From 85b380fcb5ac42d74bede9baa9b94c31b375208e Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 3 Jul 2012 15:41:02 +0200 Subject: core: moved Gobi API sources and utils to their own subdirectories --- gobi-api/GobiAPI_1.0.40/AUTHORS | 0 gobi-api/GobiAPI_1.0.40/COPYING | 27 + gobi-api/GobiAPI_1.0.40/ChangeLog | 0 gobi-api/GobiAPI_1.0.40/Core/BitPacker.cpp | 555 + gobi-api/GobiAPI_1.0.40/Core/BitPacker.h | 183 + gobi-api/GobiAPI_1.0.40/Core/BitParser.cpp | 578 + gobi-api/GobiAPI_1.0.40/Core/BitParser.h | 198 + gobi-api/GobiAPI_1.0.40/Core/CRC.cpp | 180 + gobi-api/GobiAPI_1.0.40/Core/CRC.h | 75 + gobi-api/GobiAPI_1.0.40/Core/Comm.cpp | 643 + gobi-api/GobiAPI_1.0.40/Core/Comm.h | 159 + gobi-api/GobiAPI_1.0.40/Core/CoreDatabase.cpp | 3187 +++ gobi-api/GobiAPI_1.0.40/Core/CoreDatabase.h | 2127 ++ gobi-api/GobiAPI_1.0.40/Core/CoreUtilities.cpp | 1853 ++ gobi-api/GobiAPI_1.0.40/Core/CoreUtilities.h | 657 + gobi-api/GobiAPI_1.0.40/Core/DB2NavTree.cpp | 434 + gobi-api/GobiAPI_1.0.40/Core/DB2NavTree.h | 136 + gobi-api/GobiAPI_1.0.40/Core/DB2TextFile.cpp | 253 + gobi-api/GobiAPI_1.0.40/Core/DB2TextFile.h | 110 + gobi-api/GobiAPI_1.0.40/Core/DB2Utilities.cpp | 907 + gobi-api/GobiAPI_1.0.40/Core/DB2Utilities.h | 268 + gobi-api/GobiAPI_1.0.40/Core/DataPacker.cpp | 831 + gobi-api/GobiAPI_1.0.40/Core/DataPacker.h | 216 + gobi-api/GobiAPI_1.0.40/Core/DataParser.cpp | 1118 + gobi-api/GobiAPI_1.0.40/Core/DataParser.h | 399 + gobi-api/GobiAPI_1.0.40/Core/Event.cpp | 437 + gobi-api/GobiAPI_1.0.40/Core/Event.h | 117 + gobi-api/GobiAPI_1.0.40/Core/HDLC.cpp | 304 + gobi-api/GobiAPI_1.0.40/Core/HDLC.h | 70 + .../GobiAPI_1.0.40/Core/HDLCProtocolServer.cpp | 323 + gobi-api/GobiAPI_1.0.40/Core/HDLCProtocolServer.h | 107 + gobi-api/GobiAPI_1.0.40/Core/Makefile.am | 58 + gobi-api/GobiAPI_1.0.40/Core/MemoryMappedFile.cpp | 183 + gobi-api/GobiAPI_1.0.40/Core/MemoryMappedFile.h | 120 + gobi-api/GobiAPI_1.0.40/Core/ProtocolBuffer.cpp | 222 + gobi-api/GobiAPI_1.0.40/Core/ProtocolBuffer.h | 162 + .../Core/ProtocolEntityFieldEnumerator.h | 139 + gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityNav.cpp | 997 + gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityNav.h | 246 + gobi-api/GobiAPI_1.0.40/Core/ProtocolEnum.h | 214 + gobi-api/GobiAPI_1.0.40/Core/ProtocolLog.cpp | 190 + gobi-api/GobiAPI_1.0.40/Core/ProtocolLog.h | 91 + .../GobiAPI_1.0.40/Core/ProtocolNotification.cpp | 171 + .../GobiAPI_1.0.40/Core/ProtocolNotification.h | 237 + gobi-api/GobiAPI_1.0.40/Core/ProtocolRequest.cpp | 254 + gobi-api/GobiAPI_1.0.40/Core/ProtocolRequest.h | 193 + gobi-api/GobiAPI_1.0.40/Core/ProtocolServer.cpp | 1720 ++ gobi-api/GobiAPI_1.0.40/Core/ProtocolServer.h | 351 + gobi-api/GobiAPI_1.0.40/Core/QDLBuffers.cpp | 1093 + gobi-api/GobiAPI_1.0.40/Core/QDLBuffers.h | 716 + gobi-api/GobiAPI_1.0.40/Core/QDLEnum.h | 428 + gobi-api/GobiAPI_1.0.40/Core/QDLProtocolServer.cpp | 269 + gobi-api/GobiAPI_1.0.40/Core/QDLProtocolServer.h | 77 + gobi-api/GobiAPI_1.0.40/Core/QMIBuffers.cpp | 366 + gobi-api/GobiAPI_1.0.40/Core/QMIBuffers.h | 379 + gobi-api/GobiAPI_1.0.40/Core/QMIEnum.h | 1149 + gobi-api/GobiAPI_1.0.40/Core/QMIProtocolServer.cpp | 424 + gobi-api/GobiAPI_1.0.40/Core/QMIProtocolServer.h | 128 + gobi-api/GobiAPI_1.0.40/Core/SharedBuffer.cpp | 382 + gobi-api/GobiAPI_1.0.40/Core/SharedBuffer.h | 166 + gobi-api/GobiAPI_1.0.40/Core/StdAfx.h | 175 + gobi-api/GobiAPI_1.0.40/Core/SyncQueue.h | 419 + gobi-api/GobiAPI_1.0.40/Database/Makefile.am | 2 + gobi-api/GobiAPI_1.0.40/Database/QMI/Entity.txt | 964 + gobi-api/GobiAPI_1.0.40/Database/QMI/Enum.txt | 147 + gobi-api/GobiAPI_1.0.40/Database/QMI/EnumEntry.txt | 916 + gobi-api/GobiAPI_1.0.40/Database/QMI/Field.txt | 967 + gobi-api/GobiAPI_1.0.40/Database/QMI/Makefile.am | 17 + gobi-api/GobiAPI_1.0.40/Database/QMI/Struct.txt | 1317 + gobi-api/GobiAPI_1.0.40/Database/QMI/foo.c | 0 .../GobiConnectionMgmt/GobiConnectionMgmt.cpp | 2882 +++ .../GobiConnectionMgmt/GobiConnectionMgmt.h | 1370 + .../GobiConnectionMgmt/GobiConnectionMgmtAPI.h | 3329 +++ .../GobiConnectionMgmtExports.cpp | 5021 ++++ .../GobiAPI_1.0.40/GobiConnectionMgmt/Makefile.am | 31 + .../GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmt.cpp | 315 + .../GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmt.h | 186 + .../GobiImageMgmt/GobiImageMgmtAPI.h | 416 + .../GobiImageMgmt/GobiImageMgmtExports.cpp | 923 + gobi-api/GobiAPI_1.0.40/GobiImageMgmt/Makefile.am | 31 + .../GobiQDLService/99-GobiQDLService.rules | 40 + gobi-api/GobiAPI_1.0.40/GobiQDLService/Main.cpp | 205 + gobi-api/GobiAPI_1.0.40/GobiQDLService/Makefile.am | 28 + gobi-api/GobiAPI_1.0.40/INSTALL | 365 + gobi-api/GobiAPI_1.0.40/Makefile.am | 9 + gobi-api/GobiAPI_1.0.40/NEWS | 0 gobi-api/GobiAPI_1.0.40/README | 0 gobi-api/GobiAPI_1.0.40/Shared/GobiError.h | 147 + .../GobiAPI_1.0.40/Shared/GobiImageDefinitions.h | 176 + gobi-api/GobiAPI_1.0.40/Shared/GobiMBNMgmt.cpp | 943 + gobi-api/GobiAPI_1.0.40/Shared/GobiMBNMgmt.h | 226 + gobi-api/GobiAPI_1.0.40/Shared/GobiQDLCore.cpp | 943 + gobi-api/GobiAPI_1.0.40/Shared/GobiQDLCore.h | 168 + gobi-api/GobiAPI_1.0.40/Shared/GobiQMICore.cpp | 1018 + gobi-api/GobiAPI_1.0.40/Shared/GobiQMICore.h | 1028 + gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreCAT.cpp | 219 + gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreDMS.cpp | 2050 ++ gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreImg.cpp | 656 + .../GobiAPI_1.0.40/Shared/GobiQMICoreImg2k.cpp | 562 + gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreNAS.cpp | 1986 ++ gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreOMA.cpp | 535 + gobi-api/GobiAPI_1.0.40/Shared/GobiQMICorePDS.cpp | 1292 + gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreRMS.cpp | 187 + gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreSMS.cpp | 940 + gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreUIM.cpp | 965 + gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreWDS.cpp | 2804 ++ gobi-api/GobiAPI_1.0.40/Shared/GobiQMIVoice.cpp | 205 + gobi-api/GobiAPI_1.0.40/Shared/Makefile.am | 41 + gobi-api/GobiAPI_1.0.40/autogen.sh | 23 + gobi-api/GobiAPI_1.0.40/configure.ac | 30 + gobi-api/Gobi_2011-11-28-1533/Core/Comm.cpp | 643 + gobi-api/Gobi_2011-11-28-1533/Core/Comm.h | 159 + gobi-api/Gobi_2011-11-28-1533/Core/Event.cpp | 437 + gobi-api/Gobi_2011-11-28-1533/Core/Event.h | 117 + .../Gobi_2011-11-28-1533/Core/ProtocolBuffer.cpp | 222 + .../Gobi_2011-11-28-1533/Core/ProtocolBuffer.h | 162 + gobi-api/Gobi_2011-11-28-1533/Core/ProtocolEnum.h | 236 + gobi-api/Gobi_2011-11-28-1533/Core/ProtocolLog.cpp | 190 + gobi-api/Gobi_2011-11-28-1533/Core/ProtocolLog.h | 91 + .../Core/ProtocolNotification.cpp | 171 + .../Core/ProtocolNotification.h | 237 + .../Gobi_2011-11-28-1533/Core/ProtocolRequest.cpp | 254 + .../Gobi_2011-11-28-1533/Core/ProtocolRequest.h | 193 + .../Gobi_2011-11-28-1533/Core/ProtocolServer.cpp | 1728 ++ .../Gobi_2011-11-28-1533/Core/ProtocolServer.h | 351 + gobi-api/Gobi_2011-11-28-1533/Core/QMIBuffers.cpp | 366 + gobi-api/Gobi_2011-11-28-1533/Core/QMIBuffers.h | 391 + gobi-api/Gobi_2011-11-28-1533/Core/QMIEnum.h | 1691 ++ .../Core/QMIProtocolServer.cpp | 378 + .../Gobi_2011-11-28-1533/Core/QMIProtocolServer.h | 116 + .../Gobi_2011-11-28-1533/Core/SharedBuffer.cpp | 375 + gobi-api/Gobi_2011-11-28-1533/Core/SharedBuffer.h | 166 + gobi-api/Gobi_2011-11-28-1533/Core/StdAfx.h | 176 + gobi-api/Gobi_2011-11-28-1533/Core/SyncQueue.h | 419 + .../Gobi3000Translation/Gobi3000Translation.cpp | 101 + .../Gobi3000Translation/Gobi3000Translation.h | 1028 + .../Gobi3000Translation/Gobi3000TranslationCAT.cpp | 177 + .../Gobi3000Translation/Gobi3000TranslationDMS.cpp | 1483 ++ .../Gobi3000Translation/Gobi3000TranslationNAS.cpp | 2022 ++ .../Gobi3000Translation/Gobi3000TranslationOMA.cpp | 481 + .../Gobi3000Translation/Gobi3000TranslationPDS.cpp | 1207 + .../Gobi3000Translation/Gobi3000TranslationRMS.cpp | 188 + .../Gobi3000Translation/Gobi3000TranslationUIM.cpp | 1170 + .../Gobi3000TranslationVoice.cpp | 174 + .../Gobi3000Translation/Gobi3000TranslationWDS.cpp | 3486 +++ .../Gobi3000Translation/Gobi3000TranslationWMS.cpp | 1121 + .../GobiConnectionMgmt/GobiConnectionMgmt.cpp | 606 + .../GobiConnectionMgmt/GobiConnectionMgmt.h | 270 + .../GobiConnectionMgmt/GobiConnectionMgmtAPI.h | 12502 +++++++++ .../GobiConnectionMgmtAPIEnums.h | 4259 +++ .../GobiConnectionMgmtAPIStructs.h | 22117 ++++++++++++++++ .../GobiConnectionMgmtExports.cpp | 17234 +++++++++++++ gobi-api/Gobi_2011-11-28-1533/Readme.txt | 38 + gobi-api/Gobi_2011-11-28-1533/Shared/GobiError.h | 137 + .../Gobi_2011-11-28-1533/Shared/GobiQMICore.cpp | 531 + gobi-api/Gobi_2011-11-28-1533/Shared/GobiQMICore.h | 192 + gobi-api/Gobi_2012-06-18-1054/Core/Comm.cpp | 642 + gobi-api/Gobi_2012-06-18-1054/Core/Comm.h | 139 + gobi-api/Gobi_2012-06-18-1054/Core/Connection.h | 149 + gobi-api/Gobi_2012-06-18-1054/Core/Event.cpp | 437 + gobi-api/Gobi_2012-06-18-1054/Core/Event.h | 117 + .../Gobi_2012-06-18-1054/Core/ProtocolBuffer.cpp | 222 + .../Gobi_2012-06-18-1054/Core/ProtocolBuffer.h | 162 + gobi-api/Gobi_2012-06-18-1054/Core/ProtocolEnum.h | 244 + gobi-api/Gobi_2012-06-18-1054/Core/ProtocolLog.cpp | 190 + gobi-api/Gobi_2012-06-18-1054/Core/ProtocolLog.h | 91 + .../Core/ProtocolNotification.cpp | 171 + .../Core/ProtocolNotification.h | 237 + .../Gobi_2012-06-18-1054/Core/ProtocolRequest.cpp | 254 + .../Gobi_2012-06-18-1054/Core/ProtocolRequest.h | 193 + .../Gobi_2012-06-18-1054/Core/ProtocolServer.cpp | 1750 ++ .../Gobi_2012-06-18-1054/Core/ProtocolServer.h | 363 + gobi-api/Gobi_2012-06-18-1054/Core/QMIBuffers.cpp | 366 + gobi-api/Gobi_2012-06-18-1054/Core/QMIBuffers.h | 391 + gobi-api/Gobi_2012-06-18-1054/Core/QMIEnum.h | 1722 ++ .../Core/QMIProtocolServer.cpp | 415 + .../Gobi_2012-06-18-1054/Core/QMIProtocolServer.h | 116 + .../Gobi_2012-06-18-1054/Core/SharedBuffer.cpp | 375 + gobi-api/Gobi_2012-06-18-1054/Core/SharedBuffer.h | 166 + gobi-api/Gobi_2012-06-18-1054/Core/Socket.cpp | 807 + gobi-api/Gobi_2012-06-18-1054/Core/Socket.h | 164 + gobi-api/Gobi_2012-06-18-1054/Core/StdAfx.h | 200 + gobi-api/Gobi_2012-06-18-1054/Core/SyncQueue.h | 419 + .../Gobi3000Translation/Gobi3000Translation.cpp | 101 + .../Gobi3000Translation/Gobi3000Translation.h | 1028 + .../Gobi3000Translation/Gobi3000TranslationCAT.cpp | 177 + .../Gobi3000Translation/Gobi3000TranslationDMS.cpp | 1483 ++ .../Gobi3000Translation/Gobi3000TranslationNAS.cpp | 2022 ++ .../Gobi3000Translation/Gobi3000TranslationOMA.cpp | 481 + .../Gobi3000Translation/Gobi3000TranslationPDS.cpp | 1207 + .../Gobi3000Translation/Gobi3000TranslationRMS.cpp | 188 + .../Gobi3000Translation/Gobi3000TranslationUIM.cpp | 1170 + .../Gobi3000TranslationVoice.cpp | 174 + .../Gobi3000Translation/Gobi3000TranslationWDS.cpp | 3486 +++ .../Gobi3000Translation/Gobi3000TranslationWMS.cpp | 1121 + .../GobiConnectionMgmt/GobiConnectionMgmt.cpp | 606 + .../GobiConnectionMgmt/GobiConnectionMgmt.h | 270 + .../GobiConnectionMgmt/GobiConnectionMgmtAPI.h | 14155 ++++++++++ .../GobiConnectionMgmtAPIEnums.h | 4829 ++++ .../GobiConnectionMgmtAPIStructs.h | 25670 +++++++++++++++++++ .../GobiConnectionMgmtExports.cpp | 19515 ++++++++++++++ .../GobiSampleCM/GobiCMCallback.cpp | 309 + .../GobiSampleCM/GobiCMCallback.h | 83 + .../GobiSampleCM/GobiCMDLL.cpp | 1239 + .../Gobi_2012-06-18-1054/GobiSampleCM/GobiCMDLL.h | 266 + .../GobiSampleCM/QTSampleCM.cpp | 316 + .../Gobi_2012-06-18-1054/GobiSampleCM/QTSampleCM.h | 459 + .../Gobi_2012-06-18-1054/GobiSampleCM/SampleCM.cpp | 1735 ++ .../Gobi_2012-06-18-1054/GobiSampleCM/SampleCM.h | 398 + .../android/assets/qml/GobiSampleCM/Connect.png | Bin 0 -> 5034 bytes .../android/assets/qml/GobiSampleCM/Info.png | Bin 0 -> 4686 bytes .../android/assets/qml/GobiSampleCM/main.qml | 823 + .../GobiSampleCM/android/res/drawable/icon.png | Bin 0 -> 8993 bytes .../GobiSampleCM/android/res/drawable/logo.png | Bin 0 -> 427576 bytes .../Gobi_2012-06-18-1054/GobiSampleCM/main.cpp | 45 + .../GobiSampleCM/qml/GobiSampleCM/Connect.png | Bin 0 -> 5034 bytes .../GobiSampleCM/qml/GobiSampleCM/Info.png | Bin 0 -> 4686 bytes .../GobiSampleCM/qml/GobiSampleCM/main.qml | 823 + gobi-api/Gobi_2012-06-18-1054/Readme.txt | 69 + gobi-api/Gobi_2012-06-18-1054/Shared/GobiError.h | 137 + .../Gobi_2012-06-18-1054/Shared/GobiQMICore.cpp | 531 + gobi-api/Gobi_2012-06-18-1054/Shared/GobiQMICore.h | 192 + gobi-api/fixed-GobiAPI-1.0.40/COPYING | 27 + gobi-api/fixed-GobiAPI-1.0.40/Core/BitPacker.cpp | 555 + gobi-api/fixed-GobiAPI-1.0.40/Core/BitPacker.h | 183 + gobi-api/fixed-GobiAPI-1.0.40/Core/BitParser.cpp | 578 + gobi-api/fixed-GobiAPI-1.0.40/Core/BitParser.h | 198 + gobi-api/fixed-GobiAPI-1.0.40/Core/CRC.cpp | 180 + gobi-api/fixed-GobiAPI-1.0.40/Core/CRC.h | 75 + gobi-api/fixed-GobiAPI-1.0.40/Core/Comm.cpp | 551 + gobi-api/fixed-GobiAPI-1.0.40/Core/Comm.h | 153 + .../fixed-GobiAPI-1.0.40/Core/CoreDatabase.cpp | 3187 +++ gobi-api/fixed-GobiAPI-1.0.40/Core/CoreDatabase.h | 2127 ++ .../fixed-GobiAPI-1.0.40/Core/CoreUtilities.cpp | 1751 ++ gobi-api/fixed-GobiAPI-1.0.40/Core/CoreUtilities.h | 649 + gobi-api/fixed-GobiAPI-1.0.40/Core/DB2NavTree.cpp | 434 + gobi-api/fixed-GobiAPI-1.0.40/Core/DB2NavTree.h | 136 + gobi-api/fixed-GobiAPI-1.0.40/Core/DB2TextFile.cpp | 253 + gobi-api/fixed-GobiAPI-1.0.40/Core/DB2TextFile.h | 110 + .../fixed-GobiAPI-1.0.40/Core/DB2Utilities.cpp | 899 + gobi-api/fixed-GobiAPI-1.0.40/Core/DB2Utilities.h | 268 + gobi-api/fixed-GobiAPI-1.0.40/Core/DataPacker.cpp | 831 + gobi-api/fixed-GobiAPI-1.0.40/Core/DataPacker.h | 216 + gobi-api/fixed-GobiAPI-1.0.40/Core/DataParser.cpp | 1118 + gobi-api/fixed-GobiAPI-1.0.40/Core/DataParser.h | 399 + gobi-api/fixed-GobiAPI-1.0.40/Core/Event.cpp | 443 + gobi-api/fixed-GobiAPI-1.0.40/Core/Event.h | 117 + gobi-api/fixed-GobiAPI-1.0.40/Core/HDLC.cpp | 304 + gobi-api/fixed-GobiAPI-1.0.40/Core/HDLC.h | 70 + .../Core/HDLCProtocolServer.cpp | 323 + .../fixed-GobiAPI-1.0.40/Core/HDLCProtocolServer.h | 107 + gobi-api/fixed-GobiAPI-1.0.40/Core/Makefile.am | 71 + .../fixed-GobiAPI-1.0.40/Core/MemoryMappedFile.cpp | 183 + .../fixed-GobiAPI-1.0.40/Core/MemoryMappedFile.h | 120 + .../fixed-GobiAPI-1.0.40/Core/ProtocolBuffer.cpp | 222 + .../fixed-GobiAPI-1.0.40/Core/ProtocolBuffer.h | 162 + .../Core/ProtocolEntityFieldEnumerator.h | 139 + .../Core/ProtocolEntityNav.cpp | 997 + .../fixed-GobiAPI-1.0.40/Core/ProtocolEntityNav.h | 246 + gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEnum.h | 214 + gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolLog.cpp | 190 + gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolLog.h | 91 + .../Core/ProtocolNotification.cpp | 171 + .../Core/ProtocolNotification.h | 237 + .../fixed-GobiAPI-1.0.40/Core/ProtocolRequest.cpp | 254 + .../fixed-GobiAPI-1.0.40/Core/ProtocolRequest.h | 193 + .../fixed-GobiAPI-1.0.40/Core/ProtocolServer.cpp | 1700 ++ .../fixed-GobiAPI-1.0.40/Core/ProtocolServer.h | 351 + gobi-api/fixed-GobiAPI-1.0.40/Core/QDLBuffers.cpp | 1093 + gobi-api/fixed-GobiAPI-1.0.40/Core/QDLBuffers.h | 716 + gobi-api/fixed-GobiAPI-1.0.40/Core/QDLEnum.h | 428 + .../Core/QDLProtocolServer.cpp | 269 + .../fixed-GobiAPI-1.0.40/Core/QDLProtocolServer.h | 77 + gobi-api/fixed-GobiAPI-1.0.40/Core/QMIBuffers.cpp | 366 + gobi-api/fixed-GobiAPI-1.0.40/Core/QMIBuffers.h | 379 + gobi-api/fixed-GobiAPI-1.0.40/Core/QMIEnum.h | 1149 + .../Core/QMIProtocolServer.cpp | 425 + .../fixed-GobiAPI-1.0.40/Core/QMIProtocolServer.h | 128 + .../fixed-GobiAPI-1.0.40/Core/SharedBuffer.cpp | 382 + gobi-api/fixed-GobiAPI-1.0.40/Core/SharedBuffer.h | 166 + gobi-api/fixed-GobiAPI-1.0.40/Core/StdAfx.h | 172 + gobi-api/fixed-GobiAPI-1.0.40/Core/SyncQueue.h | 419 + gobi-api/fixed-GobiAPI-1.0.40/Core/apidefs.h | 21 + gobi-api/fixed-GobiAPI-1.0.40/Core/types.h | 16 + gobi-api/fixed-GobiAPI-1.0.40/Database/Makefile.am | 2 + .../fixed-GobiAPI-1.0.40/Database/QMI/Entity.txt | 964 + .../fixed-GobiAPI-1.0.40/Database/QMI/Enum.txt | 147 + .../Database/QMI/EnumEntry.txt | 916 + .../fixed-GobiAPI-1.0.40/Database/QMI/Field.txt | 967 + .../fixed-GobiAPI-1.0.40/Database/QMI/Makefile.am | 19 + .../fixed-GobiAPI-1.0.40/Database/QMI/Struct.txt | 1317 + gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/foo.c | 0 .../GobiConnectionMgmt/GobiConnectionMgmt.cpp | 2882 +++ .../GobiConnectionMgmt/GobiConnectionMgmt.h | 1370 + .../GobiConnectionMgmt/GobiConnectionMgmtAPI.h | 3319 +++ .../GobiConnectionMgmtExports.cpp | 5030 ++++ .../GobiConnectionMgmt/Makefile.am | 32 + .../GobiImageMgmt/GobiImageMgmt.cpp | 315 + .../GobiImageMgmt/GobiImageMgmt.h | 186 + .../GobiImageMgmt/GobiImageMgmtAPI.h | 403 + .../GobiImageMgmt/GobiImageMgmtExports.cpp | 923 + .../fixed-GobiAPI-1.0.40/GobiImageMgmt/Makefile.am | 32 + .../GobiQDLService/99-GobiQDLService.rules | 40 + .../fixed-GobiAPI-1.0.40/GobiQDLService/Main.cpp | 206 + .../GobiQDLService/Makefile.am | 31 + gobi-api/fixed-GobiAPI-1.0.40/Makefile.am | 9 + gobi-api/fixed-GobiAPI-1.0.40/NEWS | 0 gobi-api/fixed-GobiAPI-1.0.40/README | 0 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiError.h | 147 + .../Shared/GobiImageDefinitions.h | 176 + .../fixed-GobiAPI-1.0.40/Shared/GobiMBNMgmt.cpp | 1017 + gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiMBNMgmt.h | 230 + .../fixed-GobiAPI-1.0.40/Shared/GobiQDLCore.cpp | 913 + gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQDLCore.h | 167 + .../fixed-GobiAPI-1.0.40/Shared/GobiQMICore.cpp | 1042 + gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICore.h | 1036 + .../fixed-GobiAPI-1.0.40/Shared/GobiQMICoreCAT.cpp | 219 + .../fixed-GobiAPI-1.0.40/Shared/GobiQMICoreDMS.cpp | 2050 ++ .../fixed-GobiAPI-1.0.40/Shared/GobiQMICoreImg.cpp | 656 + .../Shared/GobiQMICoreImg2k.cpp | 523 + .../fixed-GobiAPI-1.0.40/Shared/GobiQMICoreNAS.cpp | 1986 ++ .../fixed-GobiAPI-1.0.40/Shared/GobiQMICoreOMA.cpp | 535 + .../fixed-GobiAPI-1.0.40/Shared/GobiQMICorePDS.cpp | 1292 + .../fixed-GobiAPI-1.0.40/Shared/GobiQMICoreRMS.cpp | 187 + .../fixed-GobiAPI-1.0.40/Shared/GobiQMICoreSMS.cpp | 940 + .../fixed-GobiAPI-1.0.40/Shared/GobiQMICoreUIM.cpp | 965 + .../fixed-GobiAPI-1.0.40/Shared/GobiQMICoreWDS.cpp | 2804 ++ .../fixed-GobiAPI-1.0.40/Shared/GobiQMIVoice.cpp | 205 + gobi-api/fixed-GobiAPI-1.0.40/Shared/Makefile.am | 41 + gobi-api/fixed-GobiAPI-1.0.40/autogen.sh | 23 + gobi-api/fixed-GobiAPI-1.0.40/configure.ac | 30 + 331 files changed, 304482 insertions(+) create mode 100644 gobi-api/GobiAPI_1.0.40/AUTHORS create mode 100644 gobi-api/GobiAPI_1.0.40/COPYING create mode 100644 gobi-api/GobiAPI_1.0.40/ChangeLog create mode 100755 gobi-api/GobiAPI_1.0.40/Core/BitPacker.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/BitPacker.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/BitParser.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/BitParser.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/CRC.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/CRC.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/Comm.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/Comm.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/CoreDatabase.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/CoreDatabase.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/CoreUtilities.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/CoreUtilities.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/DB2NavTree.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/DB2NavTree.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/DB2TextFile.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/DB2TextFile.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/DB2Utilities.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/DB2Utilities.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/DataPacker.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/DataPacker.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/DataParser.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/DataParser.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/Event.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/Event.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/HDLC.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/HDLC.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/HDLCProtocolServer.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/HDLCProtocolServer.h create mode 100644 gobi-api/GobiAPI_1.0.40/Core/Makefile.am create mode 100755 gobi-api/GobiAPI_1.0.40/Core/MemoryMappedFile.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/MemoryMappedFile.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolBuffer.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolBuffer.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityFieldEnumerator.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityNav.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityNav.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolEnum.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolLog.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolLog.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolNotification.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolNotification.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolRequest.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolRequest.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolServer.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/ProtocolServer.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/QDLBuffers.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/QDLBuffers.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/QDLEnum.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/QDLProtocolServer.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/QDLProtocolServer.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/QMIBuffers.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/QMIBuffers.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/QMIEnum.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/QMIProtocolServer.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/QMIProtocolServer.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/SharedBuffer.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Core/SharedBuffer.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/StdAfx.h create mode 100755 gobi-api/GobiAPI_1.0.40/Core/SyncQueue.h create mode 100644 gobi-api/GobiAPI_1.0.40/Database/Makefile.am create mode 100755 gobi-api/GobiAPI_1.0.40/Database/QMI/Entity.txt create mode 100755 gobi-api/GobiAPI_1.0.40/Database/QMI/Enum.txt create mode 100755 gobi-api/GobiAPI_1.0.40/Database/QMI/EnumEntry.txt create mode 100755 gobi-api/GobiAPI_1.0.40/Database/QMI/Field.txt create mode 100644 gobi-api/GobiAPI_1.0.40/Database/QMI/Makefile.am create mode 100755 gobi-api/GobiAPI_1.0.40/Database/QMI/Struct.txt create mode 100644 gobi-api/GobiAPI_1.0.40/Database/QMI/foo.c create mode 100755 gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.h create mode 100755 gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmtAPI.h create mode 100755 gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp create mode 100644 gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/Makefile.am create mode 100755 gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmt.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmt.h create mode 100755 gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmtAPI.h create mode 100755 gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmtExports.cpp create mode 100644 gobi-api/GobiAPI_1.0.40/GobiImageMgmt/Makefile.am create mode 100755 gobi-api/GobiAPI_1.0.40/GobiQDLService/99-GobiQDLService.rules create mode 100755 gobi-api/GobiAPI_1.0.40/GobiQDLService/Main.cpp create mode 100644 gobi-api/GobiAPI_1.0.40/GobiQDLService/Makefile.am create mode 100644 gobi-api/GobiAPI_1.0.40/INSTALL create mode 100644 gobi-api/GobiAPI_1.0.40/Makefile.am create mode 100644 gobi-api/GobiAPI_1.0.40/NEWS create mode 100644 gobi-api/GobiAPI_1.0.40/README create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiError.h create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiImageDefinitions.h create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiMBNMgmt.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiMBNMgmt.h create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQDLCore.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQDLCore.h create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICore.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICore.h create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreCAT.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreDMS.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreImg.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreImg2k.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreNAS.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreOMA.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICorePDS.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreRMS.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreSMS.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreUIM.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreWDS.cpp create mode 100755 gobi-api/GobiAPI_1.0.40/Shared/GobiQMIVoice.cpp create mode 100644 gobi-api/GobiAPI_1.0.40/Shared/Makefile.am create mode 100755 gobi-api/GobiAPI_1.0.40/autogen.sh create mode 100644 gobi-api/GobiAPI_1.0.40/configure.ac create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/Comm.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/Comm.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/Event.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/Event.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/ProtocolBuffer.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/ProtocolBuffer.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/ProtocolEnum.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/ProtocolLog.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/ProtocolLog.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/ProtocolNotification.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/ProtocolNotification.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/ProtocolRequest.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/ProtocolRequest.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/ProtocolServer.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/ProtocolServer.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/QMIBuffers.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/QMIBuffers.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/QMIEnum.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/QMIProtocolServer.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/QMIProtocolServer.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/SharedBuffer.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/SharedBuffer.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/StdAfx.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Core/SyncQueue.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000Translation.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000Translation.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationCAT.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationDMS.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationNAS.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationOMA.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationPDS.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationRMS.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationUIM.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationVoice.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationWDS.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationWMS.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmt.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmt.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPI.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPIEnums.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPIStructs.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Readme.txt create mode 100755 gobi-api/Gobi_2011-11-28-1533/Shared/GobiError.h create mode 100755 gobi-api/Gobi_2011-11-28-1533/Shared/GobiQMICore.cpp create mode 100755 gobi-api/Gobi_2011-11-28-1533/Shared/GobiQMICore.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/Comm.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/Comm.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/Connection.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/Event.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/Event.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/ProtocolBuffer.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/ProtocolBuffer.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/ProtocolEnum.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/ProtocolLog.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/ProtocolLog.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/ProtocolNotification.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/ProtocolNotification.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/ProtocolRequest.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/ProtocolRequest.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/ProtocolServer.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/ProtocolServer.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/QMIBuffers.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/QMIBuffers.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/QMIEnum.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/QMIProtocolServer.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/QMIProtocolServer.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/SharedBuffer.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/SharedBuffer.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/Socket.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/Socket.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/StdAfx.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Core/SyncQueue.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000Translation.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000Translation.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationCAT.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationDMS.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationNAS.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationOMA.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationPDS.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationRMS.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationUIM.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationVoice.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationWDS.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationWMS.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmt.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmt.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPI.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPIEnums.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPIStructs.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMCallback.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMCallback.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMDLL.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMDLL.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/QTSampleCM.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/QTSampleCM.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/SampleCM.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/SampleCM.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/Connect.png create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/Info.png create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/main.qml create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/res/drawable/icon.png create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/res/drawable/logo.png create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/main.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/Connect.png create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/Info.png create mode 100755 gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/main.qml create mode 100755 gobi-api/Gobi_2012-06-18-1054/Readme.txt create mode 100755 gobi-api/Gobi_2012-06-18-1054/Shared/GobiError.h create mode 100755 gobi-api/Gobi_2012-06-18-1054/Shared/GobiQMICore.cpp create mode 100755 gobi-api/Gobi_2012-06-18-1054/Shared/GobiQMICore.h create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/COPYING create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/BitPacker.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/BitPacker.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/BitParser.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/BitParser.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/CRC.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/CRC.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/Comm.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/Comm.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/CoreDatabase.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/CoreDatabase.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/CoreUtilities.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/CoreUtilities.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/DB2NavTree.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/DB2NavTree.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/DB2TextFile.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/DB2TextFile.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/DB2Utilities.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/DB2Utilities.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/DataPacker.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/DataPacker.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/DataParser.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/DataParser.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/Event.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/Event.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/HDLC.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/HDLC.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/HDLCProtocolServer.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/HDLCProtocolServer.h create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/Core/Makefile.am create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/MemoryMappedFile.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/MemoryMappedFile.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolBuffer.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolBuffer.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityFieldEnumerator.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityNav.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityNav.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEnum.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolLog.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolLog.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolNotification.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolNotification.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolRequest.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolRequest.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolServer.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolServer.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/QDLBuffers.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/QDLBuffers.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/QDLEnum.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/QDLProtocolServer.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/QDLProtocolServer.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/QMIBuffers.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/QMIBuffers.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/QMIEnum.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/QMIProtocolServer.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/QMIProtocolServer.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/SharedBuffer.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/SharedBuffer.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/StdAfx.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Core/SyncQueue.h create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/Core/apidefs.h create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/Core/types.h create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/Database/Makefile.am create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Entity.txt create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Enum.txt create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/EnumEntry.txt create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Field.txt create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Makefile.am create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Struct.txt create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/foo.c create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmtAPI.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/Makefile.am create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmt.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmt.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmtAPI.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmtExports.cpp create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/Makefile.am create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/99-GobiQDLService.rules create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/Main.cpp create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/Makefile.am create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/Makefile.am create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/NEWS create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/README create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiError.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiImageDefinitions.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiMBNMgmt.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiMBNMgmt.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQDLCore.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQDLCore.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICore.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICore.h create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreCAT.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreDMS.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreImg.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreImg2k.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreNAS.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreOMA.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICorePDS.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreRMS.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreSMS.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreUIM.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreWDS.cpp create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMIVoice.cpp create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/Shared/Makefile.am create mode 100755 gobi-api/fixed-GobiAPI-1.0.40/autogen.sh create mode 100644 gobi-api/fixed-GobiAPI-1.0.40/configure.ac (limited to 'gobi-api') diff --git a/gobi-api/GobiAPI_1.0.40/AUTHORS b/gobi-api/GobiAPI_1.0.40/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/gobi-api/GobiAPI_1.0.40/COPYING b/gobi-api/GobiAPI_1.0.40/COPYING new file mode 100644 index 0000000..1a73aa4 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/COPYING @@ -0,0 +1,27 @@ +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + diff --git a/gobi-api/GobiAPI_1.0.40/ChangeLog b/gobi-api/GobiAPI_1.0.40/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/gobi-api/GobiAPI_1.0.40/Core/BitPacker.cpp b/gobi-api/GobiAPI_1.0.40/Core/BitPacker.cpp new file mode 100755 index 0000000..818b2e5 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/BitPacker.cpp @@ -0,0 +1,555 @@ +/*=========================================================================== +FILE: + BitPacker.cpp + +DESCRIPTION: + Implementation of cBitPacker class + +PUBLIC CLASSES AND METHODS: + cBitPacker + This class packs bits into a buffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- + +#include "StdAfx.h" +#include "BitPacker.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + SetUnsignedVal (Public Method) + +DESCRIPTION: + Set an unsigned value in the bit source (writing least significant + bits first) + +PARAMETERS: + pData [ O ] - Data buffer to write to + currentOffset [I/O] - Current bit offset into above buffer + maxOffset [ I ] - Maximum bit offset into above buffer + numBits [ I ] - Number of bits to write + dataIn [ I ] - Input value to write + bLSB [ I ] - Pack LSB -> MSB? + +RETURN VALUE: + DWORD +===========================================================================*/ +template +DWORD SetUnsignedVal( + BYTE * pData, + ULONG & currentOffset, + ULONG maxOffset, + ULONG numBits, + T dataIn, + bool bLSB = true ) +{ + ASSERT( pData != 0 ); + + // Number of bits in the passed in type + const ULONG TYPE_BIT_COUNT = (ULONG)(sizeof( T ) * BITS_PER_BYTE); + ASSERT( numBits > 0 && numBits <= TYPE_BIT_COUNT); + + // Requesting too much? + if (currentOffset < maxOffset) + { + ULONG bitsToGo = maxOffset - currentOffset; + if (bitsToGo < numBits) + { + return ERROR_NOT_ENOUGH_MEMORY; + } + } + else if (currentOffset == maxOffset) + { + // Silly rabbit, don't bother to call us if you don't want any bits! + return ERROR_INVALID_PARAMETER; + } + else + { + return ERROR_NOT_ENOUGH_MEMORY; + } + + // Advance to first valid byte + pData += (currentOffset / BITS_PER_BYTE); + + // Since we don't really care about performance for bit packing + // (we do not anticipate this being called as frequently as bit + // parsing) we always use the generic approach + + // Reduce input to a bit array + BYTE bits[MAX_TYPE_BITS]; + + ULONG bitsExtracted = 0; + while (bitsExtracted < numBits) + { + if (bLSB == true) + { + BYTE bit = (BYTE)(dataIn & (T)1); + bits[bitsExtracted++] = bit; + } + else + { + BYTE bit = (BYTE)(dataIn & (T)1); + bits[numBits - ++bitsExtracted] = bit; + } + + dataIn >>= 1; + } + + + // Store current offset + ULONG offset = currentOffset; + + // Add in each bit - one at a time + bitsExtracted = 0; + while (bitsExtracted != numBits) + { + // How many bits are left in the current byte? + ULONG bitsLeft = BITS_PER_BYTE - (offset % BITS_PER_BYTE); + + // Shift input bit over to desired destination + BYTE tmp = bits[bitsExtracted++]; + + if (bLSB == true) + { + tmp <<= (BITS_PER_BYTE - bitsLeft); + } + else + { + tmp <<= bitsLeft - 1; + } + + *pData |= tmp; + + // Advance to next byte in buffer? + offset++; + if (offset % BITS_PER_BYTE == 0) + { + pData++; + } + } + + currentOffset += numBits; + return NO_ERROR; +} + +/*=========================================================================*/ +// cBitPacker Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cBitPacker (Public Method) + +DESCRIPTION: + Constructor (default) + +RETURN VALUE: + None +===========================================================================*/ +cBitPacker::cBitPacker() + : mpData( 0 ), + mOffset( 0 ), + mMaxAttainedOffset( 0 ), + mMaxOffset( 0 ), + mbLSB( true ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + cBitPacker (Public Method) + +DESCRIPTION: + Constructor (from a buffer) + +PARAMETERS: + pData [ I ] - Data buffer + dataBitSize [ I ] - Size of above data buffer (in bits) + +RETURN VALUE: + None +===========================================================================*/ +cBitPacker::cBitPacker( + BYTE * pData, + ULONG dataBitSize ) + : mpData( 0 ), + mOffset( 0 ), + mMaxAttainedOffset( 0 ), + mMaxOffset( 0 ), + mbLSB( true ) +{ + SetData( pData, dataBitSize ); +} + +/*=========================================================================== +METHOD: + ~cBitPacker (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cBitPacker::~cBitPacker() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a CHAR (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + CHAR dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a SHORT (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + SHORT dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a LONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + LONG dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a LONGLONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + LONGLONG dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a UCHAR (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + UCHAR dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a USHORT (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + USHORT dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a ULONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + ULONG dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a ULONGLONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + ULONGLONG dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + ReleaseData (Public Method) + +DESCRIPTION: + Release the data being parsed + +RETURN VALUE: + None +===========================================================================*/ +void cBitPacker::ReleaseData() +{ + // Clear out current buffer + mpData = 0; + mOffset = 0; + mMaxAttainedOffset = 0; + mMaxOffset = 0; +}; + +/*=========================================================================== +METHOD: + SetData (Public Method) + +DESCRIPTION: + Set the data being parsed + +PARAMETERS: + pData [ I ] - Data buffer + dataBitSize [ I ] - Size of above data buffer (in bits) + +RETURN VALUE: + None +===========================================================================*/ +void cBitPacker::SetData( + BYTE * pData, + ULONG dataBitSize ) +{ + // Release current buffer + ReleaseData(); + + // Anything to parse? + if (pData != 0) + { + // Yes + mpData = pData; + mMaxOffset = dataBitSize; + } + else + { + // No + ASSERT( mpData != 0 ); + } +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/BitPacker.h b/gobi-api/GobiAPI_1.0.40/Core/BitPacker.h new file mode 100755 index 0000000..34363d7 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/BitPacker.h @@ -0,0 +1,183 @@ +/*=========================================================================== +FILE: + BitPacker.h + +DESCRIPTION: + Declaration of cBitPacker class + +PUBLIC CLASSES AND METHODS: + cBitPacker + This class packs bits into a buffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +#include "BitParser.h" + + +/*=========================================================================*/ +// Class cBitPacker +// +// Class to assist in parsing a buffer into bit/byte specified fields +/*=========================================================================*/ +class cBitPacker +{ + public: + // Constructor (default) + cBitPacker(); + + // Constructor (from a buffer) + cBitPacker( + BYTE * pData, + ULONG dataBitSize ); + + // Destructor + ~cBitPacker(); + + // (Inline) Returns the number of bits left in the buffer (from the + // current working bit offset) + ULONG GetNumBitsLeft() const + { + return (mMaxOffset - mOffset); + }; + + // (Inline) Returns the number of bits in the buffer that have been + // written (essentially the current working bit offset) + ULONG GetNumBitsWritten() const + { + return (mOffset); + }; + + // (Inline) Returns the number of bits in the buffer that have been + // written (essentially the maximum value the working bit offset + // attained up to now) + ULONG GetTotalBitsWritten() const + { + return mMaxAttainedOffset; + }; + + // (Inline) Set current working bit offset + void SetOffset( ULONG offset ) + { + mOffset = offset; + if (mOffset > mMaxOffset) + { + mOffset = mMaxOffset; + } + + if (mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + }; + + // (Inline) Are we parsing LSB -> MSB (the default)? + bool GetLSBMode() + { + return mbLSB; + }; + + // (Inline) Parse LSB -> MSB (if true) or MSB -> LSB + void SetLSBMode( bool bLSB ) + { + mbLSB = bLSB; + }; + + // Write 'numBits' from a CHAR (advances offset) + DWORD Set( + ULONG numBits, + CHAR dataIn ); + + // Write 'numBits' from a SHORT (advances offset) + DWORD Set( + ULONG numBits, + SHORT dataIn ); + + // Write 'numBits' from a LONG (advances offset) + DWORD Set( + ULONG numBits, + LONG dataIn ); + + // Write 'numBits' from a LONGLONG (advances offset) + DWORD Set( + ULONG numBits, + LONGLONG dataIn ); + + // Write 'numBits' from a UCHAR (advances offset) + DWORD Set( + ULONG numBits, + UCHAR dataIn ); + + // Write 'numBits' from a USHORT (advances offset) + DWORD Set( + ULONG numBits, + USHORT dataIn ); + + // Write 'numBits' from a ULONG (advances offset) + DWORD Set( + ULONG numBits, + ULONG dataIn ); + + // Write 'numBits' from a ULONGLONG (advances offset) + DWORD Set( + ULONG numBits, + ULONGLONG dataIn ); + + // Release the data being parsed + void ReleaseData(); + + // Set the data being parsed + void SetData( + BYTE * pData, + ULONG dataBitSize ); + + protected: + /* Data buffer */ + BYTE * mpData; + + /* Current bit-specified offset */ + ULONG mOffset; + + /* Maximum value the above bit offset attained */ + ULONG mMaxAttainedOffset; + + /* Maximum bit-specified offset */ + ULONG mMaxOffset; + + /* Are we parsing LSB -> MSB (the default)? */ + bool mbLSB; + +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/BitParser.cpp b/gobi-api/GobiAPI_1.0.40/Core/BitParser.cpp new file mode 100755 index 0000000..a5a638e --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/BitParser.cpp @@ -0,0 +1,578 @@ +/*=========================================================================== +FILE: + BitParser.cpp + +DESCRIPTION: + Implementation of cBitParser class + +PUBLIC CLASSES AND METHODS: + cBitParser + This class extracts bits from a buffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- + +#include "StdAfx.h" +#include "BitParser.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +static BYTE MASK[BITS_PER_BYTE + 1] = +{ + 0x00, + 0x01, + 0x03, + 0x07, + 0x0F, + 0x1F, + 0x3F, + 0x7F, + 0xFF +}; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetUnsignedVal (Public Method) + +DESCRIPTION: + Get an unsigned value from the bit source (reading least significant + bits first) + +PARAMETERS: + pData [ I ] - Data buffer + currentOffset [I/O] - Current bit offset into above buffer + maxOffset [ I ] - Maximum bit offset into above buffer + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + bLSB [ I ] - Parse LSB -> MSB? + +RETURN VALUE: + DWORD +===========================================================================*/ +template +DWORD GetUnsignedVal( + const BYTE * pData, + ULONG & currentOffset, + ULONG maxOffset, + ULONG numBits, + T & dataOut, + bool bLSB = true ) +{ + ASSERT( pData != 0 ); + + // Number of bits in the passed in type + const ULONG TYPE_BIT_COUNT = (ULONG)(sizeof( T ) * BITS_PER_BYTE); + + // Bad parameters? + if (numBits == 0 || numBits > TYPE_BIT_COUNT || numBits > MAX_TYPE_BITS) + { + return ERROR_INVALID_PARAMETER; + } + + // Requesting too much? + if (currentOffset < maxOffset) + { + ULONG bitsToGo = maxOffset - currentOffset; + if (bitsToGo < numBits) + { + return ERROR_NOT_ENOUGH_MEMORY; + } + } + else + { + // No bits left! + return ERROR_NOT_ENOUGH_MEMORY; + } + + // Advance to first valid bit + pData += (currentOffset / BITS_PER_BYTE); + + // Number of bits left in current byte + ULONG bitsLeft = BITS_PER_BYTE - (currentOffset % BITS_PER_BYTE); + + if (bLSB == true) + { + // Extracting native types on byte boundaries? + if (numBits == TYPE_BIT_COUNT && bitsLeft == BITS_PER_BYTE) + { + // Yes, a simple cast will suffice + dataOut = *((T *)pData); + + currentOffset += numBits; + return NO_ERROR; + } + + // Extracting some small number of bits? + if (numBits <= bitsLeft) + { + // Yes, simply shift back to origin and AND with correct mask + BYTE tmp = *pData; + tmp >>= (BITS_PER_BYTE - bitsLeft); + tmp &= MASK[numBits]; + + dataOut = (T)tmp; + + currentOffset += numBits; + return NO_ERROR; + } + } + + // Not either of the simple cases - extract the relevant bits + // and then build the output + + // Extract bits + BYTE bits[MAX_TYPE_BITS]; + ULONG bitsExtracted = 0; + + while (bitsExtracted < numBits) + { + BYTE bit = *pData; + + if (bLSB == true) + { + bit <<= (bitsLeft - 1); + bit >>= (BITS_PER_BYTE - 1); + bits[bitsExtracted++] = bit; + } + else + { + bit >>= (bitsLeft - 1); + bit &= 0x01; + bits[numBits - ++bitsExtracted] = bit; + } + + bitsLeft--; + if (bitsLeft == 0) + { + pData++; + bitsLeft = BITS_PER_BYTE; + } + } + + // Reassemble to form output value + dataOut = 0; + T tmp = 0; + + for (ULONG b = 0; b < numBits; b++) + { + tmp = bits[b]; + tmp <<= b; + + dataOut |= tmp; + } + + currentOffset += numBits; + return NO_ERROR; +} + +/*=========================================================================== +METHOD: + GetSignedVal (Public Method) + +DESCRIPTION: + Get an signed value from the bit source (reading least significant + bits first), just gets the equivalent unsigned representation and + then sign-extends as necessary + +PARAMETERS: + pData [ I ] - Data buffer + currentOffset [I/O] - Current bit offset into above buffer + maxOffset [ I ] - Maximum bit offset into above buffer + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + bLSB [ I ] - Parse LSB -> MSB? + +RETURN VALUE: + DWORD +===========================================================================*/ +template +DWORD GetSignedVal( + const BYTE * pData, + ULONG & currentOffset, + ULONG maxOffset, + ULONG numBits, + T & dataOut, + bool bLSB = true ) +{ + DWORD rc = GetUnsignedVal( pData, + currentOffset, + maxOffset, + numBits, + dataOut, + bLSB ); + + if (rc == NO_ERROR) + { + // If the highest-order bit is one, we must sign-extend + bool bSignExtend = (numBits < (sizeof( T ) * BITS_PER_BYTE)) + && ((dataOut >> (numBits - 1)) & 1) == 1; + + if (bSignExtend == true) + { + T mask = (T)((~0) << numBits); + dataOut |= mask; + } + } + + return rc; +} + +/*=========================================================================*/ +// cBitParser Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cBitParser (Public Method) + +DESCRIPTION: + Constructor (default) + +RETURN VALUE: + None +===========================================================================*/ +cBitParser::cBitParser() + : mpData( 0 ), + mOffset( 0 ), + mMaxOffset( 0 ), + mbLSB( true ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + cBitParser (Public Method) + +DESCRIPTION: + Constructor (from a buffer) + +PARAMETERS: + pData [ I ] - Data buffer + dataBitSize [ I ] - Size of above data buffer (in bits) + +RETURN VALUE: + None +===========================================================================*/ +cBitParser::cBitParser( + const BYTE * pData, + ULONG dataBitSize ) + : mpData( 0 ), + mOffset( 0 ), + mMaxOffset( 0 ), + mbLSB( true ) +{ + SetData( pData, dataBitSize ); +} + +/*=========================================================================== +METHOD: + cBitParser (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cBitParser::~cBitParser() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a CHAR (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + CHAR & dataOut ) +{ + return GetSignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a SHORT (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + SHORT & dataOut ) +{ + return GetSignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a LONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + LONG & dataOut ) +{ + return GetSignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a LONGLONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + LONGLONG & dataOut ) +{ + return GetSignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a UCHAR (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + UCHAR & dataOut ) +{ + return GetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a USHORT (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + USHORT & dataOut ) +{ + return GetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a ULONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + ULONG & dataOut ) +{ + return GetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a ULONGLONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + ULONGLONG & dataOut ) +{ + return GetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + ReleaseData (Public Method) + +DESCRIPTION: + Release the data being parsed + +RETURN VALUE: + None +===========================================================================*/ +void cBitParser::ReleaseData() +{ + // Clear out current buffer + mpData = 0; + mOffset = 0; + mMaxOffset = 0; +}; + +/*=========================================================================== +METHOD: + SetData (Public Method) + +DESCRIPTION: + Set the data being parsed + +PARAMETERS: + pData [ I ] - Data buffer + dataBitSize [ I ] - Size of above data buffer (in bits) + +RETURN VALUE: + None +===========================================================================*/ +void cBitParser::SetData( + const BYTE * pData, + ULONG dataBitSize ) +{ + // Release current buffer + ReleaseData(); + + // Anything to parse? + if (pData != 0) + { + // Yes + mpData = pData; + mMaxOffset = dataBitSize; + } + else + { + // No + ASSERT( mpData != 0 ); + } +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/BitParser.h b/gobi-api/GobiAPI_1.0.40/Core/BitParser.h new file mode 100755 index 0000000..8f8a686 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/BitParser.h @@ -0,0 +1,198 @@ +/*=========================================================================== +FILE: + BitParser.h + +DESCRIPTION: + Declaration of cBitParser class + +PUBLIC CLASSES AND METHODS: + cBitParser + This class extracts bits from a buffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Number of bits in a byte +const ULONG BITS_PER_BYTE = 8; + +// Maximum number of bits we will parse for any supported type +const ULONG MAX_TYPE_BITS = (ULONG)sizeof(ULONGLONG) * BITS_PER_BYTE; + +/*=========================================================================== +METHOD: + ByteSwap (Inline Public Method) + +DESCRIPTION: + Changes little-endian values to big-endian, and vice versa + +PARAMETERS: + data [ I ] - Data being byte-swapped + +RETURN VALUE: + None +===========================================================================*/ +template +void ByteSwap( T & data ) +{ + // Just reverse the order of the bytes + PBYTE pL; + PBYTE pR; + + for (pL = (PBYTE)&data, pR = pL + sizeof( T ) - 1; pL < pR; ++pL, --pR) + { + *pL = *pL ^ *pR; + *pR = *pL ^ *pR; + *pL = *pL ^ *pR; + } +}; + +/*=========================================================================*/ +// Class cBitParser +// +// Class to assist in parsing a buffer into bit/byte specified fields +/*=========================================================================*/ +class cBitParser +{ + public: + // Constructor (default) + cBitParser(); + + // Constructor (from a buffer) + cBitParser( + const BYTE * pData, + ULONG dataBitSize ); + + // Destructor + ~cBitParser(); + + // (Inline) Returns the number of bits left in the buffer (from the + // current working bit offset) + ULONG GetNumBitsLeft() const + { + return (mMaxOffset - mOffset); + }; + + // (Inline) Returns the number of bits in the buffer that have been + // processed (essentially the current working bit offset) + ULONG GetNumBitsParsed() const + { + return (mOffset); + }; + + // (Inline) Set current working bit offset + void SetOffset( ULONG offset ) + { + mOffset = offset; + if (mOffset > mMaxOffset) + { + mOffset = mMaxOffset; + } + }; + + // (Inline) Are we parsing LSB -> MSB (the default)? + bool GetLSBMode() + { + return mbLSB; + }; + + // (Inline) Parse LSB -> MSB (if true) or MSB -> LSB + void SetLSBMode( bool bLSB ) + { + mbLSB = bLSB; + }; + + // Return 'numBits' as a CHAR (advances offset) + DWORD Get( + ULONG numBits, + CHAR & dataOut ); + + // Return 'numBits' as a SHORT (advances offset) + DWORD Get( + ULONG numBits, + SHORT & dataOut ); + + // Return 'numBits' as a LONG (advances offset) + DWORD Get( + ULONG numBits, + LONG & dataOut ); + + // Return 'numBits' as a LONGLONG (advances offset) + DWORD Get( + ULONG numBits, + LONGLONG & dataOut ); + + // Return 'numBits' as a UCHAR (advances offset) + DWORD Get( + ULONG numBits, + UCHAR & dataOut ); + + // Return 'numBits' as a USHORT (advances offset) + DWORD Get( + ULONG numBits, + USHORT & dataOut ); + + // Return 'numBits' as a ULONG (advances offset) + DWORD Get( + ULONG numBits, + ULONG & dataOut ); + + // Return 'numBits' as a ULONGLONG (advances offset) + DWORD Get( + ULONG numBits, + ULONGLONG & dataOut ); + + // Release the data being parsed + void ReleaseData(); + + // Set the data being parsed + void SetData( + const BYTE * pData, + ULONG dataBitSize ); + + protected: + /* Data buffer */ + const BYTE * mpData; + + /* Current bit-specified offset */ + ULONG mOffset; + + /* Maximum bit-specified offset */ + ULONG mMaxOffset; + + /* Are we parsing LSB -> MSB (the default)? */ + bool mbLSB; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/CRC.cpp b/gobi-api/GobiAPI_1.0.40/Core/CRC.cpp new file mode 100755 index 0000000..d900ee7 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/CRC.cpp @@ -0,0 +1,180 @@ +/*=========================================================================== +FILE: + CRC.cpp + +DESCRIPTION: + 16-bit LSB CRC computation/verification + +PUBLIC CLASSES AND METHODS: + SetCRC() + CheckCRC() + CalculateCRC() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//----------------------------------------------------------------------------- +// Include Files +//----------------------------------------------------------------------------- +#include "StdAfx.h" +#include "CRC.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// CRC intermediates +static USHORT CRCTable[CRC_TABLE_SIZE] = +{ + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 +}; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + SetCRC (Free Method) + +DESCRIPTION: + Calculate and append a 16-bit CRC to given data + +PARAMETERS: + pData [ I ] - The data buffer + dataLen [ I ] - The length of the above buffer + +RETURN VALUE: + None +===========================================================================*/ +void SetCRC( + PBYTE pData, + ULONG dataLen ) +{ + // Calculate CRC + USHORT CRC = CalculateCRC( pData, dataLen * 8 ); + + // Add CRC to data + pData[dataLen] = (BYTE)(CRC & 0x00ff); + pData[dataLen + 1] = (BYTE)(CRC >> 8); +} + +/*=========================================================================== +METHOD: + CheckCRC (Free Method) + +DESCRIPTION: + Check the CRC validity of the given data + +PARAMETERS: + pData [ I ] - The data buffer + dataLen [ I ] - The length of the above buffer + +RETURN VALUE: + bool: + true - CRC checks out OK + false - CRC doesn't cut the mustard +===========================================================================*/ +bool CheckCRC( + const BYTE * pData, + ULONG dataLen ) +{ + // There must be data + ASSERT( pData != 0 ); + ASSERT( dataLen > 0 ); + + // Calculate CRC + USHORT CRC = CalculateCRC( pData, dataLen * 8 ); + + return (CRC == CRC_16_L_OK ? true : false); +} + + +/*=========================================================================== +METHOD: + CalculateCRC (Free Method) + +DESCRIPTION: + Calculate a 16-bit CRC value + +PARAMETERS: + pBuf [ I ] - The data buffer + bitLen [ I ] - The length of the above buffer (in bits) + +RETURN VALUE: + USHORT: The 16-bit calculated CRC +===========================================================================*/ +USHORT CalculateCRC( + const BYTE * pBuf, + ULONG bitLen ) +{ + // Remainders are not allowed + ASSERT( bitLen % 8 == 0 ); + + // There must be a buffer + ASSERT( pBuf != 0 ); + + USHORT CRC; + for (CRC = CRC_16_L_SEED; bitLen >= 8; bitLen -= 8, pBuf++) + { + CRC = CRCTable[(CRC ^ *pBuf) & 0x00ff] ^ (CRC >> 8); + } + + return ~CRC; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/CRC.h b/gobi-api/GobiAPI_1.0.40/Core/CRC.h new file mode 100755 index 0000000..ed26e76 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/CRC.h @@ -0,0 +1,75 @@ +/*=========================================================================== +FILE: + CRC.h + +DESCRIPTION: + 16-bit LSB CRC computation/verification + +PUBLIC CLASSES AND METHODS: + SetCRC() + CheckCRC() + CalculateCRC() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +const USHORT CRC_16_L_POLYNOMIAL = 0x8408; +const USHORT CRC_16_L_SEED = 0xFFFF; +const USHORT CRC_16_L_OK = 0x0F47; +const USHORT CRC_TABLE_SIZE = 256; +const USHORT CRC_SIZE = 2; + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +// Calculate and append a 16-bit CRC to given data, the calculated CRC +// value stored at pData[dataLen] & pData[dataLen + 1] +void SetCRC( + PBYTE pData, + ULONG dataLen ); + +// Check a CRC value for the given data, dataLen includes the 2 byte CRC +// value at the end of the buffer +bool CheckCRC( + const BYTE * pData, + ULONG dataLen ); + +// Calculate a CRC value for the given data +USHORT CalculateCRC( + const BYTE * pBuf, + ULONG bitLen ); + diff --git a/gobi-api/GobiAPI_1.0.40/Core/Comm.cpp b/gobi-api/GobiAPI_1.0.40/Core/Comm.cpp new file mode 100755 index 0000000..db06db9 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/Comm.cpp @@ -0,0 +1,643 @@ +/*=========================================================================== +FILE: + Comm.cpp + +DESCRIPTION: + Implementation of cComm class + +PUBLIC CLASSES AND METHODS: + cComm + This class wraps low level port communications + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "Comm.h" +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +// Thread commands +#define START_READ_CMD 0 +#define STOP_READ_CMD 1 +#define EXIT_CMD 2 + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + RxThread (Free Method) + +DESCRIPTION: + Thread for simulating asynchronous reads + +PARAMETERS: + pData [ I ] Asynchronous read object + +RETURN VALUE: + void * - thread exit value (always 0) +===========================================================================*/ +void * RxThread( void * pData ) +{ + cComm * pComm = (cComm*)pData; + if (pComm == NULL || pComm->IsValid() == false) + { + return 0; + } + + fd_set inputSet, outputSet; + FD_ZERO( &inputSet ); + FD_SET( pComm->mCommandPipe[READING], &inputSet ); + int largestFD = pComm->mCommandPipe[READING]; + + int status = 0; + while (true) + { + // No FD_COPY() available + memcpy( &outputSet, &inputSet, sizeof( fd_set ) ); + + status = select( largestFD + 1, &outputSet, NULL, NULL, NULL ); + if (status <= 0) + { + TRACE( "error %d in select, errno %d\n", status, errno ); + break; + } + + if (FD_ISSET( pComm->mCommandPipe[READING], &outputSet ) == true) + { + // Read from the pipe + BYTE cmd; + status = read( pComm->mCommandPipe[READING], &cmd, 1 ); + if (status != 1) + { + TRACE( "cmd error %d\n", status ); + break; + } + + if (cmd == START_READ_CMD) + { + FD_SET( pComm->mPort, &inputSet ); + largestFD = std::max( pComm->mPort, + pComm->mCommandPipe[READING] ); + } + else if (cmd == STOP_READ_CMD) + { + FD_CLR( pComm->mPort, &inputSet ); + largestFD = pComm->mCommandPipe[READING]; + } + else + { + // EXIT_CMD or anything else + break; + } + } + else if (FD_ISSET( pComm->mPort, &outputSet ) == true) + { + // Stop watching for read data + FD_CLR( pComm->mPort, &inputSet ); + largestFD = pComm->mCommandPipe[READING]; + + // Perform a read + status = read( pComm->mPort, + pComm->mpBuffer, + pComm->mBuffSz ); + + cIOCallback * pCallback = pComm->mpRxCallback; + pComm->mpRxCallback = 0; + + if (pCallback == (cIOCallback *)1) + { + // We wanted to read, but not to be notified + } + else if (status >= 0) + { + pCallback->IOComplete( 0, status ); + } + else + { + pCallback->IOComplete( status, 0 ); + } + } + } + + return 0; +}; + +/*=========================================================================*/ +// cComm Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cComm (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cComm::cComm() + : mPortName( "" ), + mPort( INVALID_HANDLE_VALUE ), + mpRxCallback( 0 ), + mbCancelWrite( false ), + mpBuffer( 0 ), + mBuffSz( 0 ), + mRxThreadID( 0 ) +{ + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; +} + +/*=========================================================================== +METHOD: + ~cComm (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cComm::~cComm() +{ + // Disconnect from current port + Disconnect(); + + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + Bool +===========================================================================*/ +bool cComm::IsValid() +{ + // Nothing to do, dependant on extended class functionality + return true; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified port + +PARAMETERS: + pPort [ I ] - Name of port to open (IE: /dev/qcqmi0) + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::Connect( LPCSTR pPort ) +{ + if (IsValid() == false || pPort == 0 || pPort[0] == 0) + { + return false; + } + + if (mPort != INVALID_HANDLE_VALUE) + { + Disconnect(); + } + + // Initialize command pipe for read thread + int nRet = pipe( mCommandPipe ); + if (nRet != 0) + { + TRACE( "cComm:Connect() pipe creation failed %d\n", nRet ); + return false; + } + + // Start the read thread + nRet = pthread_create( &mRxThreadID, + 0, + RxThread, + this ); + if (nRet != 0) + { + TRACE( "cComm::Connect() pthread_create = %d\n", nRet ); + + Disconnect(); + return false; + } + + // Opening the com port + mPort = open( pPort, O_RDWR ); + if (mPort == INVALID_HANDLE_VALUE) + { + Disconnect(); + return false; + } + + // Save port name + mPortName = pPort; + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + RunIOCTL (Public Method) + +DESCRIPTION: + Run an IOCTL on the open file handle + +PARAMETERS: + ioctlReq [ I ] - ioctl request value + pData [I/O] - input or output specific to ioctl request value + +RETURN VALUE: + int - ioctl return value (0 for success) +===========================================================================*/ +int cComm::RunIOCTL( + UINT ioctlReq, + void * pData ) +{ + if (mPort == INVALID_HANDLE_VALUE) + { + TRACE( "Invalid file handle\n" ); + return -EBADFD; + } + + return ioctl( mPort, ioctlReq, pData ); +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the current port + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::Disconnect() +{ + // Assume success + bool bRC = true; + + if (mCommandPipe[WRITING] != INVALID_HANDLE_VALUE) + { + if (mRxThreadID != 0) + { + // Notify the thread to exit + BYTE byte = EXIT_CMD; + write( mCommandPipe[WRITING], &byte, 1 ); + + // And wait for it + TRACE( "cComm::Disconnnect() joining thread\n" ); + int nRC = pthread_join( mRxThreadID, 0 ); + if (nRC != 0) + { + TRACE( "failed to join thread %d\n", nRC ); + bRC = false; + } + + mRxThreadID = 0; + } + + close( mCommandPipe[WRITING] ); + close( mCommandPipe[READING] ); + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; + } + + if (mPort != INVALID_HANDLE_VALUE) + { + close( mPort ); + mPort = INVALID_HANDLE_VALUE; + } + + mPortName.clear(); + return bRC; +} + +/*=========================================================================== +METHOD: + ConfigureSettings (Public Method) + +DESCRIPTION: + Configure the port with the passed in parameters + +PARAMETERS: + pSettings [ I ] - Desired port settings + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::ConfigureSettings( termios * pSettings ) +{ + if (mPort == INVALID_HANDLE_VALUE || pSettings == 0) + { + return false; + } + + tcflush( mPort, TCIOFLUSH ); + int nRC = tcsetattr( mPort, TCSANOW, pSettings ); + if (nRC == -1) + { + return false; + } + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + GetSettings (Public Method) + +DESCRIPTION: + Return the current port settings + +PARAMETERS: + pSettings [ I ] - Current port settings + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::GetSettings( termios * pSettings ) +{ + if (mPort == INVALID_HANDLE_VALUE || pSettings == 0) + { + return false; + } + + // Get the COM port settings + int nRC = tcgetattr( mPort, pSettings ); + if (nRC == -1) + { + return false; + } + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + CancelIO (Public Method) + +DESCRIPTION: + Cancel any in-progress I/O + +PARAMETERS: + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelIO() +{ + if (mPort == INVALID_HANDLE_VALUE) + { + return false; + } + + bool bRxCancel = CancelRx(); + bool bTxCancel = CancelTx(); + + return (bRxCancel && bTxCancel); +} + +/*=========================================================================== +METHOD: + CancelRx (Public Method) + +DESCRIPTION: + Cancel any in-progress receive operation + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelRx() +{ + if (mPort == INVALID_HANDLE_VALUE + || mCommandPipe[WRITING] == INVALID_HANDLE_VALUE + || mpRxCallback == 0 + || mRxThreadID == 0) + { + TRACE( "cannot cancel, thread not active\n" ); + return false; + } + + // Notify the thread to stop reading + BYTE byte = STOP_READ_CMD; + int nRC = write( mCommandPipe[WRITING], &byte, 1 ); + if (nRC != 1) + { + TRACE( "error %d canceling read\n", nRC ); + return false; + } + + // Remove the old callback + mpRxCallback = 0; + + return true; +} + +/*=========================================================================== +METHOD: + CancelTx (Public Method) + +DESCRIPTION: + Cancel any in-progress transmit operation + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelTx() +{ + if (mPort == INVALID_HANDLE_VALUE) + { + return false; + } + + mbCancelWrite = true; + + return true; +} + +/*=========================================================================== +METHOD: + RxData (Public Method) + +DESCRIPTION: + Receive data + +PARAMETERS: + pBuf [ I ] - Buffer to contain received data + bufSz [ I ] - Amount of data to be received + pCallback [ I ] - Callback object to be exercised when the + operation completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::RxData( + BYTE * pBuf, + ULONG bufSz, + cIOCallback * pCallback ) +{ + if (IsValid() == false || mpRxCallback != 0) + { + return false; + } + + if (pCallback == 0) + { + // Not interested in being notified, but we still need a value + // for this so that only one outstanding I/O operation is active + // at any given point in time + mpRxCallback = (cIOCallback * )1; + } + else + { + mpRxCallback = pCallback; + } + + mpBuffer = pBuf; + mBuffSz = bufSz; + + // Notify the thread to stop reading + BYTE byte = START_READ_CMD; + int nRC = write( mCommandPipe[WRITING], &byte, 1 ); + if (nRC != 1) + { + TRACE( "error %d starting read\n", nRC ); + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + TxData (Public Method) + +DESCRIPTION: + Transmit data + +PARAMETERS: + pBuf [ I ] - Data to be transmitted + bufSz [ I ] - Amount of data to be transmitted + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::TxData( + const BYTE * pBuf, + ULONG bufSz ) +{ + if (IsValid() == false) + { + return false; + } + +#ifdef DEBUG + ULONGLONG nStart = GetTickCount(); +#endif + + // Allow ourselves to be interupted + mbCancelWrite = false; + + // This seems a bit pointless, but we're still going verify + // the device is ready for writing, and give it up to + // (1000 + num bytes) MS to be ready (in 100 MS chunks) + + struct timeval TimeOut; + fd_set set; + + int nReady = 0; + int nCount = 0; + + while ( nReady == 0 ) + { + if (mbCancelWrite == true) + { + TRACE( "cComm::TxData() write canceled before device was ready\n" ); + return false; + } + + if (nCount >= (1000 + bufSz) / 100) + { + // Timeout is expired + break; + } + + FD_ZERO( &set ); + FD_SET( mPort, &set ); + TimeOut.tv_sec = 0; + TimeOut.tv_usec = 100000; + nReady = select( mPort + 1, NULL, &set, NULL, &TimeOut ); + + nCount++; + } + + if (nReady <= 0) + { + TRACE( "cComm::TxData() Unable to get device ready for" + " Write, error %d: %s\n", + nReady, + strerror( nReady) ); + return false; + } + + int nRet = write( mPort, pBuf, bufSz ); + if (nRet != bufSz) + { + TRACE( "cComm::TxData() write returned %d instead of %lu\n", + nRet, + bufSz ); + return false; + } + +#ifdef DEBUG + TRACE( "Write of %lu bytes took %llu miliseconds\n", bufSz, GetTickCount() - nStart ); +#endif + + return true; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/Comm.h b/gobi-api/GobiAPI_1.0.40/Core/Comm.h new file mode 100755 index 0000000..3f56413 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/Comm.h @@ -0,0 +1,159 @@ +/*=========================================================================== +FILE: + Comm.h + +DESCRIPTION: + Declaration of cComm class + +PUBLIC CLASSES AND METHODS: + cComm + This class wraps low level port communications + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Event.h" + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// Class cIOCallback +/*=========================================================================*/ +class cIOCallback +{ + public: + // (Inline) Constructor + cIOCallback() { }; + + // (Inline) Destructor + virtual ~cIOCallback() { }; + + // The I/O has been completed, process the results + virtual void IOComplete( + DWORD status, + DWORD bytesTransferred ) = 0; +}; + +/*=========================================================================*/ +// Class cComm +/*=========================================================================*/ +class cComm +{ + public: + // Constructor + cComm(); + + // Destructor + virtual ~cComm(); + + // Is this object valid? + virtual bool IsValid(); + + // Connect to the specified port + virtual bool Connect( LPCSTR pPort ); + + // Run an IOCTL on the open file handle + int RunIOCTL( + UINT ioctlReq, + void * pData ); + + // Disconnect from the current port + virtual bool Disconnect(); + + // Configure the port with the passed in parameters + bool ConfigureSettings( termios * pSettings ); + + // Return the current port settings + bool GetSettings( termios * pSettings ); + + // Cancel any in-progress I/O + bool CancelIO(); + + // Cancel any in-progress receive operation + bool CancelRx(); + + // Cancel any in-progress transmit operation + bool CancelTx(); + + // Receive data + virtual bool RxData( + BYTE * pBuf, + ULONG bufSz, + cIOCallback * pCallback ); + + // Transmit data + virtual bool TxData( + const BYTE * pBuf, + ULONG bufSz ); + + // (Inline) Return current port name + virtual std::string GetPortName() const + { + return mPortName; + }; + + // Are we currently connected to a port? + bool IsConnected() + { + return (mPort != INVALID_HANDLE_VALUE); + }; + + protected: + /* Name of current port */ + std::string mPortName; + + /* Handle to COM port */ + int mPort; + + /* Read callbacks */ + cIOCallback * mpRxCallback; + + // Cancel the write request? + bool mbCancelWrite; + + /* Buffer */ + BYTE * mpBuffer; + + /* Buffer size */ + ULONG mBuffSz; + + /* Pipe for comunication with thread */ + int mCommandPipe[2]; + + /* Thread ID of Rx Thread. */ + pthread_t mRxThreadID; + + // Rx thread is allowed complete access + friend void * RxThread( void * pData ); +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/CoreDatabase.cpp b/gobi-api/GobiAPI_1.0.40/Core/CoreDatabase.cpp new file mode 100755 index 0000000..e9bf5e4 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/CoreDatabase.cpp @@ -0,0 +1,3187 @@ +/*=========================================================================== +FILE: + CoreDatabase.cpp + +DESCRIPTION: + Implementation of cCoreDatabase class + +PUBLIC CLASSES AND METHODS: + cCoreDatabase + This class represents the run-time (read only) version of the + core library database + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" + +#include "CoreDatabase.h" +#include "DB2NavTree.h" + +#include "CoreUtilities.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Uncomment out to enable database load/save timing through cCoreDatabase +// #define TIME_DB 1 + +// Database table file names +LPCSTR DB2_FILE_PROTOCOL_FIELD = "Field.txt"; +LPCSTR DB2_FILE_PROTOCOL_STRUCT = "Struct.txt"; +LPCSTR DB2_FILE_PROTOCOL_ENTITY = "Entity.txt"; +LPCSTR DB2_FILE_ENUM_MAIN = "Enum.txt"; +LPCSTR DB2_FILE_ENUM_ENTRY = "EnumEntry.txt"; + +// Database table file names +LPCSTR DB2_TABLE_PROTOCOL_FIELD = "Field"; +LPCSTR DB2_TABLE_PROTOCOL_STRUCT = "Struct"; +LPCSTR DB2_TABLE_PROTOCOL_ENTITY = "Entity"; +LPCSTR DB2_TABLE_ENUM_MAIN = "Enum"; +LPCSTR DB2_TABLE_ENUM_ENTRY = "Enum Entry"; + +// An empty (but not NULL) string +LPCSTR EMPTY_STRING = ""; + +// Value seperator for database text +LPCSTR DB2_VALUE_SEP = "^"; + +// Sub-value (i.e. within a particular value) seperator for database text +LPCSTR DB2_SUBVAL_SEP = ","; + +// Maximum amount of recursion allowed in protocol entity structure processing +const ULONG MAX_NESTING_LEVEL = 32; + +// The default logger (for backwards compatibility) +cDB2TraceLog gDB2DefaultLog; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + CopyQuotedString (Public Method) + +DESCRIPTION: + Convert a string (in quotes) to a string (minus) quotes and copy + into an allocated buffer + +PARAMETERS: + pString [ I ] - The string being de-quoted/copied + +RETURN VALUE: + LPSTR: The copy (returns 0 upon error) +===========================================================================*/ +LPCSTR CopyQuotedString( LPSTR pString ) +{ + // Get string length + ULONG len = (ULONG)strlen( pString ); + + // Adjust to remove trailing spaces + while (len > 0 && pString[len - 1] == ' ') + { + pString[len - 1] = 0; + len--; + } + + // Long enough (and quoted?) + if ( (len >= 2) + && (pString[0] == '\"') + && (pString[len - 1] == '\"') ) + { + if (len == 2) + { + return EMPTY_STRING; + } + else + { + // Attempt to allocate a copy + LPSTR pRet = new char[len - 1]; + if (pRet != 0) + { + ULONG bytes = (len - 2) * sizeof( char ); + memcpy( (PVOID)pRet, (LPCVOID)&pString[1], (SIZE_T)bytes ); + pRet[len - 2] = 0; + + return pRet; + } + } + } + + return 0; +} + +/*=========================================================================*/ +// sDB2ProtocolEntity Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2ProtocolEntity::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: Type + // 1: "Key" + // 2: "Name" + // 3: Struct ID + // 4: Format specifier ID (optional) + // 5: Internal only flag (optional) + // 6: Extended format specifier ID (optional) + const ULONG NUM_REQ_VALS = 4; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[2] ); + if (pCopy != 0) + { + mpName = pCopy; + mType = (eDB2EntityType)strtol( tokens[0], 0, 10 ); + + // Convert key/populate ID + mID.push_back( (ULONG)mType ); + CSVStringToContainer( DB2_SUBVAL_SEP, tokens[1], mID, false ); + + mStructID = strtol( tokens[3], 0, 10 ); + + // Format specifier? + if (toks > NUM_REQ_VALS) + { + mFormatID = strtol( tokens[NUM_REQ_VALS], 0, 10 ); + } + + // Internal only flag? + if (toks > NUM_REQ_VALS + 1) + { + mbInternal = (strtoul( tokens[NUM_REQ_VALS + 1], 0, 10 ) != 0); + } + + // Extended format specifier ID? + if (toks > NUM_REQ_VALS + 2) + { + mFormatExID = strtol( tokens[NUM_REQ_VALS + 2], 0, 10 ); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2ProtocolEntity::IsValid() const +{ + // The type has to be valid + if (::IsValid( mType ) == false) + { + return false; + } + + // The ID must consists of at least two entries + if (mID.size() < 2) + { + return false; + } + + // The first entry in the ID has to be the type + if (mID[0] != (ULONG)mType) + { + return false; + } + + // The structure ID has to be >= -1) + if (mStructID < -1) + { + return false; + } + + // The format specifier has to be >= -1) + if (mFormatID < -1) + { + return false; + } + + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// sDB2Fragment Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: ID + // 1: Order + // 2: Type + // 3: Val + // 4: "Name" + // 5: Offset + // 6: Mod Type + // 7: "Mod Value" + const ULONG NUM_REQ_VALS = 8; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from modifier value and copy + LPCSTR pVal = CopyQuotedString( tokens[7] ); + if (pVal != 0) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[4] ); + if (pCopy != 0) + { + mStructID = strtoul( tokens[0], 0, 10 ); + mFragmentOrder = strtoul( tokens[1], 0, 10 ); + mFragmentValue = strtoul( tokens[3], 0, 10 ); + mFragmentOffset = strtol( tokens[5], 0, 10 ); + mFragmentType = (eDB2FragmentType)strtol( tokens[2], 0, 10 ); + mModifierType = (eDB2ModifierType)strtol( tokens[6], 0, 10 );; + mpModifierValue = pVal; + mpName = pCopy; + + bRC = IsValid(); + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::IsValid() const +{ + // The fragment type has to be valid + if (::IsValid( mFragmentType ) == false) + { + return false; + } + + // The modifier type has to be valid + if (::IsValid( mModifierType ) == false) + { + return false; + } + + // There has to be a name (possibly empty) + if (mpName == 0) + { + return false; + } + + // There has to be a modifier value (possibly empty) + if (mpModifierValue == 0) + { + return false; + } + + // Directives can only be given for the first fragment + if ( (mFragmentType == eDB2_FRAGMENT_MSB_2_LSB) + || (mFragmentType == eDB2_FRAGMENT_LSB_2_MSB) ) + { + if (mFragmentOrder > 0) + { + return false; + } + } + + // Validate modifier + switch (mModifierType) + { + case eDB2_MOD_NONE: + if (mpModifierValue != 0 && mpModifierValue[0] != 0) + { + // Modifier string needs to be empty + return false; + } + break; + + case eDB2_MOD_CONSTANT_ARRAY: + case eDB2_MOD_VARIABLE_ARRAY: + case eDB2_MOD_OPTIONAL: + case eDB2_MOD_VARIABLE_ARRAY2: + case eDB2_MOD_VARIABLE_ARRAY3: + if (mpModifierValue == 0 || mpModifierValue[0] == 0) + { + // Needs to be a modifier string + return false; + } + break; + + case eDB2_MOD_VARIABLE_STRING1: + case eDB2_MOD_VARIABLE_STRING2: + case eDB2_MOD_VARIABLE_STRING3: + if (mpModifierValue == 0 || mpModifierValue[0] == 0) + { + // Needs to be a modifier string + return false; + } + + if (mFragmentType != eDB2_FRAGMENT_FIELD) + { + // Only valid when modifying fields (strings) + return false; + } + break; + + } + + if (mFragmentType == eDB2_FRAGMENT_CONSTANT_PAD && mFragmentValue == 0) + { + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + BuildCondition (Static Public Method) + +DESCRIPTION: + Build a simple condition string + +PARAMETERS: + id [ I ] - Field ID + op [ I ] - Operator + val [ I ] - Value (or field ID) + bF2F [ I ] - Field to field expression? + +RETURN VALUE: + std::string +===========================================================================*/ +std::string sDB2Fragment::BuildCondition( + ULONG id, + eDB2Operator op, + LONGLONG val, + bool bF2F ) +{ + std::ostringstream tmp; + + if (::IsValid( op ) == true) + { + if (bF2F == false) + { + switch (op) + { + case eDB2_OP_LT: + tmp << (UINT)id << " " << "<" << val; + break; + + case eDB2_OP_LTE: + tmp << (UINT)id << " " << "<=" << val; + break; + + case eDB2_OP_EQ: + tmp << (UINT)id << " " << "=" << val; + break; + + case eDB2_OP_NEQ: + tmp << (UINT)id << " " << "!=" << val; + break; + + case eDB2_OP_GTE: + tmp << (UINT)id << " " << ">=" << val; + break; + + case eDB2_OP_GT: + tmp << (UINT)id << " " << ">" << val; + break; + + case eDB2_OP_DIV: + tmp << (UINT)id << " " << "%" << val; + break; + + case eDB2_OP_NDIV: + tmp << (UINT)id << " " << "!%" << val; + break; + } + } + else + { + switch (op) + { + case eDB2_OP_LT: + tmp << (UINT)id << " " << "f<" << val; + break; + + case eDB2_OP_LTE: + tmp << (UINT)id << " " << "f<=" << val; + break; + + case eDB2_OP_EQ: + tmp << (UINT)id << " " << "f=" << val; + break; + + case eDB2_OP_NEQ: + tmp << (UINT)id << " " << "f!=" << val; + break; + + case eDB2_OP_GTE: + tmp << (UINT)id << " " << "f>=" << val; + break; + + case eDB2_OP_GT: + tmp << (UINT)id << " " << "f>" << val; + break; + + case eDB2_OP_DIV: + tmp << (UINT)id << " " << "f%" << val; + break; + + case eDB2_OP_NDIV: + tmp << (UINT)id << " " << "f!%" << val; + break; + } + } + } + + std::string retStr = tmp.str(); + + return retStr; +} + +/*=========================================================================== +METHOD: + EvaluateCondition (Static Public Method) + +DESCRIPTION: + Evaluate a simple condition + +PARAMETERS: + valA [ I ] - Left value + op [ I ] - Operator + valB [ I ] - Right value + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::EvaluateCondition( + LONGLONG valA, + eDB2Operator op, + LONGLONG valB ) +{ + bool bOK = false; + if (::IsValid( op ) == true) + { + switch (op) + { + case eDB2_OP_LT: + bOK = (valA < valB); + break; + + case eDB2_OP_LTE: + bOK = (valA <= valB); + break; + + case eDB2_OP_EQ: + bOK = (valA == valB); + break; + + case eDB2_OP_NEQ: + bOK = (valA != valB); + break; + + case eDB2_OP_GTE: + bOK = (valA >= valB); + break; + + case eDB2_OP_GT: + bOK = (valA > valB); + break; + + case eDB2_OP_DIV: + bOK = ((valA % valB) == 0); + break; + + case eDB2_OP_NDIV: + bOK = ((valA % valB) != 0); + break; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ParseCondition (Static Public Method) + +DESCRIPTION: + Parse a simple condition + +PARAMETERS: + pCondition [ I ] - Condition string + id [ O ] - Field ID + op [ O ] - Operator + val [ O ] - Value (or field ID) + bF2F [ O ] - Field to field expression? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::ParseCondition( + LPCSTR pCondition, + ULONG & id, + eDB2Operator & op, + LONGLONG & val, + bool & bF2F ) +{ + // Assume error + bool bOK = false; + + // Even a condition to start with? + if (pCondition == 0 || pCondition == EMPTY_STRING) + { + return bOK; + } + + // Parse condition to tokens (field ID operator value) + int nSize = strlen( pCondition ) + 1; + + char * pCopy = new char[ nSize ]; + if (pCopy == NULL) + { + return false; + } + + memcpy( pCopy, pCondition, nSize ); + + std::vector tokens; + ParseTokens( " ", pCopy, tokens ); + + if (tokens.size() == 3) + { + // Covert first token to field ID + ULONG fieldID = strtoul( tokens[0], 0, 10 ); + + // Grab the value for the given field ID + LONGLONG fieldVal = 0; + bOK = StringToLONGLONG( tokens[2], 0, fieldVal ); + if (bOK == true) + { + std::string opStr = tokens[1]; + + // std::string version of Trim() + int nFirst = opStr.find_first_not_of( ' ' ); + int nLast = opStr.find_last_not_of( ' ' ); + if (nFirst == -1 || nLast == -1) + { + // Something went horribly wrong, empty string or all spaces + delete [] pCopy; + return false; + } + + opStr = opStr.substr( nFirst, nLast - nFirst + 1 ); + + // std::string version of MakeLower() + transform( opStr.begin(), opStr.end(), opStr.begin(), tolower ); + + bF2F = false; + if (opStr == "<") + { + op = eDB2_OP_LT; + } + else if (opStr == "<=") + { + op = eDB2_OP_LTE; + } + else if (opStr == "=") + { + op = eDB2_OP_EQ; + } + else if (opStr == "!=") + { + op = eDB2_OP_NEQ; + } + else if (opStr == ">=") + { + op = eDB2_OP_GTE; + } + else if (opStr == ">") + { + op = eDB2_OP_GT; + } + else if (opStr == "%") + { + op = eDB2_OP_DIV; + } + else if (opStr == "!%") + { + op = eDB2_OP_NDIV; + } + else if (opStr == "f<") + { + bF2F = true; + op = eDB2_OP_LT; + } + else if (opStr == "f<=") + { + bF2F = true; + op = eDB2_OP_LTE; + } + else if (opStr == "f=") + { + bF2F = true; + op = eDB2_OP_EQ; + } + else if (opStr == "f!=") + { + bF2F = true; + op = eDB2_OP_NEQ; + } + else if (opStr == "f>=") + { + bF2F = true; + op = eDB2_OP_GTE; + } + else if (opStr == "f>") + { + bF2F = true; + op = eDB2_OP_GT; + } + else if (opStr == "f%") + { + bF2F = true; + op = eDB2_OP_DIV; + } + else if (opStr == "f!%") + { + bF2F = true; + op = eDB2_OP_NDIV; + } + else + { + bOK = false; + } + + if (bOK == true) + { + id = fieldID; + val = fieldVal; + } + } + } + + delete [] pCopy; + + return bOK; +} + +/*=========================================================================== +METHOD: + BuildExpression (Static Public Method) + +DESCRIPTION: + Build a simple expression string + +PARAMETERS: + id [ I ] - Field ID + op [ I ] - Operator + val [ I ] - Value (or field ID) + bF2F [ I ] - Field to field expression? + +RETURN VALUE: + std::string +===========================================================================*/ +std::string sDB2Fragment::BuildExpression( + ULONG id, + eDB2ExpOperator op, + LONGLONG val, + bool bF2F ) +{ + std::ostringstream tmp; + + if (::IsValid( op ) == true) + { + if (bF2F == false) + { + switch (op) + { + case eDB2_EXPOP_ADD: + tmp << (UINT)id << " " << "+" << val; + break; + + case eDB2_EXPOP_SUB: + tmp << (UINT)id << " " << "-" << val; + break; + + case eDB2_EXPOP_MUL: + tmp << (UINT)id << " " << "*" << val; + break; + + case eDB2_EXPOP_DIV: + tmp << (UINT)id << " " << "/" << val; + break; + + case eDB2_EXPOP_REM: + tmp << (UINT)id << " " << "%" << val; + break; + + case eDB2_EXPOP_MIN: + tmp << (UINT)id << " " << "min" << val; + break; + + case eDB2_EXPOP_MAX: + tmp << (UINT)id << " " << "max" << val; + break; + } + } + else + { + switch (op) + { + case eDB2_EXPOP_ADD: + tmp << (UINT)id << " " << "f+" << val; + break; + + case eDB2_EXPOP_SUB: + tmp << (UINT)id << " " << "f-" << val; + break; + + case eDB2_EXPOP_MUL: + tmp << (UINT)id << " " << "f*" << val; + break; + + case eDB2_EXPOP_DIV: + tmp << (UINT)id << " " << "f/" << val; + break; + + case eDB2_EXPOP_REM: + tmp << (UINT)id << " " << "f%" << val; + break; + + case eDB2_EXPOP_MIN: + tmp << (UINT)id << " " << "fmin" << val; + break; + + case eDB2_EXPOP_MAX: + tmp << (UINT)id << " " << "fmax" << val; + break; + } + } + } + + std::string retStr = tmp.str(); + + return retStr; +} + +/*=========================================================================== +METHOD: + EvaluateExpression (Static Public Method) + +DESCRIPTION: + Evaluate a simple expression + +PARAMETERS: + valA [ I ] - Left value + op [ I ] - Operator + valB [ I ] - Right value + res [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::EvaluateExpression( + LONGLONG valA, + eDB2ExpOperator op, + LONGLONG valB, + LONGLONG & res ) +{ + bool bOK = false; + if (::IsValid( op ) == true) + { + bOK = true; + switch (op) + { + case eDB2_EXPOP_ADD: + res = valA + valB; + break; + + case eDB2_EXPOP_SUB: + res = valA - valB; + break; + + case eDB2_EXPOP_MUL: + res = valA * valB; + break; + + case eDB2_EXPOP_DIV: + res = valA / valB; + break; + + case eDB2_EXPOP_REM: + res = valA % valB; + break; + + case eDB2_EXPOP_MIN: + res = valA; + if (valA > valB) + { + res = valB; + } + break; + + case eDB2_EXPOP_MAX: + res = valA; + if (valA < valB) + { + res = valB; + } + break; + + default: + bOK = false; + break; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ParseExpression (Static Public Method) + +DESCRIPTION: + Parse a simple expression + +PARAMETERS: + pExpr [ I ] - Expression string + id [ O ] - Field ID + op [ O ] - Operator + val [ O ] - Value (or Field ID) + bF2F [ O ] - Field to field expression? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::ParseExpression( + LPCSTR pExpr, + ULONG & id, + eDB2ExpOperator & op, + LONGLONG & val, + bool & bF2F ) +{ + // Assume error + bool bOK = false; + + // Even a condition to start with? + if (pExpr == 0 || pExpr == EMPTY_STRING) + { + return bOK; + } + + // Parse condition to tokens (field ID operator value) + int nSize = strlen( pExpr ) + 1; + + char * pCopy = new char[ nSize ]; + if (pCopy == NULL) + { + return false; + } + + memcpy( pCopy, pExpr, nSize ); + + std::vector tokens; + ParseTokens( " ", pCopy, tokens ); + + if (tokens.size() == 3) + { + // Covert first token to field ID + ULONG fieldID = strtoul( tokens[0], 0, 10 ); + + // Grab the value for the given field ID + LONGLONG fieldVal = 0; + bOK = StringToLONGLONG( tokens[2], 0, fieldVal ); + if (bOK == true) + { + std::string opStr = tokens[1]; + + // std::string version of Trim() + int nFirst = opStr.find_first_not_of( ' ' ); + int nLast = opStr.find_last_not_of( ' ' ); + if (nFirst == -1 || nLast == -1) + { + // Something went horribly wrong, empty string or all spaces + delete [] pCopy; + return false; + } + + opStr = opStr.substr( nFirst, nLast - nFirst + 1 ); + + // std::string version of MakeLower() + transform( opStr.begin(), opStr.end(), opStr.begin(), tolower ); + + bF2F = false; + if (opStr == "+") + { + op = eDB2_EXPOP_ADD; + } + else if (opStr == "-") + { + op = eDB2_EXPOP_SUB; + } + else if (opStr == "*") + { + op = eDB2_EXPOP_MUL; + } + else if (opStr == "/") + { + op = eDB2_EXPOP_DIV; + } + else if (opStr == "%") + { + op = eDB2_EXPOP_REM; + } + else if (opStr == "min") + { + op = eDB2_EXPOP_MIN; + } + else if (opStr == "max") + { + op = eDB2_EXPOP_MAX; + } + else if (opStr == "f+") + { + bF2F = true; + op = eDB2_EXPOP_ADD; + } + else if (opStr == "f-") + { + bF2F = true; + op = eDB2_EXPOP_SUB; + } + else if (opStr == "f*") + { + bF2F = true; + op = eDB2_EXPOP_MUL; + } + else if (opStr == "f/") + { + bF2F = true; + op = eDB2_EXPOP_DIV; + } + else if (opStr == "f%") + { + bF2F = true; + op = eDB2_EXPOP_REM; + } + else if (opStr == "fmin") + { + bF2F = true; + op = eDB2_EXPOP_MIN; + } + else if (opStr == "fmax") + { + bF2F = true; + op = eDB2_EXPOP_MAX; + } + else + { + bOK = false; + } + + if (bOK == true) + { + id = fieldID; + val = fieldVal; + } + } + } + + delete [] pCopy; + return bOK; +} + +/*=========================================================================*/ +// sDB2Field Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Field::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: ID + // 1: "Name" + // 2: Size + // 3: Field type + // 4: Field type value + // 5: Hexadecimal + // 6: Description ID (optional) + // 7: Internal only flag (optional) + const ULONG NUM_REQ_VALS = 6; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[1] ); + if (pCopy != 0) + { + mID = strtoul( tokens[0], 0, 10 ); + mSize = strtoul( tokens[2], 0, 10 ); + mpName = pCopy; + mType = (eDB2FieldType)strtol( tokens[3], 0, 10 ); + mTypeVal = strtoul( tokens[4], 0, 10 ); + mbHex = (strtoul( tokens[5], 0, 10 ) != 0); + + // Description ID? + if (toks > NUM_REQ_VALS) + { + mDescriptionID = strtol( tokens[NUM_REQ_VALS], 0, 10 ); + } + + // Internal only flag? + if (toks > NUM_REQ_VALS + 1) + { + mbInternal = (strtoul( tokens[NUM_REQ_VALS + 1], 0, 10 ) != 0); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Field::IsValid() const +{ + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + // The field type must be valid + if (::IsValid( mType ) == false) + { + return false; + } + + // For validating size + ULONG minSz = 1; + ULONG maxSz = 8; + ULONG modVal = 0; + + // What type of field is this? + if (mType == eDB2_FIELD_STD) + { + eDB2StdFieldType ft = (eDB2StdFieldType)mTypeVal; + if (::IsValid( ft ) == false) + { + return false; + } + + switch (ft) + { + case eDB2_FIELD_STDTYPE_BOOL: + maxSz = 64; + break; + + case eDB2_FIELD_STDTYPE_INT16: + case eDB2_FIELD_STDTYPE_UINT16: + maxSz = 16; + break; + + case eDB2_FIELD_STDTYPE_INT32: + case eDB2_FIELD_STDTYPE_UINT32: + case eDB2_FIELD_STDTYPE_FLOAT32: + maxSz = 32; + break; + + case eDB2_FIELD_STDTYPE_INT64: + case eDB2_FIELD_STDTYPE_UINT64: + case eDB2_FIELD_STDTYPE_FLOAT64: + maxSz = 64; + break; + + case eDB2_FIELD_STDTYPE_STRING_A: + case eDB2_FIELD_STDTYPE_STRING_U8: + // One character, no maximum + minSz = 8; + maxSz = 0; + modVal = 8; + break; + + case eDB2_FIELD_STDTYPE_STRING_U: + // One UNICODE character, no maximum + minSz = 16; + maxSz = 0; + modVal = 16; + break; + + case eDB2_FIELD_STDTYPE_STRING_ANT: + case eDB2_FIELD_STDTYPE_STRING_UNT: + case eDB2_FIELD_STDTYPE_STRING_U8NT: + // Size needs to be specified as 0 + minSz = maxSz = 0; + break; + } + } + else + { + // Enum must be between 1 - 32 bits in size + maxSz = 32; + } + + if (mSize < minSz) + { + return false; + } + + if (maxSz != 0 && mSize > maxSz) + { + return false; + } + + if (modVal != 0 && (mSize % modVal) != 0) + { + return false; + } + + if (mDescriptionID < -1) + { + return false; + } + + // The name must be valid + std::string name = mpName; + if (name.find( DB2_VALUE_SEP ) != -1 || name.find( DB2_SUBVAL_SEP ) != -1) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// sDB2Category Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Category::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: ID + // 1: "Name" + // 2: Description ID + // 3: Parent ID + const ULONG NUM_REQ_VALS = 4; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[1] ); + if (pCopy != 0) + { + mID = strtoul( tokens[0], 0, 10 ); + mParentID = strtol( tokens[3], 0, 10 ); + mpName = pCopy; + + // Old format used to be a description string, so + // first check for quotes + if (tokens[2][0] != '\"') + { + mDescriptionID = strtol( tokens[2], 0, 10 ); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Category::IsValid() const +{ + // The parent ID has to be greater than or equal to -1 + if (mParentID < -1) + { + return false; + } + + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + if (mDescriptionID < -1) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// sDB2NVItem Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2NVItem::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: NV Item number + // 1: "Name" + // 2: "Categories" + // 3: Description ID + const ULONG NUM_REQ_VALS = 4; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[1] ); + if (pCopy != 0) + { + CSVStringToContainer( DB2_SUBVAL_SEP, tokens[2], mCategoryIDs ); + + mItem = strtoul( tokens[0], 0, 10 ); + mpName = pCopy; + + // Old format used to be a description string, so + // first check for quotes + if (tokens[3][0] != '\"') + { + mDescriptionID = strtol( tokens[3], 0, 10 ); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2NVItem::IsValid() const +{ + // There has to be at least one category ID + ULONG cats = (ULONG)mCategoryIDs.size(); + if (cats < 1) + { + return false; + } + + // The category IDs have to be greater than or equal to -1 + std::set ::const_iterator pIter = mCategoryIDs.begin(); + while (pIter != mCategoryIDs.end()) + { + if (*pIter++ < -1) + { + return false; + } + } + + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + if (mDescriptionID < -1) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// sDB2Enum Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Enum::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: ID + // 1: "Name" + // 2: Description ID + // 3: Internal? + const ULONG NUM_REQ_VALS = 4; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[1] ); + if (pCopy != 0) + { + mID = strtoul( tokens[0], 0, 10 ); + mbInternal = (strtoul( tokens[3], 0, 10 ) != 0); + mpName = pCopy; + + // Old format used to be a description string, so + // first check for quotes + if (tokens[2][0] != '\"') + { + mDescriptionID = strtol( tokens[2], 0, 10 ); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Enum::IsValid() const +{ + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + if (mDescriptionID < -1) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// sDB2EnumEntry Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2EnumEntry::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: ID + // 1: Value + // 2: "Name" + // 3: Description ID (optional) + const ULONG NUM_REQ_VALS = 3; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[2] ); + if (pCopy != 0) + { + mID = strtoul( tokens[0], 0, 10 ); + mpName = pCopy; + + // Enum entries are signed by definition, but can be entered + // in hexadecimal as they may be unsigned in practice + LONG val = -1; + StringToLONG( tokens[1], 0, val ); + mValue = (INT)val; + + // Determine hexadecimal flag by performing case-insensitve comparison + // of the value string's first two characters with "0x" + mbHex = (strncmp( tokens[1], "0x", 2 ) == 0); + + // Description ID? + if (toks > NUM_REQ_VALS) + { + mDescriptionID = strtol( tokens[NUM_REQ_VALS], 0, 10 ); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2EnumEntry::IsValid() const +{ + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + if (mDescriptionID < -1) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// cCoreDatabase Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cCoreDatabase (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cCoreDatabase::cCoreDatabase() + : mpLog( &gDB2DefaultLog ) +{ + // Nothing to do - database empty, call Initialize() +} + +/*=========================================================================== +METHOD: + ~cCoreDatabase (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cCoreDatabase::~cCoreDatabase() +{ + Exit(); +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Version to Load from file + Initialize the database - this must be done once (and only once) + prior to the database being accessed + +PARAMETERS + pBasePath [ I ] - Base path to database files + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::Initialize( LPCSTR pBasePath ) +{ + bool bRC = true; + + // Cleanup the last database (if necessary) + Exit(); + + bRC &= LoadEnumTables( pBasePath ); + bRC &= LoadStructureTables( pBasePath ); + + // Build the modifier tables + bRC &= BuildModifierTables(); + + return bRC; +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Version to Load from internal pointers + Initialize the database - this must be done once (and only once) + prior to the database being accessed + +PARAMETERS + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::Initialize() +{ + bool bRC = true; + + // Cleanup the last database (if necessary) + Exit(); + + bRC &= LoadEnumTables(); + bRC &= LoadStructureTables(); + + // Build the modifier tables + bRC &= BuildModifierTables(); + + return bRC; +} + +/*=========================================================================== +METHOD: + Exit (Public Method) + +DESCRIPTION: + Exit (cleanup) the database + +RETURN VALUE: + None +===========================================================================*/ +void cCoreDatabase::Exit() +{ + FreeDB2Table( mEntityFields ); + FreeDB2Table( mEntityStructs ); + FreeDB2Table( mProtocolEntities ); + + FreeDB2Table( mEnumNameMap ); + FreeDB2Table( mEnumEntryMap ); + + tDB2EntityNavMap::iterator pIter = mEntityNavMap.begin(); + while (pIter != mEntityNavMap.end()) + { + cDB2NavTree * pNav = pIter->second; + if (pNav != 0) + { + delete pNav; + } + + pIter++; + } + + mEntityNavMap.clear(); +} + +/*=========================================================================== +METHOD: + GetEntityNavTree (Public Method) + +DESCRIPTION: + Get the entity navigation tree for the given protocol entity, if none + exists one will be built and returned + +PARAMETERS + key [ I ] - Protocol entity key + +RETURN VALUE: + const cDB2NavTree * (0 upon error) +===========================================================================*/ +const cDB2NavTree * cCoreDatabase::GetEntityNavTree( + const std::vector & key ) const +{ + // Look up entity definition (to find DB string address) + sDB2ProtocolEntity tmpEntity; + bool bFound = FindEntity( key, tmpEntity ); + + // Did we find it? + if (bFound == false) + { + // No matching definition in database + return 0; + } + + // Obtain the canonical key and use it to look up the nav tree + tDB2EntityNavMap::const_iterator pIter = mEntityNavMap.find( key ); + if (pIter != mEntityNavMap.end()) + { + return pIter->second; + } + + // None found, go ahead and build one + cDB2NavTree * pNavTree = new cDB2NavTree( *this ); + if (pNavTree != 0) + { + bool bOK = pNavTree->BuildTree( key ); + if (bOK == true) + { + // Store it and return it to the user + std::pair , cDB2NavTree *> e( key, pNavTree ); + mEntityNavMap.insert( e ); + } + else + { + delete pNavTree; + pNavTree = 0; + } + } + + return pNavTree; +} + +/*=========================================================================== +METHOD: + FindEntity (Public Method) + +DESCRIPTION: + Find the protocol entity with the specified extended ID + +PARAMETERS + key [ I ] - Protocol entity key to find + entity [ O ] - Protocol entity (if found) + +RETURN VALUE: + bool - Success? +===========================================================================*/ +bool cCoreDatabase::FindEntity( + const std::vector & key, + sDB2ProtocolEntity & entity ) const +{ + // Assume failure + bool bFound = false; + + tDB2EntityMap::const_iterator pEntity = mProtocolEntities.find( key ); + if (pEntity != mProtocolEntities.end()) + { + entity = pEntity->second; + bFound = true; + } + + return bFound; +} + +/*=========================================================================== +METHOD: + FindEntity (Public Method) + +DESCRIPTION: + Find the protocol entity with the specified name + +PARAMETERS + pEntityName [ I ] - Protocol entity name to find + entity [ O ] - Protocol entity (if found) + +RETURN VALUE: + bool - Success? +===========================================================================*/ +bool cCoreDatabase::FindEntity( + LPCSTR pEntityName, + sDB2ProtocolEntity & entity ) const +{ + // Assume failure + bool bFound = false; + if (pEntityName != 0 && pEntityName[0] != 0) + { + tDB2EntityNameMap::const_iterator pIter = mEntityNames.find( pEntityName ); + if (pIter != mEntityNames.end()) + { + const std::vector & key = pIter->second; + bFound = FindEntity( key, entity ); + } + } + + return bFound; +} + +/*=========================================================================== +METHOD: + MapEntityNameToID (Public Method) + +DESCRIPTION: + Map a protocol entity name to an ID + +PARAMETERS + pName [ I ] - Protocol entity name + key [ O ] - Upon success, the ID corresponding to protocol entity + +RETURN VALUE: + bool - Success? +===========================================================================*/ +bool cCoreDatabase::MapEntityNameToID( + LPCSTR pName, + std::vector & key ) const +{ + // Assume failure + bool bOK = false; + + if (pName != 0 && pName[0] != 0) + { + std::string tmp = pName; + + // std::string version of Trim() + int nFirst = tmp.find_first_not_of( ' ' ); + int nLast = tmp.find_last_not_of( ' ' ); + if (nFirst == -1 || nLast == -1) + { + // Something went wrong, empty string or all spaces + return false; + } + + tmp = tmp.substr( nFirst, nLast - nFirst + 1 ); + + + tDB2EntityNameMap::const_iterator pIter = mEntityNames.find( tmp.c_str() ); + if (pIter != mEntityNames.end()) + { + key = pIter->second; + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + MapEnumToString (Public Method) + +DESCRIPTION: + Map the given enum value (specified by enum ID, and enum value) to + the enum value name string + +PARAMETERS + enumID [ I ] - ID of the enumeration + enumVal [ I ] - Enum value to map + bSimpleErrFmt [ I ] - If the eunum value cannot be mapped to a string + what should this method return? + + If 'true' then just the value as a string + If 'false' then the enum ID, value, and 'Unknown' + + bHex [ I ] - Hexadecimal output on mapping error? + +RETURN VALUE: + std::string - The enum name (or error string if enum value is not found) +===========================================================================*/ +std::string cCoreDatabase::MapEnumToString( + ULONG enumID, + int enumVal, + bool bSimpleErrFmt, + bool bHex ) const +{ + std::string retStr = ""; + + // Form the lookup key + std::pair key( enumID, enumVal ); + + // Look up the enum value descriptor + tDB2EnumEntryMap::const_iterator pVals = mEnumEntryMap.find( key ); + if (pVals != mEnumEntryMap.end()) + { + const sDB2EnumEntry & entry = pVals->second; + retStr = entry.mpName; + } + + // No string? + if (retStr.size() <= 0) + { + std::ostringstream tmp; + + if (bSimpleErrFmt == false) + { + tmp << "Unknown [" << (UINT)enumID << "/"; + } + + if (bHex == true) + { + tmp << std::ios_base::hex << std::ios_base::uppercase + << std::ios_base::showbase << enumVal; + } + else + { + tmp << enumVal; + } + + retStr = tmp.str(); + } + + return retStr; +} + +/*=========================================================================== +METHOD: + MapEnumToString (Public Method) + +DESCRIPTION: + Map the given enum value (specified by enum name, and enum value) to + the enum value name string + +PARAMETERS + pEnumName [ I ] - Name of the enumeration + enumVal [ I ] - Enum value to map + bSimpleErrFmt [ I ] - If the eunum value cannot be mapped to a string + what should this method return? + + If 'true' then just the value as a string + If 'false' then the enum ID, value, and 'Unknown' + + bHex [ I ] - Hexadecimal output on mapping error? + +RETURN VALUE: + std::string - The enum name (or error string if enum value is not found) +===========================================================================*/ +std::string cCoreDatabase::MapEnumToString( + LPCSTR pEnumName, + int enumVal, + bool bSimpleErrFmt, + bool bHex ) const +{ + std::string retStr = ""; + + tDB2EnumMap::const_iterator pEnumMapIter = mEnumMap.find( pEnumName ); + if (pEnumMapIter != mEnumMap.end()) + { + const std::map & entries = pEnumMapIter->second.second; + std::map ::const_iterator pEntry; + + pEntry = entries.find( enumVal ); + if (pEntry != entries.end()) + { + retStr = pEntry->second; + } + } + + // No string? + if (retStr.size() <= 0) + { + std::ostringstream tmp; + + if (bSimpleErrFmt == false) + { + if (pEnumName == 0) + { + pEnumName = "?"; + } + + tmp << "Unknown [" << pEnumName << "/"; + } + + if (bHex == true) + { + tmp << std::ios_base::hex << std::ios_base::uppercase + << std::ios_base::showbase << enumVal; + } + else + { + tmp << enumVal; + } + + retStr = tmp.str(); + } + + return retStr; +} + +/*=========================================================================== +METHOD: + AssembleEnumMap (Internal Method) + +DESCRIPTION: + Assemble the internal enum map from the enum and enum entry tables + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::AssembleEnumMap() +{ + bool bOK = true; + + // Empty it out first + mEnumMap.clear(); + + tDB2EnumEntryMap::const_iterator pEntry = mEnumEntryMap.begin(); + if (pEntry == mEnumEntryMap.end()) + { + return bOK; + } + + // Set initial enum ID + ULONG currentID = pEntry->second.mID; + + std::map entries; + while (pEntry != mEnumEntryMap.end()) + { + const sDB2EnumEntry & entry = pEntry->second; + pEntry++; + + if (entry.IsValid() == false) + { + continue; + } + + if (currentID != entry.mID) + { + if (entries.size() > 0) + { + // Look up the enum name + tDB2EnumNameMap::const_iterator pEnum; + pEnum = mEnumNameMap.find( currentID ); + + if (pEnum != mEnumNameMap.end()) + { + const sDB2Enum & dbEnum = pEnum->second; + if (mEnumMap.find( dbEnum.mpName ) == mEnumMap.end()) + { + tDB2EnumMapPair tmp( dbEnum.mID, entries ); + mEnumMap[dbEnum.mpName] = tmp; + } + else + { + // Hmm, duplicate enum names discovered + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_ENUM_MAIN + << "] Duplicate enum (by name) detected \'" + << dbEnum.mpName << "\'"; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + } + else + { + // Hmm, missing enum ID discovered + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_ENUM_MAIN + << "] Missing enum ID detected " + << currentID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + + // Clear out enum entries for next pass and add this entry + entries.clear(); + entries[entry.mValue] = entry.mpName; + + // Adjust current enum ID + currentID = entry.mID; + } + } + else + { + if (entries.find( entry.mValue ) == entries.end()) + { + entries[entry.mValue] = entry.mpName; + } + else + { + // Hmm, duplicate enum entry values discovered + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_ENUM_ENTRY + << "] Duplicate enum entries detected \'" + << entry.mpName << "\', " << entry.mValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + } + } + + // Add in the last enum + if (mEnumEntryMap.size() > 0 && entries.size() > 0) + { + // Look up the enum name + tDB2EnumNameMap::const_iterator pEnum; + pEnum = mEnumNameMap.find( currentID ); + + if (pEnum != mEnumNameMap.end()) + { + const sDB2Enum & dbEnum = pEnum->second; + if (mEnumMap.find( dbEnum.mpName ) == mEnumMap.end()) + { + tDB2EnumMapPair tmp( dbEnum.mID, entries ); + mEnumMap[dbEnum.mpName] = tmp; + } + else + { + // Hmm, duplicate enum names discovered + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_ENUM_MAIN + << "] Duplicate enum (by name) detected \'" + << dbEnum.mpName << "\'"; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + } + else + { + // Hmm, missing enum ID discovered + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_ENUM_MAIN + << "] Missing enum ID detected " << currentID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + AssembleEntityNameMap (Internal Method) + +DESCRIPTION: + Assemble the internal protocol entity name map + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::AssembleEntityNameMap() +{ + // Assume success + bool bOK = true; + + // Empty it out first + mEntityNames.clear(); + + // Go through and build the event name table + tDB2EntityMap::const_iterator pIter = mProtocolEntities.begin(); + while (pIter != mProtocolEntities.end()) + { + const sDB2ProtocolEntity & obj = pIter->second; + pIter++; + + if (obj.IsValid() == false) + { + continue; + } + + tDB2EntityNameMap::const_iterator pNames; + pNames = mEntityNames.find( obj.mpName ); + if (pNames == mEntityNames.end()) + { + mEntityNames[obj.mpName] = obj.GetKey(); + } + else + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_ENTITY + << "] Duplicate protocol entity (by name) detected \'" + << obj.mpName << "\'"; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + BuildModifierTables (Internal Method) + +DESCRIPTION: + Build the parsed fragment modifier maps, i.e. convert the modifier + text string to something more useful by database clients + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::BuildModifierTables() +{ + // Assume success + bool bOK = true; + + // Parse all fragment modifiers + tDB2FragmentMap::const_iterator pFragIter = mEntityStructs.begin(); + while (pFragIter != mEntityStructs.end()) + { + // Grab new fragment + const sDB2Fragment & frag = pFragIter->second; + pFragIter++; + + // Skip invalid/unmodified fragments + if ( (frag.IsValid() == false) + || (frag.mpModifierValue == 0) + || (frag.mpModifierValue == EMPTY_STRING) ) + { + continue; + } + + switch (frag.mModifierType) + { + case eDB2_MOD_CONSTANT_ARRAY: + case eDB2_MOD_VARIABLE_ARRAY: + case eDB2_MOD_VARIABLE_STRING1: + case eDB2_MOD_VARIABLE_STRING2: + case eDB2_MOD_VARIABLE_STRING3: + { + ULONG val = strtoul( frag.mpModifierValue, 0, 0 ); + mArray1ModMap[frag.mpModifierValue] = val; + } + break; + + case eDB2_MOD_VARIABLE_ARRAY2: + { + // Parse modifier to tokens (start stop) + int nSize = strlen( frag.mpModifierValue ) + 1; + + char * pCopy = new char[ nSize ]; + if (pCopy == NULL) + { + return false; + } + + memcpy( pCopy, frag.mpModifierValue, nSize ); + + std::vector indices; + CSVStringToContainer( " ", pCopy, indices ); + + delete [] pCopy; + if (indices.size() == 2) + { + std::pair val; + val.first = indices[0]; + val.second = indices[1]; + mArray2ModMap[frag.mpModifierValue] = val; + } + } + break; + + case eDB2_MOD_OPTIONAL: + { + sDB2SimpleCondition con; + + // Parse condition to tokens (field ID operator value) + bool bRC = sDB2Fragment::ParseCondition( frag.mpModifierValue, + con.mID, + con.mOperator, + con.mValue, + con.mbF2F ); + + if (bRC == true) + { + mOptionalModMap[frag.mpModifierValue] = con; + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY3: + { + sDB2SimpleExpression exp; + + // Parse condition to tokens (field ID operator value) + bool bRC = sDB2Fragment::ParseExpression( frag.mpModifierValue, + exp.mID, + exp.mOperator, + exp.mValue, + exp.mbF2F ); + + if (bRC == true) + { + mExpressionModMap[frag.mpModifierValue] = exp; + } + } + break; + } + } + + return bOK; +} + + +/*=========================================================================== +METHOD: + CheckAndSetBasePath (Internal Method) + +DESCRIPTION: + Check and set the passed in path to something that is useful + +PARAMETERS + pBasePath [ I ] - Base path + +RETURN VALUE: + std::string - The enum name (or error string if enum value is not found) +===========================================================================*/ +std::string cCoreDatabase::CheckAndSetBasePath( LPCSTR pBasePath ) const +{ + std::string basePath = "."; + if (pBasePath != 0 && pBasePath[0] != 0) + { + struct stat fileInfo; + if (stat( pBasePath, &fileInfo ) == 0) + { + if (S_ISDIR( fileInfo.st_mode ) == true) + { + // It's a directory + basePath = pBasePath; + } + } + } + + return basePath; +} + +/*=========================================================================== +METHOD: + LoadStructureTables (Internal Method) + +DESCRIPTION: + Load all tables related to structure (entity, struct, field, format spec) + +PARAMETERS + pBasePath [ I ] - Base path to database files + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::LoadStructureTables( LPCSTR pBasePath ) +{ + bool bRC = true; + + std::string basePath = CheckAndSetBasePath( pBasePath ); + basePath += "/"; + + std::string fn = basePath; + fn += DB2_FILE_PROTOCOL_FIELD; + bRC &= LoadDB2Table( (LPCSTR)fn.c_str(), + mEntityFields, + false, + DB2_TABLE_PROTOCOL_FIELD, + *mpLog ); + + fn = basePath; + fn += DB2_FILE_PROTOCOL_STRUCT; + bRC &= LoadDB2Table( (LPCSTR)fn.c_str(), + mEntityStructs, + false, + DB2_TABLE_PROTOCOL_STRUCT, + *mpLog ); + + fn = basePath; + fn += DB2_FILE_PROTOCOL_ENTITY; + bRC &= LoadDB2Table( (LPCSTR)fn.c_str(), + mProtocolEntities, + false, + DB2_TABLE_PROTOCOL_ENTITY, + *mpLog ); + + // Validate protocol entities + bRC &= ValidateStructures(); + + // Build internal protocol entity name map + bRC &= AssembleEntityNameMap(); + + return bRC; +} + +/*=========================================================================== +METHOD: + LoadStructureTables (Internal Method) + +DESCRIPTION: + Load all tables related to structure (entity, struct, field) + +PARAMETERS + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::LoadStructureTables() +{ + bool bRC = true; + + // Calculate sizes + int nFieldSize = (const char*)&_binary_QMI_Field_txt_end - + (const char*)&_binary_QMI_Field_txt_start; + int nStructSize = (const char*)&_binary_QMI_Struct_txt_end - + (const char*)&_binary_QMI_Struct_txt_start; + int nEntitySize = (const char*)&_binary_QMI_Entity_txt_end - + (const char*)&_binary_QMI_Entity_txt_start; + + bRC &= LoadDB2Table( (const char*)&_binary_QMI_Field_txt_start, + nFieldSize, + mEntityFields, + false, + DB2_TABLE_PROTOCOL_FIELD, + *mpLog ); + + bRC &= LoadDB2Table( (const char*)&_binary_QMI_Struct_txt_start, + nStructSize, + mEntityStructs, + false, + DB2_TABLE_PROTOCOL_STRUCT, + *mpLog ); + + bRC &= LoadDB2Table( (const char*)&_binary_QMI_Entity_txt_start, + nEntitySize, + mProtocolEntities, + false, + DB2_TABLE_PROTOCOL_ENTITY, + *mpLog ); + + // Validate protocol entities + bRC &= ValidateStructures(); + + // Build internal protocol entity name map + bRC &= AssembleEntityNameMap(); + + return bRC; +} + +/*=========================================================================== +METHOD: + LoadEnumTables (Internal Method) + +DESCRIPTION: + Load all enumeration tables + +PARAMETERS + pBasePath [ I ] - Base path to database files + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::LoadEnumTables( LPCSTR pBasePath ) +{ + bool bRC = true; + + std::string basePath = CheckAndSetBasePath( pBasePath ); + basePath += "/"; + + + std::string fn = basePath; + fn += DB2_FILE_ENUM_MAIN; + bRC &= LoadDB2Table( (LPCSTR)fn.c_str(), + mEnumNameMap, + false, + DB2_TABLE_ENUM_MAIN, + *mpLog ); + + fn = basePath; + fn += DB2_FILE_ENUM_ENTRY; + bRC &= LoadDB2Table( (LPCSTR)fn.c_str(), + mEnumEntryMap, + false, + DB2_TABLE_ENUM_ENTRY, + *mpLog ); + + // Build the enum map + bRC &= AssembleEnumMap(); + + return bRC; +} + +/*=========================================================================== +METHOD: + LoadEnumTables (Internal Method) + +DESCRIPTION: + Load all enumeration tables + +PARAMETERS + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::LoadEnumTables() +{ + bool bRC = true; + // Calculate sizes + int nEnumSize = (const char*)&_binary_QMI_Enum_txt_end - + (const char*)&_binary_QMI_Enum_txt_start; + int nEnumEntrySize = (const char*)&_binary_QMI_EnumEntry_txt_end - + (const char*)&_binary_QMI_EnumEntry_txt_start; + + bRC &= LoadDB2Table( (const char*)&_binary_QMI_Enum_txt_start, + nEnumSize, + mEnumNameMap, + false, + DB2_TABLE_ENUM_MAIN, + *mpLog ); + + bRC &= LoadDB2Table( (const char*)&_binary_QMI_EnumEntry_txt_start, + nEnumEntrySize, + mEnumEntryMap, + false, + DB2_TABLE_ENUM_ENTRY, + *mpLog ); + + // Build the enum map + bRC &= AssembleEnumMap(); + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateStructures (Internal Method) + +DESCRIPTION: + Validate (and attempt repair of) structure related tables + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateStructures() +{ + // Assume success + bool bRC = true; + + tDB2EntityMap::iterator pEntity = mProtocolEntities.begin(); + while (pEntity != mProtocolEntities.end()) + { + sDB2ProtocolEntity & entity = pEntity->second; + + // Structure ID given? + if (entity.mStructID != -1) + { + // Yes, validate individual structure + std::set fields; + bool bValid = ValidateStructure( (ULONG)entity.mStructID, fields, 0 ); + + // Not valid? + if (bValid == false) + { + // Invalid structure, reset to none + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid struct, ID " << entity.mStructID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + entity.mStructID = -1; + + // We found at least one bad structure + bRC = false; + } + } + + pEntity++; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateStructure (Internal Method) + +DESCRIPTION: + Validate a single structure + +PARAMETERS: + structID [ I ] - ID of structure being evaluated + fields [I/O] - List of 'known' field IDs + depth [I/O] - Recursion depth + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateStructure( + ULONG structID, + std::set & fields, + ULONG depth ) +{ + // Assume success + bool bRC = true; + + // Reached our limit? + if (depth++ >= MAX_NESTING_LEVEL) + { + // Invalid structure + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Max depth exceeded, possible loop, struct ID " << structID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + return false; + } + + // Grab first fragment of structure + std::pair id( structID, 0 ); + tDB2FragmentMap::const_iterator pFrag = mEntityStructs.find( id ); + + // Did we find the first fragment? + if (pFrag == mEntityStructs.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Missing initial fragment, struct ID " << structID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + + // Iterate over each fragment in the structure + while (pFrag != mEntityStructs.end() && pFrag->second.mStructID == structID) + { + // Grab fragment + const sDB2Fragment & frag = pFrag->second; + + // Variable array or optional fragment? + if ( (frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY) + || (frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY2) ) + { + bRC = ValidateArraySpecifier( frag, fields ); + } + else if (frag.mModifierType == eDB2_MOD_OPTIONAL) + { + bRC = ValidateOptionalSpecifier( frag, fields ); + } + else if (frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY3) + { + bRC = ValidateExpressionSpecifier( frag, fields ); + } + else if ( (frag.mModifierType == eDB2_MOD_VARIABLE_STRING1) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING2) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING3) ) + { + bRC = ValidateArraySpecifier( frag, fields ); + if (bRC == true) + { + // The field being modified has to be a fixed length string + ULONG fieldID = frag.mFragmentValue; + tDB2FieldMap::const_iterator pIter = mEntityFields.find( fieldID ); + if (pIter != mEntityFields.end()) + { + bool bString = false; + + const sDB2Field & ft = pIter->second; + if (ft.mType == eDB2_FIELD_STD) + { + if ( (ft.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_A) + || (ft.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_U) + || (ft.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_U8) ) + { + if ( (ft.mTypeVal != (ULONG)eDB2_FIELD_STDTYPE_STRING_U8) + || (frag.mModifierType != eDB2_MOD_VARIABLE_STRING3) ) + { + // Not the invalid combination of character length and + // varaible length characters + bString = true; + } + } + } + + if (bString == false) + { + // Not a string so why the string modifier? + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid string modifier, struct ID " << structID + << ", ID " << fieldID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + } + } + + if (bRC == true) + { + // What type of fragment is this? + switch (frag.mFragmentType) + { + case eDB2_FRAGMENT_FIELD: + { + ULONG fieldID = frag.mFragmentValue; + bRC = ValidateField( structID, fieldID, fields ); + } + break; + + case eDB2_FRAGMENT_VARIABLE_PAD_BITS: + case eDB2_FRAGMENT_VARIABLE_PAD_BYTES: + { + // Does this field exist in the entity? + ULONG fieldID = frag.mFragmentValue; + if (fields.find( fieldID ) == fields.end()) + { + // No + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid pad, struct ID " << structID + << ", ID " << fieldID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + break; + + case eDB2_FRAGMENT_STRUCT: + { + // Grab structure ID and recurse + ULONG structID = frag.mFragmentValue; + bRC = ValidateStructure( structID, fields, depth ); + } + break; + + default: + break; + } + } + + // Did an error occur? + if (bRC == false) + { + break; + } + + pFrag++; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateField (Internal Method) + +DESCRIPTION: + Validate a single field + +PARAMETERS: + structID [ I ] - ID of referencing structure + fieldID [ I ] - ID of field being evaluated + fields [I/O] - List of 'known' field IDs + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateField( + ULONG structID, + ULONG fieldID, + std::set & fields ) +{ + // Assume success + bool bRC = true; + + tDB2FieldMap::const_iterator pIter = mEntityFields.find( fieldID ); + if (pIter == mEntityFields.end()) + { + // No + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid field, struct ID " << structID + << ", ID " << fieldID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + else + { + // Mark field as part of this structure + fields.insert( fieldID ); + + // Is this field an enumeration? + const sDB2Field & theField = pIter->second; + if ( (theField.mType == eDB2_FIELD_ENUM_UNSIGNED) + || (theField.mType == eDB2_FIELD_ENUM_SIGNED) ) + { + // Yes, check that the enum exists + if (mEnumNameMap.find( theField.mTypeVal ) == mEnumNameMap.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_FIELD + << "] Invalid enumeration ID, field ID " << fieldID + << ", enum ID " << theField.mTypeVal; + + mpLog->Log( tmp.str(), eDB2_STATUS_WARNING ); + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateArraySpecifier (Internal Method) + +DESCRIPTION: + Validate an array specifier + +PARAMETERS: + frag [ I ] - Fragment containing array specifier + fields [ I ] - List of 'known' field IDs + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateArraySpecifier( + const sDB2Fragment & frag, + const std::set & fields ) +{ + // Assume success + bool bRC = true; + + // Even an array specifier to start with? + if (frag.mpModifierValue == 0 || frag.mpModifierValue == EMPTY_STRING) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Missing array specifier, struct ID " << frag.mStructID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + else if ( (frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING1) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING2) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING3) ) + { + ULONG id = strtoul( frag.mpModifierValue, 0, 0 ); + if (fields.find( id ) == fields.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid modifier specifier, struct ID " << frag.mStructID + << ", ID " << id; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + else if (frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY2) + { + // Parse condition to tokens (start stop) + int nSize = strlen( frag.mpModifierValue ) + 1; + + char * pCopy = new char[ nSize ]; + if (pCopy == NULL) + { + return false; + } + + memcpy( pCopy, frag.mpModifierValue, nSize ); + + std::vector indices; + CSVStringToContainer( " ", pCopy, indices ); + + delete [] pCopy; + if (indices.size() != 2) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid array specifier, struct ID " << frag.mStructID + << ", " << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + else + { + ULONG sID = indices[0]; + ULONG eID = indices[1]; + + if ( (fields.find( sID ) == fields.end()) + || (fields.find( eID ) == fields.end()) ) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid array specifier, struct ID " << frag.mStructID + << ", IDs " << sID << " " << eID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + } + else + { + ASSERT( 0 ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateOptionalSpecifier (Internal Method) + +DESCRIPTION: + Validate a simple optional fragment specifier + +PARAMETERS: + frag [ I ] - Fragment containing optional fragment specifier + fields [ I ] - List of 'known' field IDs + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateOptionalSpecifier( + const sDB2Fragment & frag, + const std::set & fields ) +{ + // Assume success + bool bRC = true; + + ASSERT( frag.mModifierType == eDB2_MOD_OPTIONAL ); + + // Even an optional specifier to start with? + if (frag.mpModifierValue == 0 || frag.mpModifierValue == EMPTY_STRING) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Missing optional specifier, struct ID " << frag.mStructID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + return false; + } + + ULONG conID; + eDB2Operator conOp; + LONGLONG conVal; + bool bF2F; + + // Parse condition + LPCSTR pCon = frag.mpModifierValue; + bRC = sDB2Fragment::ParseCondition( pCon, conID, conOp, conVal, bF2F ); + if (bRC == true) + { + // Does the given field ID exist as part of this entity? + if (fields.find( conID ) == fields.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", unknown field ID " << conID << "/" << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + + if (bF2F == true) + { + // Does the given field ID exist as part of this entity? + if (fields.find( (ULONG)conVal ) == fields.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", unknown field ID " << (ULONG)conVal + << "/" << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + } + else + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", " << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateExpressionSpecifier (Internal Method) + +DESCRIPTION: + Validate a simple expression fragment specifier + +PARAMETERS: + frag [ I ] - Fragment containing expression fragment specifier + fields [ I ] - List of 'known' field IDs + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateExpressionSpecifier( + const sDB2Fragment & frag, + const std::set & fields ) +{ + // Assume success + bool bRC = true; + + ASSERT( frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY3 ); + + // Even an expression specifier to start with? + if (frag.mpModifierValue == 0 || frag.mpModifierValue == EMPTY_STRING) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Missing array specifier, struct ID " << frag.mStructID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + return false; + } + + ULONG exprID; + eDB2ExpOperator exprOp; + LONGLONG exprVal; + bool bF2F; + + // Parse expression + LPCSTR pExpr = frag.mpModifierValue; + bRC = sDB2Fragment::ParseExpression( pExpr, exprID, exprOp, exprVal, bF2F ); + if (bRC == true) + { + // Does the given field ID exist as part of this entity? + if (fields.find( exprID ) == fields.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", unknown field ID " << exprID + << "/" << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + + if (bF2F == true) + { + // Does the given field ID exist as part of this entity? + if (fields.find( (ULONG)exprVal ) == fields.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", unknown field ID " << (ULONG)exprID + << "/" << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + } + else + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", " << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + } + + return bRC; +} + diff --git a/gobi-api/GobiAPI_1.0.40/Core/CoreDatabase.h b/gobi-api/GobiAPI_1.0.40/Core/CoreDatabase.h new file mode 100755 index 0000000..c4c47e2 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/CoreDatabase.h @@ -0,0 +1,2127 @@ +/*=========================================================================== +FILE: + CoreDatabase.h + +DESCRIPTION: + Declaration of cCoreDatabase class + +PUBLIC CLASSES AND METHODS: + cCoreDatabase + This class represents the run-time (read only) version of the + core library database + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include +#include +#include +#include + +#include "DB2TextFile.h" + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +class cDB2NavTree; + +//--------------------------------------------------------------------------- +// Prototypes +//--------------------------------------------------------------------------- + +// Convert a string (in quotes) to a string (minus) quotes and copy into +// an allocated buffer +LPCSTR CopyQuotedString( LPSTR pString ); + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// An empty (but not NULL) string +extern LPCSTR EMPTY_STRING; + +// Value seperator for database text +extern LPCSTR DB2_VALUE_SEP; + +// Sub-value (i.e. within a particular value) seperator for database text +extern LPCSTR DB2_SUBVAL_SEP; + +// Database table file names +extern LPCSTR DB2_FILE_PROTOCOL_FIELD; +extern LPCSTR DB2_FILE_PROTOCOL_STRUCT; +extern LPCSTR DB2_FILE_PROTOCOL_ENTITY; +extern LPCSTR DB2_FILE_ENUM_MAIN; +extern LPCSTR DB2_FILE_ENUM_ENTRY; + +// Database start pointers +extern const int _binary_QMI_Field_txt_start; +extern const int _binary_QMI_Struct_txt_start; +extern const int _binary_QMI_Entity_txt_start; +extern const int _binary_QMI_Enum_txt_start; +extern const int _binary_QMI_EnumEntry_txt_start; + +// Database end pointers +extern const int _binary_QMI_Field_txt_end; +extern const int _binary_QMI_Struct_txt_end; +extern const int _binary_QMI_Entity_txt_end; +extern const int _binary_QMI_Enum_txt_end; +extern const int _binary_QMI_EnumEntry_txt_end; + + +// Status levels for DB2 logging +enum eDB2StatusLevel +{ + eDB2_STATUS_BEGIN = -1, + + eDB2_STATUS_INFO, // Informational string + eDB2_STATUS_WARNING, // Warning string + eDB2_STATUS_ERROR, // Error string + + eDB2_STATUS_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2StatusLevel validity check + +PARAMETERS: + lvl [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2StatusLevel lvl ) +{ + bool retVal = false; + if (lvl > eDB2_STATUS_BEGIN && lvl < eDB2_STATUS_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// Class cDB2StatusLog +// +// Class that defines status logging interface for DB2 initialization +// and exit related information +/*=========================================================================*/ +class cDB2StatusLog +{ + public: + // Log an error string + virtual void Log( + LPCSTR pLog, + eDB2StatusLevel lvl = eDB2_STATUS_ERROR ) = 0; + + // Log an error string + virtual void Log( + const std::string & log, + eDB2StatusLevel lvl = eDB2_STATUS_ERROR ) = 0; +}; + +/*=========================================================================*/ +// Class cDB2TraceLog +// Default error logging interface for DB2 initialization and exit +// related information - sends output to TRACE +/*=========================================================================*/ +class cDB2TraceLog : public cDB2StatusLog +{ + public: + // (Inline) Constructor + cDB2TraceLog() { }; + + // (Inline) Destructor + ~cDB2TraceLog() { }; + + + // (Inline) Log an error string + virtual void Log( + LPCSTR pLog, + eDB2StatusLevel lvl = eDB2_STATUS_ERROR ) + { + if (pLog != 0 && pLog[0] != 0) + { + std::string formatString = "[0x%02X] "; + formatString += pLog; + formatString += '\n'; + + //Note: TRACE is just an alias for printf if DEBUG is used + TRACE( formatString.c_str(), lvl ); + } + }; + + // (Inline) Log an error string + virtual void Log( + const std::string & log, + eDB2StatusLevel lvl = eDB2_STATUS_ERROR ) + { + if (log.size() > 0) + { + Log( log.c_str(), lvl ); + } + }; + +}; + +// The default logger (for backwards compatibility) +extern cDB2TraceLog gDB2DefaultLog; + + +/*=========================================================================== +METHOD: + LoadDB2Table (Free Public Method) + +DESCRIPTION: + Load a database table + +PARAMETERS: + pFile [ I ] - The file to load the table from + cont [I/0] - The current/resulting database table + bDuplicatesOK [ I ] - Duplicate keys acceptable? + pName [ I ] - Name (for error reporting) + log [I/O] - Where to log errors + +RETURN VALUE: + bool +===========================================================================*/ +template +bool LoadDB2Table( + LPCSTR pFile, + Container & cont, + bool bDuplicatesOK = false, + LPCSTR pName = 0, + cDB2StatusLog & log = gDB2DefaultLog ) +{ + // Assume success + bool bRC = true; + // Sanity check error reporting name + if (pName == 0 || pName[0] == 0) + { + pName = "?"; + } + + // Sanity check file name + if (pFile == 0 || pFile[0] == 0) + { + // Bad file + std::ostringstream tmp; + tmp << "DB [" << pName << "] Invalid file name"; + + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + return false; + } + + ULONG lineNum = 0; + + // Attempt to open the file + cDB2TextFile inFile( pFile ); + if (inFile.IsValid() == true) + { + std::string line; + while (inFile.ReadLine( line ) == true) + { + std::string lineCopy = line; + + int nLineSize = lineCopy.size(); + LPSTR pLine = new CHAR[ nLineSize + 1 ]; + if (pLine == NULL) + { + return false; + } + + memcpy( pLine, line.c_str(), nLineSize ); + + // Enforce null terminator + pLine[ nLineSize ] = 0; + + typename Container::mapped_type theType; + bool bOK = theType.FromString( pLine ); + if (bOK == true) + { + // Grab key + typename Container::key_type theKey = theType.GetKey(); + + // Key already exists? + typename Container::iterator pIter; + pIter = cont.find( theKey ); + + if (pIter != cont.end() && bDuplicatesOK == false) + { + // The key already exists which indicates a (recoverable) error + std::ostringstream tmp; + tmp << "DB [" << pName << "] Duplicate key, line " + << lineNum << " (" << line.c_str() << ")"; + + log.Log( tmp.str(), eDB2_STATUS_WARNING ); + + // Free the current object + pIter->second.FreeAllocatedStrings(); + + // ... and then replace it + pIter->second = theType; + } + else + { + typename Container::value_type entry( theKey, theType ); + cont.insert( entry ); + } + } + else if (lineCopy.size() > 0) + { + // Error parsing line + std::ostringstream tmp; + tmp << "DB [" << pName << "] Parsing error, line " + << lineNum << " (" << line.c_str() << ")"; + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + theType.FreeAllocatedStrings(); + bRC = false; + } + delete [] pLine; + lineNum++; + } + } + else + { +#ifdef DEBUG + // Could not open the file + std::ostringstream tmp; + tmp << "DB [" << pName << "] Error opening file"; + + log.Log( tmp.str(), eDB2_STATUS_WARNING ); +#endif + + bRC = false; + } + + return bRC; +}; + +/*=========================================================================== +METHOD: + LoadDB2Table (Free Public Method) + +DESCRIPTION: + Load a database table + +PARAMETERS: + pStart [ I ] - Start location of database + nSize [ I ] - Size of database + cont [I/0] - The current/resulting database table + bDuplicatesOK [ I ] - Duplicate keys acceptable? + pName [ I ] - Name (for error reporting) + log [I/O] - Where to log errors + +RETURN VALUE: + bool +===========================================================================*/ +template +bool LoadDB2Table( + const char * pStart, + const int nSize, + Container & cont, + bool bDuplicatesOK = false, + LPCSTR pName = 0, + cDB2StatusLog & log = gDB2DefaultLog ) +{ + // Assume success + bool bRC = true; + + // Sanity check error reporting name + if (pName == 0 || pName[0] == 0) + { + pName = "?"; + } + + ULONG lineNum = 0; + + // Attempt to open the file + cDB2TextFile inFile( pStart, nSize ); + if (inFile.IsValid() == true) + { + std::string line; + while (inFile.ReadLine( line ) == true) + { + std::string lineCopy = line; + + int nLineSize = lineCopy.size(); + LPSTR pLine = new CHAR[ nLineSize + 1 ]; + if (pLine == NULL) + { + return false; + } + + memcpy( pLine, lineCopy.c_str(), nLineSize ); + + // Enforce null terminator + pLine[ nLineSize ] = 0; + + typename Container::mapped_type theType; + bool bOK = theType.FromString( pLine ); + if (bOK == true) + { + // Grab key + typename Container::key_type theKey = theType.GetKey(); + + // Key already exists? + typename Container::iterator pIter; + pIter = cont.find( theKey ); + + if (pIter != cont.end() && bDuplicatesOK == false) + { + // The key already exists which indicates a (recoverable) error + std::ostringstream tmp; + tmp << "DB [" << pName << "] Duplicate key, line " + << lineNum << " (" << line.c_str() << ")"; + + log.Log( tmp.str(), eDB2_STATUS_WARNING ); + + // Free the current object + pIter->second.FreeAllocatedStrings(); + + // ... and then replace it + pIter->second = theType; + } + else + { + typename Container::value_type entry( theKey, theType ); + cont.insert( entry ); + } + } + else if (lineCopy.size() > 0) + { + // Error parsing line + std::ostringstream tmp; + tmp << "DB [" << pName << "] Parsing error, line " + << lineNum << " (" << line.c_str() << ")"; + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + theType.FreeAllocatedStrings(); + bRC = false; + } + + delete [] pLine; + lineNum++; + } + } + else + { +#ifdef DEBUG + // Could not open the file + std::ostringstream tmp; + tmp << "DB [" << pName << "] Error opening file"; + + log.Log( tmp.str(), eDB2_STATUS_WARNING ); +#endif + + bRC = false; + } + + return bRC; +}; + +/*=========================================================================== +METHOD: + FreeDB2Table (Free Public Method) + +DESCRIPTION: + Free up the string allocations in a database table, emptying the + table in the process + +PARAMETERS: + cont [ I ] - The database table + +RETURN VALUE: + None +===========================================================================*/ +template +void FreeDB2Table( Container & cont ) +{ + typename Container::iterator pIter = cont.begin(); + while (pIter != cont.end()) + { + typename Container::mapped_type & theType = pIter->second; + theType.FreeAllocatedStrings(); + + pIter++; + } + + cont.clear(); +}; + +/*=========================================================================*/ +// eDB2EntityType Enumeration +// +// Database protocol entity header/payload type enumeration +/*=========================================================================*/ +enum eDB2EntityType +{ + eDB2_ET_ENUM_BEGIN = -1, + + eDB2_ET_DIAG_REQ, // 0 Synchronous request + eDB2_ET_DIAG_RSP, // 1 Synchronous response + eDB2_ET_DIAG_SUBSYS_REQ, // 2 Synchronous subsystem dispatch request + eDB2_ET_DIAG_SUBSYS_RSP, // 3 Synchronous subsystem dispatch response + eDB2_ET_DIAG_EVENT, // 4 Asynchronous event + eDB2_ET_DIAG_LOG, // 5 Asynchronous log + eDB2_ET_DIAG_NV_ITEM, // 6 NVRAM item read/write + eDB2_ET_RESERVED7, // 7 Reserved + eDB2_ET_RESERVED8, // 8 Reserved + eDB2_ET_DIAG_SUBSYS2_REQ, // 9 Sync subsystem V2 dispatch request + eDB2_ET_DIAG_SUBSYS2_RSP, // 10 Sync subsystem V2 dispatch response + eDB2_ET_DIAG_SUBSYS2_ASYNC, // 11 Async subsystem V2 dispatch response + + eDB2_ET_QMI_BEGIN = 29, // 29 Start of QMI section + + eDB2_ET_QMI_CTL_REQ, // 30 QMI CTL request + eDB2_ET_QMI_CTL_RSP, // 31 QMI CTL response + eDB2_ET_QMI_CTL_IND, // 32 QMI CTL indication + eDB2_ET_QMI_WDS_REQ, // 33 QMI WDS request + eDB2_ET_QMI_WDS_RSP, // 34 QMI WDS response + eDB2_ET_QMI_WDS_IND, // 35 QMI WDS indication + eDB2_ET_QMI_DMS_REQ, // 36 QMI DMS request + eDB2_ET_QMI_DMS_RSP, // 37 QMI DMS response + eDB2_ET_QMI_DMS_IND, // 38 QMI DMS indication + eDB2_ET_QMI_NAS_REQ, // 39 QMI NAS request + eDB2_ET_QMI_NAS_RSP, // 40 QMI NAS response + eDB2_ET_QMI_NAS_IND, // 41 QMI NAS indication + eDB2_ET_QMI_QOS_REQ, // 42 QMI QOS request + eDB2_ET_QMI_QOS_RSP, // 43 QMI QOS response + eDB2_ET_QMI_QOS_IND, // 44 QMI QOS indication + eDB2_ET_QMI_WMS_REQ, // 45 QMI WMS request + eDB2_ET_QMI_WMS_RSP, // 46 QMI WMS response + eDB2_ET_QMI_WMS_IND, // 47 QMI WMS indication + eDB2_ET_QMI_PDS_REQ, // 48 QMI PDS request + eDB2_ET_QMI_PDS_RSP, // 49 QMI PDS response + eDB2_ET_QMI_PDS_IND, // 50 QMI PDS indication + eDB2_ET_QMI_AUTH_REQ, // 51 QMI AUTH request + eDB2_ET_QMI_AUTH_RSP, // 52 QMI AUTH response + eDB2_ET_QMI_AUTH_IND, // 53 QMI AUTH indication + eDB2_ET_QMI_CAT_REQ, // 54 QMI CAT request + eDB2_ET_QMI_CAT_RSP, // 55 QMI CAT response + eDB2_ET_QMI_CAT_IND, // 56 QMI CAT indication + eDB2_ET_QMI_RMS_REQ, // 57 QMI RMS request + eDB2_ET_QMI_RMS_RSP, // 58 QMI RMS response + eDB2_ET_QMI_RMS_IND, // 59 QMI RMS indication + eDB2_ET_QMI_OMA_REQ, // 60 QMI OMA request + eDB2_ET_QMI_OMA_RSP, // 61 QMI OMA response + eDB2_ET_QMI_OMA_IND, // 62 QMI OMA indication + eDB2_ET_QMI_VOICE_REQ, // 63 QMI voice request + eDB2_ET_QMI_VOICE_RSP, // 64 QMI voice response + eDB2_ET_QMI_VOICE_IND, // 65 QMI voice indication + + eDB2_ET_QMI_END, // 63 End of QMI section + + eDB2_ET_ENUM_END + +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2EntityType validity check + +PARAMETERS: + et [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2EntityType et ) +{ + bool retVal = false; + if ( (et > eDB2_ET_ENUM_BEGIN && et <= eDB2_ET_DIAG_SUBSYS2_ASYNC) + || (et > eDB2_ET_QMI_BEGIN && et < eDB2_ET_QMI_END) ) + + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsDiagEntityType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the DIAG protocol? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsDiagEntityType( eDB2EntityType entityType ) +{ + bool retVal = false; + if (entityType == eDB2_ET_DIAG_REQ + || entityType == eDB2_ET_DIAG_RSP + || entityType == eDB2_ET_DIAG_SUBSYS_REQ + || entityType == eDB2_ET_DIAG_SUBSYS_RSP + || entityType == eDB2_ET_DIAG_EVENT + || entityType == eDB2_ET_DIAG_LOG + || entityType == eDB2_ET_DIAG_NV_ITEM + || entityType == eDB2_ET_DIAG_SUBSYS2_REQ + || entityType == eDB2_ET_DIAG_SUBSYS2_RSP + || entityType == eDB2_ET_DIAG_SUBSYS2_ASYNC) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsDiagEntityRequestType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the DIAG protocol and if so + does it represent a request? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsDiagEntityRequestType( eDB2EntityType entityType ) +{ + bool retVal = false; + if (entityType == eDB2_ET_DIAG_REQ + || entityType == eDB2_ET_DIAG_SUBSYS_REQ + || entityType == eDB2_ET_DIAG_SUBSYS2_REQ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsDiagEntityResponseType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the DIAG protocol and if so + does it represent a response? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsDiagEntityResponseType( eDB2EntityType entityType ) +{ + bool retVal = false; + if (entityType == eDB2_ET_DIAG_RSP + || entityType == eDB2_ET_DIAG_SUBSYS_RSP + || entityType == eDB2_ET_DIAG_SUBSYS2_RSP) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsDiagEntityAsyncType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the DIAG protocol and if so + does it represent asynchronous incoming data? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsDiagEntityAsyncType( eDB2EntityType entityType ) +{ + bool retVal = false; + if (entityType == eDB2_ET_DIAG_EVENT + || entityType == eDB2_ET_DIAG_LOG + || entityType == eDB2_ET_DIAG_SUBSYS2_ASYNC) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIEntityType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the QMI protocol? + +PARAMETERS: + et [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIEntityType( eDB2EntityType et ) +{ + bool retVal = false; + if (et > eDB2_ET_QMI_BEGIN && et < eDB2_ET_QMI_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIEntityRequestType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the QMI protocol and if so + does it represent a request? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIEntityRequestType( eDB2EntityType entityType ) +{ + bool retVal = false; + + // One QMI service is always a triplet of REQ/RSP/IND + DWORD baseVal = (DWORD)eDB2_ET_QMI_BEGIN + 1; + if ((DWORD)entityType % baseVal == 0) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIEntityResponseType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the QMI protocol and if so + does it represent a response? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIEntityResponseType( eDB2EntityType entityType ) +{ + bool retVal = false; + + // One QMI service is always a triplet of REQ/RSP/IND + DWORD baseVal = (DWORD)eDB2_ET_QMI_BEGIN + 1; + if ((DWORD)entityType % baseVal == 1) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIEntityIndicationType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the QMI protocol and if so + does it represent an indication? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIEntityIndicationType( eDB2EntityType entityType ) +{ + bool retVal = false; + + // One QMI service is always a triplet of REQ/RSP/IND + DWORD baseVal = (DWORD)eDB2_ET_QMI_BEGIN + 1; + if ((DWORD)entityType % baseVal == 2) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2FragmentType Enumeration +// +// Database fragment type enumeration - determines in what table +// (or manner) the fragment is described +/*=========================================================================*/ +enum eDB2FragmentType +{ + eDB2_FRAGMENT_TYPE_ENUM_BEGIN = -1, + + eDB2_FRAGMENT_FIELD, // 0 Simple field fragment + eDB2_FRAGMENT_STRUCT, // 1 Structure fragment + eDB2_FRAGMENT_CONSTANT_PAD, // 2 Pad fragment, fixed length (bits) + eDB2_FRAGMENT_VARIABLE_PAD_BITS, // 3 Pad fragment, variable (bits) + eDB2_FRAGMENT_VARIABLE_PAD_BYTES, // 4 Pad fragment, variable (bytes) + eDB2_FRAGMENT_FULL_BYTE_PAD, // 5 Pad fragment, pad to a full byte + eDB2_FRAGMENT_MSB_2_LSB, // 6 Switch to MSB -> LSB order + eDB2_FRAGMENT_LSB_2_MSB, // 7 Switch to LSB -> MSB order + + eDB2_FRAGMENT_TYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2FragmentType validity check + +PARAMETERS: + fragType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2FragmentType fragType ) +{ + bool retVal = false; + if (fragType > eDB2_FRAGMENT_TYPE_ENUM_BEGIN + && fragType < eDB2_FRAGMENT_TYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2ModifierType Enumeration +// +// Database fragment modifier type enumeration - determines how a +// fragment is modified/used +/*=========================================================================*/ +enum eDB2ModifierType +{ + eDB2_MOD_TYPE_ENUM_BEGIN = -1, + + eDB2_MOD_NONE, // 0 Modifier is not used + eDB2_MOD_CONSTANT_ARRAY, // 1 Constant (elements) array + eDB2_MOD_VARIABLE_ARRAY, // 2 Variable (elements) array + eDB2_MOD_OBSOLETE_3, // 3 Constant (bits) array [OBS] + eDB2_MOD_OBSOLETE_4, // 4 Variable (bits) array [OBS] + eDB2_MOD_OPTIONAL, // 5 Fragment is optional + eDB2_MOD_VARIABLE_ARRAY2, // 6 Variable (elements) array, start/stop given + eDB2_MOD_VARIABLE_ARRAY3, // 7 Variable (elements) array, simple expression + eDB2_MOD_VARIABLE_STRING1, // 8 Variable length string (bit length) + eDB2_MOD_VARIABLE_STRING2, // 9 Variable length string (byte length) + eDB2_MOD_VARIABLE_STRING3, // 10 Variable length string (character length) + + eDB2_MOD_TYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + ModifiedToArray (Inline Method) + +DESCRIPTION: + Does this modifier indicate an array? + +PARAMETERS: + modType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool ModifiedToArray( eDB2ModifierType modType ) +{ + bool bRC = false; + if ( (modType == eDB2_MOD_CONSTANT_ARRAY) + || (modType == eDB2_MOD_VARIABLE_ARRAY) + || (modType == eDB2_MOD_VARIABLE_ARRAY2) + || (modType == eDB2_MOD_VARIABLE_ARRAY3) ) + { + bRC = true; + } + + return bRC; +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2ModifierType validity check + +PARAMETERS: + modType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2ModifierType modType ) +{ + bool retVal = false; + if (modType > eDB2_MOD_TYPE_ENUM_BEGIN + && modType < eDB2_MOD_TYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2FieldType Enumeration +// +// Database field type enumeration - determines whether the field in +// question is a standard type or an enumeration +/*=========================================================================*/ +enum eDB2FieldType +{ + eDB2_FIELD_TYPE_ENUM_BEGIN = -1, + + eDB2_FIELD_STD, // 0 Field is a standard type (see below) + eDB2_FIELD_ENUM_UNSIGNED, // 1 Field is an unsigned enumerated type + eDB2_FIELD_ENUM_SIGNED, // 2 Field is a signed enumerated type + + eDB2_FIELD_TYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2FieldType validity check + +PARAMETERS: + fieldType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2FieldType fieldType ) +{ + bool retVal = false; + if (fieldType > eDB2_FIELD_TYPE_ENUM_BEGIN + && fieldType < eDB2_FIELD_TYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2StdFieldType Enumeration +// +// Database standard field type enumeration +/*=========================================================================*/ +enum eDB2StdFieldType +{ + eDB2_FIELD_STDTYPE_ENUM_BEGIN = -1, + + eDB2_FIELD_STDTYPE_BOOL, // 0 Field is a boolean (0/1, false/true) + eDB2_FIELD_STDTYPE_INT8, // 1 Field is 8-bit signed integer + eDB2_FIELD_STDTYPE_UINT8, // 2 Field is 8-bit unsigned integer + eDB2_FIELD_STDTYPE_INT16, // 3 Field is 16-bit signed integer + eDB2_FIELD_STDTYPE_UINT16, // 4 Field is 16-bit unsigned integer + eDB2_FIELD_STDTYPE_INT32, // 5 Field is 32-bit signed integer + eDB2_FIELD_STDTYPE_UINT32, // 6 Field is 32-bit unsigned integer + eDB2_FIELD_STDTYPE_INT64, // 7 Field is 64-bit signed integer + eDB2_FIELD_STDTYPE_UINT64, // 8 Field is 64-bit unsigned integer + eDB2_FIELD_STDTYPE_STRING_A, // 9 ANSI fixed length string + eDB2_FIELD_STDTYPE_STRING_U, // 10 UNICODE fixed length string + eDB2_FIELD_STDTYPE_STRING_ANT, // 11 ANSI NULL terminated string + eDB2_FIELD_STDTYPE_STRING_UNT, // 12 UNICODE NULL terminated string + eDB2_FIELD_STDTYPE_FLOAT32, // 13 Field is 32-bit floating point value + eDB2_FIELD_STDTYPE_FLOAT64, // 14 Field is 64-bit floating point value + eDB2_FIELD_STDTYPE_STRING_U8, // 15 UTF-8 encoded fixed length string + eDB2_FIELD_STDTYPE_STRING_U8NT, // 16 UTF-8 encoded NULL terminated string + + eDB2_FIELD_STDTYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2StdFieldType validity check + +PARAMETERS: + fieldType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2StdFieldType fieldType ) +{ + bool retVal = false; + if (fieldType > eDB2_FIELD_STDTYPE_ENUM_BEGIN + && fieldType < eDB2_FIELD_STDTYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2Operator Enumeration +// +// Database conditional fragment operator type enumeration +/*=========================================================================*/ +enum eDB2Operator +{ + eDB2_OP_TYPE_ENUM_BEGIN = -1, + + eDB2_OP_LT, + eDB2_OP_LTE, + eDB2_OP_EQ, + eDB2_OP_NEQ, + eDB2_OP_GTE, + eDB2_OP_GT, + eDB2_OP_DIV, + eDB2_OP_NDIV, + + eDB2_OP_TYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2Operator validity check + +PARAMETERS: + op [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2Operator op ) +{ + bool retVal = false; + if (op > eDB2_OP_TYPE_ENUM_BEGIN + && op < eDB2_OP_TYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2ExpOperator Enumeration +// +// Database simple expression operator type enumeration +/*=========================================================================*/ +enum eDB2ExpOperator +{ + eDB2_EXPOP_TYPE_ENUM_BEGIN = -1, + + eDB2_EXPOP_ADD, + eDB2_EXPOP_SUB, + eDB2_EXPOP_MUL, + eDB2_EXPOP_DIV, + eDB2_EXPOP_REM, + eDB2_EXPOP_MIN, + eDB2_EXPOP_MAX, + + eDB2_EXPOP_TYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2ExpOperator validity check + +PARAMETERS: + op [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2ExpOperator op ) +{ + bool retVal = false; + if (op > eDB2_EXPOP_TYPE_ENUM_BEGIN + && op < eDB2_EXPOP_TYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// Struct sDB2ProtocolEntity +// +// Structure that defines the schema for the protocol entity table +/*=========================================================================*/ +struct sDB2ProtocolEntity +{ + public: + // (Inline) Default constructor + sDB2ProtocolEntity() + : mType( eDB2_ET_ENUM_BEGIN ), + mStructID( -1 ), + mFormatID( -1 ), + mbInternal( false ), + mFormatExID( -1 ), + mpName( EMPTY_STRING ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + std::vector GetKey() const + { + return mID; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Type of protocol entity 'header/payload' */ + eDB2EntityType mType; + + /* Multi-value ID (includes above type) */ + std::vector mID; + + /* Associated structure ID (-1 = no structure) */ + int mStructID; + + /* Associated format specifier (-1 = none) */ + int mFormatID; + + /* Is this protocol entity internal only? */ + bool mbInternal; + + /* Associated extended format specifier (-1 = none) */ + int mFormatExID; + + /* Name of protocol entity */ + LPCSTR mpName; +}; + +/*=========================================================================*/ +// Struct sDB2Fragment +// +// Structure that defines the schema for the protocol structure table +/*=========================================================================*/ +struct sDB2Fragment +{ + public: + // (Inline) Default constructor + sDB2Fragment() + : mStructID( 0 ), + mFragmentOrder( 0 ), + mFragmentOffset( 0 ), + mFragmentType( eDB2_FRAGMENT_TYPE_ENUM_BEGIN ), + mFragmentValue( 0 ), + mModifierType( eDB2_MOD_TYPE_ENUM_BEGIN ), + mpModifierValue( EMPTY_STRING ), + mpName( EMPTY_STRING ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + + if (mpModifierValue != 0 && mpModifierValue != EMPTY_STRING) + { + delete [] mpModifierValue; + mpModifierValue = 0; + } + }; + + // (Inline) Return object key + std::pair GetKey() const + { + std::pair key( mStructID, mFragmentOrder ); + return key; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + // Build a simple condition string + static std::string BuildCondition( + ULONG id, + eDB2Operator op, + LONGLONG val, + bool bF2F ); + + // Evaluate a simple condition + static bool EvaluateCondition( + LONGLONG valA, + eDB2Operator op, + LONGLONG valB ); + + // Parse a simple condition + static bool ParseCondition( + LPCSTR pCondition, + ULONG & id, + eDB2Operator & op, + LONGLONG & val, + bool & bF2F ); + + // Build a simple expression string + static std::string BuildExpression( + ULONG id, + eDB2ExpOperator op, + LONGLONG val, + bool bF2F ); + + // Evaluate a simple expression + static bool EvaluateExpression( + LONGLONG valA, + eDB2ExpOperator op, + LONGLONG valB, + LONGLONG & res ); + + // Parse a simple expression + static bool ParseExpression( + LPCSTR pExpr, + ULONG & id, + eDB2ExpOperator & op, + LONGLONG & val, + bool & bF2F ); + + /* Enclosing structure ID */ + ULONG mStructID; + + /* Order of fragment within structure */ + ULONG mFragmentOrder; + + /* Offset (in bits) of fragment from beginning of enclosing structure */ + int mFragmentOffset; + + /* Fragment type, how to interpret the following fragment value */ + eDB2FragmentType mFragmentType; + + /* Fragment Value */ + ULONG mFragmentValue; + + /* Modifier type, how to interpret the following modifier value */ + eDB2ModifierType mModifierType; + + /* Modifier value */ + LPCSTR mpModifierValue; + + /* Fragment Name */ + LPCSTR mpName; +}; + +/*=========================================================================*/ +// Struct sDB2Field +// +// Structure that defines the schema for the protocol field table +/*=========================================================================*/ +struct sDB2Field +{ + public: + // (Inline) Default constructor + sDB2Field() + : mID( 0 ), + mSize( 0 ), + mType( eDB2_FIELD_TYPE_ENUM_BEGIN ), + mTypeVal( 0 ), + mbHex( false ), + mbInternal( false ), + mDescriptionID( -1 ), + mpName( EMPTY_STRING ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if ( (mpName != 0) + && (mpName != EMPTY_STRING) ) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + ULONG GetKey() const + { + return mID; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Field ID */ + ULONG mID; + + /* Size of field (in bits, maximum is 64 bits for integral types) */ + ULONG mSize; + + /* Field type */ + eDB2FieldType mType; + + /* Actual field type (eDB2StdFieldType or enum ID) */ + ULONG mTypeVal; + + /* Display integral fields as hexadecimal? */ + bool mbHex; + + /* Is this field internal only? */ + bool mbInternal; + + /* Description of field */ + int mDescriptionID; + + /* Field name */ + LPCSTR mpName; +}; + +/*=========================================================================*/ +// Struct sDB2Category +// +// Structure that defines the generic category table schema, gives +// category ID, category name, category description, and parent +// category relationship (specified as a category ID into the very +// same table) +/*=========================================================================*/ +struct sDB2Category +{ + public: + // (Inline) Default constructor + sDB2Category() + : mID( 0 ), + mParentID( -1 ), + mpName( EMPTY_STRING ), + mDescriptionID( -1 ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + ULONG GetKey() const + { + return mID; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Category ID */ + ULONG mID; + + /* Category ID of parent, -1 implies no parent/category is at root */ + int mParentID; + + /* Category display name */ + LPCSTR mpName; + + /* Description of category */ + int mDescriptionID; +}; + + +/*=========================================================================== +METHOD: + ValidateDB2Categories (Public Method) + +DESCRIPTION: + Validate the relationship between a pair of DB category/reference tables + + NOTE: Discovered problems will be repaired, i.e. bogus/problematic + category IDs are reset to -1 + +PARAMETERS: + catMap [ I ] - The category table + refMap [ I ] - The reference table + pName [ I ] - Table name (for error reporting) + log [ I ] - Error log + +RETURN VALUE: + bool +===========================================================================*/ +template +bool ValidateDB2Categories( + std::map & catMap, + std::map & refMap, + LPCSTR pName, + cDB2StatusLog & log = gDB2DefaultLog ) +{ + // Assume success + bool bRC = true; + std::string err; + + // Sanity check table name + if (pName == 0 || pName[0] == 0) + { + pName = "?"; + } + + // First validate/repair category map; stage 1: bad parent IDs + std::map ::iterator pCats = catMap.begin(); + while (pCats != catMap.end()) + { + sDB2Category & cat = pCats->second; + pCats++; + + if (cat.IsValid() == false) + { + continue; + } + + // The parent ID must be -1 or exist in the category map + if (cat.mParentID != -1) + { + if (catMap.find( cat.mParentID ) == catMap.end()) + { + // Unable to locate parent category + std::ostringstream tmp; + tmp << "DB [" << pName << "] Missing ID, parent ID " + << cat.mParentID; + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + cat.mParentID = -1; + bRC = false; + } + } + } + + // Validate/repair category map; stage 2: loop detection + pCats = catMap.begin(); + while (pCats != catMap.end()) + { + std::set catsVisited; + sDB2Category & cat = pCats->second; + + // Itererate up through parents + int parentID = cat.mParentID; + while (parentID != -1) + { + // Have we already been here? + if (catsVisited.find( parentID ) == catsVisited.end()) + { + // Nope, add ID and go on to the next one + catsVisited.insert( parentID ); + + std::map ::iterator pParent; + pParent = catMap.find( parentID ); + + parentID = pParent->second.mParentID; + } + else + { + // Yes, we are caught in a loop + std::ostringstream tmp; + tmp << "DB [" << pName << "] Loop in category, parent ID " + << cat.mParentID; + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + cat.mParentID = -1; + bRC = false; + + break; + } + } + + pCats++; + } + + // Validate that each reference references valid category IDs + typename std::map ::iterator pTypes = refMap.begin(); + while (pTypes != refMap.end()) + { + NamedType & theType = pTypes->second; + std::set cats = theType.mCategoryIDs; + + std::set ::iterator pRefCats = cats.begin(); + while (pRefCats != cats.end()) + { + if (*pRefCats != -1) + { + pCats = catMap.find( *pRefCats ); + if (pCats == catMap.end()) + { + // Unable to locate category + std::ostringstream tmp; + tmp << "DB [" << pName << "] Missing ID, category ID " + << *pRefCats << ", reference " << theType.mpName; + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + *pRefCats = -1; + bRC = false; + } + } + + pRefCats++; + } + + pTypes++; + } + + return bRC; +}; + +/*=========================================================================*/ +// Struct sDB2NVItem +// +// NVRAM item structure for database schema +/*=========================================================================*/ +struct sDB2NVItem +{ + public: + // (Inline) Default constructor + sDB2NVItem() + : mItem( 0 ), + mpName( EMPTY_STRING ), + mDescriptionID( -1 ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + ULONG GetKey() const + { + return mItem; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Category IDs (indices into NV items category table) */ + std::set mCategoryIDs; + + /* Item number */ + ULONG mItem; + + /* NV item display name */ + LPCSTR mpName; + + /* Description of NV item */ + int mDescriptionID; +}; + +/*=========================================================================*/ +// Struct sDB2Enum +// +// Structure that defines the schema for the enum table +/*=========================================================================*/ +struct sDB2Enum +{ + public: + // (Inline) Default constructor + sDB2Enum() + : mID( 0 ), + mbInternal( false ), + mpName( EMPTY_STRING ), + mDescriptionID( -1 ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + ULONG GetKey() const + { + return mID; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Enum ID */ + ULONG mID; + + /* Is this enum used internally? */ + bool mbInternal; + + /* Description of enum */ + int mDescriptionID; + + /* Name of enum */ + LPCSTR mpName; +}; + +/*=========================================================================*/ +// Struct sDB2EnumEntry +// +// Structure that defines the schema for the enum entry table +/*=========================================================================*/ +struct sDB2EnumEntry +{ + public: + // (Inline) Default constructor + sDB2EnumEntry() + : mID( 0 ), + mValue( -1 ), + mbHex( false ), + mpName( EMPTY_STRING ), + mDescriptionID( -1 ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + std::pair GetKey() const + { + std::pair key( mID, mValue ); + return key; + }; + + // (Inline) Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Enum ID */ + ULONG mID; + + /* Enum entry value */ + int mValue; + + /* Hexadecimal flag */ + bool mbHex; + + /* Enum value name */ + LPCSTR mpName; + + /* Description of enum value */ + int mDescriptionID; +}; + +/*=========================================================================*/ +// Struct sDB2SimpleCondition +// +// Structure that defines a (parsed) simple condition modifier +/*=========================================================================*/ +struct sDB2SimpleCondition +{ + public: + // (Inline) Default constructor + sDB2SimpleCondition() + : mID( 0 ), + mOperator( eDB2_OP_TYPE_ENUM_BEGIN ), + mValue( 0 ), + mbF2F( false ) + { }; + + // (Inline) Is this object valid? + bool IsValid() const + { + return ::IsValid( mOperator ); + }; + + /* ID of field whose value is to be used */ + ULONG mID; + + /* Operator to be used */ + eDB2Operator mOperator; + + /* Value (or field ID) to compare against */ + LONGLONG mValue; + + /* Field to field expression? */ + bool mbF2F; +}; + +/*=========================================================================*/ +// Struct sDB2SimpleExpression +// +// Structure that defines a (parsed) simple expression +/*=========================================================================*/ +struct sDB2SimpleExpression +{ + public: + // (Inline) Default constructor + sDB2SimpleExpression() + : mID( 0 ), + mOperator( eDB2_EXPOP_TYPE_ENUM_BEGIN ), + mValue( 0 ), + mbF2F( false ) + { }; + + // (Inline) Is this object valid? + bool IsValid() const + { + return (::IsValid( mOperator ) && mValue != 0); + }; + + /* ID of field whose value is to be used */ + ULONG mID; + + /* Operator to be used */ + eDB2ExpOperator mOperator; + + /* Value (or field ID) to compare against */ + LONGLONG mValue; + + /* Field to field expression? */ + bool mbF2F; +}; + +/*=========================================================================*/ +// Struct sLPCSTRCmp +// +// Structure that defines the '<' operator for string comparison +/*=========================================================================*/ +struct sLPCSTRCmp +{ + public: + // (Inline) Is A < B? + bool operator () ( + LPCSTR pStrA, + LPCSTR pStrB ) const + { + bool bLess = false; + if (pStrA != 0 && pStrB != 0) + { + bLess = (strcmp( pStrA, pStrB ) < 0); + } + + return bLess; + }; +}; + +/*=========================================================================*/ +// Case insensitive compare function +/*=========================================================================*/ +inline bool InsensitiveCompare( CHAR first, CHAR second ) +{ + return tolower( first ) < tolower( second ); +} + +/*=========================================================================*/ +// Struct sLPCSTRCmpI +// +// Structure that defines the '<' operator for string comparison +// (case insensitive version) +/*=========================================================================*/ +struct sLPCSTRCmpI +{ + public: + // (Inline) Is A < B? + bool operator () ( + LPCSTR pStrA, + LPCSTR pStrB ) const + { + bool bLess = false; + if (pStrA != 0 && pStrB != 0) + { + // Is there a simpler stl function for this? + bLess = std::lexicographical_compare( pStrA, + pStrA + + strlen( pStrA ), + pStrB, + pStrB + + strlen( pStrB ), + InsensitiveCompare ); + } + + return bLess; + }; +}; + +//--------------------------------------------------------------------------- +// Typedefs +//--------------------------------------------------------------------------- + +// The protocol entity table expressed as a type +typedef std::multimap , sDB2ProtocolEntity> tDB2EntityMap; + +// Protocol entity entity name to ID (reverse) table +typedef std::map , sLPCSTRCmpI> tDB2EntityNameMap; + +// The struct table expressed as a type +typedef std::map , sDB2Fragment> tDB2FragmentMap; + +// The field table expressed as a type +typedef std::map tDB2FieldMap; + +// A generic category table expressed as a type +typedef std::map tDB2CategoryMap; + +// NV item table expressed as a map type +typedef std::map tDB2NVMap; + +// Enum table expressed as a map type +typedef std::map tDB2EnumNameMap; + +// Enum entry table expressed as a map type +typedef std::map , sDB2EnumEntry> tDB2EnumEntryMap; + +// The built enumeration map +typedef std::pair < ULONG, std::map > tDB2EnumMapPair; +typedef std::map tDB2EnumMap; + +// Parsed fragment modifier map - optional fragment +typedef std::map tDB2OptionalModMap; + +// Parsed fragment modifier map - simple expression based sizes +typedef std::map tDB2ExpressionModMap; + +// Parsed fragment modifier map - element count specified arrays +typedef std::map tDB2Array1ModMap; + +// Parsed fragment modifier map - start/stop index specified arrays +typedef std::map > tDB2Array2ModMap; + +// A protocol entity navigation map expressed as a type +typedef std::map , cDB2NavTree *> tDB2EntityNavMap; + + + +/*=========================================================================*/ +// Class cCoreDatabase +/*=========================================================================*/ +class cCoreDatabase +{ + public: + // Constructor + cCoreDatabase(); + + // Destructor + virtual ~cCoreDatabase(); + + // Initialize the database - must be done once (and only once) prior + // to any database object access + virtual bool Initialize( LPCSTR pBasePath ); + virtual bool Initialize(); + + // Exit (cleanup) the database + virtual void Exit(); + + // Get the entity navigation tree for the given protocol entity, if + // none exists one will be built and returned + const cDB2NavTree * GetEntityNavTree( + const std::vector & key ) const; + + // Find the protocol entity with the specified key + bool FindEntity( + const std::vector & key, + sDB2ProtocolEntity & entity ) const; + + // Find the protocol entity with the specified name + bool FindEntity( + LPCSTR pEntityName, + sDB2ProtocolEntity & entity ) const; + + // Map a protocol entity name to an ID + bool MapEntityNameToID( + LPCSTR pName, + std::vector & key ) const; + + // Map the given enum value (specified by enum ID, and enum value) + // to the enum value name string + std::string MapEnumToString( + ULONG enumID, + int enumVal, + bool bSimpleErrFmt = false, + bool bHex = false ) const; + + // Map the given enum value (specified by enum name, and enum value) + // to the enum value name string + std::string MapEnumToString( + LPCSTR pEnumName, + int enumVal, + bool bSimpleErrFmt = false, + bool bHex = false ) const; + + // (Inline) Set status log (object must exist for the duration of + // the DB or at least until being reset) + void SetLog( cDB2StatusLog * pLog ) + { + if (pLog != 0) + { + mpLog = pLog; + } + }; + + // (Inline) Return protocol entities + const tDB2EntityMap & GetProtocolEntities() const + { + return mProtocolEntities; + }; + + // (Inline) Return protocol entity names + const tDB2EntityNameMap & GetProtocolEntityNames() const + { + return mEntityNames; + }; + + // (Inline) Return protocol structures + const tDB2FragmentMap & GetProtocolStructs() const + { + return mEntityStructs; + }; + + // (Inline) Return protocol fields + const tDB2FieldMap & GetProtocolFields() const + { + return mEntityFields; + }; + + // (Inline) Return assembled enumeration map + const tDB2EnumMap & GetEnums() const + { + return mEnumMap; + }; + + // (Inline) Return raw enumeration map + const tDB2EnumNameMap & GetRawEnums() const + { + return mEnumNameMap; + }; + + // (Inline) Return raw enumeration entry map + const tDB2EnumEntryMap & GetRawEnumEntries() const + { + return mEnumEntryMap; + }; + + // (Inline) Return parsed fragment modifier map - optional + const tDB2OptionalModMap & GetOptionalMods() const + { + return mOptionalModMap; + }; + + // (Inline) Return parsed fragment modifier map - expressions + const tDB2ExpressionModMap & GetExpressionMods() const + { + return mExpressionModMap; + }; + + // (Inline) Return parsed fragment modifier map - element + // count specified arrays + const tDB2Array1ModMap & GetArray1Mods() const + { + return mArray1ModMap; + }; + + // (Inline) Return parsed fragment modifier map - start/stop + // index specified arrays + const tDB2Array2ModMap & GetArray2Mods() const + { + return mArray2ModMap; + }; + + protected: + // Assemble the internal enum map + bool AssembleEnumMap(); + + // Assemble the internal protocol entity name map + bool AssembleEntityNameMap(); + + // Build the modifier tables + bool BuildModifierTables(); + + // Check and set the passed in path to something that is useful + std::string CheckAndSetBasePath( LPCSTR pBasePath ) const; + + // Load all tables related to structure (entity, struct, field) + bool LoadStructureTables( LPCSTR pBasePath ); + bool LoadStructureTables(); + + // Load all enumeration related tables + bool LoadEnumTables( LPCSTR pBasePath ); + bool LoadEnumTables(); + + // Validate (and attempt repair of) structure related tables + bool ValidateStructures(); + + // Validate a single structure + bool ValidateStructure( + ULONG structID, + std::set & fields, + ULONG depth ); + + // Validate a single field + bool ValidateField( + ULONG structID, + ULONG fieldID, + std::set & fields ); + + // Validate an array specifier + bool ValidateArraySpecifier( + const sDB2Fragment & frag, + const std::set & fields ); + + // Validate a simple optional fragment specifier + bool ValidateOptionalSpecifier( + const sDB2Fragment & frag, + const std::set & fields ); + + // Validate a simple expression fragment specifier + bool ValidateExpressionSpecifier( + const sDB2Fragment & frag, + const std::set & fields ); + + /* Status log */ + cDB2StatusLog * mpLog; + + /* Protocol entity table, referenced by multi-value key */ + tDB2EntityMap mProtocolEntities; + + /* Protocol entity keys, referenced by indexed by entity name */ + tDB2EntityNameMap mEntityNames; + + /* The on-demand Protocol entity navigation map */ + mutable tDB2EntityNavMap mEntityNavMap; + + /* Protocol entity struct table, indexed by struct ID & fragment order */ + tDB2FragmentMap mEntityStructs; + + /* Protocol entity field table, indexed by field ID */ + tDB2FieldMap mEntityFields; + + /* Enum map, indexed by enum ID */ + tDB2EnumNameMap mEnumNameMap; + + /* Enum entry map, indexed by enum ID/value pair */ + tDB2EnumEntryMap mEnumEntryMap; + + /* The assembled enum map */ + tDB2EnumMap mEnumMap; + + /* Parsed fragment modifier map - optional fragments */ + tDB2OptionalModMap mOptionalModMap; + + /* Parsed fragment modifier map - expression fragments */ + tDB2ExpressionModMap mExpressionModMap; + + /* Parsed fragment modifier map - element count specified arrays */ + tDB2Array1ModMap mArray1ModMap; + + /* Parsed fragment modifier map - start/stop index specified arrays */ + tDB2Array2ModMap mArray2ModMap; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/CoreUtilities.cpp b/gobi-api/GobiAPI_1.0.40/Core/CoreUtilities.cpp new file mode 100755 index 0000000..3331bfa --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/CoreUtilities.cpp @@ -0,0 +1,1853 @@ +/*=========================================================================== +FILE: + CoreUtilities.cpp + +DESCRIPTION: + Collection of various utility methods + +PUBLIC CLASSES AND METHODS: + StringToLONG + StringToULONG + StringToLONGLONG + StringToULONGLONG + + ParseTokens() + ParseCommandLine() + ParseFormatSpecifier() + + FromString( CHAR ) + FromString( UCHAR ) + FromString( SHORT ) + FromString( USHORT ) + FromString( int ) + FromString( UINT ) + FromString( LONG ) + FromString( ULONG ) + FromString( LONGLONG ) + FromString( ULONGLONG ) + + ToString( CHAR ) + ToString( UCHAR ) + ToString( SHORT ) + ToString( USHORT ) + ToString( int ) + ToString( UINT ) + ToString( LONG ) + ToString( ULONG ) + ToString( LONGLONG ) + ToString( ULONGLONG ) + + ContainerToCSVString() + CSVStringToContainer() + CSVStringToValidatedContainer() + + SetDiff() + SetIntersection() + SetUnion() + + GetProgramPath() + IsFolder() + EnumerateFolders() + IsHidden() + DepthSearch() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "CoreUtilities.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Format specifier states +enum eFormatState +{ + eFMT_STATE_NORMAL, // [0] Normal state; outputting literal characters + eFMT_STATE_PERCENT, // [1] Just read '%' + eFMT_STATE_FLAG, // [2] Just read flag character + eFMT_STATE_WIDTH, // [3] Just read width specifier + eFMT_STATE_DOT, // [4] Just read '.' + eFMT_STATE_PRECIS, // [5] Just read precision specifier + eFMT_STATE_SIZE, // [6] Just read size specifier + eFMT_STATE_TYPE, // [7] Just read type specifier + eFMT_STATE_INVALID, // [8] Invalid format + + eFMT_STATES // [9] Number of format states +}; + +// Format specifier character classes +enum eFormatCharClass +{ + eFMT_CH_CLASS_OTHER, // [0] Character with no special meaning + eFMT_CH_CLASS_PERCENT, // [1] '%' + eFMT_CH_CLASS_DOT, // [2] '.' + eFMT_CH_CLASS_STAR, // [3] '*' + eFMT_CH_CLASS_ZERO, // [4] '0' + eFMT_CH_CLASS_DIGIT, // [5] '1'..'9' + eFMT_CH_CLASS_FLAG, // [6] ' ', '+', '-', '#' + eFMT_CH_CLASS_SIZE, // [7] 'h', 'l', 'L', 'N', 'F', 'w' + eFMT_CH_CLASS_TYPE // [8] Type specifying character +}; + +// Lookup table for determining class of a character (lower nibble) +// and next format specifier state (upper nibble) +const UCHAR gLookupTable[] = +{ + 0x06, // ' ', FLAG + 0x80, // '!', OTHER + 0x80, // '"', OTHER + 0x86, // '#', FLAG + 0x80, // '$', OTHER + 0x81, // '%', PERCENT + 0x80, // '&', OTHER + 0x00, // ''', OTHER + 0x00, // '(', OTHER + 0x10, // ')', OTHER + 0x03, // '*', STAR + 0x86, // '+', FLAG + 0x80, // ',', OTHER + 0x86, // '-', FLAG + 0x82, // '.', DOT + 0x80, // '/', OTHER + 0x14, // '0', ZERO + 0x05, // '1', DIGIT + 0x05, // '2', DIGIT + 0x45, // '3', DIGIT + 0x45, // '4', DIGIT + 0x45, // '5', DIGIT + 0x85, // '6', DIGIT + 0x85, // '7', DIGIT + 0x85, // '8', DIGIT + 0x05, // '9', DIGIT + 0x00, // :!', OTHER + 0x00, // ';', OTHER + 0x30, // '<', OTHER + 0x30, // '=', OTHER + 0x80, // '>', OTHER + 0x50, // '?', OTHER + 0x80, // '@', OTHER + 0x80, // 'A', OTHER + 0x00, // 'B', OTHER + 0x08, // 'C', TYPE + 0x00, // 'D', OTHER + 0x28, // 'E', TYPE + 0x27, // 'F', SIZE + 0x38, // 'G', TYPE + 0x50, // 'H', OTHER + 0x57, // 'I', SIZE + 0x80, // 'J', OTHER + 0x00, // 'K', OTHER + 0x07, // 'L', SIZE + 0x00, // 'M', OTHER + 0x37, // 'N', SIZE + 0x30, // 'O', OTHER + 0x30, // 'P', OTHER + 0x50, // 'Q', OTHER + 0x50, // 'R', OTHER + 0x88, // 'S', TYPE + 0x00, // 'T', OTHER + 0x00, // 'U', OTHER + 0x00, // 'V', OTHER + 0x20, // 'W', OTHER + 0x28, // 'X', TYPE + 0x80, // 'Y', OTHER + 0x88, // 'Z', TYPE + 0x80, // '[', OTHER + 0x80, // '\', OTHER + 0x00, // ']', OTHER + 0x00, // '^', OTHER + 0x00, // '-', OTHER + 0x60, // '`', OTHER + 0x60, // 'a', OTHER + 0x60, // 'b', OTHER + 0x68, // 'c', TYPE + 0x68, // 'd', TYPE + 0x68, // 'e', TYPE + 0x08, // 'f', TYPE + 0x08, // 'g', TYPE + 0x07, // 'h', SIZE + 0x78, // 'i', TYPE + 0x70, // 'j', OTHER + 0x70, // 'k', OTHER + 0x77, // 'l', SIZE + 0x70, // 'm', OTHER + 0x70, // 'n', OTHER + 0x08, // 'o', TYPE + 0x08, // 'p', TYPE + 0x00, // 'q', OTHER + 0x00, // 'r', OTHER + 0x08, // 's', TYPE + 0x00, // 't', OTHER + 0x08, // 'u', TYPE + 0x00, // 'v', OTHER + 0x07, // 'w', SIZE + 0x08 // 'x', TYPE +}; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + IsWhitespace (Private Free Method) + +DESCRIPTION: + Is this whitespace? + +PARAMETERS: + pStr [ I ] - The string + +RETURN VALUE: + bool +===========================================================================*/ +static bool IsWhitespace( LPCSTR pStr ) +{ + bool bWS = false; + + int c = (int)*pStr; + if (isspace( c )) + { + bWS = true; + } + + return bWS; +} + +/*=========================================================================== +METHOD: + IsHexadecimalString (Private Free Method) + +DESCRIPTION: + Is this a hexadecimal digits string? + +PARAMETERS: + pStr [ I ] - The string + +RETURN VALUE: + bool +===========================================================================*/ +static bool IsHexadecimalString( LPCSTR pStr ) +{ + // Assume not + bool bHex = false; + + // Skip whitespace + LPCSTR pTmp = pStr; + while (IsWhitespace( pTmp ) == true) + { + pTmp++; + } + + // Skip leading +/- + CHAR ch = *pTmp; + if (ch == '+' || ch == '-') + { + pTmp++; + } + + if (*pTmp == '0') + { + pTmp++; + if (*pTmp == 'x' || *pTmp == 'X') + { + bHex = true; + } + } + + return bHex; +} + +/*=========================================================================== +METHOD: + IsNegativeString (Private Free Method) + +DESCRIPTION: + Is this a string starting with a negative sign? + +PARAMETERS: + pStr [ I ] - The string + +RETURN VALUE: + bool +===========================================================================*/ +static bool IsNegativeString( LPCSTR pStr ) +{ + // Assume not + bool bNeg = false; + + // Skip whitespace + LPCSTR pTmp = pStr; + while (IsWhitespace( pTmp ) == true) + { + pTmp++; + } + + CHAR ch = *pTmp; + if (ch == '-') + { + bNeg = true; + } + + return bNeg; +} + +/*=========================================================================== +METHOD: + StringToLONG (Free Method) + +DESCRIPTION: + Replacement/front end for strtol + + NOTE: strtol does not correctly handle a negative integer + when specified in hexadecimal, so we have to check for that + first + +PARAMETERS: + pStr [ I ] - The string + base [ I ] - Base for conversion + val [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool StringToLONG( + LPCSTR pStr, + int base, + LONG & val ) +{ + // Assume failure + bool bOK = false; + if (pStr == 0 || *pStr == 0) + { + return bOK; + } + + // Hexadecimal? + if (base == 16 || (base == 0 && IsHexadecimalString( pStr ) == true)) + { + // No negative hexadecimal strings allowed + if (IsNegativeString( pStr ) == false) + { + // Reset error + errno = 0; + + // Use the unsigned version, then cast + LPSTR pEnd = (LPSTR)pStr; + ULONG tmpVal = strtoul( pStr, &pEnd, base ); + if (tmpVal != ULONG_MAX || errno != ERANGE) + { + // Where did we end? + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = (LONG)tmpVal; + bOK = true; + } + } + } + } + else + { + // Proceed as normal + LPSTR pEnd = (LPSTR)pStr; + LONG tmpVal = strtol( pStr, &pEnd, base ); + if ((tmpVal != LONG_MAX && tmpVal != LONG_MIN) || errno != ERANGE) + { + // Where did we end? + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = tmpVal; + bOK = true; + } + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + StringToULONG (Free Method) + +DESCRIPTION: + Replacement/front end for strtoul + +PARAMETERS: + pStr [ I ] - The string + base [ I ] - Base for conversion + val [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool StringToULONG( + LPCSTR pStr, + int base, + ULONG & val ) +{ + // Assume failure + bool bOK = false; + if (pStr == 0 || *pStr == 0) + { + return bOK; + } + + // No negative strings allowed + if (IsNegativeString( pStr ) == true) + { + return bOK; + } + + // Reset error + errno = 0; + + LPSTR pEnd = (LPSTR)pStr; + ULONG tmpVal = strtoul( pStr, &pEnd, base ); + if (tmpVal != ULONG_MAX || errno != ERANGE) + { + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = tmpVal; + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + StringToLONGLONG (Free Method) + +DESCRIPTION: + Replacement/front end for strtoll + + NOTE: strtoll does not correctly handle a negative integer + when specified in hexadecimal, so we have to check for that + first + +PARAMETERS: + pStr [ I ] - The string + base [ I ] - Base for conversion + val [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool StringToLONGLONG( + LPCSTR pStr, + int base, + LONGLONG & val ) +{ + // Assume failure + bool bOK = false; + if (pStr == 0 || *pStr == 0) + { + return bOK; + } + + if (base == 16 || (base == 0 && IsHexadecimalString( pStr ) == true)) + { + // No negative hexadecimal strings allowed + if (IsNegativeString( pStr ) == false) + { + // Reset error + errno = 0; + + // Use the unsigned version, then cast + LPSTR pEnd = (LPSTR)pStr; + ULONGLONG tmpVal = strtoull( pStr, &pEnd, base ); + if (tmpVal != ULLONG_MAX || errno != ERANGE) + { + // Where did we end? + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = (LONGLONG)tmpVal; + bOK = true; + } + } + } + } + else + { + // Proceed as normal + LPSTR pEnd = (LPSTR)pStr; + LONGLONG tmpVal = strtoll( pStr, &pEnd, base ); + if ((tmpVal != LLONG_MAX && tmpVal != LLONG_MIN) || errno != ERANGE) + { + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = tmpVal; + bOK = true; + } + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + StringToULONGLONG (Free Method) + +DESCRIPTION: + Replacement/front end for strtouill + +PARAMETERS: + pStr [ I ] - The string + base [ I ] - Base for conversion + val [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool StringToULONGLONG( + LPCSTR pStr, + int base, + ULONGLONG & val ) +{ + // Assume failure + bool bOK = false; + if (pStr == 0 || *pStr == 0) + { + return bOK; + } + + // No negative strings allowed + if (IsNegativeString( pStr ) == true) + { + return bOK; + } + + // Reset error + errno = 0; + + LPSTR pEnd = (LPSTR)pStr; + ULONGLONG tmpVal = strtoull( pStr, &pEnd, base ); + if (tmpVal != ULLONG_MAX || errno != ERANGE) + { + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = tmpVal; + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ParseCommandLine (Free Method) + +DESCRIPTION: + Parse a command line to tokens (a command line is a string of + space delimited values where a value that contains space is + enclosed in text) + +PARAMETERS: + commandLine [ I ] - The characters separating tokens + tokens [ O ] - The resultant vector of tokens + +RETURN VALUE: + None +===========================================================================*/ +void ParseCommandLine( + std::string commandLine, + std::vector & tokens ) +{ + ULONG count = (ULONG)commandLine.size(); + + for (ULONG nEndToken = 0; nEndToken < count;) + { + // Skip leading spaces + int nStartToken = commandLine.find_first_not_of( " ", nEndToken ); + if (nStartToken == -1) + { + // All that is left is spaces + return; + } + + int stringLength = 0; + + // In Quotes? If so ignore spaces until next quote + if (commandLine[ nStartToken ] == '\"') + { + nStartToken++; + nEndToken = commandLine.find( '\"', nStartToken ); + if (nEndToken == -1) + { + // Unable to find trailing quote, fail + return; + } + stringLength = nEndToken - nStartToken; + nEndToken++; + } + else + { + nEndToken = commandLine.find( ' ', nStartToken ); + if (nEndToken == -1) + { + // Unable to find trailing space, use end + nEndToken = commandLine.size(); + } + + stringLength = nEndToken - nStartToken; + } + + std::string newToken = commandLine.substr( nStartToken, stringLength ); + tokens.push_back( newToken ); + } +} + +/*=========================================================================== +METHOD: + ParseTokens (Free Method) + +DESCRIPTION: + Parse a line into individual tokens + + NOTE: No attempt is made to handle accidental separators, i.e. searching + for ',' on 'foo, bar, "foo, bar"' will return four tokens, not three so + pick something like '^' instead of ','! + +PARAMETERS: + pSeparator [ I ] - The characters separating tokens + pLine [ I ] - The string being parsed + tokens [ O ] - The resultant vector of tokens + +RETURN VALUE: + None +===========================================================================*/ +void ParseTokens( + LPCSTR pSeparator, + LPSTR pLine, + std::vector & tokens ) +{ + if (pSeparator != 0 && pSeparator[0] != 0 && pLine != 0 && pLine[0] != 0) + { + LPSTR pToken = strtok( pLine, pSeparator ); + while (pToken != 0) + { + // Store token + tokens.push_back( pToken ); + + // Get next token: + pToken = strtok( 0, pSeparator ); + } + } +} + +/*=========================================================================== +METHOD: + ParseFormatSpecifier (Free Method) + +DESCRIPTION: + Parse a format specifier into individual format type tokens + +PARAMETERS: + pFmt [ I ] - The format specifier (must be NULL terminated) + fmtLen [ I ] - Length of above format specifier + fmtTypes [ O ] - The individual format type tokens ('d', 'u', 'us' etc.) + +RETURN VALUE: + bool - Valid format specifier? +===========================================================================*/ +bool ParseFormatSpecifier( + LPCSTR pFmt, + ULONG fmtLen, + std::vector & fmtTypes ) +{ + // Assume failure + bool bOK = false; + + // Make sure string is NULL terminated + CHAR ch; + ULONG chars = 0; + while (chars < fmtLen) + { + if (pFmt[chars] == '\0') + { + break; + } + else + { + chars++; + } + } + + if (pFmt[chars] != '\0') + { + return bOK; + } + + // Extract individual format type tokens + eFormatState state = eFMT_STATE_NORMAL; + eFormatCharClass cc = eFMT_CH_CLASS_OTHER; + while ((ch = *pFmt++) != '\0' && state != eFMT_STATE_INVALID) + { + // Find character class + cc = eFMT_CH_CLASS_OTHER; + if (ch >= ' ' && ch <= 'x') + { + cc = (eFormatCharClass)(gLookupTable[ch - ' '] & 0xF); + } + + // Find next state + state = (eFormatState)(gLookupTable[cc * eFMT_STATES + (state)] >> 4); + switch (state) + { + case eFMT_STATE_NORMAL: + NORMAL_STATE: + break; + + case eFMT_STATE_PERCENT: + case eFMT_STATE_FLAG: + case eFMT_STATE_DOT: + break; + + case eFMT_STATE_WIDTH: + case eFMT_STATE_PRECIS: + if (ch == '*') + { + fmtTypes.push_back( ch ); + } + break; + + case eFMT_STATE_SIZE: + switch (ch) + { + case 'l': + if (*pFmt == 'l') + { + ++pFmt; + } + break; + + case 'I': + if ( (*pFmt == '6') && (*(pFmt + 1) == '4') ) + { + pFmt += 2; + } + else if ( (*pFmt == '3') && (*(pFmt + 1) == '2') ) + { + pFmt += 2; + } + else if ( (*pFmt == 'd') + || (*pFmt == 'i') + || (*pFmt == 'o') + || (*pFmt == 'u') + || (*pFmt == 'x') + || (*pFmt == 'X') ) + { + // Nothing further needed + } + else + { + state = eFMT_STATE_NORMAL; + goto NORMAL_STATE; + } + break; + + case 'h': + case 'w': + break; + } + break; + + case eFMT_STATE_TYPE: + fmtTypes.push_back( ch ); + break; + } + } + + bOK = (state == eFMT_STATE_NORMAL || state == eFMT_STATE_TYPE); + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + CHAR & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + LONG val = LONG_MAX; + bOK = StringToLONG( pStr, 0, val ); + if (bOK == true) + { + // Reset status + bOK = false; + + // Was this provided as a hexadecimal string? + if (IsHexadecimalString( pStr ) == true) + { + // Yes, the return value is a LONG, so check against + // the maximum range for a UCHAR, before casting to + // a CHAR (to pick sign back up) + if (val <= UCHAR_MAX) + { + // Success! + theType = (CHAR)val; + bOK = true; + } + } + else if (val >= SCHAR_MIN && val <= SCHAR_MAX) + { + // Success! + theType = (CHAR)val; + bOK = true; + } + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + UCHAR & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + ULONG val = ULONG_MAX; + bOK = StringToULONG( pStr, 0, val ); + if (bOK == true && val <= UCHAR_MAX) + { + // Success! + theType = (UCHAR)val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + SHORT & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + LONG val = LONG_MAX; + bOK = StringToLONG( pStr, 0, val ); + if (bOK == true) + { + // Reset status + bOK = false; + + // Was this provided as a hexadecimal string? + if (IsHexadecimalString( pStr ) == true) + { + // Yes, the return value is a LONG, so check against + // the maximum range for a USHORT, before casting to + // a SHORT (to pick sign back up) + if (val <= USHRT_MAX) + { + // Success! + theType = (SHORT)val; + bOK = true; + } + } + else if (val >= SHRT_MIN && val <= SHRT_MAX) + { + // Success! + theType = (SHORT)val; + bOK = true; + } + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + USHORT & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + ULONG val = ULONG_MAX; + bOK = StringToULONG( pStr, 0, val ); + if (bOK == true && val <= USHRT_MAX) + { + // Success! + theType = (USHORT)val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + int & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + LONG val = LONG_MAX; + bOK = StringToLONG( pStr, 0, val ); + if (bOK == true && (val >= INT_MIN && val <= INT_MAX)) + { + // Success! + theType = (int)val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + UINT & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + ULONG val = ULONG_MAX; + bOK = StringToULONG( pStr, 0, val ); + if (bOK == true && val <= UINT_MAX) + { + // Success! + theType = (UINT)val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + LONG & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + LONG val = LONG_MAX; + bOK = StringToLONG( pStr, 0, val ); + if (bOK == true) + { + // Success! + theType = val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + ULONG & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + ULONG val = ULONG_MAX; + bOK = StringToULONG( pStr, 0, val ); + if (bOK == true) + { + // Success! + theType = val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + LONGLONG & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + LONGLONG val = LLONG_MAX; + bOK = StringToLONGLONG( pStr, 0, val ); + if (bOK == true) + { + // Success! + theType = val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + ULONGLONG & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + ULONGLONG val = ULLONG_MAX; + bOK = StringToULONGLONG( pStr, 0, val ); + if (bOK == true) + { + // Success! + theType = val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + CHAR val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int tmp = (int)val; + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%d", + tmp ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + UCHAR val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%u", + (UINT)val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + SHORT val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int tmp = (int)val; + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%d", + tmp ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + USHORT val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%u", + (UINT)val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + int val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%d", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + UINT val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%u", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + LONG val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%ld", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + ULONG val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%lu", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + LONGLONG val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%lld", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + ULONGLONG val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%llu", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + GetProgramPath (Public Method) + +DESCRIPTION: + Return the special folder used for storing program files + +RETURN VALUE: + std::string (Static value of "/opt/Qualcomm/Gobi/") +===========================================================================*/ +std::string GetProgramPath() +{ + // If running programs's path is desired we could + // use readlink with /proc/getpid()/exe + + // Just using static path, as we don't want them to move it + std::string path = "/opt/Qualcomm/Gobi/"; + + return path; + +} + +/*=========================================================================== +METHOD: + IsFolder (Free Method) + +DESCRIPTION: + Helper function for EnumerateFolders, tells if a dirent is a folder. + This reduces the memory usage by scandir, as compared to checking after + scandir returns. + +PARAMETERS: + pFile [ I ] - dirent structure describing file + +RETURN VALUE: + int: zero - Ignore this file + nonzero - Process this file +===========================================================================*/ +int IsFolder( const struct dirent * pFile ) +{ + // Ignore anything beginning with a '.' + if (pFile->d_name[0] == '.') + { + return 0; + } + + return (pFile->d_type == DT_DIR ? 1 : 0); +} + +/*=========================================================================== +METHOD: + EnumerateFolders (Public Method) + +DESCRIPTION: + Enumerate the subfolders of the given folder (recursive) + +PARAMETERS: + baseFolder [ I ] - Folder to search in + foundFolders [ O ] - Fully qualified paths of found folders + +RETURN VALUE: + None +===========================================================================*/ +void EnumerateFolders( + const std::string & baseFolder, + std::vector & foundFolders ) +{ + if (baseFolder.size() == 0) + { + return; + } + + std::string folderSearch = baseFolder; + + // Add trailing / if not present + int folderLen = folderSearch.size(); + if (folderSearch[folderLen - 1] != '/') + { + folderSearch += '/'; + } + + dirent ** ppDevFiles; + + // Yes, scandir really takes a triple pointer for its second param + int nNumDevFiles = scandir( folderSearch.c_str(), + &ppDevFiles, + IsFolder, + NULL ); + for (int nFile = 0; nFile < nNumDevFiles; nFile++) + { + std::string newFolder = folderSearch + ppDevFiles[nFile]->d_name; + free( ppDevFiles[nFile] ); + + foundFolders.push_back( newFolder ); + EnumerateFolders( newFolder, foundFolders ); + } + + if (nNumDevFiles != -1) + { + free( ppDevFiles ); + } +} + +/*=========================================================================== +METHOD: + IsHidden (Free Method) + +DESCRIPTION: + Helper function for DepthSearch, tells if a dirent is a hidden file. + This reduces the memory usage by scandir, as compared to checking after + scandir returns. + +PARAMETERS: + pFile [ I ] - dirent structure describing file + +RETURN VALUE: + int: zero - Ignore this file + nonzero - Process this file +===========================================================================*/ +int IsHidden( const struct dirent * pFile ) +{ + // Ignore anything beginning with a '.' + if (pFile->d_name[0] == '.') + { + return 0; + } + + return 1; +} + +/*=========================================================================== +METHOD: + DepthSearch (Public Method) + +DESCRIPTION: + Search for all matching files at a specified depth (recursive) + +PARAMETERS: + baseFolder [ I ] - Folder to search in + depth [ I ] - Depth + name [ I ] - Partial name of file to search for + foundFolders [ O ] - Fully qualified paths of found files + +RETURN VALUE: + None +===========================================================================*/ +void DepthSearch( + const std::string & baseFolder, + int depth, + std::string name, + std::vector & foundFiles ) +{ + if (baseFolder.size() == 0 + || name.size() == 0 + || depth < 0) + { + return; + } + + std::string folderSearch = baseFolder; + + // Add trailing / if not present + int folderLen = folderSearch.size(); + if (folderSearch[folderLen - 1] != '/') + { + folderSearch += '/'; + } + + dirent ** ppDevFiles; + + // Yes, scandir really takes a triple pointer for its second param + int nNumDevFiles = scandir( folderSearch.c_str(), + &ppDevFiles, + IsHidden, + NULL ); + for (int nFile = 0; nFile < nNumDevFiles; nFile++) + { + std::string newFile = ppDevFiles[nFile]->d_name; + + // Recurse or not? + if (depth == 0) + { + if (newFile.find( name ) != std::string::npos) + { + foundFiles.push_back( folderSearch + newFile ); + } + } + else + { + DepthSearch( folderSearch + newFile, + depth - 1, + name, + foundFiles ); + } + } + + if (nNumDevFiles != -1) + { + free( ppDevFiles ); + } +} + diff --git a/gobi-api/GobiAPI_1.0.40/Core/CoreUtilities.h b/gobi-api/GobiAPI_1.0.40/Core/CoreUtilities.h new file mode 100755 index 0000000..54e0ee0 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/CoreUtilities.h @@ -0,0 +1,657 @@ +/*=========================================================================== +FILE: + CoreUtilities.h + +DESCRIPTION: + Collection of various utility methods + +PUBLIC CLASSES AND METHODS: + StringToLONG + StringToULONG + StringToLONGLONG + StringToULONGLONG + + ParseCommandLine() + ParseTokens() + ParseFormatSpecifier() + + FromString( CHAR ) + FromString( UCHAR ) + FromString( SHORT ) + FromString( USHORT ) + FromString( int ) + FromString( UINT ) + FromString( LONG ) + FromString( ULONG ) + FromString( LONGLONG ) + FromString( ULONGLONG ) + + ToString( CHAR ) + ToString( UCHAR ) + ToString( SHORT ) + ToString( USHORT ) + ToString( int ) + ToString( UINT ) + ToString( LONG ) + ToString( ULONG ) + ToString( LONGLONG ) + ToString( ULONGLONG ) + + GetProgramPath() + EnumerateFolders() + DepthSearch() + + ContainerToCSVString() + CSVStringToContainer() + CSVStringToValidatedContainer() + + SetDiff() + SetIntersection() + SetUnion() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Suggested size of an argument buffer to ToString() for any key, each +// ToString() should not write more than this size to the passed in buffer +const ULONG SUGGESTED_BUFFER_LEN = 64; + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +// Replacement/front end for _tcstol +bool StringToLONG( + LPCSTR pStr, + int base, + LONG & val ); + +// Replacement/front end for _tcstoul +bool StringToULONG( + LPCSTR pStr, + int base, + ULONG & val ); + +// Replacement/front end for _tcstoi64 +bool StringToLONGLONG( + LPCSTR pStr, + int base, + LONGLONG & val ); + +// Replacement/front end for _tcstoui64 +bool StringToULONGLONG( + LPCSTR pStr, + int base, + ULONGLONG & val ); + +// Parse a command line to tokens (a command line is a string of +// space delimited values where a value that contains space is +// enclosed in text) +void ParseCommandLine( + std::string commandLine, + std::vector & tokens ); + +// Parse a line into individual tokens +void ParseTokens( + LPCSTR pSeparator, + LPSTR pLine, + std::vector & tokens ); + +// Parse a format specifier into individual format type tokens +bool ParseFormatSpecifier( + LPCSTR pFmt, + ULONG fmtLen, + std::vector & fmtTypes ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + CHAR & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + UCHAR & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + SHORT & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + USHORT & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + int & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + UINT & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + LONG & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + ULONG & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + LONGLONG & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + ULONGLONG & theType ); + + +// Convert a value to a string +bool ToString( + CHAR val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + UCHAR val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + SHORT val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + USHORT val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + int val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + UINT val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + LONG val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + ULONG val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + LONGLONG val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + ULONGLONG val, + LPSTR pStr ); + +// Return the special folder used for storing program files +std::string GetProgramPath(); + +// Enumerate the subfolders of the given folder (recursive) +void EnumerateFolders( + const std::string & baseFolder, + std::vector & foundFolders ); + +// Search for a file at a given depth +void DepthSearch( + const std::string & baseFolder, + int depth, + std::string name, + std::vector & foundFiles ); + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + ContainerToCSVString (Free Method) + +DESCRIPTION: + Convert the contents of a container to a CSV string + + NOTE: ToString() must be defined for the container value type + +PARAMETERS: + cont [ I ] - The container + sep [ I ] - The character separating tokens + csv [ O ] - The resulting comma separated string + +RETURN VALUE: + None +===========================================================================*/ +template +void ContainerToCSVString( + const Container & cont, + CHAR sep, + std::string & csv ) +{ + csv = ""; + if ((ULONG)cont.size() > (ULONG)0) + { + CHAR keyBuf[SUGGESTED_BUFFER_LEN]; + + typename Container::const_iterator pIter = cont.begin(); + while (pIter != cont.end()) + { + const typename Container::value_type & theKey = *pIter; + bool bOK = ToString( theKey, &keyBuf[0] ); + + if (bOK == true && keyBuf[0] != 0) + { + if (pIter != cont.begin()) + { + csv += sep; + } + + csv += (LPCSTR)&keyBuf[0]; + } + + pIter++; + } + } +} + +/*=========================================================================== +METHOD: + CSVStringToContainer (Free Method) + +DESCRIPTION: + Populate a container from a parsed CSV string + + NOTE: FromString() must be defined for the container value type + NOTE: The container is emptied before this operation is attempted + +PARAMETERS: + pSeparator [ I ] - The characters separating tokens + pCSV [ I ] - The comma separated string (will be modified) + cont [ O ] - The resulting container + bClear [ I ] - Clear the container first? NOTE: if the container + is not cleared first then insertions may fail for + duplicate keys + +RETURN VALUE: + None +===========================================================================*/ +template +void CSVStringToContainer( + LPCSTR pSeparator, + LPSTR pCSV, + Container & cont, + bool bClear = true ) +{ + if (pCSV != 0 && *pCSV != 0) + { + // Remove a leading quote? + if (*pCSV == '\"') + { + pCSV++; + } + + // Remove a trailing quote? + ULONG len = (ULONG)strlen( pCSV ); + if (len > 0) + { + if (pCSV[len - 1] == '\"') + { + pCSV[len - 1] = 0; + } + } + + // Clear the container first? + if (bClear == true) + { + cont.clear(); + } + + std::vector tokens; + ParseTokens( pSeparator, pCSV, tokens ); + + std::vector ::const_iterator pIter = tokens.begin(); + while (pIter != tokens.end()) + { + LPCSTR pTok = *pIter; + + typename Container::value_type theKey; + bool bOK = ::FromString( pTok, theKey ); + + if (bOK == true) + { + std::insert_iterator is( cont, cont.end() ); + *is = theKey; + } + + pIter++; + } + } +} + +/*=========================================================================== +METHOD: + CSVStringToValidatedContainer (Free Method) + +DESCRIPTION: + Populate a container from a parsed CSV string + + NOTE: FromString() and IsValid() must be defined for the container + value type (the later need not do anything but return true) + + NOTE: The container is emptied before this operation is attempted + +PARAMETERS: + pSeparator [ I ] - The characters separating tokens + pCSV [ I ] - The comma separated string (will be modified) + cont [ O ] - The resulting container + +RETURN VALUE: + None +===========================================================================*/ +template +void CSVStringToValidatedContainer( + LPCSTR pSeparator, + LPSTR pCSV, + Container & cont ) +{ + cont.clear(); + if (pCSV != 0 && *pCSV != 0) + { + // Remove a leading quote? + if (*pCSV == '\"') + { + pCSV++; + } + + // Remove a trailing quote? + ULONG len = (ULONG)strlen( pCSV ); + if (len > 0) + { + if (pCSV[len - 1] == '\"') + { + pCSV[len - 1] = 0; + } + } + + cont.clear(); + + std::vector tokens; + ParseTokens( pSeparator, pCSV, tokens ); + + std::vector ::const_iterator pIter = tokens.begin(); + while (pIter != tokens.end()) + { + LPCSTR pTok = *pIter; + + typename Container::value_type theKey; + bool bOK = ::FromString( pTok, theKey ); + + if (bOK == true) + { + bool bValid = IsValid( theKey ); + if (bValid == true) + { + std::insert_iterator is( cont, cont.end() ); + *is = theKey; + } + } + + pIter++; + } + } +} + +/*=========================================================================== +METHOD: + SetDiff (Free Method) + +DESCRIPTION: + Given two sets return a third that contains everything in the first + set but not the second set + +PARAMETERS: + setA [ I ] - The first set + setB [ I ] - The second set + +RETURN VALUE: + std::set - the difference +===========================================================================*/ +template +std::set SetDiff( + const std::set & setA, + const std::set & setB ) +{ + std::set retSet; + + if (setB.size() == 0) + { + // Everything that is in the first set but not the second + // (empty) set is ... the first set! + retSet = setA; + } + else if (setA.size() == 0) + { + // The first set is empty, hence the return set is empty + } + else + { + // Both sets have elements, therefore the iterators will + // be valid and we can use the standard approach + typename std::set ::const_iterator pIterA = setA.begin(); + typename std::set ::const_iterator pIterB = setB.begin(); + + for ( ; pIterA != setA.end() && pIterB != setB.end(); ) + { + if (*pIterA < *pIterB) + { + retSet.insert( *pIterA ); + pIterA++; + } + else if (*pIterB < *pIterA) + { + pIterB++; + } + else + { + pIterA++; + pIterB++; + } + } + + while (pIterA != setA.end()) + { + retSet.insert( *pIterA ); + pIterA++; + } + } + + return retSet; +} + +/*=========================================================================== +METHOD: + SetIntersection (Free Method) + +DESCRIPTION: + Given two sets return a third that contains everything that is in both + sets + +PARAMETERS: + setA [ I ] - The first set + setB [ I ] - The second set + +RETURN VALUE: + std::set - the union +===========================================================================*/ +template +std::set SetIntersection( + const std::set & setA, + const std::set & setB ) +{ + std::set retSet; + + // Neither set can be empty + if (setA.size() != 0 && setA.size() != 0) + { + // Both sets have elements, therefore the iterators will + // be valid and we can use the standard approach + typename std::set ::const_iterator pIterA = setA.begin(); + typename std::set ::const_iterator pIterB = setB.begin(); + + for ( ; pIterA != setA.end() && pIterB != setB.end(); ) + { + if (*pIterA < *pIterB) + { + pIterA++; + } + else if (*pIterB < *pIterA) + { + pIterB++; + } + else + { + retSet.insert( *pIterA ); + pIterA++; + pIterB++; + } + } + } + + return retSet; +} + +/*=========================================================================== +METHOD: + SetUnion (Free Method) + +DESCRIPTION: + Given two sets return a third that contains everything that is either + in the first set or in the second set + +PARAMETERS: + setA [ I ] - The first set + setB [ I ] - The second set + +RETURN VALUE: + std::set - the union +===========================================================================*/ +template +std::set SetUnion( + const std::set & setA, + const std::set & setB ) +{ + std::set retSet; + + if (setB.size() == 0) + { + // Everything that is in the first (possibly empty) set or in + // the second (empty) set is ... the first set! + retSet = setA; + } + else if (setA.size() == 0) + { + // Everything that is in the first (empty) set or in the + // second (possibly empty) set is ... the second set! + retSet = setB; + } + else + { + // Both sets have elements, therefore the iterators will + // be valid and we can use the standard approach + typename std::set ::const_iterator pIterA = setA.begin(); + typename std::set ::const_iterator pIterB = setB.begin(); + + for ( ; pIterA != setA.end() && pIterB != setB.end(); ) + { + if (*pIterA < *pIterB) + { + retSet.insert( *pIterA ); + pIterA++; + } + else if (*pIterB < *pIterA) + { + retSet.insert( *pIterB ); + pIterB++; + } + else + { + retSet.insert( *pIterA ); + pIterA++; + pIterB++; + } + } + + while (pIterA != setA.end()) + { + retSet.insert( *pIterA ); + pIterA++; + } + + while (pIterB != setB.end()) + { + retSet.insert( *pIterB ); + pIterB++; + } + } + + return retSet; +} + diff --git a/gobi-api/GobiAPI_1.0.40/Core/DB2NavTree.cpp b/gobi-api/GobiAPI_1.0.40/Core/DB2NavTree.cpp new file mode 100755 index 0000000..3705dcf --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/DB2NavTree.cpp @@ -0,0 +1,434 @@ +/*=========================================================================== +FILE: + ProtocolEntityNavTree.cpp + +DESCRIPTION: + Implementation of cDB2NavTree + +PUBLIC CLASSES AND METHODS: + sDB2NavFragment + cDB2NavTree + This class distills the database description of a protocol + entity into a simple tree structure more suited to + efficient navigation for parsing/packing + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "DB2NavTree.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sDB2NavFragment Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sDB2NavFragment (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +sDB2NavFragment::sDB2NavFragment() + : mpField( 0 ), + mpFragment( 0 ), + mpNextFragment( 0 ), + mpLinkFragment( 0 ) +{ + // Nothing to do +} + +/*=========================================================================*/ +// cDB2NavTree Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cDB2NavTree (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + db [ I ] - Database to use + +RETURN VALUE: + None +===========================================================================*/ +cDB2NavTree::cDB2NavTree( const cCoreDatabase & db ) + : mDB( db ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cDB2NavTree (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cDB2NavTree::~cDB2NavTree() +{ + // Clean-up our fragment allocations + std::list ::iterator pIter; + for (pIter = mFragments.begin(); pIter != mFragments.end(); pIter++) + { + sDB2NavFragment * pFrag = *pIter; + if (pFrag != 0) + { + delete pFrag; + } + } +} + +/*=========================================================================== +METHOD: + BuildTree (Internal Method) + +DESCRIPTION: + Build nav tree for the entity described by the given key/name + +PARAMETERS: + key [ I ] - Key into the protocol entity table + +RETURN VALUE: + bool +===========================================================================*/ +bool cDB2NavTree::BuildTree( const std::vector & key ) +{ + // Assume failure + bool bRC = false; + + // Look up entity definition + bool bFound = mDB.FindEntity( key, mEntity ); + + // Did we find it? + if (bFound == false) + { + // No definition in database + return bRC; + } + + // A structure to navigate? + if (mEntity.mStructID == -1) + { + bRC = true; + return bRC; + } + + const tDB2FragmentMap & structTable = mDB.GetProtocolStructs(); + + // Grab first fragment of structure + std::pair id( mEntity.mStructID, 0 ); + tDB2FragmentMap::const_iterator pFrag = structTable.find( id ); + + // Nothing to navigate? + if (pFrag == structTable.end()) + { + ASSERT( 0 ); + return bRC; + } + + // No name? + if (mEntity.mpName == 0 || mEntity.mpName[0] == 0) + { + ASSERT( 0 ); + return bRC; + } + + // Process the initial structure + bRC = ProcessStruct( &pFrag->second, 0 ); + return bRC; +} + +/*=========================================================================== +METHOD: + ProcessStruct (Internal Method) + +DESCRIPTION: + Process a structure described by the given initial fragment + +PARAMETERS: + frag [ I ] - Entry point for structure + pOwner [ I ] - Owning fragment + +RETURN VALUE: + bool +===========================================================================*/ +bool cDB2NavTree::ProcessStruct( + const sDB2Fragment * pFrag, + sDB2NavFragment * pOwner ) +{ + // Assume success + bool bRC = true; + + // Grab struct ID/fragment ID from fragment + std::pair key = pFrag->GetKey(); + ULONG structID = key.first; + + const tDB2FragmentMap & structTable = mDB.GetProtocolStructs(); + const tDB2FieldMap & fieldTable = mDB.GetProtocolFields(); + + // Sync iterator to fragment + tDB2FragmentMap::const_iterator pFragIter = structTable.find( key ); + if (pFragIter == structTable.end()) + { + // This should not happen + ASSERT( 0 ); + + bRC = false; + return bRC; + } + + // Fragments we allocate along the way + sDB2NavFragment * pOld = 0; + sDB2NavFragment * pNew = 0; + + // Process each fragment in the structure + while ( (pFragIter != structTable.end()) + && (pFragIter->second.mStructID == structID) ) + { + pFrag = &pFragIter->second; + + // Allocate our new fragment + pNew = new sDB2NavFragment; + if (pNew == 0) + { + bRC = false; + break; + } + + // Store DB fragemnt + pNew->mpFragment = pFrag; + mFragments.push_back( pNew ); + + // Hook previous up to us + if (pOld != 0 && pOld->mpNextFragment == 0) + { + pOld->mpNextFragment = pNew; + } + + // Hook owner up to us + if (pOwner != 0 && pOwner->mpLinkFragment == 0) + { + pOwner->mpLinkFragment = pNew; + } + + // Modified? + switch (pFrag->mModifierType) + { + case eDB2_MOD_VARIABLE_ARRAY: + case eDB2_MOD_VARIABLE_STRING1: + case eDB2_MOD_VARIABLE_STRING2: + case eDB2_MOD_VARIABLE_STRING3: + { + const tDB2Array1ModMap & arrays1 = mDB.GetArray1Mods(); + + tDB2Array1ModMap::const_iterator pTmp; + pTmp = arrays1.find( pFrag->mpModifierValue ); + + if (pTmp != arrays1.end()) + { + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[pTmp->second] = entry; + } + else + { + bRC = false; + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY2: + { + const tDB2Array2ModMap & arrays2 = mDB.GetArray2Mods(); + + tDB2Array2ModMap::const_iterator pTmp; + pTmp = arrays2.find( pFrag->mpModifierValue ); + + if (pTmp != arrays2.end()) + { + // We need to track the value of the given fields + std::pair entry( false, 0 ); + mTrackedFields[pTmp->second.first] = entry; + mTrackedFields[pTmp->second.second] = entry; + } + else + { + bRC = false; + } + } + break; + + case eDB2_MOD_OPTIONAL: + { + const tDB2OptionalModMap & conditions = mDB.GetOptionalMods(); + + tDB2OptionalModMap::const_iterator pTmp; + pTmp = conditions.find( pFrag->mpModifierValue ); + + if (pTmp != conditions.end()) + { + const sDB2SimpleCondition & con = pTmp->second; + + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[con.mID] = entry; + + if (con.mbF2F == true) + { + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[(ULONG)con.mValue] = entry; + } + } + else + { + bRC = false; + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY3: + { + const tDB2ExpressionModMap & exprs = mDB.GetExpressionMods(); + + tDB2ExpressionModMap::const_iterator pTmp; + pTmp = exprs.find( pFrag->mpModifierValue ); + + if (pTmp != exprs.end()) + { + const sDB2SimpleExpression & expr = pTmp->second; + + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[expr.mID] = entry; + + if (expr.mbF2F == true) + { + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[(ULONG)expr.mValue] = entry; + } + } + else + { + bRC = false; + } + } + break; + }; + + // What type of fragment is this? + switch (pFrag->mFragmentType) + { + case eDB2_FRAGMENT_FIELD: + { + // Grab field ID + ULONG fieldID = pFrag->mFragmentValue; + + // Find field representation in database + tDB2FieldMap::const_iterator pField = fieldTable.find( fieldID ); + if (pField != fieldTable.end()) + { + pNew->mpField = &pField->second; + } + else + { + bRC = false; + } + } + break; + + case eDB2_FRAGMENT_STRUCT: + { + // Grab structure ID + ULONG structID = pFrag->mFragmentValue; + + // Grab first fragment of structure + std::pair id( structID, 0 ); + tDB2FragmentMap::const_iterator pFragIterTmp; + pFragIterTmp = structTable.find( id ); + if (pFragIterTmp != structTable.end()) + { + pFrag = &pFragIterTmp->second; + bRC = ProcessStruct( pFrag, pNew ); + } + else + { + bRC = false; + } + } + break; + + case eDB2_FRAGMENT_VARIABLE_PAD_BITS: + case eDB2_FRAGMENT_VARIABLE_PAD_BYTES: + { + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[pFrag->mFragmentValue] = entry; + + bRC = true; + } + break; + + default: + bRC = true; + break; + } + + if (bRC == true) + { + pFragIter++; + + pOld = pNew; + pNew = 0; + } + else + { + break; + } + } + + return bRC; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/DB2NavTree.h b/gobi-api/GobiAPI_1.0.40/Core/DB2NavTree.h new file mode 100755 index 0000000..a1745ba --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/DB2NavTree.h @@ -0,0 +1,136 @@ +/*=========================================================================== +FILE: + ProtocolEntityNavTree.h + +DESCRIPTION: + Declaration of cProtocolEntityNavTree + +PUBLIC CLASSES AND METHODS: + sDB2NavFragment + cDB2NavTree + This class distills the database description of a protocol + entity into a simple tree structure more suited to + efficient navigation for parsing/packing + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "CoreDatabase.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Struct sDB2NavFragment +// Protocol entity navigation fragment +/*=========================================================================*/ +struct sDB2NavFragment +{ + public: + // Constructor + sDB2NavFragment(); + + /* Associated DB fragment (never empty) */ + const sDB2Fragment * mpFragment; + + /* Associated DB field (may be empty) */ + const sDB2Field * mpField; + + /* Next fragment in this structure */ + const sDB2NavFragment * mpNextFragment; + + /* Fragment linked to this structure */ + const sDB2NavFragment * mpLinkFragment; +}; + +/*=========================================================================*/ +// Class cDB2NavTree +// Class to describe a protocol entity suited to efficient navigation +/*=========================================================================*/ +class cDB2NavTree +{ + public: + // Constructor + cDB2NavTree( const cCoreDatabase & db ); + + // Destructor + virtual ~cDB2NavTree(); + + // Build nav tree for the protocol entity described by the given key + bool BuildTree( const std::vector & key ); + + // (Inline) Return protocol entity + const sDB2ProtocolEntity & GetEntity() const + { + return mEntity; + }; + + // (Inline) Return fragments + const std::list & GetFragments() const + { + return mFragments; + }; + + // Return a map of all tracked fields + std::map > GetTrackedFields() const + { + return mTrackedFields; + }; + + protected: + // Process a structure described by the given initial fragment + bool ProcessStruct( + const sDB2Fragment * pFrag, + sDB2NavFragment * pOwner ); + + /* Protocol entity being navigated */ + sDB2ProtocolEntity mEntity; + + /* Database reference */ + const cCoreDatabase & mDB; + + /* List of all allocated fragments */ + std::list mFragments; + + /* Map of all 'tracked' fields */ + std::map > mTrackedFields; +}; + + diff --git a/gobi-api/GobiAPI_1.0.40/Core/DB2TextFile.cpp b/gobi-api/GobiAPI_1.0.40/Core/DB2TextFile.cpp new file mode 100755 index 0000000..aaebdf5 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/DB2TextFile.cpp @@ -0,0 +1,253 @@ +/*=========================================================================== +FILE: + DB2TextFile.h + +DESCRIPTION: + Implementation of cDB2TextFile class + +PUBLIC CLASSES AND METHODS: + cDB2TextFile + The cDB2TextFile class provides the simple ability to read in an + ANSI/UNICODE file and copy it to a dynamically allocated buffer + + The sole difference between this and CStdioFile is that the issues + stemming from supporting both ANSI and UNICODE files are handled + in a simpler fashion at the expense of a bit of performance + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//----------------------------------------------------------------------------- +// Include Files +//----------------------------------------------------------------------------- +#include "StdAfx.h" +#include "DB2TextFile.h" + +//----------------------------------------------------------------------------- +// Definitions +//----------------------------------------------------------------------------- + +// Maximum size of a file this interface will try to open (8 MB) +const DWORD MAX_FILE_SZ = 1024 * 1024 * 8; + +// Maximum number of characters to run UNICODE check over +const INT MAX_UNICODE_CHECK_LEN = 128; + +/*=========================================================================*/ +// cDB2TextFile Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cDB2TextFile (Public Method) + +DESCRIPTION: + Construct object/load file into memory + +PARAMETERS + pFileName [ I ] - File name + +RETURN VALUE: + None +===========================================================================*/ +cDB2TextFile::cDB2TextFile( LPCSTR pFileName ) + : mText( "" ), + mStatus( ERROR_FILE_NOT_FOUND ), + mCurrentPos( 0 ) +{ + if (pFileName == 0 || pFileName[0] == 0) + { + return; + } + + // Open the file + std::ifstream tempFStream; + tempFStream.open( pFileName, std::ios::in | std::ios::binary ); + if (tempFStream.fail() == true) + { + mStatus = ERROR_FILE_NOT_FOUND; + return; + } + + // Get size + LONG nFileSize = tempFStream.rdbuf()->in_avail(); + if (nFileSize == -1 || nFileSize > MAX_FILE_SZ) + { + tempFStream.close(); + mStatus = ERROR_GEN_FAILURE; + return; + } + + // Read file into pTempBuffer + CHAR * pTempBuffer = new char[ nFileSize ]; + if (pTempBuffer == NULL) + { + tempFStream.close(); + mStatus = ERROR_GEN_FAILURE; + return; + } + + tempFStream.read( pTempBuffer, nFileSize ); + if (tempFStream.fail() == true) + { + tempFStream.close(); + delete [] pTempBuffer; + mStatus = ERROR_GEN_FAILURE; + return; + } + + tempFStream.close(); + + // Convert to string + mText = std::string( pTempBuffer, nFileSize ); + + delete [] pTempBuffer; + + // Final check + if (mText.size() != nFileSize) + { + mStatus = ERROR_GEN_FAILURE; + return; + } + + // Success! + mStatus = NO_ERROR; +} + +/*=========================================================================== +METHOD: + cDB2TextFile (Public Method) + +DESCRIPTION: + Construct object/copy from buffer into memory + +PARAMETERS + pBuffer [ I ] - Buffer to copy from + bufferLen [ I ] - Size of above buffer + +RETURN VALUE: + None +===========================================================================*/ +cDB2TextFile::cDB2TextFile( + LPCSTR pBuffer, + ULONG bufferLen ) + : mText( "" ), + mStatus( ERROR_FILE_NOT_FOUND ), + mCurrentPos( 0 ) +{ + // Convert to string + mText = std::string( pBuffer, bufferLen ); + + // Final check + if (mText.size() != bufferLen) + { + mStatus = ERROR_GEN_FAILURE; + return; + } + + // Success! + mStatus = NO_ERROR; +} + +/*=========================================================================== +METHOD: + ~cDB2TextFile (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cDB2TextFile::~cDB2TextFile() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ReadLine (Public Method) + +DESCRIPTION: + Read the next available line + +PARAMETERS + line [ O ] - Line (minus CR/LF) + +RETURN VALUE: + None +===========================================================================*/ +bool cDB2TextFile::ReadLine( std::string & line ) +{ + if (IsValid() == false) + { + return false; + } + + int len = mText.size(); + if (mCurrentPos >= len) + { + return false; + } + + int newIdx = mText.find( '\n', mCurrentPos ); + if (newIdx == -1) + { + // Possibly the end of the file + newIdx = len; + } + + if (newIdx < mCurrentPos) + { + return false; + } + + if (newIdx == mCurrentPos) + { + // Return an empty line + mCurrentPos++; + line = ""; + } + else + { + // Grab line + line = mText.substr( mCurrentPos, (newIdx - mCurrentPos) ); + + // Check for CR + int nCR = line.find( '\r' ); + if (nCR != -1) + { + line.erase( nCR, 1 ); + } + + mCurrentPos = newIdx + 1; + } + + return true; +} + diff --git a/gobi-api/GobiAPI_1.0.40/Core/DB2TextFile.h b/gobi-api/GobiAPI_1.0.40/Core/DB2TextFile.h new file mode 100755 index 0000000..8ecb1cb --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/DB2TextFile.h @@ -0,0 +1,110 @@ +/*=========================================================================== +FILE: + DB2TextFile.h + +DESCRIPTION: + Declaration of cDB2TextFile class + +PUBLIC CLASSES AND METHODS: + cDB2TextFile + The cDB2TextFile class provides the simple ability to read in an + ANSI/UNICODE file and copy it to a dynamically allocated buffer + + The sole difference between this and CStdioFile is that the issues + stemming from supporting both ANSI and UNICODE files are handled + in a simpler fashion at the expense of a bit of performance + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ +#include "StdAfx.h" + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// Class cDB2TextFile +/*=========================================================================*/ +class cDB2TextFile +{ + public: + // Constructor (loads file) + cDB2TextFile( LPCSTR pMemFile ); + + // Constructor (loads file from resource table) + cDB2TextFile( + HMODULE hModule, + LPCSTR pRscTable, + DWORD rscID ); + + // Constructor (loads file from buffer) + cDB2TextFile( + LPCSTR pBuffer, + ULONG bufferLen ); + + // Destructor + ~cDB2TextFile(); + + // (Inline) Get error status + DWORD GetStatus() + { + return mStatus; + }; + + // (Inline) Get the file contents + bool GetText( std::string & copy ) + { + bool bOK = IsValid(); + if (bOK == true) + { + copy = mText; + } + + return bOK; + }; + + // (Inline) Get file validity + virtual bool IsValid() + { + return (mStatus == NO_ERROR); + }; + + // Read the next available line + bool ReadLine( std::string & line ); + + protected: + /* File contents */ + std::string mText; + + /* Current position (in above contents) */ + int mCurrentPos; + + /* Error status */ + DWORD mStatus; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/DB2Utilities.cpp b/gobi-api/GobiAPI_1.0.40/Core/DB2Utilities.cpp new file mode 100755 index 0000000..0e40c6d --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/DB2Utilities.cpp @@ -0,0 +1,907 @@ +/*=========================================================================== +FILE: + DB2Utilities.cpp + +DESCRIPTION: + Utility functions for packing/parsing protocol entities using the + database + +PUBLIC ENUMERATIONS AND METHODS: + sProtocolEntityKey + sDB2PackingInput + sDB2NavInput + + MapQMIEntityTypeToProtocolType + MapQMIEntityTypeToQMIServiceType + MapQMIProtocolTypeToEntityType + DB2GetMaxBufferSize + DB2BuildQMIBuffer + DB2PackQMIBuffer + DB2ReduceQMIBuffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "DB2Utilities.h" + +#include "QMIBuffers.h" + +#include "DataPacker.h" +#include "ProtocolEntityFieldEnumerator.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +// Free Methods +//--------------------------------------------------------------------------- + +/*=========================================================================== +METHOD: + MapQMIEntityTypeToQMIServiceType (Public Free Method) + +DESCRIPTION: + Map a DB protocol entity type (for QMI) to a QMI service type + +PARAMETERS: + et [ I ] - Protocol entity type + +RETURN VALUE: + eQMIService +===========================================================================*/ +eQMIService MapQMIEntityTypeToQMIServiceType( eDB2EntityType et ) +{ + eQMIService st = eQMI_SVC_ENUM_BEGIN; + switch (et) + { + case eDB2_ET_QMI_CTL_REQ: + case eDB2_ET_QMI_CTL_RSP: + case eDB2_ET_QMI_CTL_IND: + st = eQMI_SVC_CONTROL; + break; + + case eDB2_ET_QMI_WDS_REQ: + case eDB2_ET_QMI_WDS_RSP: + case eDB2_ET_QMI_WDS_IND: + st = eQMI_SVC_WDS; + break; + + case eDB2_ET_QMI_DMS_REQ: + case eDB2_ET_QMI_DMS_RSP: + case eDB2_ET_QMI_DMS_IND: + st = eQMI_SVC_DMS; + break; + + case eDB2_ET_QMI_NAS_REQ: + case eDB2_ET_QMI_NAS_RSP: + case eDB2_ET_QMI_NAS_IND: + st = eQMI_SVC_NAS; + break; + + case eDB2_ET_QMI_QOS_REQ: + case eDB2_ET_QMI_QOS_RSP: + case eDB2_ET_QMI_QOS_IND: + st = eQMI_SVC_QOS; + break; + + case eDB2_ET_QMI_WMS_REQ: + case eDB2_ET_QMI_WMS_RSP: + case eDB2_ET_QMI_WMS_IND: + st = eQMI_SVC_WMS; + break; + + case eDB2_ET_QMI_PDS_REQ: + case eDB2_ET_QMI_PDS_RSP: + case eDB2_ET_QMI_PDS_IND: + st = eQMI_SVC_PDS; + break; + + case eDB2_ET_QMI_AUTH_REQ: + case eDB2_ET_QMI_AUTH_RSP: + case eDB2_ET_QMI_AUTH_IND: + st = eQMI_SVC_AUTH; + break; + + case eDB2_ET_QMI_VOICE_REQ: + case eDB2_ET_QMI_VOICE_RSP: + case eDB2_ET_QMI_VOICE_IND: + st = eQMI_SVC_VOICE; + break; + + case eDB2_ET_QMI_CAT_REQ: + case eDB2_ET_QMI_CAT_RSP: + case eDB2_ET_QMI_CAT_IND: + st = eQMI_SVC_CAT; + break; + + case eDB2_ET_QMI_RMS_REQ: + case eDB2_ET_QMI_RMS_RSP: + case eDB2_ET_QMI_RMS_IND: + st = eQMI_SVC_RMS; + break; + + case eDB2_ET_QMI_OMA_REQ: + case eDB2_ET_QMI_OMA_RSP: + case eDB2_ET_QMI_OMA_IND: + st = eQMI_SVC_OMA; + break; + } + + return st; +} + +/*=========================================================================== +METHOD: + MapQMIEntityTypeToProtocolType (Public Free Method) + +DESCRIPTION: + Map a DB protocol entity type (for QMI) to a buffer protocol type + +PARAMETERS: + et [ I ] - Protocol entity type + +RETURN VALUE: + eProtocolType +===========================================================================*/ +eProtocolType MapQMIEntityTypeToProtocolType( eDB2EntityType et ) +{ + eProtocolType pt = ePROTOCOL_ENUM_BEGIN; + switch (et) + { + case eDB2_ET_QMI_WDS_REQ: + pt = ePROTOCOL_QMI_WDS_TX; + break; + + case eDB2_ET_QMI_WDS_RSP: + case eDB2_ET_QMI_WDS_IND: + pt = ePROTOCOL_QMI_WDS_RX; + break; + + case eDB2_ET_QMI_DMS_REQ: + pt = ePROTOCOL_QMI_DMS_TX; + break; + + case eDB2_ET_QMI_DMS_RSP: + case eDB2_ET_QMI_DMS_IND: + pt = ePROTOCOL_QMI_DMS_RX; + break; + + case eDB2_ET_QMI_NAS_REQ: + pt = ePROTOCOL_QMI_NAS_TX; + break; + + case eDB2_ET_QMI_NAS_RSP: + case eDB2_ET_QMI_NAS_IND: + pt = ePROTOCOL_QMI_NAS_RX; + break; + + case eDB2_ET_QMI_QOS_REQ: + pt = ePROTOCOL_QMI_QOS_TX; + break; + + case eDB2_ET_QMI_QOS_RSP: + case eDB2_ET_QMI_QOS_IND: + pt = ePROTOCOL_QMI_QOS_RX; + break; + + case eDB2_ET_QMI_WMS_REQ: + pt = ePROTOCOL_QMI_WMS_TX; + break; + + case eDB2_ET_QMI_WMS_RSP: + case eDB2_ET_QMI_WMS_IND: + pt = ePROTOCOL_QMI_WMS_RX; + break; + + case eDB2_ET_QMI_PDS_REQ: + pt = ePROTOCOL_QMI_PDS_TX; + break; + + case eDB2_ET_QMI_PDS_RSP: + case eDB2_ET_QMI_PDS_IND: + pt = ePROTOCOL_QMI_PDS_RX; + break; + + case eDB2_ET_QMI_AUTH_REQ: + pt = ePROTOCOL_QMI_AUTH_TX; + break; + + case eDB2_ET_QMI_AUTH_RSP: + case eDB2_ET_QMI_AUTH_IND: + pt = ePROTOCOL_QMI_AUTH_RX; + break; + + case eDB2_ET_QMI_VOICE_REQ: + pt = ePROTOCOL_QMI_VOICE_TX; + break; + + case eDB2_ET_QMI_VOICE_RSP: + case eDB2_ET_QMI_VOICE_IND: + pt = ePROTOCOL_QMI_VOICE_RX; + break; + + case eDB2_ET_QMI_CAT_REQ: + pt = ePROTOCOL_QMI_CAT_TX; + break; + + case eDB2_ET_QMI_CAT_RSP: + case eDB2_ET_QMI_CAT_IND: + pt = ePROTOCOL_QMI_CAT_RX; + break; + + case eDB2_ET_QMI_RMS_REQ: + pt = ePROTOCOL_QMI_RMS_TX; + break; + + case eDB2_ET_QMI_RMS_RSP: + case eDB2_ET_QMI_RMS_IND: + pt = ePROTOCOL_QMI_RMS_RX; + break; + + case eDB2_ET_QMI_OMA_REQ: + pt = ePROTOCOL_QMI_OMA_TX; + break; + + case eDB2_ET_QMI_OMA_RSP: + case eDB2_ET_QMI_OMA_IND: + pt = ePROTOCOL_QMI_OMA_RX; + break; + + case eDB2_ET_QMI_CTL_REQ: + pt = ePROTOCOL_QMI_CTL_TX; + break; + + case eDB2_ET_QMI_CTL_RSP: + case eDB2_ET_QMI_CTL_IND: + pt = ePROTOCOL_QMI_CTL_RX; + break; + } + + return pt; +} + +/*=========================================================================== +METHOD: + MapQMIProtocolTypeToEntityType (Public Free Method) + +DESCRIPTION: + Map a buffer protocol type to a DB protocol entity type + +PARAMETERS: + pt [ I ] - Protocol type + bIndication [ I ] - Is this for an indication? + +RETURN VALUE: + eDB2EntityType +===========================================================================*/ +eDB2EntityType MapQMIProtocolTypeToEntityType( + eProtocolType pt, + bool bIndication ) +{ + eDB2EntityType et = eDB2_ET_ENUM_BEGIN; + switch (pt) + { + case ePROTOCOL_QMI_WDS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_WDS_IND; + } + else + { + et = eDB2_ET_QMI_WDS_RSP; + } + break; + + case ePROTOCOL_QMI_WDS_TX: + et = eDB2_ET_QMI_WDS_REQ; + break; + + case ePROTOCOL_QMI_DMS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_DMS_IND; + } + else + { + et = eDB2_ET_QMI_DMS_RSP; + } + break; + + case ePROTOCOL_QMI_DMS_TX: + et = eDB2_ET_QMI_DMS_REQ; + break; + + case ePROTOCOL_QMI_NAS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_NAS_IND; + } + else + { + et = eDB2_ET_QMI_NAS_RSP; + } + break; + + case ePROTOCOL_QMI_NAS_TX: + et = eDB2_ET_QMI_NAS_REQ; + break; + + case ePROTOCOL_QMI_QOS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_QOS_IND; + } + else + { + et = eDB2_ET_QMI_QOS_RSP; + } + break; + + case ePROTOCOL_QMI_QOS_TX: + et = eDB2_ET_QMI_QOS_REQ; + break; + + case ePROTOCOL_QMI_WMS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_WMS_IND; + } + else + { + et = eDB2_ET_QMI_WMS_RSP; + } + break; + + case ePROTOCOL_QMI_WMS_TX: + et = eDB2_ET_QMI_WMS_REQ; + break; + + case ePROTOCOL_QMI_PDS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_PDS_IND; + } + else + { + et = eDB2_ET_QMI_PDS_RSP; + } + break; + + case ePROTOCOL_QMI_PDS_TX: + et = eDB2_ET_QMI_PDS_REQ; + break; + + case ePROTOCOL_QMI_AUTH_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_AUTH_IND; + } + else + { + et = eDB2_ET_QMI_AUTH_RSP; + } + break; + + case ePROTOCOL_QMI_AUTH_TX: + et = eDB2_ET_QMI_AUTH_REQ; + break; + + case ePROTOCOL_QMI_VOICE_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_VOICE_IND; + } + else + { + et = eDB2_ET_QMI_VOICE_RSP; + } + break; + + case ePROTOCOL_QMI_VOICE_TX: + et = eDB2_ET_QMI_VOICE_REQ; + break; + + case ePROTOCOL_QMI_CAT_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_CAT_IND; + } + else + { + et = eDB2_ET_QMI_CAT_RSP; + } + break; + + case ePROTOCOL_QMI_CAT_TX: + et = eDB2_ET_QMI_CAT_REQ; + break; + + case ePROTOCOL_QMI_RMS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_RMS_IND; + } + else + { + et = eDB2_ET_QMI_RMS_RSP; + } + break; + + case ePROTOCOL_QMI_RMS_TX: + et = eDB2_ET_QMI_RMS_REQ; + break; + + case ePROTOCOL_QMI_OMA_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_OMA_IND; + } + else + { + et = eDB2_ET_QMI_OMA_RSP; + } + break; + + case ePROTOCOL_QMI_OMA_TX: + et = eDB2_ET_QMI_OMA_REQ; + break; + + case ePROTOCOL_QMI_CTL_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_CTL_IND; + } + else + { + et = eDB2_ET_QMI_CTL_RSP; + } + break; + + case ePROTOCOL_QMI_CTL_TX: + et = eDB2_ET_QMI_CTL_REQ; + break; + } + + return et; +} + +/*=========================================================================== +METHOD: + DB2GetMaxBufferSize (Public Free Method) + +DESCRIPTION: + Return the maximum size of a payload buffer for given type of + protocol entity + +PARAMETERS: + et [ I ] - Protocol entity type + +RETURN VALUE: + ULONG - Maximum +===========================================================================*/ +ULONG DB2GetMaxBufferSize( eDB2EntityType et ) +{ + ULONG maxSzInBytes = MAX_SHARED_BUFFER_SIZE; + + if (IsQMIEntityType( et ) == true) + { + // QMI items are further constrained in size + maxSzInBytes = QMI_MAX_BUFFER_SIZE; + } + + return maxSzInBytes; +} + +/*=========================================================================== +METHOD: + DB2BuildQMIBuffer (Internal Method) + +DESCRIPTION: + Build and return an allocated shared buffer for the QMI protocol using + the specified DB keys and payloads (one per TLV content) + +PARAMETERS: + input [ I ] - Protocol entity key and payload + +RETURN VALUE: + sSharedBuffer * (0 upon failure) +===========================================================================*/ +sSharedBuffer * DB2BuildQMIBuffer( + const std::vector & input ) +{ + // Assume failure + sSharedBuffer * pRef = 0; + + const ULONG szTransHdr = (ULONG)sizeof(sQMIServiceRawTransactionHeader); + const ULONG szMsgHdr = (ULONG)sizeof(sQMIRawMessageHeader); + const ULONG szTLVHdr = (ULONG)sizeof(sQMIRawContentHeader); + + // Need something to build (but not too much) + ULONG tlvs = (ULONG)input.size(); + if (tlvs == 0 || tlvs > (ULONG)UCHAR_MAX) + { + return pRef; + } + + // The protocol entity keys need to be consistent + const sDB2NavInput & tlvInput = input[0]; + if (tlvInput.IsValid() == false || tlvInput.mKey.size() < 3) + { + return pRef; + } + + eDB2EntityType et = (eDB2EntityType)tlvInput.mKey[0]; + if (IsQMIEntityType( et ) == false) + { + return pRef; + } + + ULONG t = 0; + for (t = 0; t < tlvs; t++) + { + const sDB2NavInput & tlvInput = input[t]; + if (tlvInput.mPayloadLen > QMI_MAX_BUFFER_SIZE) + { + return pRef; + } + } + + ULONG szReq = szTransHdr + szMsgHdr + (tlvs * szTLVHdr); + szReq += tlvInput.mPayloadLen; + + for (t = 1; t < tlvs; t++) + { + const sDB2NavInput & tlv2Input = input[t]; + if (tlv2Input.IsValid() == false || tlv2Input.mKey.size() < 3) + { + return pRef; + } + + if ( (tlvInput.mKey[0] != tlv2Input.mKey[0]) + || (tlvInput.mKey[1] != tlv2Input.mKey[1]) ) + { + return pRef; + } + + szReq += tlv2Input.mPayloadLen; + } + + // What we are building cannot be too large + if (szReq > QMI_MAX_BUFFER_SIZE) + { + return pRef; + } + + BYTE buf[QMI_MAX_BUFFER_SIZE]; + + sQMIRawContentHeader * pTLV = 0; + pTLV = (sQMIRawContentHeader *)&buf[0]; + + for (t = 0; t < tlvs; t++) + { + const sDB2NavInput & tlv2Input = input[t]; + + pTLV->mTypeID = (BYTE)tlv2Input.mKey[2]; + pTLV->mLength = (WORD)tlv2Input.mPayloadLen; + pTLV++; + + const BYTE * pPayload = (const BYTE *)pTLV; + memcpy( (LPVOID)pPayload, + (LPCVOID)tlv2Input.mpPayload, + (SIZE_T)tlv2Input.mPayloadLen ); + + pPayload += tlv2Input.mPayloadLen; + pTLV = (sQMIRawContentHeader *)pPayload; + } + + ULONG contentLen = szReq - szTransHdr - szMsgHdr; + eQMIService st = MapQMIEntityTypeToQMIServiceType( et ); + + pRef = sQMIServiceBuffer::BuildBuffer( st, + (WORD)tlvInput.mKey[1], + IsQMIEntityResponseType( et ), + IsQMIEntityIndicationType( et ), + &buf[0], + contentLen ); + + return pRef; +} + +/*=========================================================================== +METHOD: + DB2PackQMIBuffer (Internal Method) + +DESCRIPTION: + Build an allocated shared buffer for the QMI protocol + +PARAMETERS: + db [ I ] - Database to use for packing + input [ I ] - Protocol entity key and field values + +RETURN VALUE: + sSharedBuffer * (0 upon failure) +===========================================================================*/ +sSharedBuffer * DB2PackQMIBuffer( + const cCoreDatabase & db, + const std::vector & input ) +{ + // Assume failure + sSharedBuffer * pRef = 0; + + // Need something to build (but not too much) + ULONG tlvs = (ULONG)input.size(); + if (tlvs == 0 || tlvs > (ULONG)UCHAR_MAX) + { + return pRef; + } + + // The protocol entity keys need to be consistent + const sDB2PackingInput & tlvInput = input[0]; + if (tlvInput.IsValid() == false || tlvInput.mKey.size() < 3) + { + return pRef; + } + + eDB2EntityType et = (eDB2EntityType)tlvInput.mKey[0]; + if (IsQMIEntityType( et ) == false) + { + return pRef; + } + + ULONG t = 0; + for (t = 0; t < tlvs; t++) + { + const sDB2PackingInput & tlvInput = input[t]; + if (tlvInput.mDataLen > QMI_MAX_BUFFER_SIZE) + { + return pRef; + } + } + + for (t = 1; t < tlvs; t++) + { + const sDB2PackingInput & tlv2Input = input[t]; + if (tlv2Input.IsValid() == false || tlv2Input.mKey.size() < 3) + { + return pRef; + } + + if ( (tlvInput.mKey[0] != tlv2Input.mKey[0]) + || (tlvInput.mKey[1] != tlv2Input.mKey[1]) ) + { + return pRef; + } + } + + BYTE buf[QMI_MAX_BUFFER_SIZE]; + ULONG bufLen = 0; + + sQMIRawContentHeader * pTLV = 0; + pTLV = (sQMIRawContentHeader *)&buf[0]; + + bool bOK = true; + for (t = 0; t < tlvs; t++) + { + ULONG packedLen = 0; + const BYTE * pPackedData = 0; + + const sDB2PackingInput & tlv2Input = input[t]; + + if (tlv2Input.mbString == true) + { + if (tlv2Input.mValues.empty() == false) + { + // Convert field string to input fields + std::list fields + = cDataPacker::LoadValues( tlv2Input.mValues ); + + // Now pack + cDataPacker dp( db, tlv2Input.mKey, fields ); + bOK = dp.Pack(); + if (bOK == false) + { + break; + } + + pPackedData = dp.GetBuffer( packedLen ); + if (pPackedData == 0) + { + bOK = false; + break; + } + } + } + else + { + packedLen = tlv2Input.mDataLen; + pPackedData = tlv2Input.mpData; + } + + // Check if we need to adjust buffer + cProtocolEntityFieldEnumerator pefe( db, tlv2Input.mKey ); + bool bEnum = pefe.Enumerate(); + if (bEnum == true) + { + const std::vector & fieldIDs = pefe.GetFields(); + ULONG fieldCount = (ULONG)fieldIDs.size(); + if (fieldCount == 1) + { + const tDB2FieldMap & dbFields = db.GetProtocolFields(); + + tDB2FieldMap::const_iterator pField = dbFields.find( fieldIDs[0] ); + if (pField != dbFields.end()) + { + const sDB2Field & theField = pField->second; + if ( (theField.mType == eDB2_FIELD_STD) + && (theField.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_ANT) ) + { + // For QMI we need to strip out the trailing NULL + // string terminator when the TLV consists solely + // of a string since the length contained in the + // TLV structure itself renders the trailing NULL + // redundant + if (packedLen > 2) + { + packedLen--; + } + else + { + // This is the only way to specify an empty string in QMI + // when the TLV consists solely of a string + if (packedLen == 1) + { + packedLen--; + } + } + } + } + } + } + + bufLen += (ULONG)sizeof(sQMIRawContentHeader); + bufLen += packedLen; + + // What we are building cannot be too large + if (bufLen > QMI_MAX_BUFFER_SIZE) + { + bOK = false; + break; + } + + pTLV->mTypeID = (BYTE)tlv2Input.mKey[2]; + pTLV->mLength = (WORD)packedLen; + pTLV++; + + const BYTE * pPayload = (const BYTE *)pTLV; + memcpy( (LPVOID)pPayload, + (LPCVOID)pPackedData, + (SIZE_T)packedLen ); + + pPayload += packedLen; + pTLV = (sQMIRawContentHeader *)pPayload; + } + + if (bOK == false) + { + return pRef; + } + + eQMIService st = MapQMIEntityTypeToQMIServiceType( et ); + pRef = sQMIServiceBuffer::BuildBuffer( st, + (WORD)tlvInput.mKey[1], + IsQMIEntityResponseType( et ), + IsQMIEntityIndicationType( et ), + &buf[0], + bufLen ); + + return pRef; +} + +/*=========================================================================== +METHOD: + DB2ReduceQMIBuffer (Public Free Method) + +DESCRIPTION: + Reduce a DIAG buffer to a DB key and payload + +PARAMETERS: + buf [ I ] - Protocol buffer being reduced + +RETURN VALUE: + sDB2NavInput (invalid upon failure) +===========================================================================*/ +std::vector DB2ReduceQMIBuffer( const sProtocolBuffer & buf ) +{ + std::vector retInput; + + // We must have a valid protocol buffer + if (buf.IsValid() == false) + { + return retInput; + } + + eProtocolType pt = (eProtocolType)buf.GetType(); + if (IsQMIProtocol( pt ) != true) + { + return retInput; + } + + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + std::map tlvs = qmiBuf.GetContents(); + + bool bErr = false; + std::map ::const_iterator pIter; + for (pIter = tlvs.begin(); pIter != tlvs.end(); pIter++) + { + const sQMIRawContentHeader * pHdr = pIter->second; + if (pHdr == 0) + { + bErr = true; + break; + } + + bool bIndication = qmiBuf.IsIndication(); + eProtocolType pt = (eProtocolType)qmiBuf.GetType(); + eDB2EntityType et = MapQMIProtocolTypeToEntityType( pt, bIndication ); + + sDB2NavInput tmp; + tmp.mKey.push_back( (ULONG)et ); + tmp.mKey.push_back( qmiBuf.GetMessageID() ); + tmp.mKey.push_back( (ULONG)pHdr->mTypeID ); + + tmp.mPayloadLen = pHdr->mLength; + pHdr++; + + tmp.mpPayload = (const BYTE *)pHdr; + if (tmp.IsValid() == true) + { + retInput.push_back( tmp ); + } + else + { + // Ignore empty TLVs + if (tmp.mPayloadLen != 0) + { + bErr = true; + break; + } + } + } + + if (bErr == true) + { + retInput.clear(); + } + + return retInput; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/DB2Utilities.h b/gobi-api/GobiAPI_1.0.40/Core/DB2Utilities.h new file mode 100755 index 0000000..b3223e1 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/DB2Utilities.h @@ -0,0 +1,268 @@ +/*=========================================================================== +FILE: + DB2Utilities.h + +DESCRIPTION: + Utility functions for packing/parsing protocol entities using the + database + +PUBLIC ENUMERATIONS AND METHODS: + sProtocolEntityKey + sDB2PackingInput + sDB2NavInput + + MapQMIEntityTypeToProtocolType + MapQMIEntityTypeToQMIServiceType + MapQMIProtocolTypeToEntityType + DB2GetMaxBufferSize + DB2BuildQMIBuffer + DB2PackQMIBuffer + DB2ReduceQMIBuffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "CoreDatabase.h" +#include "SharedBuffer.h" +#include "ProtocolBuffer.h" +#include "QMIEnum.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Struct sProtocolEntityKey +// Simple structure to initializing protocol entity keys easier +/*=========================================================================*/ +struct sProtocolEntityKey +{ + public: + // (Inline) Constructor - default + sProtocolEntityKey() + { }; + + // (Inline) Constructor - single value keys + sProtocolEntityKey( ULONG val1 ) + { + mKey.push_back( val1 ); + }; + + // (Inline) Constructor - two value keys + sProtocolEntityKey( + ULONG val1, + ULONG val2 ) + { + mKey.push_back( val1 ); + mKey.push_back( val2 ); + }; + + // (Inline) Constructor - three value keys + sProtocolEntityKey( + ULONG val1, + ULONG val2, + ULONG val3 ) + { + mKey.push_back( val1 ); + mKey.push_back( val2 ); + mKey.push_back( val3 ); + }; + + // (Inline) Constructor - psuedo-copy constructor + sProtocolEntityKey( const std::vector & key ) + : mKey( key ) + { }; + + // (Inline) Constructor - copy constructor + sProtocolEntityKey( const sProtocolEntityKey & key ) + : mKey( key.mKey ) + { }; + + // (Inline) Assignment operator + sProtocolEntityKey & operator = ( const sProtocolEntityKey & key ) + { + mKey = key.mKey; + return *this; + }; + + // Cast operator to a protocol entity key + operator std::vector () const + { + return mKey; + }; + + /* Underlying key */ + std::vector mKey; +}; + +/*=========================================================================*/ +// Struct sDB2PackingInput +// Simple structure to make dealing packing easier +/*=========================================================================*/ +struct sDB2PackingInput +{ + public: + // (Inline) Constructor - default + sDB2PackingInput() + : mpData( 0 ), + mDataLen( 0 ), + mbString( true ) + { }; + + // (Inline) Constructor - parameterized (string payload) + sDB2PackingInput( + const sProtocolEntityKey & key, + LPCSTR pValue ) + : mKey( key ), + mpData( 0 ), + mDataLen( 0 ), + mbString( true ) + { + if (pValue != 0 && pValue[0] != 0) + { + mValues = pValue; + } + }; + + // (Inline) Constructor - parameterized (buffer payload) + sDB2PackingInput( + const sProtocolEntityKey & key, + const BYTE * pData, + ULONG dataLen ) + : mKey( key ), + mpData( pData ), + mDataLen( dataLen ), + mbString( false ) + { + // Nothing to do + }; + + // (Inline) Is this object in a valid state? + bool IsValid() const + { + // We need a key + if (mKey.size() <= 0) + { + return false; + } + + return true; + }; + + /* Underlying key */ + std::vector mKey; + + /* Are the values specified by a string? */ + bool mbString; + + /* String of space delimited field values */ + std::string mValues; + + /* Buffer containing pre-formatted fields */ + const BYTE * mpData; + + /* Length of above buffer */ + ULONG mDataLen; +}; + +/*=========================================================================*/ +// Struct sDB2NavInput +// Simple structure to make dealing with key/payload easier +/*=========================================================================*/ +struct sDB2NavInput +{ + public: + // (Inline) Constructor - default + sDB2NavInput() + : mpPayload( 0 ), + mPayloadLen( 0 ) + { }; + + // (Inline) Constructor - parameterized + sDB2NavInput( + const std::vector & key, + const BYTE * pData, + ULONG dataLen ) + : mKey( key ), + mpPayload( pData ), + mPayloadLen( dataLen ) + { }; + + // (Inline) Is this object in a valid state? + bool IsValid() const + { + return (mKey.size() > 0 && mpPayload != 0 && mPayloadLen > 0); + }; + + /* Database key for payload entity */ + std::vector mKey; + + /* Payload */ + const BYTE * mpPayload; + + /* Size of above payload */ + ULONG mPayloadLen; +}; + +// Map a DB protocol entity type to a buffer protocol type +eProtocolType MapQMIEntityTypeToProtocolType( eDB2EntityType et ); + +// Map a DB protocol entity type to a QMI service type +eQMIService MapQMIEntityTypeToQMIServiceType( eDB2EntityType et ); + +// Map a buffer protocol type to a DB protocol entity type +eDB2EntityType MapQMIProtocolTypeToEntityType( + eProtocolType pt, + bool bIndication = false ); + +// Return the maximum size of a payload buffer for given type of +// protocol entity +ULONG DB2GetMaxBufferSize( eDB2EntityType et ); + +// Build an allocated shared buffer for the QMI protocol +sSharedBuffer * DB2BuildQMIBuffer( + const std::vector & input ); + +// Build an allocated shared buffer for the QMI protocol +sSharedBuffer * DB2PackQMIBuffer( + const cCoreDatabase & db, + const std::vector & input ); + +// Reduce a QMI buffer to DB keys and payload +std::vector DB2ReduceQMIBuffer( const sProtocolBuffer & buf ); + diff --git a/gobi-api/GobiAPI_1.0.40/Core/DataPacker.cpp b/gobi-api/GobiAPI_1.0.40/Core/DataPacker.cpp new file mode 100755 index 0000000..16107b3 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/DataPacker.cpp @@ -0,0 +1,831 @@ +/*=========================================================================== +FILE: + DataPacker.cpp + +DESCRIPTION: + Implementation of sUnpackedField and cDataPacker + +PUBLIC CLASSES AND METHODS: + sUnpackedField + Structure to represent a single unpacked (input) field - i.e. the + field value as a string and an optional field name (either fully + qualified) or partial + + cDataPacker + Class to pack bit/byte specified fields into a buffer accordinging + to a database description, uses cProtocolEntityNav to navigate the DB + definition + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "DataPacker.h" + +#include "CoreDatabase.h" +#include "DB2Utilities.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cDataPacker Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cDataPacker (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + db [ I ] - Database to use + key [ I ] - Key into protocol entity table + fields [ I ] - Fields to pack into buffer + +RETURN VALUE: + None +===========================================================================*/ +cDataPacker::cDataPacker( + const cCoreDatabase & db, + const std::vector & key, + const std::list & fields ) + : cProtocolEntityNav( db ), + mKey( key ), + mbValuesOnly( true ), + mProcessedFields( 0 ), + mbPacked( false ) +{ + // Initialize internal buffer + memset( &mBuffer[0], 0, (SIZE_T)MAX_SHARED_BUFFER_SIZE ); + + // Compute bits left in buffer + ULONG bits = MAX_SHARED_BUFFER_SIZE * BITS_PER_BYTE; + if (mKey.size() > 0) + { + eDB2EntityType et = (eDB2EntityType)mKey[0]; + bits = DB2GetMaxBufferSize( et ) * BITS_PER_BYTE; + } + + // Setup the bit packer + mBitsy.SetData( mBuffer, bits ); + + // Copy fields/set value only flag + std::list ::const_iterator pIter = fields.begin(); + while (pIter != fields.end()) + { + if (pIter->mName.size() > 0) + { + mbValuesOnly = false; + } + + mFields.push_back( *pIter ); + pIter++; + } +} + +/*=========================================================================== +METHOD: + ~cDataPacker (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cDataPacker::~cDataPacker() +{ + // Ask bit packer to release data + mBitsy.ReleaseData(); +} + +/*=========================================================================== +METHOD: + Pack (Public Method) + +DESCRIPTION: + Pack the buffer + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataPacker::Pack() +{ + // Process (pack) the protocol entity + if (mbPacked == false) + { + mbPacked = ProcessEntity( mKey ); + if (mbPacked == false) + { + // Failed due to no structure ID? + if (mEntity.IsValid() == true && mEntity.mStructID == -1) + { + // Yes, for us that means instant success (no payload to pack) + mbPacked = true; + } + } + } + + return mbPacked; +} + +/*=========================================================================== +METHOD: + GetBuffer (Public Method) + +DESCRIPTION: + Get packed buffer contents + +PARAMETERS: + bufferLen [ O ] - Length of packed buffer (in bytes) + +RETURN VALUE: + const BYTE * - Packed buffer (0 upon error) +===========================================================================*/ +const BYTE * cDataPacker::GetBuffer( ULONG & bufferLen ) +{ + if (mbPacked == false) + { + bufferLen = 0; + return 0; + } + + // Payload size in bytes + bufferLen = mBitsy.GetTotalBitsWritten() + BITS_PER_BYTE - 1; + bufferLen /= BITS_PER_BYTE; + + // Payload is our buffer + const BYTE * pBuffer = 0; + if (bufferLen > 0) + { + pBuffer = (const BYTE *)&mBuffer[0]; + } + + return pBuffer; +} + +/*=========================================================================== +METHOD: + LoadValues (Static Public Method) + +DESCRIPTION: + Load values by parsing a 'summary' string of values, an example of + which would be: + + 0 1 100 "Foo Foo Foo" 15 -1 + +PARAMETERS: + vals [ I ] - Value string + +RETURN VALUE: + std::list +===========================================================================*/ +std::list cDataPacker::LoadValues( const std::string & vals ) +{ + std::list retList; + if (vals.size() <= 0) + { + return retList; + } + + std::vector tokens; + ParseCommandLine( vals, tokens ); + + std::string name = ""; + std::string val = ""; + + std::vector ::const_iterator pIter = tokens.begin(); + while (pIter != tokens.end()) + { + val = *pIter++; + + sUnpackedField entry( name, val ); + retList.push_back( entry ); + } + + return retList; +} + +/*=========================================================================== +METHOD: + LoadValues (Static Public Method) + +DESCRIPTION: + Load values by parsing a vector of string values, an example of + which would be: + + [0] 0 + [1] 1 + [2] 100 + [3] "Foo Foo Foo" + [4] 15 + [5] -1 + +PARAMETERS: + vals [ I ] - Vector of values + startIndex [ I ] - Where in above vector values start + +RETURN VALUE: + std::list +===========================================================================*/ +std::list cDataPacker::LoadValues( + std::vector & vals, + ULONG startIndex ) +{ + std::list retList; + + ULONG sz = (ULONG)vals.size(); + if (startIndex >= sz) + { + return retList; + } + + std::string name = ""; + std::string val = ""; + + for (ULONG v = startIndex; v < sz; v++) + { + val = vals[v]; + + sUnpackedField entry( name, val ); + retList.push_back( entry ); + } + + return retList; +} + +/*=========================================================================== +METHOD: + GetLastValue (Internal Method) + +DESCRIPTION: + Working from the back of the current value list find and return the + value for the specified field ID as a LONGLONG (field type must have + been able to fit in a LONGLONG for a value to be stored in value list + and thus returned) + +PARAMETERS: + fieldID [ I ] - Field ID we are looking for + val [ O ] - The value + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataPacker::GetLastValue( + ULONG fieldID, + LONGLONG & val ) +{ + // Assume failure + bool bRC = false; + + std::list < std::pair >::reverse_iterator pValues; + pValues = mValues.rbegin(); + while (pValues != mValues.rend()) + { + std::pair & entry = *pValues; + if (entry.first == fieldID) + { + val = entry.second; + + // Success! + bRC = true; + break; + } + + pValues++; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetValueString (Internal Method) + +DESCRIPTION: + For the given field return the (input) value string + +PARAMETERS: + field [ I ] - The field being processed + fieldName [ I ] - Partial (or fully qualified) field name + pValueString [ O ] - Value string + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataPacker::GetValueString( + const sDB2Field & field, + const std::string & fieldName, + LPCSTR & pValueString ) +{ + // Assume failure + pValueString = 0; + + // Create fully qualified field name + std::string fullName = GetFullFieldName( fieldName ); + + std::vector ::const_iterator pVals = mFields.begin(); + while (pVals != mFields.end()) + { + const std::string & inName = pVals->mName; + if (fieldName == inName || fullName == inName) + { + pValueString = (LPCSTR)pVals->mValueString.c_str(); + break; + } + + pVals++; + } + + // Value provided? + if (pValueString == 0) + { + // No, are we in value only mode? + if (mbValuesOnly == true) + { + if (mProcessedFields < (ULONG)mFields.size()) + { + sUnpackedField & upf = mFields[mProcessedFields++]; + + // Set field name (partial) + upf.mName = fieldName; + + // Grab field value + pValueString = (LPCSTR)upf.mValueString.c_str(); + } + } + else + { + return false; + } + } + + // Value provided? + if (pValueString == 0) + { + return false; + } + + // Meaningful value provided? + if (pValueString[0] == 0) + { + // No value provided for field? Is it a string? + if (field.mType == eDB2_FIELD_STD) + { + if ( (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_A) + && (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_U) + && (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_U8) + && (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_ANT) + && (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_UNT) + && (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_U8NT) ) + { + // No, unable to proceed + return false; + } + } + } + + return true; +} + +/*=========================================================================== +METHOD: + PackString (Internal Method) + +DESCRIPTION: + Pack the string (described by the given arguments) into the buffer + +PARAMETERS: + numChars [ I ] - Number of characters to pack (0 = NULL terminated) + pStr [ I ] - String to pack + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataPacker::PackString( + ULONG numChars, + LPCSTR pStr ) +{ + // Sanity check string pointer + if (pStr == 0) + { + return false; + } + + // Assume success + bool bOK = true; + + // Convert native string type to desired output type + const BYTE * pTmp = (const BYTE *)pStr; + + // Have we reached the practical end of a fixed length string? + ULONG numBytes = 0; + + numBytes = (ULONG)strlen( (LPCSTR)pTmp ); + if (numChars == 0) + { + // We pack the string plus the NULL character + numChars = (ULONG)strlen( (LPCSTR)pTmp ) + 1; + } + + // String size too long? + if (numBytes > numChars) + { + return false; + } + + // Pack the string one byte at a time + for (ULONG c = 0; c < numChars; c++) + { + BYTE val = 0; + if (c < numBytes) + { + val = pTmp[c]; + } + + DWORD rc = mBitsy.Set( BITS_PER_BYTE, val ); + if (rc != NO_ERROR) + { + bOK = false; + break; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ProcessField (Internal Method) + +DESCRIPTION: + Process the given field (described by the given arguments) by packing + the value into the buffer + +PARAMETERS: + pField [ I ] - The field being processed + fieldName [ I ] - Field name (partial) + arrayIndex [ I ] - Not used + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataPacker::ProcessField( + const sDB2Field * pField, + const std::string & fieldName, + LONGLONG /* arrayIndex */ ) +{ + // Assume failure + bool bOK = false; + if (pField == 0) + { + return bOK; + } + + // Find given value for field + LPCSTR pVal = 0; + bool bVal = GetValueString( *pField, fieldName, pVal ); + if (bVal == false) + { + return bOK; + } + + // Grab field ID + ULONG id = pField->mID; + + // What type is this field? + switch (pField->mType) + { + case eDB2_FIELD_STD: + { + // Standard field, what kind? + eDB2StdFieldType ft = (eDB2StdFieldType)pField->mTypeVal; + switch (ft) + { + // Field is a boolean (0/1, false/true)/8-bit unsigned integer + case eDB2_FIELD_STDTYPE_BOOL: + case eDB2_FIELD_STDTYPE_UINT8: + { + // We pack as a UCHAR + UCHAR val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + if (ft == eDB2_FIELD_STDTYPE_BOOL && val > 1) + { + val = 1; + } + + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 8-bit signed integer + case eDB2_FIELD_STDTYPE_INT8: + { + // We pack as a CHAR + CHAR val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 16-bit signed integer + case eDB2_FIELD_STDTYPE_INT16: + { + // We pack as a SHORT + SHORT val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 16-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT16: + { + // We pack as a USHORT + USHORT val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 32-bit signed integer + case eDB2_FIELD_STDTYPE_INT32: + { + // We pack as a LONG + LONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 32-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT32: + { + // We pack as a ULONG + ULONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 64-bit signed integer + case eDB2_FIELD_STDTYPE_INT64: + { + // We pack as a LONGLONG + LONGLONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 64-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT64: + { + // We pack as a ULONGLONG + ULONGLONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + if (val <= LLONG_MAX) + { + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + } + + bOK = true; + } + } + } + break; + + // ANSI/UNICODE strings + case eDB2_FIELD_STDTYPE_STRING_A: + case eDB2_FIELD_STDTYPE_STRING_U: + case eDB2_FIELD_STDTYPE_STRING_ANT: + case eDB2_FIELD_STDTYPE_STRING_UNT: + { + // Set the character size + ULONG charSz = sizeof(CHAR); + if ( (ft == eDB2_FIELD_STDTYPE_STRING_U) + || (ft == eDB2_FIELD_STDTYPE_STRING_UNT) ) + { + charSz = sizeof(USHORT); + } + + // Compute the number of characters? + ULONG numChars = 0; + if ( (ft == eDB2_FIELD_STDTYPE_STRING_A) + || (ft == eDB2_FIELD_STDTYPE_STRING_U) ) + { + numChars = (pField->mSize / BITS_PER_BYTE) / charSz; + } + + // Pack the string + bOK = PackString( numChars, pVal ); + } + break; + + // UTF-8 strings + case eDB2_FIELD_STDTYPE_STRING_U8: + case eDB2_FIELD_STDTYPE_STRING_U8NT: + { + // Unsupported in the Linux adaptation + bOK = false; + } + break; + + // Field is 32-bit floating point value + case eDB2_FIELD_STDTYPE_FLOAT32: + { + // We pack as a ULONG + FLOAT val = (float)atof( (LPCSTR)pVal ); + ULONG * pTmp = (ULONG *)&val; + + DWORD rc = mBitsy.Set( pField->mSize, *pTmp ); + if (rc == NO_ERROR) + { + // Success! + bOK = true; + } + } + break; + + // Field is 64-bit floating point value + case eDB2_FIELD_STDTYPE_FLOAT64: + { + // We pack as a ULONGLONG + double val = atof( (LPCSTR)pVal ); + ULONGLONG * pTmp = (ULONGLONG *)&val; + + DWORD rc = mBitsy.Set( pField->mSize, *pTmp ); + if (rc == NO_ERROR) + { + // Success! + bOK = true; + } + } + break; + + default: + { + bOK = false; + } + break; + } + } + break; + + case eDB2_FIELD_ENUM_UNSIGNED: + { + // We pack as a ULONG + ULONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + case eDB2_FIELD_ENUM_SIGNED: + { + // We pack as a LONG + LONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + default: + { + bOK = false; + } + break; + } + + return bOK; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/DataPacker.h b/gobi-api/GobiAPI_1.0.40/Core/DataPacker.h new file mode 100755 index 0000000..13af0d7 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/DataPacker.h @@ -0,0 +1,216 @@ +/*=========================================================================== +FILE: + DataPacker.h + +DESCRIPTION: + Declaration of sUnpackedField and cDataPacker + +PUBLIC CLASSES AND METHODS: + sUnpackedField + Structure to represent a single unpacked (input) field - i.e. the + field value as a string and an optional field name (either fully + qualified) or partial + + cDataPacker + Class to pack bit/byte specified fields into a buffer accordinging + to a database description, uses cProtocolEntityNav to navigate the DB + definition + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "CoreDatabase.h" +#include "CoreUtilities.h" +#include "BitPacker.h" +#include "SharedBuffer.h" +#include "ProtocolEntityNav.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Struct sUnpackedField +// +// Structure to represent an unpacked (input) field +/*=========================================================================*/ +struct sUnpackedField +{ + public: + // (Inline) Constructor - default + sUnpackedField() + : mName( "" ), + mValueString( "" ) + { }; + + // (Inline) Constructor - parameterized + sUnpackedField( + const std::string & name, + const std::string & valueStr ) + : mName( name ), + mValueString( valueStr ) + { }; + + /* Field value as a string */ + std::string mValueString; + + /* Name of field */ + std::string mName; +}; + +/*=========================================================================*/ +// Class cDataPacker +// Class to pack bit/byte specified fields into a buffer +/*=========================================================================*/ +class cDataPacker : public cProtocolEntityNav +{ + public: + // Constructor + cDataPacker( + const cCoreDatabase & db, + const std::vector & key, + const std::list & fields ); + + // Destructor + virtual ~cDataPacker(); + + // Pack the buffer + virtual bool Pack(); + + // Get packed buffer contents + const BYTE * GetBuffer( ULONG & bufferLen ); + + // Return the results of packing as an allocated shared buffer + sSharedBuffer * GetDiagBuffer( bool bNVRead ); + + // Load values by parsing a 'summary' string of values + static std::list LoadValues( const std::string & vals ); + + // Load values by parsing a vector of string values + static std::list LoadValues( + std::vector & vals, + ULONG startIndex ); + + protected: + // Working from the back of the current value list find + // and return the value for the specified field ID as a + // LONGLONG (field type must be able to fit) + virtual bool GetLastValue( + ULONG fieldID, + LONGLONG & val ); + + // For the given field return the (input) value string + virtual bool GetValueString( + const sDB2Field & field, + const std::string & fieldName, + LPCSTR & pValueString ); + + // Pack the string (described by the given arguments) into the buffer + virtual bool PackString( + ULONG numChars, + LPCSTR pStr ); + + // Process the given field + virtual bool ProcessField( + const sDB2Field * pField, + const std::string & fieldName, + LONGLONG arrayIndex = -1 ); + + // (Inline) Get current working offset + virtual ULONG GetOffset() + { + return mBitsy.GetNumBitsWritten(); + }; + + // (Inline) Set current working offset + virtual bool SetOffset( ULONG offset ) + { + mBitsy.SetOffset( offset ); + return true; + }; + + // (Inline) Get current navigation order + virtual bool GetLSBMode() + { + return mBitsy.GetLSBMode(); + }; + + // (Inline) Set current navigation order + virtual bool SetLSBMode( bool bLSB ) + { + // Assume success + bool bOK = true; + if (bLSB != GetLSBMode()) + { + if ((GetOffset() % BITS_PER_BYTE) != 0) + { + // We need to be on a byte boundary + bOK = false; + } + else + { + mBitsy.SetLSBMode( bLSB ); + } + } + + return bOK; + }; + + /* Entity key */ + std::vector mKey; + + /* The underlying bit packer */ + cBitPacker mBitsy; + + /* The vector of fields */ + std::vector mFields; + + /* Are we operating in value only mode, i.e. no field names given? */ + bool mbValuesOnly; + ULONG mProcessedFields; + + /* Raw field values associated with field ID */ + std::list < std::pair > mValues; + + /* Internal working buffer */ + BYTE mBuffer[MAX_SHARED_BUFFER_SIZE]; + + /* Did we successfully pack the buffer? */ + bool mbPacked; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/DataParser.cpp b/gobi-api/GobiAPI_1.0.40/Core/DataParser.cpp new file mode 100755 index 0000000..24bc2df --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/DataParser.cpp @@ -0,0 +1,1118 @@ +/*=========================================================================== +FILE: + DataParser.cpp + +DESCRIPTION: + Implementation of sParsedField and cDataParser + +PUBLIC CLASSES AND METHODS: + sParsedField + Structure to represent a single parsed field (field ID, offset, + size, value, name, etc.) + + cDataParser + Class to parse a buffer into bit/byte specified fields accordinging + to a database description, uses cProtocolEntityNav to navigate the DB + definition + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "DataParser.h" + +#include "CoreDatabase.h" +#include "DB2Utilities.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sParsedField Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sParsedField (Public Method) + +DESCRIPTION: + Construct a parsed field by setting the values and extracting + the data according to the definition + +PARAMETERS: + db [ I ] - Database to use + field [ I ] - Field description (from database) + name [ I ] - Desired field name + bp [I/O] - Bit parser to use + bGenStrings [ I ] - Generate field value strings? + + NOTE: 'bGenStrings' does not apply to fields that are string types? + +RETURN VALUE: + None +===========================================================================*/ +sParsedField::sParsedField( + const cCoreDatabase & db, + const sDB2Field * pField, + const std::string & name, + cBitParser & bp, + bool bGenStrings ) + : mField(), + mOffset( bp.GetNumBitsParsed() ), + mValueString( "" ), + mName( name ), + mbValid( false ) +{ + // Clear value + memset( (PVOID)&mValue, 0, (SIZE_T)sizeof( mValue ) ); + + // Assume failure + bool bOK = false; + if (pField == 0) + { + return; + } + + mField = *pField; + + char tempValueString[128]; + memset( &tempValueString[0], 0, 128 ); + + // What type is this field? + switch (mField.mType) + { + case eDB2_FIELD_STD: + { + // Standard field, what kind? + eDB2StdFieldType ft = (eDB2StdFieldType)mField.mTypeVal; + switch (ft) + { + // Field is a boolean (0/1, false/true)/8-bit unsigned integer + case eDB2_FIELD_STDTYPE_BOOL: + case eDB2_FIELD_STDTYPE_UINT8: + { + // We store as a UCHAR + UCHAR val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Constrain boolean values? + if (ft == eDB2_FIELD_STDTYPE_BOOL && val > 1) + { + val = 1; + } + + // Success! + mValue.mU8 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%02X", (UINT)mValue.mU8 ); + } + else + { + snprintf( &tempValueString[0], 0, "%u", (UINT)mValue.mU8 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 8-bit signed integer + case eDB2_FIELD_STDTYPE_INT8: + { + // We store as a CHAR + CHAR val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mS8 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%02X", (UINT)mValue.mU8 ); + } + else + { + snprintf( &tempValueString[0], 0, "%d", (INT)mValue.mS8 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 16-bit signed integer + case eDB2_FIELD_STDTYPE_INT16: + { + // We store as a SHORT + SHORT val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mS16 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%04hX", mValue.mU16 ); + } + else + { + snprintf( &tempValueString[0], 0, "%hd", mValue.mS16 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 16-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT16: + { + // We store as a USHORT + USHORT val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mU16 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%04hX", mValue.mU16 ); + } + else + { + snprintf( &tempValueString[0], 0, "%hu", mValue.mU16 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 32-bit signed integer + case eDB2_FIELD_STDTYPE_INT32: + { + // We store as a LONG + LONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mS32 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%08lX", mValue.mU32 ); + } + else + { + snprintf( &tempValueString[0], 0, "%ld", mValue.mS32 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 32-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT32: + { + // We store as a ULONG + ULONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mU32 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%08lX", mValue.mU32 ); + } + else + { + snprintf( &tempValueString[0], 0, "%lu", mValue.mU32 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 64-bit signed integer + case eDB2_FIELD_STDTYPE_INT64: + { + // We store as a LONGLONG + LONGLONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mS64 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%016llX", mValue.mU64 ); + } + else + { + snprintf( &tempValueString[0], 0, "%lld", mValue.mS64 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 64-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT64: + { + // We store as a ULONGLONG + ULONGLONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mU64 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%016llX", mValue.mU64 ); + } + else + { + snprintf( &tempValueString[0], 0, "%llu", mValue.mU64 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // ANSI/UNICODE fixed length string + case eDB2_FIELD_STDTYPE_STRING_A: + case eDB2_FIELD_STDTYPE_STRING_U: + { + // Compute the number of characters + ULONG numChars = mField.mSize / BITS_PER_BYTE; + + // Parse out the string + bOK = ParseString( numChars, bp ); + } + break; + + // ANSI NULL terminated string + case eDB2_FIELD_STDTYPE_STRING_ANT: + { + // Figure out the length of the string + ULONG numChars = 0; + + // Temporarily assume success + bOK = true; + + ULONG tmpOffset = bp.GetNumBitsParsed(); + + CHAR val = 1; + while (val != 0) + { + DWORD rc = bp.Get( BITS_PER_BYTE, val ); + if (rc == NO_ERROR) + { + numChars++; + } + else + { + val = 0; + } + } + + // Now actually parse/load the string + if (bOK == true) + { + bp.SetOffset( tmpOffset ); + bOK = ParseString( numChars, bp ); + } + } + break; + + // UNICODE NULL terminated string + case eDB2_FIELD_STDTYPE_STRING_UNT: + { + // Figure out the length of the string + ULONG numChars = 0; + + // Temporarily assume success + bOK = true; + + ULONG tmpOffset = bp.GetNumBitsParsed(); + + USHORT val = 1; + while (val != 0) + { + DWORD rc = bp.Get( BITS_PER_BYTE, val ); + if (rc == NO_ERROR) + { + numChars++; + } + else + { + val = 0; + } + } + + // Now actually parse/load the string + if (bOK == true) + { + bp.SetOffset( tmpOffset ); + bOK = ParseString( numChars, bp ); + } + } + break; + + case eDB2_FIELD_STDTYPE_STRING_U8: + case eDB2_FIELD_STDTYPE_STRING_U8NT: + // Unsupported in the Linux adaptation + bOK = false; + break; + + // Field is 32-bit floating point value + case eDB2_FIELD_STDTYPE_FLOAT32: + { + // We store as a ULONG + ULONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + FLOAT * pFloat = (FLOAT *)&val; + + // Success! + mValue.mFP32 = *pFloat; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%04lX", mValue.mU32 ); + } + else + { + snprintf( &tempValueString[0], 0, "%f", mValue.mFP32 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 64-bit floating point value + case eDB2_FIELD_STDTYPE_FLOAT64: + { + // We store as a ULONGLONG + ULONGLONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + DOUBLE * pFloat = (DOUBLE *)&val; + + // Success! + mValue.mFP64 = *pFloat; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%08llX", mValue.mU64 ); + } + else + { + snprintf( &tempValueString[0], 0, "%f", mValue.mFP64 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + } + } + break; + + // Unsigend enum value + case eDB2_FIELD_ENUM_UNSIGNED: + { + // We store as a ULONG + ULONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mU32 = val; + bOK = true; + + // Grab the enum ID + ULONG id = pField->mTypeVal; + + // Map to a string? + if (bGenStrings == true) + { + mValueString = db.MapEnumToString( id, + (int)mValue.mU32, + true, + mField.mbHex ); + } + } + } + break; + + // Signed enum value + case eDB2_FIELD_ENUM_SIGNED: + { + // We store as a LONG + LONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mS32 = val; + bOK = true; + + // Grab the enum ID + ULONG id = pField->mTypeVal; + + // Map to a string? + if (bGenStrings == true) + { + mValueString = db.MapEnumToString( id, + (int)mValue.mS32, + true, + mField.mbHex ); + } + } + } + break; + } + + mbValid = bOK; +} + +/*=========================================================================== +METHOD: + ParseString (Public Method) + +DESCRIPTION: + Convert the field value to a string + +PARAMETERS: + numChars [ I ] - Number of characters to parse/load + bp [I/O] - Bit parser to use + +RETURN VALUE: + bool +===========================================================================*/ +bool sParsedField::ParseString( + ULONG numChars, + cBitParser & bp ) +{ + // Validate size (including null char) + if (MAX_SHARED_BUFFER_SIZE < numChars + 1) + { + return false; + } + + // Assume success + bool bRC = true; + + // Store current offset so we can update field length + ULONG curOffset = bp.GetNumBitsParsed(); + + // Load each byte of the string individually + BYTE buf[MAX_SHARED_BUFFER_SIZE]; + for (ULONG c = 0; c < numChars; c++) + { + BYTE val = 0; + DWORD rc = bp.Get( BITS_PER_BYTE, val ); + if (rc == NO_ERROR) + { + buf[c] = val; + } + else + { + bRC = false; + break; + } + } + + if (bRC == true) + { + // Write zeros to the rest of the buffer + ULONG size = numChars; + ULONG end = numChars + 1; + for (ULONG current = size; current < end; current++) + { + buf[current] = 0; + } + + mValueString = (LPCSTR)&buf[0]; + + mValue.mpAStr = (LPCSTR)mValueString.c_str(); + + // Update field size + mField.mSize = bp.GetNumBitsParsed() - curOffset; + } + + return bRC; +} + +/*=========================================================================*/ +// cParsedFieldNavigator Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetFieldIndex (Public Method) + +DESCRIPTION: + Get index of the (first) field that matches the given field ID + +PARAMETERS: + fieldID [ I ] - Field ID to look for + bLoop [ I ] - Loop around end of field list? + +RETURN VALUE: + ULONG - Index of the field (0xFFFFFFFF upon failure) +===========================================================================*/ +ULONG cParsedFieldNavigator::GetFieldIndex( + ULONG fieldID, + bool bLoop ) const +{ + ULONG id = ULONG_MAX; + ULONG count = (ULONG)mFields.size(); + + // Start from last field ID? + ULONG fp = 0; + ULONG fi = 0; + if (mLastIDIndex < count) + { + fi = mLastIDIndex; + } + else if (mLastIDIndex != ULONG_MAX && bLoop == false) + { + // Beyond end of fields with no looping + mLastIDIndex = id; + return id; + } + + for (fp = 0; fp < count; fp++) + { + if (mFields[fi].mField.mID == fieldID) + { + id = fi; + break; + } + + fi++; + if (fi == count) + { + if (bLoop == true) + { + fi = 0; + } + else + { + break; + } + } + } + + // Update last ID accordingly (0xFFFFFFFF upon failure), and return + mLastIDIndex = id; + if (mLastIDIndex != ULONG_MAX) + { + mLastIDIndex++; + if (mLastIDIndex == count) + { + mLastIDIndex = 0; + } + } + + return id; +} + +/*=========================================================================*/ +// cDataParser Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cDataParser (Public Method) + +DESCRIPTION: + Constructor (protocol buffer, entity key, and payload) + +PARAMETERS: + db [ I ] - Database to use + buffer [ I ] - The protocol buffer being parsed + key [ I ] - Protocol entity key + pData [ I ] - Payload from above protocol buffer + dataLen [ I ] - Size of above payload + +RETURN VALUE: + None +===========================================================================*/ +cDataParser::cDataParser( + const cCoreDatabase & db, + const sProtocolBuffer & buffer, + const std::vector & key, + const BYTE * pData, + ULONG dataLen ) + : cProtocolEntityNav( db ), + mBuffer( buffer.GetSharedBuffer() ), + mbFieldStrings( true ), + mbParsed( false ) +{ + // We must have a valid protocol buffer + if (mBuffer.IsValid() == false) + { + return; + } + + // We need something to parse + if (pData == 0 || dataLen == 0) + { + return; + } + + // Key has to be proper + if (key.size() < 1) + { + return; + } + + // Key needs to match protocol + eProtocolType pt = (eProtocolType)mBuffer.GetType(); + eDB2EntityType et = (eDB2EntityType)key[0]; + + if (pt == ePROTOCOL_DIAG_RX || pt == ePROTOCOL_DIAG_TX) + { + if (IsDiagEntityType( et ) == false) + { + return; + } + } + + else if (IsQMIProtocol( pt ) == true) + { + if (IsQMIEntityType( et ) == false) + { + return; + } + } + + // Pass data to the bit parser + mKey = key; + mBitsy.SetData( pData, dataLen * BITS_PER_BYTE ); +} + +/*=========================================================================== +METHOD: + ~cDataParser (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cDataParser::~cDataParser() +{ + // Ask bit parser to release data + mBitsy.ReleaseData(); + + // Empty fields + mFields.clear(); +} + +/*=========================================================================== +METHOD: + Parse (Public Method) + +DESCRIPTION: + Parse the data to a list of fields/summary text + +PARAMETERS: + bFieldStrings [ I ] - Generate string representations of field values? + bFieldNames [ I ] - Generate (partial) field names? + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataParser::Parse( + bool bFieldStrings, + bool bFieldNames ) +{ + // Store parsing options + mbFieldStrings = bFieldStrings; + mbFieldNames = bFieldNames; + + if (mbParsed == false) + { + // Allocate space for 1024 fields up front in order to increase + // performance when parsing and accessing parsed fields + mFields.reserve( 1024 ); + + // Process (parse) the protocol entity + mbParsed = ProcessEntity( mKey ); + } + + return mbParsed; +} + + +/*=========================================================================== +METHOD: + GetLastValue (Internal Method) + +DESCRIPTION: + Working from the back of the current field list find and return the + value for the specified field ID as a LONGLONG (field type must be + able to fit in a LONGLONG for a value to be returned) + +PARAMETERS: + fieldID [ I ] - Field ID we are looking for + val [ O ] - The value + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataParser::GetLastValue( + ULONG fieldID, + LONGLONG & val ) +{ + // Assume failure + bool bRC = false; + + // Use field value tracking information + std::map >::iterator pTF; + pTF = mTrackedFields.find( fieldID ); + if (pTF != mTrackedFields.end() && pTF->second.first == true) + { + val = pTF->second.second; + bRC = true; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ContinueNavigation (Internal Method) + +DESCRIPTION: + Continue navigation now that entity has been set? + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataParser::ContinueNavigation() +{ + // Proceed to parse? + bool bParse = true; + + // Is there actually something to process? + if (mBitsy.GetNumBitsLeft() == 0) + { + bParse = false; + } + + return bParse; +} + +/*=========================================================================== +METHOD: + ProcessField (Internal Method) + +DESCRIPTION: + Process the given field by parsing the value + +PARAMETERS: + pField [ I ] - The field being processed + fieldName [ I ] - Field name (partial) + arrayIndex [ I ] - Not used + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataParser::ProcessField( + const sDB2Field * pField, + const std::string & fieldName, + LONGLONG /* arrayIndex */ ) +{ + // Assume failure + bool bRC = false; + if (pField == 0) + { + return bRC; + } + + // We must have a name + sParsedField theField( mDB, + pField, + fieldName, + mBitsy, + mbFieldStrings ); + + // Did that result in a valid field? + if (theField.IsValid() == true) + { + // Add field + mFields.push_back( theField ); + bRC = true; + + // Are we tracking the value of this field? + std::map >::iterator pTF; + pTF = mTrackedFields.find( pField->mID ); + if (pTF != mTrackedFields.end()) + { + std::pair & entry = pTF->second; + + // What type is this field? + switch (pField->mType) + { + case eDB2_FIELD_STD: + { + // Standard field, what kind? + eDB2StdFieldType ft = (eDB2StdFieldType)pField->mTypeVal; + switch (ft) + { + // Field is a boolean (0/1, false/true)/8-bit unsigned + case eDB2_FIELD_STDTYPE_BOOL: + case eDB2_FIELD_STDTYPE_UINT8: + { + // Treat as UCHAR + entry.second = (LONGLONG)theField.mValue.mU8; + entry.first = true; + } + break; + + // Field is 8-bit signed integer + case eDB2_FIELD_STDTYPE_INT8: + { + // Treat as CHAR + entry.second = (LONGLONG)theField.mValue.mS8; + entry.first = true; + } + break; + + // Field is 16-bit signed integer + case eDB2_FIELD_STDTYPE_INT16: + { + // Treat as SHORT + entry.second = (LONGLONG)theField.mValue.mS16; + entry.first = true; + } + break; + + // Field is 16-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT16: + { + // Treat as USHORT + entry.second = (LONGLONG)theField.mValue.mU16; + entry.first = true; + } + break; + + // Field is 32-bit signed integer + case eDB2_FIELD_STDTYPE_INT32: + { + // Treat as LONG + entry.second = (LONGLONG)theField.mValue.mS32; + entry.first = true; + } + break; + + // Field is 32-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT32: + { + // Treat as ULONG + entry.second = (LONGLONG)theField.mValue.mU32; + entry.first = true; + } + break; + + // Field is 64-bit signed integer + case eDB2_FIELD_STDTYPE_INT64: + { + // Treat as LONGLONG + entry.second = (LONGLONG)theField.mValue.mS64; + entry.first = true; + } + break; + + // Field is 64-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT64: + { + // Treat as ULONGLONG + if (theField.mValue.mU64 <= LLONG_MAX) + { + entry.second = (LONGLONG)theField.mValue.mU64; + entry.first = true; + } + } + break; + } + } + break; + + case eDB2_FIELD_ENUM_UNSIGNED: + { + // Treat as ULONG + entry.second = (LONGLONG)theField.mValue.mU32; + entry.first = true; + } + break; + + case eDB2_FIELD_ENUM_SIGNED: + { + // Treat as LONG + entry.second = (LONGLONG)theField.mValue.mS32; + entry.first = true; + } + break; + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + HandleSpecialCases (Internal Method) + +DESCRIPTION: + Handle special case processing for summary text generation + + NOTE: This should only be added to as a last resort + +PARAMETERS: + args [I/O] - Current argument list/updated 'special' argument list + fs [I/O] - Current format specifier/updated 'special' format + specifier + +RETURN VALUE: + None +===========================================================================*/ +void cDataParser::HandleSpecialCases( + std::string & args, + std::string & fs ) +{ + std::vector key = mEntity.GetKey(); + if (key.size() == 2 && key[0] == (ULONG)eDB2_ET_DIAG_EVENT) + { + ULONG id = key[1]; + + mBitsy.SetOffset( 0 ); + ULONG lenInBits = mBitsy.GetNumBitsLeft(); + + switch (id) + { + case 276: + if (lenInBits == 16) + { + // Old style idle handoff event, remap summary + args = "idle_handoff"; + fs = "idle_handoff=%u"; + } + break; + + case 277: + if (lenInBits == 16) + { + // Old style access handoff event, remap summary + args = "ms_access_handoff"; + fs = "ms_access_handoff=%u"; + } + break; + + case 278: + if (lenInBits == 16) + { + // Old style access probe handoff event, remap summary + args = "ms_access_probe_handoff"; + fs = "ms_access_probe_handoff=%u"; + } + break; + + case 639: + if (lenInBits == 16) + { + // Old style access entry handoff event, remap summary + args = "ms_access_handoff"; + fs = "ms_access_handoff=%u"; + } + break; + } + } +} + diff --git a/gobi-api/GobiAPI_1.0.40/Core/DataParser.h b/gobi-api/GobiAPI_1.0.40/Core/DataParser.h new file mode 100755 index 0000000..5435046 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/DataParser.h @@ -0,0 +1,399 @@ +/*=========================================================================== +FILE: + DataParser.h + +DESCRIPTION: + Declaration of sParsedField and cDataParser + +PUBLIC CLASSES AND METHODS: + sParsedField + Structure to represent a single parsed field (field ID, offset, + size, value, name, etc.) + + cDataParser + Class to parse a buffer into bit/byte specified fields accordinging + to a database description, uses cProtocolEntityNav to navigate the DB + definition + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "CoreDatabase.h" +#include "BitParser.h" +#include "ProtocolEntityNav.h" +#include "ProtocolBuffer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +class cColorItem; + +/*=========================================================================*/ +// Union uFields +// +// Union to represent the data of a parsed field +/*=========================================================================*/ +union uFields +{ + CHAR mS8; + UCHAR mU8; + SHORT mS16; + USHORT mU16; + LONG mS32; + ULONG mU32; + FLOAT mFP32; + LONGLONG mS64; + ULONGLONG mU64; + double mFP64; + LPCSTR mpAStr; +}; + +/*=========================================================================*/ +// Struct sParsedField +// +// Structure to represent a parsed field +/*=========================================================================*/ +struct sParsedField +{ + // Give data parser full access + friend class cDataParser; + + public: + // (Inline) Constructor - default + sParsedField() + : mField(), + mOffset( 0 ), + mValueString( "" ), + mName( "" ), + mbValid( false ) + { + memset( (PVOID)&mValue, 0, sizeof( mValue ) ); + }; + + // Constructor - parameterized + sParsedField( + const cCoreDatabase & db, + const sDB2Field * pField, + const std::string & name, + cBitParser & bp, + bool bGenStrings = true ); + + // (Inline) Get the raw value string (i.e. unmapped enums) + std::string GetRawValueString() const + { + std::string retStr = ""; + std::ostringstream tmp; + + if (IsValid() == true) + { + if (mField.mType == eDB2_FIELD_ENUM_UNSIGNED) + { + if (mField.mbHex == false) + { + tmp << mValue.mU32; + retStr = tmp.str(); + } + else + { + tmp << std::ios_base::hex << std::ios_base::uppercase + << std::ios_base::showbase << mValue.mU32; + retStr = tmp.str(); + } + } + else if (mField.mType == eDB2_FIELD_ENUM_SIGNED) + { + if (mField.mbHex == false) + { + tmp << mValue.mS32; + retStr = tmp.str(); + } + else + { + tmp << std::ios_base::hex << std::ios_base::uppercase + << std::ios_base::showbase << mValue.mU32; + retStr = tmp.str(); + } + } + else + { + retStr = mValueString; + } + } + + return retStr; + }; + + // (Inline) Get field size in bits + ULONG GetSize() const + { + ULONG sz = 0; + if (mField.IsValid() == true) + { + sz = mField.mSize; + } + + return sz; + }; + + // (Inline) Is this field a string type? + bool IsString() const + { + bool bStr = false; + if (IsValid() == false) + { + return bStr; + } + + if (mField.mType == eDB2_FIELD_STD) + { + switch ((eDB2StdFieldType)mField.mTypeVal) + { + case eDB2_FIELD_STDTYPE_STRING_A: + case eDB2_FIELD_STDTYPE_STRING_U: + case eDB2_FIELD_STDTYPE_STRING_U8: + case eDB2_FIELD_STDTYPE_STRING_ANT: + case eDB2_FIELD_STDTYPE_STRING_UNT: + case eDB2_FIELD_STDTYPE_STRING_U8NT: + bStr = true; + break; + } + } + + return bStr; + }; + + // (Inline) Is this object valid? + bool IsValid() const + { + return mbValid; + }; + + /* Field definition */ + sDB2Field mField; + + /* Bit offset (from start of payload) */ + ULONG mOffset; + + /* Field value */ + uFields mValue; + + /* Field value as a string */ + std::string mValueString; + + /* Partially qualified name of field */ + std::string mName; + + protected: + // Parse a string + bool ParseString( + ULONG numChars, + cBitParser & bp ); + + /* Is this object valid? */ + bool mbValid; +}; + +/*=========================================================================*/ +// Class cParsedFieldNavigator +// +// Class to navigate/search parsed fields produced by the above +/*=========================================================================*/ +class cParsedFieldNavigator +{ + public: + // (Inline) Constructor + cParsedFieldNavigator( const std::vector & pf ) + : mFields( pf ), + mLastIDIndex( ULONG_MAX ) + { }; + + // Get index of the (first) field that matches the field ID, + // the search starts from the last success index returned by + // a previous call to this method + ULONG GetFieldIndex( + ULONG fieldID, + bool bLoop = false ) const; + + // (Inline) Get index of the (first) field that matches the + // given ID, the search starts from the provided index + ULONG GetFieldIndexFrom( + ULONG fieldID, + ULONG startIndex, + bool bLoop = false ) const + { + mLastIDIndex = startIndex; + return GetFieldIndex( fieldID, bLoop ); + }; + + protected: + /* The list of parsed fields */ + const std::vector & mFields; + + /* Index of last field we matched */ + mutable ULONG mLastIDIndex; +}; + +/*=========================================================================*/ +// Class cDataParser +// Class to parse a buffer into bit/byte specified fields +/*=========================================================================*/ +class cDataParser : public cProtocolEntityNav +{ + public: + // Constructor (protocol buffer) + cDataParser( + const cCoreDatabase & db, + const sProtocolBuffer & buffer ); + + // Constructor (protocol buffer, entity key, and payload) + cDataParser( + const cCoreDatabase & db, + const sProtocolBuffer & buffer, + const std::vector & key, + const BYTE * pData, + ULONG dataLen ); + + // Destructor + virtual ~cDataParser(); + + // Parse the data to a list of fields/summary text + virtual bool Parse( + bool bFieldStrings = true, + bool bFieldNames = true ); + + // (Inline) Get the protocol entity name + std::string GetEntityName() const + { + std::string retName = "?"; + if (mEntity.mpName != 0 && mEntity.mpName[0] != 0) + { + retName = mEntity.mpName; + } + + return retName; + }; + + // (Inline) Get the parsed fields + typedef std::vector tParsedFields; + const tParsedFields & GetFields() const + { + return mFields; + }; + + protected: + // Working from the back of the current field list find + // and return the value for the specified field ID as a + // LONGLONG (field type must be able to fit) + virtual bool GetLastValue( + ULONG fieldID, + LONGLONG & val ); + + // Contiue navigation now that entity has been set? + virtual bool ContinueNavigation(); + + // Process the given field + virtual bool ProcessField( + const sDB2Field * pField, + const std::string & fieldName, + LONGLONG arrayIndex = -1 ); + + // (Inline) Get current working offset + virtual ULONG GetOffset() + { + return mBitsy.GetNumBitsParsed(); + }; + + // (Inline) Set current working offset + virtual bool SetOffset( ULONG offset ) + { + mBitsy.SetOffset( offset ); + return true; + }; + + // (Inline) Get current navigation order + virtual bool GetLSBMode() + { + return mBitsy.GetLSBMode(); + }; + + // (Inline) Set current navigation order + virtual bool SetLSBMode( bool bLSB ) + { + // Assume success + bool bOK = true; + if (bLSB != GetLSBMode()) + { + if ((GetOffset() % BITS_PER_BYTE) != 0) + { + // We need to be on a byte boundary + bOK = false; + } + else + { + mBitsy.SetLSBMode( bLSB ); + } + } + + return bOK; + }; + + // Handle special case processing for summary text generation + virtual void HandleSpecialCases( + std::string & args, + std::string & fs ); + + /* Color item containing the data we are parsing */ + sProtocolBuffer mBuffer; + + /* Entity key */ + std::vector mKey; + + /* The underlying bit parser */ + cBitParser mBitsy; + + /* The list of parsed fields */ + tParsedFields mFields; + + /* Generate field value strings? */ + bool mbFieldStrings; + + /* Did we successfully parse the buffer? */ + bool mbParsed; + + /* Parsed field vector index of last instance of each field (by ID) */ + std::map mFieldIndices; +}; + diff --git a/gobi-api/GobiAPI_1.0.40/Core/Event.cpp b/gobi-api/GobiAPI_1.0.40/Core/Event.cpp new file mode 100755 index 0000000..2b1211e --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/Event.cpp @@ -0,0 +1,437 @@ +/*=========================================================================== +FILE: + Event.cpp + +DESCRIPTION: + Implementation of cEvent class + +PUBLIC CLASSES AND METHODS: + WaitOnMultipleEvents + cEvent + Functionality to mimic Windows events using UNIX pipes (enhanced + somewhat to allow one to specify a DWORD value to pass through + when signalling the event) + + WARNING: + This class is not designed to be thread safe + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "Event.h" + +/*=========================================================================== +METHOD: + WaitOnMultipleEvents (Free Method) + +DESCRIPTION: + Wait for any of the events to be set and return the value + + Note: If multiple events are set, only the event specified by + eventIndex will be read from. Run this function again + to get the next event. + +PARAMETERS: + events [ I ] - Vector of events which may be signaled + timeoutMS [ I ] - Relative timeout length (in milliseconds) + val [ O ] - Associated value upon success + eventIndex [ O ] - Index of event which was signaled + +RETURN VALUE: + Return code + positive for number of events set + -ETIME on timeout + negative errno value on failure +===========================================================================*/ +int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ) +{ + // Check internal pipes' status + for (int index = 0; index < events.size(); index++) + { + int error = events[index]->mError; + if (error != 0) + { + TRACE( "cEvent %d has error %d\n", index, error ); + return -error; + } + } + + // Initialize the FD set + fd_set fds; + FD_ZERO( &fds ); + + // Add each item to the FD set, keeping track of the largest, + // which is used for select() + int largestFD = 0; + for (int index = 0; index < events.size(); index++) + { + int pipe = events[index]->mPipes[READING]; + FD_SET( pipe, &fds ); + + largestFD = std::max( pipe, largestFD ); + } + + struct timeval timeOut; + + // Add avoiding an overflow on (long)usec + timeOut.tv_sec = timeoutMS / 1000l; + timeOut.tv_usec = ( timeoutMS % 1000l ) * 1000l; + + // Wait for activity on the pipes for the specified amount of time + int rc = select( largestFD + 1, &fds, 0, 0, &timeOut ); + if (rc == -1) + { + TRACE( "WaitOnMultipleEvents error %d\n", errno ); + return -errno; + } + else if (rc == 0) + { + // No activity on the pipes + return -ETIME; + } + + int numSignaled = rc; + + // Only read from first pipe which was signaled + int signaled = -1; + for (int index = 0; index < events.size(); index++) + { + int pipe = events[index]->mPipes[READING]; + if (FD_ISSET( pipe, &fds ) != 0) + { + signaled = index; + break; + } + } + + if (signaled == -1) + { + // Odd, no one was signaled + return -ENODATA; + } + + DWORD tempVal = 0; + rc = events[signaled]->Read( tempVal ); + if (rc == 0) + { + // Success + val = tempVal; + eventIndex = signaled; + return numSignaled; + } + else + { + // failure + return rc; + } +} + +/*=========================================================================*/ +// cEvent Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cEvent (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cEvent::cEvent() + : mError( 0 ) +{ + int rc = pipe( mPipes ); + if (rc != 0) + { + mError = errno; + TRACE( "cEvent - Error %d creating pipe, %s\n", + mError, + strerror( mError ) ); + } +} + +/*=========================================================================== +METHOD: + ~cEvent (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cEvent::~cEvent() +{ + // Check internal pipe status + if (mError == 0) + { + Close(); + mError = EBADF; + } +} + +/*=========================================================================== +METHOD: + Close (Internal Method) + +DESCRIPTION: + Close pipe + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Close() +{ + int retCode = 0; + + int rc = close( mPipes[READING] ); + mPipes[READING] = -1; + + if (rc != 0) + { + retCode = errno; + TRACE( "cEvent - Error %d deleting pipe[READING], %s\n", + retCode, + strerror( retCode ) ); + } + + rc = close( mPipes[WRITING] ); + mPipes[WRITING] = -1; + + if (rc != 0) + { + retCode = errno; + TRACE( "cEvent - Error %d deleting pipe[WRITING], %s\n", + retCode, + strerror( retCode ) ); + } + + return retCode; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Set/signal the event with the specified value + +PARAMETERS: + val [ I ] - Value to pass through with signal + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Set( DWORD val ) +{ + // Check internal pipe status + if (mError != 0) + { + return mError; + } + + PBYTE pWrite = (PBYTE)&val; + + int writeSize = sizeof( DWORD ); + while (writeSize > 0) + { + int bytesWritten = write( mPipes[WRITING], pWrite, writeSize ); + if (bytesWritten == -1) + { + // Store error from write + int writeErr = errno; + + // First error? + if (mError == 0) + { + // Yes, save the error + mError = writeErr; + } + + // We cannot recover from this error + Close(); + return writeErr; + } + + pWrite += bytesWritten; + writeSize -= bytesWritten; + } + + // Success + return 0; +} + +/*=========================================================================== +METHOD: + Wait (Free Method) + +DESCRIPTION: + Wait for the event to be signalled and return the read in value + +PARAMETERS: + timeoutMS [ I ] - Relative timeout length (in milliseconds) + val [ O ] - Associated value upon success + +RETURN VALUE: + Return code + 0 on success + ETIME on timeout + errno value on failure +===========================================================================*/ +int cEvent::Wait( + DWORD timeoutMS, + DWORD & val ) +{ + // Check internal pipe status + if (mError != 0) + { + return mError; + } + + fd_set fds; + FD_ZERO( &fds ); + FD_SET( mPipes[READING], &fds ); + + struct timeval timeOut; + + // Add avoiding an overflow on (long)usec + timeOut.tv_sec = timeoutMS / 1000l; + timeOut.tv_usec = ( timeoutMS % 1000l ) * 1000l; + + // Wait for activity on the pipe for the specified amount of time + int rc = select( mPipes[READING] + 1, &fds, 0, 0, &timeOut ); + if (rc == -1) + { + // Store error from select + int selectErr = errno; + + // First error? + if (mError == 0) + { + // Yes, save the error + mError = selectErr; + } + + // We cannot recover from this error + Close(); + return selectErr; + } + else if (rc == 0) + { + // No activity on the pipe + return ETIME; + } + + return Read( val ); +} + +/*=========================================================================== +METHOD: + Clear (Free Method) + +DESCRIPTION: + Read and discard all values currently in the pipe +===========================================================================*/ +void cEvent::Clear() +{ + DWORD unusedVal; + int rc = 0; + while (rc == 0) + { + rc = Wait( (DWORD)0, unusedVal ); + } +} + + +/*=========================================================================== +METHOD: + Read (Internal Method) + +DESCRIPTION: + Read a DWORD from the pipe + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Read( DWORD & val ) +{ + DWORD tempVal; + PBYTE pRead = (PBYTE)&tempVal; + + int readSize = sizeof( DWORD ); + while (readSize > 0) + { + int bytesRead = read( mPipes[READING], pRead, readSize ); + if (bytesRead <= 0) + { + // Store error from read + int readErr = errno; + if (readErr == 0) + { + // Hard error! This should NEVER happen for a pipe + ASSERT( 0 ); + readErr = EBADF; + } + + // First error? + if (mError == 0) + { + // Yes, store the error + mError = readErr; + } + + // We cannot recover from this error + Close(); + return readErr; + } + + pRead += bytesRead; + readSize -= bytesRead; + } + + val = tempVal; + + return 0; +} \ No newline at end of file diff --git a/gobi-api/GobiAPI_1.0.40/Core/Event.h b/gobi-api/GobiAPI_1.0.40/Core/Event.h new file mode 100755 index 0000000..43db20d --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/Event.h @@ -0,0 +1,117 @@ +/*=========================================================================== +FILE: + Event.h + +DESCRIPTION: + Declaration of cEvent class + +PUBLIC CLASSES AND METHODS: + WaitOnMultipleEvents + cEvent + Functionality to mimic Windows events using UNIX pipes (enhanced + somewhat to allow one to specify a DWORD value to pass through + when signalling the event) + + WARNING: + This class is not designed to be thread safe + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include + +//--------------------------------------------------------------------------- +// Prototype +//--------------------------------------------------------------------------- + +class cEvent; + +/*=========================================================================*/ +// Free methods +/*=========================================================================*/ + +// Wait for any of the events to be set and return the value +int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ); + +/*=========================================================================*/ +// Class cEvent +/*=========================================================================*/ +class cEvent +{ + public: + // Constructor + cEvent(); + + // Destructor + ~cEvent(); + + // Set/signal the event with the specified value + int Set( DWORD val ); + + // Wait for the event to be signalled and return the read in value + int Wait( + DWORD timeoutMS, + DWORD & val ); + + // Read and discard all values currently in the pipe + void Clear(); + + protected: + // Close pipe (used in errors or normal exit) + int Close(); + + // Read from the pipe + int Read( DWORD & val ); + + /* Internal error status */ + int mError; + + /* Internal pipes */ + int mPipes[2]; + + // WaitOnMultipleEvents gets full access + friend int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ); +}; + diff --git a/gobi-api/GobiAPI_1.0.40/Core/HDLC.cpp b/gobi-api/GobiAPI_1.0.40/Core/HDLC.cpp new file mode 100755 index 0000000..10c3689 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/HDLC.cpp @@ -0,0 +1,304 @@ +/*=========================================================================== +FILE: + HDLC.cpp + +DESCRIPTION: + Encode and decode asynchronous HDLC protocol packets as described + by both the QUALCOMM download & SDIC (diagnostic) protocol documents + +PUBLIC CLASSES AND METHODS: + HDLCDecode() + HDLCEncode() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//----------------------------------------------------------------------------- +// Include Files +//----------------------------------------------------------------------------- +#include "StdAfx.h" +#include "HDLC.h" +#include "CRC.h" +#include "SharedBuffer.h" +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/* Async HDLC defines */ +const BYTE AHDLC_FLAG = 0x7e; +const BYTE AHDLC_ESCAPE = 0x7d; +const BYTE AHDLC_ESC_M = 0x20; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + HDLCDecode (Free Method) + +DESCRIPTION: + HDLC decode the given buffer returning the results in an allocated buffer + +PARAMETERS: + pBuf [ I ] - The data buffer to decode + +RETURN VALUE: + sSharedBuffer * : The decoded buffer (allocated), 0 on error +===========================================================================*/ +sSharedBuffer * HDLCDecode( sSharedBuffer * pBuf ) +{ + // The return buffer + sSharedBuffer * pRet = 0; + + // The has to be something to decode + if (pBuf == 0 || pBuf->IsValid() == false) + { + return pRet; + } + + // Grab raw data from shared buffer + const BYTE * pData = pBuf->GetBuffer(); + UINT sz = pBuf->GetSize(); + + // Is the first character a leading flag? + if (pData[0] == AHDLC_FLAG) + { + pData++; + sz--; + } + + // There must be at least four bytes (data, CRC, trailing flag) + if (sz < 4) + { + return pRet; + } + + // The last character must be the trailing flag + if (pData[sz - 1] == AHDLC_FLAG) + { + sz--; + } + else + { + return pRet; + } + + // Allocate the decode buffer + PBYTE pDecoded = new BYTE[sz]; + if (pDecoded == 0) + { + return pRet; + } + + // Handle escaped characters and copy into decode buffer + UINT encodeIndex = 0; + UINT decodeIndex = 0; + while (encodeIndex < sz) + { + BYTE b = pData[encodeIndex++]; + if (b == AHDLC_ESCAPE && encodeIndex < sz) + { + b = pData[encodeIndex++]; + b ^= AHDLC_ESC_M; + } + + pDecoded[decodeIndex++] = b; + } + + // Check CRC value + if (CheckCRC( pDecoded, decodeIndex ) == false) + { + delete [] pDecoded; + return pRet; + } + + // Adjust decode length down for CRC + decodeIndex -= 2; + + // ... and wrap up in a shared buffer + pRet = new sSharedBuffer( decodeIndex, pDecoded, pBuf->GetType() ); + return pRet; +} + +/*=========================================================================== +METHOD: + HDLCEncode (Free Method) + +DESCRIPTION: + HDLC encode the given buffer returning the results in an allocated buffer + +PARAMETERS: + pBuf [ I ] - The data buffer to decode + +RETURN VALUE: + sSharedBuffer * : The decoded buffer (allocated), 0 on error +===========================================================================*/ +sSharedBuffer * HDLCEncode( sSharedBuffer * pBuf ) +{ + // The return buffer + sSharedBuffer * pRet = 0; + + // The has to be something to decode + if (pBuf == 0 || pBuf->IsValid() == false) + { + return pRet; + } + + // Grab raw data from shared buffer + const BYTE * pData = pBuf->GetBuffer(); + UINT sz = pBuf->GetSize(); + + // Compute CRC + USHORT CRC = CalculateCRC( pData, sz * 8 ); + + // Allocate the encode buffer + PBYTE pEncoded = new BYTE[sz * 2 + 4]; + if (pEncoded == 0) + { + return pRet; + } + + // Add leading flag + UINT encodeIndex = 0; + pEncoded[encodeIndex++] = AHDLC_FLAG; + + // Add data, escaping when necessary + UINT decodeIndex = 0; + while (decodeIndex < sz) + { + BYTE value = pData[decodeIndex++]; + if (value == AHDLC_FLAG || value == AHDLC_ESCAPE) + { + value ^= AHDLC_ESC_M; + pEncoded[encodeIndex++] = AHDLC_ESCAPE; + } + + pEncoded[encodeIndex++] = value; + } + + // Byte order CRC + BYTE byteOrderedCRC[2]; + byteOrderedCRC[0] = (BYTE)(CRC & 0x00ff); + byteOrderedCRC[1] = (BYTE)(CRC >> 8); + + // Add CRC + UINT c = 0; + while (c < 2) + { + BYTE value = byteOrderedCRC[c++]; + if (value == AHDLC_FLAG || value == AHDLC_ESCAPE) + { + value ^= AHDLC_ESC_M; + pEncoded[encodeIndex++] = AHDLC_ESCAPE; + } + + pEncoded[encodeIndex++] = value; + } + + // Add trailing flag + pEncoded[encodeIndex++] = AHDLC_FLAG; + + // Wrap up in a shared buffer + pRet = new sSharedBuffer( encodeIndex, pEncoded, pBuf->GetType() ); + return pRet; +} + +/*=========================================================================== +METHOD: + HDLCUnitTest (Free Method) + +DESCRIPTION: + Simple in = out testing of HDLCEncode/HDLCDecode + +RETURN VALUE: + bool: + true - Test succeeded + false - Test failed +===========================================================================*/ +#ifdef DEBUG +#include + +bool HDLCUnitTest() +{ + // Assume failure + bool bRC = false; + + const UINT MAX_LEN = 2048; + BYTE testBuf[MAX_LEN]; + + srand( GetTickCount() ); + + UINT len = (((UINT)rand()) % MAX_LEN) + 1; + for (UINT i = 0; i < len; i++) + { + testBuf[i] = (BYTE)((UINT)rand() % 256); + } + + sSharedBuffer * pOrig = new sSharedBuffer( testBuf, len, 0 ); + if (pOrig != 0) + { + // Encode buffer + sSharedBuffer * pEnc = HDLCEncode( pOrig ); + if (pEnc != 0) + { + // Now decode buffer encoded above + sSharedBuffer * pDec = HDLCDecode( pEnc ); + if (pDec != 0) + { + if (pOrig->IsValid() == true && pDec->IsValid() == true) + { + // Compare decoded to original + const BYTE * pOrigData = pOrig->GetBuffer(); + const BYTE * pDecData = pDec->GetBuffer(); + + if (len == pDec->GetSize()) + { + int cmp = memcmp( (const void *)pOrigData, + (const void *)pDecData, + (size_t)len ); + + bRC = (cmp == 0); + } + } + + delete [] pDec; + } + + delete [] pEnc; + } + + delete [] pOrig; + } + + return bRC; +} + +#endif diff --git a/gobi-api/GobiAPI_1.0.40/Core/HDLC.h b/gobi-api/GobiAPI_1.0.40/Core/HDLC.h new file mode 100755 index 0000000..91a1a75 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/HDLC.h @@ -0,0 +1,70 @@ +/*=========================================================================== +FILE: + HDLC.h + +DESCRIPTION: + Encode and decode asynchronous HDLC protocol packets as described + by both the QUALCOMM download & SDIC (diagnostic) protocol documents + +PUBLIC CLASSES AND METHODS: + HDLCDecode() + HDLCEncode() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +extern const BYTE AHDLC_FLAG; +extern const BYTE AHDLC_ESCAPE; +extern const BYTE AHDLC_ESC_M; + +struct sSharedBuffer; + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +// HDLC encode the given buffer returning the results in an allocated buffer +sSharedBuffer * HDLCEncode( sSharedBuffer * pBuf ); + +// HDLC decode the given buffer returning the results in an allocated buffer +sSharedBuffer * HDLCDecode( sSharedBuffer * pBuf ); + +#ifdef DEBUG + +// Simple in = out testing of HDLCEncode/HDLCDecode +bool HDLCUnitTest(); + +#endif diff --git a/gobi-api/GobiAPI_1.0.40/Core/HDLCProtocolServer.cpp b/gobi-api/GobiAPI_1.0.40/Core/HDLCProtocolServer.cpp new file mode 100755 index 0000000..7c92a8b --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/HDLCProtocolServer.cpp @@ -0,0 +1,323 @@ +/*=========================================================================== +FILE: + HDLCProtocolServer.cpp + +DESCRIPTION: + Generic HDLC framed protocol packet server + +PUBLIC CLASSES AND METHODS: + cHDLCProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "HDLCProtocolServer.h" +#include "HDLC.h" +#include "CRC.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cHDLCProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cHDLCProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + rxType [ I ] - Protocol type to assign to incoming data + txType [ I ] - Protocol type to verify for outgoing data + bufferSzRx [ I ] - Size of data buffer for incoming data + logSz [ I ] - Size of log (number of buffers) + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cHDLCProtocolServer::cHDLCProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ) + : cProtocolServer( rxType, txType, bufferSzRx, logSz ), + mRxType( rxType ), + mpEncodedBuffer( 0 ), + mpRxDecodeBuffer( 0 ), + mRxDecodeOffset( 0 ), + mbInEscape( false ) +{ + // Allocate decode buffer? + if (mRxBufferSize > 0) + { + mpRxDecodeBuffer = new BYTE[mRxBufferSize * 4]; + } +} + +/*=========================================================================== +METHOD: + ~cHDLCProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cHDLCProtocolServer::~cHDLCProtocolServer() +{ + // Free encoded buffer? + if (mpEncodedBuffer != 0) + { + delete mpEncodedBuffer; + mpEncodedBuffer = 0; + } + + // Free decode buffer? + if (mpRxDecodeBuffer != 0) + { + delete [] mpRxDecodeBuffer; + mpRxDecodeBuffer = 0; + } +} + +/*=========================================================================== +METHOD: + InitializeComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port initialization + + NOTE: This sends the commands to the driver which sends the IOCTL, but + that isn't successful + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cHDLCProtocolServer::InitializeComm() +{ + // Default configuration setting + struct termios settings; + + if (mComm.GetSettings( &settings ) == false) + { + return false; + } + + cfmakeraw( &settings ); + settings.c_cflag |= CREAD|CLOCAL; + + return mComm.ConfigureSettings( &settings ); +} + +/*=========================================================================== +METHOD: + CleanupComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port cleanup + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cHDLCProtocolServer::CleanupComm() +{ + // Nothing to actually do here + return true; +} + +/*=========================================================================== +METHOD: + EncodeTxData (Internal Method) + +DESCRIPTION: + Encode data for transmission + +PARAMETERS: + pBuffer [ I ] - Data to be encoded + bEncoded [ O ] - Do we even encoded data? + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + sSharedBuffer * - Encoded data (0 upon error when encoding is indicated) +===========================================================================*/ +sSharedBuffer * cHDLCProtocolServer::EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) +{ + // We encoded data + bEncoded = true; + + // Last encoded buffer around? + if (mpEncodedBuffer != 0) + { + // Yes free it. Note that this assumes that the last transmission has + // concluded since the buffer must exist during transmission. Since we + // support one and only one outstanding request this is valid + delete mpEncodedBuffer; + mpEncodedBuffer = 0; + } + + mpEncodedBuffer = HDLCEncode( pBuffer ); + return mpEncodedBuffer; +} + +/*=========================================================================== +METHOD: + DecodeRxData (Internal Method) + +DESCRIPTION: + Decode incoming data into packets returning the last response + +PARAMETERS: + bytesReceived [ I ] - Number of bytes to decoded + rspIdx [ O ] - Log index of last valid response + bAbortTx [ O ] - Response aborts current transmission? + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool - Was a response received? +===========================================================================*/ +bool cHDLCProtocolServer::DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ) +{ + // Assume failure + bool bRC = false; + rspIdx = INVALID_LOG_INDEX; + + // Something to decode from/to? + if (bytesReceived == 0 || mpRxDecodeBuffer == 0) + { + return bRC; + } + + BYTE val; + ULONG idx = 0; + ULONG maxSz = mRxBufferSize * 4; + + while (idx < bytesReceived) + { + val = mpRxBuffer[idx++]; + + // Check for target spewing nonsense + if (mRxDecodeOffset >= maxSz) + { + // Reset to beginning + mRxDecodeOffset = 0; + } + + // Was the previous byte an escape byte? + if (mbInEscape == true) + { + // Yes, handle it + mbInEscape = false; + + val ^= AHDLC_ESC_M; + mpRxDecodeBuffer[mRxDecodeOffset++] = val; + } + else if (val == AHDLC_ESCAPE) + { + // No, but this one is + mbInEscape = true; + } + else if (val == AHDLC_FLAG) + { + // Is this a valid frame? + if ( (mRxDecodeOffset > 0) + && (CheckCRC( mpRxDecodeBuffer, mRxDecodeOffset ) == true) ) + { + // Yes, extract it (minus CRC) to a shared buffer + sSharedBuffer * pTmp = 0; + pTmp = new sSharedBuffer( mpRxDecodeBuffer, + mRxDecodeOffset - 2, + (ULONG)mRxType ); + + if (pTmp != 0) + { + sProtocolBuffer tmpPB( pTmp ); + ULONG tmpIdx = mLog.AddBuffer( tmpPB ); + + // Abort? + bool bTmpAbortTx = IsTxAbortResponse( tmpPB ); + if (bTmpAbortTx == true) + { + bAbortTx = true; + } + else + { + // Is this the response we are looking for? + bool bRsp = IsResponse( tmpPB ); + if (bRsp == true) + { + rspIdx = tmpIdx; + bRC = true; + } + } + } + } + + // Reset for next frame + mRxDecodeOffset = 0; + } + else + { + // No, just a regular value + mpRxDecodeBuffer[mRxDecodeOffset++] = val; + } + } + + return bRC; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/HDLCProtocolServer.h b/gobi-api/GobiAPI_1.0.40/Core/HDLCProtocolServer.h new file mode 100755 index 0000000..58b3d8f --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/HDLCProtocolServer.h @@ -0,0 +1,107 @@ +/*=========================================================================== +FILE: + HDLCProtocolServer.h + +DESCRIPTION: + Generic HDLC framed protocol packet server + +PUBLIC CLASSES AND METHODS: + cHDLCProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cHDLCProtocolServer +/*=========================================================================*/ +class cHDLCProtocolServer : public cProtocolServer +{ + public: + // Constructor + cHDLCProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cHDLCProtocolServer(); + + protected: + // Perform protocol specific communications port initialization + virtual bool InitializeComm(); + + // Perform protocol specific communications port cleanup + virtual bool CleanupComm(); + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ); + + // Decode incoming data into packets returning the last response + virtual bool DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ); + + // Is the passed in data a response to the current request? + virtual bool IsResponse( const sProtocolBuffer & /* rsp */ ) = 0; + + // Is the passed in data a response that aborts the current request? + virtual bool IsTxAbortResponse( const sProtocolBuffer & rsp ) = 0; + + /* Protocol type for incoming data*/ + eProtocolType mRxType; + + /* Encoded data being transmitted */ + sSharedBuffer * mpEncodedBuffer; + + /* Decode buffer for incoming data */ + BYTE * mpRxDecodeBuffer; + + /* Current index into above buffer */ + ULONG mRxDecodeOffset; + + /* Are we currently escaping a character? */ + bool mbInEscape; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/Makefile.am b/gobi-api/GobiAPI_1.0.40/Core/Makefile.am new file mode 100644 index 0000000..d036d62 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/Makefile.am @@ -0,0 +1,58 @@ +noinst_LTLIBRARIES = libCore.la + +libCore_la_CXXFLAGS = -Wunused-variable + +libCore_la_SOURCES = \ + BitPacker.cpp \ + BitPacker.h \ + BitParser.cpp \ + BitParser.h \ + Comm.cpp \ + Comm.h \ + CoreDatabase.cpp \ + CoreDatabase.h \ + CoreUtilities.cpp \ + CoreUtilities.h \ + CRC.cpp \ + CRC.h \ + DataPacker.cpp \ + DataPacker.h \ + DataParser.cpp \ + DataParser.h \ + DB2NavTree.cpp \ + DB2NavTree.h \ + DB2TextFile.cpp \ + DB2TextFile.h \ + DB2Utilities.cpp \ + DB2Utilities.h \ + Event.cpp \ + Event.h \ + HDLC.cpp \ + HDLC.h \ + HDLCProtocolServer.cpp \ + HDLCProtocolServer.h \ + MemoryMappedFile.cpp \ + MemoryMappedFile.h \ + ProtocolBuffer.cpp \ + ProtocolBuffer.h \ + ProtocolEntityNav.cpp \ + ProtocolEntityNav.h \ + ProtocolLog.cpp \ + ProtocolLog.h \ + ProtocolNotification.cpp \ + ProtocolNotification.h \ + ProtocolRequest.cpp \ + ProtocolRequest.h \ + ProtocolServer.cpp \ + ProtocolServer.h \ + QDLBuffers.cpp \ + QDLBuffers.h \ + QDLProtocolServer.cpp \ + QDLProtocolServer.h \ + QMIBuffers.cpp \ + QMIBuffers.h \ + QMIProtocolServer.cpp \ + QMIProtocolServer.h \ + SharedBuffer.cpp \ + SharedBuffer.h + diff --git a/gobi-api/GobiAPI_1.0.40/Core/MemoryMappedFile.cpp b/gobi-api/GobiAPI_1.0.40/Core/MemoryMappedFile.cpp new file mode 100755 index 0000000..ec1709e --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/MemoryMappedFile.cpp @@ -0,0 +1,183 @@ +/*=========================================================================== +FILE: + MemoryMappedFile.cpp + +DESCRIPTION: + Implementation of cMemoryMappedFile class + +PUBLIC CLASSES AND METHODS: + cMemoryMappedFile + The cMemoryMappedFile class provides the ability to read in a file + via Linux memory maps + + Note: cMemoryMappedFiles are read only + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//----------------------------------------------------------------------------- +// Include Files +//----------------------------------------------------------------------------- +#include "StdAfx.h" +#include "MemoryMappedFile.h" + +#include + +//----------------------------------------------------------------------------- +// Definitions +//----------------------------------------------------------------------------- + +// Maximum size of a file this interface will try to open (64 MB) +const DWORD MAX_FILE_SZ = 1024 * 1024 * 64; + +/*=========================================================================*/ +// cMemoryMappedFile Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cMemoryMappedFile (Public Method) + +DESCRIPTION: + Construct object/load file into memory + +PARAMETERS + pFile [ I ] - File name + +RETURN VALUE: + None +===========================================================================*/ +cMemoryMappedFile::cMemoryMappedFile( LPCSTR pFile ) + : mbResourceBased( false ), + mpBuffer( 0 ), + mFileSize( 0 ), + mStatus( ERROR_FILE_NOT_FOUND ) +{ + if (pFile == 0 || pFile[0] == 0) + { + return; + } + + // Open the file + mFile = open( pFile, O_RDONLY ); + if (mFile == -1) + { + TRACE( "Unable to Map %s to memory. Error %d: %s\n", + pFile, + errno, + strerror( errno ) ); + return; + } + + // Grab the file size + struct stat fileInfo; + if (fstat( mFile, &fileInfo ) != 0) + { + TRACE( "Unable to get info for %s. Error %d: %s\n", + pFile, + errno, + strerror( errno ) ); + return; + } + DWORD fileSize = fileInfo.st_size; + + // Map to mpBuffer + mpBuffer = mmap( 0, + fileSize, + PROT_READ, + MAP_SHARED | MAP_POPULATE, + mFile, + 0 ); + if (mpBuffer == 0 || mpBuffer == MAP_FAILED ) + { + TRACE( "Memory map failed error %d:, %s\n", + errno, + strerror( errno ) ); + return; + } + + // Success! + mFileSize = fileSize; + mStatus = NO_ERROR; +} + +/*=========================================================================== +METHOD: + cMemoryMappedFile (Public Method) + +DESCRIPTION: + Construct object/load resource based file into memory + +PARAMETERS + pStart [ I ] - Start location of object + nSize [ I ] - Size of object + +RETURN VALUE: + None +===========================================================================*/ +cMemoryMappedFile::cMemoryMappedFile( + const char * pStart, + const int nSize ) + : mbResourceBased( true ), + mpBuffer( 0 ), + mFileSize( 0 ), + mStatus( INVALID_HANDLE_VALUE ) +{ + // Set size + mFileSize = nSize; + + // Set memory pointer + mpBuffer = (void * )pStart; + + // Success! + mStatus = NO_ERROR; +} + +/*=========================================================================== +METHOD: + ~cMemoryMappedFile (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cMemoryMappedFile::~cMemoryMappedFile() +{ + if (mbResourceBased == false) + { + if (munmap( mpBuffer, mFileSize ) == -1) + { + TRACE( "Memory unmapping error %d: %s\n", + errno, + strerror( errno ) ); + return; + } + } +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/MemoryMappedFile.h b/gobi-api/GobiAPI_1.0.40/Core/MemoryMappedFile.h new file mode 100755 index 0000000..180aa88 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/MemoryMappedFile.h @@ -0,0 +1,120 @@ +/*=========================================================================== +FILE: + MemoryMappedFile.h + +DESCRIPTION: + Declaration of cMemoryMappedFile class + +PUBLIC CLASSES AND METHODS: + cMemoryMappedFile + The cMemoryMappedFile class provides the ability to read in a file + via Linux memory maps + + Note: cMemoryMappedFiles are read only + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// Class cMemoryMappedFile +/*=========================================================================*/ +class cMemoryMappedFile +{ + public: + // Constructor (loads file) + cMemoryMappedFile( LPCSTR pFile ); + + // Constructor (loads file from resource) + cMemoryMappedFile( + const char * pStart, + const int nSize ); + + // Destructor + virtual ~cMemoryMappedFile(); + + // (Inline) Get error status + DWORD GetStatus() + { + DWORD stat = mStatus; + if (mStatus == NO_ERROR) + { + if (mpBuffer == 0 || mFileSize == 0) + { + // We failed but GetLastError() return NO_ERROR + stat = ERROR_NO_MORE_ITEMS; + } + } + + return stat; + }; + + // (Inline) Return the size of the file (contents) + ULONG GetSize() + { + ULONG sz = 0; + if (GetStatus() == NO_ERROR) + { + sz = mFileSize; + } + + return sz; + }; + + // (Inline) Return the file contents + LPVOID GetContents() + { + LPVOID pContents = 0; + if (GetStatus() == NO_ERROR) + { + pContents = mpBuffer; + } + + return pContents; + }; + + protected: + /* Resource based file? */ + bool mbResourceBased; + + /* File handle */ + int mFile; + + /* File contents*/ + LPVOID mpBuffer; + + /* File size */ + ULONG mFileSize; + + /* Error status */ + DWORD mStatus; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolBuffer.cpp b/gobi-api/GobiAPI_1.0.40/Core/ProtocolBuffer.cpp new file mode 100755 index 0000000..7171d62 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolBuffer.cpp @@ -0,0 +1,222 @@ +/*=========================================================================== +FILE: + ProtocolBuffer.cpp + +DESCRIPTION: + Generic protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sProtocolBuffer + Simple struct to represent a protocol buffer using a reference counted + (shared) buffer, this allows us to use in in several places without + copying it once in each place. A few base services are provided + but the main purpose is to provide a class to inherit off of for + specific protocols + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolBuffer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sProtocolBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Constructor (default) + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer() + : mpData( 0 ), + mbValid( false ) +{ + // Object is currently invalid + mTimestamp = EMPTY_TIME; +} + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Constructor (parameterized) + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the DIAG data + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer( sSharedBuffer * pBuffer ) + : mpData( 0 ), + mbValid( false ) +{ + mTimestamp = EMPTY_TIME; + + time_t rawtime; + time( &rawtime ); + tm * timestamp = localtime( &rawtime ); + if (timestamp != 0) + { + mTimestamp = *timestamp; + } + + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->Release(); + mpData = 0; + } + + mpData = pBuffer; + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + } + + // NOTE: Derived classes need to call their own validation method + // in their constructors since the override might try to access + // data that is not yet in place + sProtocolBuffer::Validate(); +} + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Copy constructor + +PARAMETERS: + copyThis [ I ] - sProtocolBuffer to base the new one on + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer( const sProtocolBuffer & copyThis ) + : mpData( copyThis.mpData ), + mTimestamp( copyThis.mTimestamp ), + mbValid( copyThis.mbValid ) +{ + // Bump reference count for shared buffer + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + mbValid = false; + } +} + +/*=========================================================================== +METHOD: + operator = (Public Method) + +DESCRIPTION: + Assignment operator + +PARAMETERS: + copyThis [ I ] - sProtocolBuffer to base the new one on + +RETURN VALUE: + sProtocolBuffer & +===========================================================================*/ +sProtocolBuffer & sProtocolBuffer::operator = ( const sProtocolBuffer & copyThis ) +{ + // Do we already have data? + if (mpData != 0) + { + // Is it different than what we are duplicating? + if (mpData != copyThis.mpData) + { + // Yes, release our current buffer + mpData->Release(); + } + } + + mpData = copyThis.mpData; + mTimestamp = copyThis.mTimestamp; + mbValid = copyThis.mbValid; + + // Bump reference count for shared buffer + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + mbValid = false; + } + + return *this; +} + +/*=========================================================================== +METHOD: + ~sProtocolBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::~sProtocolBuffer() +{ + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->Release(); + mpData = 0; + } + else if (mpData != 0) + { + ASSERT( 0 ); + } + + mbValid = false; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolBuffer.h b/gobi-api/GobiAPI_1.0.40/Core/ProtocolBuffer.h new file mode 100755 index 0000000..1c34747 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolBuffer.h @@ -0,0 +1,162 @@ +/*=========================================================================== +FILE: + ProtocolBuffer.h + +DESCRIPTION: + Generic protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sProtocolBuffer + Simple struct to represent a protocol buffer using a reference counted + (shared) buffer, this allows us to use in in several places without + copying it once in each place. A few base services are provided + but the main purpose is to provide a class to inherit off of for + specific protocols + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "SharedBuffer.h" +#include "ProtocolEnum.h" + +static const tm EMPTY_TIME = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + +/*=========================================================================*/ +// Struct sProtocolBuffer +/*=========================================================================*/ +struct sProtocolBuffer +{ + public: + // Constructor (default) + sProtocolBuffer(); + + // Constructor (parameterized) + sProtocolBuffer( sSharedBuffer * pBuffer ); + + // Copy constructor + sProtocolBuffer( const sProtocolBuffer & copyThis ); + + // Assignment operator + sProtocolBuffer & operator = ( const sProtocolBuffer & copyThis ); + + // Destructor + virtual ~sProtocolBuffer(); + + // (Inline) Get buffer + const BYTE * GetBuffer() const + { + BYTE * pRet = 0; + if (IsValid() == true) + { + pRet = (BYTE *)mpData->GetBuffer(); + } + + return (const BYTE *)pRet; + }; + + // (Inline) Get buffer size + ULONG GetSize() const + { + ULONG size = 0; + if (IsValid() == true) + { + size = mpData->GetSize(); + } + + return size; + }; + + // (Inline) Return the protocol type + eProtocolType GetType() const + { + eProtocolType pt = ePROTOCOL_ENUM_BEGIN; + if (IsValid() == true) + { + pt = (eProtocolType)mpData->GetType(); + } + + return pt; + }; + + // (Inline) Return the shared buffer + sSharedBuffer * GetSharedBuffer() const + { + sSharedBuffer * pRet = 0; + if (IsValid() == true) + { + pRet = mpData; + } + + return pRet; + }; + + // (Inline) Return the timestamp + tm GetTimestamp() const + { + tm ft = EMPTY_TIME; + + if (IsValid() == true) + { + ft = mTimestamp; + } + + return ft; + }; + + // (Inline) Is this buffer valid? + virtual bool IsValid() const + { + return mbValid; + }; + + protected: + // (Inline) Validate buffer + virtual bool Validate() + { + // Do we have a shared buffer and is it valid? + mbValid = (mpData != 0 && mpData->IsValid()); + return mbValid; + }; + + /* Our data buffer */ + sSharedBuffer * mpData; + + /* Time buffer was created */ + tm mTimestamp; + + /* Has this buffer been validated? (NOTE: *NOT* set in base) */ + bool mbValid; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityFieldEnumerator.h b/gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityFieldEnumerator.h new file mode 100755 index 0000000..1a2743f --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityFieldEnumerator.h @@ -0,0 +1,139 @@ +/*=========================================================================== +FILE: + ProtocolEntityFieldEnumerator.h + +DESCRIPTION: + Declaration of cProtocolEntityFieldEnumerator + +PUBLIC CLASSES AND METHODS: + cProtocolEntityFieldEnumerator + Class to navigate a protoocl entity, generating a vector of + field IDs, i.e. every field referenced by this protocol entity + in the exact order it would regularly be found + + NOTE: This only functions for fixed structures such as NV items + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolEntityNav.h" +#include "DB2NavTree.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cProtocolEntityFieldEnumerator +/*=========================================================================*/ +class cProtocolEntityFieldEnumerator : public cProtocolEntityNav +{ + public: + // (Inline) Constructor + cProtocolEntityFieldEnumerator( + const cCoreDatabase & db, + const std::vector & key ) + : cProtocolEntityNav( db ), + mKey( key ) + { + // Nothing to do + }; + + // (Inline) Destructor + virtual ~cProtocolEntityFieldEnumerator() + { + // Nothing to do + }; + + // (Inline) Enumerate the fields + virtual bool Enumerate() + { + bool bRC = ProcessEntity( mKey ); + return bRC; + }; + + // (Inline) Return fields + const std::vector & GetFields() const + { + return mFields; + }; + + protected: + // (Inline) Evaluate the given condition + virtual bool EvaluateCondition( + LPCSTR /* pCondition */, + bool & bResult ) + { + // All conditions pass + bResult = true; + return bResult; + }; + + // Return the value for the specified field ID as a + // LONGLONG (field type must be able to fit) + virtual bool GetLastValue( + ULONG /* fieldID */, + LONGLONG & val ) + { + // This should only be called for figuring out array + // boundaries (including strings) + val = 1; + return true; + }; + + // Process the given field + virtual bool ProcessField( + const sDB2Field * pField, + const std::string & /* fieldName */, + LONGLONG /* arrayIndex = -1 */ ) + { + if (pField != 0) + { + mFields.push_back( pField->mID ); + } + + return true; + }; + + + /* Protocol entity being navigated */ + std::vector mKey; + + /* Fields (by ID) */ + std::vector mFields; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityNav.cpp b/gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityNav.cpp new file mode 100755 index 0000000..de2ea14 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityNav.cpp @@ -0,0 +1,997 @@ +/*=========================================================================== +FILE: + ProtocolEntityNav.cpp + +DESCRIPTION: + Implementation of cProtocolEntityNav + +PUBLIC CLASSES AND METHODS: + cProtocolEntityNav + This calss serves as a base for all class that need to + 'navigate' a protocol entity database description. It is + necessary in order to seperate the structural aspects + from parsing/packing details + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolEntityNav.h" +#include "BitParser.h" +#include "CoreUtilities.h" +#include "DB2NavTree.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Field seperator string +LPCSTR PE_NAV_FIELD_SEP = "."; + +/*=========================================================================*/ +// cProtocolEntityNav Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolEntityNav (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + db [ I ] - Database to use + bSummaryOnly [ I ] - Only navigate if a format specifier exists? + +RETURN VALUE: + None +===========================================================================*/ +cProtocolEntityNav::cProtocolEntityNav( const cCoreDatabase & db ) + : mDB( db ), + mbFieldNames( true ), + mConditions( db.GetOptionalMods() ), + mExpressions( db.GetExpressionMods() ), + mArrays1( db.GetArray1Mods() ), + mArrays2( db.GetArray2Mods() ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cProtocolEntityNav (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cProtocolEntityNav::~cProtocolEntityNav() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + EvaluateCondition (Internal Method) + +DESCRIPTION: + Evaluate the given condition + +PARAMETERS: + pCondition [ I ] - Condition to evaluate + bResult [ O ] - Result of evaluating the condition (true/false) + +RETURN VALUE: + bool : + true - We were able to evaluate the condition + false - Unable to evaluate condition +===========================================================================*/ +bool cProtocolEntityNav::EvaluateCondition( + LPCSTR pCondition, + bool & bResult ) +{ + // Assume error + bool bRC = false; + + tDB2OptionalModMap::const_iterator pIter; + pIter = mConditions.find( pCondition ); + + if (pIter != mConditions.end()) + { + const sDB2SimpleCondition & con = pIter->second; + + // Grab the value for the given field ID + LONGLONG valA = 0; + bRC = GetLastValue( con.mID, valA ); + + // Field to field? + LONGLONG valB = con.mValue; + if (con.mbF2F == true) + { + // Yes, grab value of the second field + bRC &= GetLastValue( (ULONG)con.mValue, valB ); + } + + if (bRC == true) + { + bResult = sDB2Fragment::EvaluateCondition( valA, + con.mOperator, + valB ); + } + else + { + // We could not find the field used in the condition, this + // can either be because of a bad entity (which is ruled + // out prior to reaching this point) or the existence of + // the field itself is based on another condition. The + // former should not happen and the later is not an error + bResult = false; + bRC = true; + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetArrayBounds (Internal Method) + +DESCRIPTION: + Get the array bounds described by the fragment descriptor + +PARAMETERS: + frag [ I ] - Fragment descriptor + arraySz [ O ] - Size of array + arrayAdj [ O ] - Adjust for array indices + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolEntityNav::GetArrayBounds( + const sDB2Fragment & frag, + LONGLONG & arraySz, + LONGLONG & arrayAdj ) +{ + // Assume failure + bool bRC = false; + + // Figure out the array size/adjust + arraySz = 0; + arrayAdj = 0; + + switch (frag.mModifierType) + { + case eDB2_MOD_CONSTANT_ARRAY: + { + tDB2Array1ModMap::const_iterator pIter; + pIter = mArrays1.find( frag.mpModifierValue ); + + if (pIter != mArrays1.end()) + { + arraySz = (LONGLONG)pIter->second; + bRC = true; + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY: + { + tDB2Array1ModMap::const_iterator pIter; + pIter = mArrays1.find( frag.mpModifierValue ); + + if (pIter != mArrays1.end()) + { + ULONG id = pIter->second; + + // Now find last occurence of this field ID and grab the value + bRC = GetLastValue( id, arraySz ); + if (bRC == true) + { + // It makes no sense to have a negative sized array + if (arraySz < 0) + { + bRC = false; + } + } + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY2: + { + tDB2Array2ModMap::const_iterator pIter; + pIter = mArrays2.find( frag.mpModifierValue ); + + if (pIter != mArrays2.end()) + { + ULONG sID = pIter->second.first; + ULONG eID = pIter->second.second; + + LONGLONG s; + LONGLONG e; + + // Now find last occurence of these field IDs and + // grab the values + bRC = GetLastValue( sID, s ); + bRC &= GetLastValue( eID, e ); + if (bRC == true) + { + // It makes no sense to have an negative sized array + if (e < s) + { + bRC = false; + } + else + { + arrayAdj = s; + arraySz = (e - s) + 1; + } + } + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY3: + { + tDB2ExpressionModMap::const_iterator pIter; + pIter = mExpressions.find( frag.mpModifierValue ); + + if (pIter != mExpressions.end()) + { + const sDB2SimpleExpression & expr = pIter->second; + + // Grab the value for the given field ID + LONGLONG valA = 0; + bRC = GetLastValue( expr.mID, valA ); + + // Field to field? + LONGLONG valB = expr.mValue; + if (expr.mbF2F == true) + { + // Yes, grab value of the second field + bRC &= GetLastValue( (ULONG)expr.mValue, valB ); + } + + if (bRC == true) + { + bRC = sDB2Fragment::EvaluateExpression( valA, + expr.mOperator, + valB, + arraySz ); + + // It makes no sense to have a negative sized array + if (bRC == true && arraySz < 0) + { + bRC = false; + } + } + } + } + break; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ModifyStringLength (Internal Method) + +DESCRIPTION: + Modify string length based on existing field value, at the end + of this function the field size will be the string length in bits + +PARAMETERS: + frag [ I ] - Fragment descriptor + field [ O ] - Field to modify + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolEntityNav::ModifyStringLength( + const sDB2Fragment & frag, + sDB2Field & field ) +{ + // Assume failure + bool bRC = false; + + if (field.mType != eDB2_FIELD_STD) + { + // Why are we here? + ASSERT( 0 ); + return false; + } + + if ( (field.mTypeVal != (ULONG)eDB2_FIELD_STDTYPE_STRING_A) + && (field.mTypeVal != (ULONG)eDB2_FIELD_STDTYPE_STRING_U) + && (field.mTypeVal != (ULONG)eDB2_FIELD_STDTYPE_STRING_U8) ) + { + // Why are we here? + ASSERT( 0 ); + return false; + } + + if ( (frag.mModifierType == eDB2_MOD_VARIABLE_STRING3) + && (field.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_U8) ) + { + // We can't have the size specified in characters when the + // size of the character itself is variable length + ASSERT( 0 ); + return false; + } + + tDB2Array1ModMap::const_iterator pIter; + pIter = mArrays1.find( frag.mpModifierValue ); + if (pIter == mArrays1.end()) + { + // Unable to obtain string length + return bRC; + } + + ULONG id = pIter->second; + + // Now find last occurence of this field ID and grab the value + LONGLONG strSz; + bRC = GetLastValue( id, strSz ); + if (bRC == false || strSz < 0) + { + // Unable to obtain size or invalid size + bRC = false; + return bRC; + } + + // Compute character size + ULONG charSz = BITS_PER_BYTE; + if (field.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_U) + { + charSz *= 2; + } + + if (frag.mModifierType == eDB2_MOD_VARIABLE_STRING2) + { + strSz *= BITS_PER_BYTE; + } + else if (frag.mModifierType == eDB2_MOD_VARIABLE_STRING3) + { + strSz *= charSz; + } + + if (strSz > ULONG_MAX) + { + // String length far too large + bRC = false; + return bRC; + } + + if (strSz != 0) + { + if (strSz < charSz || (strSz % charSz) != 0) + { + // String length not a proper multiple of character size + bRC = false; + return bRC; + } + } + + field.mSize = (ULONG)strSz; + return bRC; +} + +/*=========================================================================== +METHOD: + ProcessEntity (Internal Method) + +DESCRIPTION: + Process a protocol entity + +PARAMETERS: + key [ I ] - Key into the protocol entity table + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolEntityNav::ProcessEntity( const std::vector & key ) +{ + // Assume failure + bool bRC = false; + + // Look up entity definition + const cDB2NavTree * pNavTree = mDB.GetEntityNavTree( key ); + + // Did we find it? + if (pNavTree == 0) + { + return bRC; + } + + // Is it valid? + mEntity = pNavTree->GetEntity(); + if (mEntity.IsValid() == false) + { + // No definition in database + return bRC; + } + + // Check if we should continue + if (ContinueNavigation() == false) + { + // Success! + bRC = true; + return bRC; + } + + // A structure to navigate? + if (mEntity.mStructID == -1) + { + // Success! + bRC = true; + return bRC; + } + + // Grab navigation fragments + const std::list & frags = pNavTree->GetFragments(); + + // Nothing to navigate? + if (frags.size() == 0) + { + ASSERT( 0 ); + return bRC; + } + + // No name? + if (mEntity.mpName == 0 || mEntity.mpName[0] == 0) + { + ASSERT( 0 ); + return bRC; + } + + // Grab tracked fields + mTrackedFields = pNavTree->GetTrackedFields(); + + std::string preamble = ""; + + // Process the initial structure + EnterStruct( mEntity.mpName, -1 ); + bRC = ProcessStruct( frags.front(), preamble, -1 ); + ExitStruct( mEntity.mpName, -1 ); + + return bRC; +} + +/*=========================================================================== +METHOD: + ProcessStruct (Internal Method) + +DESCRIPTION: + Process a structure described by the given initial fragment + +PARAMETERS: + pFrag [ I ] - First fragment in structure + preamable [ I ] - String to prepend to any field/struct names + arrayIndex [ I ] - Array index (-1 = not part of an array) + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolEntityNav::ProcessStruct( + const sDB2NavFragment * pFrag, + const std::string & preamble, + LONGLONG /* arrayIndex */ ) +{ + // Assume success + bool bRC = true; + + ULONG structSz = 0; + ULONG structOffset = GetOffset(); + + // Grab current navigation order + bool bOldLSB = GetLSBMode(); + bool bNewLSB = bOldLSB; + + // Check for directives + if (pFrag != 0) + { + bool bDirective = false; + + const sDB2Fragment & frag = *pFrag->mpFragment; + if (frag.mFragmentType == eDB2_FRAGMENT_MSB_2_LSB) + { + bDirective = true; + if (bOldLSB == true) + { + bNewLSB = false; + bRC = SetLSBMode( bNewLSB ); + } + } + + if (frag.mFragmentType == eDB2_FRAGMENT_LSB_2_MSB) + { + bDirective = true; + if (bOldLSB == false) + { + bNewLSB = true; + bRC = SetLSBMode( bNewLSB ); + } + } + + if (bDirective == true) + { + // We process directives here so move on to the next fragment + // upon success + if (bRC == true) + { + pFrag = pFrag->mpNextFragment; + } + else + { + pFrag = 0; + } + } + } + + // Process each fragment in the structure + while (pFrag != 0) + { + bRC = ProcessFragment( pFrag, structOffset, structSz, preamble ); + if (bRC == true) + { + pFrag = pFrag->mpNextFragment; + } + else + { + break; + } + } + + // Restore navigation order + if (bRC == true && bOldLSB != bNewLSB) + { + bRC = SetLSBMode( bOldLSB ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ProcessFragment (Internal Method) + +DESCRIPTION: + Process the given fragment + +PARAMETERS: + pFrag [ I ] - Fragment to be processed + structOffset [ I ] - Offset (from start of payload) of enclosing struct + structSize [ I ] - Current size of enclosing struct + preamble [ I ] - String to prepend to any field/struct names + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolEntityNav::ProcessFragment( + const sDB2NavFragment * pFrag, + ULONG structOffset, + ULONG & structSize, + const std::string & preamble ) +{ + // Assume failure + bool bRC = false; + if (pFrag == 0 || pFrag->mpFragment == 0) + { + return bRC; + } + + // Grab database fragment + const sDB2Fragment & frag = *pFrag->mpFragment; + + // Is this fragment optional? + if (frag.mModifierType == eDB2_MOD_OPTIONAL) + { + bool bParse = false; + bool bOK = EvaluateCondition( frag.mpModifierValue, bParse ); + if (bOK == false) + { + // Error evaluating the condition + bRC = false; + return bRC; + } + + if (bParse == false) + { + // Condition not satisfied, nothing to parse + bRC = true; + return bRC; + } + } + + // Is this an array? + LONGLONG arraySz = -1; + LONGLONG arrayAdj = 0; + bool bArray = ModifiedToArray( frag.mModifierType ); + if (bArray == true) + { + bool bOK = GetArrayBounds( frag, arraySz, arrayAdj ); + if (bOK == false) + { + // Error obtaining array dimensions + bRC = false; + return bRC; + } + else if (arraySz == 0) + { + // No array to process + bRC = true; + return bRC; + } + } + + // Set base name + std::string baseName = ""; + if (mbFieldNames == true) + { + baseName = preamble; + + // Add in fragment name? + if (frag.mpName != EMPTY_STRING) + { + if (baseName.size() > 0) + { + baseName += PE_NAV_FIELD_SEP; + } + + // Yes, add to the preamble + baseName += frag.mpName; + } + } + + // Is this fragment offset? + if (frag.mFragmentOffset != -1) + { + // Yes, add in offset to structure offset and save + ULONG newOffset = frag.mFragmentOffset + structOffset; + SetOffset( newOffset ); + } + + // What type of fragment is this? + switch (frag.mFragmentType) + { + case eDB2_FRAGMENT_FIELD: + { + const sDB2Field * pField = pFrag->mpField; + if (pField != 0) + { + if (mbFieldNames == true) + { + if (baseName.size() > 0) + { + baseName += PE_NAV_FIELD_SEP; + } + + // Add in field name + baseName += pField->mpName; + } + + // Variable string? + sDB2Field modField; + if ( (frag.mModifierType == eDB2_MOD_VARIABLE_STRING1) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING2) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING3) ) + { + modField = *pField; + bRC = ModifyStringLength( frag, modField ); + if (bRC == false) + { + // Unable to obtain string length + return bRC; + } + + if (modField.mSize == 0) + { + // String has no length - treat like an optional fragment + bRC = true; + return bRC; + } + + pField = &modField; + } + + // Handle an array? + if (bArray == true) + { + EnterArray( frag, arraySz ); + + if (mbFieldNames == true) + { + ULONG baseLen = baseName.size(); + + std::string fieldName; + fieldName.reserve( baseLen + 16 ); + fieldName = baseName; + + CHAR arraySpec[32]; + + for (LONGLONG i = 0; i < arraySz; i++) + { + snprintf( arraySpec, 31, "[%lld]", i + arrayAdj ); + fieldName += arraySpec; + + bRC = ProcessField( pField, fieldName, i ); + if (bRC == false) + { + break; + } + + // Remove the array specifier for the next pass + fieldName.resize( baseLen ); + } + } + else + { + for (LONGLONG i = 0; i < arraySz; i++) + { + bRC = ProcessField( pField, baseName, i ); + if (bRC == false) + { + break; + } + } + } + + ExitArray( frag, arraySz ); + } + else + { + bRC = ProcessField( pField, baseName ); + } + } + } + break; + + case eDB2_FRAGMENT_STRUCT: + { + if (pFrag->mpLinkFragment != 0) + { + // Handle an array? + if (bArray == true) + { + EnterArray( frag, arraySz ); + + if (mbFieldNames == true) + { + ULONG baseLen = baseName.size(); + + std::string structName; + structName.reserve( baseLen + 16 ); + structName = baseName; + + CHAR arraySpec[32]; + + for (LONGLONG i = 0; i < arraySz; i++) + { + snprintf( arraySpec, 31, "[%lld]", i + arrayAdj ); + structName += arraySpec; + + EnterStruct( frag.mpName, i ); + + bRC = ProcessStruct( pFrag->mpLinkFragment, + structName, + i ); + + ExitStruct( frag.mpName, i ); + + if (bRC == false) + { + break; + } + + // Remove the array specifier for the next pass + structName.resize( baseLen ); + } + } + else + { + + for (LONGLONG i = 0; i < arraySz; i++) + { + EnterStruct( frag.mpName, i ); + + bRC = ProcessStruct( pFrag->mpLinkFragment, + baseName, + i ); + + ExitStruct( frag.mpName, i ); + + if (bRC == false) + { + break; + } + } + } + + ExitArray( frag, arraySz ); + } + else + { + EnterStruct( frag.mpName, -1 ); + bRC = ProcessStruct( pFrag->mpLinkFragment, baseName ); + ExitStruct( frag.mpName, -1 ); + } + } + } + break; + + case eDB2_FRAGMENT_CONSTANT_PAD: + { + // Is the structure is smaller than the specified + // value that we are to pad out to? + ULONG totalSz = frag.mFragmentValue; + if (totalSz >= structSize) + { + ULONG newOffset = structOffset + totalSz; + SetOffset( newOffset ); + } + + // Succcess! + bRC = true; + } + break; + + case eDB2_FRAGMENT_VARIABLE_PAD_BITS: + case eDB2_FRAGMENT_VARIABLE_PAD_BYTES: + { + // Find last occurence of this field ID and grab the value + LONGLONG totalSz = 0; + bRC = GetLastValue( frag.mFragmentValue, totalSz ); + if (bRC == true) + { + // Convert to bits? + if (frag.mFragmentType == eDB2_FRAGMENT_VARIABLE_PAD_BYTES) + { + totalSz *= BITS_PER_BYTE; + } + + // Is the structure is smaller than the specified + // value that we are to pad out to? + if ((ULONG)totalSz >= structSize) + { + ULONG newOffset = structOffset + (ULONG)totalSz; + SetOffset( newOffset ); + } + } + } + break; + + case eDB2_FRAGMENT_FULL_BYTE_PAD: + { + ULONG totalSz = structSize; + while ((totalSz % BITS_PER_BYTE) != 0) + { + totalSz++; + } + + if (totalSz > structSize) + { + ULONG newOffset = structOffset + totalSz; + SetOffset( newOffset ); + } + + // Succcess! + bRC = true; + } + break; + + default: + bRC = false; + break; + } + + // Adjust struct size? + if (bRC == true) + { + ULONG newOffset = GetOffset(); + if (newOffset > structOffset) + { + ULONG newSz = newOffset - structOffset; + if (newSz > structSize) + { + structSize = newSz; + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetPartialFieldName (Public Method) + +DESCRIPTION: + Return the fully qualified field name given the partial name + +PARAMETERS: + partialName [ I ] - Partial field name + +RETURN VALUE: + std::string +===========================================================================*/ +std::string cProtocolEntityNav::GetFullFieldName( + const std::string & partialName ) const +{ + std::string retStr = EMPTY_STRING; + + if (mEntity.mpName != 0 && mEntity.mpName != EMPTY_STRING) + { + retStr = mEntity.mpName; + retStr += PE_NAV_FIELD_SEP; + retStr += partialName; + } + + return retStr; +} + +/*=========================================================================== +METHOD: + GetPartialFieldName (Public Method) + +DESCRIPTION: + Return the partial field name given the fully qualified name + +PARAMETERS: + fieldNameFQ [ I ] - Fully qualified name + +RETURN VALUE: + std::string +===========================================================================*/ +std::string cProtocolEntityNav::GetPartialFieldName( + const std::string & fieldNameFQ ) const +{ + std::string retStr = EMPTY_STRING; + + if (mEntity.mpName != 0 && mEntity.mpName != EMPTY_STRING) + { + int idx = fieldNameFQ.find( mEntity.mpName, 0 ); + if (idx == 0) + { + idx = fieldNameFQ.find( PE_NAV_FIELD_SEP ); + if (idx != -1) + { + retStr = fieldNameFQ.substr( idx - 1 ); + } + + } + } + + return retStr; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityNav.h b/gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityNav.h new file mode 100755 index 0000000..4ad8550 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolEntityNav.h @@ -0,0 +1,246 @@ +/*=========================================================================== +FILE: + ProtocolEntityNav.h + +DESCRIPTION: + Declaration of cProtocolEntityNav + +PUBLIC CLASSES AND METHODS: + cProtocolEntityNav + This class serves as a base for all class that need to + 'navigate' a protocol entity database description. It is + necessary in order to seperate the structural aspects + from parsing/packing details + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "CoreDatabase.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +struct sSharedBuffer; +struct sDB2NavFragment; + +// Field seperator string +extern LPCSTR PE_NAV_FIELD_SEP; + +// Types of protocol entity field attributes +enum ePENavFieldAttr +{ + ePENAV_FIELD_BEGIN = -1, + + ePENAV_FIELD_NAME, // Name of field + ePENAV_FIELD_NAME_FULL, // Fully qualified name of field + ePENAV_FIELD_NAME_PARTIAL, // Partially qualified name of field + ePENAV_FIELD_VALUE, // Translated value of field + ePENAV_FIELD_VALUE_RAW, // Raw value of field + ePENAV_FIELD_TYPE, // Type of field + ePENAV_FIELD_SIZE, // Size of field + ePENAV_FIELD_OFFSET, // Offset of field + ePENAV_FIELD_INDEX, // Index of field + ePENAV_FIELD_ID, // ID of field + + ePENAV_FIELD_END // Number of field attributes +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + Is this a valid ePENavFieldAttr? + +PARAMETERS: + contentType [ I ] - The enum value being validated + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( ePENavFieldAttr attr ) +{ + bool bRC = false; + if (attr > ePENAV_FIELD_BEGIN && attr < ePENAV_FIELD_END) + { + bRC = true; + } + + return bRC; +}; + +/*=========================================================================*/ +// Class cProtocolEntityNav +// Class to navigate a protocol entity +/*=========================================================================*/ +class cProtocolEntityNav +{ + public: + // Constructor + cProtocolEntityNav( const cCoreDatabase & db ); + + // Destructor + virtual ~cProtocolEntityNav(); + + // Return the fully qualified field name given the partial name + virtual std::string GetFullFieldName( const std::string & partialName ) const; + + // Return the partial field name given the fully qualified name + virtual std::string GetPartialFieldName( + const std::string & fieldNameFQ ) const; + + protected: + // Evaluate the given condition + virtual bool EvaluateCondition( + LPCSTR pCondition, + bool & bResult ); + + // Get the array bounds described by the fragment descriptor + virtual bool GetArrayBounds( + const sDB2Fragment & frag, + LONGLONG & arraySz, + LONGLONG & arrayAdj ); + + // Return the value for the specified field ID as a + // LONGLONG (field type must be able to fit) + virtual bool GetLastValue( + ULONG fieldID, + LONGLONG & val ) = 0; + + // Modify string length based on existing field value + virtual bool ModifyStringLength( + const sDB2Fragment & frag, + sDB2Field & field ); + + // Process the protocol entity described by the given key/name + virtual bool ProcessEntity( const std::vector & key ); + + // (Inline) Contiue navigation now that entity has been set? + virtual bool ContinueNavigation() + { + // Override to implement + return true; + }; + + // Process a structure described by the given initial fragment + virtual bool ProcessStruct( + const sDB2NavFragment * pFrag, + const std::string & preamble, + LONGLONG arrayIndex = -1 ); + + // Process the given fragment + virtual bool ProcessFragment( + const sDB2NavFragment * pFrag, + ULONG structOffset, + ULONG & structSize, + const std::string & preamble ); + + // Process the given field + virtual bool ProcessField( + const sDB2Field * pField, + const std::string & fieldName, + LONGLONG arrayIndex = -1 ) = 0; + + // (Inline) Handle an array being entered + virtual void EnterArray( + const sDB2Fragment & /* frag */, + LONGLONG /* arraySz */ ) + { }; + + // (Inline) Handle an array being exited + virtual void ExitArray( + const sDB2Fragment & /* frag */, + LONGLONG /* arraySz */ ) + { }; + + // (Inline) Handle a structure being entered + virtual void EnterStruct( + LPCSTR /* pName */, + LONGLONG /* arrayIndex */ ) + { }; + + // (Inline) Handle a structure being exited + virtual void ExitStruct( + LPCSTR /* pName */, + LONGLONG /* arrayIndex */ ) + { }; + + // (Inline) Get current working offset + virtual ULONG GetOffset() + { + // Override to implement + return 0; + }; + + // (Inline) Set current working offset + virtual bool SetOffset( ULONG /* offset */ ) + { + // Override to implement + return true; + }; + + // (Inline) Get current navigation order + virtual bool GetLSBMode() + { + // Override to implement + return true; + }; + + // (Inline) Set current navigation order + virtual bool SetLSBMode( bool /* bLSB */ ) + { + // Override to implement + return true; + }; + + /* Generate field name strings? */ + bool mbFieldNames; + + /* Protocol entity being navigated */ + sDB2ProtocolEntity mEntity; + + /* Database reference */ + const cCoreDatabase & mDB; + + /* References to DB tables we need */ + const tDB2OptionalModMap & mConditions; + const tDB2ExpressionModMap & mExpressions; + const tDB2Array1ModMap & mArrays1; + const tDB2Array2ModMap & mArrays2; + + /* Map of all 'tracked' fields */ + std::map > mTrackedFields; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolEnum.h b/gobi-api/GobiAPI_1.0.40/Core/ProtocolEnum.h new file mode 100755 index 0000000..fbb50f1 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolEnum.h @@ -0,0 +1,214 @@ +/*=========================================================================== +FILE: + ProtocolEnum.h + +DESCRIPTION: + Generic protocol enumerations and related methods + +PUBLIC ENUMERATIONS AND METHODS: + eProtocolType + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// eProtocolType Enumeration +/*=========================================================================*/ +enum eProtocolType +{ + ePROTOCOL_ENUM_BEGIN = -1, + + ePROTOCOL_COMMAND, // 00 Protocol server command + ePROTOCOL_AT, // 01 AT command protocol + ePROTOCOL_NMEA, // 02 NMEA (GPS) protocol + ePROTOCOL_DIAG_RX, // 03 DIAG protocol (incoming) + ePROTOCOL_DIAG_TX, // 04 DIAG protocol (outgoing) + ePROTOCOL_DOWNLOAD_RX, // 05 Download protocol (incoming) + ePROTOCOL_DOWNLOAD_TX, // 06 Download protocol (outgoing) + ePROTOCOL_SDOWNLOAD_RX, // 07 Streaming download protocol (incoming) + ePROTOCOL_SDOWNLOAD_TX, // 08 Streaming download protocol (outgoing) + ePROTOCOL_QDL_RX, // 09 QDL variant of streaming protocol (incoming) + ePROTOCOL_QDL_TX, // 10 QDL variant of streaming protocol (outgoing) + ePROTOCOL_QMI_CTL_RX, // 11 QMI CTL protocol (incoming) + ePROTOCOL_QMI_CTL_TX, // 12 QMI CTL protocol (outgoing) + ePROTOCOL_QMI_WDS_RX, // 13 QMI WDS protocol (incoming) + ePROTOCOL_QMI_WDS_TX, // 14 QMI WDS protocol (outgoing) + ePROTOCOL_QMI_DMS_RX, // 15 QMI DMS protocol (incoming) + ePROTOCOL_QMI_DMS_TX, // 16 QMI DMS protocol (outgoing) + ePROTOCOL_QMI_NAS_RX, // 17 QMI NAS protocol (incoming) + ePROTOCOL_QMI_NAS_TX, // 18 QMI NAS protocol (outgoing) + ePROTOCOL_QMI_QOS_RX, // 19 QMI QOS protocol (incoming) + ePROTOCOL_QMI_QOS_TX, // 20 QMI QOS protocol (outgoing) + ePROTOCOL_QMI_WMS_RX, // 21 QMI WMS protocol (incoming) + ePROTOCOL_QMI_WMS_TX, // 22 QMI WMS protocol (outgoing) + ePROTOCOL_QMI_PDS_RX, // 23 QMI PDS protocol (incoming) + ePROTOCOL_QMI_PDS_TX, // 24 QMI PDS protocol (outgoing) + ePROTOCOL_QMI_AUTH_RX, // 25 QMI AUTH protocol (incoming) + ePROTOCOL_QMI_AUTH_TX, // 26 QMI AUTH protocol (outgoing) + ePROTOCOL_QMI_CAT_RX, // 27 QMI CAT protocol (incoming) + ePROTOCOL_QMI_CAT_TX, // 28 QMI CAT protocol (outgoing) + ePROTOCOL_QMI_RMS_RX, // 29 QMI RMS protocol (incoming) + ePROTOCOL_QMI_RMS_TX, // 30 QMI RMS protocol (outgoing) + ePROTOCOL_QMI_OMA_RX, // 31 QMI OMA protocol (incoming) + ePROTOCOL_QMI_OMA_TX, // 32 QMI OMA protocol (outgoing) + ePROTOCOL_QMI_VOICE_RX, // 33 QMI Voice protocol (incoming) + ePROTOCOL_QMI_VOICE_TX, // 34 QMI Voice protocol (outgoing) + + ePROTOCOL_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eProtocolType validity check + +PARAMETERS: + pt [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eProtocolType pt ) +{ + bool retVal = false; + if (pt > ePROTOCOL_ENUM_BEGIN && pt < ePROTOCOL_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocol (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocol( eProtocolType pt ) +{ + bool retVal = false; + if (pt >= ePROTOCOL_QMI_CTL_RX && pt <= ePROTOCOL_QMI_VOICE_TX) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocolRX (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol and if so in the + incoming direction? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocolRX( eProtocolType pt ) +{ + bool retVal = false; + + switch (pt) + { + case ePROTOCOL_QMI_CTL_RX: + case ePROTOCOL_QMI_WDS_RX: + case ePROTOCOL_QMI_DMS_RX: + case ePROTOCOL_QMI_NAS_RX: + case ePROTOCOL_QMI_QOS_RX: + case ePROTOCOL_QMI_WMS_RX: + case ePROTOCOL_QMI_PDS_RX: + case ePROTOCOL_QMI_AUTH_RX: + case ePROTOCOL_QMI_CAT_RX: + case ePROTOCOL_QMI_RMS_RX: + case ePROTOCOL_QMI_OMA_RX: + case ePROTOCOL_QMI_VOICE_RX: + retVal = true; + break; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocolTX (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol and if so in the + outgoing direction? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocolTX( eProtocolType pt ) +{ + bool retVal = false; + + switch (pt) + { + case ePROTOCOL_QMI_CTL_TX: + case ePROTOCOL_QMI_WDS_TX: + case ePROTOCOL_QMI_DMS_TX: + case ePROTOCOL_QMI_NAS_TX: + case ePROTOCOL_QMI_QOS_TX: + case ePROTOCOL_QMI_WMS_TX: + case ePROTOCOL_QMI_PDS_TX: + case ePROTOCOL_QMI_AUTH_TX: + case ePROTOCOL_QMI_CAT_TX: + case ePROTOCOL_QMI_RMS_TX: + case ePROTOCOL_QMI_OMA_TX: + case ePROTOCOL_QMI_VOICE_TX: + retVal = true; + break; + } + + return retVal; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolLog.cpp b/gobi-api/GobiAPI_1.0.40/Core/ProtocolLog.cpp new file mode 100755 index 0000000..7b6ad74 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolLog.cpp @@ -0,0 +1,190 @@ +/*=========================================================================== +FILE: + ProtocolLog.h + +DESCRIPTION: + Simple protocol 'log' class definition + +PUBLIC CLASSES AND METHODS: + cProtocolLog + This class stores protocol buffers in to a flat array (actually a + double-ended queue) so that they can be accessed by other objects + during the flow of normal processing. Note that the storage is + in-memory and therefore finite + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolLog.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// The maximum number of in-memory buffers we allow +const ULONG MAX_PROTOCOL_BUFFERS = 1024 * 16; + +/*=========================================================================*/ +// cProtocolLog Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolLog (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + maxBuffers [ I ] - Maximum number of buffers to store in the log + +RETURN VALUE: + None +===========================================================================*/ +cProtocolLog::cProtocolLog( ULONG maxBuffers ) + : mLog( maxBuffers > MAX_PROTOCOL_BUFFERS ? MAX_PROTOCOL_BUFFERS : maxBuffers, + true ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cProtocolLog (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cProtocolLog::~cProtocolLog() +{ + // Empty out the log + Clear(); +} + +/*=========================================================================== +METHOD: + AddBuffer (Public Method) + +DESCRIPTION: + Add an protocol buffer to the end of the log + +PARAMETERS: + buff [ I ] - Protocol buffer to add + +RETURN VALUE: + ULONG - Index of newly added buffer (INVALID_LOG_INDEX upon failure) +===========================================================================*/ +ULONG cProtocolLog::AddBuffer( sProtocolBuffer & buf ) +{ + ULONG idx = INVALID_LOG_INDEX; + if (buf.IsValid() == false) + { + return idx; + } + + bool bRC = mLog.AddElement( buf, idx ); + if (bRC == false) + { + idx = INVALID_LOG_INDEX; + } + + return idx; +} + +/*=========================================================================== +METHOD: + GetBuffer (Public Method) + +DESCRIPTION: + Return the protocol buffer at the given index from the log + +PARAMETERS: + idx [ I ] - Index of protocol buffer to obtain + +RETURN VALUE: + sProtocolBuffer - Protocol buffer +===========================================================================*/ +sProtocolBuffer cProtocolLog::GetBuffer( ULONG idx ) const +{ + sProtocolBuffer buf; + mLog.GetElement( idx, buf ); + return buf; +} + +/*=========================================================================== +METHOD: + GetSignalEvent (Public Method) + +DESCRIPTION: + Return the underlying signal event, which will be set when + the log is updated. + +RETURN VALUE: + cEvent - Signal event +===========================================================================*/ +cEvent & cProtocolLog::GetSignalEvent() const +{ + return mLog.GetSignalEvent(); +} + +/*=========================================================================== +METHOD: + GetCount (Public Method) + +DESCRIPTION: + Return the total number of buffers added to the log + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cProtocolLog::GetCount() const +{ + return mLog.GetTotalCount(); +} + +/*=========================================================================== +METHOD: + Clear (Public Method) + +DESCRIPTION: + Clear the log + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolLog::Clear() +{ + mLog.EmptyQueue(); +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolLog.h b/gobi-api/GobiAPI_1.0.40/Core/ProtocolLog.h new file mode 100755 index 0000000..c0d6163 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolLog.h @@ -0,0 +1,91 @@ +/*=========================================================================== +FILE: + ProtocolLog.h + +DESCRIPTION: + Simple protocol 'log' class declaration + +PUBLIC CLASSES AND METHODS: + cProtocolLog + This class stores protocol buffers in to a flat array (actually a + double-ended queue) so that they can be accessed by other objects + during the flow of normal processing. Note that the storage is + in-memory and therefore finite + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "SyncQueue.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +const ULONG INVALID_LOG_INDEX = ULONG_MAX; + +/*=========================================================================*/ +// Class cProtocolLog +/*=========================================================================*/ +class cProtocolLog +{ + public: + // Constructor + cProtocolLog( ULONG maxBuffers ); + + // Destructor + virtual ~cProtocolLog(); + + // Add an protocol buffer to the end of the log + virtual ULONG AddBuffer( sProtocolBuffer & buf ); + + // Return the protocol buffer at the given index from the log + virtual sProtocolBuffer GetBuffer( ULONG idx ) const; + + // Return the underlying signal event + virtual cEvent & GetSignalEvent() const; + + // Return the total number of buffers added to the log + virtual ULONG GetCount() const; + + // Clear the log + virtual void Clear(); + + protected: + /* The underlying 'log' */ + cSyncQueue mLog; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolNotification.cpp b/gobi-api/GobiAPI_1.0.40/Core/ProtocolNotification.cpp new file mode 100755 index 0000000..92bcc68 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolNotification.cpp @@ -0,0 +1,171 @@ +/*=========================================================================== +FILE: + ProtocolNotification.cpp + +DESCRIPTION: + Implementation of cProtocolNotification base class and derivations + +PUBLIC CLASSES AND METHODS: + sProtocolNotificationEvent + Generic protocol event notification structure + + cProtocolNotification + This abstract base class provides notification of protocol server + events sent from the protocol server to protocol server clients + + cProtocolQueueNotification + This class provides notification via a cSyncQueue object + populated with sProtocolNotificationEvent objects + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolNotification.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cProtocolQueueNotification Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pSQ [ I ] - Sync queue to utilize + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::cProtocolQueueNotification( + cSyncQueue * pSQ ) + : mpSQ( pSQ ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Copy constructor + +PARAMETERS: + notifier [ I ] - Notifier to base the new one on + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::cProtocolQueueNotification( + const cProtocolQueueNotification & notifier ) + : mpSQ( notifier.mpSQ ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::~cProtocolQueueNotification() +{ + mpSQ = 0; +} + +/*=========================================================================== +METHOD: + Clone (Public Method) + +DESCRIPTION: + Return an allocated copy of this object downcasted to our base class + +RETURN VALUE: + cProtocolNotification * : Cloned object (0 on error) +===========================================================================*/ +cProtocolNotification * cProtocolQueueNotification::Clone() const +{ + cProtocolQueueNotification * pCopy = 0; + + try + { + pCopy = new cProtocolQueueNotification( *this ); + } + catch (...) + { + // Simply return 0 + } + + return ((cProtocolNotification *)pCopy); +} + +/*=========================================================================== +METHOD: + Notify (Public Method) + +DESCRIPTION: + Notify view of a protocol event by adding notification structure to + the underlying sync queue (which will provide the notification + by signalling an event) + +PARAMETERS: + eventType [ I ] - Protocol event type + param1 [ I ] - Event type specific argument (see header description) + param2 [ I ] - Event type specific argument (see header description) + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolQueueNotification::Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const +{ + sProtocolNotificationEvent evt( eventType, param1, param2 ); + if (evt.IsValid() == true && mpSQ != 0 && mpSQ->IsValid() == true) + { + sProtocolNotificationEvent elem( eventType, param1, param2 ); + mpSQ->AddElement( elem ); + } +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolNotification.h b/gobi-api/GobiAPI_1.0.40/Core/ProtocolNotification.h new file mode 100755 index 0000000..f44d13e --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolNotification.h @@ -0,0 +1,237 @@ +/*=========================================================================== +FILE: + ProtocolNotification.h + +DESCRIPTION: + Declaration of cProtocolNotification base class and derivations + +PUBLIC CLASSES AND METHODS: + sProtocolNotificationEvent + Generic protocol event notification structure + + cProtocolNotification + This abstract base class provides notification of protocol server + events sent from the protocol server to protocol server clients + + cProtocolQueueNotification + This class provides notification via a cSyncQueue object + populated with sProtocolNotificationEvent objects + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "SyncQueue.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +enum eProtocolEventType +{ + ePROTOCOL_EVT_BEGIN = -1, + + ePROTOCOL_EVT_REQ_ERR, // There was an error sending the request + ePROTOCOL_EVT_REQ_SENT, // The request has been sent + + ePROTOCOL_EVT_RSP_ERR, // There was an error receiving the response + ePROTOCOL_EVT_RSP_RECV, // The response has been received + + ePROTOCOL_EVT_AUX_TU_SENT, // Auxiliary data transmission unit sent + + ePROTOCOL_EVT_END +}; + +// NOTE: The arguments for each event are currently as follows: +// +// ePROTOCOL_EVT_REQ_ERR +// param1: Request ID +// param2: Error code +// +// ePROTOCOL_EVT_REQ_SENT +// param1: Request ID +// param2: Index of request buffer in associated protocol log + +// ePROTOCOL_EVT_RSP_ERR +// param1: Request ID +// param2: Error code +// +// ePROTOCOL_EVT_RSP_RECV +// param1: Request ID +// param2: Index of response buffer in associated protocol log +// +// ePROTOCOL_EVT_AUX_TU_SENT +// param1: Request ID +// param2: Size of transmission unit + +// NOTE: To handle protoocl events using the Windows notifier add the following +// prototype to your Window class header file: +// +// afx_msg LRESULT OnProtocolEvent( +// WPARAM wParam, +// LPARAM lParam ); +// +// Then add an entry to the message map in your Window class source file: +// +// BEGIN_MESSAGE_MAP( CView, CChildView ) +// ON_MESSAGE( PROTOCOL_WM_BASE + (ULONG)ePROTOCOL_EVT_XXX, OnProtocolEvent ) +// END_MESSAGE_MAP() +// +// Finally write the handler itself: +// +// LRESULT CView::OnProtocolEvent( +// WPARAM wParam, +// LPARAM lParam ) +// { +// Do something +// return 0; +// } + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eProtocolEventType validity check + +PARAMETERS: + evtType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eProtocolEventType evtType ) +{ + bool bRC = false; + if (evtType > ePROTOCOL_EVT_BEGIN && evtType < ePROTOCOL_EVT_END) + { + bRC = true; + } + + return bRC; +}; + +/*=========================================================================*/ +// Struct sProtocolNotificationEvent +/*=========================================================================*/ +struct sProtocolNotificationEvent +{ + public: + // (Inline) Default constructor (results in invalid object) + sProtocolNotificationEvent() + : mEventType( ePROTOCOL_EVT_BEGIN ), + mParam1( 0 ), + mParam2( 0 ) + { + // Nothing to do + }; + + // (Inline) Parameter constructor + sProtocolNotificationEvent( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) + : mEventType( eventType ), + mParam1( param1 ), + mParam2( param2 ) + { + // Nothing to do + }; + + // (Inline) Is this object valid? + bool IsValid() + { + return ::IsValid( mEventType ); + } + + /* Event type */ + eProtocolEventType mEventType; + + /* First parameter (see above) */ + DWORD mParam1; + + /* Second parameter (see above) */ + DWORD mParam2; +}; + +/*=========================================================================*/ +// Class cProtocolNotification +// +// This abstract base class provides notification of protocol server +// events sent from the protocol server to protocol server clients +/*=========================================================================*/ +class cProtocolNotification +{ + public: + // Return an allocated copy of this object + virtual cProtocolNotification * Clone() const = 0; + + // Notify view of a protocol event + virtual void Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const = 0; +}; + +/*=========================================================================*/ +// Class cProtocolQueueNotification +// +// This class provides notification via a cSyncQueue object +// populated with sProtocolNotificationEvent objects +/*=========================================================================*/ +class cProtocolQueueNotification : public cProtocolNotification +{ + public: + // Constructor + cProtocolQueueNotification( cSyncQueue * pSQ ); + + // Copy constructor + cProtocolQueueNotification( const cProtocolQueueNotification & notifier ); + + // Destructor + virtual ~cProtocolQueueNotification(); + + // Return a copy of this object + virtual cProtocolNotification * Clone() const; + + // Notify view of a MIS event + virtual void Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const; + + protected: + /* Event notification queue */ + mutable cSyncQueue * mpSQ; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolRequest.cpp b/gobi-api/GobiAPI_1.0.40/Core/ProtocolRequest.cpp new file mode 100755 index 0000000..23069ec --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolRequest.cpp @@ -0,0 +1,254 @@ +/*=========================================================================== +FILE: + ProtocolRequest.cpp + +DESCRIPTION: + Generic protocol request/command related structures and + affliated methods, these structures are used by clients of + the protocol server to specify outgoing requests + +PUBLIC CLASSES AND METHODS: + sProtocolRequest + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" + +#include "ProtocolRequest.h" +#include "ProtocolNotification.h" +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default protocol request timeout +const ULONG DEFAULT_REQ_TIMEOUT = 1000; + +// Minimum and maximum allowable timeout values (in milliseconds) +const ULONG MIN_REQ_TIMEOUT = 100; +const ULONG MAX_REQ_TIMEOUT = 300000; + +// Minimum number of attempts a request can be scheduled for +const ULONG MIN_REQ_ATTEMPTS = 1; + +// Value to indicate that a request is to be sent out indefinately +const ULONG INFINITE_REQS = 0xFFFFFFFF; + +// Minimum/default amount of time between repeated requests (in milliseconds) +const ULONG MIN_REQ_FREQUENCY = 10; +const ULONG DEFAULT_REQ_FREQUENCY = 100; + +/*=========================================================================*/ +// sProtocolRequest Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Parameterized constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer representing the request (must be + valid) + + schedule [ I ] - When (from now, in milliseconds) to send the first + request, this isn't a hard value as the request is + only guaranteed to go out after this time elapses + + timeout [ I ] - Milliseconds to wait for a response to an individual + request before declaring a timeout. Regardless of + what is passed in the timeout value used will be + between MIN/MAX_REQ_TIMEOUT + + requests [ I ] - Number of request attempts to make, this isn't a + retry count rather this value is used to specify + repeating requests. Regardless of what is passed in + the requests value used will be at least + MIN_REQ_ATTEMPTS + + frequency [ I ] - If the 'requests' value is greater than the + MIN_REQ_ATTEMPTS than this represents the amount of + time to wait between requests (from the completion of + the last request attempt, in milliseconds), again this + isn't a hard value. Regardless of what is passed in + the frequency value used will be at least + MIN_REQ_FREQUENCY + + pNotifier [ I ] - Status notification mechanism (may be 0) + + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( + sSharedBuffer * pBuffer, + ULONG schedule, + ULONG timeout, + ULONG requests, + ULONG frequency, + cProtocolNotification * pNotifier ) + : sProtocolBuffer( pBuffer ), + mSchedule( schedule ), + mTimeout( DEFAULT_REQ_TIMEOUT ), + mRequests( MIN_REQ_ATTEMPTS ), + mFrequency( DEFAULT_REQ_FREQUENCY ), + mpNotifier( 0 ), + mpAuxData( 0 ), + mAuxDataSize( 0 ), + mbTXOnly( false ) +{ + // Constrain requested timeout to allowable range + if (timeout < MIN_REQ_TIMEOUT) + { + timeout = MIN_REQ_TIMEOUT; + } + + if (timeout > MAX_REQ_TIMEOUT) + { + timeout = MAX_REQ_TIMEOUT; + } + + mTimeout = timeout; + + // Constrain request attempts + if (requests >= MIN_REQ_ATTEMPTS) + { + mRequests = requests; + } + + // Constrain frequency + if (frequency >= MIN_REQ_FREQUENCY) + { + mFrequency = frequency; + } + + // Clone notifier? + if (pNotifier != 0) + { + mpNotifier = pNotifier->Clone(); + } +} + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Parameterized constructor (notification with defaults) + +PARAMETERS: + pBuffer [ I ] - Shareable buffer representing the request (must be + valid) + + pNotifier [ I ] - Status notification mechanism (may be 0) + + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( + sSharedBuffer * pBuffer, + cProtocolNotification * pNotifier ) + : sProtocolBuffer( pBuffer ), + mSchedule( 0 ), + mTimeout( DEFAULT_REQ_TIMEOUT ), + mRequests( MIN_REQ_ATTEMPTS ), + mFrequency( DEFAULT_REQ_FREQUENCY ), + mpNotifier( pNotifier ), + mpAuxData( 0 ), + mAuxDataSize( 0 ), + mbTXOnly( false ) +{ + // Clone notifier? + if (pNotifier != 0) + { + mpNotifier = pNotifier->Clone(); + } + + Validate(); +} + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Copy constructor + +PARAMETERS: + req [ I ] - Request to copy + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( const sProtocolRequest & req ) + : sProtocolBuffer( req ), + mSchedule( req.mSchedule ), + mTimeout( req.mTimeout ), + mRequests( req.mRequests ), + mFrequency( req.mFrequency ), + mpNotifier( 0 ), + mpAuxData( req.mpAuxData ), + mAuxDataSize( req.mAuxDataSize ), + mbTXOnly( req.mbTXOnly ) +{ + // Clone notifier? + if (req.mpNotifier != 0) + { + mpNotifier = req.mpNotifier->Clone(); + } + + Validate(); +} + +/*=========================================================================== +METHOD: + ~sProtocolRequest + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::~sProtocolRequest() +{ + // Delete cloned notifier? + if (mpNotifier != 0) + { + delete mpNotifier; + mpNotifier = 0; + } +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolRequest.h b/gobi-api/GobiAPI_1.0.40/Core/ProtocolRequest.h new file mode 100755 index 0000000..414e1c2 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolRequest.h @@ -0,0 +1,193 @@ +/*=========================================================================== +FILE: + ProtocolRequest.h + +DESCRIPTION: + Generic protocol request/command related structures and + affliated methods, these structures are used by clients of + the protocol server to specify outgoing protocol requests + +PUBLIC CLASSES AND METHODS: + sProtocolRequest + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +class cProtocolNotification; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default protocol request timeout +extern const ULONG DEFAULT_REQ_TIMEOUT; + +// Minimum and maximum allowable timeout values (in milliseconds) +extern const ULONG MIN_REQ_TIMEOUT; +extern const ULONG MAX_REQ_TIMEOUT; + +// Minimum number of attempts a request can be scheduled for +extern const ULONG MIN_REQ_ATTEMPTS; + +// Value to indicate that a request is to be sent out indefinately +extern const ULONG INFINITE_REQS; + +// Minimum/default amount of time between repeated requests (in milliseconds) +extern const ULONG MIN_REQ_FREQUENCY; +extern const ULONG DEFAULT_REQ_FREQUENCY; + +/*=========================================================================*/ +// Struct sProtocolRequest +// +// Structure to represent a generic request packet, including all the +// information needed to schedule the request, send the request, and +// (optionally) reschedule the request for another TX/RX attempt +// +// The default parameters schedule an immediate request (indicated by +// passing in '0' for the schedule parameter) to be sent once with +// the default timeout value +/*=========================================================================*/ +struct sProtocolRequest : public sProtocolBuffer +{ + public: + // Parameterized constructor + sProtocolRequest( + sSharedBuffer * pBuffer, + ULONG schedule = 0, + ULONG timeout = DEFAULT_REQ_TIMEOUT, + ULONG requests = MIN_REQ_ATTEMPTS, + ULONG frequency = DEFAULT_REQ_FREQUENCY, + cProtocolNotification * pNotifier = 0 ); + + // Parameterized constructor (notification with defaults) + sProtocolRequest( + sSharedBuffer * pBuffer, + cProtocolNotification * pNotifier ); + + // Copy constructor + sProtocolRequest( const sProtocolRequest & req ); + + // Destructor + virtual ~sProtocolRequest(); + + // (Inline) Get schedule value (value is in milliseconds) + ULONG GetSchedule() const + { + return mSchedule; + }; + + // (Inline) Get timeout value + ULONG GetTimeout() const + { + return mTimeout; + }; + + // (Inline) Get requests value + ULONG GetRequests() const + { + return mRequests; + }; + + // (Inline) Get frequency value (value is in milliseconds) + ULONG GetFrequency() const + { + return mFrequency; + }; + + const cProtocolNotification * GetNotifier() const + { + return mpNotifier; + }; + + // (Inline) Set auxiliary data + void SetAuxiliaryData( + const BYTE * pData, + ULONG dataSz ) + { + mpAuxData = pData; + mAuxDataSize = dataSz; + }; + + // (Inline) Get auxiliary data + const BYTE * GetAuxiliaryData( ULONG & dataSz ) const + { + dataSz = mAuxDataSize; + return mpAuxData; + }; + + // (Inline) Set TX only flag + void SetTXOnly() + { + mbTXOnly = true; + }; + + // (Inline) Get TX only flag + bool IsTXOnly() const + { + return mbTXOnly; + }; + + protected: + /* Schedule (approximately when to send the initial request) */ + ULONG mSchedule; + + /* Timeout value for receiving a response */ + ULONG mTimeout; + + /* Number of requests to schedule (must be at least one) */ + ULONG mRequests; + + /* Frequency (approximately how long to wait before next request) */ + ULONG mFrequency; + + /* Notification object */ + cProtocolNotification * mpNotifier; + + /* Auxiliary data */ + const BYTE * mpAuxData; + + /* Auxilary data size */ + ULONG mAuxDataSize; + + /* TX only (i.e. do not wait for a response) ? */ + bool mbTXOnly; +}; + diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolServer.cpp b/gobi-api/GobiAPI_1.0.40/Core/ProtocolServer.cpp new file mode 100755 index 0000000..4e14f15 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolServer.cpp @@ -0,0 +1,1720 @@ +/*=========================================================================== +FILE: + ProtocolServer.cpp + +DESCRIPTION: + Generic protocol packet server + +PUBLIC CLASSES AND METHODS: + cProtocolServer + Abstract base class for protocol servers + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" + +#include "ProtocolServer.h" +#include "ProtocolNotification.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid request ID +const ULONG INVALID_REQUEST_ID = 0; + +// Default activity timeout value +const ULONG DEFAULT_WAIT = 100; + +// MTU (Maximum Transmission Unit) for auxiliary data (QC USB imposed) +const ULONG MAX_AUX_MTU_SIZE = 1024 * 256; + +// USB's MaxPacketSize +const ULONG MAX_PACKET_SIZE = 512; + +// Maximum amount of time to wait on external access synchronization object +#ifdef DEBUG + // For the sake of debugging do not be so quick to assume failure + const ULONG DEADLOCK_TIME = 180000; +#else + const ULONG DEADLOCK_TIME = 10000; +#endif + +// Maximum amount of time to wait for the protocol server to process a command +const ULONG COMMAND_TIME = DEADLOCK_TIME; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + ScheduleThread (Free Method) + +DESCRIPTION: + Watch schedule for event to process or timeout + +PARAMETERS: + pArg [ I ] - The protocol server object + +RETURN VALUE: + void * - thread exit value (always NULL) +===========================================================================*/ +void * ScheduleThread( PVOID pArg ) +{ + // Do we have a server? + cProtocolServer * pServer = (cProtocolServer *)pArg; + if (pServer == 0) + { + TRACE( "ScheduleThread started with empty pArg." + " Unable to locate cProtocolServer\n" ); + + ASSERT( 0 ); + return NULL; + } + + TRACE( "Schedule thread [%lu] started\n", + pthread_self() ); + + // Default wait event + timespec toTime = TimeIn( DEFAULT_WAIT ); + + // Return value checking + int nRet; + + while (pServer->mbExiting == false) + { + DWORD nTemp; + nRet = pServer->mThreadScheduleEvent.Wait( TimeFromNow( toTime ), nTemp ); + if (nRet != 0 && nRet != ETIME) + { + // Error condition + TRACE( "ScheduleThread [%lu] ScheduleThread wait error %d, %s\n", + pthread_self(), + nRet, + strerror( nRet ) ); + break; + } + + // Time to exit? + if (pServer->mbExiting == true) + { + break; + } + + // Get Schedule Mutex (non-blocking) + nRet = pthread_mutex_trylock( &pServer->mScheduleMutex ); + if (nRet == EBUSY) + { + // Not an error, we're just too slow + // Someone else got to the ScheduleMutex before us + // We'll wait for the signal again + toTime = TimeIn( DEFAULT_WAIT ); + TRACE( "ScheduleThread [%lu] unable to lock ScheduleMutex\n", + pthread_self() ); + continue; + } + else if (nRet != 0) + { + // Error condition + TRACE( "ScheduleThread [%lu] mScheduleMutex error %d, %s\n", + pthread_self(), + nRet, + strerror( nRet ) ); + break; + } + + // Verify time. In the rare event it does move backward + // it would simply place all our schedule items as due now + pServer->CheckSystemTime(); + + // Default next wait period + toTime = TimeIn( DEFAULT_WAIT ); + + timespec curTime = TimeIn( 0 ); + + if (pServer->mpActiveRequest != 0) + { + if (pServer->mpActiveRequest->mbWaitingForResponse == true) + { + // Waiting on a response, this takes priority over the next + // scheduled event + + // Has timeout expired? + if (pServer->mActiveRequestTimeout <= curTime) + { + // Response timeout + + // Note: This may clear mpActiveRequest + pServer->RxTimeout(); + } + else + { + // Active response timer is not yet due to expire + // Default timeout again, or this response's timeout? + if (pServer->mActiveRequestTimeout <= toTime) + { + toTime = pServer->mActiveRequestTimeout; + } + } + } + else + { + // This should never happen + + TRACE( "ScheduleThread() Sequencing error: " + "Active request %lu is not waiting for response ???\n", + pServer->mpActiveRequest->mID ); + + break; + } + } + + if (pServer->mpActiveRequest == 0 + && pServer->mRequestSchedule.size() > 0) + { + // No response timer active, ready to start the next + // scheduled item if due + + timespec scheduledItem = pServer->GetNextRequestTime(); + + // Is item due to be scheduled? + if (scheduledItem <= curTime) + { + // Process scheduled item + pServer->ProcessRequest(); + } + else + { + // Scheduled item is not yet due to be processed + // Default timeout again, or this item's start time? + if (scheduledItem <= toTime) + { + toTime = scheduledItem; + } + } + } + + /*TRACE( "Updated timer at %llu waiting %lu\n", + GetTickCount(), + TimeFromNow( toTime ) ); */ + + // Unlock schedule mutex + nRet = pthread_mutex_unlock( &pServer->mScheduleMutex ); + if (nRet != 0) + { + TRACE( "ScheduleThread Unable to unlock schedule mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + } + + TRACE( "Schedule thread [%lu] exited\n", + pthread_self() ); + + return NULL; +} + +/*=========================================================================== +METHOD: + TimeIn (Free Method) + +DESCRIPTION: + Fill timespec with the time it will be in specified milliseconds + Relative time to Absolute time + +PARAMETERS: + millis [ I ] - Milliseconds from current time + +RETURN VALUE: + timespec - resulting time (from epoc) + NOTE: tv_sec of 0 is an error +===========================================================================*/ +timespec TimeIn( ULONG millis ) +{ + timespec outTime; + + int nRC = clock_gettime( CLOCK_REALTIME, &outTime ); + if (nRC == 0) + { + // Add avoiding an overflow on (long)nsec + outTime.tv_sec += millis / 1000l; + outTime.tv_nsec += ( millis % 1000l ) * 1000000l; + + // Check if we need to carry + if (outTime.tv_nsec >= 1000000000l) + { + outTime.tv_sec += outTime.tv_nsec / 1000000000l; + outTime.tv_nsec = outTime.tv_nsec % 1000000000l; + } + } + else + { + outTime.tv_sec = 0; + outTime.tv_nsec = 0; + } + + return outTime; +} + +/*=========================================================================== +METHOD: + TimeFromNow (Free Method) + +DESCRIPTION: + Find the milliseconds from current time this timespec will occur + Absolute time to Relative time + +PARAMETERS: + time [ I ] - Absolute time + +RETURN VALUE: + Milliseconds in which absolute time will occur + 0 if time has passed or error has occured +===========================================================================*/ +ULONG TimeFromNow( timespec time ) +{ + // Assume failure + ULONG nOutTime = 0; + + timespec now; + int nRC = clock_gettime( CLOCK_REALTIME, &now ); + if (nRC == -1) + { + TRACE( "Error %d with gettime, %s\n", errno, strerror( errno ) ); + return nOutTime; + } + + if (time <= now) + { + return nOutTime; + } + + nOutTime = (time.tv_sec - now.tv_sec) * 1000l; + nOutTime += (time.tv_nsec - now.tv_nsec) / 1000000l; + + return nOutTime; +} + +/*=========================================================================== +METHOD: + GetTickCount (Free Method) + +DESCRIPTION: + Provide a number for sequencing reference, similar to the windows + ::GetTickCount(). + + NOTE: This number is based on the time since epoc, not + uptime. + +PARAMETERS: + +RETURN VALUE: + ULONGLONG - Number of milliseconds system has been up +===========================================================================*/ +ULONGLONG GetTickCount() +{ + timespec curtime = TimeIn( 0 ); + + ULONGLONG outtime = curtime.tv_sec * 1000LL; + outtime += curtime.tv_nsec / 1000000LL; + + return outtime; +} + +/*=========================================================================*/ +// cProtocolServerRxCallback Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + IOComplete (Free Method) + +DESCRIPTION: + The I/O has been completed, process the results + +PARAMETERS: + status [ I ] - Status of operation + bytesReceived [ I ] - Bytes received during operation + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServerRxCallback::IOComplete( + DWORD status, + DWORD bytesReceived ) +{ + if (mpServer != 0) + { + mpServer->RxComplete( status, bytesReceived ); + } +} + +/*=========================================================================*/ +// cProtocolServer::sProtocolReqRsp Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolServer::sProtocolReqRsp (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + requestInfo [ I ] - Underlying request object + requestID [ I ] - Request ID + auxDataMTU [ I ] - MTU (Maximum Transmission Unit) for auxiliary data + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::sProtocolReqRsp::sProtocolReqRsp( + const sProtocolRequest & requestInfo, + ULONG requestID, + ULONG auxDataMTU ) + : mRequest( requestInfo ), + mID( requestID ), + mAttempts( 0 ), + mEncodedSize( requestInfo.GetSize() ), + mRequiredAuxTxs( 0 ), + mCurrentAuxTx( 0 ), + mbWaitingForResponse( false ) +{ + ULONG auxDataSz = 0; + const BYTE * pAuxData = requestInfo.GetAuxiliaryData( auxDataSz ); + + // Compute the number of required auxiliary data transmissions? + if (auxDataMTU > 0 && pAuxData != 0 && auxDataSz > 0) + { + mRequiredAuxTxs = 1; + if (auxDataSz > auxDataMTU) + { + mRequiredAuxTxs = auxDataSz / auxDataMTU; + if ((auxDataSz % auxDataMTU) != 0) + { + mRequiredAuxTxs++; + } + } + } +} + +/*=========================================================================== +METHOD: + cProtocolServer::sProtocolReqRsp (Public Method) + +DESCRIPTION: + Coop constructor + +PARAMETERS: + reqRsp [ I ] - Object being copied + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::sProtocolReqRsp::sProtocolReqRsp( + const sProtocolReqRsp & reqRsp ) + : mRequest( reqRsp.mRequest ), + mID( reqRsp.mID ), + mAttempts( reqRsp.mAttempts ), + mEncodedSize( reqRsp.mEncodedSize ), + mRequiredAuxTxs( reqRsp.mRequiredAuxTxs ), + mCurrentAuxTx( reqRsp.mCurrentAuxTx ), + mbWaitingForResponse( reqRsp.mbWaitingForResponse ) +{ + // Nothing to do +}; + +/*=========================================================================*/ +// cProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + rxType [ I ] - Protocol type to assign to incoming data + txType [ I ] - Protocol type to verify for outgoing data + bufferSzRx [ I ] - Size of data buffer for incoming data + logSz [ I ] - Size of log (number of buffers) + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::cProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ) + : mComm(), + mRxCallback(), + mScheduleThreadID( 0 ), + mThreadScheduleEvent(), + mbExiting( false ), + mpServerControl( 0 ), + mLastRequestID( 1 ), + mpActiveRequest( 0 ), + mpRxBuffer( 0 ), + mRxBufferSize( bufferSzRx ), + mRxType( rxType ), + mTxType( txType ), + mLog( logSz ) +{ + mLastTime = TimeIn( 0 ); + + // Allocate receive buffer? + if (mRxBufferSize > 0 && mComm.IsValid() == true) + { + mpRxBuffer = new BYTE[mRxBufferSize]; + } + + // Before continuing verify receive buffer was allocated + if (mpRxBuffer != 0) + { + // Schedule mutex + int nRet = pthread_mutex_init( &mScheduleMutex, NULL ); + if (nRet != 0) + { + TRACE( "Unable to init schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + } +} + +/*=========================================================================== +METHOD: + ~cProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (destroys sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::~cProtocolServer() +{ + // This should have already been called, but ... + Exit(); + + // Schedule mutex + int nRet = pthread_mutex_destroy( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to destroy schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + } + + // Free receive buffer + if (mpRxBuffer != 0) + { + delete [] mpRxBuffer; + mpRxBuffer = 0; + } +} + +/*=========================================================================== +METHOD: + HandleRemoveRequest (Public Method) + +DESCRIPTION: + Remove a previously added protocol request + + Note: if a request is being processed, it cannot be inturrupted + +PARAMETERS: + reqID [ I ] - Server assigned request ID + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::HandleRemoveRequest( ULONG reqID ) +{ + // Assume failure + bool bRC = false; + + // Find and erase request from request map + std::map ::iterator pReqIter; + pReqIter = mRequestMap.find( reqID ); + + if (pReqIter != mRequestMap.end()) + { + sProtocolReqRsp * pReqRsp = pReqIter->second; + if (pReqRsp != 0) + { + delete pReqRsp; + } + + mRequestMap.erase( pReqIter ); + + // Success! + bRC = true; + + // Find and erase request from schedule + bool bFound = false; + int entryIndex = -1; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + while (pScheduleIter != mRequestSchedule.end()) + { + entryIndex++; + + tSchedule entry = *pScheduleIter; + if (entry.second == reqID) + { + bFound = true; + mRequestSchedule.erase( pScheduleIter ); + break; + } + else + { + pScheduleIter++; + } + } + + // Note: schedule will be updated when mutex is unlocked/signaled + } + else if (mpActiveRequest != 0 && mpActiveRequest->mID == reqID) + { + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Cancel the response timer (when active) + if (mpActiveRequest->mbWaitingForResponse == true) + { + // Schedule will be updated when mutex is unlocked + + // Failure to receive response, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_ERR, + (DWORD)reqID, + ECANCELED ); + } + } + else + { + // This is the active request, cancel the underlying transmit + // Note: Because ProcessRequest and RemoveRequest are both muxed + // with ScheduleMutex, it is impossible to for the write + // to actually be in progress when this code is reached. + mComm.CancelTx(); + + // Failure to send request, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_ERR, + (DWORD)reqID, + ECANCELED ); + } + } + + // Now delete the request + delete mpActiveRequest; + mpActiveRequest = 0; + + // Success! + bRC = true; + } + else + { + TRACE( "cProtocolServer::RemoveRequest( %lu )," + " invalid request ID\n", + reqID ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ScheduleRequest (Internal Method) + +DESCRIPTION: + Schedule a request for transmission + +PARAMETERS: + reqID [ I ] - ID of the request being scheduled this ID must exist + in the internal request/schedule maps + + schedule [ I ] - Value in milliseconds that indicates the approximate + time from now that the request is to be sent out, the + actual time that the request is sent will be greater + than or equal to this value dependant on requests + scheduled before the request in question and + standard server processing time + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::ScheduleRequest( + ULONG reqID, + ULONG schedule ) +{ + // Assume failure + bool bRC = false; + + // Schedule adjust is in milliseconds + timespec schTimer = TimeIn( schedule ); + + // Create the schedule entry + tSchedule newEntry( schTimer, reqID ); + + // Fit this request into the schedule (ordered by scheduled time) + mRequestSchedule.insert( newEntry ); + + // Note: timer will be updated when mScheduleMutex is unlocked + + return bRC; +} + +/*=========================================================================== +METHOD: + RescheduleActiveRequest (Internal Method) + +DESCRIPTION: + Reschedule (or cleanup) the active request + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RescheduleActiveRequest() +{ + // Are there more attempts to be made? + if (mpActiveRequest->mAttempts < mpActiveRequest->mRequest.GetRequests()) + { + // Yes, first reset the request + mpActiveRequest->Reset(); + + // Now add it back to the request map + mRequestMap[mpActiveRequest->mID] = mpActiveRequest; + + TRACE( "RescheduleActiveRequest(): req %lu rescheduled\n", mpActiveRequest->mID ); + + // Lastly reschedule the request + ScheduleRequest( mpActiveRequest->mID, + mpActiveRequest->mRequest.GetFrequency() ); + + } + else + { + TRACE( "RescheduleActiveRequest(): req %lu removed\n", mpActiveRequest->mID ); + + // No, we are through with this request + delete mpActiveRequest; + } + + // There is no longer an active request + mpActiveRequest = 0; + +} + +/*=========================================================================== +METHOD: + ProcessRequest (Internal Method) + +DESCRIPTION: + Process a single outgoing protocol request, this consists of removing + the request ID from the head of the schedule, looking up the internal + request object in the request map, sending out the request, and setting + up the response timer (if a response is required) + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: +===========================================================================*/ +void cProtocolServer::ProcessRequest() +{ + // Is there already an active request? + if (mpActiveRequest != 0) + { + return; + } + + // Grab request ID from the schedule + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + // Did we find the request? + if (pScheduleIter == mRequestSchedule.end()) + { + // No + return; + } + + // Yes, grab the request ID + ULONG reqID = pScheduleIter->second; + + // Remove from schedule + mRequestSchedule.erase( pScheduleIter ); + + // Look up the internal request object + std::map ::iterator pReqIter; + pReqIter = mRequestMap.find( reqID ); + + // Request not found around? + if (pReqIter == mRequestMap.end() || pReqIter->second == 0) + { + // No + return; + } + + // Set this request as the active request + mpActiveRequest = pReqIter->second; + + TRACE( "ProcessRequest(): req %lu started\n", mpActiveRequest->mID ); + + // Remove request from pending request map + mRequestMap.erase( pReqIter ); + + // Extract the underlying request + const sProtocolRequest & req = mpActiveRequest->mRequest; + + // Increment attempt count? + if (req.GetRequests() != INFINITE_REQS) + { + // This request isn't an indefinite one, so keep track of each attempt + mpActiveRequest->mAttempts++; + } + + bool bTxSuccess = false; + + // Encode data for transmission? + bool bEncoded = false; + sSharedBuffer * pEncoded = 0; + pEncoded = EncodeTxData( req.GetSharedBuffer(), bEncoded ); + if (bEncoded == false) + { + // Note: no longer asynchronus + // Send the request data + bTxSuccess = mComm.TxData( req.GetBuffer(), + req.GetSize() ); + } + else if (bEncoded == true) + { + if (pEncoded != 0 && pEncoded->IsValid() == true) + { + // Note: no longer asynchronus + // Send the request data + mpActiveRequest->mEncodedSize = pEncoded->GetSize(); + bTxSuccess = mComm.TxData( pEncoded->GetBuffer(), + pEncoded->GetSize() ); + } + } + + if (bTxSuccess == true) + { + TRACE( "ProcessRequest(): req %lu finished\n", mpActiveRequest->mID ); + TxComplete(); + } + else + { + TxError(); + TRACE( "ProcessRequest(): req finished with a TxError\n" ); + } + + return; +} + +/*=========================================================================== +METHOD: + CheckSystemTime (Internal Method) + +DESCRIPTION: + Check that system time hasn't moved backwards. Since we use the system + time for scheduling requests we need to periodically check that the + user (or system itself) hasn't reset system time backwards, if it has + then we reschedule everything to the current system time. This disrupts + the schedule but avoids stranding requests + + Updates mLastTime + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool: System time moved backwards? +===========================================================================*/ +bool cProtocolServer::CheckSystemTime() +{ + // Assume that time is still marching forward + bool bAdjust = false; + + timespec curTime = TimeIn( 0 ); + + if (curTime < mLastTime) + { + // Looks like the system clock has been adjusted to an earlier + // value, go through the current schedule and adjust each timer + // to reflect the adjustment. This isn't an exact approach but + // it prevents requests from being stranded which is our goal + + // Note: set iterators are constant. This means we need to + // create a set with the new data, we can't modify this one + + std::set < tSchedule, std::less > tempSchedule; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + while (pScheduleIter != mRequestSchedule.end()) + { + tSchedule entry = *pScheduleIter; + entry.first.tv_sec = curTime.tv_sec; + entry.first.tv_nsec = curTime.tv_nsec; + tempSchedule.insert( entry ); + + pScheduleIter++; + } + + mRequestSchedule = tempSchedule; + + // Update mActiveRequestTimeout + if ( (mpActiveRequest != 0) + && (mpActiveRequest->mbWaitingForResponse == true) ) + { + // Restart active request's timeout + ULONG mTimeout = mpActiveRequest->mRequest.GetTimeout(); + mActiveRequestTimeout = TimeIn( mTimeout ); + } + + TRACE( "Time has moved backwards, schedule updated\n" ); + + // Indicate the change + bAdjust = true; + } + + mLastTime.tv_sec = curTime.tv_sec; + mLastTime.tv_nsec = curTime.tv_nsec; + + return bAdjust; +} + +/*=========================================================================== +METHOD: + RxComplete (Internal Method) + +DESCRIPTION: + Handle completion of receive data operation + +PARAMETERS: + status [ I ] - Status of operation + bytesReceived [ I ] - Number of bytes received + +SEQUENCING: + This method is sequenced according to the schedule mutex + i.e. any other thread that needs to modify the schedule + will block until this method completes + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RxComplete( + DWORD status, + DWORD bytesReceived ) +{ + if (status != NO_ERROR) + { + TRACE( "cProtocolServer::RxComplete() = %lu\n", status ); + } + + // Error with the read + if (status != NO_ERROR || bytesReceived == 0) + { + // Setup the next read + mComm.RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + + return; + } + + // Get Schedule Mutex + if (GetScheduleMutex() == false) + { + TRACE( "RxComplete(), unable to get schedule Mutex\n" ); + return; + } + + TRACE( "RxComplete() - Entry at %llu\n", GetTickCount() ); + + // Decode data + bool bAbortTx = false; + ULONG rspIdx = INVALID_LOG_INDEX; + bool bRsp = DecodeRxData( bytesReceived, rspIdx, bAbortTx ); + + // Is there an active request that needs to be aborted + if (mpActiveRequest != 0 && bAbortTx == true) + { + // Yes, terminate the transmission and handle the error + mComm.CancelTx(); + TxError(); + } + // Is there an active request and a valid response? + else if (mpActiveRequest != 0 && bRsp == true) + { + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Notify client that response was received + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_RECV, + (DWORD)mpActiveRequest->mID, + (DWORD)rspIdx ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); + } + + // Setup the next read + mComm.RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + + TRACE( "RxComplete() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return; + } + + return; +} + +/*=========================================================================== +METHOD: + RxTimeout (Internal Method) + +DESCRIPTION: + Handle the response timer expiring + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RxTimeout() +{ + // No active request? + if (mpActiveRequest == 0) + { + TRACE( "RxTimeout() with no active request\n" ); + ASSERT( 0 ); + } + + TRACE( "RxTimeout() for req %lu\n", mpActiveRequest->mID ); + + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Failure to receive response, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_ERR, + (DWORD)mpActiveRequest->mID, + (DWORD)0 ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); +} + +/*=========================================================================== +METHOD: + TxComplete (Internal Method) + +DESCRIPTION: + Handle completion of transmit data operation + +PARAMETERS: + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::TxComplete() +{ + // No active request? + if (mpActiveRequest == 0) + { + TRACE( "TxComplete() called with no active request\n" ); + ASSERT( 0 ); + } + + TRACE( "TxComplete() req %lu started\n", mpActiveRequest->mID ); + + ULONG reqID = mpActiveRequest->mID; + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Notify client of auxiliary data being sent? + if (mpActiveRequest->mRequiredAuxTxs && mpActiveRequest->mCurrentAuxTx) + { + pNotifier->Notify( ePROTOCOL_EVT_AUX_TU_SENT, + (DWORD)reqID, + (DWORD)mpActiveRequest->mEncodedSize ); + } + + // Check for more auxiliary data to transmit + if (mpActiveRequest->mCurrentAuxTx < mpActiveRequest->mRequiredAuxTxs) + { + ULONG auxDataSz = 0; + const BYTE * pAuxData = req.GetAuxiliaryData( auxDataSz ); + if (auxDataSz > 0 && pAuxData != 0) + { + bool bRC = false; + + // Adjust for current MTU + pAuxData += (mpActiveRequest->mCurrentAuxTx * MAX_AUX_MTU_SIZE); + mpActiveRequest->mCurrentAuxTx++; + + // Last MTU? + if (mpActiveRequest->mCurrentAuxTx == mpActiveRequest->mRequiredAuxTxs) + { + // More than one MTU? + if (mpActiveRequest->mRequiredAuxTxs > 1) + { + auxDataSz = (auxDataSz % MAX_AUX_MTU_SIZE); + if (auxDataSz == 0) + { + auxDataSz = MAX_AUX_MTU_SIZE; + } + } + + if (auxDataSz % MAX_PACKET_SIZE == 0) + { + // If last write of unframed write request is divisible + // by 512, break off last byte and send seperatly. + TRACE( "TxComplete() Special case, break off last byte\n" ); + + bRC = mComm.TxData( pAuxData, + auxDataSz - 1 ); + + if (bRC == true) + { + bRC = mComm.TxData( pAuxData + auxDataSz -1, + 1 ); + } + } + else + { + bRC = mComm.TxData( pAuxData, + auxDataSz ); + } + } + else if (mpActiveRequest->mRequiredAuxTxs > 1) + { + auxDataSz = MAX_AUX_MTU_SIZE; + + bRC = mComm.TxData( pAuxData, + auxDataSz ); + } + + if (bRC == true) + { + mpActiveRequest->mEncodedSize = auxDataSz; + TxComplete(); + } + else + { + TxError(); + } + + return; + } + } + + // Another successful transmission, add the buffer to the log + ULONG reqIdx = INVALID_LOG_INDEX; + + sProtocolBuffer pb( req.GetSharedBuffer() ); + reqIdx = mLog.AddBuffer( pb ); + + // Notify client? + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_SENT, (DWORD)reqID, (DWORD)reqIdx ); + } + + // Wait for a response? + if (mpActiveRequest->mRequest.IsTXOnly() == false) + { + // We now await the response + mpActiveRequest->mbWaitingForResponse = true; + mActiveRequestTimeout = TimeIn( mpActiveRequest->mRequest.GetTimeout() ); + } + else + { + // Reschedule request as needed + RescheduleActiveRequest(); + } +} + +/*=========================================================================== +METHOD: + TxError (Internal Method) + +DESCRIPTION: + Handle transmit data operation error be either rescheduling the + request or cleaning it up + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::TxError() +{ + // No active request? + if (mpActiveRequest == 0) + { + return; + } + + ULONG reqID = mpActiveRequest->mID; + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Failure to send request, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_ERR, (DWORD)reqID, (DWORD)0 ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the protocol server by starting up the schedule thread + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Initialize() +{ + // Assume failure + bool bRC = false; + + mbExiting = false; + + // Get mScheduleMutex + if (GetScheduleMutex() == true) + { + if (mScheduleThreadID == 0) + { + // Yes, start thread + int nRet = pthread_create( &mScheduleThreadID, + NULL, + ScheduleThread, + this ); + if (nRet == 0) + { + // Success! + bRC = true; + } + } + } + else + { + TRACE( "cProtocolServer::Initialize(), unable to aquire ScheduleMutex\n" ); + return false; + } + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return false; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Exit (Public Method) + +DESCRIPTION: + Exit the protocol server by exiting the schedule thread (if necessary) + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Exit() +{ + // Assume failure + bool bRC = false; + + if (mScheduleThreadID != 0) + { + if (GetScheduleMutex() == false) + { + // This should never happen + return false; + } + + // Set exit event + mbExiting = true; + + // Signal a schedule update + if (mThreadScheduleEvent.Set( 1 ) != 0) + { + // This should never happen + return false; + } + + TRACE( "Joining ScheduleThread\n" ); + + // Allow process to continue until it finishes + int nRet = pthread_join( mScheduleThreadID, NULL ); + if (nRet == ESRCH) + { + TRACE( "ScheduleThread has exited already\n" ); + } + else if (nRet != 0) + { + TRACE( "Unable to join ScheduleThread. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + TRACE( "cProtocolServer::Exit(), completed thread %lu\n", + (ULONG)mScheduleThreadID ); + + bRC = true; + + // Release "handle" + mScheduleThreadID = 0; + + // Release mutex lock, don't signal ScheduleThread + if (ReleaseScheduleMutex( false ) == false) + { + // This should never happen + return false; + } + } + else + { + // No ScheduleThread + bRC = true; + } + + // Free any allocated requests + std::map ::iterator pReqIter; + pReqIter = mRequestMap.begin(); + + while (pReqIter != mRequestMap.end()) + { + sProtocolReqRsp * pReqRsp = pReqIter->second; + if (pReqRsp != 0) + { + delete pReqRsp; + } + + pReqIter++; + } + + mRequestMap.clear(); + + // Free log + mLog.Clear(); + + return bRC; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the given communications port + +PARAMETERS: + pPort [ I ] - String pointer representing the device node to + connect to (IE: /dev/qcqmi0) + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Connect( LPCSTR pPort ) +{ + // Assume failure + bool bRC = false; + if (pPort == 0 || pPort[0] == 0) + { + return bRC; + } + + // Connect to device + + // Set callback + mRxCallback.SetServer( this ); + + // Override to initialize port with protocol specific options + bRC = mComm.Connect( pPort ); + if (bRC == true) + { + bRC = InitializeComm(); + if (bRC == true) + { + // Setup the initial read + mComm.RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the current communications port + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Disconnect() +{ + // Disconnect + + // Cancel any outstanding I/O + mComm.CancelIO(); + + // Empty callback + mRxCallback.SetServer( 0 ); + + // Cleanup COM port + CleanupComm(); + + // Now disconnect + return mComm.Disconnect(); +} + +/*=========================================================================== +METHOD: + IsConnected (Public Method) + +DESCRIPTION: + Are we currently connected to a port? + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::IsConnected() +{ + return mComm.IsConnected(); +} + +/*=========================================================================== +METHOD: + AddRequest (Public Method) + +DESCRIPTION: + Add an outgoing protocol request to the protocol server request queue + +PARAMETERS: + req [ I ] - Request being added + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + ULONG - ID of scheduled request (INVALID_REQUEST_ID upon error) +===========================================================================*/ +ULONG cProtocolServer::AddRequest( const sProtocolRequest & req ) +{ + // Assume failure + ULONG reqID = INVALID_REQUEST_ID; + + // Server not configured for sending requests? + if (IsValid( mTxType ) == false) + { + return reqID; + } + + // Request type not valid for server? + if (req.GetType() != mTxType) + { + return reqID; + } + + // Invalide request? + if (ValidateRequest( req ) == false) + { + return reqID; + } + + // Get mScheduleMutex + if (GetScheduleMutex() == true) + { + TRACE( "AddRequest() - Entry at %llu\n", GetTickCount() ); + + // Grab next available request ID + if (++mLastRequestID == 0) + { + mLastRequestID++; + } + + reqID = mLastRequestID; + while (mRequestMap.find( reqID ) != mRequestMap.end()) + { + reqID++; + } + + // Wrap in our internal structure + sProtocolReqRsp * pReqRsp = 0; + pReqRsp = new sProtocolReqRsp( req, reqID, MAX_AUX_MTU_SIZE ); + + if (pReqRsp != 0) + { + // Add to request map + mRequestMap[reqID] = pReqRsp; + + // ... and schedule + ScheduleRequest( reqID, req.GetSchedule() ); + } + + TRACE( "AddRequest() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return INVALID_REQUEST_ID; + } + } + else + { + TRACE( "cProtocolServer::AddRequest(), unable to get schedule Mutex\n" ); + } + + return reqID; +} + +/*=========================================================================== +METHOD: + RemoveRequest (Public Method) + +DESCRIPTION: + Remove a previously added protocol request + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + + Note: If a request is being written, it cannot be inturrupted as + both ProcessRequest and RemoveRequest depend on the ScheduleMutex + and the write is synchronus. If the request has been written but + the read has not been triggered it can be removed. + +PARAMETERS: + reqID [ I ] - ID of request being removed + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::RemoveRequest( ULONG reqID ) +{ + // Assume failure + bool bRC = false; + + // Get Schedule Mutex + if (GetScheduleMutex() == true) + { + TRACE( "RemoveRequest() - Entry at %llu\n", GetTickCount() ); + + bRC = HandleRemoveRequest( reqID ); + + TRACE( "RemoveRequest() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return false; + } + } + else + { + TRACE( "cProtocolServer::RemoveRequest(), unable to get mScheduleMutex\n" ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetScheduleMutex (Internal Method) + +DESCRIPTION: + Get the schedule mutex. Additionally a check is applied to verify the + DEADLOCK_TIME was not exceeded + +SEQUENCING: + This function will block until the mScheduleMutex is aquired + +PARAMETERS: + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::GetScheduleMutex() +{ + ULONGLONG nStart = GetTickCount(); + + //TRACE( "Locking Schedule mutex\n" ); + int nRet = pthread_mutex_lock( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to lock schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + ULONGLONG nEnd = GetTickCount(); + if (nEnd - nStart > DEADLOCK_TIME) + { + TRACE( "Deadlock time exceeded: took %llu ms\n", nEnd - nStart ); + ReleaseScheduleMutex( true ); + return false; + } + + //TRACE( "Locked ScheduleMutex\n" ); + return true; +} + +/*=========================================================================== +METHOD: + ReleaseScheduleMutex (Internal Method) + +DESCRIPTION: + Release lock on the schedule mutex + +SEQUENCING: + Calling process must have lock + +PARAMETERS: + bSignalThread [ I ] - Signal Schedule thread as well? + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::ReleaseScheduleMutex( bool bSignalThread ) +{ + if (bSignalThread == true) + { + if (mThreadScheduleEvent.Set( 1 ) != 0) + { + return false; + } + } + + int nRet = pthread_mutex_unlock( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to unlock schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return true; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/ProtocolServer.h b/gobi-api/GobiAPI_1.0.40/Core/ProtocolServer.h new file mode 100755 index 0000000..4f8bd4c --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/ProtocolServer.h @@ -0,0 +1,351 @@ +/*=========================================================================== +FILE: + ProtocolServer.h + +DESCRIPTION: + Generic protocol packet server + +PUBLIC CLASSES AND METHODS: + cProtocolServer + Abstract base class for protocol servers + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Comm.h" +#include "ProtocolRequest.h" +#include "ProtocolLog.h" +#include "Event.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +class cProtocolServer; +struct sServerControl; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid request ID +extern const ULONG INVALID_REQUEST_ID; + +// Fill timespec with the time it will be in specified milliseconds +// Relative time to Absolute time +timespec TimeIn( ULONG millis ); + +// Find the milliseconds from current time this timespec will occur +// Absolute time to Relative time +ULONG TimeFromNow( timespec time ); + +// Provide a number for sequencing reference, similar to the windows function +ULONGLONG GetTickCount(); + +// timespec < comparison method +inline bool operator< (const timespec & first, const timespec & second) +{ + return ( (first.tv_sec < second.tv_sec) + ||( (first.tv_sec == second.tv_sec) + &&(first.tv_nsec < second.tv_nsec) ) ); +} + +// timespec <= comparison method +inline bool operator<= (const timespec & first, const timespec & second) +{ + return ( (first.tv_sec < second.tv_sec) + ||( (first.tv_sec == second.tv_sec) + &&(first.tv_nsec <= second.tv_nsec) ) ); +} + +/*=========================================================================*/ +// Class cProtocolServerRxCallback +/*=========================================================================*/ +class cProtocolServerRxCallback +{ + public: + // (Inline) Constructor + cProtocolServerRxCallback() + : mpServer( 0 ) + { }; + + // (Inline) Destructor + virtual ~cProtocolServerRxCallback() { }; + + // (Inline) Set server object to pass results to + void SetServer( cProtocolServer * pServer ) + { + mpServer = pServer; + }; + + // The I/O has been completed, process the results + virtual void IOComplete( + DWORD status, + DWORD bytesReceived ); + + protected: + /* Protocol server to interact with */ + cProtocolServer * mpServer; +}; + +/*=========================================================================*/ +// Class cProtocolServer +/*=========================================================================*/ +class cProtocolServer +{ + public: + // Constructor + cProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cProtocolServer(); + + // Initialize the protocol server + bool Initialize(); + + // Exit the protocol server + bool Exit(); + + // Connect to the given communications port + bool Connect( LPCSTR pPort ); + + // Disconnect from target + bool Disconnect(); + + // Are we currently connected to a port? + bool IsConnected(); + + // Add an outgoing protocol request to the protocol server request queue + ULONG AddRequest( const sProtocolRequest & req ); + + // Remove a previously added protocol request + bool RemoveRequest( ULONG reqID ); + + // (Inline) Return the protocol log + const cProtocolLog & GetLog() + { + return mLog; + }; + + protected: + // Internal protocol server request/response structure, used to track + // info related to sending out a request + struct sProtocolReqRsp + { + public: + // Constructor + sProtocolReqRsp( + const sProtocolRequest & requestInfo, + ULONG requestID, + ULONG auxDataMTU ); + + // Copy constructor + sProtocolReqRsp( const sProtocolReqRsp & reqRsp ); + + // (Inline) Reset for next transmission attempt + void Reset() + { + mEncodedSize = mRequest.GetSize(); + + mCurrentAuxTx = 0; + mbWaitingForResponse = 0; + }; + + /* Request ID */ + ULONG mID; + + /* Number of times this request has been attempted */ + ULONG mAttempts; + + /* Size of encoded data being transmitted */ + ULONG mEncodedSize; + + /* Number of required auxiliary data transmissions */ + ULONG mRequiredAuxTxs; + + /* Current auxiliary data transmission */ + ULONG mCurrentAuxTx; + + /* Are we currently waiting for a response? */ + bool mbWaitingForResponse; + + /* Underlying protocol request */ + sProtocolRequest mRequest; + }; + + // Handle the remove request + bool HandleRemoveRequest( ULONG reqID ); + + // Schedule a request for transmission + bool ScheduleRequest( + ULONG reqID, + ULONG schedule ); + + // (Inline) Get next request's time from mRequestSchedule + timespec GetNextRequestTime() + { + timespec outTime; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + tSchedule entry = *pScheduleIter; + + outTime = entry.first; + return outTime; + } + + // (Inline) Validate a request that is about to be scheduled + virtual bool ValidateRequest( const sProtocolRequest & req ) + { + return req.IsValid(); + }; + + // Reschedule (or cleanup) the active request + void RescheduleActiveRequest(); + + // Process a single outgoing protocol request + void ProcessRequest(); + + // Check that system time hasn't moved backwards + bool CheckSystemTime(); + + // Perform protocol specific communications port initialization + virtual bool InitializeComm() = 0; + + // Perform protocol specific communications port cleanup + virtual bool CleanupComm() = 0; + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) = 0; + + // Decode incoming data into packets returning the last response + virtual bool DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ) = 0; + + // Handle completion of receive data operation + void RxComplete( + DWORD status, + DWORD bytesReceived ); + + // Handle the response timer expiring + void RxTimeout(); + + // Handle completion of transmit data operation + virtual void TxComplete(); + + // Handle a transmission error + void TxError(); + + /* Underlying communications object */ + cComm mComm; + + /* Rx callback */ + cProtocolServerRxCallback mRxCallback; + + /* ID of Schedule thread */ + pthread_t mScheduleThreadID; + + // ScheduleThread signal event + cEvent mThreadScheduleEvent; + + // Schedule mutex + // Ensures exclusive access to mRequestSchedule + pthread_mutex_t mScheduleMutex; + + // Is the thread in the process of exiting? + // (no new commands will be accepted) + bool mbExiting; + + /* Client/server thread control object */ + sSharedBuffer * mpServerControl; + + /* Protocol request schedule (scheduled time/request ID) */ + typedef std::pair tSchedule; + std::set < tSchedule, std::less > mRequestSchedule; + + /* Last system time value (used to check for time changes) */ + timespec mLastTime; + + /* Protocol request map (request ID mapped to internal req/rsp struct) */ + std::map mRequestMap; + + /* Last assigned request ID */ + ULONG mLastRequestID; + + /* Current request being processed */ + sProtocolReqRsp * mpActiveRequest; + + /* Absolute timeout for mpActiveRequest + based on when write was completed */ + timespec mActiveRequestTimeout; + + /* Data buffer for incoming data */ + BYTE * mpRxBuffer; + + /* Size of above buffer (i.e. how much data to read in at once) */ + ULONG mRxBufferSize; + + /* Protocol type for incoming/outgoing data*/ + eProtocolType mRxType; + eProtocolType mTxType; + + /* Protocol log */ + cProtocolLog mLog; + + // Get a lock on ScheduleMutex + bool GetScheduleMutex(); + + // Release lock on ScheduleMutex + // Signal ScheduleThread if desired + bool ReleaseScheduleMutex( bool bSignalThread = true ); + + // Schedule Thread gets full access + friend void * ScheduleThread( PVOID pArg ); + + // Callback objects get full access + friend class cProtocolServerRxCallback; +}; + diff --git a/gobi-api/GobiAPI_1.0.40/Core/QDLBuffers.cpp b/gobi-api/GobiAPI_1.0.40/Core/QDLBuffers.cpp new file mode 100755 index 0000000..c6e2010 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/QDLBuffers.cpp @@ -0,0 +1,1093 @@ +/*=========================================================================== +FILE: + QDLBuffers.cpp + +DESCRIPTION: + QDL protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQDLRawHelloReq + sQDLRawHelloRsp + sQDLRawErrorRsp + sQDLRawOpenUnframedReq + sQDLRawOpenUnframedRsp + sQDLRawWriteUnframedReq + sQDLRawWriteUnframedRsp + sQDLRawDoneRsp + sQDLRawGetImagePrefRsp + sQDLRawImageID + + sQDLHello + sQDLError + sQDLOpenUnframed + sQDLWriteUnframed + sQDLDone + sQDLGetImagePref + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QDLBuffers.h" +#include "CRC.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sQDLHello Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLHello (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLHello::sQDLHello( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLHello::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLHello (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLHello::~sQDLHello() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this hello request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLHello::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX && pt != ePROTOCOL_QDL_TX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szReq = (ULONG)sizeof(sQDLRawHelloReq); + const ULONG szRsp = (ULONG)sizeof(sQDLRawHelloRsp); + + if (pt == ePROTOCOL_QDL_TX && sz == szReq) + { + const sQDLRawHelloReq * pReq = (const sQDLRawHelloReq *)GetBuffer(); + if (pReq->mCommandCode != (BYTE)eQDL_CMD_HELLO_REQ) + { + return bRC; + } + + int notEqual = memcmp( (const void *)&pReq->mMagicNumber[0], + (const void *)&QDL_HELLO_MAGIC_REQ[0], + sizeof( QDL_HELLO_MAGIC_REQ ) ); + + if (notEqual != 0) + { + return bRC; + } + + bRC = true; + } + else if (pt == ePROTOCOL_QDL_RX && sz == szRsp) + { + const sQDLRawHelloRsp * pRsp = (const sQDLRawHelloRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_HELLO_RSP) + { + return bRC; + } + + int notEqual = memcmp( (const void *)&pRsp->mMagicNumber[0], + (const void *)&QDL_HELLO_MAGIC_RSP[0], + sizeof( QDL_HELLO_MAGIC_RSP ) ); + + if (notEqual != 0) + { + return bRC; + } + + if ( (pRsp->mMaxVersion != QDL_MIN_VERSION) + || (pRsp->mMinVersion != QDL_MAX_VERSION) ) + { + return bRC; + } + + if ( ((pRsp->mFeatures & QDL_FEATURE_GENERIC_UNFRAMED) == 0) + || ((pRsp->mFeatures & QDL_FEATURE_QDL_UNFRAMED) == 0) ) + { + return bRC; + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================== +METHOD: + GetBootVersionInfo (Internal Method) + +DESCRIPTION: + Extract boot downloader version info from the response + +PARAMETERS: + major [ O ] - Major version + minor [ O ] - Minor version + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLHello::GetBootVersionInfo( + ULONG & major, + ULONG & minor ) const +{ + // Assume failure + bool bRC = false; + + major = 0; + minor = 0; + + const sQDLRawHelloRsp * pRsp = GetResponse(); + if (pRsp == 0) + { + return bRC; + } + + major = (ULONG)pRsp->mBootMajorVersion; + minor = (ULONG)pRsp->mBootMinorVersion; + + bRC = true; + return bRC; +} + +/*=========================================================================== +METHOD: + BuildHelloReq (Static Public Method) + +DESCRIPTION: + Build a hello request + +PARAMETERS: + bBARMode [ O ] - Request boot and recovery mode feature + +RETURN VALUE: + sSharedBuffer * : The request in an allocated buffer (0 on error) +===========================================================================*/ +sSharedBuffer * sQDLHello::BuildHelloReq( bool bBARMode ) +{ + const ULONG sz = (ULONG)sizeof(sQDLRawHelloReq); + BYTE req[sz]; + + sQDLRawHelloReq * pReq = (sQDLRawHelloReq *)&req[0]; + + pReq->mCommandCode = (BYTE)eQDL_CMD_HELLO_REQ; + pReq->mMaxVersion = QDL_MIN_VERSION; + pReq->mMinVersion = QDL_MAX_VERSION; + pReq->mFeatures = QDL_FEATURE_GENERIC_UNFRAMED | QDL_FEATURE_QDL_UNFRAMED; + + if (bBARMode == true) + { + pReq->mFeatures |= QDL_FEATURE_BAR_MODE; + } + + memcpy( (PVOID)&pReq->mMagicNumber[0], + (const VOID *)&QDL_HELLO_MAGIC_REQ[0], + (SIZE_T)32 ); + + eProtocolType pt = ePROTOCOL_QDL_TX; + sSharedBuffer * pRetBuf = new sSharedBuffer( (const BYTE *)req, sz, pt ); + return pRetBuf; +} + +/*=========================================================================*/ +// sQDLError Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLError (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLError::sQDLError( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLError::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLError (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLError::~sQDLError() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this session done request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLError::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szRsp = (ULONG)sizeof( sQDLRawErrorRsp ); + + if (sz >= szRsp) + { + const sQDLRawErrorRsp * pRsp = 0; + pRsp = (const sQDLRawErrorRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_ERROR) + { + return bRC; + } + + // Error code needs to be valid + if (::IsValid( (eQDLError)pRsp->mErrorCode ) == false) + { + return bRC; + } + + // Error text needs to be NULL terminated + const BYTE * pTmp = GetBuffer(); + if (pTmp[sz - 1] != 0) + { + return bRC; + } + + // What there is of the error text needs to be printable + pTmp = &pRsp->mErrorText; + while (*pTmp != 0) + { + int val = (int)*pTmp++; + if (isprint( (int)val ) == 0) + { + return bRC; + } + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================*/ +// sQDLOpenUnframed Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLOpenUnframed (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLOpenUnframed::sQDLOpenUnframed( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLOpenUnframed::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLOpenUnframed (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLOpenUnframed::~sQDLOpenUnframed() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this open unframed request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLOpenUnframed::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX && pt != ePROTOCOL_QDL_TX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szReq = (ULONG)sizeof(sQDLRawOpenUnframedReq); + const ULONG szRsp = (ULONG)sizeof(sQDLRawOpenUnframedRsp); + + if (pt == ePROTOCOL_QDL_TX && sz == szReq) + { + const sQDLRawOpenUnframedReq * pReq = 0; + pReq = (const sQDLRawOpenUnframedReq *)GetBuffer(); + if (pReq->mCommandCode != (BYTE)eQDL_CMD_OPEN_UNFRAMED_REQ) + { + return bRC; + } + + if (::IsValid( (eQDLImageType)pReq->mImageType ) == false) + { + return bRC; + } + + if (pReq->mWindowSize != 1) + { + return bRC; + } + + bRC = true; + } + else if (pt == ePROTOCOL_QDL_RX && sz == szRsp) + { + const sQDLRawOpenUnframedRsp * pRsp = 0; + pRsp = (const sQDLRawOpenUnframedRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_OPEN_UNFRAMED_RSP) + { + return bRC; + } + + if (pRsp->mWindowSize != 1) + { + return bRC; + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================== +METHOD: + GetChunkSize (Internal Method) + +DESCRIPTION: + Extract chunk size info from the response + +PARAMETERS: + chunkSize [ O ] - Target supported chunk size + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLOpenUnframed::GetChunkSize( ULONG & chunkSize ) const +{ + // Assume failure + bool bRC = false; + + chunkSize = 0; + + const sQDLRawOpenUnframedRsp * pRsp = GetResponse(); + if (pRsp == 0) + { + return bRC; + } + + chunkSize = (ULONG)pRsp->mUnframedChunkSize; + + bRC = true; + return bRC; +} + +/*=========================================================================== +METHOD: + BuildOpenUnframedReq (Static Public Method) + +DESCRIPTION: + Build an open image for unframed write request + +PARAMETERS: + imageType [ I ] - Type of image about to be written + imageSize [ I ] - Size of image about to be written + chunkSize [ I ] - Desired size of chunk for each write + +RETURN VALUE: + sSharedBuffer * : The request in an allocated buffer (0 on error) +===========================================================================*/ +sSharedBuffer * sQDLOpenUnframed::BuildOpenUnframedReq( + eQDLImageType imageType, + ULONG imageSize, + ULONG chunkSize ) +{ + sSharedBuffer * pRetBuf = 0; + if (::IsValid( imageType ) == false) + { + return pRetBuf; + } + + // We can not write out chunks larger than the maximum + if (chunkSize > QDL_MAX_CHUNK_SIZE) + { + return pRetBuf; + } + + const ULONG sz = (ULONG)sizeof(sQDLRawOpenUnframedReq); + BYTE req[sz]; + + memset( (LPVOID)&req[0], 0, (SIZE_T)sz ); + + sQDLRawOpenUnframedReq * pReq = (sQDLRawOpenUnframedReq *)&req[0]; + + pReq->mCommandCode = (BYTE)eQDL_CMD_OPEN_UNFRAMED_REQ; + pReq->mImageType = (BYTE)imageType; + pReq->mImageLength = (DWORD)imageSize; + pReq->mWindowSize = 1; + pReq->mUnframedChunkSize = chunkSize; + + eProtocolType pt = ePROTOCOL_QDL_TX; + pRetBuf = new sSharedBuffer( (const BYTE *)req, sz, pt ); + return pRetBuf; +} + +/*=========================================================================*/ +// sQDLWriteUnframed Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLWriteUnframed (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLWriteUnframed::sQDLWriteUnframed( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLWriteUnframed::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLWriteUnframed (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLWriteUnframed::~sQDLWriteUnframed() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this unframed write request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLWriteUnframed::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX && pt != ePROTOCOL_QDL_TX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szReq = (ULONG)sizeof( sQDLRawWriteUnframedReq ); + const ULONG szRsp = (ULONG)sizeof( sQDLRawWriteUnframedRsp ); + + if (pt == ePROTOCOL_QDL_TX && sz == szReq) + { + const sQDLRawWriteUnframedReq * pReq = 0; + pReq = (const sQDLRawWriteUnframedReq *)GetBuffer(); + if (pReq->mCommandCode != (BYTE)eQDL_CMD_WRITE_UNFRAMED_REQ) + { + return bRC; + } + + bRC = CheckCRC( GetBuffer(), szReq - sizeof( USHORT ) ); + } + else if (pt == ePROTOCOL_QDL_RX && sz == szRsp) + { + const sQDLRawWriteUnframedRsp * pRsp = 0; + pRsp = (const sQDLRawWriteUnframedRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_WRITE_UNFRAMED_RSP) + { + return bRC; + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================== +METHOD: + GetSequenceNumber (Internal Method) + +DESCRIPTION: + Extract sequence number from the response + +PARAMETERS: + sequenceNumber [ O ] - Target reported sequence number + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLWriteUnframed::GetSequenceNumber( ULONG & sequenceNumber ) const +{ + // Assume failure + bool bRC = false; + + sequenceNumber = 0; + + const sQDLRawWriteUnframedRsp * pRsp = GetResponse(); + if (pRsp == 0) + { + return bRC; + } + + sequenceNumber = (ULONG)pRsp->mSequenceNumber; + + bRC = true; + return bRC; +} + +/*=========================================================================== +METHOD: + BuildWriteUnframedReq (Static Public Method) + +DESCRIPTION: + Build an unframed write request + +PARAMETERS: + sequenceNumber [ I ] - Type of image about to be written + chunkSize [ I ] - Size of chunk being written + +RETURN VALUE: + sSharedBuffer * : The request in an allocated buffer (0 on error) +===========================================================================*/ +sSharedBuffer * sQDLWriteUnframed::BuildWriteUnframedReq( + USHORT sequenceNumber, + ULONG chunkSize ) +{ + sSharedBuffer * pRetBuf = 0; + + // We can not write out chunks larger than the maximum + if (chunkSize == 0 || chunkSize > (ULONG)QDL_MAX_CHUNK_SIZE) + { + return pRetBuf; + } + + const ULONG sz = (ULONG)sizeof(sQDLRawWriteUnframedReq); + BYTE req[sz]; + + memset( (LPVOID)&req[0], 0, (SIZE_T)sz ); + + sQDLRawWriteUnframedReq * pReq = (sQDLRawWriteUnframedReq *)&req[0]; + + pReq->mCommandCode = (BYTE)eQDL_CMD_WRITE_UNFRAMED_REQ; + pReq->mSequenceNumber = (WORD)sequenceNumber; + pReq->mUnframedChunkSize = (DWORD)chunkSize; + SetCRC( req, sz - sizeof( USHORT ) ); + + eProtocolType pt = ePROTOCOL_QDL_TX; + pRetBuf = new sSharedBuffer( (const BYTE *)req, sz, pt ); + return pRetBuf; +} + +/*=========================================================================== +METHOD: + BuildWriteUnframedReqs (Static Public Method) + +DESCRIPTION: + Build list of unframed write requests from the given parameters + +PARAMETERS: + chunkSize [ I ] - Size to write in each request + dataLen [ I ] - Total number of bytes to write + +RETURN VALUE: + std::list : The requests in allocated buffers (the + list is empty on error) +===========================================================================*/ +std::list sQDLWriteUnframed::BuildWriteUnframedReqs( + ULONG chunkSize, + ULONG totalSize ) +{ + std::list retList; + + // Check length (in bytes) is acceptable + if (chunkSize == 0 || chunkSize > QDL_MAX_CHUNK_SIZE) + { + return retList; + } + + ULONG writes = 1; + ULONG rem = totalSize; + + // Will we need more than one write request? + if (totalSize > chunkSize) + { + writes = totalSize / chunkSize; + rem = totalSize % chunkSize; + + // Total size is a multiple of chunk size? + if (rem == 0) + { + // Yes, the remainder will be the block size + rem = chunkSize; + } + else + { + // No, we need an extra write for the remainder + writes++; + } + } + + ULONG blockSz = chunkSize; + if (writes == 1) + { + blockSz = rem; + } + + // Generate first request + USHORT seqNum = 0; + sSharedBuffer * pReq = 0; + pReq = sQDLWriteUnframed::BuildWriteUnframedReq( seqNum++, blockSz ); + if (pReq != 0) + { + retList.push_back( pReq ); + } + + // Generate remaining requests + for (UINT b = 1; b < writes; b++) + { + blockSz = chunkSize; + if (b == writes - 1) + { + blockSz = rem; + } + + pReq = sQDLWriteUnframed::BuildWriteUnframedReq( seqNum++, blockSz ); + if (pReq != 0) + { + retList.push_back( pReq ); + } + } + + // Errors? + if (retList.size() != writes) + { + // Free up all our hard work + std::list ::const_iterator pIter = retList.begin(); + while (pIter != retList.end()) + { + delete [] *pIter; + pIter++; + } + + retList.clear(); + } + + return retList; +} + +/*=========================================================================*/ +// sQDLDone Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLDone (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLDone::sQDLDone( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLDone::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLDone (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLDone::~sQDLDone() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this session done request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLDone::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX && pt != ePROTOCOL_QDL_TX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szReq = (ULONG)sizeof( BYTE ); + const ULONG szRsp = (ULONG)sizeof( sQDLRawDoneRsp ); + + if (pt == ePROTOCOL_QDL_TX && sz == szReq) + { + const BYTE * pReq = GetBuffer(); + if (*pReq != (BYTE)eQDL_CMD_SESSION_DONE_REQ) + { + return bRC; + } + + bRC = true; + } + else if (pt == ePROTOCOL_QDL_RX && sz >= szRsp) + { + const sQDLRawDoneRsp * pRsp = 0; + pRsp = (const sQDLRawDoneRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_SESSION_DONE_RSP) + { + return bRC; + } + + // Status needs to be valid + if (::IsValid( (eQDLDoneStatus)pRsp->mStatus ) == false) + { + return bRC; + } + + // For success the error text should be NULL + if ( (pRsp->mStatus == (WORD)eQDL_DONE_STATUS_SUCCESS) + && (sz != szRsp || pRsp->mErrorText != 0) ) + { + return bRC; + } + + if (pRsp->mStatus != (WORD)eQDL_DONE_STATUS_SUCCESS) + { + // Error text needs to be NULL terminated + const BYTE * pTmp = GetBuffer(); + if (pTmp[sz - 1] != 0) + { + return bRC; + } + + // What there is of the error text needs to be printable + pTmp = &pRsp->mErrorText; + while (*pTmp != 0) + { + int val = (int)*pTmp++; + if (isprint( (int)val ) == 0) + { + return bRC; + } + } + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================*/ +// sQDLGetImagePref Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLGetImagePref (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLGetImagePref::sQDLGetImagePref( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLGetImagePref::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLGetImagePref (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLGetImagePref::~sQDLGetImagePref() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this get image preference request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLGetImagePref::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX && pt != ePROTOCOL_QDL_TX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szReq = (ULONG)sizeof( BYTE ); + const ULONG szRsp = (ULONG)sizeof( sQDLRawGetImagePrefRsp ); + + if (pt == ePROTOCOL_QDL_TX && sz == szReq) + { + const BYTE * pReq = GetBuffer(); + if (*pReq != (BYTE)eQDL_CMD_GET_IMAGE_PREF_REQ) + { + return bRC; + } + + bRC = true; + } + else if (pt == ePROTOCOL_QDL_RX && sz >= szRsp) + { + const sQDLRawGetImagePrefRsp * pRsp = 0; + pRsp = (const sQDLRawGetImagePrefRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_GET_IMAGE_PREF_RSP) + { + return bRC; + } + + BYTE entries = pRsp->mEntries; + ULONG needSz = szRsp + (ULONG)entries * (ULONG)sizeof( sQDLRawImageID ); + if (sz != needSz) + { + return bRC; + } + + // Skip response header + pRsp++; + + // Validate image IDs + const sQDLRawImageID * pID = (const sQDLRawImageID *)pRsp; + for (BYTE e = 0; e < entries; e++) + { + sQDLRawImageID imagePref = *pID++; + if (::IsValid( (eQDLImageType)imagePref.mImageType) == false) + { + return bRC; + } + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================== +METHOD: + GetImageIDs (Public Method) + +DESCRIPTION: + Return image IDs + +RETURN VALUE: + std::list +===========================================================================*/ +std::list sQDLGetImagePref::GetImageIDs() const +{ + // Assume failure + std::list retIDs; + + const sQDLRawGetImagePrefRsp * pRsp = GetResponse(); + if (pRsp == 0) + { + return retIDs; + } + + BYTE entries = pRsp->mEntries; + if (entries == 0) + { + return retIDs; + } + + // Skip response header + pRsp++; + + const sQDLRawImageID * pID = (const sQDLRawImageID *)pRsp; + for (BYTE e = 0; e < entries; e++) + { + retIDs.push_back( *pID++ ); + } + + return retIDs; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/QDLBuffers.h b/gobi-api/GobiAPI_1.0.40/Core/QDLBuffers.h new file mode 100755 index 0000000..cf6f1af --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/QDLBuffers.h @@ -0,0 +1,716 @@ +/*=========================================================================== +FILE: + QDLBuffers.h + +DESCRIPTION: + QDL protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQDLRawHelloReq + sQDLRawHelloRsp + sQDLRawErrorRsp + sQDLRawOpenUnframedReq + sQDLRawOpenUnframedRsp + sQDLRawWriteUnframedReq + sQDLRawWriteUnframedRsp + sQDLRawDoneRsp + sQDLRawGetImagePrefRsp + sQDLRawImageID + + sQDLHello + sQDLError + sQDLOpenUnframed + sQDLWriteUnframed + sQDLDone + sQDLGetImagePref + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "QDLEnum.h" + +#include + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sQDLRawHelloReq +// Struct to represent a QDL hello request (raw) +/*=========================================================================*/ +struct sQDLRawHelloReq +{ + public: + BYTE mCommandCode; + BYTE mMagicNumber[32]; + BYTE mMaxVersion; + BYTE mMinVersion; + BYTE mFeatures; +}; + +/*=========================================================================*/ +// Struct sQDLRawHelloRsp +// Struct to represent a QDL hello response (raw) +/*=========================================================================*/ +struct sQDLRawHelloRsp +{ + public: + BYTE mCommandCode; + BYTE mMagicNumber[24]; + DWORD mReserved1; + WORD mBootMajorVersion; + WORD mBootMinorVersion; + BYTE mMaxVersion; + BYTE mMinVersion; + DWORD mReserved2; + DWORD mReserved3; + BYTE mReserved4; + WORD mReserved5; + WORD mReserved6; + BYTE mFeatures; +}; + +/*=========================================================================*/ +// Struct sQDLRawErrorRsp +// Struct to represent a QDL error response (raw) +/*=========================================================================*/ +struct sQDLRawErrorRsp +{ + public: + BYTE mCommandCode; + DWORD mErrorCode; + BYTE mErrorText; +}; + +/*=========================================================================*/ +// Struct sQDLRawOpenUnframedReq +// Struct to represent a QDL open unframed image write request (raw) +/*=========================================================================*/ +struct sQDLRawOpenUnframedReq +{ + public: + BYTE mCommandCode; + BYTE mImageType; + DWORD mImageLength; + BYTE mWindowSize; + DWORD mUnframedChunkSize; + WORD mReserved1; +}; + +/*=========================================================================*/ +// Struct sQDLRawOpenUnframedRsp +// Struct to represent a QDL open unframed image write response (raw) +/*=========================================================================*/ +struct sQDLRawOpenUnframedRsp +{ + public: + BYTE mCommandCode; + WORD mStatus; + BYTE mWindowSize; + DWORD mUnframedChunkSize; +}; + +/*=========================================================================*/ +// Struct sQDLRawWriteUnframedReq +// Struct to represent a QDL unframed image write request (raw) +/*=========================================================================*/ +struct sQDLRawWriteUnframedReq +{ + public: + BYTE mCommandCode; + WORD mSequenceNumber; + DWORD mReserved; + DWORD mUnframedChunkSize; + WORD mCRC; +}; + +/*=========================================================================*/ +// Struct sQDLRawWriteUnframedRsp +// Struct to represent a QDL unframed image write response (raw) +/*=========================================================================*/ +struct sQDLRawWriteUnframedRsp +{ + public: + BYTE mCommandCode; + WORD mSequenceNumber; + DWORD mReserved; + WORD mStatus; +}; + +/*=========================================================================*/ +// Struct sQDLRawDoneRsp +// Struct to represent a QDL session done response (raw) +/*=========================================================================*/ +struct sQDLRawDoneRsp +{ + public: + BYTE mCommandCode; + WORD mStatus; + BYTE mImageType; + BYTE mErrorText; +}; + +/*=========================================================================*/ +// Struct sQDLRawGetImagePrefRsp +// Struct to represent a QDL get image preference response (raw) +/*=========================================================================*/ +struct sQDLRawGetImagePrefRsp +{ + public: + BYTE mCommandCode; + BYTE mEntries; + + // Array of sQDLRawImageID follows (sized by mEntries) +}; + +/*=========================================================================*/ +// Struct sQDLRawImageID +// Struct to represent a QDL image ID (raw) +/*=========================================================================*/ +struct sQDLRawImageID +{ + public: + BYTE mImageType; + BYTE mImageID[16]; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + + +/*=========================================================================*/ +// Struct sQDLHello +// Struct to represent a QDL hello request/response (shared buffer) +/*=========================================================================*/ +struct sQDLHello : public sProtocolBuffer +{ + public: + // Constructor + sQDLHello( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLHello(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bRequest = (pBuf[0] == (BYTE)eQDL_CMD_HELLO_REQ); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bResponse = (pBuf[0] == (BYTE)eQDL_CMD_HELLO_RSP); + } + + return bResponse; + }; + + // (Inline) Return raw request + const sQDLRawHelloReq * GetRequest() const + { + const sQDLRawHelloReq * pReq = 0; + if (IsRequest() == true) + { + pReq = (const sQDLRawHelloReq *)GetBuffer(); + } + + return pReq; + }; + + // (Inline) Return raw response + const sQDLRawHelloRsp * GetResponse() const + { + const sQDLRawHelloRsp * pRsp = 0; + if (IsResponse() == true) + { + pRsp = (const sQDLRawHelloRsp *)GetBuffer(); + } + + return pRsp; + }; + + // Extract boot downloader version info from the response + bool GetBootVersionInfo( + ULONG & major, + ULONG & minor ) const; + + // Build a hello request + static sSharedBuffer * BuildHelloReq( bool bBARMode = false ); + + protected: + // Is this hello request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLHello( const sProtocolBuffer & ); + sQDLHello & operator = ( const sProtocolBuffer & ); +}; + +/*=========================================================================*/ +// Struct sQDLError +// Struct to represent a QDL error response (shared buffer) +/*=========================================================================*/ +struct sQDLError : public sProtocolBuffer +{ + public: + // Constructor + sQDLError( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLError(); + + // (Inline) Return raw response + const sQDLRawErrorRsp * GetResponse() const + { + const sQDLRawErrorRsp * pRsp = 0; + if (IsValid() == true) + { + pRsp = (const sQDLRawErrorRsp *)GetBuffer(); + } + + return pRsp; + }; + + // (Inline) Return the (validated) error code + eQDLError GetErrorCode() const + { + eQDLError err = eQDL_ERROR_ENUM_BEGIN; + + const sQDLRawErrorRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + err = (eQDLError)pRsp->mErrorCode; + } + + return err; + }; + + // (Inline) Return the error text string + LPCSTR GetError() const + { + LPCSTR pErr = 0; + + const sQDLRawErrorRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + pErr = (LPCSTR)&pRsp->mErrorText; + } + + return pErr; + }; + + protected: + // Is this session done request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLError( const sProtocolBuffer & ); + sQDLError & operator = ( const sProtocolBuffer & ); +}; + +/*=========================================================================*/ +// Struct sQDLOpenUnframed +// Struct to represent a QDL open image for unframed write +// request/response (shared buffer) +/*=========================================================================*/ +struct sQDLOpenUnframed : public sProtocolBuffer +{ + public: + // Constructor + sQDLOpenUnframed( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLOpenUnframed(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bRequest = (pBuf[0] == (BYTE)eQDL_CMD_OPEN_UNFRAMED_REQ); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bResponse = (pBuf[0] == (BYTE)eQDL_CMD_OPEN_UNFRAMED_RSP); + } + + return bResponse; + }; + + // (Inline) Return raw request + const sQDLRawOpenUnframedReq * GetRequest() const + { + const sQDLRawOpenUnframedReq * pReq = 0; + if (IsRequest() == true) + { + pReq = (const sQDLRawOpenUnframedReq *)GetBuffer(); + } + + return pReq; + }; + + // (Inline) Return raw response + const sQDLRawOpenUnframedRsp * GetResponse() const + { + const sQDLRawOpenUnframedRsp * pRsp = 0; + if (IsResponse() == true) + { + pRsp = (const sQDLRawOpenUnframedRsp *)GetBuffer(); + } + + return pRsp; + }; + + // (Inline) Does the response indicate success? + bool IsSuccess() const + { + bool bSuccess = false; + + const sQDLRawOpenUnframedRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + bSuccess = (pRsp->mStatus == eQDL_OPEN_STATUS_SUCCESS); + } + + return bSuccess; + }; + + // Extract supported chunk size from the response + bool GetChunkSize( ULONG & chunkSize ) const; + + // Build an open image for unframed write request + static sSharedBuffer * BuildOpenUnframedReq( + eQDLImageType imageType, + ULONG imageSize, + ULONG chunkSize ); + + protected: + // Is this open unframed request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLOpenUnframed( const sProtocolBuffer & ); + sQDLOpenUnframed & operator = ( const sProtocolBuffer & ); +}; + +/*=========================================================================*/ +// Struct sQDLWriteUnframed +// Struct to represent a QDL unframed write of an image +// request/response (shared buffer) +/*=========================================================================*/ +struct sQDLWriteUnframed : public sProtocolBuffer +{ + public: + // Constructor + sQDLWriteUnframed( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLWriteUnframed(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bRequest = (pBuf[0] == (BYTE)eQDL_CMD_WRITE_UNFRAMED_REQ); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bResponse = (pBuf[0] == (BYTE)eQDL_CMD_WRITE_UNFRAMED_RSP); + } + + return bResponse; + }; + + // (Inline) Return raw request + const sQDLRawWriteUnframedReq * GetRequest() const + { + const sQDLRawWriteUnframedReq * pReq = 0; + if (IsRequest() == true) + { + pReq = (const sQDLRawWriteUnframedReq *)GetBuffer(); + } + + return pReq; + }; + + // (Inline) Return raw response + const sQDLRawWriteUnframedRsp * GetResponse() const + { + const sQDLRawWriteUnframedRsp * pRsp = 0; + if (IsResponse() == true) + { + pRsp = (const sQDLRawWriteUnframedRsp *)GetBuffer(); + } + + return pRsp; + }; + + // (Inline) Does the response indicate success? + bool IsSuccess() const + { + bool bSuccess = false; + + const sQDLRawWriteUnframedRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + bSuccess = (pRsp->mStatus == eQDL_WRITE_STATUS_SUCCESS); + } + + return bSuccess; + }; + + // Extract sequence number from the response + bool GetSequenceNumber( ULONG & sequenceNumber ) const; + + // Build an unframed write request + static sSharedBuffer * BuildWriteUnframedReq( + USHORT sequenceNumber, + ULONG chunkSize ); + + // Build unframed write requests for the specified parameters + static std::list BuildWriteUnframedReqs( + ULONG chunkSize, + ULONG totalSize ); + + protected: + // Is this open unframed request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLWriteUnframed( const sProtocolBuffer & ); + sQDLWriteUnframed & operator = ( const sProtocolBuffer & ); +}; + +/*=========================================================================*/ +// Struct sQDLDone +// Struct to represent a QDL session done request/response (shared buffer) +/*=========================================================================*/ +struct sQDLDone : public sProtocolBuffer +{ + public: + // Constructor + sQDLDone( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLDone(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bRequest = (pBuf[0] == (BYTE)eQDL_CMD_SESSION_DONE_REQ); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bResponse = (pBuf[0] == (BYTE)eQDL_CMD_SESSION_DONE_RSP); + } + + return bResponse; + }; + + // (Inline) Return raw response + const sQDLRawDoneRsp * GetResponse() const + { + const sQDLRawDoneRsp * pRsp = 0; + if (IsResponse() == true) + { + pRsp = (const sQDLRawDoneRsp *)GetBuffer(); + } + + return pRsp; + }; + + // (Inline) Does the response indicate success? + bool IsSuccess() const + { + bool bSuccess = false; + + const sQDLRawDoneRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + bSuccess = (pRsp->mStatus == eQDL_DONE_STATUS_SUCCESS); + } + + return bSuccess; + }; + + // (Inline) Return the error text string + LPCSTR GetError() const + { + LPCSTR pErr = 0; + + const sQDLRawDoneRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + if (pRsp->mStatus != eQDL_DONE_STATUS_SUCCESS) + { + pErr = (LPCSTR)&pRsp->mErrorText; + } + } + + return pErr; + }; + + protected: + // Is this session done request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLDone( const sProtocolBuffer & ); + sQDLDone & operator = ( const sProtocolBuffer & ); +}; + +/*=========================================================================*/ +// Struct sQDLGetImagePref +// Struct to represent a QDL get image preference +// request/response (shared buffer) +/*=========================================================================*/ +struct sQDLGetImagePref : public sProtocolBuffer +{ + public: + // Constructor + sQDLGetImagePref( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLGetImagePref(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bRequest = (pBuf[0] == (BYTE)eQDL_CMD_GET_IMAGE_PREF_REQ); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bResponse = (pBuf[0] == (BYTE)eQDL_CMD_GET_IMAGE_PREF_RSP); + } + + return bResponse; + }; + + // (Inline) Return raw response + const sQDLRawGetImagePrefRsp * GetResponse() const + { + const sQDLRawGetImagePrefRsp * pRsp = 0; + if (IsResponse() == true) + { + pRsp = (const sQDLRawGetImagePrefRsp *)GetBuffer(); + } + + return pRsp; + }; + + // Return image IDs + std::list GetImageIDs() const; + + protected: + // Is this get image preference request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLGetImagePref( const sProtocolBuffer & ); + sQDLGetImagePref & operator = ( const sProtocolBuffer & ); +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/QDLEnum.h b/gobi-api/GobiAPI_1.0.40/Core/QDLEnum.h new file mode 100755 index 0000000..f53b19e --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/QDLEnum.h @@ -0,0 +1,428 @@ +/*=========================================================================== +FILE: + QDLEnum.h + +DESCRIPTION: + QDL protocol enumerations and related methods + +PUBLIC ENUMERATIONS AND METHODS: + eQDLCommand + eQDLError + eQDLImageType + eQDLOpenStatus + eQDLWriteStatus + eQDLDoneStatus + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// QDL feature bits +const BYTE QDL_FEATURE_GENERIC_UNFRAMED = 0x10; +const BYTE QDL_FEATURE_QDL_UNFRAMED = 0x20; +const BYTE QDL_FEATURE_BAR_MODE = 0x40; + +// QDL protocol version +const BYTE QDL_MIN_VERSION = 6; +const BYTE QDL_MAX_VERSION = 6; + +const BYTE QDL_HELLO_MAGIC_REQ[32] = +{ + 'Q', + 'C', + 'O', + 'M', + ' ', + 'h', + 'i', + 'g', + 'h', + ' ', + 's', + 'p', + 'e', + 'e', + 'd', + ' ', + 'p', + 'r', + 'o', + 't', + 'o', + 'c', + 'o', + 'l', + ' ', + 'h', + 's', + 't', + 0, + 0, + 0, + 0 +}; + +const BYTE QDL_HELLO_MAGIC_RSP[24] = +{ + 'Q', + 'C', + 'O', + 'M', + ' ', + 'h', + 'i', + 'g', + 'h', + ' ', + 's', + 'p', + 'e', + 'e', + 'd', + ' ', + 'p', + 'r', + 'o', + 't', + 'o', + 'c', + 'o', + 'l' +}; + +// QDL maximum chunk size we support +const ULONG QDL_MAX_CHUNK_SIZE = 1024 * 1024 * 64; + +/*=========================================================================*/ +// eQDLCommand Enumeration +// QDL Command Code Enumeration +/*=========================================================================*/ +enum eQDLCommand +{ + eQDL_CMD_ENUM_BEGIN = -1, + + eQDL_CMD_HELLO_REQ = 1, // 001 Hello request + eQDL_CMD_HELLO_RSP, // 002 Hello response + + eQDL_CMD_ERROR = 13, // 013 Error report + + eQDL_CMD_OPEN_UNFRAMED_REQ = 37, // 037 Open unframed image write request + eQDL_CMD_OPEN_UNFRAMED_RSP, // 038 Open unframed image write response + eQDL_CMD_WRITE_UNFRAMED_REQ, // 039 Unframed image write request + eQDL_CMD_WRITE_UNFRAMED_RSP, // 040 Unframed image write response + eQDL_CMD_SESSION_DONE_REQ, // 041 Unframed session done request + eQDL_CMD_SESSION_DONE_RSP, // 042 Unframed session done response + eQDL_CMD_DOWNLOAD_REQ, // 043 Switch to download protocol request + + eQDL_CMD_SESSION_CLOSE_REQ = 45, // 045 Close unframed session request + eQDL_CMD_GET_IMAGE_PREF_REQ, // 046 Get image preference request + eQDL_CMD_GET_IMAGE_PREF_RSP, // 047 Get image preference response + + eQDL_CMD_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLCommand validity check + +PARAMETERS: + cmd [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLCommand cmd ) +{ + bool retVal = false; + + switch (cmd) + { + case eQDL_CMD_HELLO_REQ: + case eQDL_CMD_HELLO_RSP: + case eQDL_CMD_ERROR: + case eQDL_CMD_OPEN_UNFRAMED_REQ: + case eQDL_CMD_OPEN_UNFRAMED_RSP: + case eQDL_CMD_WRITE_UNFRAMED_REQ: + case eQDL_CMD_WRITE_UNFRAMED_RSP: + case eQDL_CMD_SESSION_DONE_REQ: + case eQDL_CMD_SESSION_DONE_RSP: + case eQDL_CMD_DOWNLOAD_REQ: + case eQDL_CMD_SESSION_CLOSE_REQ: + case eQDL_CMD_GET_IMAGE_PREF_REQ: + case eQDL_CMD_GET_IMAGE_PREF_RSP: + retVal = true; + break; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQDLError Enumeration +// QDL Error Enumeration +/*=========================================================================*/ +enum eQDLError +{ + eQDL_ERROR_ENUM_BEGIN = 0, + + eQDL_ERROR_01, // 01 Reserved + eQDL_ERROR_BAD_ADDR, // 02 Invalid destination address + eQDL_ERROR_BAD_LEN, // 03 Invalid length + eQDL_ERROR_BAD_PACKET, // 04 Unexpected end of packet + eQDL_ERROR_BAD_CMD, // 05 Invalid command + eQDL_ERROR_06, // 06 Reserved + eQDL_ERROR_OP_FAILED, // 07 Operation failed + eQDL_ERROR_BAD_FLASH_ID, // 08 Invalid flash intelligent ID + eQDL_ERROR_BAD_VOLTAGE, // 09 Invalid programming voltage + eQDL_ERROR_WRITE_FAILED, // 10 Write verify failed + eQDL_ERROR_11, // 11 Reserved + eQDL_ERROR_BAD_SPC, // 12 Invalid security code + eQDL_ERROR_POWERDOWN, // 13 Power-down failed + eQDL_ERROR_UNSUPPORTED, // 14 NAND flash programming not supported + eQDL_ERROR_CMD_SEQ, // 15 Command out of sequence + eQDL_ERROR_CLOSE, // 16 Close failed + eQDL_ERROR_BAD_FEATURES, // 17 Invalid feature bits + eQDL_ERROR_SPACE, // 18 Out of space + eQDL_ERROR_BAD_SECURITY, // 19 Invalid security mode + eQDL_ERROR_MULTI_UNSUPPORTED, // 20 Multi-image NAND not supported + eQDL_ERROR_POWEROFF, // 21 Power-off command not supported + eQDL_ERROR_CMD_UNSUPPORTED, // 22 Command not supported + eQDL_ERROR_BAD_CRC, // 23 Invalid CRC + eQDL_ERROR_STATE, // 24 Command received in invalid state + eQDL_ERROR_TIMEOUT, // 25 Receive timeout + eQDL_ERROR_IMAGE_AUTH, // 26 Image authentication error + + eQDL_ERROR_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLError validity check + +PARAMETERS: + err [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLError err ) +{ + bool retVal = false; + if (err > eQDL_ERROR_ENUM_BEGIN && err < eQDL_ERROR_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQDLImageType Enumeration +// QDL Download Image Type Enumeration +/*=========================================================================*/ +enum eQDLImageType +{ + eQDL_IMAGE_ENUM_BEGIN = -1, + + eQDL_IMAGE_AMSS_MODEM = 5, // 05 AMSS modem image + eQDL_IMAGE_AMSS_APPLICATION, // 06 AMSS application image + + eQDL_IMAGE_AMSS_UQCN = 13, // 13 Provisioning information + + eQDL_IMAGE_DBL = 15, // 15 DBL image + eQDL_IMAGE_OSBL, // 16 OSBL image + + eQDL_IMAGE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLImageType validity check + +PARAMETERS: + it [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLImageType it ) +{ + bool retVal = false; + + switch (it) + { + case eQDL_IMAGE_AMSS_MODEM: + case eQDL_IMAGE_AMSS_APPLICATION: + case eQDL_IMAGE_AMSS_UQCN: + case eQDL_IMAGE_DBL: + case eQDL_IMAGE_OSBL: + retVal = true; + break; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQDLOpenStatus Enumeration +// QDL Unframed Open Status Enumeration +/*=========================================================================*/ +enum eQDLOpenStatus +{ + eQDL_OPEN_STATUS_ENUM_BEGIN = -1, + + eQDL_OPEN_STATUS_SUCCESS, // 00 Success + eQDL_OPEN_STATUS_SIZE, // 01 Reported image size error + eQDL_OPEN_STATUS_BAD_TYPE, // 02 Invalid image type for downloader + eQDL_OPEN_STATUS_HDR_SIZE, // 03 Reported image header size error + eQDL_OPEN_STATUS_HDR1, // 04 Image header incorrectly present + eQDL_OPEN_STATUS_HDR2, // 05 Image header required + eQDL_OPEN_STATUS_PROTECTION, // 06 Memory block protection error + eQDL_OPEN_STATUS_NOT_NEEDED, // 07 Image type not required + + eQDL_OPEN_STATUS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLOpenStatus validity check + +PARAMETERS: + os [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLOpenStatus os ) +{ + bool retVal = false; + if (os > eQDL_OPEN_STATUS_ENUM_BEGIN && os < eQDL_OPEN_STATUS_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQDLWriteStatus Enumeration +// QDL Unframed Write Status Enumeration +/*=========================================================================*/ +enum eQDLWriteStatus +{ + eQDL_WRITE_STATUS_ENUM_BEGIN = -1, + + eQDL_WRITE_STATUS_SUCCESS, // 00 Success + eQDL_WRITE_STATUS_CRC, // 01 Error with CRC + eQDL_WRITE_STATUS_CONTENT, // 02 Error with chunk content + + eQDL_WRITE_STATUS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLWriteStatus validity check + +PARAMETERS: + ws [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLWriteStatus ws ) +{ + bool retVal = false; + if (ws > eQDL_WRITE_STATUS_ENUM_BEGIN && ws < eQDL_WRITE_STATUS_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQDLDoneStatus Enumeration +// QDL Done Status Enumeration +/*=========================================================================*/ +enum eQDLDoneStatus +{ + eQDL_DONE_STATUS_ENUM_BEGIN = -1, + + eQDL_DONE_STATUS_SUCCESS, // 00 Success + eQDL_DONE_STATUS_AUTH, // 01 Authentication failure + eQDL_DONE_STATUS_WRITE, // 02 Write failure + + eQDL_DONE_STATUS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLDoneStatus validity check + +PARAMETERS: + ds [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLDoneStatus ds ) +{ + bool retVal = false; + if (ds > eQDL_DONE_STATUS_ENUM_BEGIN && ds < eQDL_DONE_STATUS_ENUM_END) + { + retVal = true; + } + + return retVal; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/QDLProtocolServer.cpp b/gobi-api/GobiAPI_1.0.40/Core/QDLProtocolServer.cpp new file mode 100755 index 0000000..9568b1a --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/QDLProtocolServer.cpp @@ -0,0 +1,269 @@ +/*=========================================================================== +FILE: + QDLProtocolServer.cpp + +DESCRIPTION: + QDL protocol packet server + +PUBLIC CLASSES AND METHODS: + cQDLProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QDLProtocolServer.h" +#include "QDLEnum.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cQDLProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cQDLProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + bufferSzRx [ I ] - Size of data buffer for incoming data + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQDLProtocolServer::cQDLProtocolServer( + ULONG bufferSzRx, + ULONG logSz ) + : cHDLCProtocolServer( ePROTOCOL_QDL_RX, + ePROTOCOL_QDL_TX, + bufferSzRx, + logSz ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cQDLProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (destroys sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQDLProtocolServer::~cQDLProtocolServer() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + EncodeTxData (Internal Method) + +DESCRIPTION: + Encode data for transmission + +PARAMETERS: + pBuffer [ I ] - Data to be encoded + bEncoded [ O ] - Do we even encoded data? + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + sSharedBuffer * - Encoded data (0 upon error when encoding is indicated) +===========================================================================*/ +sSharedBuffer * cQDLProtocolServer::EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) +{ + // We encoded data + bEncoded = true; + if (pBuffer != 0 && pBuffer->IsValid() == true) + { + const BYTE * pReqBuf = mpActiveRequest->mRequest.GetBuffer(); + + eQDLCommand reqCmd = (eQDLCommand)pReqBuf[0]; + if (reqCmd == eQDL_CMD_WRITE_UNFRAMED_REQ) + { + // The write request is not HDLC encoded + bEncoded = false; + } + } + + if (bEncoded == true) + { + // Base class can handle HDLC encoding + return cHDLCProtocolServer::EncodeTxData( pBuffer, bEncoded ); + } + + return 0; +} + +/*=========================================================================== +METHOD: + IsResponse (Internal Method) + +DESCRIPTION: + Is the passed in data a response to the current request? + +PARAMETERS: + rsp [ I ] - Candidate response + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQDLProtocolServer::IsResponse( const sProtocolBuffer & rsp ) +{ + // Assume not + bool bRC = false; + if ( (mpActiveRequest == 0) + || (mpActiveRequest->mRequest.IsValid() == false) + || (mpActiveRequest->mbWaitingForResponse == false) + || (rsp.IsValid() == false) ) + { + return bRC; + } + + const BYTE * pReqBuf = mpActiveRequest->mRequest.GetBuffer(); + const BYTE * pRspBuf = rsp.GetBuffer(); + + eQDLCommand reqCmd = (eQDLCommand)pReqBuf[0]; + eQDLCommand rspCmd = (eQDLCommand)pRspBuf[0]; + + switch (reqCmd) + { + case eQDL_CMD_HELLO_REQ: + if ( (rspCmd == eQDL_CMD_HELLO_RSP) + || (rspCmd == eQDL_CMD_ERROR) ) + { + bRC = true; + } + break; + + case eQDL_CMD_OPEN_UNFRAMED_REQ: + if ( (rspCmd == eQDL_CMD_OPEN_UNFRAMED_RSP) + || (rspCmd == eQDL_CMD_ERROR) ) + { + bRC = true; + } + break; + + case eQDL_CMD_WRITE_UNFRAMED_REQ: + if ( (rspCmd == eQDL_CMD_WRITE_UNFRAMED_RSP) + || (rspCmd == eQDL_CMD_ERROR) ) + { + bRC = true; + } + break; + + case eQDL_CMD_SESSION_DONE_REQ: + if ( (rspCmd == eQDL_CMD_SESSION_DONE_RSP) + || (rspCmd == eQDL_CMD_ERROR) ) + { + bRC = true; + } + break; + + case eQDL_CMD_DOWNLOAD_REQ: + case eQDL_CMD_SESSION_CLOSE_REQ: + if (rspCmd == eQDL_CMD_ERROR) + { + bRC = true; + } + break; + + case eQDL_CMD_GET_IMAGE_PREF_REQ: + if ( (rspCmd == eQDL_CMD_GET_IMAGE_PREF_RSP) + || (rspCmd == eQDL_CMD_ERROR) ) + { + bRC = true; + } + break; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsTxAbortResponse (Internal Method) + +DESCRIPTION: + Is the passed in data a response that aborts the current request? + +PARAMETERS: + rsp [ I ] - Candidate response + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQDLProtocolServer::IsTxAbortResponse( const sProtocolBuffer & rsp ) +{ + // Assume not + bool bRC = false; + if ( (mpActiveRequest == 0) + || (mpActiveRequest->mRequest.IsValid() == false) + || (mpActiveRequest->mbWaitingForResponse == true) + || (rsp.IsValid() == false) ) + { + return bRC; + } + + // If we are in the middle of a transmission an we receive an error + // packet then we abort + const BYTE * pRspBuf = rsp.GetBuffer(); + eQDLCommand rspCmd = (eQDLCommand)pRspBuf[0]; + if (rspCmd == eQDL_CMD_ERROR) + { + bRC = true; + } + + return bRC; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/QDLProtocolServer.h b/gobi-api/GobiAPI_1.0.40/Core/QDLProtocolServer.h new file mode 100755 index 0000000..f86c6fe --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/QDLProtocolServer.h @@ -0,0 +1,77 @@ +/*=========================================================================== +FILE: + QDLProtocolServer.h + +DESCRIPTION: + QDL protocol packet server + +PUBLIC CLASSES AND METHODS: + cQDLProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "HDLCProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cQDLProtocolServer +/*=========================================================================*/ +class cQDLProtocolServer : public cHDLCProtocolServer +{ + public: + // Constructor + cQDLProtocolServer( + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cQDLProtocolServer(); + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ); + + // Is the passed in data a response to the current request? + virtual bool IsResponse( const sProtocolBuffer & rsp ); + + // Is the passed in data a response that aborts the current request? + virtual bool IsTxAbortResponse( const sProtocolBuffer & rsp ); +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/QMIBuffers.cpp b/gobi-api/GobiAPI_1.0.40/Core/QMIBuffers.cpp new file mode 100755 index 0000000..154617b --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/QMIBuffers.cpp @@ -0,0 +1,366 @@ +/*=========================================================================== +FILE: + QMIBuffers.cpp + +DESCRIPTION: + QMI service protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQMIControlRawTransactionHeader + sQMIServiceRawTransactionHeader + sQMIRawMessageHeader + sQMIRawContentHeader + + sQMIServiceBuffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sQMIServiceBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQMIServiceBuffer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the DIAG data + +RETURN VALUE: + None +===========================================================================*/ +sQMIServiceBuffer::sQMIServiceBuffer( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQMIServiceBuffer::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQMIServiceBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQMIServiceBuffer::~sQMIServiceBuffer() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + GetResult (Public Method) + +DESCRIPTION: + Return contents of mandatory result content + +PARAMETERS: + returnCode [ I ] - The return code (should be eQMIResultCode) + errorCode [ I ] - The error code (should be eQMIErrorCode) + +RETURN VALUE: + bool +===========================================================================*/ +bool sQMIServiceBuffer::GetResult( + ULONG & returnCode, + ULONG & errorCode ) +{ + if (IsResponse() == false) + { + return false; + } + + std::map ::const_iterator pIter; + pIter = mContents.find( QMI_TLV_ID_RESULT ); + if (pIter == mContents.end()) + { + return false; + } + + const sQMIRawContentHeader * pContent = pIter->second; + if (pContent == 0) + { + ASSERT( 0 ); + return false; + } + + if (pContent->mLength != 4) + { + return false; + } + + const WORD * pData = (const WORD *)(++pContent); + + returnCode = (ULONG)*pData++; + errorCode = (ULONG)*pData; + + return true; +} + +/*=========================================================================== +METHOD: + BuildBuffer (Static Public Method) + +DESCRIPTION: + Build a QMI request + +PARAMETERS: + serviceType [ I ] - QMI service type + msgID [ I ] - The QMI message request ID + bResponse [ I ] - Build a response? + bIndication [ I ] - Build an indication? + pPayload [ I ] - Payload + payloadLen [ I ] - Size of above payload + +RETURN VALUE: + sSharedBuffer * : The request in an allocated buffer (0 on error) +===========================================================================*/ +sSharedBuffer * sQMIServiceBuffer::BuildBuffer( + eQMIService serviceType, + WORD msgID, + bool bResponse, + bool bIndication, + const BYTE * pPayload, + ULONG payloadLen ) +{ + const ULONG szTransHdr = (ULONG)sizeof(sQMIServiceRawTransactionHeader); + const ULONG szMsgHdr = (ULONG)sizeof(sQMIRawMessageHeader); + const ULONG totalHdrSz = szTransHdr + szMsgHdr; + + // Truncate payload? + if (payloadLen > (QMI_MAX_BUFFER_SIZE - totalHdrSz)) + { + payloadLen = QMI_MAX_BUFFER_SIZE - totalHdrSz; + } + + // Make sure length agrees with pointer + if (pPayload == 0) + { + payloadLen = 0; + } + + // Allocate buffer + PBYTE pBuffer = new BYTE[payloadLen + totalHdrSz]; + if (pBuffer == 0) + { + return 0; + } + + // Format header + sQMIServiceRawTransactionHeader * pHdr = 0; + pHdr = (sQMIServiceRawTransactionHeader *)&pBuffer[0]; + pHdr->mCompound = 0; + pHdr->mResponse = 0; + pHdr->mIndication = 0; + pHdr->mReserved = 0; + pHdr->mTransactionID = 1; + + bool bTX = true; + if (bResponse == true) + { + pHdr->mResponse = 1; + bTX = false; + } + else if (bIndication == true) + { + pHdr->mIndication = 1; + bTX = false; + } + + pHdr++; + + // Format message header + sQMIRawMessageHeader * pMsg = 0; + pMsg = (sQMIRawMessageHeader *)pHdr; + pMsg->mMessageID = msgID; + pMsg->mLength = (WORD)payloadLen; + + // Copy in payload? + if (payloadLen > 0 && pPayload != 0) + { + memcpy( (LPVOID)&pBuffer[totalHdrSz], + (LPCVOID)&pPayload[0], + (SIZE_T)payloadLen ); + } + + // Compute total size + ULONG sz = payloadLen + totalHdrSz; + + // Build and return the shared buffer + eProtocolType pt = MapQMIServiceToProtocol( serviceType, bTX ); + sSharedBuffer * pBuf = new sSharedBuffer( sz, pBuffer, pt ); + return pBuf; +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this open unframed request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQMIServiceBuffer::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (IsQMIProtocol( pt ) == false) + { + mbValid = bRC; + return bRC; + } + + const ULONG szTransHdr = (ULONG)sizeof(sQMIServiceRawTransactionHeader); + const ULONG szMsgHdr = (ULONG)sizeof(sQMIRawMessageHeader); + const ULONG szContentHdr = (ULONG)sizeof(sQMIRawContentHeader); + + // Must be enough space for both headers + ULONG sz = GetSize(); + if (sz < szTransHdr + szMsgHdr) + { + mbValid = bRC; + return bRC; + } + + const BYTE * pBuffer = GetBuffer(); + + // Obtain transaction header + const sQMIServiceRawTransactionHeader * pTransHdr = 0; + pTransHdr = (const sQMIServiceRawTransactionHeader *)pBuffer; + pBuffer += szTransHdr; + + // This is required to be 0 + if (pTransHdr->mCompound != 0) + { + mbValid = bRC; + return bRC; + } + + // These are mutually exclusive + if (pTransHdr->mIndication == 1 && pTransHdr->mResponse == 1) + { + mbValid = bRC; + return bRC; + } + + // Requests/responses required valid transaction IDs + if ( (pTransHdr->mIndication == 0) + && (pTransHdr->mTransactionID == (WORD)INVALID_QMI_TRANSACTION_ID) ) + { + mbValid = bRC; + return bRC; + } + + if ( (pTransHdr->mResponse == 1 || pTransHdr->mIndication == 1) + && (IsQMIProtocolRX( pt ) == false) ) + { + mbValid = bRC; + return bRC; + } + + if ( (pTransHdr->mResponse == 0 && pTransHdr->mIndication == 0) + && (IsQMIProtocolTX( pt ) == false) ) + { + mbValid = bRC; + return bRC; + } + + // Obtain message header + const sQMIRawMessageHeader * pMsgHdr = 0; + pMsgHdr = (const sQMIRawMessageHeader *)pBuffer; + pBuffer += szMsgHdr; + + // Validate reported length + if (sz != ((ULONG)pMsgHdr->mLength + szTransHdr + szMsgHdr)) + { + mbValid = bRC; + return bRC; + } + + // Extract content TLV structures + ULONG contentProcessed = 0; + ULONG contentSz = (ULONG)pMsgHdr->mLength; + while (contentProcessed < contentSz) + { + const sQMIRawContentHeader * pContent = 0; + pContent = (const sQMIRawContentHeader *)pBuffer; + + ULONG tlvLen = szContentHdr + pContent->mLength; + + contentProcessed += tlvLen; + if (contentProcessed <= contentSz) + { + mContents[(ULONG)pContent->mTypeID] = pContent; + } + else + { + mContents.clear(); + + mbValid = bRC; + return bRC; + } + + pBuffer += tlvLen; + } + + // Validate TLV reported lengths + if (contentProcessed != contentSz) + { + mbValid = bRC; + return bRC; + } + + // Success! + bRC = true; + + mbValid = bRC; + return mbValid; +} + diff --git a/gobi-api/GobiAPI_1.0.40/Core/QMIBuffers.h b/gobi-api/GobiAPI_1.0.40/Core/QMIBuffers.h new file mode 100755 index 0000000..2f4c5eb --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/QMIBuffers.h @@ -0,0 +1,379 @@ +/*=========================================================================== +FILE: + QMIBuffers.h + +DESCRIPTION: + QMI service protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQMUXHeader + sQMIControlRawTransactionHeader + sQMIServiceRawTransactionHeader + sQMIRawMessageHeader + sQMIRawContentHeader + + sQMIServiceBuffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "QMIEnum.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// QMI maximum buffer size (cannot be larger than MAX_SHARED_BUFFER_SIZE) +const ULONG QMI_MAX_BUFFER_SIZE = MAX_SHARED_BUFFER_SIZE; + +// Content ID for mandatory result TLV +const ULONG QMI_TLV_ID_RESULT = 2; + +/*=========================================================================== +METHOD: + MapQMIServiceToProtocol (Inline Method) + +DESCRIPTION: + Map QMI service type (eQMIService) and direction to a protocol type + (eProtocolType) + +PARAMETERS: + serviceType [ I ] - Enum value being mapped + bTransmission [ I ] - IS this a transmission (TX vs. RX)? + +RETURN VALUE: + bool +===========================================================================*/ +inline eProtocolType MapQMIServiceToProtocol( + eQMIService serviceType, + bool bTransmission = true ) +{ + eProtocolType pt = ePROTOCOL_ENUM_BEGIN; + switch (serviceType) + { + case eQMI_SVC_WDS: + pt = ePROTOCOL_QMI_WDS_RX; + break; + + case eQMI_SVC_DMS: + pt = ePROTOCOL_QMI_DMS_RX; + break; + + case eQMI_SVC_NAS: + pt = ePROTOCOL_QMI_NAS_RX; + break; + + case eQMI_SVC_QOS: + pt = ePROTOCOL_QMI_QOS_RX; + break; + + case eQMI_SVC_WMS: + pt = ePROTOCOL_QMI_WMS_RX; + break; + + case eQMI_SVC_PDS: + pt = ePROTOCOL_QMI_PDS_RX; + break; + + case eQMI_SVC_AUTH: + pt = ePROTOCOL_QMI_AUTH_RX; + break; + + case eQMI_SVC_VOICE: + pt = ePROTOCOL_QMI_VOICE_RX; + break; + + case eQMI_SVC_CAT: + pt = ePROTOCOL_QMI_CAT_RX; + break; + + case eQMI_SVC_RMS: + pt = ePROTOCOL_QMI_RMS_RX; + break; + + case eQMI_SVC_OMA: + pt = ePROTOCOL_QMI_OMA_RX; + break; + + case eQMI_SVC_CONTROL: + pt = ePROTOCOL_QMI_CTL_RX; + break; + + } + + if (pt != ePROTOCOL_ENUM_BEGIN && bTransmission == true) + { + // This relies on the fact the the TX variant is always the next + // enumerated value after the RX variant (so don't do something + // to change that) + pt = (eProtocolType)((ULONG)pt + 1); + } + + return pt; +}; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sQMUXHeader +// Struct to represent a QMUX transaction header (raw) +/*=========================================================================*/ +struct sQMUXHeader +{ + public: + WORD mLength; + BYTE mFlags; + BYTE mServiceType; + BYTE mClientID; +}; + +/*=========================================================================*/ +// Struct sQMIControlRawTransactionHeader +// Struct to represent a QMI control transaction header (raw) +/*=========================================================================*/ +struct sQMIControlRawTransactionHeader +{ + public: + BYTE mResponse : 1; // Is this a response transaction? + BYTE mIndication : 1; // Is this an indication transaction? + BYTE mReserved : 6; + + BYTE mTransactionID; // Transaction ID +}; + +/*=========================================================================*/ +// Struct sQMIServiceRawTransactionHeader +// Struct to represent a QMI service transaction header (raw) +/*=========================================================================*/ +struct sQMIServiceRawTransactionHeader +{ + public: + BYTE mCompound : 1; // Is this a compound transaction? + BYTE mResponse : 1; // Is this a response transaction? + BYTE mIndication : 1; // Is this an indication transaction? + BYTE mReserved : 5; + + WORD mTransactionID; // Transaction ID +}; + +/*=========================================================================*/ +// Struct sQMIRawMessageHeader +// Struct to represent a QMI (control/service) message header (raw) +/*=========================================================================*/ +struct sQMIRawMessageHeader +{ + public: + WORD mMessageID; // Message ID + WORD mLength; // Length of message (not including this header) +}; + +/*=========================================================================*/ +// Struct sQMIRawContentHeader +// Struct to represent a QMI (control/service) content +// (i.e Type/Length/Value, TLV) header (raw) +/*=========================================================================*/ +struct sQMIRawContentHeader +{ + public: + BYTE mTypeID; // Content type ID + WORD mLength; // Content length (not including this header) +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + + +/*=========================================================================*/ +// Struct sQMIServiceBuffer +// Struct to represent a QMI service channel request/response/indication +// (shared buffer) +/*=========================================================================*/ +struct sQMIServiceBuffer : public sProtocolBuffer +{ + public: + // Constructor + sQMIServiceBuffer( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQMIServiceBuffer(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bRequest = (pHdr->mResponse == 0 && pHdr->mIndication == 0); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bResponse = (pHdr->mResponse == 1); + } + + return bResponse; + }; + + // (Inline) Is this an indication? + bool IsIndication() const + { + bool bInd = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bInd = (pHdr->mIndication == 1); + } + + return bInd; + }; + + // (Inline) Return raw header + const sQMIServiceRawTransactionHeader * GetHeader() const + { + const sQMIServiceRawTransactionHeader * pHdr = 0; + if (IsValid() == true) + { + pHdr = (const sQMIServiceRawTransactionHeader *)GetBuffer(); + } + + return pHdr; + }; + + // (Inline) Return the message ID + ULONG GetMessageID() const + { + ULONG id = (ULONG)ULONG_MAX; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + pHdr++; + const sQMIRawMessageHeader * pMsgHdr = 0; + pMsgHdr = (sQMIRawMessageHeader *)pHdr; + + id = pMsgHdr->mMessageID; + } + + return id; + }; + + // (Inline) Return the transaction ID + WORD GetTransactionID() const + { + WORD id = (WORD)INVALID_QMI_TRANSACTION_ID; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + id = pHdr->mTransactionID; + } + + return id; + }; + + // (Inline) Return content structures + std::map GetContents() const + { + return mContents; + }; + + // Return contents of mandatory result content + bool GetResult( + ULONG & returnCode, + ULONG & errorCode ); + + // Build a QMI request/response/indication + static sSharedBuffer * BuildBuffer( + eQMIService serviceType, + WORD msgID, + bool bResponse = false, + bool bIndication = false, + const BYTE * pData = 0, + ULONG dataLen = 0 ); + + protected: + // QMI protocol server has to be able to set the transaction ID + friend class cQMIProtocolServer; + + // Set the transaction ID + void SetTransactionID( WORD tid ) const + { + if (tid == (WORD)INVALID_QMI_TRANSACTION_ID || IsValid() == false) + { + return; + } + + sQMIServiceRawTransactionHeader * pHdr = 0; + pHdr = (sQMIServiceRawTransactionHeader *)GetHeader(); + if (pHdr != 0) + { + pHdr->mTransactionID = tid; + } + }; + + // Is this QMI request/response/indication packet valid? + virtual bool Validate(); + + /* Content TLV structures (indexed by type ID) */ + std::map mContents; + + private: + // Prevent 'upcopying' + sQMIServiceBuffer( const sProtocolBuffer & ); + sQMIServiceBuffer & operator = ( const sProtocolBuffer & ); +}; + diff --git a/gobi-api/GobiAPI_1.0.40/Core/QMIEnum.h b/gobi-api/GobiAPI_1.0.40/Core/QMIEnum.h new file mode 100755 index 0000000..88a7d9d --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/QMIEnum.h @@ -0,0 +1,1149 @@ +/*=========================================================================== +FILE: + QMIEnum.h + +DESCRIPTION: + QMI protocol enumerations and related methods + +PUBLIC ENUMERATIONS AND METHODS: + eQMIService + eQMIMessageCTL + eQMIMessageWDS + eQMIMessageDMS + eQMIMessageNAS + eQMIMessageWMS + eQMIMessagePDS + eQMIMessageAUTH + eQMIMessageCAT + eQMIMessageRMS + eQMIMessageOMA + eQMIResultCode + eQMIErrorCode + eQMICallEndReason + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid QMI transaction ID +const ULONG INVALID_QMI_TRANSACTION_ID = 0; + +// QMI DMS PRL size constants +const ULONG QMI_DMS_MAX_PRL_SIZE = 16384; +const ULONG QMI_DMS_MAX_PRL_BLOCK = 256; + +/*=========================================================================*/ +// eQMIService Enumeration +// QMI Service Type Enumeration +/*=========================================================================*/ +enum eQMIService +{ + eQMI_SVC_ENUM_BEGIN = -1, + + eQMI_SVC_CONTROL, // 000 Control service + eQMI_SVC_WDS, // 001 Wireless data service + eQMI_SVC_DMS, // 002 Device management service + eQMI_SVC_NAS, // 003 Network access service + eQMI_SVC_QOS, // 004 Quality of service, err, service + eQMI_SVC_WMS, // 005 Wireless messaging service + eQMI_SVC_PDS, // 006 Position determination service + eQMI_SVC_AUTH, // 007 Authentication service + + eQMI_SVC_VOICE = 9, // 009 Voice service + + eQMI_SVC_CAT = 224, // 224 Card application toolkit service + eQMI_SVC_RMS, // 225 Remote management service + eQMI_SVC_OMA, // 226 Open mobile alliance dev mgmt service + + eQMI_SVC_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIService validity check + +PARAMETERS: + svc [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIService svc ) +{ + bool retVal = false; + if ( (svc > eQMI_SVC_ENUM_BEGIN && svc <= eQMI_SVC_AUTH) + || (svc == eQMI_SVC_VOICE) + || (svc >= eQMI_SVC_CAT && svc < eQMI_SVC_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageCTL Enumeration +// QMI Control Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageCTL +{ + eQMI_CTL_ENUM_BEGIN = -1, + + eQMI_CTL_SET_INSTANCE_ID = 32, // 32 Set the unique link instance ID + eQMI_CTL_GET_VERSION_INFO, // 33 Get supported service version info + eQMI_CTL_GET_CLIENT_ID, // 34 Get a unique client ID + eQMI_CTL_RELEASE_CLIENT_ID, // 35 Release the unique client ID + eQMI_CTL_REVOKE_CLIENT_ID_IND, // 36 Indication of client ID revocation + eQMI_CTL_INVALID_CLIENT_ID, // 37 Indication of invalid client ID + eQMI_CTL_SET_DATA_FORMAT, // 38 Set host driver data format + eQMI_CTL_SYNC, // 39 Synchronize client/server + eQMI_CTL_SYNC_IND = 39, // 39 Synchronize indication + eQMI_CTL_SET_EVENT, // 40 Set event report conditions + eQMI_CTL_EVENT_IND = 40, // 40 Event report indication + eQMI_CTL_SET_POWER_SAVE_CFG, // 41 Set power save config + eQMI_CTL_SET_POWER_SAVE_MODE, // 42 Set power save mode + eQMI_CTL_GET_POWER_SAVE_MODE, // 43 Get power save mode + + eQMI_CTL_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageCTL validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageCTL msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_CTL_SET_INSTANCE_ID && msgID < eQMI_CTL_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageWDS Enumeration +// QMI WDS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageWDS +{ + eQMI_WDS_ENUM_BEGIN = -1, + + eQMI_WDS_RESET, // 00 Reset WDS service state variables + eQMI_WDS_SET_EVENT, // 01 Set connection state report conditions + eQMI_WDS_EVENT_IND = 1, // 01 Connection state report indication + eQMI_WDS_ABORT, // 02 Abort previously issued WDS command + + eQMI_WDS_START_NET = 32, // 32 Start WDS network interface + eQMI_WDS_STOP_NET, // 33 Stop WDS network interface + eQMI_WDS_GET_PKT_STATUS, // 34 Get packet data connection status + eQMI_WDS_PKT_STATUS_IND = 34, // 34 Packet data connection status indication + eQMI_WDS_GET_RATES, // 35 Get current bit rates of the connection + eQMI_WDS_GET_STATISTICS, // 36 Get the packet data transfer statistics + eQMI_WDS_G0_DORMANT, // 37 Go dormant + eQMI_WDS_G0_ACTIVE, // 38 Go active + eQMI_WDS_CREATE_PROFILE, // 39 Create profile with specified settings + eQMI_WDS_MODIFY_PROFILE, // 40 Modify profile with specified settings + eQMI_WDS_DELETE_PROFILE, // 41 Delete the specified profile + eQMI_WDS_GET_PROFILE_LIST, // 42 Get all profiles + eQMI_WDS_GET_PROFILE, // 43 Get the specified profile + eQMI_WDS_GET_DEFAULTS, // 44 Get the default data session settings + eQMI_WDS_GET_SETTINGS, // 45 Get the runtime data session settings + eQMI_WDS_SET_MIP, // 46 Get the mobile IP setting + eQMI_WDS_GET_MIP, // 47 Set the mobile IP setting + eQMI_WDS_GET_DORMANCY, // 48 Get the dormancy status + + eQMI_WDS_GET_AUTOCONNECT = 52, // 52 Get the NDIS autoconnect setting + eQMI_WDS_GET_DURATION, // 53 Get the duration of data session + eQMI_WDS_GET_MODEM_STATUS, // 54 Get the modem status + eQMI_WDS_MODEM_IND = 54, // 54 Modem status indication + eQMI_WDS_GET_DATA_BEARER, // 55 Get the data bearer type + eQMI_WDS_GET_MODEM_INFO, // 56 Get the modem info + eQMI_WDS_MODEM_INFO_IND = 56, // 56 Modem info indication + + eQMI_WDS_GET_ACTIVE_MIP = 60, // 60 Get the active mobile IP profile + eQMI_WDS_SET_ACTIVE_MIP, // 61 Set the active mobile IP profile + eQMI_WDS_GET_MIP_PROFILE, // 62 Get mobile IP profile settings + eQMI_WDS_SET_MIP_PROFILE, // 63 Set mobile IP profile settings + eQMI_WDS_GET_MIP_PARAMS, // 64 Get mobile IP parameters + eQMI_WDS_SET_MIP_PARAMS, // 65 Set mobile IP parameters + eQMI_WDS_GET_LAST_MIP_STATUS, // 66 Get last mobile IP status + eQMI_WDS_GET_AAA_AUTH_STATUS, // 67 Get AN-AAA authentication status + eQMI_WDS_GET_CUR_DATA_BEARER, // 68 Get current data bearer + eQMI_WDS_GET_CALL_LIST, // 69 Get the call history list + eQMI_WDS_GET_CALL_ENTRY, // 70 Get an entry from the call history list + eQMI_WDS_CLEAR_CALL_LIST, // 71 Clear the call history list + eQMI_WDS_GET_CALL_LIST_MAX, // 72 Get maximum size of call history list + + eQMI_WDS_SET_IP_FAMILY = 77, // 77 Set the client IP family preference + + eQMI_WDS_SET_AUTOCONNECT = 81, // 81 Set the NDIS autoconnect setting + eQMI_WDS_GET_DNS, // 82 Get the DNS setting + eQMI_WDS_SET_DNS, // 83 Set the DNS setting + + eQMI_WDS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageWDS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageWDS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_WDS_ENUM_BEGIN && msgID <= eQMI_WDS_ABORT) + || (msgID >= eQMI_WDS_START_NET && msgID <= eQMI_WDS_GET_DORMANCY) + || (msgID >= eQMI_WDS_GET_AUTOCONNECT && msgID <= eQMI_WDS_MODEM_INFO_IND) + || (msgID >= eQMI_WDS_GET_ACTIVE_MIP && msgID <= eQMI_WDS_GET_CALL_LIST_MAX) + || (msgID == eQMI_WDS_SET_IP_FAMILY) + || (msgID >= eQMI_WDS_SET_AUTOCONNECT && msgID < eQMI_WDS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageDMS Enumeration +// QMI DMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageDMS +{ + eQMI_DMS_ENUM_BEGIN = -1, + + eQMI_DMS_RESET, // 00 Reset DMS service state variables + eQMI_DMS_SET_EVENT, // 01 Set connection state report conditions + eQMI_DMS_EVENT_IND = 1, // 01 Connection state report indication + + eQMI_DMS_GET_CAPS = 32, // 32 Get the device capabilities + eQMI_DMS_GET_MANUFACTURER, // 33 Get the device manfacturer + eQMI_DMS_GET_MODEL_ID, // 34 Get the device model ID + eQMI_DMS_GET_REV_ID, // 35 Get the device revision ID + eQMI_DMS_GET_NUMBER, // 36 Get the assigned voice number + eQMI_DMS_GET_IDS, // 37 Get the ESN/IMEI/MEID + eQMI_DMS_GET_POWER_STATE, // 38 Get the get power state + eQMI_DMS_UIM_SET_PIN_PROT, // 39 UIM - Set PIN protection + eQMI_DMS_UIM_PIN_VERIFY, // 40 UIM - Verify PIN + eQMI_DMS_UIM_PIN_UNBLOCK, // 41 UIM - Unblock PIN + eQMI_DMS_UIM_PIN_CHANGE, // 42 UIM - Change PIN + eQMI_DMS_UIM_GET_PIN_STATUS, // 43 UIM - Get PIN status + eQMI_DMS_GET_MSM_ID = 44, // 44 Get MSM ID + eQMI_DMS_GET_OPERTAING_MODE, // 45 Get the operating mode + eQMI_DMS_SET_OPERATING_MODE, // 46 Set the operating mode + eQMI_DMS_GET_TIME, // 47 Get timestamp from the device + eQMI_DMS_GET_PRL_VERSION, // 48 Get the PRL version + eQMI_DMS_GET_ACTIVATED_STATE, // 49 Get the activation state + eQMI_DMS_ACTIVATE_AUTOMATIC, // 50 Perform an automatic activation + eQMI_DMS_ACTIVATE_MANUAL, // 51 Perform a manual activation + eQMI_DMS_GET_USER_LOCK_STATE, // 52 Get the lock state + eQMI_DMS_SET_USER_LOCK_STATE, // 53 Set the lock state + eQMI_DMS_SET_USER_LOCK_CODE, // 54 Set the lock PIN + eQMI_DMS_READ_USER_DATA, // 55 Read user data + eQMI_DMS_WRITE_USER_DATA, // 56 Write user data + eQMI_DMS_READ_ERI_FILE, // 57 Read the enhanced roaming indicator file + eQMI_DMS_FACTORY_DEFAULTS, // 58 Reset to factory defaults + eQMI_DMS_VALIDATE_SPC, // 59 Validate service programming code + eQMI_DMS_UIM_GET_ICCID, // 60 Get UIM ICCID + eQMI_DMS_GET_FIRWARE_ID, // 61 Get firmware ID + eQMI_DMS_SET_FIRMWARE_ID, // 62 Set firmware ID + eQMI_DMS_GET_HOST_LOCK_ID, // 63 Get host lock ID + eQMI_DMS_UIM_GET_CK_STATUS, // 64 UIM - Get control key status + eQMI_DMS_UIM_SET_CK_PROT, // 65 UIM - Set control key protection + eQMI_DMS_UIM_UNBLOCK_CK, // 66 UIM - Unblock facility control key + eQMI_DMS_GET_IMSI, // 67 Get the IMSI + eQMI_DMS_UIM_GET_STATE, // 68 UIM - Get the UIM state + eQMI_DMS_GET_BAND_CAPS, // 69 Get the device band capabilities + eQMI_DMS_GET_FACTORY_ID, // 70 Get the device factory ID + eQMI_DMS_GET_FIRMWARE_PREF, // 71 Get firmware preference + eQMI_DMS_SET_FIRMWARE_PREF, // 72 Set firmware preference + eQMI_DMS_LIST_FIRMWARE, // 73 List all stored firmware + eQMI_DMS_DELETE_FIRMWARE, // 74 Delete specified stored firmware + eQMI_DMS_SET_TIME, // 75 Set device time + eQMI_DMS_GET_FIRMWARE_INFO, // 76 Get stored firmware info + eQMI_DMS_GET_ALT_NET_CFG, // 77 Get alternate network config + eQMI_DMS_SET_ALT_NET_CFG, // 78 Set alternate network config + eQMI_DMS_GET_IMG_DLOAD_MODE, // 79 Get next image download mode + eQMI_DMS_SET_IMG_DLOAD_MODE, // 80 Set next image download mod + + eQMI_DMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageDMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageDMS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_DMS_ENUM_BEGIN && msgID <= eQMI_DMS_EVENT_IND) + || (msgID >= eQMI_DMS_GET_CAPS && msgID < eQMI_DMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageNAS Enumeration +// QMI NAS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageNAS +{ + eQMI_NAS_ENUM_BEGIN = -1, + + eQMI_NAS_RESET, // 00 Reset NAS service state variables + eQMI_NAS_ABORT, // 01 Abort previously issued NAS command + eQMI_NAS_SET_EVENT, // 02 Set NAS state report conditions + eQMI_NAS_EVENT_IND = 2, // 02 Connection state report indication + eQMI_NAS_SET_REG_EVENT, // 03 Set NAS registration report conditions + + eQMI_NAS_GET_RSSI = 32, // 32 Get the signal strength + eQMI_NAS_SCAN_NETS, // 33 Scan for visible network + eQMI_NAS_REGISTER_NET, // 34 Initiate a network registration + eQMI_NAS_ATTACH_DETACH, // 35 Initiate an attach or detach action + eQMI_NAS_GET_SS_INFO, // 36 Get info about current serving system + eQMI_NAS_SS_INFO_IND = 36, // 36 Current serving system info indication + eQMI_NAS_GET_HOME_INFO, // 37 Get info about home network + eQMI_NAS_GET_NET_PREF_LIST, // 38 Get the list of preferred networks + eQMI_NAS_SET_NET_PREF_LIST, // 39 Set the list of preferred networks + eQMI_NAS_GET_NET_BAN_LIST, // 40 Get the list of forbidden networks + eQMI_NAS_SET_NET_BAN_LIST, // 41 Set the list of forbidden networks + eQMI_NAS_SET_TECH_PREF, // 42 Set the technology preference + eQMI_NAS_GET_TECH_PREF, // 43 Get the technology preference + eQMI_NAS_GET_ACCOLC, // 44 Get the Access Overload Class + eQMI_NAS_SET_ACCOLC, // 45 Set the Access Overload Class + eQMI_NAS_GET_SYSPREF, // 46 Get the CDMA system preference + eQMI_NAS_GET_NET_PARAMS, // 47 Get various network parameters + eQMI_NAS_SET_NET_PARAMS, // 48 Set various network parameters + eQMI_NAS_GET_RF_INFO, // 49 Get the SS radio/band channel info + eQMI_NAS_GET_AAA_AUTH_STATUS, // 50 Get AN-AAA authentication status + eQMI_NAS_SET_SYS_SELECT_PREF, // 51 Set system selection preference + eQMI_NAS_GET_SYS_SELECT_PREF, // 52 Get system selection preference + eQMI_NAS_SYS_SELECT_IND = 52, // 52 System selection pref indication + + eQMI_NAS_SET_DDTM_PREF = 55, // 55 Set DDTM preference + eQMI_NAS_GET_DDTM_PREF, // 56 Get DDTM preference + eQMI_NAS_DDTM_IND = 56, // 56 DDTM preference indication + + eQMI_NAS_GET_PLMN_MODE = 59, // 59 Get PLMN mode bit from CSP + eQMI_NAS_PLMN_MODE_IND, // 60 CSP PLMN mode bit indication + + eQMI_NAS_GET_PLMN_NAME = 68, // 68 Get operator name for specified network + + eQMI_NAS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageNAS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageNAS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_NAS_ENUM_BEGIN && msgID <= eQMI_NAS_SET_REG_EVENT) + || (msgID >= eQMI_NAS_GET_RSSI && msgID <= eQMI_NAS_SYS_SELECT_IND) + || (msgID >= eQMI_NAS_SET_DDTM_PREF && msgID <= eQMI_NAS_DDTM_IND) + || (msgID >= eQMI_NAS_GET_PLMN_MODE && msgID <= eQMI_NAS_PLMN_MODE_IND) + || (msgID >= eQMI_NAS_GET_PLMN_NAME && msgID < eQMI_NAS_ENUM_END) ) + { + retVal = true; + } + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageWMS Enumeration +// QMI WMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageWMS +{ + eQMI_WMS_ENUM_BEGIN = -1, + + eQMI_WMS_RESET, // 00 Reset WMS service state variables + eQMI_WMS_SET_EVENT, // 01 Set new message report conditions + eQMI_WMS_EVENT_IND = 1, // 01 New message report indication + + eQMI_WMS_RAW_SEND = 32, // 32 Send a raw message + eQMI_WMS_RAW_WRITE, // 33 Write a raw message to the device + eQMI_WMS_RAW_READ, // 34 Read a raw message from the device + eQMI_WMS_MODIFY_TAG, // 35 Modify message tag on the device + eQMI_WMS_DELETE, // 36 Delete message by index/tag/memory + + eQMI_WMS_GET_MSG_PROTOCOL = 48, // 48 Get the current message protocol + eQMI_WMS_GET_MSG_LIST, // 49 Get list of messages from the device + eQMI_WMS_SET_ROUTES, // 50 Set routes for message memory storage + eQMI_WMS_GET_ROUTES, // 51 Get routes for message memory storage + eQMI_WMS_GET_SMSC_ADDR, // 52 Get SMSC address + eQMI_WMS_SET_SMSC_ADDR, // 53 Set SMSC address + eQMI_WMS_GET_MSG_LIST_MAX, // 54 Get maximum size of SMS storage + eQMI_WMS_SEND_ACK, // 55 Send ACK + eQMI_WMS_SET_RETRY_PERIOD, // 56 Set retry period + eQMI_WMS_SET_RETRY_INTERVAL, // 57 Set retry interval + eQMI_WMS_SET_DC_DISCO_TIMER, // 58 Set DC auto-disconnect timer + eQMI_WMS_SET_MEMORY_STATUS, // 59 Set memory storage status + eQMI_WMS_SET_BC_ACTIVATION, // 60 Set broadcast activation + eQMI_WMS_SET_BC_CONFIG, // 61 Set broadcast config + eQMI_WMS_GET_BC_CONFIG, // 62 Get broadcast config + eQMI_WMS_MEMORY_FULL_IND, // 63 Memory full indication + eQMI_WMS_GET_DOMAIN_PREF, // 64 Get domain preference + eQMI_WMS_SET_DOMAIN_PREF, // 65 Set domain preference + eQMI_WMS_MEMORY_SEND, // 66 Send message from memory store + eQMI_WMS_GET_MSG_WAITING, // 67 Get message waiting info + eQMI_WMS_MSG_WAITING_IND, // 68 Message waiting indication + eQMI_WMS_SET_PRIMARY_CLIENT, // 69 Set client as primary client + eQMI_WMS_SMSC_ADDR_IND, // 70 SMSC address indication + + eQMI_WMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageWMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageWMS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_WMS_ENUM_BEGIN && msgID <= eQMI_WMS_EVENT_IND) + || (msgID >= eQMI_WMS_RAW_SEND && msgID <= eQMI_WMS_DELETE) + || (msgID >= eQMI_WMS_GET_MSG_PROTOCOL && msgID < eQMI_WMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessagePDS Enumeration +// QMI PDS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessagePDS +{ + eQMI_PDS_ENUM_BEGIN = -1, + + eQMI_PDS_RESET, // 00 Reset PDS service state variables + eQMI_PDS_SET_EVENT, // 01 Set PDS report conditions + eQMI_PDS_EVENT_IND = 1, // 01 PDS report indication + + eQMI_PDS_GET_STATE = 32, // 32 Return PDS service state + eQMI_PDS_STATE_IND = 32, // 32 PDS service state indication + eQMI_PDS_SET_STATE, // 33 Set PDS service state + eQMI_PDS_START_SESSION, // 34 Start a PDS tracking session + eQMI_PDS_GET_SESSION_INFO, // 35 Get PDS tracking session info + eQMI_PDS_FIX_POSITION, // 36 Manual tracking session position + eQMI_PDS_END_SESSION, // 37 End a PDS tracking session + eQMI_PDS_GET_NMEA_CFG, // 38 Get NMEA sentence config + eQMI_PDS_SET_NMEA_CFG, // 39 Set NMEA sentence config + eQMI_PDS_INJECT_TIME, // 40 Inject a time reference + eQMI_PDS_GET_DEFAULTS, // 41 Get default tracking session config + eQMI_PDS_SET_DEFAULTS, // 42 Set default tracking session config + eQMI_PDS_GET_XTRA_PARAMS, // 43 Get the GPS XTRA parameters + eQMI_PDS_SET_XTRA_PARAMS, // 44 Set the GPS XTRA parameters + eQMI_PDS_FORCE_XTRA_DL, // 45 Force a GPS XTRA database download + eQMI_PDS_GET_AGPS_CONFIG, // 46 Get the AGPS mode configuration + eQMI_PDS_SET_AGPS_CONFIG, // 47 Set the AGPS mode configuration + + eQMI_PDS_GET_SVC_AUTOTRACK, // 48 Get the service auto-tracking state + eQMI_PDS_SET_SVC_AUTOTRACK, // 49 Set the service auto-tracking state + eQMI_PDS_GET_COM_AUTOTRACK, // 50 Get COM port auto-tracking config + eQMI_PDS_SET_COM_AUTOTRACK, // 51 Set COM port auto-tracking config + eQMI_PDS_RESET_DATA, // 52 Reset PDS service data + eQMI_PDS_SINGLE_FIX, // 53 Request single position fix + eQMI_PDS_GET_VERSION, // 54 Get PDS service version + eQMI_PDS_INJECT_XTRA, // 55 Inject XTRA data + eQMI_PDS_INJECT_POSITION, // 56 Inject position data + eQMI_PDS_INJECT_WIFI, // 57 Inject Wi-Fi obtained data + eQMI_PDS_GET_SBAS_CONFIG, // 58 Get SBAS config + eQMI_PDS_SET_SBAS_CONFIG, // 59 Set SBAS config + eQMI_PDS_SEND_NI_RESPONSE, // 60 Send network initiated response + eQMI_PDS_INJECT_ABS_TIME, // 61 Inject absolute time + eQMI_PDS_INJECT_EFS, // 62 Inject EFS data + eQMI_PDS_GET_DPO_CONFIG, // 63 Get DPO config + eQMI_PDS_SET_DPO_CONFIG, // 64 Set DPO config + eQMI_PDS_GET_ODP_CONFIG, // 65 Get ODP config + eQMI_PDS_SET_ODP_CONFIG, // 66 Set ODP config + eQMI_PDS_CANCEL_SINGLE_FIX, // 67 Cancel single position fix + eQMI_PDS_GET_GPS_STATE, // 68 Get GPS state + + eQMI_PDS_GET_METHODS = 80, // 80 Get GPS position methods state + eQMI_PDS_SET_METHODS, // 81 Set GPS position methods state + + eQMI_PDS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessagePDS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessagePDS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_PDS_ENUM_BEGIN && msgID <= eQMI_PDS_EVENT_IND) + || (msgID >= eQMI_PDS_GET_STATE && msgID <= eQMI_PDS_GET_GPS_STATE) + || (msgID >= eQMI_PDS_GET_METHODS && msgID < eQMI_PDS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageAUTH Enumeration +// QMI Authentication Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageAUTH +{ + eQMI_AUTH_ENUM_BEGIN = -1, + + eQMI_AUTH_START_EAP = 32, // 32 Start the EAP session + eQMI_AUTH_SEND_EAP, // 33 Send and receive EAP packets + eQMI_AUTH_EAP_RESULT_IND, // 34 EAP session result indication + eQMI_AUTH_GET_EAP_KEYS, // 35 Get the EAP session keys + eQMI_AUTH_END_EAP, // 36 End the EAP session + + eQMI_AUTH_ENUM_END +}; + +/*=========================================================================*/ +// eQMIMessageVoice Enumeration +// QMI Voice Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageVoice +{ + eQMI_VOICE_ENUM_BEGIN = -1, + + eQMI_VOICE_INDICATION_REG = 3, // 03 Set indication registration state + + eQMI_VOICE_CALL_ORIGINATE = 32, // 32 Originate a voice call + eQMI_VOICE_CALL_END, // 33 End a voice call + eQMI_VOICE_CALL_ANSWER, // 34 Answer incoming voice call + + eQMI_VOICE_GET_CALL_INFO = 36, // 36 Get call information + eQMI_VOICE_OTASP_STATUS_IND, // 37 OTASP/OTAPA event indication + eQMI_VOICE_INFO_REC_IND, // 38 New info record indication + eQMI_VOICE_SEND_FLASH, // 39 Send a simple flash + eQMI_VOICE_BURST_DTMF, // 40 Send a burst DTMF + eQMI_VOICE_START_CONT_DTMF, // 41 Starts a continuous DTMF + eQMI_VOICE_STOP_CONT_DTMF, // 42 Stops a continuous DTMF + eQMI_VOICE_DTMF_IND, // 43 DTMF event indication + eQMI_VOICE_SET_PRIVACY_PREF, // 44 Set privacy preference + eQMI_VOICE_PRIVACY_IND, // 45 Privacy change indication + eQMI_VOICE_ALL_STATUS_IND, // 46 Voice all call status indication + eQMI_VOICE_GET_ALL_STATUS, // 47 Get voice all call status + + eQMI_VOICE_MANAGE_CALLS = 49, // 49 Manage calls + eQMI_VOICE_SUPS_NOTIFICATION_IND, // 50 Supplementary service notifications + eQMI_VOICE_SET_SUPS_SERVICE, // 51 Manage supplementary service + eQMI_VOICE_GET_CALL_WAITING, // 52 Query sup service call waiting + eQMI_VOICE_GET_CALL_BARRING, // 53 Query sup service call barring + eQMI_VOICE_GET_CLIP, // 54 Query sup service CLIP + eQMI_VOICE_GET_CLIR, // 55 Query sup service CLIR + eQMI_VOICE_GET_CALL_FWDING, // 56 Query sup service call forwarding + eQMI_VOICE_SET_CALL_BARRING_PWD, // 57 Set call barring password + eQMI_VOICE_ORIG_USSD, // 58 Initiate USSD operation + eQMI_VOICE_ANSWER_USSD, // 59 Answer USSD request + eQMI_VOICE_CANCEL_USSD, // 60 Cancel USSD operation + eQMI_VOICE_USSD_RELEASE_IND, // 61 USSD release indication + eQMI_VOICE_USSD_IND, // 62 USSD request/notification indication + eQMI_VOICE_UUS_IND, // 63 UUS information indication + eQMI_VOICE_SET_CONFIG, // 64 Set config + eQMI_VOICE_GET_CONFIG, // 65 Get config + eQMI_VOICE_SUPS_IND, // 66 Sup service request indication + eQMI_VOICE_ASYNC_ORIG_USSD, // 67 Initiate USSD operation + eQMI_VOICE_ASYNC_USSD_IND = 67, // 67 USSD request/notification indication + + eQMI_VOICE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageVoice validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageVoice msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_VOICE_INDICATION_REG) + || (msgID >= eQMI_VOICE_CALL_ORIGINATE && msgID <= eQMI_VOICE_CALL_ANSWER) + || (msgID >= eQMI_VOICE_GET_CALL_INFO && msgID <= eQMI_VOICE_GET_ALL_STATUS) + || (msgID >= eQMI_VOICE_MANAGE_CALLS && msgID < eQMI_VOICE_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageAUTH validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageAUTH msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_AUTH_START_EAP && msgID < eQMI_AUTH_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageCAT Enumeration +// QMI CAT Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageCAT +{ + eQMI_CAT_ENUM_BEGIN = -1, + + eQMI_CAT_RESET, // 00 Reset CAT service state variables + eQMI_CAT_SET_EVENT, // 01 Set new message report conditions + eQMI_CAT_EVENT_IND = 1, // 01 New message report indication + + eQMI_CAT_GET_STATE = 32, // 32 Get service state information + eQMI_CAT_SEND_TERMINAL, // 33 Send a terminal response + eQMI_CAT_SEND_ENVELOPE, // 34 Send an envelope command + + eQMI_CAT_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageCAT validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageCAT msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_CAT_ENUM_BEGIN && msgID <= eQMI_CAT_EVENT_IND) + || (msgID >= eQMI_CAT_GET_STATE && msgID < eQMI_CAT_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageRMS Enumeration +// QMI RMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageRMS +{ + eQMI_RMS_ENUM_BEGIN = -1, + + eQMI_RMS_RESET, // 00 Reset RMS service state variables + + eQMI_RMS_GET_SMS_WAKE = 32, // 32 Get SMS wake settings + eQMI_RMS_SET_SMS_WAKE, // 33 Set SMS wake settings + + eQMI_RMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageRMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageRMS msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_RMS_RESET) + || (msgID >= eQMI_RMS_GET_SMS_WAKE && msgID < eQMI_RMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageOMA Enumeration +// QMI OMA-DM Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageOMA +{ + eQMI_OMA_ENUM_BEGIN = -1, + + eQMI_OMA_RESET, // 00 Reset OMA service state variables + eQMI_OMA_SET_EVENT, // 01 Set OMA report conditions + eQMI_OMA_EVENT_IND = 1, // 01 OMA report indication + + eQMI_OMA_START_SESSION = 32, // 32 Start client inititated session + eQMI_OMA_CANCEL_SESSION, // 33 Cancel session + eQMI_OMA_GET_SESSION_INFO, // 34 Get session information + eQMI_OMA_SEND_SELECTION, // 35 Send selection for net inititated msg + eQMI_OMA_GET_FEATURES, // 36 Get feature settings + eQMI_OMA_SET_FEATURES, // 37 Set feature settings + + eQMI_OMA_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageOMA validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageOMA msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_OMA_ENUM_BEGIN && msgID <= eQMI_OMA_EVENT_IND) + || (msgID >= eQMI_OMA_START_SESSION && msgID < eQMI_OMA_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIResultCode Enumeration +// QMI Result Code Enumeration +/*=========================================================================*/ +enum eQMIResultCode +{ + eQMI_RC_ENUM_BEGIN = -1, + + eQMI_RC_SUCCESS, // 00 Success + eQMI_RC_ERROR, // 01 Error + + eQMI_RC_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIResultCode validity check + +PARAMETERS: + rc [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIResultCode rc ) +{ + bool retVal = false; + if (rc > eQMI_RC_ENUM_BEGIN && rc < eQMI_RC_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIErrorCode Enumeration +// QMI Error Code Enumeration +/*=========================================================================*/ +enum eQMIErrorCode +{ + eQMI_ERR_ENUM_BEGIN = -1, + + eQMI_ERR_NONE, // 00 + eQMI_ERR_MALFORMED_MSG, // 01 + eQMI_ERR_NO_MEMORY, // 02 + eQMI_ERR_INTERNAL, // 03 + eQMI_ERR_ABORTED, // 04 + eQMI_ERR_CLIENT_IDS_EXHAUSTED, // 05 + eQMI_ERR_UNABORTABLE_TRANSACTION, // 06 + eQMI_ERR_INVALID_CLIENT_ID, // 07 + eQMI_ERR_NO_THRESHOLDS, // 08 + eQMI_ERR_INVALID_HANDLE, // 09 + eQMI_ERR_INVALID_PROFILE, // 10 + eQMI_ERR_INVALID_PIN_ID, // 11 + eQMI_ERR_INCORRECT_PIN, // 12 + eQMI_ERR_NO_NETWORK_FOUND, // 13 + eQMI_ERR_CALL_FAILED, // 14 + eQMI_ERR_OUT_OF_CALL, // 15 + eQMI_ERR_NOT_PROVISIONED, // 16 + eQMI_ERR_MISSING_ARG, // 17 + eQMI_ERR_18, // 18 + eQMI_ERR_ARG_TOO_LONG, // 19 + eQMI_ERR_20, // 20 + eQMI_ERR_21, // 21 + eQMI_ERR_INVALID_TX_ID, // 22 + eQMI_ERR_DEVICE_IN_USE, // 23 + eQMI_ERR_OP_NETWORK_UNSUPPORTED, // 24 + eQMI_ERR_OP_DEVICE_UNSUPPORTED, // 25 + eQMI_ERR_NO_EFFECT, // 26 + eQMI_ERR_NO_FREE_PROFILE, // 27 + eQMI_ERR_INVALID_PDP_TYPE, // 28 + eQMI_ERR_INVALID_TECH_PREF, // 29 + eQMI_ERR_INVALID_PROFILE_TYPE, // 30 + eQMI_ERR_INVALID_SERVICE_TYPE, // 31 + eQMI_ERR_INVALID_REGISTER_ACTION, // 32 + eQMI_ERR_INVALID_PS_ATTACH_ACTION, // 33 + eQMI_ERR_AUTHENTICATION_FAILED, // 34 + eQMI_ERR_PIN_BLOCKED, // 35 + eQMI_ERR_PIN_ALWAYS_BLOCKED, // 36 + eQMI_ERR_UIM_UNINITIALIZED, // 37 + eQMI_ERR_MAX_QOS_REQUESTS_IN_USE, // 38 + eQMI_ERR_INCORRECT_FLOW_FILTER, // 39 + eQMI_ERR_NETWORK_QOS_UNAWARE, // 40 + eQMI_ERR_INVALID_QOS_ID, // 41 + eQMI_ERR_REQUESTED_NUM_UNSUPPORTED, // 42 + eQMI_ERR_INTERFACE_NOT_FOUND, // 43 + eQMI_ERR_FLOW_SUSPENDED, // 44 + eQMI_ERR_INVALID_DATA_FORMAT, // 45 + eQMI_ERR_GENERAL, // 46 + eQMI_ERR_UNKNOWN, // 47 + eQMI_ERR_INVALID_ARG, // 48 + eQMI_ERR_INVALID_INDEX, // 49 + eQMI_ERR_NO_ENTRY, // 50 + eQMI_ERR_DEVICE_STORAGE_FULL, // 51 + eQMI_ERR_DEVICE_NOT_READY, // 52 + eQMI_ERR_NETWORK_NOT_READY, // 53 + eQMI_ERR_WMS_CAUSE_CODE, // 54 + eQMI_ERR_WMS_MESSAGE_NOT_SENT, // 55 + eQMI_ERR_WMS_MESSAGE_DELIVERY_FAILURE, // 56 + eQMI_ERR_WMS_INVALID_MESSAGE_ID, // 57 + eQMI_ERR_WMS_ENCODING, // 58 + eQMI_ERR_AUTHENTICATION_LOCK, // 59 + eQMI_ERR_INVALID_TRANSITION, // 60 + eQMI_ERR_61, // 61 + eQMI_ERR_62, // 62 + eQMI_ERR_63, // 63 + eQMI_ERR_64, // 64 + eQMI_ERR_SESSION_INACTIVE, // 65 + eQMI_ERR_SESSION_INVALID, // 66 + eQMI_ERR_SESSION_OWNERSHIP, // 67 + eQMI_ERR_INSUFFICIENT_RESOURCES, // 68 + eQMI_ERR_DISABLED, // 69 + eQMI_ERR_INVALID_OPERATION, // 70 + eQMI_ERR_INVALID_QMI_CMD, // 71 + eQMI_ERR_WMS_TPDU_TYPE, // 72 + eQMI_ERR_WMS_SMSC_ADDR, // 73 + eQMI_ERR_INFO_UNAVAILABLE, // 74 + eQMI_ERR_SEGMENT_TOO_LONG, // 75 + eQMI_ERR_SEGMENT_ORDER, // 76 + eQMI_ERR_BUNDLING_NOT_SUPPORTED, // 77 + eQMI_ERR_78, // 78 + eQMI_ERR_POLICY_MISMATCH, // 79 + eQMI_ERR_SIM_FILE_NOT_FOUND, // 80 + eQMI_ERR_EXTENDED_EXTERNAL, // 81 + eQMI_ERR_ACCESS_DENIED, // 82 + eQMI_ERR_HARDWARE_RESTRICTED, // 83 + eQMI_ERR_ACK_NOT_SENT, // 84 + + eQMI_ERR_INCOMPATIBLE_STATE = 90, // 90 + eQMI_ERR_FDN_RESTRICT, // 91 + eQMI_ERR_SUPS_FAILURE_CAUSE, // 92 + eQMI_ERR_NO_RADIO, // 93 + eQMI_ERR_NOT_SUPPORTED, // 94 + + eQMI_ERR_CARD_CALL_CONTROL_FAILED = 96, // 96 + eQMI_ERR_NETWORK_ABORTED, // 97 + + eQMI_ERR_CAT_EVT_REG_FAILED, // 61441 + eQMI_ERR_CAT_INVALID_TR, // 61442 + eQMI_ERR_CAT_INVALID_ENV_CMD, // 61443 + eQMI_ERR_CAT_ENV_CMD_BUSY, // 61444 + eQMI_ERR_CAT_ENV_CMD_FAIL, // 61445 + + eQMI_ERR_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIErrorCode validity check + +PARAMETERS: + ec [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIErrorCode ec ) +{ + bool retVal = false; + if ( (ec > eQMI_ERR_ENUM_BEGIN && ec <= eQMI_ERR_ACK_NOT_SENT) + || (ec >= eQMI_ERR_INCOMPATIBLE_STATE && ec <= eQMI_ERR_NOT_SUPPORTED) + || (ec == eQMI_ERR_CARD_CALL_CONTROL_FAILED) + || (ec == eQMI_ERR_NETWORK_ABORTED) + || (ec >= eQMI_ERR_CAT_EVT_REG_FAILED && ec < eQMI_ERR_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMICallEndReason Enumeration +// QMI Call End Reason Enumeration +/*=========================================================================*/ +enum eQMICallEndReason +{ + eQMI_CALL_END_REASON_BEGIN = -1, + + // General + eQMI_CALL_END_REASON_UNSPECIFIED = 1, // 1 + eQMI_CALL_END_REASON_CLIENT_END, // 2 + eQMI_CALL_END_REASON_NO_SRV, // 3 + eQMI_CALL_END_REASON_FADE, // 4 + eQMI_CALL_END_REASON_REL_NORMAL, // 5 + eQMI_CALL_END_REASON_ACC_IN_PROG, // 6 + eQMI_CALL_END_REASON_ACC_FAIL, // 7 + eQMI_CALL_END_REASON_REDIR_OR_HANDOFF, // 8 + eQMI_CALL_END_REASON_CLOSE_IN_PROGRESS, // 9 + eQMI_CALL_END_REASON_AUTH_FAILED, // 10 + eQMI_CALL_END_REASON_INTERNAL, // 11 + + // CDMA + eQMI_CALL_END_REASON_CDMA_LOCK = 500, // 500 + eQMI_CALL_END_REASON_INTERCEPT, // 501 + eQMI_CALL_END_REASON_REORDER, // 502 + eQMI_CALL_END_REASON_REL_SO_REJ, // 503 + eQMI_CALL_END_REASON_INCOM_CALL, // 504 + eQMI_CALL_END_REASON_ALERT_STOP, // 505 + eQMI_CALL_END_REASON_ACTIVATION, // 506 + eQMI_CALL_END_REASON_MAX_ACCESS_PROBE, // 507 + eQMI_CALL_END_REASON_CCS_NOT_SUPPORTED_BY_BS, // 508 + eQMI_CALL_END_REASON_NO_RESPONSE_FROM_BS, // 509 + eQMI_CALL_END_REASON_REJECTED_BY_BS, // 510 + eQMI_CALL_END_REASON_INCOMPATIBLE, // 511 + eQMI_CALL_END_REASON_ALREADY_IN_TC, // 512 + eQMI_CALL_END_REASON_USER_CALL_ORIG_DURING_GPS, // 513 + eQMI_CALL_END_REASON_USER_CALL_ORIG_DURING_SMS, // 514 + eQMI_CALL_END_REASON_NO_CDMA_SRV, // 515 + + // GSM/WCDMA + eQMI_CALL_END_REASON_CONF_FAILED = 1000, // 1000 + eQMI_CALL_END_REASON_INCOM_REJ, // 1001 + eQMI_CALL_END_REASON_NO_GW_SRV, // 1002 + eQMI_CALL_END_REASON_NETWORK_END, // 1003 + + eQMI_CALL_END_REASON_LLC_SNDCP_FAILURE, // 1004 + eQMI_CALL_END_REASON_INSUFFICIENT_RESOURCES, // 1005 + eQMI_CALL_END_REASON_OPTION_TEMP_OOO, // 1006 + eQMI_CALL_END_REASON_NSAPI_ALREADY_USED, // 1007 + eQMI_CALL_END_REASON_REGULAR_DEACTIVATION, // 1008 + eQMI_CALL_END_REASON_NETWORK_FAILURE, // 1009 + eQMI_CALL_END_REASON_UMTS_REATTACH_REQ, // 1010 + eQMI_CALL_END_REASON_UMTS_PROTOCOL_ERROR, // 1011 + eQMI_CALL_END_REASON_OPERATOR_BARRING, // 1012 + eQMI_CALL_END_REASON_UNKNOWN_APN, // 1013 + eQMI_CALL_END_REASON_UNKNOWN_PDP, // 1014 + eQMI_CALL_END_REASON_GGSN_REJECT, // 1015 + eQMI_CALL_END_REASON_ACTIVATION_REJECT, // 1016 + eQMI_CALL_END_REASON_OPTION_NOT_SUPPORTED, // 1017 + eQMI_CALL_END_REASON_OPTION_UNSUBSCRIBED, // 1018 + eQMI_CALL_END_REASON_QOS_NOT_ACCEPTED, // 1019 + eQMI_CALL_END_REASON_TFT_SEMANTIC_ERROR, // 1020 + eQMI_CALL_END_REASON_TFT_SYNTAX_ERROR, // 1021 + eQMI_CALL_END_REASON_UNKNOWN_PDP_CONTEXT, // 1022 + eQMI_CALL_END_REASON_FILTER_SEMANTIC_ERROR, // 1023 + eQMI_CALL_END_REASON_FILTER_SYNTAX_ERROR, // 1024 + eQMI_CALL_END_REASON_PDP_WITHOUT_ACTIVE_TFT, // 1025 + eQMI_CALL_END_REASON_INVALID_TRANSACTION_ID, // 1026 + eQMI_CALL_END_REASON_MESSAGE_SEMANTIC_ERROR, // 1027 + eQMI_CALL_END_REASON_INVALID_MANDATORY_INFO, // 1028 + eQMI_CALL_END_REASON_TYPE_UNSUPPORTED, // 1029 + eQMI_CALL_END_REASON_MSG_TYPE_WRONG_FOR_STATE, // 1030 + eQMI_CALL_END_REASON_UNKNOWN_INFO_ELEMENT, // 1031 + eQMI_CALL_END_REASON_CONDITIONAL_IE_ERROR, // 1032 + eQMI_CALL_END_REASON_MSG_WRONG_FOR_PROTOCOL, // 1033 + eQMI_CALL_END_REASON_APN_TYPE_CONFLICT, // 1034 + eQMI_CALL_END_REASON_NO_GPRS_CONTEXT, // 1035 + eQMI_CALL_END_REASON_FEATURE_NOT_SUPPORTED, // 1036 + + // CDMA 1xEV-DO (HDR) + eQMI_CALL_END_REASON_CD_GEN_OR_BUSY = 1500, // 1500 + eQMI_CALL_END_REASON_CD_BILL_OR_AUTH, // 1501 + eQMI_CALL_END_REASON_CHG_HDR, // 1502 + eQMI_CALL_END_REASON_EXIT_HDR, // 1503 + eQMI_CALL_END_REASON_HDR_NO_SESSION , // 1504 + eQMI_CALL_END_REASON_HDR_ORIG_DURING_GPS_FIX, // 1505 + eQMI_CALL_END_REASON_HDR_CS_TIMEOUT , // 1506 + eQMI_CALL_END_REASON_HDR_RELEASED_BY_CM, // 1507 + + eQMI_CALL_END_REASON_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMICallEndReason validity check + +PARAMETERS: + err [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMICallEndReason err ) +{ + if ( (err >= eQMI_CALL_END_REASON_UNSPECIFIED) + && (err <= eQMI_CALL_END_REASON_INTERNAL) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CDMA_LOCK) + && (err <= eQMI_CALL_END_REASON_NO_CDMA_SRV) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CONF_FAILED) + && (err <= eQMI_CALL_END_REASON_FEATURE_NOT_SUPPORTED) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CD_GEN_OR_BUSY) + && (err <= eQMI_CALL_END_REASON_HDR_RELEASED_BY_CM) ) + { + return true; + } + + return false; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/QMIProtocolServer.cpp b/gobi-api/GobiAPI_1.0.40/Core/QMIProtocolServer.cpp new file mode 100755 index 0000000..9a15f21 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/QMIProtocolServer.cpp @@ -0,0 +1,424 @@ +/*=========================================================================== +FILE: + QMIProtocolServer.h + +DESCRIPTION: + QMI protocol server + +PUBLIC CLASSES AND METHODS: + cQMIProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QMIProtocolServer.h" +#include "QMIBuffers.h" + +/*=========================================================================*/ +// cQMIProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cQMIProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + serviceType [ I ] - QMI service type requested + bufferSzRx [ I ] - Size of data buffer for incoming data + logSz [ I ] - Size of log (number of buffers) + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQMIProtocolServer::cQMIProtocolServer( + eQMIService serviceType, + ULONG bufferSzRx, + ULONG logSz ) + : cProtocolServer( MapQMIServiceToProtocol( serviceType, false ), + MapQMIServiceToProtocol( serviceType, true ), + bufferSzRx, + logSz ), + mLastTID( (WORD)INVALID_QMI_TRANSACTION_ID ), + mService( serviceType ), + mMEID( "" ) + +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cQMIProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQMIProtocolServer::~cQMIProtocolServer() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the configured QMI service using the given QMI + control file + +PARAMETERS: + pControlFile [ I ] - QMI control file + +SEQUENCING: + This method is sequenced according to the command event, i.e. any + other thread that needs to send a command to the protocol server + thread will block until this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::Connect( LPCSTR pControlFile ) +{ + // Assume failure + bool bRC = false; + if (IsValid( mService ) == false || mService == eQMI_SVC_CONTROL) + { + return bRC; + } + + // Store the MEID + mMEID = GetDeviceMEID( pControlFile ); + + // Pass service file to base class for actual connection + bRC = cProtocolServer::Connect( pControlFile ); + + if (bRC == false) + { + TRACE( "QMI connect %d failed\n", mService ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetDeviceMEID (Internal Method) + +DESCRIPTION: + Get device MEID by interfacing to the given QMI control file + +PARAMETERS: + deviceNode [ I ] - QMI device node + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + std::string (empty upon failure) +===========================================================================*/ +std::string cQMIProtocolServer::GetDeviceMEID( std::string deviceNode ) +{ + std::string retStr = ""; + + int devHandle = open( deviceNode.c_str(), 0 ); + if (devHandle == INVALID_HANDLE_VALUE) + { + return retStr; + } + + char devMEID[15]; + memset( &devMEID[0], 0, 15 ); + + if (ioctl( devHandle, QMI_GET_MEID_IOCTL, &devMEID[0] ) != 0) + { + close( devHandle ); + return retStr; + } + + // Enforce null + devMEID[14] = 0; + + retStr = &devMEID[0]; + + close( devHandle ); +} + +/*=========================================================================== +METHOD: + ValidateRequest (Internal Method) + +DESCRIPTION: + Validate a request that is about to be scheduled + +SEQUENCING: + This method is sequenced according to the command event, i.e. any + other thread that needs to send a command to the protocol server + thread will block until this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::ValidateRequest( const sProtocolRequest & req ) +{ + if (cProtocolServer::ValidateRequest( req ) == false) + { + return false; + } + + sQMIServiceBuffer qmiReq( req.GetSharedBuffer() ); + return qmiReq.IsValid(); +} + +/*=========================================================================== +METHOD: + InitializeComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port initialization + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::InitializeComm() +{ + // Setup the QMI Service type + int result = mComm.RunIOCTL( QMI_GET_SERVICE_FILE_IOCTL, + (void*)(unsigned long)mService ); + + if (result == 0) + { + return true; + } + else + { + return false; + } +} + +/*=========================================================================== +METHOD: + CleanupComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port cleanup + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::CleanupComm() +{ + // Nothing to actually do here + return true; +} + +/*=========================================================================== +METHOD: + DecodeRxData (Internal Method) + +DESCRIPTION: + Decode incoming data into QMI indications/responses + +PARAMETERS: + bytesReceived [ I ] - Number of bytes to decoded + rspIdx [ O ] - Log index of last valid response (not used) + bAbortTx [ O ] - Response aborts current transmission? (not used) + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool - Was a response received? +===========================================================================*/ +bool cQMIProtocolServer::DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ) +{ + // Assume failure + bool bRC = false; + + rspIdx = INVALID_LOG_INDEX; + bAbortTx = false; + + // Something to decode from? + if (bytesReceived == 0) + { + return bRC; + } + + // Set protocol type (we have to be dealing with a valid QMI service) + eProtocolType pt = MapQMIServiceToProtocol( mService, false ); + if (pt == ePROTOCOL_ENUM_BEGIN) + { + return bRC; + } + + sSharedBuffer * pTmp = 0; + pTmp = new sSharedBuffer( mpRxBuffer, bytesReceived, pt ); + if (pTmp != 0) + { + sQMIServiceBuffer tmpBuf( pTmp ); + if (tmpBuf.IsValid() == true) + { + rspIdx = mLog.AddBuffer( tmpBuf ); + if (IsResponse( tmpBuf ) == true) + { + bRC = true; + } + else + { + rspIdx = INVALID_LOG_INDEX; + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + EncodeTxData (Internal Method) + +DESCRIPTION: + Encode data for transmission + +PARAMETERS: + pBuffer [ I ] - Data to be encoded + bEncoded [ O ] - Do we even encode data? + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + sSharedBuffer * - Encoded data (0 upon error when encoding is indicated) +===========================================================================*/ +sSharedBuffer * cQMIProtocolServer::EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) +{ + WORD tid = ++mLastTID; + if (tid == (WORD)INVALID_QMI_TRANSACTION_ID) + { + tid++; + } + + sQMIServiceBuffer tmpBuf( pBuffer ); + tmpBuf.SetTransactionID( tid ); + + // No actual encoding required as we alter the original request + bEncoded = false; + return 0; +}; + +/*=========================================================================== +METHOD: + IsResponse (Internal Method) + +DESCRIPTION: + Is the passed in data a response to the current request? + +PARAMETERS: + rsp [ I ] - Candidate response + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::IsResponse( const sProtocolBuffer & rsp ) +{ + // Assume not + bool bRC = false; + if ( (mpActiveRequest == 0) + || (mpActiveRequest->mRequest.IsValid() == false) + || (mpActiveRequest->mbWaitingForResponse == false) + || (rsp.IsValid() == false) ) + { + return bRC; + } + + sQMIServiceBuffer qmiReq( mpActiveRequest->mRequest.GetSharedBuffer() ); + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + + if (qmiReq.IsValid() == false || qmiRsp.IsValid() == false) + { + return bRC; + } + + if (qmiRsp.IsResponse() == false) + { + return bRC; + } + + WORD reqID = qmiReq.GetTransactionID(); + WORD rspID = qmiRsp.GetTransactionID(); + + if ( (reqID == (WORD)INVALID_QMI_TRANSACTION_ID) + || (rspID == (WORD)INVALID_QMI_TRANSACTION_ID) + || (reqID != rspID) ) + { + return bRC; + } + + // Sadly there are documentated cases of firmware returning responses + // with a matching transaction ID but a mismatching message ID. There + // is no reason for this to be considered valid behavior as of yet + ULONG reqMsgID = qmiReq.GetMessageID(); + ULONG rspMsgID = qmiRsp.GetMessageID(); + + if (reqMsgID != rspMsgID) + { + return bRC; + } + + bRC = true; + return bRC; +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/QMIProtocolServer.h b/gobi-api/GobiAPI_1.0.40/Core/QMIProtocolServer.h new file mode 100755 index 0000000..1276de9 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/QMIProtocolServer.h @@ -0,0 +1,128 @@ +/*=========================================================================== +FILE: + QMIProtocolServer.h + +DESCRIPTION: + QMI protocol server + +PUBLIC CLASSES AND METHODS: + cQMIProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolServer.h" +#include "QMIEnum.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cQMIProtocolServer +/*=========================================================================*/ +class cQMIProtocolServer : public cProtocolServer +{ + public: + // Constructor + cQMIProtocolServer( + eQMIService serviceType, + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cQMIProtocolServer(); + + // Connect to the given QMI service using the configured QMI + // control file + bool Connect( LPCSTR pControlFile ); + + // (Inline) Return the device MEID + std::string GetMEID() + { + return mMEID; + }; + + // (Inline) Return the QMI service type + eQMIService GetServiceType() + { + return mService; + }; + + // Get device MEID by interfacing to the given device node + static std::string GetDeviceMEID( std::string deviceNode ); + + protected: + // Validate a request that is about to be scheduled + virtual bool ValidateRequest( const sProtocolRequest & req ); + + // Perform protocol specific communications port initialization + virtual bool InitializeComm(); + + // Perform protocol specific communications port cleanup + virtual bool CleanupComm(); + + // Decode incoming data into packets returning the last response + virtual bool DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ); + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ); + + // Is the passed in data a response to the current request? + virtual bool IsResponse( const sProtocolBuffer & rsp ); + + // (Inline) Is the passed in data a response that aborts the + // current request? + virtual bool IsTxAbortResponse( const sProtocolBuffer & /* rsp */ ) + { + // QMI doesn't necessarily require this + return false; + }; + + /* Current transaction ID */ + SHORT mLastTID; + + /* Type of QMI service we are serving */ + eQMIService mService; + + /* Device MEID */ + std::string mMEID; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Core/SharedBuffer.cpp b/gobi-api/GobiAPI_1.0.40/Core/SharedBuffer.cpp new file mode 100755 index 0000000..74334e8 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/SharedBuffer.cpp @@ -0,0 +1,382 @@ +/*=========================================================================== +FILE: + SharedBuffer.cpp + +DESCRIPTION: + Shareable protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + + sSharedBuffer + Simple struct to represent a reference counted shareable (no copy) + buffer, as the basis for all buffer related classes + + sDiagBuffer + Simple struct to represent a DIAG buffer using a reference counted + (shared) buffer, this allows us to use in in several places without + copying it once in each place. A few base services are provided + but the main purpose is to provide a class to inherit off of for + DIAG command code specific DIAG buffers + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "SharedBuffer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Synchronization object +struct sSharedBufferSync +{ + public: + // Constructor + sSharedBufferSync() + : mbInitialized( false ) + { + int nRet = pthread_mutex_init( &mSyncSection, NULL ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to init sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + mbInitialized = true; + }; + + // Destructor + ~sSharedBufferSync() + { + mbInitialized = false; + int nRet = pthread_mutex_destroy( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to destroy sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + } + + }; + + // Lock sync object + void Lock() + { + if (mbInitialized == true) + { + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to lock sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + } + }; + + // Unlock sync object + void Unlock() + { + if (mbInitialized == true) + { + int nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to unlock sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + } + }; + + protected: + /* DIAG buffer critical section */ + pthread_mutex_t mSyncSection; + + /* Has this object been initialized? */ + bool mbInitialized; +}; + +// Global (across all shared buffers) reference count guard +sSharedBufferSync gRefCount; + +/*=========================================================================*/ +// sSharedBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sSharedBuffer (Public Method) + +DESCRIPTION: + Constructor (copy passed in buffer) + +PARAMETERS: + pDataToCopy [ I ] - The data buffer to copy (should be non-zero) + dataLen [ I ] - The length of the above buffer (should be > 1) + dataType [ I ] - Type of data (not used internal to class) + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::sSharedBuffer( + const BYTE * pDataToCopy, + ULONG dataLen, + ULONG dataType ) + : mpData( 0 ), + mSize( 0 ), + mType( dataType ), + mRefCount( 0 ) +{ + // Length not too small/not too big? + if (IsValidSize( dataLen ) == true) + { + // Yes, data actually exists? + if (pDataToCopy != 0) + { + // Yes, try to allocate memory + mpData = new BYTE[dataLen]; + if (mpData != 0) + { + // Now copy into our allocation + memcpy( (PVOID)mpData, + (LPCVOID)pDataToCopy, + (SIZE_T)dataLen ); + + // Now set the size, we do this last so that our double + // deletion logic is only applied if we had an allocation + // in the first place + mSize = dataLen; + } + } + } +} + +/*=========================================================================== +METHOD: + sSharedBuffer (Public Method) + +DESCRIPTION: + Constructor (assume ownership of passed in buffer) + +PARAMETERS: + dataLen [ I ] - The length of the above buffer (should be > 1) + pDataToOwn [ I ] - The data buffer to assume ownership of (should + be non-zero) + + dataType [ I ] - Type of data (not used internal to class) + + NOTE: The order is intentionally reversed from the previous constructor + to avoid any cases of mistaken identity (copy versus assume ownership) + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::sSharedBuffer( + ULONG dataLen, + PBYTE pDataToOwn, + ULONG dataType ) + : mpData( 0 ), + mSize( 0 ), + mType( dataType ), + mRefCount( 0 ) +{ + // Data actually exists? + if (pDataToOwn != 0) + { + // Yes, length not too small/not too big? + if (IsValidSize( dataLen ) == true) + { + // Yes, assume ownership of the passed in buffer + mpData = pDataToOwn; + mSize = dataLen; + } + else + { + // This data buffer is not acceptable to us, but we have assumed + // ownership of the memory which we will now free + delete [] pDataToOwn; + } + } +} + +/*=========================================================================== +METHOD: + ~sSharedBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::~sSharedBuffer() +{ + ASSERT( mRefCount == 0 ); + + // Buffer data to free? + if (mpData != 0) + { + // Yes, zero first byte for caution and then delete it + mpData[0] = 0; + delete [] mpData; + + // Even more caution, zero out pointer + mpData = 0; + } + else if (mSize != 0) + { + ASSERT( (PVOID)("Double deletion detected in ~sSharedBuffer") == 0 ); + } +} + +/*=========================================================================== +METHOD: + operator == (Public Method) + +DESCRIPTION: + Equality operator + +RETURN VALUE: + bool +===========================================================================*/ +bool sSharedBuffer::operator == ( const sSharedBuffer & refBuf ) const +{ + // Assume they are not equal + bool bEq = false; + + // The buffers must be the same + if (mpData == refBuf.mpData) + { + if (mSize == refBuf.mSize) + { + if (mRefCount == refBuf.mRefCount) + { + if (mType == refBuf.mType) + { + // The shared buffers are the same + bEq = true; + } + } + else + { + // Very odd - the buffers are the same, but not the ref count?!? + ASSERT( 0 ); + } + } + else + { + // Very odd - the buffers are the same, but not the size?!? + ASSERT( 0 ); + } + } + + return bEq; +} + +/*=========================================================================== +METHOD: + operator != (Public Method) + +DESCRIPTION: + Inequality operator + +RETURN VALUE: + bool +===========================================================================*/ +bool sSharedBuffer::operator != ( const sSharedBuffer & refBuf ) const +{ + if (*this == refBuf) + { + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + AddRef (Internal Method) + +DESCRIPTION: + Increment reference count + +RETURN VALUE: + None +===========================================================================*/ +void sSharedBuffer::AddRef() +{ + gRefCount.Lock(); + mRefCount++; + gRefCount.Unlock(); +} + +/*=========================================================================== +METHOD: + Release (Internal Method) + +DESCRIPTION: + Release reference, delete if reference count zero + +RETURN VALUE: + None +===========================================================================*/ +void sSharedBuffer::Release() +{ + gRefCount.Lock(); + + ASSERT( mRefCount != 0 ); + + // Decrement reference count + if (mRefCount > 0) + { + mRefCount--; + } + + // ... and delete if reference count now 0 + if (mRefCount == 0) + { + delete this; + } + + gRefCount.Unlock(); +} diff --git a/gobi-api/GobiAPI_1.0.40/Core/SharedBuffer.h b/gobi-api/GobiAPI_1.0.40/Core/SharedBuffer.h new file mode 100755 index 0000000..c2d4bc7 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/SharedBuffer.h @@ -0,0 +1,166 @@ +/*=========================================================================== +FILE: + SharedBuffer.h + +DESCRIPTION: + Shareable buffer structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sSharedBuffer + Simple struct to represent a reference counted shareable (no copy) + buffer, as the basis for all buffer related classes + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +struct sProtocolBuffer; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum size of a shared buffer +const ULONG MAX_SHARED_BUFFER_SIZE = 1024 * 16 + 256; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sSharedBuffer +// +// Simple struct to represent a reference counted shareable (no copy) +// buffer, as the basis for all buffer related classes +// +// NOTE: Do *NOT* create instances of this structure on the stack, it +// must be dynamically allocated in order to function correctly +/*=========================================================================*/ +struct sSharedBuffer +{ + public: + // Constructor (copy passed in buffer) + sSharedBuffer( + const BYTE * pDataToCopy, + ULONG dataLen, + ULONG dataType ); + + // Constructor (assume ownership of passed in buffer) + sSharedBuffer( + ULONG dataLen, + PBYTE pDataToOwn, + ULONG dataType ); + + // Destructor + virtual ~sSharedBuffer(); + + // Equality operator + bool operator == ( const sSharedBuffer & ) const; + + // Inequality operator + bool operator != ( const sSharedBuffer & ) const; + + // (Inline) Get buffer + const BYTE * GetBuffer() const + { + return mpData; + }; + + // (Inline) Get buffer size + ULONG GetSize() const + { + return mSize; + }; + + // (Inline) Get buffer type + ULONG GetType() const + { + return mType; + }; + + // (Inline) Is this buffer valid? + bool IsValid() const + { + return (mpData != 0 && IsValidSize( mSize )); + }; + + // (Inline) Get reference count + ULONG GetRefCount() const + { + return mRefCount; + }; + + // (Static Inline) Is the passed in size within the allowable range + // a shared buffer? + static bool IsValidSize( ULONG sz ) + { + return (sz > 0 && sz <= MAX_SHARED_BUFFER_SIZE); + }; + + protected: + // Add reference + void AddRef(); + + // Release reference, delete if reference count zero + void Release(); + + /* Data */ + PBYTE mpData; + + /* Size of data */ + ULONG mSize; + + /* Type of data */ + ULONG mType; + + /* Reference count */ + ULONG mRefCount; + + private: + // Leave copy constructor and assignment operator unimplemented + // to prevent unintentional and unauthorized copying of the object + // (which would lead to bad reference counting) + sSharedBuffer( const sSharedBuffer & ); + sSharedBuffer & operator = ( const sSharedBuffer & ); + + friend struct sProtocolBuffer; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + diff --git a/gobi-api/GobiAPI_1.0.40/Core/StdAfx.h b/gobi-api/GobiAPI_1.0.40/Core/StdAfx.h new file mode 100755 index 0000000..8063e7b --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/StdAfx.h @@ -0,0 +1,175 @@ +/*=========================================================================== +FILE: + StdAfx.h + +DESCRIPTION: + Application Framework eXtenstions for Linux + +PUBLIC CLASSES AND FUNCTIONS: + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once +//--------------------------------------------------------------------------- +// Includes +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//--------------------------------------------------------------------------- +// Macro defination +//--------------------------------------------------------------------------- + +#define ASSERT( x ) assert( x ) + +#ifdef DEBUG + #define TRACE printf +#else + #define TRACE(...) +#endif + +//--------------------------------------------------------------------------- +// data type defination +//--------------------------------------------------------------------------- +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef CONST +#define CONST const +#endif + +typedef void VOID; +typedef unsigned long DWORD; +typedef int BOOL; +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef float FLOAT; +typedef long long LONGLONG; +typedef unsigned long long ULONGLONG; +typedef signed char INT8; +typedef double DOUBLE; + +typedef int INT; +typedef unsigned int UINT; +typedef unsigned int * PUINT; +typedef INT HANDLE; +typedef HANDLE HMODULE; + +typedef char CHAR; +typedef short SHORT; +typedef long LONG; + +typedef unsigned long ULONG; +typedef ULONG * PULONG; +typedef unsigned short USHORT; +typedef USHORT * PUSHORT; +typedef unsigned char UCHAR; +typedef UCHAR * PUCHAR; +typedef char * PSZ; + + +typedef CONST CHAR * LPCSTR; +typedef CHAR * LPSTR; + +typedef BYTE * PBYTE; +typedef BOOL * PBOOL; +typedef INT * PINT; +typedef UINT * LPINT; +typedef WORD * PWORD; +typedef PWORD LPWORD; +typedef LONG * LPLONG; +typedef DWORD * PDWORD; +typedef VOID * PVOID; +typedef PVOID LPVOID; +typedef const void * LPCVOID; + +typedef size_t SIZE_T; +typedef double DATE; + +// Error code +#define NO_ERROR 0L +#define ERROR_SUCCESS 0L +#define ERROR_NO_MORE_ITEMS 259L +#define ERROR_CRC 23L +#define ERROR_OUTOFMEMORY 14L +#define ERROR_CAN_NOT_COMPLETE 1003L +#define ERROR_REVISION_MISMATCH 1306L +#define ERROR_BAD_ARGUMENTS 160L +#define INVALID_SET_FILE_POINTER -1 +#define VALID_HANDLE_VALUE 0 +#define INVALID_HANDLE_VALUE -1 +#define INVALID_FILE_SZ -1 + +#define ERROR_GEN_FAILURE 31L +#define ERROR_FILE_NOT_FOUND 2L +#define ERROR_NOT_ENOUGH_MEMORY 8L +#define ERROR_INVALID_PARAMETER 87L +#define ERROR_BAD_FORMAT 11L + + +// Other Constant definitions +#define MAX_PATH 512 +#define INFINITE 0xffffffff + + +// SIOCIWFIRSTPRIV = 0x8BE0 + +// Device I/O control code for setting QMI service +#define QMI_GET_SERVICE_FILE_IOCTL 0x8BE0 + 1 + +// Device I/O control code for obtaining device VIDPID +#define QMI_GET_VIDPID_IOCTL 0x8BE0 + 2 + +// Device I/O control code for obtaining device MEID +#define QMI_GET_MEID_IOCTL 0x8BE0 + 3 + +// Define the directions for pipes +#define READING 0 +#define WRITING 1 diff --git a/gobi-api/GobiAPI_1.0.40/Core/SyncQueue.h b/gobi-api/GobiAPI_1.0.40/Core/SyncQueue.h new file mode 100755 index 0000000..7c62e3f --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Core/SyncQueue.h @@ -0,0 +1,419 @@ +/*=========================================================================== +FILE: + SyncQueue.h + +DESCRIPTION: + Declaration/Implementation of cSyncQueue class + +PUBLIC CLASSES AND METHODS: + cSyncQueue + Synchronized shareable (across multiple threads) queue of + structures with event notifications + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include +#include "Event.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cSyncQueue +/*=========================================================================*/ +template class cSyncQueue +{ + public: + // (Inline) Constructor + cSyncQueue( + ULONG maxElements, + bool bSignalEvent = false ) + : mSignature( (ULONG)eSYNC_QUEUE_SIG ), + mSignalEvent(), + mbSignalEvent( bSignalEvent ), + mMaxElements( maxElements ), + mTotalElements( 0 ) + { + // Create sync CS + int nRet = pthread_mutex_init( &mSyncSection, NULL ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to init sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + }; + + // (Inline) Destructor + ~cSyncQueue() + { + if (IsValid() == false) + { + ASSERT( (PVOID)"Double deletion detected in ~cSyncQueue" == 0 ); + } + else + { + EmptyQueue(); + + mSignature = 0; + int nRet = pthread_mutex_destroy( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to destroy sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + } + + }; + + // (Inline) Add an element to the queue + bool AddElement( const tElementType & elem ) + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Are we out of space? + if ((ULONG)mElementDeque.size() >= mMaxElements) + { + // Yes, drop oldest element + mElementDeque.pop_front(); + } + + // Add new item to the queue + mElementDeque.push_back( elem ); + mTotalElements++; + + // Set event? + if (mbSignalEvent == true) + { + // Signal index of event + nRet = mSignalEvent.Set( mTotalElements - 1 ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to signal. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + } + + // Success! + bRC = true; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Add an element to the queue returning the index of + // the element + bool AddElement( + const tElementType & elem, + ULONG & idx ) + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Are we out of space? + if ((ULONG)mElementDeque.size() >= mMaxElements) + { + mElementDeque.pop_front(); + } + + // Add new item to the queue + mElementDeque.push_back( elem ); + idx = mTotalElements++; + + // Set event? + if (mbSignalEvent == true) + { + // Signal index of event + nRet = mSignalEvent.Set( mTotalElements - 1 ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to signal. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + } + + // Success! + bRC = true; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Return given element in the queue + bool GetElement( + ULONG idx, + tElementType & elem ) const + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Is this a current element index? + ULONG expiredIndices = mTotalElements - (ULONG)mElementDeque.size(); + if (idx >= expiredIndices) + { + // Yes, grab it from the deque + idx -= expiredIndices; + if (idx < (ULONG)mElementDeque.size()) + { + elem = mElementDeque[idx]; + bRC = true; + } + } + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Empty element queue + bool EmptyQueue() + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + + mElementDeque.clear(); + mTotalElements = 0; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + bRC = true; + return bRC; + }; + + // (Inline) Return the number of queued elements + ULONG GetQueueCount() const + { + ULONG elems = 0; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return elems; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + elems = (ULONG)mElementDeque.size(); + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + return elems; + }; + + // (Inline) Return the total number of elements added to queue + ULONG GetTotalCount() const + { + ULONG elems = 0; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return elems; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + elems = mTotalElements; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + return elems; + }; + + // (Inline) Return the signal event + cEvent & GetSignalEvent() const + { + return mSignalEvent; + }; + + // (Inline) Is this sync queue valid? + bool IsValid() const + { + return (mSignature == (ULONG)eSYNC_QUEUE_SIG); + }; + + protected: + // Object signature + enum eClassConstants + { + eSYNC_QUEUE_SIG = 0x1799A2BC + }; + + /* Object signature */ + ULONG mSignature; + + /* Multithreaded mutex type */ + mutable pthread_mutex_t mSyncSection; + + /* Signal event, set everytime an element is added (if configured) */ + mutable cEvent mSignalEvent; + + /* Use above signal event? */ + bool mbSignalEvent; + + /* Maximum number of elements to add to the deque */ + ULONG mMaxElements; + + /* Total number of elements added to the deque */ + ULONG mTotalElements; + + /* Element queue */ + std::deque mElementDeque; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Database/Makefile.am b/gobi-api/GobiAPI_1.0.40/Database/Makefile.am new file mode 100644 index 0000000..720a3fb --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Database/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS=QMI + diff --git a/gobi-api/GobiAPI_1.0.40/Database/QMI/Entity.txt b/gobi-api/GobiAPI_1.0.40/Database/QMI/Entity.txt new file mode 100755 index 0000000..593b6e2 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Database/QMI/Entity.txt @@ -0,0 +1,964 @@ +30^"32,1"^"CTL/Set Instance ID Request/Instance"^50900^-1^0 +30^"34,1"^"CTL/Get Client ID Request/Type"^50905^-1^0 +30^"35,1"^"CTL/Release Client ID Request/ID"^50906^-1^0 +30^"38,1"^"CTL/Set Data Format Request/Format"^50907^-1^0 +30^"38,16"^"CTL/Set Data Format Request/Protocol"^50908^-1^0 +30^"40,1"^"CTL/Set Event Report Request/Report"^50909^-1^0 +30^"41,1"^"CTL/Set Power Save Config Request/Descriptor"^50911^-1^0 +30^"41,17"^"CTL/Set Power Save Config Request/Permitted Set"^50912^-1^0 +30^"42,1"^"CTL/Set Power Save Mode Request/Mode"^50913^-1^0 +31^"32,1"^"CTL/Set Instance ID Response/Link"^50901^-1^0 +31^"32,2"^"CTL/Set Instance ID Response/Result Code"^50000^-1^0 +31^"33,1"^"CTL/Get Version Info Response/List"^50902^-1^0 +31^"33,2"^"CTL/Get Version Info Response/Result Code"^50000^-1^0 +31^"33,16"^"CTL/Get Version Info Response/Addendum"^50904^-1^0 +31^"34,1"^"CTL/Get Client ID Response/ID"^50906^-1^0 +31^"34,2"^"CTL/Get Client ID Response/Result Code"^50000^-1^0 +31^"35,1"^"CTL/Release Client ID Response/ID"^50906^-1^0 +31^"35,2"^"CTL/Release Client ID Response/Result Code"^50000^-1^0 +31^"38,2"^"CTL/Set Data Format Response/Result Code"^50000^-1^0 +31^"38,16"^"CTL/Set Data Format Response/Protocol"^50908^-1^0 +31^"40,2"^"CTL/Set Event Report Response/Result Code"^50000^-1^0 +31^"41,2"^"CTL/Set Power Save Config Response/Result Code"^50000^-1^0 +31^"42,2"^"CTL/Set Power Save Mode Response/Result Code"^50000^-1^0 +31^"43,1"^"CTL/Get Power Save Mode Response/Mode"^50913^-1^0 +31^"43,2"^"CTL/Get Power Save Mode Response/Result Code"^50000^-1^0 +32^"36,1"^"CTL/Release Client ID Indication/ID"^50906^-1^0 +32^"37,1"^"CTL/Invalid Client ID Indication/ID"^50906^-1^0 +32^"40,1"^"CTL/Event Report Indication/Report"^50910^-1^0 +33^"1,16"^"WDS/Set Event Report Request/Channel Rate Indicator"^50010^-1 +33^"1,17"^"WDS/Set Event Report Request/Transfer Statistics Indicator"^50011^-1 +33^"1,18"^"WDS/Set Event Report Request/Data Bearer Technology Indicator"^50012^-1 +33^"1,19"^"WDS/Set Event Report Request/Dormancy Status Indicator"^50041^-1 +33^"1,20"^"WDS/Set Event Report Request/MIP Status Indicator"^50087^-1 +33^"1,21"^"WDS/Set Event Report Request/Current Data Bearer Technology Indicator"^50012^-1 +33^"2,1"^"WDS/Abort Request/Transaction ID"^50001^-1 +33^"32,16"^"WDS/Start Network Interface Request/Primary DNS"^50021^-1 +33^"32,17"^"WDS/Start Network Interface Request/Secondary DNS"^50021^-1 +33^"32,18"^"WDS/Start Network Interface Request/Primary NBNS"^50021^-1 +33^"32,19"^"WDS/Start Network Interface Request/Secondary NBNS"^50021^-1 +33^"32,20"^"WDS/Start Network Interface Request/Context APN Name"^50022^-1 +33^"32,21"^"WDS/Start Network Interface Request/IP Address"^50021^-1 +33^"32,22"^"WDS/Start Network Interface Request/Authentication"^50023^-1 +33^"32,23"^"WDS/Start Network Interface Request/Username"^50024^-1 +33^"32,24"^"WDS/Start Network Interface Request/Password"^50025^-1 +33^"32,25"^"WDS/Start Network Interface Request/IP Family"^50097^-1 +33^"32,48"^"WDS/Start Network Interface Request/Technology Preference"^50026^-1 +33^"32,49"^"WDS/Start Network Interface Request/3GPP Profile Identifier"^50027^-1 +33^"32,50"^"WDS/Start Network Interface Request/3GPP2 Profile Identifier"^50027^-1 +33^"32,51"^"WDS/Start Network Interface Request/Autoconnect"^50045^-1 +33^"32,52"^"WDS/Start Network Interface Request/Extended Technology Preference"^50095^-1 +33^"32,53"^"WDS/Start Network Interface Request/Call Type"^50096^-1 +33^"33,1"^"WDS/Stop Network Interface Request/Packet Data Handle"^50028^-1 +33^"33,16"^"WDS/Stop Network Interface Request/Autoconnect"^50046^-1 +33^"36,1"^"WDS/Get Packet Statistics Request/Packet Stats Mask"^50032^-1 +33^"39,1"^"WDS/Create Profile Request/Profile Type"^50033^-1 +33^"39,16"^"WDS/Create Profile Request/Profile Name"^50034^-1 +33^"39,17"^"WDS/Create Profile Request/PDP Type"^50035^-1 +33^"39,20"^"WDS/Create Profile Request/APN Name"^50022^-1 +33^"39,21"^"WDS/Create Profile Request/Primary DNS"^50021^-1 +33^"39,22"^"WDS/Create Profile Request/Secondary DNS"^50021^-1 +33^"39,23"^"WDS/Create Profile Request/UMTS Requested QoS"^50036^-1 +33^"39,24"^"WDS/Create Profile Request/UMTS Minimum QoS"^50036^-1 +33^"39,25"^"WDS/Create Profile Request/GPRS Requested QoS"^50037^-1 +33^"39,26"^"WDS/Create Profile Request/GPRS Minimum QoS"^50037^-1 +33^"39,27"^"WDS/Create Profile Request/Username"^50024^-1 +33^"39,28"^"WDS/Create Profile Request/Password"^50025^-1 +33^"39,29"^"WDS/Create Profile Request/Authentication"^50023^-1 +33^"39,30"^"WDS/Create Profile Request/IP Address"^50021^-1 +33^"39,31"^"WDS/Create Profile Request/P-CSCF"^50099^-1 +33^"40,1"^"WDS/Modify Profile Request/Profile Identifier"^50038^-1 +33^"40,16"^"WDS/Modify Profile Request/Profile Name"^50034^-1 +33^"40,17"^"WDS/Modify Profile Request/PDP Type"^50035^-1 +33^"40,20"^"WDS/Modify Profile Request/APN Name"^50022^-1 +33^"40,21"^"WDS/Modify Profile Request/Primary DNS"^50021^-1 +33^"40,22"^"WDS/Modify Profile Request/Secondary DNS"^50021^-1 +33^"40,23"^"WDS/Modify Profile Request/UMTS Requested QoS"^50036^-1 +33^"40,24"^"WDS/Modify Profile Request/UMTS Minimum QoS"^50036^-1 +33^"40,25"^"WDS/Modify Profile Request/GPRS Requested QoS"^50037^-1 +33^"40,26"^"WDS/Modify Profile Request/GPRS Minimum QoS"^50037^-1 +33^"40,27"^"WDS/Modify Profile Request/Username"^50024^-1 +33^"40,28"^"WDS/Modify Profile Request/Password"^50025^-1 +33^"40,29"^"WDS/Modify Profile Request/Authentication"^50023^-1 +33^"40,30"^"WDS/Modify Profile Request/IP Address"^50021^-1 +33^"40,31"^"WDS/Modify Profile Request/P-CSCF"^50099^-1 +33^"40,32"^"WDS/Modify Profile Request/PDP Access Control Flag"^60086^-1 +33^"40,33"^"WDS/Modify Profile Request/P-CSCF Address Using DHCP"^60087^-1 +33^"40,34"^"WDS/Modify Profile Request/IM CN Flag"^60088^-1 +33^"40,35"^"WDS/Modify Profile Request/Traffic Flow Template ID1 Parameters"^60018^-1 +33^"40,36"^"WDS/Modify Profile Request/Traffic Flow Template ID2 Parameters"^60018^-1 +33^"40,37"^"WDS/Modify Profile Request/PDP Context Number"^60020^-1 +33^"40,38"^"WDS/Modify Profile Request/PDP Context Secondary Flag"^60021^-1 +33^"40,39"^"WDS/Modify Profile Request/PDP Context Primary ID"^60022^-1 +33^"40,40"^"WDS/Modify Profile Request/IPv6 Address"^60023^-1 +33^"40,41"^"WDS/Modify Profile Request/Requested QoS"^60024^-1 +33^"40,42"^"WDS/Modify Profile Request/Minimum QoS"^60024^-1 +33^"40,43"^"WDS/Modify Profile Request/Primary IPv6"^60090^-1 +33^"40,44"^"WDS/Modify Profile Request/Secondary IPv6"^60090^-1 +33^"40,45"^"WDS/Modify Profile Request/Address Allocation Preference"^60028^-1 +33^"40,46"^"WDS/Modify Profile Request/LTE QoS Parameters"^60029^-1 +33^"40,144"^"WDS/Modify Profile Request/Negotiate DNS Server Prefrence"^60059^-1 +33^"40,145"^"WDS/Modify Profile Request/PPP Session Close Timer DO"^60060^-1 +33^"40,146"^"WDS/Modify Profile Request/PPP Session Close Timer 1X"^60061^-1 +33^"40,147"^"WDS/Modify Profile Request/Allow Linger"^60062^-1 +33^"40,148"^"WDS/Modify Profile Request/LCP ACK Timeout"^60063^-1 +33^"40,149"^"WDS/Modify Profile Request/IPCP ACK Timeout"^60064^-1 +33^"40,150"^"WDS/Modify Profile Request/Authentication Timeout"^60065^-1 +33^"40,154"^"WDS/Modify Profile Request/Authentication Protocol"^60069^-1 +33^"40,155"^"WDS/Modify Profile Request/User ID"^60070^-1 +33^"40,156"^"WDS/Modify Profile Request/Authentication Password"^60071^-1 +33^"40,157"^"WDS/Modify Profile Request/Data Rate"^60072^-1 +33^"40,158"^"WDS/Modify Profile Request/Application Type"^60073^-1 +33^"40,159"^"WDS/Modify Profile Request/Data Mode"^60074^-1 +33^"40,160"^"WDS/Modify Profile Request/Application Priority"^60075^-1 +33^"40,161"^"WDS/Modify Profile Request/APN String"^60076^-1 +33^"40,162"^"WDS/Modify Profile Request/PDN Type"^60077^-1 +33^"40,163"^"WDS/Modify Profile Request/P-CSCF Address Needed"^60078^-1 +33^"40,164"^"WDS/Modify Profile Request/Primary IPv4 Address"^60079^-1 +33^"40,165"^"WDS/Modify Profile Request/Secondary IPv4 Address"^60080^-1 +33^"40,166"^"WDS/Modify Profile Request/Primary IPv6 Address"^60081^-1 +33^"40,167"^"WDS/Modify Profile Request/Secondary IPv6 Address"^60082^-1 +33^"41,1"^"WDS/Delete Profile Request/Profile Identifier"^50038^-1 +33^"43,1"^"WDS/Get Profile Settings Request/Profile Identifier"^50038^-1 +33^"44,1"^"WDS/Get Default Settings Request/Profile Type"^50033^-1 +33^"45,16"^"WDS/Get Current Settings Request/Requested Settings"^50084^-1 +33^"46,1"^"WDS/Set MIP Mode Request/Mobile IP Mode"^50044^-1 +33^"56,1"^"WDS/Get Modem Info Request/Requested Status"^50051^-1 +33^"56,16"^"WDS/Get Modem Info Request/Connection Status Indicator"^50052^-1 +33^"56,17"^"WDS/Get Modem Info Request/Transfer Statistics Indicator"^50053^-1 +33^"56,18"^"WDS/Get Modem Info Request/Dormancy Status Indicator"^50041^-1 +33^"56,19"^"WDS/Get Modem Info Request/Data Bearer Technology Indicator"^50012^-1 +33^"56,20"^"WDS/Get Modem Info Request/Channel Rate Indicator"^50010^-1 +33^"61,1"^"WDS/Set Active MIP Profile Request/Index"^50056^-1 +33^"62,1"^"WDS/Get MIP Profile Request/Index"^50027^-1 +33^"63,1"^"WDS/Set MIP Profile Request/Index"^50056^-1 +33^"63,16"^"WDS/Set MIP Profile Request/State"^50057^-1 +33^"63,17"^"WDS/Set MIP Profile Request/Home Address"^50021^-1 +33^"63,18"^"WDS/Set MIP Profile Request/Primary Home Agent Address"^50021^-1 +33^"63,19"^"WDS/Set MIP Profile Request/Secondary Home Agent Address"^50021^-1 +33^"63,20"^"WDS/Set MIP Profile Request/Reverse Tunneling"^50058^-1 +33^"63,21"^"WDS/Set MIP Profile Request/NAI"^50059^-1 +33^"63,22"^"WDS/Set MIP Profile Request/HA SPI"^50060^-1 +33^"63,23"^"WDS/Set MIP Profile Requeste/AAA SPI"^50061^-1 +33^"63,24"^"WDS/Set MIP Profile Request/MN-HA"^50062^-1 +33^"63,25"^"WDS/Set MIP Profile Request/MN-AAA"^50063^-1 +33^"65,1"^"WDS/Set MIP Parameters Request/SPC"^50070^-1 +33^"65,16"^"WDS/Set MIP Parameters Request/Mobile IP Mode"^50044^-1 +33^"65,17"^"WDS/Set MIP Parameters Request/Retry Attempt Limit"^50064^-1 +33^"65,18"^"WDS/Set MIP Parameters Request/Retry Attempt Interval"^50065^-1 +33^"65,19"^"WDS/Set MIP Parameters Request/Re-Registration Period"^50066^-1 +33^"65,20"^"WDS/Set MIP Parameters Request/Re-Registration Only With Traffic"^50067^-1 +33^"65,21"^"WDS/Set MIP Parameters Request/MN-HA Authenticator Calculator"^50068^-1 +33^"65,22"^"WDS/Set MIP Parameters Request/MN-HA RFC 2002 BIS Authentication"^50069^-1 +33^"69,16"^"WDS/Get Call List Request/List Type"^50073^-1 +33^"70,1"^"WDS/Get Call Record Request/Record ID"^50077^-1 +33^"81,1"^"WDS/Set Autoconnect Setting Request/Autoconnect"^50045^-1 +33^"81,16"^"WDS/Set Autoconnect Setting Request/Roam"^60008^-1 +33^"83,16"^"WDS/Set DNS Setting Request/Primary"^60009^-1 +33^"83,17"^"WDS/Set DNS Setting Request/Secondary"^60009^-1 +33^"83,18"^"WDS/Set DNS Setting Request/Primary IPv6 Address"^60084^-1 +33^"83,19"^"WDS/Set DNS Setting Request/Secondary IPv6 Address"^60085^-1 +34^"0,2"^"WDS/Reset Response/Result Code"^50000^-1 +34^"1,2"^"WDS/Set Event Report Response/Result Code"^50000^-1 +34^"2,2"^"WDS/Abort Response/Result Code"^50000^-1 +34^"32,1"^"WDS/Start Network Interface Response/Packet Data Handle"^50028^-1 +34^"32,2"^"WDS/Start Network Interface Response/Result Code"^50000^-1 +34^"32,16"^"WDS/Start Network Interface Response/Call End Reason"^50043^-1 +34^"32,17"^"WDS/Start Network Interface Response/Verbose Call End Reason"^50098^-1 +34^"33,2"^"WDS/Stop Network Interface Response/Result Code"^50000^-1 +34^"34,1"^"WDS/Get Packet Service Status Response/Status"^50029^-1 +34^"34,2"^"WDS/Get Packet Service Status Response/Result Code"^50000^-1 +34^"35,1"^"WDS/Get Channel Rates Response/Channel Rates"^50031^-1 +34^"35,2"^"WDS/Get Channel Rates Response/Result Code"^50000^-1 +34^"36,2"^"WDS/Get Packet Statistics Response/Result Code"^50000^-1 +34^"36,16"^"WDS/Get Packet Statistics Response/TX Packet Successes"^50013^-1 +34^"36,17"^"WDS/Get Packet Statistics Response/RX Packet Successes"^50014^-1 +34^"36,18"^"WDS/Get Packet Statistics Response/TX Packet Errors"^50015^-1 +34^"36,19"^"WDS/Get Packet Statistics Response/RX Packet Errors"^50016^-1 +34^"36,20"^"WDS/Get Packet Statistics Response/TX Overflows"^50017^-1 +34^"36,21"^"WDS/Get Packet Statistics Response/RX Overflows"^50018^-1 +34^"36,25"^"WDS/Get Packet Statistics Response/TX Bytes"^50054^-1 +34^"36,26"^"WDS/Get Packet Statistics Response/RX Bytes"^50055^-1 +34^"36,27"^"WDS/Get Packet Statistics Response/Previous TX Bytes"^50079^-1 +34^"36,28"^"WDS/Get Packet Statistics Response/Previous RX Bytes"^50080^-1 +34^"37,2"^"WDS/Go Dormant Response/Result Code"^50000^-1 +34^"38,2"^"WDS/Go Active Response/Result Code"^50000^-1 +34^"39,1"^"WDS/Create Profile Response/Profile Identifier"^50038^-1 +34^"39,2"^"WDS/Create Profile Response/Result Code"^50000^-1 +34^"40,2"^"WDS/Modify Profile Response/Result Code"^50000^-1 +34^"40,151"^"WDS/Modify Profile Request/LCP Config Retry Count"^60066^-1 +34^"40,152"^"WDS/Modify Profile Request/IPCP Config Retry Count"^60067^-1 +34^"40,153"^"WDS/Modify Profile Request/Authentication Retry"^60068^-1 +34^"40,224"^"WDS/Modify Profile Request/Extended Error Code"^60083^-1 +34^"41,2"^"WDS/Delete Profile Response/Result Code"^50000^-1 +34^"42,1"^"WDS/Get Profile List Response/Profile List"^50039^-1 +34^"42,2"^"WDS/Get Profile List Response/Result Code"^50000^-1 +34^"43,2"^"WDS/Get Profile Settings Response/Result Code"^50000^-1 +34^"43,16"^"WDS/Get Profile Settings Response/Profile Name"^50034^-1 +34^"43,17"^"WDS/Get Profile Settings Response/PDP Type"^50035^-1 +34^"43,20"^"WDS/Get Profile Settings Response/APN Name"^50022^-1 +34^"43,21"^"WDS/Get Profile Settings Response/Primary DNS"^50021^-1 +34^"43,22"^"WDS/Get Profile Settings Response/Secondary DNS"^50021^-1 +34^"43,23"^"WDS/Get Profile Settings Response/UMTS Requested QoS"^50036^-1 +34^"43,24"^"WDS/Get Profile Settings Response/UMTS Minimum QoS"^50036^-1 +34^"43,25"^"WDS/Get Profile Settings Response/GPRS Requested QoS"^50037^-1 +34^"43,26"^"WDS/Get Profile Settings Response/GPRS Minimum QoS"^50037^-1 +34^"43,27"^"WDS/Get Profile Settings Response/Username"^50024^-1 +34^"43,29"^"WDS/Get Profile Settings Response/Authentication"^50023^-1 +34^"43,30"^"WDS/Get Profile Settings Response/IP Address"^50021^-1 +34^"43,31"^"WDS/Get Profile Settings Response/P-CSCF"^50099^-1 +34^"44,2"^"WDS/Get Default Settings Response/Result Code"^50000^-1 +34^"44,16"^"WDS/Get Default Settings Response/Profile Name"^50034^-1 +34^"44,17"^"WDS/Get Default Settings Response/PDP Type"^50035^-1 +34^"44,20"^"WDS/Get Default Settings Response/APN Name"^50022^-1 +34^"44,21"^"WDS/Get Default Settings Response/Primary DNS"^50021^-1 +34^"44,22"^"WDS/Get Default Settings Response/Secondary DNS"^50021^-1 +34^"44,23"^"WDS/Get Default Settings Response/UMTS Requested QoS"^50036^-1 +34^"44,24"^"WDS/Get Default Settings Response/UMTS Minimum QoS"^50036^-1 +34^"44,25"^"WDS/Get Default Settings Response/GPRS Requested QoS"^50037^-1 +34^"44,26"^"WDS/Get Default Settings Response/GPRS Minimum QoS"^50037^-1 +34^"44,27"^"WDS/Get Default Settings Response/Username"^50024^-1 +34^"44,28"^"WDS/Get Default Settings Response/Password"^50025^-1 +34^"44,29"^"WDS/Get Default Settings Response/Authentication"^50023^-1 +34^"44,30"^"WDS/Get Default Settings Response/IP Address"^50021^-1 +34^"44,31"^"WDS/Get Default Settings Response/P-CSCF"^50099^-1 +34^"44,32"^"WDS/Get Default Settings Response/PDP Access Control Flag"^60015^-1 +34^"44,33"^"WDS/Get Default Settings Response/P-CSCF Address Using DHCP"^60016^-1 +34^"44,34"^"WDS/Get Default Settings Response/IM CN Flag"^60017^-1 +34^"44,35"^"WDS/Get Default Settings Response/Traffic Flow Template ID1 Parameters"^60018^-1 +34^"44,36"^"WDS/Get Default Settings Response/Traffic Flow Template ID2 Parameters"^60019^-1 +34^"44,37"^"WDS/Get Default Settings Response/PDP Context Number"^60020^-1 +34^"44,38"^"WDS/Get Default Settings Response/PDP Context Secondary Flag"^60021^-1 +34^"44,39"^"WDS/Get Default Settings Response/PDP Context Primary ID"^60022^-1 +34^"44,40"^"WDS/Get Default Settings Response/IPv6 Address"^60023^-1 +34^"44,41"^"WDS/Get Default Settings Response/Requested QoS"^60024^-1 +34^"44,42"^"WDS/Get Default Settings Response/Minimum QoS"^60025^-1 +34^"44,43"^"WDS/Get Default Settings Response/Primary DNS IPv6 Address"^60026^-1 +34^"44,44"^"WDS/Get Default Settings Response/Secondary DNS IPv6 Address"^60027^-1 +34^"44,45"^"WDS/Get Default Settings Response/DHCP NAS Preference"^60028^-1 +34^"44,46"^"WDS/Get Default Settings Response/LTE QoS Parameters"^60029^-1 +34^"44,144"^"WDS/Get Default Settings Response/Negotiate DSN Server Preferences"^60030^-1 +34^"44,145"^"WDS/Get Default Settings Response/PPP Session CLose Timer DO"^60031^-1 +34^"44,146"^"WDS/Get Default Settings Response/PPP Session Close Timer 1X"^60032^-1 +34^"44,147"^"WDS/Get Default Settings Response/Allow Lingering Interface"^60033^-1 +34^"44,148"^"WDS/Get Default Settings Response/LCP ACK Timeout"^60034^-1 +34^"44,149"^"WDS/Get Default Settings Response/IPCP ACK Timeout"^60035^-1 +34^"44,150"^"WDS/Get Default Settings Response/Authentication Timeout"^60036^-1 +34^"44,151"^"WDS/Get Default Settings Response/LCP Config Retry Count"^60037^-1 +34^"44,152"^"WDS/Get Default Settings Response/IPCP Config Retry Count"^60038^-1 +34^"44,153"^"WDS/Get Default Settings Response/Authentication Retry"^60039^-1 +34^"44,154"^"WDS/Get Default Settings Response/Authentication Protocol"^60040^-1 +34^"44,155"^"WDS/Get Default Settings Response/User ID"^60041^-1^0^-1^0^0 +34^"44,156"^"WDS/Get Default Settings Response/Authentication Password"^60042^-1 +34^"44,157"^"WDS/Get Default Settings Response/Data Rate"^60043^-1 +34^"44,158"^"WDS/Get Default Settings Response/Application Type"^60044^-1 +34^"44,159"^"WDS/Get Default Settings Response/Data Mode"^60045^-1 +34^"44,160"^"WDS/Get Default Settings Response/Application Priority"^60046^-1 +34^"44,161"^"WDS/Get Default Settings Response/APN String"^60047^-1 +34^"44,162"^"WDS/Get Default Settings Response/PDN Type"^60048^-1 +34^"44,163"^"WDS/Get Default Settings Response/P-CSCF Address Needed"^60049^-1 +34^"44,164"^"WDS/Get Default Settings Response/Primary DNS Address"^60050^-1 +34^"44,165"^"WDS/Get Default Settings Response/Secondary DNS Address"^60051^-1 +34^"44,166"^"WDS/Get Default Settings Response/Primary IPv6 Address"^60052^-1 +34^"44,167"^"WDS/Get Default Settings Response/Secondary IPv6 Address"^60053^-1 +34^"44,224"^"WDS/Get Default Settings Response/Extended Error Code"^60054^-1 +34^"45,2"^"WDS/Get Current Settings Response/Result Code"^50000^-1 +34^"45,16"^"WDS/Get Current Settings Response/Profile Name"^50034^-1 +34^"45,17"^"WDS/Get Current Settings Response/PDP Type"^50035^-1 +34^"45,20"^"WDS/Get Current Settings Response/APN Name"^50022^-1 +34^"45,21"^"WDS/Get Current Settings Response/Primary DNS"^50021^-1 +34^"45,22"^"WDS/Get Current Settings Response/Secondary DNS"^50021^-1 +34^"45,23"^"WDS/Get Current Settings Response/UMTS Granted QoS"^50036^-1 +34^"45,25"^"WDS/Get Current Settings Response/GPRS Granted QoS"^50037^-1 +34^"45,27"^"WDS/Get Current Settings Response/Username"^50024^-1 +34^"45,29"^"WDS/Get Current Settings Response/Authentication"^50023^-1 +34^"45,30"^"WDS/Get Current Settings Response/IP Address"^50021^-1 +34^"45,31"^"WDS/Get Current Settings Response/Profile ID"^50038^-1 +34^"45,32"^"WDS/Get Current Settings Response/Gateway Address"^50021^-1 +34^"45,33"^"WDS/Get Current Settings Response/Gateway Subnet Mask"^50085^-1 +34^"45,34"^"WDS/Get Current Settings Response/P-CSCF"^50099^-1 +34^"45,35"^"WDS/Get Current Settings Response/P-CSCF Server Address List"^60000^-1 +34^"45,36"^"WDS/Get Current Settings Response/P-CSCF Domain Name List"^60001^-1 +34^"45,37"^"WDS/Get Current Settings Response/IPv6 Address"^60010^-1 +34^"45,38"^"WDS/Get Current Settings Response/IPv6 Gateway Address"^60011^-1 +34^"45,39"^"WDS/Get Current Settings Response/Primary IPv6 DNS"^60003^-1 +34^"45,40"^"WDS/Get Current Settings Response/Secondary IPv6 DNS"^60003^-1 +34^"45,41"^"WDS/Get Current Settings Response/MTU"^60004^-1 +34^"45,42"^"WDS/Get Current Settings Response/Domain Name List"^60005^-1 +34^"45,43"^"WDS/Get Current Settings Response/IP Family"^50097^-1 +34^"45,44"^"WDS/Get Current Settings Response/IM CN Flag"^60007^-1 +34^"45,45"^"WDS/Get Current Settings Response/Extended Technology"^50095^-1 +34^"45,46"^"WDS/Get Current Settings Response/P-CSCF IPv6 Address List"^60057^-1 +34^"46,2"^"WDS/Set MIP Mode Response/Result Code"^50000^-1 +34^"47,1"^"WDS/Get MIP Mode Response/Mobile IP Mode"^50044^-1 +34^"47,2"^"WDS/Get MIP Mode Response/Result Code"^50000^-1 +34^"48,1"^"WDS/Get Dormancy Response/Dormancy Status"^50042^-1 +34^"48,2"^"WDS/Get Dormancy Response/Result Code"^50000^-1 +34^"52,1"^"WDS/Get Autoconnect Setting Response/Autoconnect"^50045^-1 +34^"52,2"^"WDS/Get Autoconnect Setting Response/Result Code"^50000^-1 +34^"52,16"^"WDS/Get Autoconnect Setting Response/Roam"^60008^-1 +34^"53,1"^"WDS/Get Data Session Duration Response/Duration"^50047^-1 +34^"53,2"^"WDS/Get Data Session Duration Response/Result Code"^50000^-1 +34^"53,16"^"WDS/Get Data Session Duration Response/Previous Duration"^50081^-1 +34^"53,17"^"WDS/Get Data Session Duration Response/Active Duration"^50082^-1 +34^"53,18"^"WDS/Get Data Session Duration Response/Previous Active Duration"^50083^-1 +34^"54,1"^"WDS/Get Modem Status Response/Status"^50048^-1 +34^"54,2"^"WDS/Get Modem Status Response/Result Code"^50000^-1 +34^"54,16"^"WDS/Get Modem Status Response/Call End Reason"^50049^-1 +34^"55,1"^"WDS/Get Data Bearer Technology Response/Technology"^50020^-1 +34^"55,2"^"WDS/Get Data Bearer Technology Response/Result Code"^50000^-1 +34^"55,16"^"WDS/Get Data Bearer Technology Response/Last Call Technology"^50020^-1 +34^"56,2"^"WDS/Get Modem Info Response/Result Code"^50000^-1 +34^"56,16"^"WDS/Get Modem Info Response/Status"^50048^-1 +34^"56,17"^"WDS/Get Modem Info Response/Call End Reason"^50049^-1 +34^"56,18"^"WDS/Get Modem Info Response/TX Bytes"^50054^-1 +34^"56,19"^"WDS/Get Modem Info Response/RX Bytes"^50055^-1 +34^"56,20"^"WDS/Get Modem Info Response/Dormancy Status"^50042^-1 +34^"56,21"^"WDS/Get Modem Info Response/Technology"^50020^-1 +34^"56,22"^"WDS/Get Modem Info Response/Rates"^50031^-1 +34^"56,23"^"WDS/Get Modem Info Response/Previous TX Bytes"^50079^-1 +34^"56,24"^"WDS/Get Modem Info Response/Previous RX Bytes"^50080^-1 +34^"56,25"^"WDS/Get Modem Info Duration Response/Active Duration"^50082^-1 +34^"60,1"^"WDS/Get Active MIP Profile Response/Index"^50027^-1 +34^"60,2"^"WDS/Get Active MIP Profile Response/Result Code"^50000^-1 +34^"61,2"^"WDS/Set Active MIP Profile Response/Result Code"^50000^-1 +34^"62,2"^"WDS/Get MIP Profile Response/Result Code"^50000^-1 +34^"62,16"^"WDS/Get MIP Profile Response/State"^50057^-1 +34^"62,17"^"WDS/Get MIP Profile Response/Home Address"^50021^-1 +34^"62,18"^"WDS/Get MIP Profile Response/Primary Home Agent Address"^50021^-1 +34^"62,19"^"WDS/Get MIP Profile Response/Secondary Home Agent Address"^50021^-1 +34^"62,20"^"WDS/Get MIP Profile Response/Reverse Tunneling"^50058^-1 +34^"62,21"^"WDS/Get MIP Profile Response/NAI"^50059^-1 +34^"62,22"^"WDS/Get MIP Profile Response/HA SPI"^50060^-1 +34^"62,23"^"WDS/Get MIP Profile Response/AAA SPI"^50061^-1 +34^"62,26"^"WDS/Get MIP Profile Response/HA State"^50086^-1 +34^"62,27"^"WDS/Get MIP Profile Response/AAA State"^50086^-1 +34^"63,2"^"WDS/Set MIP Profile Response/Result Code"^50000^-1 +34^"64,2"^"WDS/Get MIP Parameters Response/Result Code"^50000^-1 +34^"64,16"^"WDS/Get MIP Parameters Response/Mobile IP Mode"^50044^-1 +34^"64,17"^"WDS/Get MIP Parameters Response/Retry Attempt Limit"^50064^-1 +34^"64,18"^"WDS/Get MIP Parameters Response/Retry Attempt Interval"^50065^-1 +34^"64,19"^"WDS/Get MIP Parameters Response/Re-Registration Period"^50066^-1 +34^"64,20"^"WDS/Get MIP Parameters Response/Re-Registration Only With Traffic"^50067^-1 +34^"64,21"^"WDS/Get MIP Parameters Response/MN-HA Authenticator Calculator"^50068^-1 +34^"64,22"^"WDS/Get MIP Parameters Response/MN-HA RFC 2002 BIS Authentication"^50069^-1 +34^"65,2"^"WDS/Set MIP Parameters Response/Result Code"^50000^-1 +34^"66,1"^"WDS/Get Last MIP Status Response/Status"^50071^-1 +34^"66,2"^"WDS/Get Last MIP Status Response/Result Code"^50000^-1 +34^"67,1"^"WDS/Get AN-AAA Authentication Status Response/Status"^50072^-1 +34^"67,2"^"WDS/Get AN-AAA Authentication Status Response/Result Code"^50000^-1 +34^"68,1"^"WDS/Get Current Data Bearer Technology Response/Technology"^50090^-1 +34^"68,2"^"WDS/Get Current Data Bearer Technology Response/Result Code"^50000^-1 +34^"69,2"^"WDS/Get Call List Response/Result Code"^50000^-1 +34^"69,16"^"WDS/Get Call List Response/Full List"^50074^-1 +34^"69,17"^"WDS/Get Call List Response/ID List"^50076^-1 +34^"70,1"^"WDS/Get Call Record Response/Record"^50075^-1 +34^"70,2"^"WDS/Get Call Record Response/Result Code"^50000^-1 +34^"71,2"^"WDS/Clear Call List Response/Result Code"^50000^-1 +34^"72,1"^"WDS/Get Call List Max Size Response/Maximum"^50078^-1 +34^"72,2"^"WDS/Get Call List Max Size Response/Result Code"^50000^-1 +34^"81,2"^"WDS/Set Autoconnect Setting Response/Result Code"^50000^-1 +34^"82,2"^"WDS/Get DNS Setting Response/Result Code"^50000^-1 +34^"82,16"^"WDS/Get DNS Setting Response/Primary"^60009^-1 +34^"82,17"^"WDS/Get DNS Setting Response/Secondary"^60009^-1 +34^"82,18"^"WDS/Get DNS Setting Response/Primary IPv6"^60055^-1 +34^"82,19"^"WDS/Get DNS Setting Response/Secondary IPv6"^60056^-1 +34^"83,2"^"WDS/Set DNS Setting Response/Result Code"^50000^-1 +35^"1,16"^"WDS/Event Report/TX Packet Successes"^50013^-1 +35^"1,17"^"WDS/Event Report/RX Packet Successes"^50014^-1 +35^"1,18"^"WDS/Event Report/TX Packet Errors"^50015^-1 +35^"1,19"^"WDS/Event Report/RX Packet Errors"^50016^-1 +35^"1,20"^"WDS/Event Report/TX Overflows"^50017^-1 +35^"1,21"^"WDS/Event Report/RX Overflows"^50018^-1 +35^"1,22"^"WDS/Event Report/Channel Rates"^50019^-1 +35^"1,23"^"WDS/Event Report/Data Bearer Technology"^50020^-1 +35^"1,24"^"WDS/Event Report/Dormancy Status"^50042^-1 +35^"1,25"^"WDS/Event Report/TX Bytes"^50054^-1 +35^"1,26"^"WDS/Event Report/RX Bytes"^50055^-1 +35^"1,27"^"WDS/Event Report/MIP Status"^50088^-1 +35^"1,29"^"WDS/Event Report/Current Data Bearer Technology"^50090^-1 +35^"34,1"^"WDS/Packet Service Status Report/Status"^50030^-1 +35^"34,16"^"WDS/Packet Service Status Report/Call End Reason"^50043^-1 +35^"34,17"^"WDS/Packet Service Status Report/Verbose Call End Reason"^50098^-1 +35^"54,1"^"WDS/Modem Status Report/Status"^50050^-1 +35^"54,16"^"WDS/Modem Status Report/Call End Reason"^50049^-1 +35^"56,16"^"WDS/Modem Info Report/Status"^50050^-1 +35^"56,17"^"WDS/Modem Info Report/Call End Reason"^50049^-1 +35^"56,18"^"WDS/Modem Info Report/TX Bytes"^50054^-1 +35^"56,19"^"WDS/Modem Info Report/RX Bytes"^50055^-1 +35^"56,20"^"WDS/Modem Info Report/Dormancy Status"^50042^-1 +35^"56,21"^"WDS/Modem Info Report/Technology"^50020^-1 +35^"56,22"^"WDS/Modem Info Report/Rates"^50019^-1 +36^"1,16"^"DMS/Set Event Report Request/Power State"^50100^-1 +36^"1,17"^"DMS/Set Event Report Request/Battery Level"^50101^-1 +36^"1,18"^"DMS/Set Event Report Request/PIN Status"^50133^-1 +36^"1,19"^"DMS/Set Event Report Request/Activation State"^50111^-1 +36^"1,20"^"DMS/Set Event Report Request/Operating Mode"^50144^-1 +36^"1,21"^"DMS/Set Event Report Request/UIM State"^50151^-1 +36^"1,22"^"DMS/Set Event Report Request/Wireless Disable State"^50166^-1 +36^"39,1"^"DMS/UIM Set PIN Protection Request/Info"^50127^-1 +36^"40,1"^"DMS/UIM Verify PIN Request/Info"^50129^-1 +36^"41,1"^"DMS/UIM Unblock PIN Request/Info"^50130^-1 +36^"42,1"^"DMS/UIM Change PIN Request/Info"^50131^-1 +36^"46,1"^"DMS/Set Operating Mode Request/Operating Mode"^50115^-1 +36^"50,1"^"DMS/Activate Automatic Request/Activation Code"^50118^-1 +36^"51,1"^"DMS/Activate Manual Request/Activation Data"^50119^-1 +36^"51,16"^"DMS/Activate Manual Request/PRL (Obsolete)"^50120^-1 +36^"51,17"^"DMS/Activate Manual Request/MN-HA Key"^50121^-1 +36^"51,18"^"DMS/Activate Manual Request/MN-AAA Key"^50122^-1 +36^"51,19"^"DMS/Activate Manual Request/PRL"^50135^-1 +36^"53,1"^"DMS/Set Lock State Request/Lock State"^50124^-1 +36^"54,1"^"DMS/Set Lock Code Request/Lock Code"^50125^-1 +36^"56,1"^"DMS/Write User Data Request/User Data"^50126^-1 +36^"58,1"^"DMS/Reset Factory Defaults Request/SPC"^50134^-1 +36^"59,1"^"DMS/Validate SPC Request/SPC"^50070^-1 +36^"62,1"^"DMS/UIM Set Firmware ID Request/ID"^50141^-1 +36^"64,1"^"DMS/UIM Get Control Key Status Request/Facility"^50145^-1 +36^"65,1"^"DMS/UIM Set Control Key Protection Request/Facility"^50147^-1 +36^"66,1"^"DMS/UIM Unblock Control Key Request/Facility"^50149^-1 +36^"72,1"^"DMS/Set Firmware Preference Request/Image List"^50155^-1 +36^"72,16"^"DMS/Set Firmware Preference Request/Override"^50157^-1 +36^"72,17"^"DMS/Set Firmware Preference Request/Index"^50158^-1 +36^"74,1"^"DMS/Delete Stored Firmware Request/Image"^50156^-1 +36^"75,1"^"DMS/Set Device Time Request/Time"^50170^-1 +36^"75,16"^"DMS/Set Device Time Request/Type"^50171^-1 +36^"76,1"^"DMS/Get Stored Firmware Info Request/Image"^50156^-1 +36^"78,1"^"DMS/Set Alternate Net Config Request/Config"^50169^-1 +36^"80,1"^"DMS/Set Image Download Mode Request/Mode"^50175^-1 +37^"0,2"^"DMS/Reset Response/Result Code"^50000^-1 +37^"1,2"^"DMS/Set Event Report Response/Result Code"^50000^-1 +37^"32,1"^"DMS/Get Device Capabilities Response/Capabilities"^50103^-1 +37^"32,2"^"DMS/Get Device Capabilities Response/Result Code"^50000^-1 +37^"33,1"^"DMS/Get Device Manfacturer Response/Manfacturer"^50104^-1 +37^"33,2"^"DMS/Get Device Manfacturer Response/Result Code"^50000^-1 +37^"34,1"^"DMS/Get Device Model Response/Model"^50105^-1 +37^"34,2"^"DMS/Get Device Model Response/Result Code"^50000^-1 +37^"35,1"^"DMS/Get Device Revision Response/Revision"^50106^-1 +37^"35,2"^"DMS/Get Device Revision Response/Result Code"^50000^-1 +37^"35,16"^"DMS/Get Device Revision Response/Boot Code Revision"^50136^-1 +37^"35,17"^"DMS/Get Device Revision Response/UQCN Revision"^50136^-1 +37^"36,1"^"DMS/Get Device Voice Number Response/Voice Number"^50107^-1 +37^"36,2"^"DMS/Get Device Voice Number Response/Result Code"^50000^-1 +37^"36,16"^"DMS/Get Device Voice Number Response/Mobile ID Number"^50113^-1 +37^"36,17"^"DMS/Get Device Voice Number Response/IMSI"^50138^-1 +37^"37,2"^"DMS/Get Device Serial Numbers Response/Result Code"^50000^-1 +37^"37,16"^"DMS/Get Device Serial Numbers Response/ESN"^50108^-1 +37^"37,17"^"DMS/Get Device Serial Numbers Response/IMEI"^50109^-1 +37^"37,18"^"DMS/Get Device Serial Numbers Response/MEID"^50110^-1 +37^"38,1"^"DMS/Get Power State Response/Power State"^50102^-1 +37^"38,2"^"DMS/Get Power State Response/Result Code"^50000^-1 +37^"39,2"^"DMS/UIM Set PIN Protection Response/Result Code"^50000^-1 +37^"39,16"^"DMS/UIM Set PIN Protection Response/Retry Info"^50128^-1 +37^"40,2"^"DMS/UIM Verify PIN Response/Result Code"^50000^-1 +37^"40,16"^"DMS/UIM Verify PIN Response/Retry Info"^50128^-1 +37^"41,2"^"DMS/UIM Unblock PIN Response/Result Code"^50000^-1 +37^"41,16"^"DMS/UIM Unblock PIN Response/Retry Info"^50128^-1 +37^"42,2"^"DMS/UIM Change PIN Response/Result Code"^50000^-1 +37^"42,16"^"DMS/UIM Change PIN Response/Retry Info"^50128^-1 +37^"43,2"^"DMS/UIM Get PIN Status Response/Result Code"^50000^-1 +37^"43,17"^"DMS/UIM Get PIN Status Response/PIN1 Status"^50132^-1 +37^"43,18"^"DMS/UIM Get PIN Status Response/PIN2 Status"^50132^-1 +37^"44,1"^"DMS/Get Hardware Revision Response/Hardware Revision"^50114^-1 +37^"44,2"^"DMS/Get Hardware Revision Response/Result Code"^50000^-1 +37^"45,1"^"DMS/Get Operating Mode Response/Operating Mode"^50115^-1 +37^"45,2"^"DMS/Get Operating Mode Response/Result Code"^50000^-1 +37^"45,16"^"DMS/Get Operating Mode Response/Offline Reason"^50139^-1 +37^"45,17"^"DMS/Get Operating Mode Response/Platform Restricted"^50143^-1 +37^"46,2"^"DMS/Set Operating Mode Response/Result Code"^50000^-1 +37^"47,1"^"DMS/Get Timestamp Response/Timestamp"^50116^-1 +37^"47,2"^"DMS/Get Timestamp Response/Result Code"^50000^-1 +37^"48,1"^"DMS/Get PRL Version Response/PRL Version"^50117^-1 +37^"48,2"^"DMS/Get PRL Version Response/Result Code"^50000^-1 +37^"49,1"^"DMS/Get Activation State Response/Activation State"^50112^-1 +37^"49,2"^"DMS/Get Activation State Response/Result Code"^50000^-1 +37^"50,2"^"DMS/Activate Automatic Response/Result Code"^50000^-1 +37^"51,2"^"DMS/Activate Manual Response/Result Code"^50000^-1 +37^"52,1"^"DMS/Get Lock State Response/Lock State"^50123^-1 +37^"52,2"^"DMS/Get Lock State Response/Result Code"^50000^-1 +37^"53,2"^"DMS/Set Lock State Response/Result Code"^50000^-1 +37^"54,2"^"DMS/Set Lock Code Response/Result Code"^50000^-1 +37^"55,1"^"DMS/Read User Data Response/User Data"^50126^-1 +37^"55,2"^"DMS/Read User Data Response/Result Code"^50000^-1 +37^"56,2"^"DMS/Write User Data Response/Result Code"^50000^-1 +37^"57,1"^"DMS/Read ERI Data Response/User Data"^50126^-1 +37^"57,2"^"DMS/Read ERI Data Response/Result Code"^50000^-1 +37^"58,2"^"DMS/Reset Factory Defaults Response/Result Code"^50000^-1 +37^"59,2"^"DMS/Validate SPC Response/Result Code"^50000^-1 +37^"60,1"^"DMS/UIM Get ICCID Response/ICCID"^50140^-1 +37^"60,2"^"DMS/UIM Get ICCID Response/Result Code"^50000^-1 +37^"61,1"^"DMS/UIM Get Firmware ID Response/ID"^50141^-1 +37^"61,2"^"DMS/UIM Get Firmware ID Response/Result Code"^50000^-1 +37^"62,2"^"DMS/UIM Set Firmware ID Response/Result Code"^50000^-1 +37^"63,1"^"DMS/UIM Get Host Lock ID Response/ID"^50142^-1 +37^"63,2"^"DMS/UIM Get Host Lock ID Response/Result Code"^50000^-1 +37^"64,1"^"DMS/UIM Get Control Key Status Response/Status"^50146^-1 +37^"64,2"^"DMS/UIM Get Control Key Status Response/Result Code"^50000^-1 +37^"64,16"^"DMS/UIM Get Control Key Status Response/Blocking"^50153^-1 +37^"65,2"^"DMS/UIM Set Control Key Protection Response/Result Code"^50000^-1 +37^"65,16"^"DMS/UIM Set Control Key Protection Response/Status"^50148^-1 +37^"66,2"^"DMS/UIM Unblock Control Key Response/Result Code"^50000^-1 +37^"66,16"^"DMS/UIM Unblock Control Key Response/Status"^50150^-1 +37^"67,1"^"DMS/Get IMSI Response/IMSI"^50138^-1 +37^"67,2"^"DMS/Get IMSI Response/Result Code"^50000^-1 +37^"68,1"^"DMS/Get UIM State Response/State"^50152^-1 +37^"68,2"^"DMS/Get UIM State Response/Result Code"^50000^-1 +37^"69,1"^"DMS/Get Band Capabilities Response/Bands"^50165^-1 +37^"69,2"^"DMS/Get Band Capabilities Response/Result Code"^50000^-1 +37^"70,1"^"DMS/Get Factory Serial Number Response/ID"^50168^-1^0 +37^"70,2"^"DMS/Get Factory Serial Number Response/Result Code"^50000^-1^0 +37^"71,1"^"DMS/Get Firmware Preference Response/Image List"^50155^-1 +37^"71,2"^"DMS/Get Firmware Preference Response/Result Code"^50000^-1 +37^"72,1"^"DMS/Set Firmware Preference Response/Image List"^50159^-1 +37^"72,2"^"DMS/Set Firmware Preference Response/Result Code"^50000^-1 +37^"72,16"^"DMS/Set Firmware Preference Response/Maximum"^50160^-1 +37^"73,1"^"DMS/List Stored Firmware Response/Image List"^50161^-1 +37^"73,2"^"DMS/List Stored Firmware Response/Result Code"^50000^-1 +37^"74,2"^"DMS/Delete Stored Firmware Response/Result Code"^50000^-1 +37^"75,2"^"DMS/Set Device Time Response/Result Code"^50000^-1 +37^"76,2"^"DMS/Get Stored Firmware Info Response/Result Code"^50000^-1 +37^"76,16"^"DMS/Get Stored Firmware Info Response/Boot Version"^50172^-1 +37^"76,17"^"DMS/Get Stored Firmware Info Response/PRI Version"^50173^-1 +37^"76,18"^"DMS/Get Stored Firmware Info Response/OEM Lock ID"^50174^-1 +37^"77,1"^"DMS/Get Alternate Net Config Response/Config"^50169^-1 +37^"77,2"^"DMS/Get Alternate Net Config Response/Result Code"^50000^-1 +37^"78,2"^"DMS/Set Alternate Net Config Response/Result Code"^50000^-1 +37^"79,2"^"DMS/Get Image Download Mode Response/Result Code"^50000^-1 +37^"79,16"^"DMS/Get Image Download Mode Response/Mode"^50175^-1 +37^"80,2"^"DMS/Set Image Download Mode Response/Result Code"^50000^-1 +38^"1,16"^"DMS/Event Report/Power State"^50102^-1 +38^"1,17"^"DMS/Event Report/PIN1 State"^50132^-1 +38^"1,18"^"DMS/Event Report/PIN2 State"^50132^-1 +38^"1,19"^"DMS/Event Report/Activation State"^50112^-1 +38^"1,20"^"DMS/Event Report/Operating Mode"^50115^-1 +38^"1,21"^"DMS/Event Report/UIM State"^50152^-1 +38^"1,22"^"DMS/Event Report/Wireless Disable State"^50167^-1 +39^"1,1"^"NAS/Abort Request/Transaction ID"^50001^-1 +39^"2,16"^"NAS/Set Event Report Request/Signal Indicator"^50200^-1 +39^"2,17"^"NAS/Set Event Report Request/RF Indicator"^50233^-1 +39^"2,18"^"NAS/Set Event Report Request/Registration Reject Indicator"^50234^-1 +39^"2,19"^"NAS/Set Event Report Request/RSSI Indicator"^50240^-1 +39^"2,20"^"NAS/Set Event Report Request/ECIO Indicator"^50241^-1 +39^"2,21"^"NAS/Set Event Report Request/IO Indicator"^50242^-1 +39^"2,22"^"NAS/Set Event Report Request/SINR Indicator"^50243^-1 +39^"2,23"^"NAS/Set Event Report Request/Error Rate Indicator"^50244^-1 +39^"2,24"^"NAS/Set Event Report Request/RSRQ Indicator"^50277^-1 +39^"3,16"^"NAS/Set Registration Event Report Request/System Select Indicator"^50250^-1 +39^"3,18"^"NAS/Set Registration Event Report Request/DDTM Indicator"^50251^-1 +39^"3,19"^"NAS/Set Registration Event Report Request/Serving System Indicator"^50252^-1 +39^"32,16"^"NAS/Get Signal Strength Request/Request Mask"^50253^-1 +39^"34,1"^"NAS/Initiate Network Register Request/Action"^50204^-1 +39^"34,16"^"NAS/Initiate Network Register Request/Manual Info"^50205^-1 +39^"34,17"^"NAS/Initiate Network Register Request/Change Duration"^50276^-1 +39^"35,16"^"NAS/Initiate Attach Request/Action"^50206^-1 +39^"39,16"^"NAS/Set Preferred Networks Request/Networks"^50210^-1 +39^"41,16"^"NAS/Set Forbidden Networks Request/Networks"^50213^-1 +39^"42,1"^"NAS/Set Technology Preference Request/Preference"^50216^-1 +39^"45,1"^"NAS/Set ACCOLC Request/ACCOLC"^50219^-1 +39^"48,16"^"NAS/Set Network Parameters Request/SPC"^50230^-1 +39^"48,20"^"NAS/Set Network Parameters Request/CDMA 1xEV-DO Revision"^50228^-1 +39^"48,21"^"NAS/Set Network Parameters Request/CDMA 1xEV-DO SCP Custom"^50229^-1 +39^"48,22"^"NAS/Set Network Parameters Request/Roaming"^50231^-1 +39^"51,16"^"NAS/Set System Selection Pref Request/Emergency Mode"^50263^-1 +39^"51,17"^"NAS/Set System Selection Pref Request/Mode"^50264^-1 +39^"51,18"^"NAS/Set System Selection Pref Request/Band"^50265^-1 +39^"51,19"^"NAS/Set System Selection Pref Request/PRL"^50266^-1 +39^"51,20"^"NAS/Set System Selection Pref Request/Roaming"^50267^-1 +39^"55,1"^"NAS/Set DDTM Preference Request/DDTM"^50268^-1 +39^"68,1"^"NAS/Get PLMN Name Request/PLMN"^50214^-1 +40^"0,2"^"NAS/Reset Response/Result Code"^50000^-1 +40^"1,2"^"NAS/Abort Response/Result Code"^50000^-1 +40^"2,2"^"NAS/Set Event Report Response/Result Code"^50000^-1 +40^"3,2"^"NAS/Set Registration Event Report Response/Result Code"^50000^-1 +40^"32,1"^"NAS/Get Signal Strength Response/Signal Strength"^50201^-1 +40^"32,2"^"NAS/Get Signal Strength Response/Result Code"^50000^-1 +40^"32,16"^"NAS/Get Signal Strength Response/Signal Strength List"^50220^-1 +40^"32,17"^"NAS/Get Signal Strength Response/RSSI List"^50254^-1 +40^"32,18"^"NAS/Get Signal Strength Response/ECIO List"^50255^-1 +40^"32,19"^"NAS/Get Signal Strength Response/IO"^50247^-1 +40^"32,20"^"NAS/Get Signal Strength Response/SINR"^50248^-1 +40^"32,21"^"NAS/Get Signal Strength Response/Error Rate List"^50256^-1 +40^"33,2"^"NAS/Perform Network Scan Response/Result Code"^50000^-1 +40^"33,16"^"NAS/Perform Network Scan Response/Network Info"^50202^-1 +40^"33,17"^"NAS/Perform Network Scan Response/Network RAT"^50270^-1 +40^"34,2"^"NAS/Initiate Network Register Response/Result Code"^50000^-1 +40^"35,2"^"NAS/Initiate Attach Response/Result Code"^50000^-1 +40^"36,1"^"NAS/Get Serving System Response/Serving System"^50207^-1 +40^"36,2"^"NAS/Get Serving System Response/Result Code"^50000^-1 +40^"36,16"^"NAS/Get Serving System Response/Roaming Indicator"^50208^-1 +40^"36,17"^"NAS/Get Serving System Response/Data Services"^50223^-1 +40^"36,18"^"NAS/Get Serving System Response/Current PLMN"^50209^-1 +40^"36,19"^"NAS/Get Serving System Response/System ID"^50215^-1 +40^"36,20"^"NAS/Get Serving System Response/Base Station"^50257^-1 +40^"36,21"^"NAS/Get Serving System Response/Roaming List"^50258^-1 +40^"36,22"^"NAS/Get Serving System Response/Default Roaming"^50260^-1 +40^"36,23"^"NAS/Get Serving System Response/Time Zone"^50261^-1 +40^"36,24"^"NAS/Get Serving System Response/Protocol Revision"^50262^-1 +40^"37,1"^"NAS/Get Home Network Response/Home Network"^50209^-1 +40^"37,2"^"NAS/Get Home Network Response/Result Code"^50000^-1 +40^"37,16"^"NAS/Get Home Network Response/Home IDs"^50215^-1 +40^"37,17"^"NAS/Get Home Network Response/Extended Home Network"^50269^-1 +40^"38,2"^"NAS/Get Preferred Networks Response/Result Code"^50000^-1 +40^"38,16"^"NAS/Get Preferred Networks Response/Networks"^50210^-1 +40^"38,17"^"NAS/Get Preferred Networks Response/Static Networks"^50210^-1 +40^"39,2"^"NAS/Set Preferred Networks Response/Result Code"^50000^-1 +40^"40,2"^"NAS/Get Forbidden Networks Response/Result Code"^50000^-1 +40^"40,16"^"NAS/Get Forbidden Networks Response/Networks"^50213^-1 +40^"41,2"^"NAS/Set Forbidden Networks Response/Result Code"^50000^-1 +40^"42,2"^"NAS/Set Technology Preference Response/Result Code"^50000^-1 +40^"43,1"^"NAS/Get Technology Preference Response/Active Preference"^50216^-1 +40^"43,2"^"NAS/Get Technology Preference Response/Result Code"^50000^-1 +40^"43,16"^"NAS/Get Technology Preference Response/Persistent Preference"^50217^-1 +40^"44,1"^"NAS/Get ACCOLC Response/ACCOLC"^50218^-1 +40^"44,2"^"NAS/Get ACCOLC Response/Result Code"^50000^-1 +40^"45,2"^"NAS/Set ACCOLC Response/Result Code"^50000^-1 +40^"46,1"^"NAS/Get System Preference/Pref"^50224^-1 +40^"46,2"^"NAS/Get System Preference/Result Code"^50000^-1 +40^"47,2"^"NAS/Get Network Parameters Response/Result Code"^50000^-1 +40^"47,17"^"NAS/Get Network Parameters Response/SCI"^50225^-1 +40^"47,18"^"NAS/Get Network Parameters Response/SCM"^50226^-1 +40^"47,19"^"NAS/Get Network Parameters Response/Registration"^50227^-1 +40^"47,20"^"NAS/Get Network Parameters Response/CDMA 1xEV-DO Revision"^50228^-1 +40^"47,21"^"NAS/Get Network Parameters Response/CDMA 1xEV-DO SCP Custom"^50229^-1 +40^"47,22"^"NAS/Get Network Parameters Response/Roaming"^50231^-1 +40^"48,2"^"NAS/Set Network Parameters Response/Result Code"^50000^-1 +40^"49,1"^"NAS/Get RF Info Response/RF Info"^50235^-1 +40^"49,2"^"NAS/Get RF Info Response/Result Code"^50000^-1 +40^"50,1"^"NAS/Get AN-AAA Authentication Status Response/Status"^50237^-1 +40^"50,2"^"NAS/Get AN-AAA Authentication Status Response/Result Code"^50000^-1 +40^"51,2"^"NAS/Set System Selection Pref Response/Result Code"^50000^-1 +40^"52,2"^"NAS/Get System Selection Pref Response/Result Code"^50000^-1 +40^"52,16"^"NAS/Get System Selection Pref Response/Emergency Mode"^50263^-1 +40^"52,17"^"NAS/Get System Selection Pref Response/Mode"^50264^-1 +40^"52,18"^"NAS/Get System Selection Pref Response/Band"^50265^-1 +40^"52,19"^"NAS/Get System Selection Pref Response/PRL"^50266^-1 +40^"52,20"^"NAS/Get System Selection Pref Response/Roaming"^50267^-1 +40^"55,2"^"NAS/Set DDTM Preference Response/Result Code"^50000^-1 +40^"56,1"^"NAS/Get DDTM Preference Response/DDTM"^50268^-1 +40^"56,2"^"NAS/Get DDTM Preference Response/Result Code"^50000^-1 +40^"59,2"^"NAS/Get CSP PLMN Mode Response/Result Code"^50000^-1 +40^"59,16"^"NAS/Get CSP PLMN Mode Response/Mode"^50273^-1 +40^"68,2"^"NAS/Get PLMN Name Response/Result Code"^50000^-1 +40^"68,16"^"NAS/Get PLMN Name Response/Name"^50274^-1 +41^"2,16"^"NAS/Event Report/Signal Strength"^50201^-1 +41^"2,17"^"NAS/Event Report/RF Info"^50235^-1 +41^"2,18"^"NAS/Event Report/Registration Reject"^50236^-1 +41^"2,19"^"NAS/Event Report/RSSI"^50245^-1 +41^"2,20"^"NAS/Event Report/ECIO"^50246^-1 +41^"2,21"^"NAS/Event Report/IO"^50247^-1 +41^"2,22"^"NAS/Event Report/SINR"^50248^-1 +41^"2,23"^"NAS/Event Report/Error Rate"^50249^-1 +41^"2,24"^"NAS/Event Report/RSRQ"^50275^-1 +41^"36,1"^"NAS/Serving System Indication/Serving System"^50207^-1 +41^"36,16"^"NAS/Serving System Indication/Roaming Indicator"^50208^-1 +41^"36,17"^"NAS/Serving System Indication/Data Services"^50223^-1 +41^"36,18"^"NAS/Serving System Indication/Current PLMN"^50209^-1 +41^"36,19"^"NAS/Serving System Indication/System ID"^50215^-1 +41^"36,20"^"NAS/Serving System Indication/Base Station"^50257^-1 +41^"36,21"^"NAS/Serving System Indication/Roaming List"^50258^-1 +41^"36,22"^"NAS/Serving System Indication/Default Roaming"^50260^-1 +41^"36,23"^"NAS/Serving System Indication/Time Zone"^50261^-1 +41^"36,24"^"NAS/Serving System Indication/Protocol Revision"^50262^-1 +41^"36,25"^"NAS/Serving System Indication/PLMN Change"^50272^-1 +41^"52,16"^"NAS/System Selection Pref Indication/Emergency Mode"^50263^-1 +41^"52,17"^"NAS/System Selection Pref Indication/Mode"^50264^-1 +41^"52,18"^"NAS/System Selection Pref Indication/Band"^50265^-1 +41^"52,19"^"NAS/System Selection Pref Indication/PRL"^50266^-1 +41^"52,20"^"NAS/System Selection Pref Indication/Roaming"^50267^-1 +41^"56,1"^"NAS/DDTM Preference Indication/DDTM"^50268^-1 +41^"60,16"^"NAS/CSP PLMN Mode Indication/Mode"^50273^-1 +45^"1,16"^"WMS/Set Event Report Request/New MT Message Indicator"^50300^-1 +45^"32,1"^"WMS/Raw Send Request/Message Data"^50302^-1 +45^"32,16"^"WMS/Raw Send Request/Force On DC"^50321^-1 +45^"32,17"^"WMS/Raw Send Request/Follow On DC"^50322^-1 +45^"32,18"^"WMS/Raw Send Request/Link Control"^50323^-1 +45^"33,1"^"WMS/Raw Write Request/Message Data"^50304^-1 +45^"34,1"^"WMS/Raw Read Request/Message Index"^50301^-1 +45^"34,16"^"WMS/Raw Read Request/Message Mode"^50310^-1 +45^"35,1"^"WMS/Modify Tag Request/Message Tag"^50307^-1 +45^"35,16"^"WMS/Modify Tag Request/Message Mode"^50310^-1 +45^"36,1"^"WMS/Delete Request/Memory Storage"^50308^-1 +45^"36,16"^"WMS/Delete Request/Message Index"^50305^-1 +45^"36,17"^"WMS/Delete Request/Message Tag"^50309^-1 +45^"36,18"^"WMS/Delete Request/Message Mode"^50310^-1 +45^"49,1"^"WMS/List Messages Request/Memory Storage"^50308^-1 +45^"49,16"^"WMS/List Messages Request/Message Tag"^50309^-1 +45^"49,17"^"WMS/List Messages Request/Message Mode"^50310^-1 +45^"50,1"^"WMS/Set Routes Request/Route List"^50313^-1 +45^"50,16"^"WMS/Set Routes Request/Transfer Status Report"^50326^-1 +45^"53,1"^"WMS/Set SMSC Address Request/Address"^50319^-1 +45^"53,16"^"WMS/Set SMSC Address Request/Address Type"^50318^-1 +45^"54,1"^"WMS/Get Storage Max Size Request/Memory Storage"^50308^-1 +45^"54,16"^"WMS/Get Storage Max Size Request/Message Mode"^50310^-1 +45^"55,1"^"WMS/Send ACK Request/ACK"^50329^-1 +45^"55,16"^"WMS/Send ACK Request/3GPP2 Failure Info"^50330^-1 +45^"55,17"^"WMS/Send ACK Request/3GPP Failure Info"^50331^-1 +45^"56,1"^"WMS/Set Retry Period Request/Period"^50332^-1 +45^"57,1"^"WMS/Set Retry Interval Request/Interval"^50333^-1 +45^"58,1"^"WMS/Set DC Disconnect Timer Request/Timer"^50334^-1 +45^"59,1"^"WMS/Set Memory Status Request/Status"^50335^-1 +45^"60,1"^"WMS/Set Broadcast Activation Request/BC Info"^50336^-1 +45^"61,1"^"WMS/Set Broadcast Config Request/Mode"^50310^-1 +45^"61,16"^"WMS/Set Broadcast Config Request/3GPP Info"^50337^-1 +45^"61,17"^"WMS/Set Broadcast Config Request/3GPP2 Info"^50339^-1 +45^"62,1"^"WMS/Get Broadcast Config Request/Mode"^50310^-1 +45^"65,1"^"WMS/Set Domain Preference Request/Pref"^50344^-1 +45^"66,1"^"WMS/Send From Memory Store Request/Info"^50345^-1 +46^"0,2"^"WMS/Reset Response/Result Code"^50000^-1 +46^"1,2"^"WMS/Set Event Report Response/Result Code"^50000^-1 +46^"32,2"^"WMS/Raw Send Response/Result Code"^50000^-1 +46^"32,16"^"WMS/Raw Send Response/Cause Code"^50303^-1 +46^"32,17"^"WMS/Raw Send Response/Error Class"^50324^-1 +46^"32,18"^"WMS/Raw Send Response/Cause Info"^50325^-1 +46^"33,1"^"WMS/Raw Write Response/Message Index"^50305^-1 +46^"33,2"^"WMS/Raw Write Response/Result Code"^50000^-1 +46^"34,1"^"WMS/Raw Read Response/Message Data"^50306^-1 +46^"34,2"^"WMS/Raw Read Response/Result Code"^50000^-1 +46^"35,2"^"WMS/Modify Tag Response/Result Code"^50000^-1 +46^"36,2"^"WMS/Delete Response/Result Code"^50000^-1 +46^"48,1"^"WMS/Get Message Protocol Response/Message Protocol"^50310^-1 +46^"48,2"^"WMS/Get Message Protocol Response/Result Code"^50000^-1 +46^"49,1"^"WMS/List Messages Response/Message List"^50311^-1 +46^"49,2"^"WMS/List Messages Response/Result Code"^50000^-1 +46^"50,2"^"WMS/Set Routes Response/Result Code"^50000^-1 +46^"51,1"^"WMS/Get Routes Response/Route List"^50315^-1 +46^"51,16"^"WMS/Get Routes Response/Transfer Status Report"^50326^-1 +46^"51,2"^"WMS/Get Routes Response/Result Code"^50000^-1 +46^"52,1"^"WMS/Get SMSC Address Response/Address"^50317^-1 +46^"52,2"^"WMS/Get SMSC Address Response/Result Code"^50000^-1 +46^"54,1"^"WMS/Get Storage Max Size Response/Max Size"^50327^-1 +46^"54,2"^"WMS/Get Storage Max Size Response/Result Code"^50000^-1 +46^"54,16"^"WMS/Get Storage Max Size Response/Available Size"^50328^-1 +46^"55,2"^"WMS/Send ACK Response/Result Code"^50000^-1 +46^"56,2"^"WMS/Set Retry Period Response/Result Code"^50000^-1 +46^"57,2"^"WMS/Set Retry Interval Response/Result Code"^50000^-1 +46^"58,2"^"WMS/Set DC Disconnect Timer Response/Result Code"^50000^-1 +46^"59,2"^"WMS/Set Memory Status Response/Result Code"^50000^-1 +46^"60,2"^"WMS/Set Broadcast Activation Response/Result Code"^50000^-1 +46^"61,2"^"WMS/Set Broadcast Config Response/Result Code"^50000^-1 +46^"62,2"^"WMS/Get Broadcast Config Response/Result Code"^50000^-1 +46^"62,16"^"WMS/Get Broadcast Config Response/3GPP Info"^50341^-1 +46^"62,17"^"WMS/Get Broadcast Config Response/3GPP2 Info"^50342^-1 +46^"64,1"^"WMS/Get Domain Preference Response/Pref"^50344^-1 +46^"64,2"^"WMS/Get Domain Preference Response/Result Code"^50000^-1 +46^"65,2"^"WMS/Set Domain Preference Response/Result Code"^50000^-1 +46^"66,2"^"WMS/Send From Memory Store Response/Result Code"^50000^-1 +46^"66,16"^"WMS/Send From Memory Store Response/Message ID"^50346^-1 +46^"66,17"^"WMS/Send From Memory Store Response/Cause Code"^50303^-1 +46^"66,18"^"WMS/Send From Memory Store Response/Error Class"^50324^-1 +46^"66,19"^"WMS/Send From Memory Store Response/Cause Info"^50325^-1 +47^"1,16"^"WMS/Event Report/Received MT Message"^50301^-1 +47^"1,17"^"WMS/Event Report/Transfer Route MT Message"^50320^-1 +47^"1,18"^"WMS/Event Report/Message Mode"^50310^-1 +47^"63,1"^"WMS/Memory Full Indication/Info"^50343^-1 +47^"70,1"^"WMS/SMSC Address Indication/Address"^50317^-1 +48^"1,16"^"PDS/Set Event Report Request/NMEA Indicator"^50400^-1 +48^"1,17"^"PDS/Set Event Report Request/Mode Indicator"^50416^-1 +48^"1,18"^"PDS/Set Event Report Request/Raw Indicator"^50420^-1 +48^"1,19"^"PDS/Set Event Report Request/XTRA Request Indicator"^50421^-1 +48^"1,20"^"PDS/Set Event Report Request/Time Injection Indicator"^50422^-1 +48^"1,21"^"PDS/Set Event Report Request/Wi-Fi Indicator"^50423^-1 +48^"1,22"^"PDS/Set Event Report Request/Satellite Indicator"^50424^-1 +48^"1,23"^"PDS/Set Event Report Request/VX Network Indicator"^50425^-1 +48^"1,24"^"PDS/Set Event Report Request/SUPL Network Indicator"^50426^-1 +48^"1,25"^"PDS/Set Event Report Request/UMTS CP Network Indicator"^50427^-1 +48^"1,26"^"PDS/Set Event Report Request/PDS Comm Indicator"^50428^-1 +48^"33,1"^"PDS/Set Service State Request/State"^50403^-1 +48^"34,1"^"PDS/Start Tracking Session Request/Session"^50404^-1 +48^"39,1"^"PDS/Set NMEA Config Request/Config"^50405^-1 +48^"40,1"^"PDS/Inject Time Reference Request/Time"^50406^-1 +48^"42,1"^"PDS/Set Defaults Request/Defaults"^50407^-1 +48^"44,16"^"PDS/Set XTRA Parameters Request/Automatic"^50408^-1 +48^"44,17"^"PDS/Set XTRA Parameters Request/Medium"^50409^-1 +48^"44,18"^"PDS/Set XTRA Parameters Request/Network"^50410^-1 +48^"44,20"^"PDS/Set XTRA Parameters Request/Embedded"^50441^-1 +48^"46,18"^"PDS/Get AGPS Config Request/Network Mode"^50471^-1 +48^"47,16"^"PDS/Set AGPS Config Request/Server"^50412^-1 +48^"47,17"^"PDS/Set AGPS Config Request/Server URL"^50432^-1 +48^"47,18"^"PDS/Set AGPS Config Request/Network Mode"^50471^-1 +48^"49,1"^"PDS/Set Service Auto-Tracking State Request/State"^50413^-1 +48^"51,1"^"PDS/Set COM Port Auto-Tracking Config Request/Config"^50413^-1 +48^"52,16"^"PDS/Reset PDS Data Request/GPS Data"^50414^-1 +48^"52,17"^"PDS/Reset PDS Data Request/Cell Data"^50415^-1 +48^"53,16"^"PDS/Single Position Fix Request/Mode"^50442^-1 +48^"53,17"^"PDS/Single Position Fix Request/Timeout"^50443^-1 +48^"53,18"^"PDS/Single Position Fix Request/Accuracy"^50444^-1 +48^"55,1"^"PDS/Inject XTRA Data Request/Data"^50446^-1 +48^"56,16"^"PDS/Inject Position Data Request/Timestamp"^50447^-1 +48^"56,17"^"PDS/Inject Position Data Request/Latitude"^50448^-1 +48^"56,18"^"PDS/Inject Position Data Request/Longitude"^50449^-1 +48^"56,19"^"PDS/Inject Position Data Request/Altitude Ellipsoid"^50450^-1 +48^"56,20"^"PDS/Inject Position Data Request/Altitude Sea Level"^50451^-1 +48^"56,21"^"PDS/Inject Position Data Request/Horizontal Uncertainty"^50452^-1 +48^"56,22"^"PDS/Inject Position Data Request/Vertical Uncertainty"^50453^-1 +48^"56,23"^"PDS/Inject Position Data Request/Horizontal Confidence"^50454^-1 +48^"56,24"^"PDS/Inject Position Data Request/Vertical Confidence"^50455^-1 +48^"56,25"^"PDS/Inject Position Data Request/Source"^50456^-1 +48^"57,16"^"PDS/Inject Wi-Fi Position Data Request/Time"^50457^-1 +48^"57,17"^"PDS/Inject Wi-Fi Position Data Request/Position"^50458^-1 +48^"57,18"^"PDS/Inject Wi-Fi Position Data Request/AP Info"^50459^-1 +48^"59,16"^"PDS/Set SBAS Config Request/Config"^50462^-1 +48^"60,1"^"PDS/Send Network Initiated Response Request/Action"^50463^-1 +48^"60,16"^"PDS/Send Network Initiated Response Request/VX"^50437^-1 +48^"60,17"^"PDS/Send Network Initiated Response Request/SUPL"^50438^-1 +48^"60,18"^"PDS/Send Network Initiated Response Request/UMTS CP"^50439^-1 +48^"61,1"^"PDS/Inject Absolute Time Request/Time"^50464^-1 +48^"62,1"^"PDS/Inject EFS Data Request/Date File"^50465^-1 +48^"64,1"^"PDS/Set DPO Config Request/Config"^50467^-1 +48^"66,16"^"PDS/Set ODP Config Request/Config"^50468^-1 +48^"81,16"^"PDS/Set Position Methods State Request/XTRA Time"^50470^-1 +48^"81,17"^"PDS/Set Position Methods State Request/XTRA Data"^50470^-1 +48^"81,18"^"PDS/Set Position Methods State Request/Wi-Fi"^50470^-1 +49^"0,2"^"PDS/Reset Response/Result Code"^50000^-1 +49^"1,2"^"PDS/Set Event Report Response/Result Code"^50000^-1 +49^"32,1"^"PDS/Get Service State Response/State"^50402^-1 +49^"32,2"^"PDS/Get Service State Response/Result Code"^50000^-1 +49^"33,2"^"PDS/Set Service State Response/Result Code"^50000^-1 +49^"34,2"^"PDS/Start Tracking Session Response/Result Code"^50000^-1 +49^"35,1"^"PDS/Get Tracking Session Info Response/Info"^50404^-1 +49^"35,2"^"PDS/Get Tracking Session Info Response/Result Code"^50000^-1 +49^"36,2"^"PDS/Fix Position Response/Result Code"^50000^-1 +49^"37,2"^"PDS/End Tracking Session Response/Result Code"^50000^-1 +49^"38,1"^"PDS/Get NMEA Config Response/Config"^50405^-1 +49^"38,2"^"PDS/Get NMEA Config Response/Result Code"^50000^-1 +49^"39,2"^"PDS/Set NMEA Config Response/Result Code"^50000^-1 +49^"40,2"^"PDS/Inject Time Reference Response/Result Code"^50000^-1 +49^"41,1"^"PDS/Get Defaults Response/Defaults"^50407^-1 +49^"41,2"^"PDS/Get Defaults Response/Result Code"^50000^-1 +49^"42,2"^"PDS/Set Defaults Response/Result Code"^50000^-1 +49^"43,2"^"PDS/Get XTRA Parameters Response/Result Code"^50000^-1 +49^"43,16"^"PDS/Get XTRA Parameters Response/Automatic"^50408^-1 +49^"43,17"^"PDS/Get XTRA Parameters Response/Medium"^50409^-1 +49^"43,18"^"PDS/Get XTRA Parameters Response/Network"^50410^-1 +49^"43,19"^"PDS/Get XTRA Parameters Response/Validity"^50411^-1 +49^"43,20"^"PDS/Get XTRA Parameters Response/Embedded"^50441^-1 +49^"44,2"^"PDS/Set XTRA Parameters Response/Result Code"^50000^-1 +49^"45,2"^"PDS/Force XTRA Download Response/Result Code"^50000^-1 +49^"46,2"^"PDS/Get AGPS Config Response/Result Code"^50000^-1 +49^"46,16"^"PDS/Get AGPS Config Response/Server"^50412^-1 +49^"46,17"^"PDS/Get AGPS Config Response/Server URL"^50432^-1 +49^"47,2"^"PDS/Set AGPS Config Response/Result Code"^50000^-1 +49^"48,1"^"PDS/Get Service Auto-Tracking State Response/State"^50413^-1 +49^"48,2"^"PDS/Get Service Auto-Tracking State Response/Result Code"^50000^-1 +49^"49,2"^"PDS/Set Service Auto-Tracking State Response/Result Code"^50000^-1 +49^"50,1"^"PDS/Get COM Port Auto-Tracking Config Response/Config"^50413^-1 +49^"50,2"^"PDS/Get COM Port Auto-Tracking Config Response/Result Code"^50000^-1 +49^"51,2"^"PDS/Set COM Port Auto-Tracking Config Response/Result Code"^50000^-1 +49^"52,2"^"PDS/Reset PDS Data Response/Result Code"^50000^-1 +49^"53,2"^"PDS/Single Position Fix Response/Result Code"^50000^-1 +49^"54,1"^"PDS/Get Service Version Response/Version"^50445^-1 +49^"54,2"^"PDS/Get Service Version Response/Result Code"^50000^-1 +49^"55,2"^"PDS/Inject XTRA Data Response/Result Code"^50000^-1 +49^"56,2"^"PDS/Inject Position Data Response/Result Code"^50000^-1 +49^"57,2"^"PDS/Inject Wi-Fi Position Data Response/Result Code"^50000^-1 +49^"58,2"^"PDS/Get SBAS Config Response/Result Code"^50000^-1 +49^"58,16"^"PDS/Get SBAS Config Response/Config"^50461^-1 +49^"59,2"^"PDS/Set SBAS Config Response/Result Code"^50000^-1 +49^"60,2"^"PDS/Send Network Initiated Response Response/Result Code"^50000^-1 +49^"61,2"^"PDS/Inject Absolute Time Response/Result Code"^50000^-1 +49^"62,2"^"PDS/Inject EFS Data Response/Result Code"^50000^-1 +49^"63,2"^"PDS/Get DPO Config Response/Result Code"^50000^-1 +49^"63,16"^"PDS/Get DPO Config Response/Config"^50466^-1 +49^"64,2"^"PDS/Set DPO Config Response/Result Code"^50000^-1 +49^"65,2"^"PDS/Get ODP Config Response/Result Code"^50000^-1 +49^"65,16"^"PDS/Get ODP Config Response/Config"^50468^-1 +49^"66,2"^"PDS/Set ODP Config Response/Result Code"^50000^-1 +49^"67,2"^"PDS/Cancel Single Position Fix Response/Result Code"^50000^-1 +49^"68,2"^"PDS/Get GPS State Response/Result Code"^50000^-1 +49^"68,16"^"PDS/Get GPS State Response/State"^50469^-1 +49^"80,2"^"PDS/Get Position Methods State Response/Result Code"^50000^-1 +49^"80,16"^"PDS/Get Position Methods State Response/XTRA Time"^50470^-1 +49^"80,17"^"PDS/Get Position Methods State Response/XTRA Data"^50470^-1 +49^"80,18"^"PDS/Get Position Methods State Response/Wi-Fi"^50470^-1 +49^"81,2"^"PDS/Set Position Methods State Response/Result Code"^50000^-1 +50^"1,16"^"PDS/Event Report/NMEA Sentence"^50401^-1 +50^"1,17"^"PDS/Event Report/NMEA Sentence Plus Mode"^50417^-1 +50^"1,18"^"PDS/Event Report/Position Session Status"^50429^-1 +50^"1,19"^"PDS/Event Report/Parsed Position Data"^50430^-1 +50^"1,20"^"PDS/Event Report/External XTRA Request"^50431^-1 +50^"1,21"^"PDS/Event Report/External Time Injection Request"^50433^-1 +50^"1,22"^"PDS/Event Report/External Wi-Fi Position Request"^50434^-1 +50^"1,23"^"PDS/Event Report/Satellite Info"^50435^-1 +50^"1,24"^"PDS/Event Report/VX Network Initiated Prompt"^50437^-1 +50^"1,25"^"PDS/Event Report/SUPL Network Initiated Prompt"^50438^-1 +50^"1,26"^"PDS/Event Report/UMTS CP Network Initiated Prompt"^50439^-1 +50^"1,27"^"PDS/Event Report/Comm Events"^50440^-1 +50^"32,1"^"PDS/Service State Indication/State"^50402^-1 +51^"32,16"^"AUTH/Start EAP Session Request/Method Mask"^50700^-1^0 +51^"33,1"^"AUTH/Send EAP Packet Request/Request Packet"^50701^-1^0 +52^"32,2"^"AUTH/Start EAP Session Response/Result Code"^50000^-1^0 +52^"33,1"^"AUTH/Send EAP Packet Response/Response Packet"^50703^-1^0 +52^"33,2"^"AUTH/Send EAP Packet Response/Result Code"^50000^-1^0 +52^"35,1"^"AUTH/Get EAP Session Keys Response/Session Keys"^50705^-1^0 +52^"35,2"^"AUTH/Get EAP Session Keys Response/Result Code"^50000^-1^0 +52^"36,2"^"AUTH/End EAP Session Response/Result Code"^50000^-1^0 +52^"34,1"^"AUTH/EAP Session Result/Result"^50704^-1^0 +54^"1,16"^"CAT/Set Event Report Request/Report Mask"^50600^-1^0 +54^"33,1"^"CAT/Send Terminal Response Request/Terminal Response Type"^50612^-1^0 +54^"34,1"^"CAT/Envelope Command Request/Envelope Command"^50613^-1^0 +55^"0,2"^"CAT/Reset Response/Result Code"^50000^-1^0 +55^"1,2"^"CAT/Set Event Report Response/Result Code"^50000^-1^0 +55^"1,16"^"CAT/Set Event Report Response/Reg Status Mask"^50600^-1^0 +55^"32,1"^"CAT/Get Service State Response/CAT Service State"^50615^-1^0 +55^"32,2"^"CAT/Get Service State Response/Result Code"^50000^-1^0 +55^"33,2"^"CAT/Send Terminal Response Response/Result Code"^50000^-1^0 +55^"34,2"^"CAT/Envelope Command Response/Result Code"^50000^-1^0 +56^"1,16"^"CAT/Event Report/Display Text Event"^50601^-1^0 +56^"1,17"^"CAT/Event Report/Get Inkey Event"^50602^-1^0 +56^"1,18"^"CAT/Event Report/Get Input Event"^50603^-1^0 +56^"1,19"^"CAT/Event Report/Setup Menu Event"^50604^-1^0 +56^"1,20"^"CAT/Event Report/Select Item Event"^50605^-1^0 +56^"1,21"^"CAT/Event Report/Alpha ID Available"^50606^-1^0 +56^"1,22"^"CAT/Event Report/Setup Event List"^50607^-1^0 +56^"1,23"^"CAT/Event Report/Setup Idle Mode Text Event"^50608^-1^0 +56^"1,24"^"CAT/Event Report/Language Notification Event"^50609^-1^0 +56^"1,25"^"CAT/Event Report/Refresh Event"^50610^-1^0 +56^"1,26"^"CAT/Event Report/End Proactive Session"^50611^-1^0 +57^"33,16"^"RMS/Set SMS Wake Request/State"^50500^-1^0 +57^"33,17"^"RMS/Set SMS Wake Request/Mask"^50501^-1^0 +58^"0,2"^"RMS/Reset Response/Result Code"^50000^-1^0 +58^"32,2"^"RMS/Get SMS Wake Response/Result Code"^50000^-1^0 +58^"32,16"^"RMS/Get SMS Wake Response/State"^50500^-1^0 +58^"32,17"^"RMS/Get SMS Wake Request/Mask"^50501^-1^0 +58^"33,2"^"RMS/Set SMS Wake Response/Result Code"^50000^-1^0 +60^"1,16"^"OMA/Set Event Report Request/NIA"^50800^-1^0 +60^"1,17"^"OMA/Set Event Report Request/Status"^50801^-1^0 +60^"32,16"^"OMA/Start Session Request/Type"^50805^-1^0 +60^"35,16"^"OMA/Send Selection Request/Type"^50808^-1^0 +60^"37,16"^"OMA/Set Features Response/Provisioning"^50809^-1^0 +60^"37,17"^"OMA/Set Features Response/PRL Update"^50810^-1^0 +60^"37,18"^"OMA/Set Features Response/HFA Feature"^50811^-1^0 +61^"0,2"^"OMA/Reset Response/Result Code"^50000^-1^0 +61^"1,2"^"OMA/Set Event Report Response/Result Code"^50000^-1^0 +61^"32,2"^"OMA/Start Session Response/Result Code"^50000^-1^0 +61^"33,2"^"OMA/Cancel Session Response/Result Code"^50000^-1^0 +61^"34,2"^"OMA/Get Session Info Response/Result Code"^50000^-1^0 +61^"34,16"^"OMA/Get Session Info Response/Info"^50806^-1^0 +61^"34,17"^"OMA/Get Session Info Response/Failure"^50804^-1^0 +61^"34,18"^"OMA/Get Session Info Response/Retry"^50807^-1^0 +61^"34,19"^"OMA/Get Session Info Response/NIA"^50802^-1^0 +61^"35,2"^"OMA/Send Selection Response/Result Code"^50000^-1^0 +61^"36,2"^"OMA/Get Features Response/Result Code"^50000^-1^0 +61^"36,16"^"OMA/Get Features Response/Provisioning"^50809^-1^0 +61^"36,17"^"OMA/Get Features Response/PRL Update"^50810^-1^0 +61^"36,18"^"OMA/Get Features Response/HFA Feature"^50811^-1^0 +61^"36,19"^"OMA/Get Features Response/HFA Done State"^50812^-1^0 +61^"37,2"^"OMA/Set Features Response/Result Code"^50000^-1^0 +62^"1,16"^"OMA/Event Report/NIA"^50802^-1^0 +62^"1,17"^"OMA/Event Report/Status"^50803^-1^0 +62^"1,18"^"OMA/Event Report/Failure"^50804^-1^0 +63^"58,1"^"Voice/Initiate USSD Request/Info"^70000^-1^0 +63^"59,1"^"Voice/Answer USSD Request/Info"^70000^-1^0 +63^"67,1"^"Voice/Async Initiate USSD Request/Info"^70000^-1^0 +64^"58,2"^"Voice/Initiate USSD Response/Result Code"^50000^-1^0 +64^"58,16"^"Voice/Initiate USSD Response/Fail Cause"^70001^-1^0 +64^"58,17"^"Voice/Initiate USSD Response/Alpha ID"^70002^-1^0 +64^"58,18"^"Voice/Initiate USSD Response/Data"^70000^-1^0 +64^"59,2"^"Voice/Answer USSD Response/Result Code"^50000^-1^0 +64^"60,2"^"Voice/Cancel USSD Response/Result Code"^50000^-1^0 +64^"67,2"^"Voice/Async Initiate USSD Response/Result Code"^50000^-1^0 +65^"62,1"^"Voice/USSD Indication/Type"^70003^-1^0 +65^"62,16"^"Voice/USSD Indication/Data"^70000^-1 +65^"67,16"^"Voice/USSD Async Indication/Error"^70004^-1^0 +65^"67,17"^"Voice/USSD Async Indication/Fail Cause"^70001^-1^0 +65^"67,18"^"Voice/USSD Async Indication/Info"^70000^-1^0 +65^"67,19"^"Voice/USSD Async Indication/Alpha ID"^70002^-1^0 \ No newline at end of file diff --git a/gobi-api/GobiAPI_1.0.40/Database/QMI/Enum.txt b/gobi-api/GobiAPI_1.0.40/Database/QMI/Enum.txt new file mode 100755 index 0000000..a772f9a --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Database/QMI/Enum.txt @@ -0,0 +1,147 @@ +50000^"QMI Results"^-1^0 +50001^"QMI Errors"^-1^0 +50002^"QMI Data Bearer Technologies"^-1^0 +50003^"QMI Connection Status"^-1^0 +50004^"QMI Profile Types"^-1^0 +50005^"QMI PDP Types"^-1^0 +50006^"QMI Traffic Classes"^-1^0 +50007^"QMI QoS Delivery Orders"^-1^0 +50008^"QMI SDU Error Ratios"^-1^0 +50009^"QMI SDU Residual Bit Error Ratios"^-1^0 +50010^"QMI Erroneous SDU Deliveries"^-1^0 +50011^"QMI Dormancy Status"^-1^0 +50012^"QMI Call End Reasons"^-1^0 +50013^"QMI Mobile IP Modes"^-1^0 +50014^"QMI Call History Types"^-1^0 +50015^"QMI Call Types"^-1^0 +50016^"QMI HA/AAA Key States"^-1^0 +50017^"QMI WDS Network Types"^-1^0 +50018^"QMI WDS Extended Tech Prefs"^-1^0 +50019^"QMI WDS Call Types"^-1^0 +50020^"QMI WDS IP Families"^-1^0 +50021^"QMI WDS Mobile IP Call End Reasons"^-1^0 +50022^"QMI WDS Internal Call End Reasons"^-1^0 +50023^"QMI WDS Call Manager Call End Reasons"^-1^0 +50024^"QMI WDS 3GPP Call End Reasons"^-1^0 +50025^"QMI WDS Call End Reason Types"^-1^0 +50026^"QMI WDS Autoconnect Settings"^-1^0 +50027^"QMI WDS Autoconnect Roam Settings"^-1^0 +50028^"QMI PDP Access Control Flag"^-1^0 +50029^"QMI IP Version"^-1^0 +50030^"QMI Address Allocation Preference"^-1^0 +50031^"QMI QoS Class Identifier"^-1^0 +50032^"QMI Authentication Protocol"^-1^0 +50033^"QMI Data Rate"^-1^0 +50034^"QMI Application Type"^-1^0 +50035^"QMI Data Mode"^-1^0 +50036^"QMI PDN Type"^-1^0 +50037^"QMI Extended Error Code"^-1^0 +50100^"QMI Power Sources"^-1^0 +50101^"QMI Data Service Capabilities 1"^-1^0 +50102^"QMI DMS Radio Interfaces"^-1^0 +50103^"QMI DMS Activation States"^-1^0 +50104^"QMI DMS Operating Modes"^-1^0 +50105^"QMI DMS Timestamp Sources"^-1^0 +50106^"QMI DMS Activation Types"^-1^0 +50107^"QMI DMS Lock States"^-1^0 +50108^"QMI DMS PIN Status"^-1^0 +50109^"QMI DMS UIM Facility"^-1^0 +50110^"QMI DMS UIM Facility States"^-1^0 +50111^"QMI DMS UIM States"^-1^0 +50112^"QMI DMS Image Types"^-1^0 +50113^"QMI DMS Time References"^-1^0 +50200^"QMI NAS Radio Interfaces"^-1^0 +50201^"QMI In Use States"^-1^0 +50202^"QMI Roaming States"^-1^0 +50203^"QMI Forbidden States"^-1^0 +50204^"QMI Preferred States"^-1^0 +50205^"QMI Register Actions"^-1^0 +50206^"QMI Radio Access Technologies"^-1^0 +50207^"QMI PS Attach Actions"^-1^0 +50208^"QMI Registration States"^-1^0 +50209^"QMI CS/PS Attach States"^-1^0 +50210^"QMI Registered Networks"^-1^0 +50211^"QMI Roaming Indicators"^-1^0 +50212^"QMI Tech Pref Durations"^-1^0 +50213^"QMI Tech Prefs"^-1^0 +50214^"QMI Data Service Capabilities 2"^-1^0 +50215^"QMI NAS System Preferences"^-1^0 +50216^"QMI NAS Roaming Preferences"^-1^0 +50217^"QMI NAS Band Classes"^-1^0 +50218^"QMI NAS Service Domains"^-1^0 +50219^"QMI NAS AN-AAA Authentication Status"^-1^0 +50220^"QMI NAS SINR Levels"^-1^0 +50221^"QMI NAS PRL Preferences"^-1^0 +50222^"QMI NAS Roaming Preferences 2"^-1^0 +50223^"QMI NAS DDTM Preferences"^-1^0 +50224^"QMI NAS Service Option Actions"^-1^0 +50225^"QMI NAS Network Description Displays"^-1^0 +50226^"QMI NAS Network Description Encodings"^-1^0 +50227^"QMI NAS PLMN Name Encoding Schemes"^-1^0 +50228^"QMI NAS PLMN Name Country Initials"^-1^0 +50229^"QMI NAS PLMN Name Spare Bits"^-1^0 +50230^"QMI Change Duration"^-1^0 +50300^"QMI WMS Storage Types"^-1^0 +50301^"QMI WMS Message Formats"^-1^0 +50302^"QMI WMS Message Tags"^-1^0 +50303^"QMI WMS Message Protocols"^-1^0 +50304^"QMI WMS Message Types"^-1^0 +50305^"QMI WMS Message Classes"^-1^0 +50306^"QMI WMS Receipt Actions"^-1^0 +50307^"QMI WMS Route Values"^-1^0 +50308^"QMI WMS CDMA Service Options"^-1^0 +50309^"QMI WMS Error Classes"^-1^0 +50310^"QMI WMS Error Classes 2"^-1^0 +50311^"QMI WMS GSM/WCDMA Domains"^-1^0 +50400^"QMI PDS Tracking Session States"^-1^0 +50401^"QMI PDS Session Control Types"^-1^0 +50402^"QMI PDS Session Types"^-1^0 +50403^"QMI PDS Operation Types"^-1^0 +50404^"QMI PDS Server Options"^-1^0 +50405^"QMI PDS Output Devices"^-1^0 +50406^"QMI PDS NMEA Reporting Options"^-1^0 +50407^"QMI PDS Mediums"^-1^0 +50408^"QMI PDS WWAN Network Preferences"^-1^0 +50409^"QMI PDS NMEA Sentence Operating Modes"^-1^0 +50410^"QMI PDS Session Status"^-1^0 +50411^"QMI PDS Calendar Months"^-1^0 +50412^"QMI PDS Calendar Days"^-1^0 +50413^"QMI PDS Wi-Fi Request Types"^-1^0 +50414^"QMI PDS SV Systems"^-1^0 +50415^"QMI PDS SV Health Status"^-1^0 +50416^"QMI PDS SV Processing Status"^-1^0 +50417^"QMI PDS SV Ephemeris Status"^-1^0 +50418^"QMI PDS SV Almanac Status"^-1^0 +50419^"QMI PDS Privacy Modes"^-1^0 +50420^"QMI PDS VX Modes"^-1^0 +50421^"QMI PDS VX Data Coding Schemes"^-1^0 +50422^"QMI PDS SUPL Modes"^-1^0 +50423^"QMI PDS SUPL Data Coding Schemes"^-1^0 +50424^"QMI PDS SUPL ID/Name Data Coding Schemes"^-1^0 +50425^"QMI PDS UMTS CP Data Coding Schemes"^-1^0 +50426^"QMI PDS UMTS CP Location Types"^-1^0 +50427^"QMI PDS Comm Event Types"^-1^0 +50428^"QMI PDS Comm Event Protocols"^-1^0 +50429^"QMI PDS Injected Position Sources"^-1^0 +50430^"QMI PDS SBAS States"^-1^0 +50431^"QMI PDS Time Bases"^-1^0 +50432^"QMI PDS EFS File Operations"^-1^0 +50433^"QMI PDS ODP States"^-1^0 +50434^"QMI PDS Method States"^-1^0 +50435^"QMI Network Mode"^-1^0 +50600^"QMI CAT Alpha ID Command Type"^-1^0 +50601^"QMI CAT Refresh Stage"^-1^0 +50602^"QMI CAT Proactive Session End Type"^-1^0 +50603^"QMI CAT Envelope Command Type"^-1^0 +50700^"QMI AUTH EAP Result"^-1^0 +50800^"QMI OMA Session Types"^-1^0 +50801^"QMI OMA Session States"^-1^0 +50802^"QMI OMA Session Failure Reasons"^-1^0 +50803^"QMI OMA Selections"^-1^0 +50804^"QMI OMA HFA Done States"^-1^0 +50900^"QMI Service Types"^-1^0 +50901^"QMI Driver Data Formats"^-1^0 +50902^"QMI Power Save States "^-1^0 +70000^"USSD Data Coding Schemes"^-1^0 +70001^"USSD Alpha Coding Schemes"^-1^0 +70002^"USSD Notifcation Types"^-1^0 \ No newline at end of file diff --git a/gobi-api/GobiAPI_1.0.40/Database/QMI/EnumEntry.txt b/gobi-api/GobiAPI_1.0.40/Database/QMI/EnumEntry.txt new file mode 100755 index 0000000..75837cc --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Database/QMI/EnumEntry.txt @@ -0,0 +1,916 @@ +50000^0^"Success" +50000^1^"Failure" +50001^0^"None" +50001^1^"Malformed Message" +50001^2^"No Memory" +50001^3^"Internal" +50001^4^"Aborted" +50001^5^"Client IDs Exhausted" +50001^6^"Unabortable Transaction" +50001^7^"Invalid Client ID" +50001^8^"No Thresholds Provided" +50001^9^"Invalid Handle" +50001^10^"Invalid Profile" +50001^11^"Invalid PIN ID" +50001^12^"Incorrect PIN" +50001^13^"No Network Found" +50001^14^"Call Failed" +50001^15^"Out Of Call" +50001^16^"Not Provisioned" +50001^17^"Missing Argument" +50001^19^"Argument Too Long" +50001^22^"Invalid Transaction ID" +50001^23^"Device In Use" +50001^24^"Network Unsupported" +50001^25^"Device Unsupported" +50001^26^"No Effect" +50001^27^"No Free Profile" +50001^28^"Invalid PDP Type" +50001^29^"Invalid Technology Preference" +50001^30^"Invalid Profile Type" +50001^31^"Invalid Service Type" +50001^32^"Invalid Register Action" +50001^33^"Invalid PS Attach Action" +50001^34^"Authentication Failed" +50001^35^"PIN Blocked" +50001^36^"PIN Always Blocked" +50001^37^"UIM Uninitialized" +50001^38^"Maximum QoS Requests In Use" +50001^39^"Incorrect Flow Filter" +50001^40^"Network QoS Unaware" +50001^41^"Invalid QoS ID" +50001^42^"QoS Unavailable" +50001^43^"Flow Suspended" +50001^46^"General Error" +50001^47^"Unknown Error" +50001^48^"Invalid Argument" +50001^49^"Invalid Index" +50001^50^"No Entry" +50001^51^"Device Storage Full" +50001^52^"Device Not Ready" +50001^53^"Network Not Ready" +50001^54^"WMS Cause Code" +50001^55^"WMS Message Not Sent" +50001^56^"WMS Message Delivery Failure" +50001^57^"WMS Invalid Message ID" +50001^58^"WMS Encoding" +50001^59^"Authentication Lock" +50001^60^"Invalid Transition" +50001^65^"Session Inactive" +50001^66^"Session Invalid" +50001^67^"Session Ownership" +50001^68^"Insufficient Resources" +50001^69^"Disabled" +50001^70^"Invalid Operation" +50001^71^"Invalid QMI Command" +50001^72^"WMS TPDU Type" +50001^73^"WMS SMSC Address" +50001^74^"Information Unavailable" +50001^75^"Segment Too Long" +50001^76^"Segment Order" +50001^77^"Bundling Not Supported" +50001^80^"SIM File Not Found" +50001^82^"Access Denied" +50001^83^"Hardware Restricted" +50001^61441^"CAT Event Registration Failed" +50001^61442^"CAT Invalid Terminal Response" +50001^61443^"CAT Invalid Envelope Command" +50001^61444^"CAT Envelope Command Busy" +50001^61445^"CAT Envelope Command Failed" +50002^1^"CDMA2000 1x" +50002^2^"CDMA2000 1x Ev-DO Rev. 0" +50002^3^"GPRS" +50002^4^"WCDMA" +50002^5^"CDMA2000 1x Ev-DO Rev. A" +50002^6^"EGPRS" +50002^7^"HSDPA/WCDMA" +50002^8^"WCDMA/HSUPA" +50002^9^"HSDPA/HSUPA" +50002^10^"LTE" +50002^11^"CDMA2000 EHRPD" +50003^1^"Disconnected" +50003^2^"Connected" +50003^3^"Suspended" +50003^4^"Authenticating" +50004^0^"3GPP" +50004^1^"3GPP2" +50005^0^"PDP-IP (V4)" +50006^0^"Subscribed" +50006^1^"Conversational" +50006^2^"Streaming" +50006^3^"Interactive" +50006^4^"Background" +50007^0^"Subscribe" +50007^1^"Delivery Order On" +50007^2^"Delivery Order Off" +50008^0^"Subscribe" +50008^1^"1 x 10-2" +50008^2^"7 x 10-3" +50008^3^"1 x 10-3" +50008^4^"1 x 10-4" +50008^5^"1 x 10-5" +50008^6^"1 x 10-6" +50008^7^"1 x 10-1" +50009^0^"Subscribe" +50009^1^"5 x 10-2" +50009^2^"1 x 10-2" +50009^3^"5 x 10-3" +50009^4^"4 x 10-3" +50009^5^"1 x 10-3" +50009^6^"1 x 10-4" +50009^7^"1 x 10-5" +50009^8^"1 x 10-6" +50009^9^"6 x 10-8" +50010^0^"Subscribe" +50010^1^"No Detection" +50010^2^"Erroneous SDU Is Delivered" +50010^3^"Erroneous SDU Is Not Delivered" +50011^1^"Traffic Channel Dormant" +50011^2^"Traffic Channel Active" +50012^1^"Unspecified" +50012^2^"Client End" +50012^3^"No Service" +50012^4^"Fade" +50012^5^"Release Normal" +50012^6^"Acc In Progress" +50012^7^"Acc Failed" +50012^8^"Redirect Or Handoff" +50012^9^"Close In Progress" +50012^10^"Authentication Failed" +50012^11^"Internal Error" +50012^500^"CDMA Lock" +50012^501^"Intercept" +50012^502^"Reorder" +50012^503^"Release Service Option Rejected" +50012^504^"Incoming Call" +50012^505^"Alert Stop" +50012^506^"Activation" +50012^507^"Max Access Probe" +50012^508^"CCS Not Supported By BS" +50012^509^"No Response From BS" +50012^510^"Rejected By BS" +50012^511^"Incompatible" +50012^512^"Already In TC" +50012^513^"User Call Orig During GPS" +50012^514^"User Call Orig During SMS" +50012^515^"No CDMA Service" +50012^1000^"Conf Failed" +50012^1001^"Incoming Rejected" +50012^1002^"No GW Service" +50012^1003^"Network End" +50012^1004^"LLC Or SNDCP Failure" +50012^1005^"Insufficient Resources" +50012^1006^"Service Option Out Of order" +50012^1007^"NSAPI Already Used" +50012^1008^"Regular PDP Context Deactivation" +50012^1009^"Network Failure" +50012^1010^"Reactivation Requested" +50012^1011^"Protocol Error" +50012^1012^"Operator Determined Barring" +50012^1013^"Unknown Or Missing APN" +50012^1014^"Unknown PDP Address Or PDP Type" +50012^1015^"Activation Rejected By GGSN" +50012^1016^"Activation Rejected, Unspecified" +50012^1017^"Service Option Not Supported" +50012^1018^"Requested Service Option Not Subscribed" +50012^1019^"QoS Not Accepted" +50012^1020^"Semantic Error In The TFT Operation" +50012^1021^"Syntactical Error In The TFT Operation" +50012^1022^"Unknown PDP Context" +50012^1023^"Semantic Errors In Packet Filter(s)" +50012^1024^"Syntactical Errors In Packet Filter(s)" +50012^1025^"PDP Context Without TFT Already Activated" +50012^1026^"Invalid Transaction Identifier Value" +50012^1027^"Semantically Incorrect Message" +50012^1028^"Invalid Mandatory Information" +50012^1029^"Message Type Non-Existent" +50012^1030^"Message Not Compatible With State" +50012^1031^"Information Element Nonexistent " +50012^1032^"Conditional Information Element Error" +50012^1033^"Message Not Compatible With Protocol State" +50012^1034^"APN Restriction Value Incompatible With Active PDP Context" +50012^1035^"No GPRS Context Present" +50012^1036^"Requested Feature Not Supported" +50012^1500^"CD Gen Or Busy" +50012^1501^"CD Bill Or Auth" +50012^1502^"Change HDR" +50012^1503^"Exit HDR" +50012^1504^"HDR No Session" +50012^1505^"HDR Orig During GPS Fix" +50012^1506^"HDR CS Timeout" +50012^1507^"HDR Released By CM" +50013^0^"MIP Off (Simple IP Only)" +50013^1^"MIP Preferred" +50013^2^"MIP Only" +50014^0^"Full" +50014^1^"IDs Only" +50015^0^"NDIS" +50015^1^"DUN" +50016^0^"Unset" +50016^1^"Set, Default" +50016^2^"Set, Modified" +50017^0^"Unknown" +50017^1^"CDMA" +50017^2^"UMTS" +50018^0x8001^"CDMA" +50018^0x8004^"UMTS" +50019^0^"Laptop" +50019^1^"Embedded" +50020^4^"IPv4" +50020^6^"IPv6" +50020^8^"Unspecified" +50021^64^"FA Unspecified" +50021^65^"FA Administratively Prohibited" +50021^66^"FA Insufficient Resources" +50021^67^"FA Mobile Node Authentication Failure" +50021^68^"FA HA Authentication Failure" +50021^69^"FA Requested Lifetime Too Long" +50021^70^"FA Malformed Request" +50021^71^"FA Malformed Reply" +50021^72^"FA Encapsulation Unavailable" +50021^73^"FA VJHC Unavailable" +50021^74^"FA Reverse Tunnel Unavailable" +50021^75^"FA Reverse Tunnel Is Mandatory And T Bit Is Not Set" +50021^79^"FA Delivery Style Not Supported" +50021^97^"FA Missing NAI" +50021^98^"FA Missing HA" +50021^99^"FA Missing Home Address" +50021^104^"FA Unknown Challenge" +50021^105^"FA Missing Challenge" +50021^106^"FA Stale Challenge" +50021^128^"HA Reason Unspecified" +50021^129^"HA Administratively Prohibited" +50021^130^"HA Insufficient Resources" +50021^131^"HA Mobile Node Authentication Failure" +50021^132^"HA FA Authentication Failure" +50021^133^"HA Registration ID Mismatch" +50021^134^"HA Malformed Request" +50021^136^"HA Unknown HA Address" +50021^137^"HA Reverse Tunnel Unavailable" +50021^138^"HA Reverse Tunnel Is Mandatory And T Bit Is Not Set" +50021^139^"HA Encapsulation Unavailable" +50021^65535^"Unknown" +50022^201^"Internal" +50022^202^"Call Ended" +50022^203^"Internal Unknown Cause Code" +50022^204^"Unknown Cause Code" +50022^205^"Close In Progress" +50022^206^"NW Initiated Termination" +50022^207^"App Preempted" +50023^500^"CDMA Lock" +50023^501^"Intercept" +50023^502^"Reorder" +50023^503^"Release Service Option Reject" +50023^504^"Incoming Call" +50023^505^"Alert Stop" +50023^506^"Activation" +50023^507^"Max Access Probe" +50023^508^"CCS Not Supported By BS" +50023^509^"No Response From BS" +50023^510^"Rejected By BS" +50023^511^"Incompatible" +50023^512^"Already In TC" +50023^513^"User Call Orig During GPS" +50023^514^"User Call Orig During SMS" +50023^515^"No CDMA Service" +50023^1000^"Conf Failed" +50023^1001^"Incoming Rejected" +50023^1002^"No GW Service" +50023^1003^"No GPRS Context" +50023^1004^"Illegal MS" +50023^1005^"Illegal ME" +50023^1006^"GPRS Services And Non-GPRS Service Not Allowed" +50023^1007^"GPRS Services Not Allowed" +50023^1008^"MS Identity Cannot Be Derived By The Network" +50023^1009^"Implicitly Detached" +50023^1010^"PLMN Not Allowed" +50023^1011^"LA Not Allowed" +50023^1012^"GPRS Services Not Allowed In This PLMN" +50023^1013^"PDP Duplicate" +50023^1014^"UE RAT Change" +50023^1015^"Congestion" +50023^1016^"No PDP Context Activated" +50023^1017^"Access Class DSAC Rejection" +50023^1500^"CD Gen Or Busy" +50023^1501^"CD Bill Or Auth" +50023^1502^"Change HDR" +50023^1503^"Exit HDR" +50023^1504^"HDR No Session" +50023^1505^"HDR Orig During GPS Fix" +50023^1506^"HDR CS Timeout" +50023^1507^"HDR Released By CM" +50023^2000^"Client End" +50023^2001^"No Service" +50023^2002^"Fade" +50023^2003^"Normal Release" +50023^2004^"Access In Progress" +50023^2005^"Access Fail" +50023^2006^"Redirect Or Handoff" +50024^8^"Operator Determined Barring" +50024^25^"LLC SNDCP Failure" +50024^26^"Insufficient Resources" +50024^27^"Unknown APN" +50024^28^"Unknown PDP" +50024^29^"Authentication FAiled" +50024^30^"GGSN Reject" +50024^31^"Activation Reject" +50024^32^"Option Not Supported" +50024^33^"Option Unsubscribed" +50024^34^"Option Temporarily OOO" +50024^35^"NSAPI Already Used" +50024^36^"Regular Deactivation" +50024^37^"QoS Not Accepted" +50024^38^"Network Failure" +50024^39^"UMTS Reactivation Request" +50024^40^"Feature Not Supported" +50024^41^"TFT Semantic Error" +50024^42^"TFT Syntax Error" +50024^43^"Unknown PDP Context" +50024^44^"Filter Semantic Error" +50024^45^"Filter Syntax Error" +50024^46^"PDP Without Active TFT" +50024^81^"Invalid Transaction ID" +50024^95^"Message Incorrect Semantic" +50024^96^"Invalid Mandatory ID" +50024^97^"Message Type Unsupported" +50024^98^"Message Type Noncompatible State" +50024^99^"Unknown Info Element" +50024^100^"Conditional Info Element Error" +50024^101^"Message And Protocol State Uncompatible" +50024^111^"Protocol Error" +50024^112^"APN Type Conflict" +50025^1^"Mobile IP" +50025^2^"Internal" +50025^3^"Call Manager Defined" +50025^6^"3GPP Specification Defined" +50026^0^"Disabled" +50026^1^"Enabled" +50026^2^"Paused" +50027^0^"Always" +50027^1^"Home Only" +50028^0^"PDP Access Control None" +50028^1^"PDP Access Control Reject" +50028^2^"PDP Access Control Permission" +50029^4^"IPv4" +50029^6^"IPv6" +50030^0^"NAS signaling" +50030^1^"DHCP" +50031^0^"Network Assign QCI" +50031^1^"Guaranteed Bitrate" +50031^2^"Guaranteed Bitrate" +50031^3^"Guaranteed Bitrate" +50031^4^"Guaranteed Bitrate" +50031^5^"Non Guaranteed Bitrate" +50031^6^"Non Guaranteed Bitrate" +50031^7^"Non Guaranteed Bitrate" +50031^8^"Non Guaranteed Bitrate" +50032^1^"PAP" +50032^2^"CHAP" +50032^3^"PAP or CHAP" +50033^0^"Low (SO15 Only)" +50033^1^"Medium (SO33 + low R-SCH)" +50033^2^"High (SO33 + high R-SCH)" +50034^0^"Default Application Type" +50034^32^"LBS Application Type" +50034^64^"Tethered Application Type" +50035^0^"CDMA or HDR" +50035^1^"CDMA Only" +50035^2^"HDR Only" +50036^0^"IPv4 PDN Type" +50036^1^"IPv6 PDN Type" +50036^2^"IPv4 or IPv6 PDN Type" +50036^3^"Unspecified PDN Type" +50037^1^"Failure" +50037^2^"Invalid handle" +50037^3^"Invalid Operation" +50037^4^"Invalid Profile Type" +50037^5^"Invalid Profile Number" +50037^6^"Invalid Identifier" +50037^7^"Invalid Argument" +50037^8^"Not Initialized" +50037^9^"Invalid Length" +50037^10^"List End" +50037^11^"Invalid Subscription ID" +50037^12^"Invalid Profile Family" +50037^1001^"3GPP Invalid Profile Family" +50037^1002^"3GPP Access Error" +50037^1003^"3GPP Context Not Defined" +50037^1004^"3GPP Valid Flag Not Set" +50037^1005^"3GPP Read Only Flag Set" +50037^1006^"3GPP Error Max Profile Number" +50037^1101^"3GPP2 Error Invalid Identifier For Profile" +50100^0^"Battery" +50100^1^"External" +50101^0^"No Data Services Supported" +50101^1^"Only Circuit Switched" +50101^2^"Only Packet Switched" +50101^3^"Simultaneous Circuit/Packet Switched" +50101^4^"Nonsimultaneous Circuit/Packet Switched" +50102^1^"CDMA2000 1x" +50102^2^"CDMA2000 HRPD" +50102^4^"GSM" +50102^5^"UMTS" +50102^8^"LTE" +50103^0^"Service Not Activated" +50103^1^"Serivce Activated" +50103^2^"Activation Connecting" +50103^3^"Activation In Progress" +50103^4^"OTASP Security Authenticated" +50103^5^"OTASP NAM Downloaded" +50103^6^"OTASP MDN Downloaded" +50103^7^"OTASP IMSI Downloaded" +50103^8^"OTASP PRL Downloaded" +50103^9^"OTASP SPC Downloaded" +50103^10^"OTASP Settings Committed" +50104^0^"Online" +50104^1^"Low Power" +50104^2^"Factory Test Mode" +50104^3^"Offline" +50104^4^"Reset" +50104^5^"Shutdown" +50104^6^"Persistent Low Power" +50104^7^"Mode-Only Low Power" +50105^0^"Device" +50105^1^"CDMA Network" +50105^2^"CDMA 1xEV-DO Network" +50105^3^"GSM Network" +50105^4^"WCDMA Network" +50105^5^"GPS Network" +50105^6^"MFLO Network" +50106^0^"OTASP" +50107^0^"Lock Disabled" +50107^1^"Lock Enabled" +50108^0^"PIN Uninitialized" +50108^1^"PIN Enabled, Unverified" +50108^2^"PIN Enabled, Verified" +50108^3^"PIN Disabled" +50108^4^"PIN Blocked" +50108^5^"PIN Blocked Permanently" +50108^6^"PIN Unblocked" +50108^7^"PIN Changed" +50109^0^"PN - Network Personalization" +50109^1^"PU - Network Subset Personalization" +50109^2^"PP - Service Provider Personalization" +50109^3^"PC - Corporate Personalization" +50109^4^"PF - UIM Personalization" +50110^0^"Deactivated" +50110^1^"Activated" +50110^2^"Block" +50111^0^"Initialization Completed" +50111^1^"Initialization Failed" +50111^2^"Not Present" +50111^255^"State Unavailable" +50112^0^"Modem" +50112^1^"PRI" +50113^0^"User" +50200^0^"None (No Service)" +50200^1^"CDMA2000 1x" +50200^2^"CDMA2000 HRPD" +50200^3^"AMPS" +50200^4^"GSM" +50200^5^"UMTS" +50200^8^"LTE" +50201^0^"Unknown" +50201^1^"Current Serving" +50201^2^"Available" +50202^0^"Unknown" +50202^1^"Home" +50202^2^"Roam" +50203^0^"Unknown" +50203^1^"Forbidden" +50203^2^"Not Forbidden" +50204^0^"Unknown" +50204^1^"Preferred" +50204^2^"Not Preferred" +50205^1^"Automatic" +50205^2^"Manual" +50206^4^"GSM" +50206^5^"UMTS" +50206^8^"LTE" +50207^1^"Attach" +50207^2^"Detach" +50208^0^"NAS Not Registered" +50208^1^"NAS Registered" +50208^2^"NAS Not Registered (Searching)" +50208^3^"NAS Registration Denied" +50208^4^"Registration State Unknown" +50209^0^"Unknown/Not Applicable" +50209^1^"Attached" +50209^2^"Detached" +50210^0^"Unknown" +50210^1^"3GPP2" +50210^2^"3GPP" +50211^0^"Roaming" +50211^1^"Home" +50211^2^"Roaming (Partner)" +50212^0^"Permanent" +50212^1^"Power Cycle" +50213^0^"Automatic" +50213^1^"3GPP2" +50213^2^"3GPP" +50213^3^"Invalid" +50214^1^"GPRS" +50214^2^"EGPRS" +50214^3^"HSDPA" +50214^4^"HSUPA" +50214^5^"WCDMA" +50214^6^"CDMA" +50214^7^"CDMA 1xEV-DO Rev. 0" +50214^8^"CDMA 1xEV-DO Rev. A" +50214^9^"GSM" +50214^10^"CDMA 1xEV-DO Rev. B" +50214^11^"LTE" +50214^12^"HSDPA+" +50214^13^"DC-HSDPA+" +50215^0^"Automatic" +50215^1^"Automatic A" +50215^2^"Automatic B" +50216^0^"Automatic" +50216^1^"Home Only" +50216^2^"Roaming Only" +50216^3^"Home/Roaming" +50217^0^"CDMA Band Class 0" +50217^1^"CDMA Band Class 1" +50217^3^"CDMA Band Class 3" +50217^4^"CDMA Band Class 4" +50217^5^"CDMA Band Class 5" +50217^6^"CDMA Band Class 6" +50217^7^"CDMA Band Class 7" +50217^8^"CDMA Band Class 8" +50217^9^"CDMA Band Class 9" +50217^10^"CDMA Band Class 10" +50217^11^"CDMA Band Class 11" +50217^12^"CDMA Band Class 12" +50217^13^"CDMA Band Class 13" +50217^14^"CDMA Band Class 14" +50217^15^"CDMA Band Class 15" +50217^16^"CDMA Band Class 16" +50217^40^"GSM 450" +50217^41^"GSM 480" +50217^42^"GSM 750" +50217^43^"GSM 850" +50217^44^"GSM 900 (Extended)" +50217^45^"GSM 900 (Primary)" +50217^46^"GSM 900 (Railways)" +50217^47^"GSM 1800" +50217^48^"GSM 1900" +50217^80^"WCDMA 2100" +50217^81^"WCDMA PCS 1900" +50217^82^"WCDMA DCS 1800" +50217^83^"WCDMA 1700 (US)" +50217^84^"WCDMA 850" +50217^85^"WCDMA 800" +50217^86^"WCDMA 2600" +50217^87^"WCDMA 900" +50217^88^"WCDMA 1700 (Japan)" +50217^120^"E-UTRA Band 1" +50217^121^"E-UTRA Band 2" +50217^122^"E-UTRA Band 3" +50217^123^"E-UTRA Band 4" +50217^124^"E-UTRA Band 5" +50217^125^"E-UTRA Band 6" +50217^126^"E-UTRA Band 7" +50217^127^"E-UTRA Band 8" +50217^128^"E-UTRA Band 9" +50217^129^"E-UTRA Band 10" +50217^130^"E-UTRA Band 11" +50217^131^"E-UTRA Band 12" +50217^132^"E-UTRA Band 13" +50217^133^"E-UTRA Band 14" +50217^134^"E-UTRA Band 17" +50217^135^"E-UTRA Band 33" +50217^136^"E-UTRA Band 34" +50217^137^"E-UTRA Band 35" +50217^138^"E-UTRA Band 36" +50217^139^"E-UTRA Band 37" +50217^140^"E-UTRA Band 38" +50217^141^"E-UTRA Band 39" +50217^142^"E-UTRA Band 40" +50218^1^"Circuit Switched" +50219^0^"Authentication Failed" +50219^1^"Authentication Success" +50219^2^"No Authentication Requested" +50220^0^"-9 dB" +50220^1^"-6 dB" +50220^2^"-4.5 dB" +50220^3^"-3 dB" +50220^4^"-2 dB" +50220^5^"1 dB" +50220^6^"3 dB" +50220^7^"6 dB" +50220^8^"9 dB" +50221^1^"Acquire A Side Only" +50221^2^"Acquire B Side Only" +50221^16383^"Acquire Any" +50222^1^"Acquire When Roaming Indicator Off" +50222^2^"Acquire When Roaming Indicator Not Off" +50222^3^"Acquire When Roaming Indicator Not Flashing" +50222^255^"Acquire Any" +50223^0^"Off" +50223^1^"On" +50223^2^"No Change" +50224^0^"Add" +50224^1^"Replace" +50224^2^"Delete" +50224^3^"No Change" +50225^0^"Do Not Display" +50225^1^"Display" +50225^255^"Unknown" +50226^0^"Unspecified Octet" +50226^1^"Extended Protocol Message" +50226^2^"7-Bit ASCII" +50226^3^"IA5" +50226^4^"UNICODE" +50226^5^"Shift-JIS" +50226^6^"Korean" +50226^7^"Latin/Hebrew" +50226^8^"Latin" +50226^9^"GSM 7-Bit" +50226^10^"GSM DCS" +50227^0^"ASCII" +50227^1^"UCS2-LE" +50228^0^"Do Not Add Country Initials" +50228^1^"Add Country Initials" +50228^255^"Unspecified" +50229^0^"Unknown" +50229^1^"Bit 8" +50229^2^"Bits 7/8" +50229^3^"Bits 6 - 8" +50229^4^"Bits 5 - 8" +50229^5^"Bits 4 - 8" +50229^6^"Bits 3 - 8" +50229^7^"Bits 2 - 8" +50230^0^"Power Cycle" +50230^1^"Permanent" +50300^0^"UIM" +50300^1^"NV" +50300^2^"Unknown" +50301^0^"CDMA" +50301^1^"Analog CLI (Unsupported)" +50301^2^"Analog Voice Mail (Unsupported)" +50301^3^"Analog WMS (Unsupported)" +50301^4^"Analog AWI/WMS (Unsupported)" +50301^5^"MWI (Unsupported)" +50301^6^"GSM/WCDMA PP" +50301^7^"GSM/WCDMA BC" +50301^8^"MWI" +50302^0^"MT Read" +50302^1^"MT Not Read" +50302^2^"MO Send" +50302^3^"MO Not Sent" +50303^0^"CDMA" +50303^1^"GSM/WCDMA (Unsupported)" +50304^0^"Point-To-Point" +50304^1^"Broadcast" +50305^0^"Class 0" +50305^1^"Class 1" +50305^2^"Class 2" +50305^3^"Class 3" +50305^4^"Class None" +50305^5^"Class CDMA" +50306^0^"Discard" +50306^1^"Store And Notify" +50307^0^"Discard" +50307^1^"Store And Notify" +50307^2^"Unknown" +50308^0^"Automatic" +50308^6^"SO 6" +50308^14^"SO 14" +50309^0^"Temporary" +50309^1^"Permanent" +50310^2^"Temporary" +50310^3^"Permanent" +50311^0^"CS Preferred" +50311^1^"PS Preferred" +50311^2^"CS Only" +50311^3^"PS Only" +50400^0^"Unknown" +50400^1^"Inactive" +50400^2^"Active" +50401^0^"Manual" +50402^0^"New" +50403^0^"Standalone" +50403^1^"MS Based" +50403^2^"MS Assisted" +50404^0^"Default" +50405^0^"None (Disabled)" +50405^1^"USB" +50405^2^"UART1" +50405^3^"UART2" +50405^4^"Shared Memory" +50406^0^"1 Hz From Time Requested Until Final Position Determination" +50406^1^"Final Position Determination Only" +50407^0^"WWAN" +50408^0^"Any Available" +50408^1^"Home Only" +50408^2^"Roam Only" +50409^0^"Standalone" +50409^1^"MS Based" +50409^2^"MS Assisted" +50409^255^"Unknown" +50410^0^"Success" +50410^1^"In Progress" +50410^2^"General Failure" +50410^3^"Timeout" +50410^4^"User Ended" +50410^5^"Bad Parameter" +50410^6^"Phone Offline" +50410^7^"Engine Locked" +50410^8^"E911 Session In Progress" +50411^0^"January" +50411^1^"February" +50411^2^"March" +50411^3^"April" +50411^4^"May" +50411^5^"June" +50411^6^"July" +50411^7^"August" +50411^8^"September" +50411^9^"October" +50411^10^"November" +50411^11^"December" +50412^0^"Sunday" +50412^1^"Monday" +50412^2^"Tuesday" +50412^3^"Wednesday" +50412^4^"Thursday" +50412^5^"Friday" +50412^6^"Saturday" +50413^0^"Start Periodic Fixes - High Frequency" +50413^1^"Start Periodic Fixes - Keep Warm" +50413^2^"Stop Periodic Fixes" +50413^4^"Suspend" +50414^1^"GPS" +50414^2^"Galileo" +50414^3^"SBAS" +50414^4^"Compass" +50414^5^"Glonass" +50415^0^"Unhealthy" +50415^1^"Healthy" +50416^1^"Idle" +50416^2^"Search" +50416^3^"Search Verify" +50416^4^"Bit Edge" +50416^5^"Track" +50417^0^"Unavailable" +50417^1^"Available" +50418^0^"Unavailable" +50418^1^"Available" +50419^0^"No Notify/Verify" +50419^1^"Notify" +50419^2^"Notify/Verify - Allow No Response" +50419^3^"Notify/Verify - Require Response" +50419^4^"Privacy Override" +50420^0^"MS Assisted" +50420^1^"MS Based" +50420^2^"MS Assisted Preferred" +50420^3^"MS Based Preferred" +50421^0^"Octet" +50421^1^"EXN Protocol Message" +50421^2^"ASCII" +50421^3^"IA5" +50421^4^"Unicode" +50421^5^"Shift JIS" +50421^6^"Korean" +50421^7^"Latin Hebrew" +50421^8^"Latin" +50421^9^"GSM" +50422^0^"MS Assisted" +50422^1^"MS Based" +50422^2^"MS Assisted Preferred" +50422^3^"MS Based Preferred" +50422^4^"Standalone" +50422^5^"AFLT" +50422^6^"ECID" +50422^7^"EOTD" +50422^8^"OTDOA" +50422^9^"No Position" +50423^0^"UTF8" +50423^1^"UCS2" +50423^2^"GSM" +50423^255^"Unknown" +50424^0^"Logical Name" +50424^1^"Email Address" +50424^2^"MSISDN" +50424^3^"URL" +50424^4^"SIP URL" +50424^5^"MIN" +50424^6^"MDN" +50424^255^"Unknown" +50425^0^"German" +50425^1^"English" +50425^2^"Italian" +50425^3^"French" +50425^4^"Spanish" +50425^5^"Dutch" +50425^6^"Swedish" +50425^7^"Danish" +50425^8^"Portuguese" +50425^9^"Finnish" +50425^10^"Norwegian" +50425^11^"Greek" +50425^12^"Turkish" +50425^13^"Hungarian" +50425^14^"Polish" +50425^255^"Unknown" +50426^0^"Current" +50426^1^"Current Or Last Known" +50426^2^"Initial" +50427^0^"Begin" +50427^1^"Connected" +50427^2^"Failure" +50427^3^"Done" +50427^4^"Other Failure" +50428^0^"UMTS User Plane SUPL" +50428^1^"1X" +50428^2^"UMTS Control Plane WCDMA" +50428^3^"UMTS Control Plane GSM" +50428^4^"V1/V2" +50428^5^"KDDI" +50428^6^"XTRA Data Download" +50428^7^"SNTP Time Download" +50429^0^"Unknown" +50429^1^"GPS" +50429^2^"Cell ID" +50429^3^"Enhanced Cell ID" +50429^4^"Wi-Fi" +50429^5^"Terrestial" +50429^6^"Terrestial Hybrid" +50429^7^"Other" +50430^0^"Disabled" +50430^1^"Enabled" +50430^255^"Unknown" +50431^0^"GPS" +50431^1^"UTC" +50432^0^"Write" +50433^0^"Disables" +50433^1^"Enabled - Low Power Mode" +50433^2^"Enabled - Ready Mode" +50434^0^"Disabled" +50434^1^"Enabled" +50434^255^"Not Supported" +50435^0^"UMTS" +50435^1^"CDMA" +50600^1^"Send SMS Proactive Command"^-1 +50601^1^"Refresh Start"^-1 +50601^2^"Refresh Success"^-1 +50601^3^"Refresh Failed"^-1 +50602^1^"End Proactive Session Command Received from the card"^-1 +50602^2^"End Proactive Session Internal to ME"^-1 +50603^1^"Menu Selection"^-1 +50603^2^"Event Download User Activity"^-1 +50603^3^"Event Download Idle Screen Available"^-1 +50603^4^"Event Download Language Selection"^-1 +50700^0^"Success"^-1 +50700^1^"Failure"^-1 +50800^0^"Client Initiated Device Configure"^-1 +50800^1^"Client Initiated PRL Update"^-1 +50800^2^"Client Initiated Hands Free Activation"^-1 +50800^3^"Device Initiated Hands Free Activation"^-1 +50800^4^"Network Initiated PRL Update"^-1 +50800^5^"Network Initiated Device Configure"^-1 +50801^0^"Complete, Info Updated"^-1 +50801^1^"Complete, Info Unavailable"^-1 +50801^2^"Failed"^-1 +50801^3^"Retrying"^-1 +50801^4^"Connecting"^-1 +50801^5^"Connected"^-1 +50801^6^"Authenticated"^-1 +50801^7^"MDN Downloaded"^-1 +50801^8^"MSID Downloaded"^-1 +50801^9^"PRL Downloaded"^-1 +50801^10^"MIP Profile Downloaded"^-1 +50802^0^"Unknown"^-1 +50802^1^"Network Unavailable"^-1 +50802^2^"Server Unavailable"^-1 +50802^3^"Authentication Failed"^-1 +50802^4^"Max Retry Exceeded"^-1 +50802^5^"Session Cancelled"^-1 +50803^0^"Reject"^-1 +50803^1^"Accept"^-1 +50804^0^"None"^-1 +50804^1^"Succeeded"^-1 +50804^2^"Failed"^-1 +50900^0^"Control"^-1 +50900^1^"WDS"^-1 +50900^2^"DMS"^-1 +50900^3^"NAS"^-1 +50900^4^"QOS"^-1 +50900^5^"WMS"^-1 +50900^6^"PDS"^-1 +50900^7^"AUTH"^-1 +50900^224^"CAT"^-1 +50900^225^"RMS"^-1 +50900^226^"OMA"^-1 +50901^0^"QoS Flow Header Absent"^-1 +50901^1^"QoS Flow Header Present"^-1 +50902^0^"Normal"^-1 +50902^1^"Suspend"^-1 +50902^2^"Powerdown"^-1 +70000^1^"ASCII"^-1 +70000^2^"8-Bit"^-1 +70000^3^"UCS2"^-1 +70001^1^"GSM"^-1 +70001^2^"UCS2"^-1 +70002^1^"No Action Required"^-1 +70002^2^"Action Is Required"^-1 \ No newline at end of file diff --git a/gobi-api/GobiAPI_1.0.40/Database/QMI/Field.txt b/gobi-api/GobiAPI_1.0.40/Database/QMI/Field.txt new file mode 100755 index 0000000..c50db38 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Database/QMI/Field.txt @@ -0,0 +1,967 @@ +50000^"QMI Result"^16^1^50000^0 +50001^"QMI Error"^16^1^50001^0 +50002^"Transaction ID"^16^0^4^0 +50100^"Report Channel Rate"^8^0^0^0 +50101^"Transfer Statistics Interval (Seconds)"^8^0^2^0 +50102^"Report TX Packet Successes"^1^0^0^0 +50103^"Report RX Packet Successes"^1^0^0^0 +50104^"Report TX Packet Errors"^1^0^0^0 +50105^"Report RX Packet Errors"^1^0^0^0 +50106^"Report TX Overflows"^1^0^0^0 +50107^"Report RX Overflows"^1^0^0^0 +50108^"Report Data Bearer Technology"^8^0^0^0 +50109^"TX Packet Successes"^32^0^6^0 +50110^"RX Packet Successes"^32^0^6^0 +50111^"TX Packet Errors"^32^0^6^0 +50112^"RX Packet Errors"^32^0^6^0 +50113^"TX Overflows"^32^0^6^0 +50114^"RX Overflows"^32^0^6^0 +50115^"Channel TX Rate (bps)"^32^0^6^0 +50116^"Channel RX Rate (bps)"^32^0^6^0 +50117^"Data Bearer Technology"^8^1^50002^0 +50118^"IP V4 Address"^8^0^2^0 +50119^"APN Name"^0^0^11^0 +50120^"Enable PAP"^1^0^0^0 +50121^"Enable CHAP"^1^0^0^0 +50122^"Username"^0^0^11^0 +50123^"Password"^0^0^11^0 +50124^"Enable 3GPP"^1^0^0^0 +50125^"Enable 3GPP2"^1^0^0^0 +50126^"Profile Index"^8^0^2^0 +50127^"Packet Data Handle"^32^0^6^1 +50128^"Connection Status"^8^1^50003^0 +50129^"Reconfigure Required"^8^0^0^0 +50130^"Max Channel TX Rate (bps)"^32^0^6^0 +50131^"Max Channel RX Rate (bps)"^32^0^6^0 +50132^"Profile Type"^8^1^50004^0 +50133^"Profile Name"^0^0^11^0 +50134^"PDP Type"^8^1^50005^0 +50135^"Traffic Class"^8^1^50006^0 +50136^"Max Uplink Bitrate"^32^0^6^0 +50137^"Max Downlink Bitrate"^32^0^6^0 +50138^"Guaranteed Uplink Bitrate"^32^0^6^0 +50139^"Guaranteed Downlink Bitrate"^32^0^6^0 +50140^"QoS Delivery Order"^8^1^50007^0 +50141^"Max SDU Size"^32^0^6^0 +50142^"SDU Error Ratio"^8^1^50008^0 +50143^"SDU Residual Bit Error Ratio"^8^1^50009^0 +50144^"Erroneous SDU Delivery"^8^1^50010^0 +50145^"Transfer Delay"^32^0^6^0 +50146^"Traffic Handling Priority"^32^0^6^0 +50147^"Precedence Class"^32^0^6^0 +50148^"Delay Class"^32^0^6^0 +50149^"Reliability Class"^32^0^6^0 +50150^"Peak Throughput Class"^32^0^6^0 +50151^"Mean Throughput Class"^32^0^6^0 +50152^"Number Of Profiles"^8^0^2^0 +50153^"Profile Name Length"^8^0^2^0 +50154^"Profile Name"^8^0^9^0 +50155^"Report Dormancy Status"^8^0^0^0 +50156^"Dormancy Status"^8^1^50011^0 +50157^"Call End"^16^1^50012^0 +50158^"MIP Mode"^8^1^50013^0 +50159^"Autoconnect Setting"^8^1^50026^0 +50160^"Autoconnect Off"^8^0^0^0 +50161^"Data Session Duration"^64^0^8^0 +50162^"Connection Status"^1^0^0^0 +50163^"Last Call End Reason"^1^0^0^0 +50164^"RX/TX Byte Totals"^1^0^0^0 +50165^"Dormancy Status"^1^0^0^0 +50166^"Data Bearer Technology"^1^0^0^0 +50167^"Channel Rates"^1^0^0^0 +50168^"Report Connection Status"^8^0^0^0 +50169^"TX Byte Total"^1^0^0^0 +50170^"RX Byte Total"^1^0^0^0 +50171^"TX Byte Total"^64^0^8^0 +50172^"RX Byte Total"^64^0^8^0 +50173^"SPC"^48^0^9^0 +50174^"Enabled"^8^0^0^0 +50175^"Reverse Tunneling"^8^0^0^0 +50176^"NAI"^0^0^11^0 +50177^"HA SPI"^32^0^6^0 +50178^"AAA SPI"^32^0^6^0 +50179^"MN-HA Key"^0^0^11^0 +50180^"MN-AAA Key"^0^0^11^0 +50181^"Retry Attempt Limit"^8^0^2^0 +50182^"Retry Attempt Interval"^8^0^2^0 +50183^"Re-Registration Period"^8^0^2^0 +50184^"Re-Registration Only With Traffic"^8^0^0^0 +50185^"MN-HA Authenticator Calculator"^8^0^0^0 +50186^"MN-HA RFC 2002 BIS Authentication"^8^0^0^0 +50187^"Last MIP Status"^8^0^2^0 +50188^"AN-AAA Authenticated"^8^0^0^0 +50189^"Call List Type"^8^1^50014^0 +50190^"Call Records"^16^0^4^0 +50191^"ID"^16^0^4^0 +50192^"Type"^8^1^50015^0 +50193^"Data Bearer"^8^1^50002^0 +50194^"Timestamp"^64^0^8^1 +50196^"Total Duration"^64^0^8^0 +50197^"Active Duration"^64^0^8^0 +50198^"RX Byte Total"^64^0^8^0 +50199^"TX Byte Total"^64^0^8^0 +50201^"Phone Number Length"^8^0^2^0 +50202^"Phone Number"^8^0^9^0 +50203^"Call List Max Size"^16^0^4^0 +50204^"Previous Call TX Byte Total"^64^0^8^0 +50205^"Previous Call RX Byte Total"^64^0^8^0 +50206^"Previous Data Session Duration"^64^0^8^0 +50207^"Data Session Active Duration"^64^0^8^0 +50208^"Previous Data Session Active Duration"^64^0^8^0 +50209^"Duration"^1^0^0^0 +50210^"Profile ID"^1^0^0^0 +50211^"Profile Name"^1^0^0^0 +50212^"PDP Type"^1^0^0^0 +50213^"APN Name"^1^0^0^0 +50214^"DNS Address"^1^0^0^0 +50215^"Granted QoS"^1^0^0^0 +50216^"Username"^1^0^0^0 +50217^"Authentication Protocol"^1^0^0^0 +50218^"IP Address"^1^0^0^0 +50219^"Gateway Info"^1^0^0^0 +50220^"IPv4 Subnet Mask"^32^0^6^1 +50221^"Key State"^8^1^50016^0 +50222^"Report MIP Status"^8^0^0^0 +50223^"MIP Status"^8^0^2^0 +50230^"Network Type"^8^1^50017^0 +50231^"CDMA 1x"^1^0^0^0 +50232^"CDMA 1x Ev-DO Rev. 0"^1^0^0^0 +50233^"CDMA 1x Ev-DO Rev. A"^1^0^0^0 +50234^"WCDMA"^1^0^0^0 +50235^"GPRS"^1^0^0^0 +50236^"HSDPA"^1^0^0^0 +50237^"HSUPA"^1^0^0^0 +50238^"EDGE"^1^0^0^0 +50239^"CDMA 1x IS95"^1^0^0^0 +50240^"CDMA 1x IS2000"^1^0^0^0 +50241^"CDMA 1x IS2000 Rel. A"^1^0^0^0 +50242^"CDMA 1x Ev-DO Rev. A DPA"^1^0^0^0 +50243^"CDMA 1x Ev-DO Rev. A MFPA"^1^0^0^0 +50244^"CDMA 1x Ev-DO Rev. A EMPA"^1^0^0^0 +50245^"Extended Technology Preference"^16^1^50018^0 +50246^"Call Type"^8^1^50019^0 +50247^"IP Family"^8^1^50020^0 +50248^"Call End Reason Type"^16^1^50025^0 +50249^"Call End Reason Value"^16^0^4^0 +50250^"Call End Reason"^16^1^50021^0 +50251^"Call End Reason"^16^1^50022^0 +50252^"Call End Reason"^16^1^50023^0 +50253^"Call End Reason"^16^1^50024^0 +50254^"P-CSCF Address Using PCO"^8^0^0^0 +50255^"P-CSCF Address"^1^0^0^0 +50256^"P-CSCF Server Address List"^1^0^0^0 +50257^"P-CSCF Domain Name List"^1^0^0^0 +50258^"MTU"^1^0^0^0 +50259^"Domain Name List"^1^0^0^0 +50260^"IP Family"^1^0^0^0 +50261^"IM CN Flag"^1^0^0^0 +50262^"Extended Technology"^1^0^0^0 +50263^"Number Of Instances"^8^0^2^0 +50264^"FQDN Length"^16^0^4^0 +50265^"FQDN"^8^0^9^0 +50266^"MTU"^32^0^6^0 +50267^"Domain Name Length"^16^0^4^0 +50268^"Domain Name"^8^0^9^0 +50269^"IM CN"^8^0^0^0 +50270^"Autoconnect Roam Setting"^8^1^50027^0 +50271^"DNS Address"^8^0^2^0 +50272^"IP Prefix Length"^8^0^2^0 +50273^"LTE"^1^0^0^0 +50274^"CDMA 1x Ev-DO Rev. A EMPA EHRPD"^1^0^0^0 +50275^"IPv6 Address"^16^0^4^1 +50276^"PDP Access Control Flag"^8^1^50028^0 +50277^"P-CSCF Address Using DHCP"^8^0^0^0 +50278^"Filter ID"^8^0^2^0 +50279^"Evaluation ID"^8^0^2^0 +50280^"IP Version"^8^1^50029^0 +50281^"IP Source"^8^0^2^0 +50282^"Source IP Mask"^8^0^2^0 +50283^"Next Header"^8^0^2^0 +50284^"Destination Port Range Start"^16^0^4^0 +50285^"Destination Port Range End"^16^0^4^0 +50286^"Source Port Range Start"^16^0^4^0 +50287^"Source Port Range End"^16^0^4^0 +50288^"IPSEC Security Parameter Index"^32^0^6^0 +50289^"TOS Mask"^16^0^4^0 +50290^"Flow Label"^32^0^6^0 +50291^"PDP Context Number"^8^0^2^0 +50292^"PDP Context Secondary Flag"^8^0^0^0 +50293^"PDP Primary ID"^8^0^2^0 +50294^"Signaling Indication"^8^0^0^0 +50295^"Address Allocation Preference"^8^1^50030^0 +50296^"QoS Class Identifier"^8^1^50031^0 +50297^"Negotiate DNS Server Preference"^8^0^0^0 +50298^"PPP Session Close Timer DO"^32^0^6^0 +50299^"PPP Session Close Timer 1X"^32^0^6^0 +50300^"Allow Linger"^8^0^0^0 +50301^"Timeout"^16^0^4^0 +50302^"Retry Count"^8^0^2^0 +50303^"Authentication Protocol"^8^1^50032^0 +50304^"Data Rate"^8^1^50033^0 +50305^"Application Type"^32^1^50034^0 +50306^"Data Mode"^8^1^50035^0 +50307^"Application Priority"^8^0^2^0 +50308^"PDN Type"^8^1^50036^0 +50309^"P-CSCF Address Needed"^8^0^0^0 +50310^"Extended Error Code"^16^1^50037^0 +50311^"Number Of Addresses"^8^0^2^0 +51000^"Report Power State"^8^0^0^0 +51001^"Battery Level Lower Limit (%)"^8^0^2^0 +51002^"Battery Level Upper Limit (%)"^8^0^2^0 +51003^"Power Source"^1^1^50100^0 +51004^"Battery Connected"^1^0^0^0 +51005^"Battery Charging"^1^0^0^0 +51006^"Power Fault"^1^0^0^0 +51007^"Battery Level (%)"^8^0^2^0 +51008^"Max TX Rate (bps)"^32^0^6^0 +51009^"Max RX Rate (bps)"^32^0^6^0 +51010^"Data Service Capability"^8^1^50101^0 +51011^"SIM Supported"^8^0^0^0 +51012^"Radio Interface Count"^8^0^2^0 +51013^"Radio Interface"^8^1^50102^0 +51014^"Device Manfacturer"^0^0^11^0 +51015^"Device Model ID"^0^0^11^0 +51016^"Device Revision ID"^0^0^11^0 +51017^"Device Voice Number"^0^0^11^0 +51018^"ESN"^0^0^11^0 +51019^"IMEI"^0^0^11^0 +51020^"MEID"^0^0^11^0 +51021^"Report Activation State"^8^0^0^0 +51022^"Activation State"^16^1^50103^0 +51023^"Device Mobile ID Number"^0^0^11^0 +51024^"Device Hardware Revision"^0^0^11^0 +51025^"Operating Mode"^8^1^50104^0 +51026^"Timestamp"^48^0^8^1 +51027^"Source"^16^1^50105^0 +51028^"PRL Version"^16^0^4^0 +51030^"SPC"^48^0^9^0 +51031^"SID"^16^0^4^0 +51032^"MDN Length"^8^0^2^0 +51033^"MDN"^8^0^9^0 +51034^"MIN Length"^8^0^2^0 +51035^"MIN"^8^0^9^0 +51036^"PRL Length"^16^0^4^0 +51037^"PRL"^8^0^2^1 +51038^"MN-HA Length"^8^0^2^0 +51039^"MN-HA"^8^0^9^0 +51040^"MN-AAA Length"^8^0^2^0 +51041^"MN-AAA"^8^0^9^0 +51042^"Lock State"^8^1^50107^0 +51043^"Lock Code"^32^0^9^0 +51044^"Current Lock Code"^32^0^9^0 +51045^"New Lock Code"^32^0^9^0 +51046^"Data Length"^16^0^4^0 +51047^"Data"^8^0^2^1 +51048^"Code Length"^8^0^2^0 +51049^"Code"^8^0^9^0 +51050^"PIN ID"^8^0^2^0 +51051^"PIN Enabled"^8^0^2^0 +51052^"PIN Length"^8^0^2^0 +51053^"PIN Value"^8^0^9^0 +51054^"Remaining Verify Retries"^8^0^2^0 +51055^"Remaining Unblock Retries"^8^0^2^0 +51056^"PUK Length"^8^0^2^0 +51057^"PUK Value"^8^0^9^0 +51058^"Old PIN Length"^8^0^2^0 +51059^"Old PIN Value"^8^0^9^0 +51060^"New PIN Length"^8^0^2^0 +51061^"New PIN Value"^8^0^9^0 +51062^"PIN Status"^8^1^50108^0 +51063^"Report PIN Status"^8^0^0^0 +51064^"PRL Total Length"^16^0^4^0 +51065^"PRL Segment Length"^16^0^4^0 +51066^"PRL Segment ID"^8^0^2^0 +51067^"Boot Code Revision ID"^0^0^11^0 +51068^"UQCN Revision ID"^0^0^11^0 +51069^"IMSI"^0^0^11^0 +51070^"Host Image Mismatch"^1^0^2^0 +51071^"UQCN Image Mismatch"^1^0^2^0 +51072^"Incompatible UQCN"^1^0^2^0 +51073^"ICCID"^0^0^11^0 +51074^"Firmware ID"^32^0^6^0 +51075^"Host Lock Code"^32^0^6^0 +51076^"Platform Restricted"^8^0^0^0 +51077^"Report Operating Mode"^8^0^0^0 +51078^"Facility"^8^1^50109^0 +51079^"Facility State"^8^1^50110^0 +51080^"Control Key Length"^8^0^2^0 +51081^"Control Key"^8^0^9^0 +51082^"UQCN Copy Issue"^1^0^2^0 +51083^"Report UIM State"^8^0^0^0 +51084^"UIM State"^8^1^50111^0 +51085^"Operation Blocking"^8^0^0^0 +51090^"Number Of Images"^8^0^2^0 +51091^"Image Type"^8^1^50112^0 +51092^"Image ID"^8^0^2^1 +51093^"Build ID Length"^8^0^2^0 +51094^"Build ID"^8^0^9^0 +51095^"Force Download"^8^0^0^0 +51096^"Storage Index"^8^0^2^0 +51097^"Maximum Build ID Length"^8^0^2^0 +51098^"Number Of Image Types"^8^0^2^0 +51099^"Maximum Number Of Images"^8^0^2^0 +51100^"Index Of Executing Image"^8^0^2^0 +51101^"Failure Count"^8^0^2^0 +51110^"Band Class 0 - A System"^1^0^0^0 +51111^"Band Class 0 - B System"^1^0^0^0 +51112^"Band Class 1"^1^0^0^0 +51113^"Band Class 2"^1^0^0^0 +51114^"Band Class 3 - A System"^1^0^0^0 +51115^"Band Class 4"^1^0^0^0 +51116^"Band Class 5"^1^0^0^0 +51117^"GSM DCS"^1^0^0^0 +51118^"GSM Primary"^1^0^0^0 +51119^"GSM Extended"^1^0^0^0 +51120^"Band Class 6"^1^0^0^0 +51121^"Band Class 7"^1^0^0^0 +51122^"Band Class 8"^1^0^0^0 +51123^"Band Class 9"^1^0^0^0 +51124^"Band Class 10"^1^0^0^0 +51125^"Band Class 11"^1^0^0^0 +51126^"GSM 450"^1^0^0^0 +51127^"GSM 480"^1^0^0^0 +51128^"GSM 750"^1^0^0^0 +51129^"GSM 850"^1^0^0^0 +51130^"GSM Railways"^1^0^0^0 +51131^"GSM PCS"^1^0^0^0 +51132^"WCDMA 2100I"^1^0^0^0 +51133^"WCDMA PCS 1900"^1^0^0^0 +51134^"WCDMA DCS 1800"^1^0^0^0 +51135^"WCDMA 1700 (US)"^1^0^0^0 +51136^"WCDMA 850"^1^0^0^0 +51137^"WCDMA 800"^1^0^0^0 +51138^"Band Class 12"^1^0^0^0 +51139^"Band Class 14"^1^0^0^0 +51140^"Band Class 15"^1^0^0^0 +51141^"WCDMA 2600"^1^0^0^0 +51142^"WCDMA 900"^1^0^0^0 +51143^"WCDMA 1700 (Japan)"^1^0^0^0 +51144^"Band Class 16"^1^0^0^0 +51145^"Band Class 17"^1^0^0^0 +51146^"Band Class 18"^1^0^0^0 +51147^"Band Class 19"^1^0^0^0 +51148^"Report Wireless Disable State"^8^0^0^0 +51149^"Wireless Disable On"^8^0^0^0 +51150^"Factory Serial Number"^0^0^11^0 +51151^"Alternate Enabled"^8^0^0^0 +51152^"Time In Milliseconds"^64^0^8^0 +51153^"Time Reference"^32^1^50113^0 +51154^"Boot Major Version"^16^0^4^0 +51155^"Boot Minor Version"^16^0^4^0 +51156^"PRI Version"^32^0^6^1 +51157^"PRI Info"^256^0^9^0 +51158^"OEM Lock ID"^32^0^6^1 +51159^"BAR Mode"^8^0^0^0 +52000^"Report Signal Strength"^8^0^0^0 +52001^"Number Of Thresholds"^8^0^2^0 +52002^"Signal Strength Threshold (dBm)"^8^0^1^0 +52003^"Signal Strength (dBm)"^8^0^1^0 +52004^"Radio Interface"^8^1^50200^0 +52005^"Number Of Info Instances"^16^0^4^0 +52006^"Mobile Country Code"^16^0^4^0 +52007^"Mobile Network Code"^16^0^4^0 +52008^"In Use Status"^2^1^50201^0 +52009^"Roaming Status"^2^1^50202^0 +52010^"Forbidden Status"^2^1^50203^0 +52011^"Preferred Status"^2^1^50204^0 +52012^"Description Length"^8^0^2^0 +52013^"Description"^8^0^9^0 +52014^"Register Action"^8^1^50205^0 +52015^"Radio Access Technology"^8^1^50206^0 +52016^"PS Attach Action"^8^1^50207^0 +52017^"Registration State"^8^1^50208^0 +52018^"CS Attach State"^8^1^50209^0 +52019^"PS Attach State"^8^1^50209^0 +52020^"Registered Network"^8^1^50210^0 +52021^"Number Of Radio Interfaces In Use"^8^0^2^0 +52022^"Roaming Indicator"^8^1^50211^0 +52023^"Number Of Preferred Networks"^16^0^4^0 +52024^"GSM Compact"^1^0^0^0 +52025^"GSM"^1^0^0^0 +52026^"UMTS"^1^0^0^0 +52027^"Number Of Forbidden Networks"^16^0^4^0 +52028^"System ID"^16^0^4^0 +52029^"Network ID"^16^0^4^0 +52032^"Duration"^8^1^50212^0 +52033^"ACCOLC"^8^0^2^0 +52034^"SPC"^48^0^9^0 +52035^"Technology"^2^1^50213^0 +52036^"Analog"^1^0^2^0 +52037^"Digital"^1^0^2^0 +52038^"EV-DO"^1^0^2^0 +52039^"GSM"^1^0^2^0 +52040^"WCDMA"^1^0^2^0 +52041^"Number Of Data Capabilities"^8^0^2^0 +52042^"Data Capability"^8^1^50214^0 +52043^"System Preference"^8^1^50215^0 +52044^"Slot Cycle Index"^8^0^2^0 +52045^"Station Class Mark"^8^0^2^0 +52046^"Register On Home System"^8^0^0^0 +52047^"Register On Foreign System"^8^0^0^0 +52048^"Register On Foreign Network"^8^0^0^0 +52049^"Force CDMA 1xEV-DO Rev. 0"^8^0^0^0 +52050^"CDMA 1xEV-DO SCP Custom Config"^8^0^0^0 +52051^"Subtype 2 Physical Layer"^1^0^0^0 +52052^"Enhanced CC MAC"^1^0^0^0 +52053^"Enhanced AC MAC"^1^0^0^0 +52054^"Enhanced FTC MAC"^1^0^0^0 +52055^"Subtype 3 RTC MAC"^1^0^0^0 +52056^"Subtype 1 RTC MAC"^1^0^0^0 +52057^"Enhanced Idle"^1^0^0^0 +52058^"Generic Multimode Capable Disc Port"^1^0^0^0 +52059^"Generic Broadcast"^1^0^0^0 +52060^"SN Multiflow Packet Application"^1^0^0^0 +52061^"SN Enhanced Multiflow Packet Application"^1^0^0^0 +52062^"Roam Preference"^8^1^50216^0 +52063^"Active Band Class"^16^1^50217^0 +52064^"Active Channel"^16^0^4^0 +52065^"Report RF Info"^8^0^0^0 +52066^"Report LU Reject"^8^0^0^0 +52067^"Number Of Instances"^8^0^2^0 +52068^"Service Domain"^8^1^50218^0 +52069^"Reject Cause"^16^0^4^0 +52070^"AN-AAA Authentication Status"^8^1^50219^0 +52080^"Report RSSI"^8^0^0^0 +52081^"RSSI Delta"^8^0^2^0 +52082^"Report ECIO"^8^0^0^0 +52083^"ECIO Delta"^8^0^2^0 +52084^"Report IO"^8^0^0^0 +52085^"IO Delta"^8^0^2^0 +52086^"Report SINR"^8^0^0^0 +52087^"SINR Delta"^8^0^2^0 +52088^"Report Error Rate"^8^0^0^0 +52089^"RSSI"^8^0^2^0 +52090^"ECIO"^8^0^2^0 +52091^"IO"^32^0^6^0 +52092^"SINR"^8^1^50220^0 +52093^"Error Rate"^16^0^4^0 +52094^"Report System Select"^8^0^0^0 +52095^"Report DDTM"^8^0^0^0 +52096^"Report Serving System"^8^0^0^0 +52097^"Number Of Measurements"^16^0^4^0 +52098^"Base Station ID"^16^0^4^0 +52099^"Latitude"^32^0^5^0 +52100^"Longitude"^32^0^5^0 +52101^"Leap Seconds"^8^0^2^0 +52102^"Local Time Offset"^8^0^1^0 +52103^"Daylight Savings In Effect"^8^0^0^0 +52104^"Protocol Revision"^8^0^2^0 +52105^"Emergency Mode On"^8^0^0^0 +52106^"CDMA 1x"^1^0^0^0 +52107^"CDMA 1xEV-DO"^1^0^0^0 +52108^"GSM"^1^0^0^0 +52109^"UMTS"^1^0^0^0 +52110^"Band Class 0 - A System"^1^0^0^0 +52111^"Band Class 0 - B System"^1^0^0^0 +52112^"Band Class 1"^1^0^0^0 +52113^"Band Class 2"^1^0^0^0 +52114^"Band Class 3 - A System"^1^0^0^0 +52115^"Band Class 4"^1^0^0^0 +52116^"Band Class 5"^1^0^0^0 +52117^"GSM DCS"^1^0^0^0 +52118^"GSM Primary"^1^0^0^0 +52119^"GSM Extended"^1^0^0^0 +52120^"Band Class 6"^1^0^0^0 +52121^"Band Class 7"^1^0^0^0 +52122^"Band Class 8"^1^0^0^0 +52123^"Band Class 9"^1^0^0^0 +52124^"Band Class 10"^1^0^0^0 +52125^"Band Class 11"^1^0^0^0 +52126^"GSM 450"^1^0^0^0 +52127^"GSM 480"^1^0^0^0 +52128^"GSM 750"^1^0^0^0 +52129^"GSM 850"^1^0^0^0 +52130^"GSM Railways"^1^0^0^0 +52131^"GSM PCS"^1^0^0^0 +52132^"WCDMA 2100I"^1^0^0^0 +52133^"WCDMA PCS 1900"^1^0^0^0 +52134^"WCDMA DCS 1800"^1^0^0^0 +52135^"WCDMA 1700 (US)"^1^0^0^0 +52136^"WCDMA 850"^1^0^0^0 +52137^"WCDMA 800"^1^0^0^0 +52138^"Band Class 12"^1^0^0^0 +52139^"Band Class 14"^1^0^0^0 +52140^"Band Class 15"^1^0^0^0 +52141^"WCDMA 2600"^1^0^0^0 +52142^"WCDMA 900"^1^0^0^0 +52143^"WCDMA 1700 (Japan)"^1^0^0^0 +52144^"Band Class 16"^1^0^0^0 +52145^"Band Class 17"^1^0^0^0 +52146^"Band Class 18"^1^0^0^0 +52147^"Band Class 19"^1^0^0^0 +52148^"PRL Preference"^16^1^50221^0 +52149^"Roaming Preference"^16^1^50222^0 +52150^"DDTM Preference"^8^1^50223^0 +52151^"Suppress L2 ACK"^1^0^0^0 +52152^"Suppress 1x Registrations"^1^0^0^0 +52153^"Ignore Service Option Pages"^1^0^0^0 +52154^"Block Mobile Originated SMS And DBM"^1^0^0^0 +52155^"Service Option Action"^8^1^50224^0 +52156^"Service Option"^16^0^4^0 +52157^"Query RSSI"^1^0^0^0 +52158^"Query ECIO"^1^0^0^0 +52159^"Query IO"^1^0^0^0 +52160^"Query SINR"^1^0^0^0 +52161^"Query Error Rate"^1^0^0^0 +52162^"Display Network Description"^8^1^50225^0 +52163^"Network Description Encoding"^8^1^50226^0 +52164^"Network Description Length"^8^0^2^0 +52165^"Network Description"^8^0^2^1 +52166^"PLMN Changed"^8^0^0^0 +52167^"Restrict Manual PLMN Selection"^8^0^0^0 +52168^"SPN Encoding"^8^1^50227^0 +52169^"SPN Length"^8^0^2^0 +52170^"SPN"^8^0^2^1 +52171^"PLMN Short Encoding"^8^1^50227^0 +52172^"PLMN Short Country Initials"^8^1^50228^0 +52173^"PLMN Spare Bits"^8^1^50229^0 +52174^"PLMN Short Length"^8^0^2^0 +52175^"PLMN Short"^8^0^2^1 +52176^"PLMN Long Encoding"^8^1^50227^0 +52177^"PLMN Long Country Initials"^8^1^50228^0 +52178^"PLMN Long Bits"^8^1^50229^0 +52179^"PLMN Long Length"^8^0^2^0 +52180^"PLMN Long"^8^0^2^1 +52181^"RSRQ"^8^0^1^0 +52182^"Change Duration"^8^1^50230^0 +52183^"Report RSRQ"^8^0^0^0 +52184^"RSRQ Delta"^8^0^2^0 +53000^"Report New MT Messages"^8^0^0^0 +53001^"Storage Type"^8^1^50300^0 +53002^"Storage Index"^32^0^6^0 +53003^"Message Format"^8^1^50301^0 +53004^"Raw Message Length"^16^0^4^0 +53005^"Raw Message"^8^0^2^1 +53006^"Cause Code"^16^0^4^0 +53007^"Message Tag"^8^1^50302^0 +53008^"Mode"^8^1^50303^0 +53009^"Number Of Messages"^32^0^6^0 +53010^"Number Of Routes"^16^0^4^0 +53011^"Message Type"^8^1^50304^0 +53012^"Message Class"^8^1^50305^0 +53013^"Receipt Action"^8^1^50306^0 +53014^"Route Value"^8^1^50307^0 +53015^"SMSC Address Type"^24^0^9^0 +53016^"SMSC Address Length"^8^0^2^0 +53017^"SMSC Address"^8^0^9^0 +53018^"SMSC Address Type"^8^0^11^0 +53019^"SMSC Address"^8^0^11^0 +53020^"ACK Required"^8^0^0^0 +53021^"Transaction ID"^32^0^6^0 +53022^"Force Send On DC"^8^0^0^0 +53023^"Service Option"^8^1^50308^0 +53024^"Do Not Disconnect DC"^8^0^0^0 +53025^"Link Timer In Seconds"^8^0^2^0 +53026^"Error Class"^8^1^50309^0 +53027^"GSM/WCDMA RP Cause"^16^0^4^0 +53028^"GSM/WCDMA TP Cause"^8^0^2^0 +53029^"Transfer Status Reports"^8^0^0^0 +53030^"Max Storage Size In Messages"^32^0^6^0 +53031^"Free Storage Size In Messages"^32^0^6^0 +53032^"Processed Successfully"^8^0^0^0 +53033^"Error Class"^8^1^50310^0 +53034^"Transport Layer Status"^8^0^2^0 +53035^"GSM/WCDMA RP Cause"^8^0^2^0 +53036^"Retry Period In Seconds"^32^0^6^0 +53037^"Retry Interval In Seconds"^32^0^6^0 +53038^"DC Disconnect Timer In Seconds"^32^0^6^0 +53039^"Memory Is Available"^8^0^0^0 +53040^"Activate Broadcast"^8^0^0^0 +53041^"Number Of Instances"^16^0^4^0 +53042^"Message ID Start"^16^0^4^0 +53043^"Message ID End"^16^0^4^0 +53044^"Selected"^8^0^0^0 +53045^"Service Category"^16^0^4^0 +53046^"Language"^16^0^4^0 +53047^"Activated"^8^0^0^0 +53048^"Domain Preference"^8^1^50311^0 +53049^"Message ID"^16^0^4^0 +54000^"Report NMEA Sentences"^8^0^0^0 +54001^"NMEA Sentence"^0^0^11^0 +54002^"Service Enabled"^8^0^0^0 +54003^"Tracking Session State"^8^1^50400^0 +54004^"Session Control"^8^1^50401^0 +54005^"Session Type"^8^1^50402^0 +54006^"Session Operation"^8^1^50403^0 +54007^"Server Option"^8^1^50404^0 +54008^"Timeout In Seconds"^8^0^2^0 +54009^"Session Fix Requests"^32^0^6^0 +54010^"Fix Request Interval In Seconds"^32^0^6^0 +54011^"Desired Accuracy In Meters"^32^0^6^0 +54012^"GGA NMEA Sentences"^1^0^0^0 +54013^"RMC NMEA Sentences"^1^0^0^0 +54014^"GSV NMEA Sentences"^1^0^0^0 +54015^"GSA NMEA Sentences"^1^0^0^0 +54016^"VTG NMEA Sentences"^1^0^0^0 +54017^"Output Device"^8^1^50405^0 +54018^"NMEA Reporting"^8^1^50406^0 +54019^"System Time"^64^0^8^0 +54020^"System Discontinuties"^16^0^4^0 +54021^"Automatic Download Enabled"^8^0^0^0 +54022^"Download Interval In Hours"^16^0^4^0 +54023^"Medium Preferences"^8^0^2^0 +54024^"Medium Preference"^8^1^50407^0 +54025^"WWAN Network Preference"^8^1^50408^0 +54026^"Valid Period - GPS Start Week"^16^0^4^0 +54027^"Valid Period - GPS Start Week Offset In Minutes"^16^0^4^0 +54028^"Valid Period - Duration In Hours"^16^0^4^0 +54029^"Server Address"^8^0^2^0 +54030^"Server Port"^32^0^6^0 +54031^"Auto-Tracking Enabled"^8^0^0^0 +54032^"Reset EPH"^1^0^0^0 +54033^"Reset ALM"^1^0^0^0 +54034^"Reset POS"^1^0^0^0 +54035^"Reset TIME"^1^0^0^0 +54036^"Reset IONO"^1^0^0^0 +54037^"Reset UTC"^1^0^0^0 +54038^"Reset HEALTH"^1^0^0^0 +54039^"Reset SVDIR"^1^0^0^0 +54040^"Reset SVSTEER"^1^0^0^0 +54041^"Reset SADATA"^1^0^0^0 +54042^"Reset RTI"^1^0^0^0 +54043^"Reset ALM CORR"^1^0^0^0 +54044^"Reset FREQ BIAS EST"^1^0^0^0 +54045^"Reset POS"^1^0^0^0 +54046^"Reset LATEST GPS POS"^1^0^0^0 +54047^"Reset OTA POS"^1^0^0^0 +54048^"Reset EXT REF POS"^1^0^0^0 +54049^"Reset TIMETAG"^1^0^0^0 +54050^"Reset CELLID"^1^0^0^0 +54051^"Reset CACHED CELLID"^1^0^0^0 +54052^"Reset LAST SRV CELL"^1^0^0^0 +54053^"Reset CUR SRV CELL"^1^0^0^0 +54054^"Reset NEIGHBOR INFO"^1^0^0^0 +54055^"Report NMEA Sentences Plus Mode"^8^0^0^0 +54056^"NMEA Sentence Operating Mode"^8^1^50409^0 +54057^"NMEA Sentence Length"^16^0^4^0 +54058^"NMEA Sentence"^8^0^9^0 +54100^"Report Raw Position Data"^8^0^0^0 +54101^"Report External XTRA Data Requests"^8^0^0^0 +54102^"Report External Time Injections"^8^0^0^0 +54103^"Report External Wi-Fi Requests"^8^0^0^0 +54104^"Report Satellite Info"^8^0^0^0 +54105^"Report VX Network Initiated Prompts"^8^0^0^0 +54106^"Report SUPL Network Initiated Prompts"^8^0^0^0 +54107^"Report UMTS CP Network Initiated Prompts"^8^0^0^0 +54108^"Report PDS Comm Events"^8^0^0^0 +54109^"Session Status"^8^1^50410^0 +54110^"Timestamp Calendar Valid"^1^0^0^0 +54111^"Timestamp UTC Valid"^1^0^0^0 +54112^"Leap Seconds Valid"^1^0^0^0 +54113^"Time Uncertainty Valid"^1^0^0^0 +54114^"Latitude Valid"^1^0^0^0 +54115^"Longitude Valid"^1^0^0^0 +54116^"Ellipsoid Altitude Valid"^1^0^0^0 +54117^"Mean Sea Level Altitude Valid"^1^0^0^0 +54118^"Horizontal Speed Valid"^1^0^0^0 +54119^"Vertical Speed Valid"^1^0^0^0 +54120^"Heading Valid"^1^0^0^0 +54121^"Horizontal Uncertainty Circular Valid"^1^0^0^0 +54122^"Horizontal Uncertainty Ellipse Semi-Major Valid"^1^0^0^0 +54123^"Horizontal Uncertainty Ellipse Semi-Minor Valid"^1^0^0^0 +54124^"Horizontal Uncertainty Ellipse Orient Azimuth Valid"^1^0^0^0 +54125^"Vertical Uncertainty Valid"^1^0^0^0 +54126^"Horizontal Velocity Uncertainty Valid"^1^0^0^0 +54127^"Vertical Velocity Uncertainty Valid"^1^0^0^0 +54128^"Horizontal Confidence Valid"^1^0^0^0 +54129^"Position DOP Valid"^1^0^0^0 +54130^"Horizontal DOP Valid"^1^0^0^0 +54131^"Vertical DOP Valid"^1^0^0^0 +54132^"Operating Mode Used Valid"^1^0^0^0 +54133^"Calendar Year"^16^0^4^0 +54134^"Calendar Month"^8^1^50411^0 +54135^"Calendar Day"^8^1^50412^0 +54136^"Calendar Day Of Month"^8^0^2^0 +54137^"Calendar Hour"^8^0^2^0 +54138^"Calendar Minute"^8^0^2^0 +54139^"Calendar Second"^8^0^2^0 +54140^"Calendar Millisecond"^16^0^4^0 +54141^"Calendar Leap Seconds"^8^0^2^0 +54142^"UTC Timestamp"^64^0^8^1 +54143^"UTC Timestamp Uncertainty"^32^0^6^0 +54144^"Latitude"^64^0^14^0 +54145^"Longitude"^64^0^14^0 +54146^"Ellipsoid Altitude"^32^0^13^0 +54147^"Mean Sea Level Altitude"^32^0^13^0 +54148^"Horizontal Speed"^32^0^13^0 +54149^"Vertical Speed"^32^0^13^0 +54150^"Heading"^32^0^13^0 +54151^"Horizontal Uncertainty Circular"^32^0^13^0 +54152^"Horizontal Uncertainty Ellipse Semi-Major"^32^0^13^0 +54153^"Horizontal Uncertainty Ellipse Semi-Minor"^32^0^13^0 +54154^"Horizontal Uncertainty Ellipse Orient Azimuth"^32^0^13^0 +54155^"Vertical Uncertainty"^32^0^13^0 +54156^"Horizontal Velocity Uncertainty"^32^0^13^0 +54157^"Vertical Velocity Uncertainty"^32^0^13^0 +54158^"Horizontal Confidence"^8^0^2^0 +54159^"Position DOP "^32^0^13^0 +54160^"Horizontal DOP"^32^0^13^0 +54161^"Vertical DOP"^32^0^13^0 +54162^"Operating Mode"^8^1^50409^0 +54163^"Maximum File Size"^16^0^4^0 +54164^"URL Record Count"^8^0^2^0 +54165^"URL Length"^8^0^2^0 +54166^"URL"^8^0^9^0 +54167^"Delay Threshold"^32^0^6^0 +54168^"Wi-Fi Request Type"^8^1^50413^0 +54169^"Wi-Fi Request Time Between Fixes"^16^0^4^0 +54170^"Iono Valid"^1^0^0^0 +54171^"Satellite Count Valid"^1^0^0^0 +54172^"Satellite List Valid"^1^0^0^0 +54173^"Ionospheric Corrections"^8^0^0^0 +54174^"SV Record Count"^8^0^2^0 +54175^"System Valid"^1^0^0^0 +54176^"PRN Valid"^1^0^0^0 +54177^"Health Status Valid"^1^0^0^0 +54178^"Process Status Valid"^1^0^0^0 +54179^"Ephemeris State Valid"^1^0^0^0 +54180^"Almanac State Valid"^1^0^0^0 +54181^"Elevation Valid"^1^0^0^0 +54182^"Azimuth Valid"^1^0^0^0 +54183^"CN0 Valid"^1^0^0^0 +54184^"System"^8^1^50414^0 +54185^"PRN"^8^0^2^0 +54186^"Health Level"^8^1^50415^0 +54187^"Processing Status"^8^1^50416^0 +54188^"Ephemeris State"^8^1^50417^0 +54189^"Almanac State"^8^1^50418^0 +54190^"Azimuth"^16^0^4^0 +54191^"CN0"^16^0^4^0 +54192^"Privacy Valid"^1^0^0^0 +54193^"QoS Valid"^1^0^0^0 +54194^"Count Valid"^1^0^0^0 +54195^"Interval Valid"^1^0^0^0 +54196^"Mode Valid"^1^0^0^0 +54197^"Requestor ID Valid"^1^0^0^0 +54198^"Privacy"^8^1^50419^0 +54199^"QoS"^8^0^2^0 +54200^"Position Count"^32^0^6^0 +54201^"Interval Between Fixes"^32^0^6^0 +54202^"Mode"^8^1^50420^0 +54203^"Requestor ID DCS"^8^1^50421^0 +54204^"Requestor ID Length"^8^0^2^0 +54205^"Requestor ID"^8^0^2^1 +54206^"Privacy Valid"^1^0^0^0 +54207^"INIT Hash Valid"^1^0^0^0 +54208^"Mode Valid"^1^0^0^0 +54209^"SLP Session ID Valid"^1^0^0^0 +54210^"SLP Server IPv4 Address Valid"^1^0^0^0 +54211^"SLP Server IPv6 Address Valid"^1^0^0^0 +54212^"SLP Server URL Address Valid"^1^0^0^0 +54213^"DCS Valid"^1^0^0^0 +54214^"Requestor ID Valid"^1^0^0^0 +54215^"Client Name Valid"^1^0^0^0 +54216^"QoP Horizontal Accuracy Valid"^1^0^0^0 +54217^"QoP Vertical Accuracy Valid"^1^0^0^0 +54218^"QoP Max Location Age Valid"^1^0^0^0 +54219^"QoP Delay Valid"^1^0^0^0 +54220^"Privacy"^8^1^50419^0 +54221^"INIT Hash"^64^0^8^1 +54222^"Mode"^8^1^50422^0 +54223^"SLP Session ID"^32^0^6^0 +54224^"SLP Server IPv4 Port"^32^0^6^0 +54225^"SLP Server IPv4 Address"^8^0^2^0 +54226^"SLP Server IPv6 Address"^8^0^2^0 +54227^"SLP Server URL Length"^8^0^2^0 +54228^"SLP Server URL Address"^8^0^9^0 +54229^"Request DCS"^8^1^50423^0 +54230^"Requestor ID DCS"^8^1^50424^0 +54231^"Requestor ID Length"^8^0^2^0 +54232^"Requestor ID"^8^0^2^1 +54233^"Client Name DCS"^8^1^50424^0 +54234^"Client Name Length"^8^0^2^0 +54235^"Client Name"^8^0^2^1 +54236^"QoP Horizontal Accuracy"^8^0^2^0 +54237^"QoP Vertical Accuracy"^8^0^2^0 +54238^"QoP Max Location Age"^8^0^2^0 +54239^"QoP Delay"^8^0^2^0 +54250^"Privacy Valid"^1^0^0^0 +54251^"Invoke ID Valid"^1^0^0^0 +54252^"Notification Text Valid"^1^0^0^0 +54253^"Client Address Valid"^1^0^0^0 +54254^"Location Type Valid"^1^0^0^0 +54255^"Requestor ID Valid"^1^0^0^0 +54256^"Codeword String Valid"^1^0^0^0 +54257^"Service Type ID Valid"^1^0^0^0 +54258^"Privacy"^8^1^50419^0 +54259^"Invoke ID"^8^0^2^0 +54260^"Notification Text DCS"^8^1^50425^0 +54261^"Notification Text Length"^8^0^2^0 +54262^"Notification Text"^8^0^2^1 +54263^"Client Address Length"^8^0^2^0 +54264^"Client Address"^8^0^9^0 +54265^"Location Type"^8^1^50426^0 +54266^"Requestor ID DCS"^8^1^50425^0 +54267^"Requestor ID Length"^8^0^2^0 +54268^"Requestor ID"^8^0^2^1 +54269^"Codeword DCS"^8^1^50425^0 +54270^"Codeword Length"^8^0^2^0 +54271^"Codeword"^8^0^2^1 +54272^"Service Type ID"^8^0^2^0 +54273^"Type"^8^1^50427^0 +54274^"Protocol/Data Type"^8^1^50428^0 +54275^"Embedded XTRA Data Client Enabled"^8^0^0^0 +54276^"Embedded XTRA Time Client Enabled"^8^0^0^0 +54277^"Service Major Version"^8^0^2^0 +54278^"Service Minor Version"^8^0^2^0 +54279^"Sequence Number"^8^0^2^0 +54280^"Total Length"^16^0^4^0 +54281^"Sequence Length"^16^0^4^0 +54282^"Data"^8^0^2^1 +54283^"Vertical Confidence"^8^0^2^0 +54284^"Source"^8^1^50429^0 +54285^"Wi-Fi Time Counter"^32^0^6^0 +54286^"Wi-Fi Latitude"^32^0^5^0 +54287^"Wi-Fi Longitude"^32^0^5^0 +54288^"HEPE In Meters"^16^0^4^0 +54289^"AP Count"^8^0^2^0 +54290^"Error Code"^8^0^2^0 +54291^"MAC Address"^8^0^2^1 +54292^"RSSI"^32^0^6^0 +54293^"Beacon Channel"^16^0^4^0 +54294^"State"^8^1^50430^0 +54295^"Enable SBAS"^8^0^0^0 +54296^"Allow Request"^8^0^0^0 +54297^"Timestamp"^64^0^8^0 +54298^"Time Uncertainty"^32^0^6^0 +54299^"Time Base"^8^1^50431^0 +54300^"Force Acceptance"^8^0^0^0 +54301^"Filename Length"^8^0^2^0 +54302^"Filename"^8^0^9^0 +54303^"File Operation"^8^1^50432^0 +54304^"Data Length"^32^0^6^0 +54305^"Part Number"^8^0^2^0 +54306^"Total Parts"^8^0^2^0 +54307^"Data"^8^0^2^1 +54308^"Data Power Optimization Enabled"^8^0^0^0 +54309^"Enable Data Power Optimization"^8^0^0^0 +54310^"On Demand Positioning"^8^1^50433^0 +54311^"Position Valid"^1^0^0^0 +54312^"Altitude/Vertical Uncertainty Valid"^1^0^0^0 +54313^"Time Milliseconds Valid"^1^0^0^0 +54314^"Time Week Number Valid"^1^0^0^0 +54315^"Time Uncertainty Valid"^1^0^0^0 +54316^"Iono Valid"^1^0^0^0 +54317^"GPS Ephemeris Valid"^1^0^0^0 +54318^"GPS Almanac Valid"^1^0^0^0 +54319^"GPS Health Valid"^1^0^0^0 +54320^"GPS Visible SVs Valid"^1^0^0^0 +54321^"Glonass Ephemeris Valid"^1^0^0^0 +54322^"Glonass Almanac Valid"^1^0^0^0 +54323^"Glonass Health Valid"^1^0^0^0 +54324^"Glonass Visible SVs Valid"^1^0^0^0 +54325^"SBAS Ephemeris Valid"^1^0^0^0 +54326^"SBAS Almanac Valid"^1^0^0^0 +54327^"SBAS Health Valid"^1^0^0^0 +54328^"SBAS Visible SVs Valid"^1^0^0^0 +54329^"XTRA Information Valid"^1^0^0^0 +54330^"Timestamp In TOW Milliseconds"^32^0^6^0 +54331^"GPS Week Number"^16^0^4^0 +54332^"Iono Is Valid"^8^0^0^0 +54333^"GPS Ephemeris SV Mask"^32^0^6^1 +54334^"GPS Almanac SV Mask"^32^0^6^1 +54335^"GPS Health SV Mask"^32^0^6^1 +54336^"GPS Visible SV Mask"^32^0^6^1 +54337^"Glonass Ephemeris SV Mask"^32^0^6^1 +54338^"Glonass Almanac SV Mask"^32^0^6^1 +54339^"Glonass Health SV Mask"^32^0^6^1 +54340^"Glonass Visible SV Mask"^32^0^6^1 +54341^"SBAS Ephemeris SV Mask"^32^0^6^1 +54342^"SBAS Almanac SV Mask"^32^0^6^1 +54343^"SBAS Health SV Mask"^32^0^6^1 +54344^"SBAS Visible SV Mask"^32^0^6^1 +54345^"XTRA GPS Start Week"^16^0^4^0 +54346^"XTRA GPS Start Minutes"^16^0^4^0 +54347^"XTRA GPS Valid Hours"^16^0^4^0 +54348^"Elevation"^32^0^13^0 +54349^"SLP Server IPv6 Port"^32^0^6^0 +54350^"Used For Position"^1^0^0^0 +54351^"Hidden SSID"^1^0^0^0 +54352^"Encryption On"^1^0^0^0 +54353^"Infrastructure Mode"^1^0^0^0 +54354^"Engine Enabled"^8^0^0^0 +54355^"Method State"^8^1^50434^0 +54356^"Network Mode"^8^1^50435^0 +55000^"SMS Wake Enabled"^8^0^0^0^-1^0 +55001^"Mask"^32^0^6^1^-1^0 +56000^"Display Text"^1^0^0^0^-1^0 +56001^"Get Inkey"^1^0^0^0^-1^0 +56002^"Get Input"^1^0^0^0^-1^0 +56003^"Setup Menu"^1^0^0^0^-1^0 +56004^"Select Item"^1^0^0^0^-1^0 +56005^"Send SMS Alpha Identifier"^1^0^0^0^-1^0 +56006^"Setup Event User Activity"^1^0^0^0^-1^0 +56007^"Setup Event Idle Screen Notify"^1^0^0^0^-1^0 +56008^"Setup Event Language Sel Notify"^1^0^0^0^-1^0 +56009^"Setup Idle Mode Text"^1^0^0^0^-1^0 +56010^"Language Notification"^1^0^0^0^-1^0 +56011^"Refresh"^1^0^0^0^-1^0 +56012^"End Proactive Session"^1^0^0^0^-1^0 +56013^"Reference ID"^32^0^6^1^-1^0 +56014^"Command Length"^16^0^4^0^-1^0 +56015^"Display Text Command"^8^0^2^1^-1^0 +56016^"Get Inkey Command"^8^0^2^1^-1^0 +56017^"Get Input Command"^8^0^2^1^-1^0 +56018^"Setup Menu Command"^8^0^2^1^-1^0 +56019^"Select Item Command"^8^0^2^1^-1^0 +56020^"Alpha ID Command Type"^8^1^50600^1^-1^0 +56021^"Alpha ID Length"^16^0^4^0^-1^0 +56022^"Alpha ID"^8^0^2^1^-1^0 +56023^"User Activity Notify"^1^0^0^0^-1^0 +56024^"Idle Screen Available"^1^0^0^0^-1^0 +56025^"Language Selection Notify"^1^0^0^0^-1^0 +56026^"Setup Idle Mode Text Command"^8^0^2^1^-1^0 +56027^"Language Notification Command"^8^0^2^1^-1^0 +56028^"Refresh Mode"^16^0^4^1^-1^0 +56029^"Refresh Stage"^16^1^50601^1^-1^0 +56030^"Proactive Session End Type"^8^1^50602^1^-1^0 +56031^"Terminal Response Length"^16^0^4^0^-1^0 +56032^"Terminal Response"^8^0^2^1^-1^0 +56033^"Envelope Command Type"^16^1^50005^0^-1^0 +56034^"Envelope Length"^16^0^4^0^-1^0 +56035^"Envelope Data"^8^0^2^1^-1^0 +56036^"Envelope Command Type"^16^1^50603^0^-1^0 +57000^"EAP-SIM"^1^0^0^0^-1^0 +57001^"EAP-AKA"^1^0^0^0^-1^0 +57002^"EAP Request Packet"^8^0^2^1^-1^0 +57003^"Response Packet"^8^0^2^1^-1^0 +57005^"Session Keys"^8^0^2^1^-1^0 +57006^"Result"^8^1^50700^0^-1^0 +58000^"Report Network Initiated Alerts"^8^0^0^0^-1^0 +58001^"Report Session Status"^8^0^0^0^-1^0 +58002^"Session Type"^8^1^50800^0^-1^0 +58003^"Session ID"^16^0^4^0^-1^0 +58004^"Session State"^8^1^50801^0^-1^0 +58005^"Session Failure"^8^1^50802^0^-1^0 +58006^"Retry Count"^8^0^2^0^-1^0 +58007^"Retry Pause Timer"^16^0^4^0^-1^0 +58008^"Remaining Time"^16^0^4^0^-1^0 +58009^"Selection"^8^1^50803^0^-1^0 +58010^"Device Provisioning Service Update Enabled"^8^0^0^0^-1^0 +58011^"PRL Service Update Enabled"^8^0^0^0^-1^0 +58012^"HFA Feature Enabled"^8^0^0^0^-1^0 +58013^"HFA Feature Done State"^8^1^50804^0^-1^0 +59000^"Instance ID"^8^0^2^0^-1^0 +59001^"Link ID"^16^0^4^0^-1^0 +59002^"Service Count"^8^0^2^0^-1^0 +59003^"Service Type"^8^1^50900^0^-1^0 +59004^"Major Version"^16^0^4^0^-1^0 +59005^"Minor Version"^16^0^4^0^-1^0 +59006^"Addendum Label Length"^8^0^2^0^-1^0 +59007^"Addendum Label"^8^0^9^0^-1^0 +59008^"Client ID"^8^0^2^0^-1^0 +59009^"Data Format"^8^1^50901^0^-1^0 +59010^"Link Protocol - 802.3"^1^0^0^0^-1^0 +59011^"Link Protocol - IP"^1^0^0^0^-1^0 +59012^"Report Power State Changes"^8^0^0^0^-1^0 +59013^"Current Power Save State"^32^1^50902^0^-1^0 +59014^"Previous Power Save State"^32^1^50902^0^-1^0 +59015^"Message ID"^16^0^4^0^-1^0 +70000^"USS DCS"^8^1^70000^0^-1^0 +70001^"USS Length"^8^0^2^0^-1^0 +70002^"USS Data"^8^0^2^1^-1^0 +70003^"Failure Cause"^16^0^4^1^-1^0 +70004^"Alpha DCS"^8^1^70001^0^-1^0 +70005^"Alpha Length"^8^0^2^0^-1^0 +70006^"Alpha Data"^8^0^2^1^-1^0 +70007^"Notification Type"^8^1^70002^0^-1^0 \ No newline at end of file diff --git a/gobi-api/GobiAPI_1.0.40/Database/QMI/Makefile.am b/gobi-api/GobiAPI_1.0.40/Database/QMI/Makefile.am new file mode 100644 index 0000000..5c7cb31 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Database/QMI/Makefile.am @@ -0,0 +1,17 @@ +noinst_LTLIBRARIES = libQMIDB.la + +DBFILES = \ + Entity.txt \ + EnumEntry.txt \ + Enum.txt \ + Field.txt \ + Struct.txt + +QMIDB.o: $(DBFILES) + $(LD) -r -b binary -o QMIDB.o $(DBFILES) + +libQMIDB_la_SOURCES = foo.c + +libQMIDB_la_LIBADD = QMIDB.o + +CLEANFILES = QMIDB.o diff --git a/gobi-api/GobiAPI_1.0.40/Database/QMI/Struct.txt b/gobi-api/GobiAPI_1.0.40/Database/QMI/Struct.txt new file mode 100755 index 0000000..0ab7590 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Database/QMI/Struct.txt @@ -0,0 +1,1317 @@ +50000^0^0^50000^""^-1^0^"" +50000^1^0^50001^""^-1^0^"" +50001^0^0^50002^""^-1^0^"" +50010^0^0^50100^""^-1^0^"" +50011^0^0^50101^""^-1^0^"" +50011^1^0^50102^""^-1^0^"" +50011^2^0^50103^""^-1^0^"" +50011^3^0^50104^""^-1^0^"" +50011^4^0^50105^""^-1^0^"" +50011^5^0^50106^""^-1^0^"" +50011^6^0^50107^""^-1^0^"" +50011^7^0^50169^""^-1^0^"" +50011^8^0^50170^""^-1^0^"" +50011^9^2^40^""^-1^0^"" +50012^0^0^50108^""^-1^0^"" +50013^0^0^50109^""^-1^0^"" +50014^0^0^50110^""^-1^0^"" +50015^0^0^50111^""^-1^0^"" +50016^0^0^50112^""^-1^0^"" +50017^0^0^50113^""^-1^0^"" +50018^0^0^50114^""^-1^0^"" +50019^0^0^50115^""^-1^0^"" +50019^1^0^50116^""^-1^0^"" +50020^0^0^50117^""^-1^0^"" +50021^0^0^50118^""^-1^1^"4" +50022^0^0^50119^""^-1^0^"" +50023^0^0^50120^""^-1^0^"" +50023^1^0^50121^""^-1^0^"" +50023^2^2^8^""^-1^0^"" +50024^0^0^50122^""^-1^0^"" +50025^0^0^50123^""^-1^0^"" +50026^0^0^50124^""^-1^0^"" +50026^1^0^50125^""^-1^0^"" +50026^2^2^8^""^-1^0^"" +50027^0^0^50126^""^-1^0^"" +50028^0^0^50127^""^-1^0^"" +50029^0^0^50128^""^-1^0^"" +50030^0^0^50128^""^-1^0^"" +50030^1^0^50129^""^-1^0^"" +50031^0^0^50115^""^-1^0^"" +50031^1^0^50116^""^-1^0^"" +50031^2^0^50130^""^-1^0^"" +50031^3^0^50131^""^-1^0^"" +50032^0^0^50102^""^-1^0^"" +50032^1^0^50103^""^-1^0^"" +50032^2^0^50104^""^-1^0^"" +50032^3^0^50105^""^-1^0^"" +50032^4^0^50106^""^-1^0^"" +50032^5^0^50107^""^-1^0^"" +50032^6^0^50169^""^-1^0^"" +50032^7^0^50170^""^-1^0^"" +50032^8^2^32^""^-1^0^"" +50033^0^0^50132^""^-1^0^"" +50034^0^0^50133^""^-1^0^"" +50035^0^0^50134^""^-1^0^"" +50036^0^0^50135^""^-1^0^"" +50036^1^0^50136^""^-1^0^"" +50036^2^0^50137^""^-1^0^"" +50036^3^0^50138^""^-1^0^"" +50036^4^0^50139^""^-1^0^"" +50036^5^0^50140^""^-1^0^"" +50036^6^0^50141^""^-1^0^"" +50036^7^0^50142^""^-1^0^"" +50036^8^0^50143^""^-1^0^"" +50036^9^0^50144^""^-1^0^"" +50036^10^0^50145^""^-1^0^"" +50036^11^0^50146^""^-1^0^"" +50037^0^0^50147^""^-1^0^"" +50037^1^0^50148^""^-1^0^"" +50037^2^0^50149^""^-1^0^"" +50037^3^0^50150^""^-1^0^"" +50037^4^0^50151^""^-1^0^"" +50038^0^0^50132^""^-1^0^"" +50038^1^0^50126^""^-1^0^"" +50039^0^0^50152^""^-1^0^"" +50039^1^1^50040^"Profile"^-1^2^"50152" +50040^0^0^50132^""^-1^0^"" +50040^1^0^50126^""^-1^0^"" +50040^2^0^50153^""^-1^0^"" +50040^3^0^50154^""^-1^10^"50153" +50041^0^0^50155^""^-1^0^"" +50042^0^0^50156^""^-1^0^"" +50043^0^0^50157^""^-1^0^"" +50044^0^0^50158^""^-1^0^"" +50045^0^0^50159^""^-1^0^"" +50046^0^0^50160^""^-1^0^"" +50047^0^0^50161^""^-1^0^"" +50048^0^0^50128^""^-1^0^"" +50048^1^0^50161^""^-1^0^"" +50049^0^0^50157^""^-1^0^"" +50050^0^0^50128^""^-1^0^"" +50051^0^0^50162^""^-1^0^"" +50051^1^0^50163^""^-1^0^"" +50051^2^0^50164^""^-1^0^"" +50051^3^0^50165^""^-1^0^"" +50051^4^0^50166^""^-1^0^"" +50051^5^0^50167^""^-1^0^"" +50051^6^0^50209^""^-1^0^"" +50051^7^2^32^""^-1^0^"" +50052^0^0^50168^""^-1^0^"" +50053^0^0^50101^""^-1^0^"" +50053^1^0^50169^""^14^0^"" +50053^2^0^50170^""^-1^0^"" +50053^7^2^40^""^-1^0^"" +50054^0^0^50171^""^-1^0^"" +50055^0^0^50172^""^-1^0^"" +50056^0^0^50173^""^-1^0^"" +50056^1^0^50126^""^-1^0^"" +50057^0^0^50174^""^-1^0^"" +50058^0^0^50175^""^-1^0^"" +50059^0^0^50176^""^-1^0^"" +50060^0^0^50177^""^-1^0^"" +50061^0^0^50178^""^-1^0^"" +50062^0^0^50179^""^-1^0^"" +50063^0^0^50180^""^-1^0^"" +50064^0^0^50181^""^-1^0^"" +50065^0^0^50182^""^-1^0^"" +50066^0^0^50183^""^-1^0^"" +50067^0^0^50184^""^-1^0^"" +50068^0^0^50185^""^-1^0^"" +50069^0^0^50186^""^-1^0^"" +50070^0^0^50173^""^-1^0^"" +50071^0^0^50187^""^-1^0^"" +50072^0^0^50188^""^-1^0^"" +50073^0^0^50189^""^-1^0^"" +50074^0^0^50190^""^-1^0^"" +50074^1^1^50075^"Record"^-1^2^"50190" +50075^0^0^50191^""^-1^0^"" +50075^1^0^50192^""^-1^0^"" +50075^2^0^50193^""^-1^0^"" +50075^3^0^50194^""^-1^0^"" +50075^4^0^50118^""^-1^1^"4" +50075^5^0^50196^""^-1^0^"" +50075^6^0^50197^""^-1^0^"" +50075^7^0^50198^""^-1^0^"" +50075^8^0^50199^""^-1^0^"" +50075^9^0^50157^""^-1^0^"" +50075^10^0^50201^""^-1^0^"" +50075^11^0^50202^""^-1^10^"50201" +50076^0^0^50190^""^-1^0^"" +50076^1^1^50077^"Record"^-1^2^"50190" +50077^0^0^50191^""^-1^0^"" +50078^0^0^50203^""^-1^0^"" +50079^0^0^50204^""^-1^0^"" +50080^0^0^50205^""^-1^0^"" +50081^0^0^50206^""^-1^0^"" +50082^0^0^50207^""^-1^0^"" +50083^0^0^50208^""^-1^0^"" +50084^0^0^50210^""^-1^0^"" +50084^1^0^50211^""^-1^0^"" +50084^2^0^50212^""^-1^0^"" +50084^3^0^50213^""^-1^0^"" +50084^4^0^50214^""^-1^0^"" +50084^5^0^50215^""^-1^0^"" +50084^6^0^50216^""^-1^0^"" +50084^7^0^50217^""^-1^0^"" +50084^8^0^50218^""^-1^0^"" +50084^9^0^50219^""^-1^0^"" +50084^10^0^50255^""^-1^0^"" +50084^11^0^50256^""^-1^0^"" +50084^12^0^50257^""^-1^0^"" +50084^13^0^50258^""^-1^0^"" +50084^14^0^50259^""^-1^0^"" +50084^15^0^50260^""^-1^0^"" +50084^16^0^50261^""^-1^0^"" +50084^17^0^50262^""^-1^0^"" +50084^18^2^32^""^-1^0^"" +50085^0^0^50220^""^-1^0^"" +50086^0^0^50221^""^-1^0^"" +50087^0^0^50222^""^-1^0^"" +50088^0^0^50223^""^-1^0^"" +50090^0^0^50230^""^-1^0^"" +50090^1^1^50091^""^-1^5^"50230 = 1" +50090^2^1^50092^""^-1^5^"50230 = 2" +50090^3^2^72^""^-1^0^"" +50091^0^0^50231^""^-1^0^"" +50091^1^0^50232^""^-1^0^"" +50091^2^0^50233^""^-1^0^"" +50091^3^2^32^""^-1^0^"" +50091^4^1^50093^""^-1^5^"50231 = 1" +50091^5^1^50094^""^-1^5^"50233 = 1" +50091^6^2^64^""^-1^0^"" +50092^0^0^50234^""^-1^0^"" +50092^1^0^50235^""^-1^0^"" +50092^2^0^50236^""^-1^0^"" +50092^3^0^50237^""^-1^0^"" +50092^4^0^50238^""^-1^0^"" +50092^5^0^50273^""^-1^0^"" +50092^6^2^32^""^-1^0^"" +50093^0^0^50239^""^-1^0^"" +50093^1^0^50240^""^-1^0^"" +50093^2^0^50241^""^-1^0^"" +50093^3^2^32^""^-1^0^"" +50094^0^0^50242^""^-1^0^"" +50094^1^0^50243^""^-1^0^"" +50094^2^0^50244^""^-1^0^"" +50094^3^0^50274^""^-1^0^"" +50094^4^2^32^""^-1^0^"" +50095^0^0^50245^""^-1^0^"" +50096^0^0^50246^""^-1^0^"" +50097^0^0^50247^""^-1^0^"" +50098^0^0^50248^""^-1^0^"" +50098^1^0^50249^""^-1^0^"" +50098^2^0^50250^""^16^5^"50248 = 1" +50098^3^0^50251^""^16^5^"50248 = 2" +50098^4^0^50252^""^16^5^"50248 = 3" +50098^5^0^50253^""^16^5^"50248 = 6" +50099^0^0^50254^""^-1^0^"" +50100^0^0^51000^""^-1^0^"" +50101^0^0^51001^""^-1^0^"" +50101^1^0^51002^""^-1^0^"" +50102^0^0^51003^""^-1^0^"" +50102^1^0^51004^""^-1^0^"" +50102^2^0^51005^""^-1^0^"" +50102^3^0^51006^""^-1^0^"" +50102^4^0^51007^""^8^0^"" +50103^0^0^51008^""^-1^0^"" +50103^1^0^51009^""^-1^0^"" +50103^2^0^51010^""^-1^0^"" +50103^3^0^51011^""^-1^0^"" +50103^4^0^51012^""^-1^0^"" +50103^5^0^51013^""^-1^2^"51012" +50104^0^0^51014^""^-1^0^"" +50105^0^0^51015^""^-1^0^"" +50106^0^0^51016^""^-1^0^"" +50107^0^0^51017^""^-1^0^"" +50108^0^0^51018^""^-1^0^"" +50109^0^0^51019^""^-1^0^"" +50110^0^0^51020^""^-1^0^"" +50111^0^0^51021^""^-1^0^"" +50112^0^0^51022^""^-1^0^"" +50113^0^0^51023^""^-1^0^"" +50114^0^0^51024^""^-1^0^"" +50115^0^0^51025^""^-1^0^"" +50116^0^0^51026^""^-1^0^"" +50116^1^0^51027^""^-1^0^"" +50117^0^0^51028^""^-1^0^"" +50118^0^0^51048^""^-1^0^"" +50118^1^0^51049^""^-1^9^"51048" +50119^0^0^51030^""^-1^0^"" +50119^1^0^51031^""^-1^0^"" +50119^2^0^51032^""^-1^0^"" +50119^3^0^51033^""^-1^9^"51032" +50119^4^0^51034^""^-1^0^"" +50119^5^0^51035^""^-1^9^"51034" +50120^0^0^51036^""^-1^0^"" +50120^1^0^51037^""^-1^2^"51036" +50121^0^0^51038^""^-1^0^"" +50121^1^0^51039^""^-1^9^"51038" +50122^0^0^51040^""^-1^0^"" +50122^1^0^51041^""^-1^9^"51040" +50123^0^0^51042^""^-1^0^"" +50124^0^0^51042^""^-1^0^"" +50124^1^0^51043^""^-1^0^"" +50125^0^0^51044^""^-1^0^"" +50125^1^0^51045^""^-1^0^"" +50126^0^0^51046^""^-1^0^"" +50126^1^0^51047^""^-1^2^"51046" +50127^0^0^51050^""^-1^0^"" +50127^1^0^51051^""^-1^0^"" +50127^2^0^51052^""^-1^0^"" +50127^3^0^51053^""^-1^9^"51052" +50128^0^0^51054^""^-1^0^"" +50128^1^0^51055^""^-1^0^"" +50129^0^0^51050^""^-1^0^"" +50129^1^0^51052^""^-1^0^"" +50129^2^0^51053^""^-1^9^"51052" +50130^0^0^51050^""^-1^0^"" +50130^1^0^51056^""^-1^0^"" +50130^2^0^51057^""^-1^9^"51056" +50130^3^0^51060^""^-1^0^"" +50130^4^0^51061^""^-1^9^"51060" +50131^0^0^51050^""^-1^0^"" +50131^1^0^51058^""^-1^0^"" +50131^2^0^51059^""^-1^9^"51058" +50131^3^0^51060^""^-1^0^"" +50131^4^0^51061^""^-1^9^"51060" +50132^0^0^51062^""^-1^0^"" +50132^1^0^51054^""^-1^0^"" +50132^2^0^51055^""^-1^0^"" +50133^0^0^51063^""^-1^0^"" +50134^0^0^51030^""^-1^0^"" +50135^0^0^51064^""^-1^0^"" +50135^1^0^51065^""^-1^0^"" +50135^2^0^51066^""^-1^0^"" +50135^3^0^51037^""^-1^2^"51065" +50136^0^0^51067^""^-1^0^"" +50137^0^0^51068^""^-1^0^"" +50138^0^0^51069^""^-1^0^"" +50139^0^0^51070^""^-1^0^"" +50139^1^0^51071^""^-1^0^"" +50139^2^0^51072^""^-1^0^"" +50139^3^0^51082^""^-1^0^"" +50140^0^0^51073^""^-1^0^"" +50141^0^0^51074^""^-1^0^"" +50142^0^0^51075^""^-1^0^"" +50143^0^0^51076^""^-1^0^"" +50144^0^0^51077^""^-1^0^"" +50145^0^0^51078^""^-1^0^"" +50146^0^0^51079^""^-1^0^"" +50146^1^0^51054^""^-1^0^"" +50146^2^0^51055^""^-1^0^"" +50147^0^0^51078^""^-1^0^"" +50147^1^0^51079^""^-1^0^"" +50147^2^0^51080^""^-1^0^"" +50147^3^0^51081^""^-1^9^"51080" +50148^0^0^51054^""^-1^0^"" +50149^0^0^51078^""^-1^0^"" +50149^1^0^51080^""^-1^0^"" +50149^2^0^51081^""^-1^9^"51080" +50150^0^0^51055^""^-1^0^"" +50151^0^0^51083^""^-1^0^"" +50152^0^0^51084^""^-1^0^"" +50153^0^0^51085^""^-1^0^"" +50155^0^0^51090^""^-1^0^"" +50155^1^1^50156^"Image"^-1^2^"51090" +50156^0^0^51091^""^-1^0^"" +50156^1^0^51092^""^-1^1^"16" +50156^2^0^51093^""^-1^0^"" +50156^3^0^51094^""^-1^10^"51093" +50157^0^0^51095^""^-1^0^"" +50158^0^0^51096^""^-1^0^"" +50159^0^0^51090^""^-1^0^"" +50159^1^0^51091^""^-1^2^"51090" +50160^0^0^51097^""^-1^0^"" +50161^0^0^51098^""^-1^0^"" +50161^1^1^50162^"Type"^-1^2^"51098" +50162^0^0^51091^""^-1^0^"" +50162^1^0^51099^""^-1^0^"" +50162^2^0^51100^""^-1^0^"" +50162^3^0^51090^""^-1^0^"" +50162^4^1^50163^"Image"^-1^2^"51090" +50163^0^0^51096^""^-1^0^"" +50163^1^0^51101^""^-1^0^"" +50163^2^0^51092^""^-1^1^"16" +50163^3^0^51093^""^-1^0^"" +50163^4^0^51094^""^-1^10^"51093" +50165^0^0^51110^""^-1^0^"" +50165^1^0^51111^""^-1^0^"" +50165^2^0^51112^""^-1^0^"" +50165^3^0^51113^""^-1^0^"" +50165^4^0^51114^""^-1^0^"" +50165^5^0^51115^""^-1^0^"" +50165^6^0^51116^""^-1^0^"" +50165^7^0^51117^""^-1^0^"" +50165^8^0^51118^""^-1^0^"" +50165^9^0^51119^""^-1^0^"" +50165^10^0^51120^""^-1^0^"" +50165^11^0^51121^""^-1^0^"" +50165^12^0^51122^""^-1^0^"" +50165^13^0^51123^""^-1^0^"" +50165^14^0^51124^""^-1^0^"" +50165^15^0^51125^""^-1^0^"" +50165^16^0^51126^""^-1^0^"" +50165^17^0^51127^""^-1^0^"" +50165^18^0^51128^""^-1^0^"" +50165^19^0^51129^""^-1^0^"" +50165^20^0^51130^""^-1^0^"" +50165^21^0^51131^""^-1^0^"" +50165^22^0^51132^""^-1^0^"" +50165^23^0^51133^""^-1^0^"" +50165^24^0^51134^""^-1^0^"" +50165^25^0^51135^""^-1^0^"" +50165^26^0^51136^""^-1^0^"" +50165^27^0^51137^""^-1^0^"" +50165^28^0^51138^""^-1^0^"" +50165^29^0^51139^""^-1^0^"" +50165^30^0^51140^""^31^0^"" +50165^31^0^51141^""^48^0^"" +50165^32^0^51142^""^-1^0^"" +50165^33^0^51143^""^-1^0^"" +50165^34^0^51144^""^56^0^"" +50165^35^0^51145^""^-1^0^"" +50165^36^0^51146^""^-1^0^"" +50165^37^0^51147^""^-1^0^"" +50165^38^2^64^""^-1^0^"" +50166^0^0^51148^""^-1^0^"" +50167^0^0^51149^""^-1^0^"" +50168^0^0^51150^""^-1^0^"" +50169^0^0^51151^""^-1^0^"" +50170^0^0^51152^""^-1^0^"" +50171^0^0^51153^""^-1^0^"" +50172^0^0^51154^""^-1^0^"" +50172^1^0^51155^""^-1^0^"" +50173^0^0^51156^""^-1^0^"" +50173^1^0^51157^""^-1^0^"" +50174^0^0^51158^""^-1^0^"" +50175^0^0^51159^""^-1^0^"" +50200^0^0^52000^""^-1^0^"" +50200^1^0^52001^""^-1^0^"" +50200^2^0^52002^""^-1^2^"52001" +50201^0^0^52003^""^-1^0^"" +50201^1^0^52004^""^-1^0^"" +50202^0^0^52005^""^-1^0^"" +50202^1^1^50203^"Network Info"^-1^2^"52005" +50203^0^0^52006^""^-1^0^"" +50203^1^0^52007^""^-1^0^"" +50203^2^0^52008^""^-1^0^"" +50203^3^0^52009^""^-1^0^"" +50203^4^0^52010^""^-1^0^"" +50203^5^0^52011^""^-1^0^"" +50203^6^0^52012^""^-1^0^"" +50203^7^0^52013^""^-1^10^"52012" +50204^0^0^52014^""^-1^0^"" +50205^0^0^52006^""^-1^0^"" +50205^1^0^52007^""^-1^0^"" +50205^2^0^52015^""^-1^0^"" +50206^0^0^52016^""^-1^0^"" +50207^0^0^52017^""^-1^0^"" +50207^1^0^52018^""^-1^0^"" +50207^2^0^52019^""^-1^0^"" +50207^3^0^52020^""^-1^0^"" +50207^4^0^52021^""^-1^0^"" +50207^5^0^52004^""^-1^2^"52021" +50208^0^0^52022^""^-1^0^"" +50209^0^0^52006^""^-1^0^"" +50209^1^0^52007^""^-1^0^"" +50209^2^0^52012^""^-1^0^"" +50209^3^0^52013^""^-1^10^"52012" +50210^0^0^52023^""^-1^0^"" +50210^1^1^50211^"Network"^-1^2^"52023" +50211^0^0^52006^""^-1^0^"" +50211^1^0^52007^""^-1^0^"" +50211^2^1^50212^""^-1^0^"" +50212^0^0^52024^""^6^0^"" +50212^1^0^52025^""^-1^0^"" +50212^2^0^52026^""^15^0^"" +50213^0^0^52027^""^-1^0^"" +50213^1^1^50214^"Network"^-1^2^"52027" +50214^0^0^52006^""^-1^0^"" +50214^1^0^52007^""^-1^0^"" +50215^0^0^52028^""^-1^0^"" +50215^1^0^52029^""^-1^0^"" +50216^0^1^50217^""^-1^0^"" +50216^1^0^52032^""^-1^0^"" +50217^0^0^52035^""^-1^0^"" +50217^1^1^50221^""^-1^5^"52035 = 1" +50217^2^1^50222^""^-1^5^"52035 = 2" +50217^3^2^16^""^-1^0^"" +50218^0^0^52033^""^-1^0^"" +50219^0^0^52034^""^-1^0^"" +50219^1^0^52033^""^-1^0^"" +50220^0^0^52005^""^-1^0^"" +50220^1^1^50201^"Info"^-1^2^"52005" +50221^0^0^52036^""^-1^0^"" +50221^1^0^52037^""^-1^0^"" +50221^2^0^52038^""^-1^0^"" +50222^0^0^52039^""^-1^0^"" +50222^1^0^52040^""^-1^0^"" +50223^0^0^52041^""^-1^0^"" +50223^1^0^52042^""^-1^2^"52041" +50224^0^0^52043^""^-1^0^"" +50225^0^0^52044^""^-1^0^"" +50226^0^0^52045^""^-1^0^"" +50227^0^0^52046^""^-1^0^"" +50227^1^0^52047^""^-1^0^"" +50227^2^0^52048^""^-1^0^"" +50228^0^0^52049^""^-1^0^"" +50229^0^0^52050^""^-1^0^"" +50229^1^0^52051^""^-1^0^"" +50229^2^0^52052^""^-1^0^"" +50229^3^0^52053^""^-1^0^"" +50229^4^0^52054^""^-1^0^"" +50229^5^0^52055^""^-1^0^"" +50229^6^0^52056^""^-1^0^"" +50229^7^0^52057^""^-1^0^"" +50229^8^0^52058^""^-1^0^"" +50229^9^0^52059^""^40^0^"" +50229^10^0^52060^""^72^0^"" +50229^11^0^52061^""^-1^0^"" +50229^12^2^104^""^-1^0^"" +50230^0^0^52034^""^-1^0^"" +50231^0^0^52062^""^-1^0^"" +50232^0^0^52004^""^-1^0^"" +50232^1^0^52063^""^-1^0^"" +50232^2^0^52064^""^-1^0^"" +50233^0^0^52065^""^-1^0^"" +50234^0^0^52066^""^-1^0^"" +50235^0^0^52067^""^-1^0^"" +50235^1^1^50232^"Instance"^-1^2^"52067" +50236^0^0^52068^""^-1^0^"" +50236^1^0^52069^""^-1^0^"" +50237^0^0^52070^""^-1^0^"" +50240^0^0^52080^""^-1^0^"" +50240^1^0^52081^""^-1^0^"" +50241^0^0^52082^""^-1^0^"" +50241^1^0^52083^""^-1^0^"" +50242^0^0^52084^""^-1^0^"" +50242^1^0^52085^""^-1^0^"" +50243^0^0^52086^""^-1^0^"" +50243^1^0^52087^""^-1^0^"" +50244^0^0^52088^""^-1^0^"" +50245^0^0^52089^""^-1^0^"" +50245^1^0^52004^""^-1^0^"" +50246^0^0^52090^""^-1^0^"" +50246^1^0^52004^""^-1^0^"" +50247^0^0^52091^""^-1^0^"" +50248^0^0^52092^""^-1^0^"" +50249^0^0^52093^""^-1^0^"" +50249^1^0^52004^""^-1^0^"" +50250^0^0^52094^""^-1^0^"" +50251^0^0^52095^""^-1^0^"" +50252^0^0^52096^""^-1^0^"" +50253^0^0^52157^""^-1^0^"" +50253^1^0^52158^""^-1^0^"" +50253^2^0^52159^""^-1^0^"" +50253^3^0^52160^""^-1^0^"" +50253^4^0^52161^""^-1^0^"" +50253^5^2^16^""^-1^0^"" +50254^0^0^52097^""^-1^0^"" +50254^1^1^50245^"Measurement"^-1^2^"52097" +50255^0^0^52097^""^-1^0^"" +50255^1^1^50246^"Measurement"^-1^2^"52097" +50256^0^0^52097^""^-1^0^"" +50256^1^1^50249^"Measurement"^-1^2^"52097" +50257^0^0^52098^""^-1^0^"" +50257^1^0^52099^""^-1^0^"" +50257^2^0^52100^""^-1^0^"" +50258^0^0^52067^""^-1^0^"" +50258^1^1^50259^"Instance"^-1^2^"52067" +50259^0^0^52004^""^-1^0^"" +50259^1^0^52022^""^-1^0^"" +50260^0^0^52022^""^-1^0^"" +50261^0^0^52101^""^-1^0^"" +50261^1^0^52102^""^-1^0^"" +50261^2^0^52103^""^-1^0^"" +50262^0^0^52104^""^-1^0^"" +50263^0^0^52105^""^-1^0^"" +50264^0^0^52106^""^-1^0^"" +50264^1^0^52107^""^-1^0^"" +50264^2^0^52108^""^-1^0^"" +50264^3^0^52109^""^-1^0^"" +50264^4^2^16^""^-1^0^"" +50265^0^0^52110^""^-1^0^"" +50265^1^0^52111^""^-1^0^"" +50265^2^0^52112^""^-1^0^"" +50265^3^0^52113^""^-1^0^"" +50265^4^0^52114^""^-1^0^"" +50265^5^0^52115^""^-1^0^"" +50265^6^0^52116^""^-1^0^"" +50265^7^0^52117^""^-1^0^"" +50265^8^0^52118^""^-1^0^"" +50265^9^0^52119^""^-1^0^"" +50265^10^0^52120^""^-1^0^"" +50265^11^0^52121^""^-1^0^"" +50265^12^0^52122^""^-1^0^"" +50265^13^0^52123^""^-1^0^"" +50265^14^0^52124^""^-1^0^"" +50265^15^0^52125^""^-1^0^"" +50265^16^0^52126^""^-1^0^"" +50265^17^0^52127^""^-1^0^"" +50265^18^0^52128^""^-1^0^"" +50265^19^0^52129^""^-1^0^"" +50265^20^0^52130^""^-1^0^"" +50265^21^0^52131^""^-1^0^"" +50265^22^0^52132^""^-1^0^"" +50265^23^0^52133^""^-1^0^"" +50265^24^0^52134^""^-1^0^"" +50265^25^0^52135^""^-1^0^"" +50265^26^0^52136^""^-1^0^"" +50265^27^0^52137^""^-1^0^"" +50265^28^0^52138^""^-1^0^"" +50265^29^0^52139^""^-1^0^"" +50265^30^0^52140^""^31^0^"" +50265^31^0^52141^""^48^0^"" +50265^32^0^52142^""^-1^0^"" +50265^33^0^52143^""^-1^0^"" +50265^34^0^52144^""^56^0^"" +50265^35^0^52145^""^-1^0^"" +50265^36^0^52146^""^-1^0^"" +50265^37^0^52147^""^-1^0^"" +50265^38^2^64^""^-1^0^"" +50266^0^0^52148^""^-1^0^"" +50267^0^0^52149^""^-1^0^"" +50268^0^0^52150^""^-1^0^"" +50268^1^0^52151^""^-1^0^"" +50268^2^0^52152^""^-1^0^"" +50268^3^0^52153^""^-1^0^"" +50268^4^0^52154^""^-1^0^"" +50268^6^0^52155^""^24^0^"" +50268^7^0^52067^""^-1^0^"" +50268^8^0^52156^""^-1^2^"52067" +50269^0^0^52006^""^-1^0^"" +50269^1^0^52007^""^-1^0^"" +50269^2^0^52162^""^-1^0^"" +50269^3^0^52163^""^-1^0^"" +50269^4^0^52164^""^-1^0^"" +50269^5^0^52165^""^-1^2^"52164" +50270^0^0^52005^""^-1^0^"" +50270^1^1^50271^"Info"^-1^2^"52005" +50271^0^0^52006^""^-1^0^"" +50271^1^0^52007^""^-1^0^"" +50271^2^0^52015^""^-1^0^"" +50272^0^0^52166^""^-1^0^"" +50273^0^0^52167^""^-1^0^"" +50274^0^0^52168^""^-1^0^"" +50274^1^0^52169^""^-1^0^"" +50274^2^0^52170^""^-1^2^"52169" +50274^3^0^52171^""^-1^0^"" +50274^4^0^52172^""^-1^0^"" +50274^5^0^52173^""^-1^0^"" +50274^6^0^52174^""^-1^0^"" +50274^7^0^52175^""^-1^2^"52174" +50274^8^0^52176^""^-1^0^"" +50274^9^0^52177^""^-1^0^"" +50274^10^0^52178^""^-1^0^"" +50274^11^0^52179^""^-1^0^"" +50274^12^0^52180^""^-1^2^"52179" +50275^0^0^52181^""^-1^0^"" +50275^1^0^52004^""^-1^0^"" +50276^0^0^52182^""^-1^0^"" +50277^0^0^52183^""^-1^0^"" +50277^1^0^52184^""^-1^0^"" +50300^0^0^53000^""^-1^0^"" +50301^0^0^53001^""^-1^0^"" +50301^1^0^53002^""^-1^0^"" +50302^0^0^53003^""^-1^0^"" +50302^1^0^53004^""^-1^0^"" +50302^2^0^53005^""^-1^2^"53004" +50303^0^0^53006^""^-1^0^"" +50304^0^0^53001^""^-1^0^"" +50304^1^0^53003^""^-1^0^"" +50304^2^0^53004^""^-1^0^"" +50304^3^0^53005^""^-1^2^"53004" +50305^0^0^53002^""^-1^0^"" +50306^0^0^53007^""^-1^0^"" +50306^1^0^53003^""^-1^0^"" +50306^2^0^53004^""^-1^0^"" +50306^3^0^53005^""^-1^2^"53004" +50307^0^0^53001^""^-1^0^"" +50307^1^0^53002^""^-1^0^"" +50307^2^0^53007^""^-1^0^"" +50308^0^0^53001^""^-1^0^"" +50309^0^0^53007^""^-1^0^"" +50310^0^0^53008^""^-1^0^"" +50311^0^0^53009^""^-1^0^"" +50311^1^1^50312^"Message"^-1^2^"53009" +50312^0^0^53002^""^-1^0^"" +50312^1^0^53007^""^-1^0^"" +50313^0^0^53010^""^-1^0^"" +50313^1^1^50314^"Route"^-1^2^"53010" +50314^0^0^53011^""^-1^0^"" +50314^1^0^53012^""^-1^0^"" +50314^2^0^53001^""^-1^0^"" +50314^3^0^53013^""^-1^0^"" +50315^0^0^53010^""^-1^0^"" +50315^1^1^50316^"Route"^-1^2^"53010" +50316^0^0^53011^""^-1^0^"" +50316^1^0^53012^""^-1^0^"" +50316^2^0^53001^""^-1^0^"" +50316^3^0^53014^""^-1^0^"" +50317^0^0^53015^""^-1^0^"" +50317^1^0^53016^""^-1^0^"" +50317^2^0^53017^""^-1^9^"53016" +50318^0^0^53018^""^-1^0^"" +50319^0^0^53019^""^-1^0^"" +50320^0^0^53020^""^-1^0^"" +50320^1^0^53021^""^-1^0^"" +50320^2^0^53003^""^-1^0^"" +50320^3^0^53004^""^-1^0^"" +50320^4^0^53005^""^-1^2^"53004" +50321^0^0^53022^""^-1^0^"" +50321^1^0^53023^""^-1^0^"" +50322^0^0^53024^""^-1^0^"" +50323^0^0^53025^""^-1^0^"" +50324^0^0^53026^""^-1^0^"" +50325^0^0^53027^""^-1^0^"" +50325^1^0^53028^""^-1^0^"" +50326^0^0^53029^""^-1^0^"" +50327^0^0^53030^""^-1^0^"" +50328^0^0^53031^""^-1^0^"" +50329^0^0^53021^""^-1^0^"" +50329^1^0^53008^""^-1^0^"" +50329^2^0^53032^""^-1^0^"" +50330^0^0^53033^""^-1^0^"" +50330^1^0^53034^""^-1^0^"" +50331^0^0^53035^""^-1^0^"" +50331^1^0^53028^""^-1^0^"" +50332^0^0^53036^""^-1^0^"" +50333^0^0^53037^""^-1^0^"" +50334^0^0^53038^""^-1^0^"" +50335^0^0^53039^""^-1^0^"" +50336^0^0^53008^""^-1^0^"" +50336^1^0^53040^""^-1^0^"" +50337^0^0^53041^""^-1^0^"" +50337^1^1^50338^"Instance"^-1^2^"53041" +50338^0^0^53042^""^-1^0^"" +50338^1^0^53043^""^-1^0^"" +50338^2^0^53044^""^-1^0^"" +50339^0^0^53041^""^-1^0^"" +50339^1^1^50340^"Instance"^-1^2^"53041" +50340^0^0^53045^""^-1^0^"" +50340^1^0^53046^""^-1^0^"" +50340^2^0^53044^""^-1^0^"" +50341^0^0^53047^""^-1^0^"" +50341^1^0^53041^""^-1^0^"" +50341^2^1^50338^"Instance"^-1^2^"53041" +50342^0^0^53047^""^-1^0^"" +50342^1^0^53041^""^-1^0^"" +50342^2^1^50340^"Instance"^-1^2^"53041" +50343^0^0^53001^""^-1^0^"" +50343^1^0^53008^""^-1^0^"" +50344^0^0^53048^""^-1^0^"" +50345^0^0^53001^""^-1^0^"" +50345^1^0^53002^""^-1^0^"" +50345^2^0^53008^""^-1^0^"" +50346^0^0^53049^""^-1^0^"" +50400^0^0^54000^""^-1^0^"" +50401^0^0^54001^""^-1^0^"" +50402^0^0^54002^""^-1^0^"" +50402^1^0^54003^""^-1^0^"" +50403^0^0^54002^""^-1^0^"" +50404^0^0^54004^""^-1^0^"" +50404^1^0^54005^""^-1^0^"" +50404^2^0^54006^""^-1^0^"" +50404^3^0^54007^""^-1^0^"" +50404^4^0^54008^""^-1^0^"" +50404^5^0^54009^""^-1^0^"" +50404^6^0^54010^""^-1^0^"" +50404^7^0^54011^""^-1^0^"" +50405^0^0^54012^""^-1^0^"" +50405^1^0^54013^""^-1^0^"" +50405^2^0^54014^""^-1^0^"" +50405^3^0^54015^""^-1^0^"" +50405^4^0^54016^""^-1^0^"" +50405^5^0^54017^""^8^0^"" +50405^6^0^54018^""^-1^0^"" +50406^0^0^54019^""^-1^0^"" +50406^1^0^54020^""^-1^0^"" +50407^0^0^54006^""^-1^0^"" +50407^1^0^54008^""^-1^0^"" +50407^2^0^54010^""^-1^0^"" +50407^3^0^54011^""^-1^0^"" +50408^0^0^54021^""^-1^0^"" +50408^1^0^54022^""^-1^0^"" +50409^0^0^54023^""^-1^0^"" +50409^1^0^54024^""^-1^2^"54023" +50410^0^0^54025^""^-1^0^"" +50411^0^0^54026^""^-1^0^"" +50411^1^0^54027^""^-1^0^"" +50411^2^0^54028^""^-1^0^"" +50412^0^0^54029^""^-1^1^"4" +50412^1^0^54030^""^-1^0^"" +50413^0^0^54031^""^-1^0^"" +50414^0^0^54032^""^-1^0^"" +50414^1^0^54033^""^-1^0^"" +50414^2^0^54034^""^-1^0^"" +50414^3^0^54035^""^-1^0^"" +50414^4^0^54036^""^-1^0^"" +50414^5^0^54037^""^-1^0^"" +50414^6^0^54038^""^-1^0^"" +50414^7^0^54039^""^-1^0^"" +50414^8^0^54040^""^-1^0^"" +50414^9^0^54041^""^-1^0^"" +50414^10^0^54042^""^-1^0^"" +50414^11^0^54043^""^-1^0^"" +50414^12^0^54044^""^-1^0^"" +50414^13^2^32^""^-1^0^"" +50415^0^0^54045^""^-1^0^"" +50415^1^0^54046^""^-1^0^"" +50415^2^0^54047^""^-1^0^"" +50415^3^0^54048^""^-1^0^"" +50415^4^0^54049^""^-1^0^"" +50415^5^0^54050^""^-1^0^"" +50415^6^0^54051^""^-1^0^"" +50415^7^0^54052^""^-1^0^"" +50415^8^0^54053^""^-1^0^"" +50415^9^0^54054^""^-1^0^"" +50415^10^2^32^""^-1^0^"" +50416^0^0^54055^""^-1^0^"" +50417^0^0^54056^""^-1^0^"" +50417^1^0^54057^""^-1^0^"" +50417^2^0^54058^""^-1^10^"54057" +50420^0^0^54100^""^-1^0^"" +50421^0^0^54101^""^-1^0^"" +50422^0^0^54102^""^-1^0^"" +50423^0^0^54103^""^-1^0^"" +50424^0^0^54104^""^-1^0^"" +50425^0^0^54105^""^-1^0^"" +50426^0^0^54106^""^-1^0^"" +50427^0^0^54107^""^-1^0^"" +50428^0^0^54108^""^-1^0^"" +50429^0^0^54109^""^-1^0^"" +50430^0^0^54110^""^-1^0^"" +50430^1^0^54111^""^-1^0^"" +50430^2^0^54112^""^-1^0^"" +50430^3^0^54113^""^-1^0^"" +50430^4^0^54114^""^-1^0^"" +50430^5^0^54115^""^-1^0^"" +50430^6^0^54116^""^-1^0^"" +50430^7^0^54117^""^-1^0^"" +50430^8^0^54118^""^-1^0^"" +50430^9^0^54119^""^-1^0^"" +50430^10^0^54120^""^-1^0^"" +50430^11^0^54121^""^-1^0^"" +50430^12^0^54122^""^-1^0^"" +50430^13^0^54123^""^-1^0^"" +50430^14^0^54124^""^-1^0^"" +50430^15^0^54125^""^-1^0^"" +50430^16^0^54126^""^-1^0^"" +50430^17^0^54127^""^-1^0^"" +50430^18^0^54128^""^-1^0^"" +50430^19^0^54129^""^-1^0^"" +50430^20^0^54130^""^-1^0^"" +50430^21^0^54131^""^-1^0^"" +50430^22^0^54132^""^-1^0^"" +50430^23^0^54132^""^-1^0^"" +50430^24^2^32^""^-1^0^"" +50430^25^0^54133^""^-1^0^"" +50430^26^0^54134^""^-1^0^"" +50430^27^0^54135^""^-1^0^"" +50430^28^0^54136^""^-1^0^"" +50430^29^0^54137^""^-1^0^"" +50430^30^0^54138^""^-1^0^"" +50430^31^0^54139^""^-1^0^"" +50430^32^0^54140^""^-1^0^"" +50430^33^0^54141^""^-1^0^"" +50430^34^0^54142^""^-1^0^"" +50430^35^0^54143^""^-1^0^"" +50430^36^0^54144^""^-1^0^"" +50430^37^0^54145^""^-1^0^"" +50430^38^0^54146^""^-1^0^"" +50430^39^0^54147^""^-1^0^"" +50430^40^0^54148^""^-1^0^"" +50430^41^0^54149^""^-1^0^"" +50430^42^0^54150^""^-1^0^"" +50430^43^0^54151^""^-1^0^"" +50430^44^0^54152^""^-1^0^"" +50430^45^0^54153^""^-1^0^"" +50430^46^0^54154^""^-1^0^"" +50430^47^0^54155^""^-1^0^"" +50430^48^0^54156^""^-1^0^"" +50430^49^0^54157^""^-1^0^"" +50430^50^0^54158^""^-1^0^"" +50430^51^0^54159^""^-1^0^"" +50430^52^0^54160^""^-1^0^"" +50430^53^0^54161^""^-1^0^"" +50430^54^0^54162^""^-1^0^"" +50431^0^0^54163^""^-1^0^"" +50431^1^0^54164^""^-1^0^"" +50431^2^1^50432^"URL"^-1^2^"54164" +50432^0^0^54165^""^-1^0^"" +50432^1^0^54166^""^-1^10^"54165" +50433^0^0^54167^""^-1^0^"" +50433^1^0^54164^""^-1^0^"" +50433^2^1^50432^"URL"^-1^2^"54164" +50434^0^0^54168^""^-1^0^"" +50434^1^0^54169^""^-1^0^"" +50435^0^0^54170^""^-1^0^"" +50435^1^0^54171^""^-1^0^"" +50435^2^0^54172^""^-1^0^"" +50435^3^2^32^""^-1^0^"" +50435^4^0^54173^""^-1^0^"" +50435^5^0^54174^""^-1^0^"" +50435^6^1^50436^"SV"^-1^2^"54174" +50436^0^0^54175^""^-1^0^"" +50436^1^0^54176^""^-1^0^"" +50436^2^0^54177^""^-1^0^"" +50436^3^0^54178^""^-1^0^"" +50436^4^0^54179^""^-1^0^"" +50436^5^0^54180^""^-1^0^"" +50436^6^0^54181^""^-1^0^"" +50436^7^0^54182^""^-1^0^"" +50436^8^0^54183^""^-1^0^"" +50436^9^2^32^""^-1^0^"" +50436^10^0^54184^""^-1^0^"" +50436^11^0^54185^""^-1^0^"" +50436^12^0^54186^""^-1^0^"" +50436^13^0^54187^""^-1^0^"" +50436^14^0^54188^""^-1^0^"" +50436^15^0^54189^""^-1^0^"" +50436^16^0^54347^""^-1^0^"" +50436^17^0^54190^""^-1^0^"" +50436^18^0^54191^""^-1^0^"" +50437^0^0^54192^""^-1^0^"" +50437^1^0^54193^""^-1^0^"" +50437^2^0^54194^""^-1^0^"" +50437^3^0^54195^""^-1^0^"" +50437^4^0^54196^""^-1^0^"" +50437^5^0^54197^""^-1^0^"" +50437^6^2^32^""^-1^0^"" +50437^7^0^54198^""^-1^0^"" +50437^8^0^54199^""^-1^0^"" +50437^9^0^54200^""^-1^0^"" +50437^10^0^54201^""^-1^0^"" +50437^11^0^54202^""^-1^0^"" +50437^12^0^54203^""^-1^0^"" +50437^13^0^54204^""^-1^0^"" +50437^14^0^54205^""^-1^2^"54204" +50438^0^0^54206^""^-1^0^"" +50438^1^0^54207^""^-1^0^"" +50438^2^0^54208^""^-1^0^"" +50438^3^0^54209^""^-1^0^"" +50438^4^0^54210^""^-1^0^"" +50438^5^0^54211^""^-1^0^"" +50438^6^0^54212^""^-1^0^"" +50438^7^0^54213^""^-1^0^"" +50438^8^0^54214^""^-1^0^"" +50438^9^0^54215^""^-1^0^"" +50438^10^0^54216^""^-1^0^"" +50438^11^0^54217^""^-1^0^"" +50438^12^0^54218^""^-1^0^"" +50438^13^0^54219^""^-1^0^"" +50438^14^2^32^""^-1^0^"" +50438^15^0^54220^""^-1^0^"" +50438^16^0^54221^""^-1^0^"" +50438^17^0^54222^""^-1^0^"" +50438^18^0^54223^""^-1^0^"" +50438^19^0^54224^""^-1^0^"" +50438^20^0^54225^""^-1^1^"4" +50438^21^0^54348^""^-1^0^"" +50438^22^0^54226^""^-1^1^"16" +50438^23^0^54227^""^-1^0^"" +50438^24^0^54228^""^-1^10^"54227" +50438^25^0^54229^""^-1^0^"" +50438^26^0^54230^""^-1^0^"" +50438^27^0^54231^""^-1^0^"" +50438^28^0^54232^""^-1^2^"54231" +50438^29^0^54233^""^-1^0^"" +50438^30^0^54234^""^-1^0^"" +50438^31^0^54235^""^-1^2^"54234" +50438^32^0^54236^""^-1^0^"" +50438^33^0^54237^""^-1^0^"" +50438^34^0^54238^""^-1^0^"" +50438^35^0^54239^""^-1^0^"" +50439^0^0^54250^""^-1^0^"" +50439^1^0^54251^""^-1^0^"" +50439^2^0^54252^""^-1^0^"" +50439^3^0^54253^""^-1^0^"" +50439^4^0^54254^""^-1^0^"" +50439^5^0^54255^""^-1^0^"" +50439^6^0^54256^""^-1^0^"" +50439^7^0^54257^""^-1^0^"" +50439^8^2^32^""^-1^0^"" +50439^9^0^54258^""^-1^0^"" +50439^10^0^54259^""^-1^0^"" +50439^11^0^54260^""^-1^0^"" +50439^12^0^54261^""^-1^0^"" +50439^13^0^54262^""^-1^2^"54261" +50439^14^0^54263^""^-1^0^"" +50439^15^0^54264^""^-1^10^"54263" +50439^16^0^54265^""^-1^0^"" +50439^17^0^54266^""^-1^0^"" +50439^18^0^54267^""^-1^0^"" +50439^19^0^54268^""^-1^2^"54267" +50439^20^0^54269^""^-1^0^"" +50439^21^0^54270^""^-1^0^"" +50439^22^0^54271^""^-1^2^"54270" +50439^23^0^54272^""^-1^0^"" +50440^0^0^54273^""^-1^0^"" +50440^1^0^54274^""^-1^0^"" +50441^0^0^54275^""^-1^0^"" +50441^1^0^54276^""^-1^0^"" +50442^0^0^54006^""^-1^0^"" +50443^0^0^54008^""^-1^0^"" +50444^0^0^54011^""^-1^0^"" +50445^0^0^54277^""^-1^0^"" +50445^1^0^54278^""^-1^0^"" +50446^0^0^54279^""^-1^0^"" +50446^1^0^54280^""^-1^0^"" +50446^2^0^54281^""^-1^0^"" +50446^3^0^54282^""^-1^2^"54281" +50447^0^0^54142^""^-1^0^"" +50448^0^0^54144^""^-1^0^"" +50449^0^0^54145^""^-1^0^"" +50450^0^0^54146^""^-1^0^"" +50451^0^0^54147^""^-1^0^"" +50452^0^0^54151^""^-1^0^"" +50453^0^0^54155^""^-1^0^"" +50454^0^0^54158^""^-1^0^"" +50455^0^0^54283^""^-1^0^"" +50456^0^0^54284^""^-1^0^"" +50457^0^0^54285^""^-1^0^"" +50458^0^0^54286^""^-1^0^"" +50458^1^0^54287^""^-1^0^"" +50458^2^0^54288^""^-1^0^"" +50458^3^0^54289^""^-1^0^"" +50458^4^0^54290^""^-1^0^"" +50459^0^0^54289^""^-1^0^"" +50459^1^1^50460^"AP"^-1^2^"54289" +50460^0^0^54291^""^-1^1^"6" +50460^1^0^54292^""^-1^0^"" +50460^2^0^54293^""^-1^0^"" +50460^3^0^54350^""^-1^0^"" +50460^4^0^54351^""^-1^0^"" +50460^5^0^54352^""^-1^0^"" +50460^6^0^54353^""^-1^0^"" +50460^7^2^8^""^-1^0^"" +50461^0^0^54294^""^-1^0^"" +50462^0^0^54295^""^-1^0^"" +50463^0^0^54296^""^-1^0^"" +50464^0^0^54297^""^-1^0^"" +50464^1^0^54298^""^-1^0^"" +50464^2^0^54299^""^-1^0^"" +50464^3^0^54300^""^-1^0^"" +50465^0^0^54301^""^-1^0^"" +50465^1^0^54302^""^-1^10^"54301" +50465^2^0^54303^""^-1^0^"" +50465^3^0^54304^""^-1^0^"" +50465^4^0^54305^""^-1^0^"" +50465^5^0^54306^""^-1^0^"" +50465^6^0^54306^""^-1^2^"54304" +50466^0^0^54308^""^-1^0^"" +50467^0^0^54309^""^-1^0^"" +50468^0^0^54310^""^-1^0^"" +50469^0^0^54354^""^-1^0^"" +50469^1^0^54311^""^-1^0^"" +50469^2^0^54312^""^-1^0^"" +50469^3^0^54313^""^-1^0^"" +50469^4^0^54314^""^-1^0^"" +50469^5^0^54315^""^-1^0^"" +50469^6^0^54316^""^-1^0^"" +50469^7^0^54317^""^-1^0^"" +50469^8^0^54318^""^-1^0^"" +50469^9^0^54319^""^-1^0^"" +50469^10^0^54320^""^-1^0^"" +50469^11^0^54321^""^-1^0^"" +50469^12^0^54322^""^-1^0^"" +50469^13^0^54323^""^-1^0^"" +50469^14^0^54324^""^-1^0^"" +50469^15^0^54325^""^-1^0^"" +50469^16^0^54326^""^-1^0^"" +50469^17^0^54327^""^-1^0^"" +50469^18^0^54328^""^-1^0^"" +50469^19^0^54329^""^-1^0^"" +50469^20^2^32^""^-1^0^"" +50469^21^0^54144^""^-1^0^"" +50469^22^0^54145^""^-1^0^"" +50469^23^0^54151^""^-1^0^"" +50469^24^0^54146^""^-1^0^"" +50469^25^0^54155^""^-1^0^"" +50469^26^0^54330^""^-1^0^"" +50469^27^0^54331^""^-1^0^"" +50469^28^0^54298^""^-1^0^"" +50469^29^0^54332^""^-1^0^"" +50469^30^0^54333^""^-1^0^"" +50469^31^0^54334^""^-1^0^"" +50469^32^0^54335^""^-1^0^"" +50469^33^0^54336^""^-1^0^"" +50469^34^0^54337^""^-1^0^"" +50469^35^0^54338^""^-1^0^"" +50469^36^0^54339^""^-1^0^"" +50469^37^0^54340^""^-1^0^"" +50469^38^0^54341^""^-1^0^"" +50469^39^0^54342^""^-1^0^"" +50469^40^0^54343^""^-1^0^"" +50469^41^0^54344^""^-1^0^"" +50469^42^0^54345^""^-1^0^"" +50469^43^0^54346^""^-1^0^"" +50469^44^0^54347^""^-1^0^"" +50470^0^0^54355^""^-1^0^"" +50471^0^0^54356^""^-1^0^"" +50500^0^0^55000^""^-1^0^"" +50501^0^0^55001^""^-1^0^"" +50600^0^0^56000^""^-1^0^"" +50600^1^0^56001^""^-1^0^"" +50600^2^0^56002^""^-1^0^"" +50600^3^0^56003^""^-1^0^"" +50600^4^0^56004^""^-1^0^"" +50600^5^0^56005^""^-1^0^"" +50600^6^0^56006^""^-1^0^"" +50600^7^0^56007^""^-1^0^"" +50600^8^0^56008^""^-1^0^"" +50600^9^0^56009^""^-1^0^"" +50600^10^0^56010^""^-1^0^"" +50600^11^0^56011^""^-1^0^"" +50600^12^0^56012^""^-1^0^"" +50600^13^2^32^""^-1^0^"" +50601^0^0^56013^""^-1^0^"" +50601^1^0^56014^""^-1^0^"" +50601^2^0^56015^""^-1^2^"56014" +50602^0^0^56013^""^-1^0^"" +50602^1^0^56014^""^-1^0^"" +50602^2^0^56016^""^-1^2^"56014" +50603^0^0^56013^""^-1^0^"" +50603^1^0^56014^""^-1^0^"" +50603^2^0^56017^""^-1^2^"56014" +50604^0^0^56013^""^-1^0^"" +50604^1^0^56014^""^-1^0^"" +50604^2^0^56018^""^-1^2^"56014" +50605^0^0^56013^""^-1^0^"" +50605^1^0^56014^""^-1^0^"" +50605^2^0^56019^""^-1^2^"56014" +50606^0^0^56020^""^-1^0^"" +50606^1^0^56021^""^-1^0^"" +50606^2^0^56022^""^-1^2^"56021" +50607^0^0^56023^""^-1^0^"" +50607^1^0^56024^""^-1^0^"" +50607^2^0^56025^""^-1^0^"" +50607^3^2^32^""^-1^0^"" +50608^0^0^56013^""^-1^0^"" +50608^1^0^56014^""^-1^0^"" +50608^2^0^56026^""^-1^2^"56014" +50609^0^0^56013^""^-1^0^"" +50609^1^0^56014^""^-1^0^"" +50609^2^0^56027^""^-1^2^"56014" +50610^0^0^56028^""^-1^0^"" +50610^1^0^56029^""^-1^0^"" +50611^0^0^56030^""^-1^0^"" +50612^0^0^56013^""^-1^0^"" +50612^1^0^56031^""^-1^0^"" +50612^2^0^56032^""^-1^2^"56031" +50613^0^0^56036^""^-1^0^"" +50613^1^0^56034^""^-1^0^"" +50613^2^0^56035^""^-1^2^"56034" +50615^0^1^50600^"Common"^-1^0^"" +50615^1^1^50600^"Control"^-1^0^"" +50700^0^0^57000^""^-1^0^"" +50700^1^0^57001^""^-1^0^"" +50700^2^2^32^""^-1^0^"" +50701^0^0^57002^""^-1^1^"4096" +50703^0^0^57003^""^-1^1^"4096" +50704^0^0^57006^""^-1^0^"" +50705^0^0^57005^""^-1^1^"4096" +50800^0^0^58000^""^-1^0^"" +50801^0^0^58001^""^-1^0^"" +50802^0^0^58002^""^-1^0^"" +50802^1^0^58003^""^-1^0^"" +50803^0^0^58004^""^-1^0^"" +50804^0^0^58005^""^-1^0^"" +50805^0^0^58002^""^-1^0^"" +50806^0^0^58004^""^-1^0^"" +50806^1^0^58002^""^-1^0^"" +50807^0^0^58006^""^-1^0^"" +50807^1^0^58007^""^-1^0^"" +50807^2^0^58008^""^-1^0^"" +50808^0^0^58009^""^-1^0^"" +50808^1^0^58003^""^-1^0^"" +50809^0^0^58010^""^-1^0^"" +50810^0^0^58011^""^-1^0^"" +50811^0^0^58012^""^-1^0^"" +50812^0^0^58013^""^-1^0^"" +50900^0^0^59000^""^-1^0^"" +50901^0^0^59001^""^-1^0^"" +50902^0^0^59002^""^-1^0^"" +50902^1^1^50903^"Services"^-1^2^"59002" +50903^0^0^59003^""^-1^0^"" +50903^1^0^59004^""^-1^0^"" +50903^2^0^59005^""^-1^0^"" +50904^0^0^59006^""^-1^0^"" +50904^1^0^59007^""^-1^9^"59006" +50904^2^0^59002^""^-1^0^"" +50904^3^1^50903^"Services"^-1^2^"59002" +50905^0^0^59003^""^-1^0^"" +50906^0^0^59003^""^-1^0^"" +50906^1^0^59008^""^-1^0^"" +50907^0^0^59009^""^-1^0^"" +50908^0^0^59010^""^-1^0^"" +50908^1^0^59011^""^-1^0^"" +50908^2^2^16^""^-1^0^"" +50909^0^0^59012^""^-1^0^"" +50910^0^0^59013^""^-1^0^"" +50910^1^0^59014^""^-1^0^"" +50911^0^0^59013^""^-1^0^"" +50911^1^0^59003^""^-1^0^"" +50912^0^0^59015^""^-1^1^"255" +50913^0^0^59013^""^-1^0^"" +60000^0^0^50263^""^-1^0^"" +60000^1^1^50021^"Instance"^-1^2^"50263" +60001^0^0^50263^""^-1^0^"" +60001^1^1^60002^"Instance"^-1^2^"50263" +60002^0^0^50264^""^-1^0^"" +60002^1^0^50265^""^-1^10^"50264" +60003^0^1^60013^""^-1^0^"" +60004^0^0^50266^""^-1^0^"" +60005^0^0^50263^""^-1^0^"" +60005^1^1^60006^"Instance"^-1^2^"50263" +60006^0^0^50267^""^-1^0^"" +60006^1^0^50268^""^-1^10^"50267" +60007^0^0^50269^""^-1^0^"" +60008^0^0^50270^""^-1^0^"" +60009^0^0^50271^""^-1^1^"4" +60010^0^1^60012^""^-1^0^"" +60011^0^1^60012^""^-1^0^"" +60012^0^1^60013^""^-1^0^"" +60012^1^1^60014^""^-1^0^"" +60013^0^6^0^""^-1^0^"" +60013^1^0^50275^""^-1^1^"8" +60014^0^0^50272^""^-1^0^"" +60015^0^0^50276^""^-1^0^"" +60016^0^0^50277^""^-1^0^"" +60017^0^0^50269^""^-1^0^"" +60018^0^0^50278^""^-1^0^"" +60018^1^0^50279^""^-1^0^"" +60018^2^0^50280^""^-1^0^"" +60018^3^0^50281^""^-1^1^"16" +60018^4^0^50282^""^-1^0^"" +60018^5^0^50283^""^-1^0^"" +60018^6^0^50284^""^-1^0^"" +60018^7^0^50285^""^-1^0^"" +60018^8^0^50286^""^-1^0^"" +60018^9^0^50287^""^-1^0^"" +60018^10^0^50288^""^-1^0^"" +60018^11^0^50289^""^-1^0^"" +60018^12^0^50290^""^-1^0^"" +60019^0^0^50278^""^-1^0^"" +60019^1^0^50279^""^-1^0^"" +60019^2^0^50280^""^-1^0^"" +60019^3^0^50281^""^-1^0^"" +60019^4^0^50282^""^-1^0^"" +60019^5^0^50283^""^-1^0^"" +60019^6^0^50284^""^-1^0^"" +60019^7^0^50285^""^-1^0^"" +60019^8^0^50286^""^-1^0^"" +60019^9^0^50287^""^-1^0^"" +60019^10^0^50288^""^-1^0^"" +60019^11^0^50289^""^-1^0^"" +60019^12^0^50290^""^-1^0^"" +60020^0^0^50291^""^-1^0^"" +60021^0^0^50292^""^-1^0^"" +60022^0^0^50293^""^-1^0^"" +60023^0^1^60058^""^-1^0^"" +60024^0^0^50135^""^-1^0^"" +60024^1^0^50136^""^-1^0^"" +60024^2^0^50137^""^-1^0^"" +60024^3^0^50138^""^-1^0^"" +60024^4^0^50139^""^-1^0^"" +60024^5^0^50140^""^-1^0^"" +60024^6^0^50141^""^-1^0^"" +60024^7^0^50142^""^-1^0^"" +60024^8^0^50143^""^-1^0^"" +60024^9^0^50144^""^-1^0^"" +60024^10^0^50145^""^-1^0^"" +60024^11^0^50146^""^-1^0^"" +60024^12^0^50294^""^-1^0^"" +60025^0^0^50135^""^-1^0^"" +60025^1^0^50136^""^-1^0^"" +60025^2^0^50137^""^-1^0^"" +60025^3^0^50138^""^-1^0^"" +60025^4^0^50139^""^-1^0^"" +60025^5^0^50140^""^-1^0^"" +60025^6^0^50141^""^-1^0^"" +60025^7^0^50142^""^-1^0^"" +60025^8^0^50143^""^-1^0^"" +60025^9^0^50144^""^-1^0^"" +60025^10^0^50145^""^-1^0^"" +60025^11^0^50146^""^-1^0^"" +60025^12^0^50294^""^-1^0^"" +60026^0^1^60058^""^-1^0^"" +60027^0^1^60058^""^-1^0^"" +60028^0^0^50295^""^-1^0^"" +60029^0^0^50296^""^-1^0^"" +60029^1^0^50139^""^-1^0^"" +60029^2^0^50137^""^-1^0^"" +60029^3^0^50138^""^-1^0^"" +60029^4^0^50136^""^-1^0^"" +60030^0^0^50297^""^-1^0^"" +60031^0^0^50298^""^-1^0^"" +60032^0^0^50299^""^-1^0^"" +60033^0^0^50300^""^-1^0^"" +60034^0^0^50301^""^-1^0^"" +60035^0^0^50301^""^-1^0^"" +60036^0^0^50301^""^-1^0^"" +60037^0^0^50302^""^-1^0^"" +60038^0^0^50302^""^-1^0^"" +60039^0^0^50302^""^-1^0^"" +60040^0^0^50303^""^-1^0^"" +60041^0^0^50122^""^-1^0^"" +60042^0^0^50123^""^-1^0^"" +60043^0^0^50304^""^-1^0^"" +60044^0^0^50305^""^-1^0^"" +60045^0^0^50306^""^-1^0^"" +60046^0^0^50307^""^-1^0^"" +60047^0^0^50119^""^-1^0^"" +60048^0^0^50308^""^-1^0^"" +60049^0^0^50309^""^-1^0^"" +60050^0^0^50271^""^-1^0^"" +60051^0^0^50271^""^-1^0^"" +60052^0^1^60058^""^-1^0^"" +60053^0^1^60058^""^-1^0^"" +60054^0^0^50310^""^-1^0^"" +60055^0^1^60058^""^-1^0^"" +60056^0^1^60058^""^-1^0^"" +60057^0^0^50311^""^-1^0^"" +60057^1^1^60058^""^-1^2^"50311" +60058^0^1^60013^""^-1^0^"" +60059^0^0^50297^""^-1^0^"" +60060^0^0^50298^""^-1^0^"" +60061^0^0^50299^""^-1^0^"" +60062^0^0^50300^""^-1^0^"" +60063^0^0^50301^""^-1^0^"" +60064^0^0^50301^""^-1^0^"" +60065^0^0^50301^""^-1^0^"" +60066^0^0^50302^""^-1^0^"" +60067^0^0^50302^""^-1^0^"" +60068^0^0^50302^""^-1^0^"" +60069^0^0^50303^""^-1^0^"" +60070^0^0^50122^""^-1^0^"" +60071^0^0^50123^""^-1^0^"" +60072^0^0^50304^""^-1^0^"" +60073^0^0^50305^""^-1^0^"" +60074^0^0^50306^""^-1^0^"" +60075^0^0^50307^""^-1^0^"" +60076^0^0^50119^""^-1^0^"" +60077^0^0^50308^""^-1^0^"" +60078^0^0^50309^""^-1^0^"" +60079^0^0^50271^""^-1^0^"" +60080^0^0^50271^""^-1^0^"" +60081^0^1^60058^""^-1^0^"" +60082^0^1^60058^""^-1^0^"" +60083^0^0^50310^""^-1^0^"" +60084^0^1^60058^""^-1^0^"" +60085^0^1^60058^""^-1^0^"" +60086^0^0^50276^""^-1^0^"" +60087^0^0^50277^""^-1^0^"" +60088^0^0^50269^""^-1^0^"" +60090^0^1^60058^""^-1^0^"" + +70000^0^0^70000^""^-1^0^"" +70000^1^0^70001^""^-1^0^"" +70000^2^0^70002^""^-1^2^"70001" +70001^0^0^70003^""^-1^0^"" +70002^0^0^70004^""^-1^0^"" +70002^1^0^70005^""^-1^0^"" +70002^2^0^70006^""^-1^2^"70005" +70003^0^0^70007^""^-1^0^"" +70004^0^0^50001^""^-1^0^"" \ No newline at end of file diff --git a/gobi-api/GobiAPI_1.0.40/Database/QMI/foo.c b/gobi-api/GobiAPI_1.0.40/Database/QMI/foo.c new file mode 100644 index 0000000..e69de29 diff --git a/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.cpp b/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.cpp new file mode 100755 index 0000000..fa89daf --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.cpp @@ -0,0 +1,2882 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmt.cpp + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + cGobiConnectionMgmtDLL + cGobiConnectionMgmt + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiConnectionMgmt.h" +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Global object +cGobiConnectionMgmtDLL gConnectionDLL; + +// Interval between traffic processing loop iterations (milliseconds) +const ULONG TRAFFIC_INTERVAL_MS = 300000; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + TrafficProcessThread (Free Method) + +DESCRIPTION: + QMI traffic process thread - processes all traffic in order to fire + off QMI traffic related callbacks + +PARAMETERS: + pArg [ I ] - Object to interface to + +RETURN VALUE: + VOID * - always NULL +===========================================================================*/ +VOID * TrafficProcessThread( PVOID pArg ) +{ + // Keep running? + bool bRun = false; + + TRACE( "GobiConnectionMgmt traffic thread [%u] started\n", + (UINT)pthread_self() ); + + // Create a vector of the objects to wait on + std::vector events; + + // Store the index to service type for use later + std::map services; + + cGobiConnectionMgmt * pAPI = (cGobiConnectionMgmt *)pArg; + if (pAPI != 0) + { + // Time to go to work + bRun = true; + + // Add the thread exit event + events.push_back( &pAPI->mExitEvent ); + + // For each Protocol server, grab the signal event + std::set ::const_iterator pIter; + pIter = pAPI->mServerConfig.begin(); + while (pIter != pAPI->mServerConfig.end()) + { + eQMIService svc = pIter->first; + cQMIProtocolServer * pServer = pAPI->GetServer( svc ); + if (pServer != 0) + { + // Grab the log from the server + const cProtocolLog & log = pServer->GetLog(); + + // Grab the Signal event, if it exists + cEvent & sigEvent = log.GetSignalEvent(); + + services[events.size()] = svc; + events.push_back( &sigEvent ); + } + + pIter++; + } + } + + // Loop waiting for exit event + while (bRun == true) + { + // Wait for activity + DWORD ignoredVal, index; + int nRet = WaitOnMultipleEvents( events, + TRAFFIC_INTERVAL_MS, + ignoredVal, + index ); + // Timeout + if (nRet == -ETIME) + { + // Do nothing + } + // Error? + else if (nRet <= 0) + { + TRACE( "GobiConnectionMgmt traffic thread wait error %d\n", nRet ); + bRun = false; + } + // Exit event? + else if (index == 0) + { + bRun = false; + } + else if (index < events.size()) + { + // Run ProcessTraffic() for this service type + if (services.find( index ) != services.end()) + { + pAPI->ProcessTraffic( services[index] ); + } + } + else + { + // Fatal error + bRun = false; + } + } + + TRACE( "GobiConnectionMgmt traffic thread [%u] exited\n", + (UINT)pthread_self() ); + + return NULL; +} + +/*=========================================================================== +METHOD: + CallbackThread (Free Method) + +DESCRIPTION: + Thread to execute a callback asynchronously + +PARAMETERS: + pArg [ I ] - The cAsyncFunction object + +RETURN VALUE: + void * - thread exit value (always 0) +===========================================================================*/ +void * CallbackThread( PVOID pArg ) +{ + cGobiCMCallback * pCB = (cGobiCMCallback *)pArg; + if (pCB == 0) + { + ASSERT( 0 ); + return 0; + } + + pCB->Call(); + + delete pCB; + pCB = 0; + + return 0; +} + +/*=========================================================================*/ +// cGobiConnectionMgmtDLL Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiConnectionMgmtDLL (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmtDLL::cGobiConnectionMgmtDLL() + : mpAPI( 0 ), + mbAllocated( false ) +{ + // Create sync CS + pthread_mutex_init( &mSyncSection, NULL ); +} + +/*=========================================================================== +METHOD: + ~cGobiConnectionMgmtDLL (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmtDLL::~cGobiConnectionMgmtDLL() +{ + // Just in case + if (mpAPI != 0) + { + mpAPI->Cleanup(); + delete mpAPI; + mpAPI = 0; + } + + pthread_mutex_destroy( &mSyncSection ); +} + +/*=========================================================================== +METHOD: + GetAPI (Public Method) + +DESCRIPTION: + Return the cGobiConnectionMgmt object + +RETURN VALUE: + cGobiConnectionMgmt * +===========================================================================*/ +cGobiConnectionMgmt * cGobiConnectionMgmtDLL::GetAPI() +{ + pthread_mutex_lock( &mSyncSection ); + + bool bAlloc = mbAllocated; + + pthread_mutex_unlock( &mSyncSection ); + + if (bAlloc == true) + { + return mpAPI; + } + + pthread_mutex_lock( &mSyncSection ); + + mpAPI = new cGobiConnectionMgmt(); + if (mpAPI != 0) + { + mpAPI->Initialize(); + } + + // We have tried to allocate the object + mbAllocated = true; + + pthread_mutex_unlock( &mSyncSection ); + return mpAPI; +} + +/*=========================================================================*/ +// cGobiConnectionMgmt Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiConnectionMgmt (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmt::cGobiConnectionMgmt() + : cGobiQMICore(), + mbThreadStarted( false ), + mThreadID( 0 ), + mWDSItemsProcessed( 0 ), + mDMSItemsProcessed( 0 ), + mNASItemsProcessed( 0 ), + mWMSItemsProcessed( 0 ), + mPDSItemsProcessed( 0 ), + mCATItemsProcessed( 0 ), + mOMAItemsProcessed( 0 ), + mVoiceItemsProcessed( 0 ), + mpFNSessionState( 0 ), + mpFNByteTotals( 0 ), + mpFNDataCapabilities( 0 ), + mpFNDataBearer( 0 ), + mpFNDormancyStatus( 0 ), + mpFNMobileIPStatus( 0 ), + mpFNActivationStatus( 0 ), + mpFNPower( 0 ), + mpFNWirelessDisable( 0 ), + mpFNRoamingIndicator( 0 ), + mpFNSignalStrength( 0 ), + mpFNRFInfo( 0 ), + mpFNLUReject( 0 ), + mpPLMNMode( 0 ), + mpFNNewSMS( 0 ), + mpFNNewNMEA( 0 ), + mpFNPDSState( 0 ), + mpFNCATEvent( 0 ), + mpFNOMADMAlert( 0 ), + mpFNOMADMState( 0 ), + mpFNUSSDRelease( 0 ), + mpFNUSSDNotification( 0 ), + mpFNUSSDOrigination( 0 ) +{ + tServerConfig wdsSvr( eQMI_SVC_WDS, true ); + tServerConfig dmsSvr( eQMI_SVC_DMS, true ); + tServerConfig nasSvr( eQMI_SVC_NAS, true ); + tServerConfig wmsSvr( eQMI_SVC_WMS, true ); + tServerConfig pdsSvr( eQMI_SVC_PDS, true ); + tServerConfig catSvr( eQMI_SVC_CAT, false ); + tServerConfig rmsSvr( eQMI_SVC_RMS, false ); + tServerConfig omaSvr( eQMI_SVC_OMA, false ); + tServerConfig voiceSvr( eQMI_SVC_VOICE, false ); + mServerConfig.insert( wdsSvr ); + mServerConfig.insert( dmsSvr ); + mServerConfig.insert( nasSvr ); + mServerConfig.insert( wmsSvr ); + mServerConfig.insert( pdsSvr ); + mServerConfig.insert( catSvr ); + mServerConfig.insert( rmsSvr ); + mServerConfig.insert( omaSvr ); + mServerConfig.insert( voiceSvr ); +} + +/*=========================================================================== +METHOD: + ~cGobiConnectionMgmt (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmt::~cGobiConnectionMgmt() +{ + Disconnect(); +} + +/*=========================================================================== +METHOD: + ProcessTraffic (Internal Method) + +DESCRIPTION: + Process traffic in a QMI server protocol log, this is done to + exercise QMI indication related callbacks + +PARAMETERS: + svc [ I ] - QMI Service type + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessTraffic( eQMIService svc ) +{ + ULONG count = 0; + + switch (svc) + { + case eQMI_SVC_WDS: + { + cQMIProtocolServer * pWDS = GetServer( eQMI_SVC_WDS ); + if (pWDS != 0) + { + // Grab the WDS log from the server + const cProtocolLog & logWDS = pWDS->GetLog(); + + // New WDS items to process? + count = logWDS.GetCount(); + if (count != INVALID_LOG_INDEX && count > mWDSItemsProcessed) + { + for (ULONG i = mWDSItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logWDS.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_WDS_RX) ) + { + ProcessWDSBuffer( buf ); + } + } + + mWDSItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_DMS: + { + cQMIProtocolServer * pDMS = GetServer( eQMI_SVC_DMS ); + if (pDMS != 0) + { + // Grab the DMS log from the server + const cProtocolLog & logDMS = pDMS->GetLog(); + + // New DMS items to process? + count = logDMS.GetCount(); + if (count != INVALID_LOG_INDEX && count > mDMSItemsProcessed) + { + for (ULONG i = mDMSItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logDMS.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_DMS_RX) ) + { + ProcessDMSBuffer( buf ); + } + } + + mDMSItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_NAS: + { + cQMIProtocolServer * pNAS = GetServer( eQMI_SVC_NAS ); + if (pNAS != 0) + { + // Grab the NAS log from the server + const cProtocolLog & logNAS = pNAS->GetLog(); + + // New NAS items to process? + count = logNAS.GetCount(); + if (count != INVALID_LOG_INDEX && count > mNASItemsProcessed) + { + for (ULONG i = mNASItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logNAS.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_NAS_RX) ) + { + ProcessNASBuffer( buf ); + } + } + + mNASItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_WMS: + { + cQMIProtocolServer * pWMS = GetServer( eQMI_SVC_WMS ); + if (pWMS != 0) + { + // Grab the WMS log from the server + const cProtocolLog & logWMS = pWMS->GetLog(); + + // New WMS items to process? + count = logWMS.GetCount(); + if (count != INVALID_LOG_INDEX && count > mWMSItemsProcessed) + { + for (ULONG i = mWMSItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logWMS.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_WMS_RX) ) + { + ProcessWMSBuffer( buf ); + } + } + + mWMSItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_PDS: + { + cQMIProtocolServer * pPDS = GetServer( eQMI_SVC_PDS ); + if (pPDS != 0) + { + // Grab the PDS log from the server + const cProtocolLog & logPDS = pPDS->GetLog(); + + // New PDS items to process? + count = logPDS.GetCount(); + if (count != INVALID_LOG_INDEX && count > mPDSItemsProcessed) + { + for (ULONG i = mPDSItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logPDS.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_PDS_RX) ) + { + ProcessPDSBuffer( buf ); + } + } + + mPDSItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_CAT: + { + cQMIProtocolServer * pCAT = GetServer( eQMI_SVC_CAT ); + if (pCAT != 0) + { + // Grab the CAT log from the server + const cProtocolLog & logCAT = pCAT->GetLog(); + + // New CAT items to process? + count = logCAT.GetCount(); + if (count != INVALID_LOG_INDEX && count > mCATItemsProcessed) + { + for (ULONG i = mCATItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logCAT.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_CAT_RX) ) + { + ProcessCATBuffer( buf ); + } + } + + mCATItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_OMA: + { + cQMIProtocolServer * pOMA = GetServer( eQMI_SVC_OMA ); + if (pOMA != 0) + { + // Grab the OMA log from the server + const cProtocolLog & logOMA = pOMA->GetLog(); + + // New OMA items to process? + count = logOMA.GetCount(); + if (count != INVALID_LOG_INDEX && count > mOMAItemsProcessed) + { + for (ULONG i = mOMAItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logOMA.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_OMA_RX) ) + { + ProcessOMABuffer( buf ); + } + } + + mOMAItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_VOICE: + { + cQMIProtocolServer * pVoice = GetServer( eQMI_SVC_VOICE ); + if (pVoice != 0) + { + // Grab the voice log from the server + const cProtocolLog & logVoice = pVoice->GetLog(); + + // New voice items to process? + count = logVoice.GetCount(); + if (count != INVALID_LOG_INDEX && count > mVoiceItemsProcessed) + { + for (ULONG i = mVoiceItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logVoice.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_VOICE_RX) ) + { + ProcessVoiceBuffer( buf ); + } + } + + mVoiceItemsProcessed = count; + } + } + + break; + } + + default: + break; + } +} + +/*=========================================================================== +METHOD: + ProcessWDSBuffer (Internal Method) + +DESCRIPTION: + Process a WDS buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessWDSBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == eQMI_WDS_EVENT_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out data bearer technology + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_IND, msgID, 23 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + if (mpFNDataBearer != 0) + { + cDataBearerCallback * pCB = 0; + pCB = new cDataBearerCallback( mpFNDataBearer, pf[0].mValue.mU32 ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + + // Parse out dormancy status + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_IND, msgID, 24 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + if (mpFNDormancyStatus != 0) + { + cDormancyStatusCallback * pCB = 0; + pCB = new cDormancyStatusCallback( mpFNDormancyStatus, + pf[0].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + + // Parse out byte totals + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_IND, msgID, 25 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + ULONGLONG tx = pf[0].mValue.mU64; + ULONGLONG rx = ULLONG_MAX; + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_IND, msgID, 26 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + rx = pf[0].mValue.mU64; + } + + if (mpFNByteTotals != 0) + { + cByteTotalsCallback * pCB = 0; + pCB = new cByteTotalsCallback( mpFNByteTotals, tx, rx ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + // Parse out mobile IP status + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_IND, msgID, 27 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + if (mpFNMobileIPStatus != 0) + { + cMobileIPStatusCallback * pCB = 0; + pCB = new cMobileIPStatusCallback( mpFNMobileIPStatus, + pf[0].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } + else if (msgID == eQMI_WDS_PKT_STATUS_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out session status + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_IND, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + ULONG ss = pf[0].mValue.mU32; + ULONG cer = ULONG_MAX; + + // Parse out call end reason (if present) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_IND, msgID, 16 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + cer = pf[0].mValue.mU32; + } + + if (mpFNSessionState != 0) + { + cSessionStateCallback * pCB = 0; + pCB = new cSessionStateCallback( mpFNSessionState, ss, cer ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessDMSBuffer (Internal Method) + +DESCRIPTION: + Process a DMS buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessDMSBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == eQMI_DMS_EVENT_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out activation status + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_IND, msgID, 19 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1 && mpFNActivationStatus != 0) + { + cActivationStatusCallback * pCB = 0; + pCB = new cActivationStatusCallback( mpFNActivationStatus, + pf[0].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + + // Parse out operating mode + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_IND, msgID, 20 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1 && mpFNPower != 0) + { + cPowerCallback * pCB = 0; + pCB = new cPowerCallback( mpFNPower, pf[0].mValue.mU32 ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + + // Parse out wireless disable state + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_IND, msgID, 22 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1 && mpFNWirelessDisable != 0) + { + cWirelessDisableCallback * pCB = 0; + pCB = new cWirelessDisableCallback( mpFNWirelessDisable, + pf[0].mValue.mU32 ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessNASBuffer (Internal Method) + +DESCRIPTION: + Process a NAS buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessNASBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_NAS_EVENT_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse signal strength + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 2) + { + INT8 sigVal = pf[0].mValue.mS8; + ULONG radioVal = pf[1].mValue.mU32; + bool bValidSig = (sigVal <= -30 && sigVal > -125 && radioVal != 0); + + if (bValidSig == true && mpFNSignalStrength != 0) + { + cSignalStrengthCallback * pCB = 0; + pCB = new cSignalStrengthCallback( mpFNSignalStrength, + pf[0].mValue.mS8, + pf[1].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + + // Parse out RF info + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_NAS_IND, msgID, 17 ); + cDataParser::tParsedFields pf2 = ParseTLV( mDB, buf, tlvs, tlvKey2 ); + + ULONG fieldCount = (ULONG)pf2.size(); + if (fieldCount >= 1 && mpFNRFInfo != 0) + { + BYTE ifaceCount = pf2[0].mValue.mU8; + if (fieldCount >= 1 + ((ULONG)ifaceCount * 3)) + { + for (BYTE i = 0; i < ifaceCount; i++) + { + ULONG offset = 3 * (ULONG)i; + + cRFInfoCallback * pCB = 0; + pCB = new cRFInfoCallback( mpFNRFInfo, + pf2[offset + 1].mValue.mU32, + pf2[offset + 2].mValue.mU32, + (ULONG)pf2[offset + 3].mValue.mU16 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } + + // Parse out LU reject + sProtocolEntityKey tlvKey3( eDB2_ET_QMI_NAS_IND, msgID, 18 ); + cDataParser::tParsedFields pf3 = ParseTLV( mDB, buf, tlvs, tlvKey3 ); + if (pf3.size() >= 2 && mpFNLUReject != 0) + { + cLURejectCallback * pCB = 0; + pCB = new cLURejectCallback( mpFNLUReject, + pf3[0].mValue.mU32, + (ULONG)pf3[1].mValue.mU16 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + + } + else if (msgID == (ULONG)eQMI_NAS_SS_INFO_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out roaming indicator + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_NAS_IND, msgID, 16 ); + cDataParser::tParsedFields pf1 = ParseTLV( mDB, buf, tlvs, tlvKey1 ); + if (pf1.size() >= 1) + { + if (mpFNRoamingIndicator != 0) + { + cRoamingIndicatorCallback * pCB = 0; + pCB = new cRoamingIndicatorCallback( mpFNRoamingIndicator, + pf1[0].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + + // Parse out data capabilities + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_NAS_IND, msgID, 17 ); + cDataParser::tParsedFields pf2 = ParseTLV( mDB, buf, tlvs, tlvKey2 ); + if (pf2.size() >= 1) + { + BYTE activeDataCaps = pf2[0].mValue.mU8; + if (pf2.size() >= 1 + (ULONG)activeDataCaps) + { + ULONG caps[12] = { 0 }; + if (activeDataCaps > 12) + { + activeDataCaps = 12; + } + + for (ULONG d = 0; d < activeDataCaps; d++) + { + caps[d] = pf2[1 + d].mValue.mU32; + } + + if (mpFNDataCapabilities != 0) + { + cDataCapabilitiesCallback * pCB = 0; + pCB = new cDataCapabilitiesCallback( mpFNDataCapabilities, + activeDataCaps, + &caps[0] ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } + } + else if (msgID == (ULONG)eQMI_NAS_PLMN_MODE_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse PLMN mode + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + cPLMNModeCallback * pCB = 0; + pCB = new cPLMNModeCallback( mpPLMNMode, + (ULONG)pf[0].mValue.mU8 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessWMSBuffer (Internal Method) + +DESCRIPTION: + Process a WDS buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessWMSBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_WMS_EVENT_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out message details + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 2) + { + if (mpFNNewSMS != 0) + { + cNewSMSCallback * pCB = 0; + pCB = new cNewSMSCallback( mpFNNewSMS, + pf[0].mValue.mU32, + pf[1].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessPDSBuffer (Internal Method) + +DESCRIPTION: + Process a PDS buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessPDSBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_PDS_EVENT_IND) + { + // Prepare TLVs for extraction + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1 && mpFNNewNMEA != 0) + { + cNewNMEACallback * pCB = 0; + pCB = new cNewNMEACallback( mpFNNewNMEA, pf[0].mValueString ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + else if (msgID == (ULONG)eQMI_PDS_STATE_IND) + { + // Prepare TLVs for extraction + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out message details + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_IND, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 2 && mpFNPDSState != 0) + { + cPDSStateCallback * pCB = 0; + pCB = new cPDSStateCallback( mpFNPDSState, + pf[0].mValue.mU32, + pf[1].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessCATBuffer (Internal Method) + +DESCRIPTION: + Process a CAT buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessCATBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_CAT_EVENT_IND && mpFNCATEvent != 0) + { + // Prepare TLVs for extraction + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + ULONG tlvCount = (ULONG)tlvs.size(); + for (ULONG t = 0; t < tlvCount; t++) + { + const sDB2NavInput tlv = tlvs[t]; + if (tlv.mKey.size() == 3) + { + cCATEventCallback * pCB = 0; + pCB = new cCATEventCallback( mpFNCATEvent, + tlv.mKey[2], + tlv.mPayloadLen, + tlv.mpPayload ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessOMABuffer (Internal Method) + +DESCRIPTION: + Process an OMA buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessOMABuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_OMA_EVENT_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out NIA + sProtocolEntityKey tlvKey( eDB2_ET_QMI_OMA_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 2) + { + if (mpFNOMADMAlert != 0) + { + cOMADMAlertCallback * pCB = 0; + pCB = new cOMADMAlertCallback( mpFNOMADMAlert, + pf[0].mValue.mU32, + pf[1].mValue.mU16 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + + // Parse out failure reason (may not be present) + ULONG failureReason = ULONG_MAX; + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_OMA_IND, msgID, 18 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + failureReason = pf[0].mValue.mU32; + } + + // Parse out state + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_OMA_IND, msgID, 17 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + if (mpFNOMADMState != 0) + { + cOMADMStateCallback * pCB = 0; + pCB = new cOMADMStateCallback( mpFNOMADMState, + pf[0].mValue.mU32, + failureReason ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessVoiceBuffer (Internal Method) + +DESCRIPTION: + Process a voice buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessVoiceBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_VOICE_USSD_RELEASE_IND && mpFNUSSDRelease != 0) + { + cUSSDReleaseCallback * pCB = 0; + pCB = new cUSSDReleaseCallback( mpFNUSSDRelease ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + + } + else if (msgID == (ULONG)eQMI_VOICE_USSD_IND && mpFNUSSDNotification != 0) + { + // Prepare TLVs for extraction + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + std::map tlvMap; + tlvMap = qmiBuf.GetContents(); + + // Parse out message details + sProtocolEntityKey tlvKey( eDB2_ET_QMI_VOICE_IND, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + const BYTE * pUSSData = 0; + + std::map ::const_iterator pIter; + pIter = tlvMap.find( 16 ); + if (pIter != tlvMap.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG len = (ULONG)pHdr->mLength; + if (len >= (ULONG)2) + { + const BYTE * pData = (const BYTE *)++pHdr; + if (len >= (ULONG)pData[1] + (ULONG)2) + { + pUSSData = pData; + } + } + } + + cUSSDNotificationCallback * pCB = 0; + pCB = new cUSSDNotificationCallback( mpFNUSSDNotification, + pf[0].mValue.mU32, + pUSSData ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + else if ( (msgID == (ULONG)eQMI_VOICE_ASYNC_USSD_IND) + && (mpFNUSSDOrigination != 0) ) + { + // Prepare TLVs for extraction + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + std::map tlvMap; + tlvMap = qmiBuf.GetContents(); + + ULONG ec = ULONG_MAX; + ULONG fc = ULONG_MAX; + + // Parse out message details + sProtocolEntityKey tlvKey( eDB2_ET_QMI_VOICE_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + ec = pf[0].mValue.mU32; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_VOICE_IND, msgID, 17 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + fc = pf[0].mValue.mU32; + } + + const BYTE * pNetworkInfo = 0; + + std::map ::const_iterator pIter; + pIter = tlvMap.find( 18 ); + if (pIter != tlvMap.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG len = (ULONG)pHdr->mLength; + if (len >= (ULONG)2) + { + const BYTE * pData = (const BYTE *)++pHdr; + if (len >= (ULONG)pData[1] + (ULONG)2) + { + pNetworkInfo = pData; + } + } + } + + const BYTE * pAlpha = 0; + + pIter = tlvMap.find( 19 ); + if (pIter != tlvMap.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG len = (ULONG)pHdr->mLength; + if (len >= (ULONG)2) + { + const BYTE * pData = (const BYTE *)++pHdr; + if (len >= (ULONG)pData[1] + (ULONG)2) + { + pAlpha = pData; + } + } + } + + + cUSSDOriginationCallback * pCB = 0; + pCB = new cUSSDOriginationCallback( mpFNUSSDOrigination, + ec, + fc, + pNetworkInfo, + pAlpha ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified (or first detected) Gobi device + +PARAMETERS: + pDeviceNode [ I ] - The device node + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiConnectionMgmt::Connect( + LPCSTR pDeviceNode, + LPCSTR pDeviceKey ) +{ + // Assume failure + bool bRC = cGobiQMICore::Connect( pDeviceNode, pDeviceKey ); + if (bRC == true) + { + // Clear mExitEvent; + mExitEvent.Clear(); + + pthread_create( &mThreadID, + NULL, + TrafficProcessThread, + this ); + + mbThreadStarted = true; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the currently connected Gobi device + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiConnectionMgmt::Disconnect() +{ + // Clear all callback function pointers (no need to turn them off at + // the device as we are about to tear-down each QMI service client) + mpFNSessionState = 0; + mpFNByteTotals = 0; + mpFNDataCapabilities = 0; + mpFNDataBearer = 0; + mpFNDormancyStatus = 0; + mpFNMobileIPStatus = 0; + mpFNActivationStatus = 0; + mpFNPower = 0; + mpFNWirelessDisable = 0; + mpFNRoamingIndicator = 0; + mpFNSignalStrength = 0; + mpFNRFInfo = 0; + mpFNLUReject = 0; + mpPLMNMode = 0; + mpFNNewSMS = 0; + mpFNNewNMEA = 0; + mpFNPDSState = 0; + mpFNCATEvent = 0; + mpFNOMADMAlert = 0; + mpFNOMADMState = 0; + mpFNUSSDRelease = 0; + mpFNUSSDNotification = 0; + mpFNUSSDOrigination = 0; + + // Exit traffic processing thread + if (mbThreadStarted == true) + { + // Signal thread to exit + mExitEvent.Set( 0 ); + + // If we are not being called from the thread itself then wait for + // it to exit, if not then it will have to exit automatically + if (pthread_self() != mThreadID) + { + if (mThreadID != 0) + { + pthread_join( mThreadID, NULL ); + } + } + } + + // Clear out thread handle/ID + mbThreadStarted = false; + mThreadID = 0; + + bool bRC = cGobiQMICore::Disconnect(); + + // Servers reset server logs so we need to reset our counters + mWDSItemsProcessed = 0; + mDMSItemsProcessed = 0; + mNASItemsProcessed = 0; + mWMSItemsProcessed = 0; + mPDSItemsProcessed = 0; + mCATItemsProcessed = 0; + mOMAItemsProcessed = 0; + mVoiceItemsProcessed = 0; + + return bRC; +} + +/*=========================================================================== +METHOD: + SetSessionStateCallback (Public Method) + +DESCRIPTION: + Enable/disable session state callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetSessionStateCallback( + tFNSessionState pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNSessionState = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetByteTotalsCallback + +DESCRIPTION: + This function enables/disables the RX/TX byte counts callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + interval [ I ] - Interval in seconds (ignored when disabling) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetByteTotalsCallback( + tFNByteTotals pCallback, + BYTE interval ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNByteTotals == 0); + bool bOff = (pCallback == 0 && mpFNByteTotals != 0); + bool bReplace = (pCallback != 0 && mpFNByteTotals != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_WDS; + WORD msgID = (WORD)eQMI_WDS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + + if (bOn == true) + { + std::ostringstream tmp; + tmp << (ULONG)interval << " 0 0 0 0 0 0 1 1"; + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0 0 0 0 0 0 0 0 0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNByteTotals = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNByteTotals = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetDataCapabilitiesCallback (Public Method) + +DESCRIPTION: + Enables/disables the serving system data capabilities callback + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Corrected error code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetDataCapabilitiesCallback( + tFNDataCapabilities pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNDataCapabilities = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetDataBearerCallback (Public Method) + +DESCRIPTION: + Enable/disable data bearer callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return cod +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetDataBearerCallback( + tFNDataBearer pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNDataBearer == 0); + bool bOff = (pCallback == 0 && mpFNDataBearer != 0); + bool bReplace = (pCallback != 0 && mpFNDataBearer != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_WDS; + WORD msgID = (WORD)eQMI_WDS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 18 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNDataBearer = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNDataBearer = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetDormancyStatusCallback (Public Method) + +DESCRIPTION: + Enable/disable dormancy status callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetDormancyStatusCallback( + tFNDormancyStatus pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNDormancyStatus == 0); + bool bOff = (pCallback == 0 && mpFNDormancyStatus != 0); + bool bReplace = (pCallback != 0 && mpFNDormancyStatus != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_WDS; + WORD msgID = (WORD)eQMI_WDS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 19 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNDormancyStatus = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNDormancyStatus = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetMobileIPStatusCallback (Public Method) + +DESCRIPTION: + Enable/disable mobile IP status callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetMobileIPStatusCallback( + tFNMobileIPStatus pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNMobileIPStatus == 0); + bool bOff = (pCallback == 0 && mpFNMobileIPStatus != 0); + bool bReplace = (pCallback != 0 && mpFNMobileIPStatus != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_WDS; + WORD msgID = (WORD)eQMI_WDS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 20 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNMobileIPStatus = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNMobileIPStatus = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetActivationStatusCallback (Public Method) + +DESCRIPTION: + Enable/disable activation status callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetActivationStatusCallback( + tFNActivationStatus pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNActivationStatus == 0); + bool bOff = (pCallback == 0 && mpFNActivationStatus != 0); + bool bReplace = (pCallback != 0 && mpFNActivationStatus != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_DMS; + WORD msgID = (WORD)eQMI_DMS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 19 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNActivationStatus = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNActivationStatus = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetPowerCallback (Public Method) + +DESCRIPTION: + Enable/disable power operating mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetPowerCallback( + tFNPower pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNPower == 0); + bool bOff = (pCallback == 0 && mpFNPower != 0); + bool bReplace = (pCallback != 0 && mpFNPower != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_DMS; + WORD msgID = (WORD)eQMI_DMS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 20 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNPower = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNPower = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetWirelessDisableCallback (Public Method) + +DESCRIPTION: + Enable/disable wireless disable state callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetWirelessDisableCallback( + tFNWirelessDisable pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNWirelessDisable == 0); + bool bOff = (pCallback == 0 && mpFNWirelessDisable != 0); + bool bReplace = (pCallback != 0 && mpFNWirelessDisable != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_DMS; + WORD msgID = (WORD)eQMI_DMS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 22 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNWirelessDisable = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNWirelessDisable = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetRoamingIndicatorCallback (Public Method) + +DESCRIPTION: + Enable/disable roaming indicator callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Corrected error code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetRoamingIndicatorCallback( + tFNRoamingIndicator pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNRoamingIndicator = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetSignalStrengthCallback (Public Method) + +DESCRIPTION: + Enable/disable signal strength callback function + +PARAMETERS: + pCallback [ I ] - Callback function + thresholds [ I ] - Desired threholds (only valid when enabling) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetSignalStrengthCallback( + tFNSignalStrength pCallback, + std::list thresholds ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Grab number of thresholds + ULONG thresholdCount = (ULONG)thresholds.size(); + + // Validate arguments versus what is changing + bool bOn = (pCallback != 0 && mpFNSignalStrength == 0); + if (bOn == true && thresholdCount == 0) + { + rc = eGOBI_ERR_INVALID_ARG; + return rc; + } + + bool bOff = (pCallback == 0 && mpFNSignalStrength != 0); + if (bOff == true && thresholdCount != 0) + { + rc = eGOBI_ERR_INVALID_ARG; + return rc; + } + + bool bReplace = (pCallback != 0 && mpFNSignalStrength != 0); + if (bReplace == true && thresholdCount == 0) + { + rc = eGOBI_ERR_INVALID_ARG; + return rc; + } + + eQMIService svc = eQMI_SVC_NAS; + WORD msgID = (WORD)eQMI_NAS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 16 ); + + if (bOn == true || bOff == true || bReplace == true) + { + if (bOn == true || bReplace == true) + { + std::ostringstream args; + args << "1 " << (UINT)thresholdCount; + + std::list ::const_iterator pThreshold = thresholds.begin(); + while (pThreshold != thresholds.end()) + { + INT8 t = *pThreshold++; + + args << " " << (INT)t; + } + + sDB2PackingInput pi( pek, (LPCSTR)args.str().c_str() ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0 0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true || bReplace == true) + { + mpFNSignalStrength = pCallback; + } + } + else + { + // Turning it off redundantly + if (thresholdCount != 0) + { + rc = eGOBI_ERR_INVALID_ARG; + } + else + { + rc = eGOBI_ERR_NONE; + } + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetRFInfoCallback (Public Method) + +DESCRIPTION: + Enable/disable RF information callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetRFInfoCallback( tFNRFInfo pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Validate arguments versus what is changing + bool bOn = (pCallback != 0 && mpFNRFInfo == 0); + bool bOff = (pCallback == 0 && mpFNRFInfo != 0); + bool bReplace = (pCallback != 0 && mpFNRFInfo != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_NAS; + WORD msgID = (WORD)eQMI_NAS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 17 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNRFInfo = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNRFInfo = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetLURejectCallback (Public Method) + +DESCRIPTION: + Enable/disable LU reject callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetLURejectCallback( tFNLUReject pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Validate arguments versus what is changing + bool bOn = (pCallback != 0 && mpFNLUReject == 0); + bool bOff = (pCallback == 0 && mpFNLUReject != 0); + bool bReplace = (pCallback != 0 && mpFNLUReject != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_NAS; + WORD msgID = (WORD)eQMI_NAS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 18 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNLUReject = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNLUReject = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetPLMNModeCallback (Public Method) + +DESCRIPTION: + Enable/disable PLMN mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetPLMNModeCallback( tFNPLMNMode pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpPLMNMode = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetNewSMSCallback (Public Method) + +DESCRIPTION: + Enable/disable new SMS callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetNewSMSCallback( tFNNewSMS pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNNewSMS == 0); + bool bOff = (pCallback == 0 && mpFNNewSMS != 0); + bool bReplace = (pCallback != 0 && mpFNNewSMS != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_WMS; + WORD msgID = (WORD)eQMI_WMS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 16 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNNewSMS = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNNewSMS = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetNMEACallback (Public Method) + +DESCRIPTION: + Enable/disable new NMEA sentence function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetNMEACallback( tFNNewNMEA pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNNewNMEA == 0); + bool bOff = (pCallback == 0 && mpFNNewNMEA != 0); + bool bReplace = (pCallback != 0 && mpFNNewNMEA != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_PDS; + WORD msgID = (WORD)eQMI_PDS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 16 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNNewNMEA = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNNewNMEA = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetPDSStateCallback (Public Method) + +DESCRIPTION: + Enable/disable PDS service state callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetPDSStateCallback( tFNPDSState pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNPDSState = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetCATEventCallback (Public Method) + +DESCRIPTION: + This function enables/disables the CAT event callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + eventMask [ I ] - Bitmask of CAT events to register for + pErrorMask [ O ] - Error bitmask + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetCATEventCallback( + tFNCATEvent pCallback, + ULONG eventMask, + ULONG * pErrorMask ) +{ + // Assume failure + eGobiError retCode = eGOBI_ERR_GENERAL; + *pErrorMask = ULONG_MAX; + + // Validate arguments versus what is changing + bool bOn = (pCallback != 0 && mpFNCATEvent == 0); + bool bOff = (pCallback == 0 && mpFNCATEvent != 0); + bool bReplace = (pCallback != 0 && mpFNCATEvent != 0); + if (bOn == true || bOff == true || bReplace == true) + { + const ULONG szTLVHdr = (ULONG)sizeof( sQMIRawContentHeader ); + const ULONG szData = (ULONG)sizeof( ULONG ); + BYTE buf[szTLVHdr + szData]; + + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)&buf[0]; + pTLV->mTypeID = 16; + pTLV->mLength = (WORD)szData; + + ULONG * pData = (ULONG *)&buf[szTLVHdr]; + + *pData = eventMask; + + if (bOff == true) + { + // Ignore event mask argument when disabling the callback + *pData = 0; + + // We also always clear the callback regardless of the response + mpFNCATEvent = pCallback; + } + + sSharedBuffer * pReq = 0; + pReq = sQMIServiceBuffer::BuildBuffer( eQMI_SVC_CAT, + (WORD)eQMI_CAT_SET_EVENT, + false, + false, + &buf[0], + szTLVHdr + szData ); + + sProtocolBuffer rsp = Send( eQMI_SVC_CAT, pReq ); + if (rsp.IsValid() == false) + { + retCode = GetCorrectedLastError(); + return retCode; + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + retCode = eGOBI_ERR_MALFORMED_RSP; + return retCode; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + retCode = eGOBI_ERR_MALFORMED_RSP; + return retCode; + } + else if (rc != 0) + { + // Parse out the error mask? + if (qmiRsp.GetMessageID() == (ULONG)eQMI_CAT_SET_EVENT) + { + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 16 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + if (pHdr->mLength > 4) + + { + pData = (ULONG *)++pHdr; + *pErrorMask = *pData; + } + } + } + + retCode = GetCorrectedQMIError( ec ); + return retCode; + } + + // Success! + mpFNCATEvent = pCallback; + retCode = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + retCode = eGOBI_ERR_NONE; + } + + return retCode; +} + +/*=========================================================================== +METHOD: + SetOMADMAlertCallback (Public Method) + +DESCRIPTION: + This function enables/disables the OMA-DM network initiated alert + callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetOMADMAlertCallback( + tFNOMADMAlert pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNOMADMAlert == 0); + bool bOff = (pCallback == 0 && mpFNOMADMAlert != 0); + bool bReplace = (pCallback != 0 && mpFNOMADMAlert != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_OMA; + WORD msgID = (WORD)eQMI_OMA_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 16 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNOMADMAlert = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNOMADMAlert = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetOMADMStateCallback (Public Method) + +DESCRIPTION: + This function enables/disables the OMA-DM state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetOMADMStateCallback( tFNOMADMState pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNOMADMState == 0); + bool bOff = (pCallback == 0 && mpFNOMADMState != 0); + bool bReplace = (pCallback != 0 && mpFNOMADMState != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_OMA; + WORD msgID = (WORD)eQMI_OMA_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 17 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNOMADMState = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNOMADMState = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetUSSDReleaseCallback (Public Method) + +DESCRIPTION: + Enable/disable USSD release callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetUSSDReleaseCallback( + tFNUSSDRelease pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNUSSDRelease = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetUSSDNotificationCallback (Public Method) + +DESCRIPTION: + Enable/disable USSD notification callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetUSSDNotificationCallback( + tFNUSSDNotification pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNUSSDNotification = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetUSSDOriginationCallback (Public Method) + +DESCRIPTION: + Enable/disable USSD origination callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetUSSDOriginationCallback( + tFNUSSDOrigination pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNUSSDOrigination = pCallback; + return eGOBI_ERR_NONE; +} + diff --git a/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.h b/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.h new file mode 100755 index 0000000..e92cbcf --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.h @@ -0,0 +1,1370 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmt.h + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + cGobiConnectionMgmtDLL + cGobiConnectionMgmt + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiQMICore.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +extern "C" +{ + +// Session state callback function +typedef void (* tFNSessionState)( +ULONG state, +ULONG sessionEndReason ); + +// RX/TX byte counts callback function +typedef void (* tFNByteTotals)( +ULONGLONG totalBytesTX, +ULONGLONG totalBytesRX ); + +// Dormancy status callback function +typedef void (* tFNDormancyStatus)( ULONG dormancyStatus ); + +// Mobile IP status callback function +typedef void (* tFNMobileIPStatus)( ULONG mipStatus ); + +// Activation status callback function +typedef void (* tFNActivationStatus)( ULONG activationStatus ); + +// Power operating mode callback function +typedef void (* tFNPower)( ULONG operatingMode ); + +// Wireless disable callback function +typedef void (* tFNWirelessDisable)( ULONG bState ); + +// Serving system data capabilities callback function +typedef void (* tFNDataCapabilities)( +BYTE dataCapsSize, +BYTE * pDataCaps ); + +// Data bearer technology callback function +typedef void (* tFNDataBearer)( ULONG dataBearer ); + +// Roaming indicator callback function +typedef void (* tFNRoamingIndicator)( ULONG roaming ); + +// Signal strength callback function +typedef void (* tFNSignalStrength)( +INT8 signalStrength, +ULONG radioInterface ); + +// RF information callback function +typedef void (* tFNRFInfo)( +ULONG radioInterface, +ULONG activeBandClass, +ULONG activeChannel ); + +// LU reject callback function +typedef void (* tFNLUReject)( +ULONG serviceDomain, +ULONG rejectCause ); + +// PLMN mode callback function +typedef void (* tFNPLMNMode)( ULONG mode ); + +// New SMS message callback function +typedef void (* tFNNewSMS)( +ULONG storageType, +ULONG messageIndex ); + +// New NMEA sentence callback function +typedef void (* tFNNewNMEA)( LPCSTR pNMEA ); + +// PDS session state callback function +typedef void (* tFNPDSState)( +ULONG enabledStatus, +ULONG trackingStatus ); + +// CAT event callback function +typedef void (* tFNCATEvent)( +ULONG eventID, +ULONG eventLen, +BYTE * pEventData ); + +// OMA-DM network initiated alert callback function +typedef void (* tFNOMADMAlert)( + ULONG sessionType, + USHORT sessionID ); + +// OMA-DM state callback function +typedef void (* tFNOMADMState)( + ULONG sessionState, + ULONG failureReason ); + +// USSD release callback function +typedef void (* tFNUSSDRelease)(); + +// USSD notification callback function +typedef void (* tFNUSSDNotification)( + ULONG type, + BYTE * pNetworkInfo ); + +// USSD origination callback function +typedef void (* tFNUSSDOrigination)( + ULONG errorCode, + ULONG failureCause, + BYTE * pNetworkInfo, + BYTE * pAlpha ); + +}; + +// CallbackThread prototype +// Thread to execute a callback asynchronously +void * CallbackThread( PVOID pArg ); + +/*=========================================================================*/ +// Class cGobiCMCallback +/*=========================================================================*/ +class cGobiCMCallback +{ + public: + // (Inline) Constructor + cGobiCMCallback() + { }; + + // (Inline) Destructor + virtual ~cGobiCMCallback() + { }; + + // (Inline) Initialize the callback object by starting the thread + bool Initialize() + { + // Start the thread + pthread_t threadID; + pthread_attr_t attributes; + pthread_attr_init( &attributes ); + pthread_attr_setdetachstate( &attributes, PTHREAD_CREATE_DETACHED ); + + int nRC = pthread_create( &threadID, + &attributes, + CallbackThread, + this ); + + if (nRC == 0) + { + // Success! + return true; + } + + return false; + }; + + protected: + // Call the function + virtual void Call() = 0; + + // Function thread gets full access + friend void * CallbackThread( PVOID pArg ); +}; + +/*=========================================================================*/ +// Class cSessionStateCallback +/*=========================================================================*/ +class cSessionStateCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cSessionStateCallback( + tFNSessionState pCallback, + ULONG state, + ULONG sessionEndReason ) + : mpCallback( pCallback ), + mState( state ), + mSessionEndReason( sessionEndReason ) + { }; + + // (Inline) Destructor + virtual ~cSessionStateCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mState, mSessionEndReason ); + } + }; + + /* Callback function */ + tFNSessionState mpCallback; + + /* Callback arguments */ + ULONG mState; + ULONG mSessionEndReason; +}; + +/*=========================================================================*/ +// Class cByteTotalsCallback +/*=========================================================================*/ +class cByteTotalsCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cByteTotalsCallback( + tFNByteTotals pCallback, + ULONGLONG totalBytesTX, + ULONGLONG totalBytesRX ) + : mpCallback( pCallback ), + mTotalBytesTX( totalBytesTX ), + mTotalBytesRX( totalBytesRX ) + { }; + + // (Inline) Destructor + virtual ~cByteTotalsCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mTotalBytesTX, mTotalBytesRX ); + } + }; + + /* Callback function */ + tFNByteTotals mpCallback; + + /* Callback arguments */ + ULONGLONG mTotalBytesTX; + ULONGLONG mTotalBytesRX; +}; + +/*=========================================================================*/ +// Class cDormancyStatusCallback +/*=========================================================================*/ +class cDormancyStatusCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cDormancyStatusCallback( + tFNDormancyStatus pCallback, + ULONG dormancyStatus ) + : mpCallback( pCallback ), + mDormancyStatus( dormancyStatus ) + { }; + + // (Inline) Destructor + virtual ~cDormancyStatusCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mDormancyStatus ); + } + }; + + /* Callback function */ + tFNDormancyStatus mpCallback; + + /* Callback arguments */ + ULONG mDormancyStatus; +}; + +/*=========================================================================*/ +// Class cMobileIPStatusCallback +/*=========================================================================*/ +class cMobileIPStatusCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cMobileIPStatusCallback( + tFNMobileIPStatus pCallback, + ULONG mobileIPStatus ) + : mpCallback( pCallback ), + mMobileIPStatus( mobileIPStatus ) + { }; + + // (Inline) Destructor + virtual ~cMobileIPStatusCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mMobileIPStatus ); + } + }; + + /* Callback function */ + tFNMobileIPStatus mpCallback; + + /* Callback arguments */ + ULONG mMobileIPStatus; +}; + +/*=========================================================================*/ +// Class cActivationStatusCallback +/*=========================================================================*/ +class cActivationStatusCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cActivationStatusCallback( + tFNActivationStatus pCallback, + ULONG activationStatus ) + : mpCallback( pCallback ), + mActivationStatus( activationStatus ) + { }; + + // (Inline) Destructor + virtual ~cActivationStatusCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mActivationStatus ); + } + }; + + /* Callback function */ + tFNActivationStatus mpCallback; + + /* Callback arguments */ + ULONG mActivationStatus; +}; + +/*=========================================================================*/ +// Class cPowerCallback +/*=========================================================================*/ +class cPowerCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cPowerCallback( + tFNPower pCallback, + ULONG operatingMode ) + : mpCallback( pCallback ), + mOperatingMode( operatingMode ) + { }; + + // (Inline) Destructor + virtual ~cPowerCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mOperatingMode ); + } + }; + + /* Callback function */ + tFNPower mpCallback; + + /* Callback arguments */ + ULONG mOperatingMode; +}; + +/*=========================================================================*/ +// Class cWirelessDisableCallback +/*=========================================================================*/ +class cWirelessDisableCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cWirelessDisableCallback( + tFNWirelessDisable pCallback, + ULONG bState ) + : mpCallback( pCallback ), + mbState( bState ) + { }; + + // (Inline) Destructor + virtual ~cWirelessDisableCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mbState ); + } + }; + + /* Callback function */ + tFNWirelessDisable mpCallback; + + /* Callback arguments */ + ULONG mbState; +}; + +/*=========================================================================*/ +// Class cDataCapabilitiesCallback +/*=========================================================================*/ +class cDataCapabilitiesCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cDataCapabilitiesCallback( + tFNDataCapabilities pCallback, + BYTE dataCapsSize, + ULONG * pDataCaps ) + : mpCallback( pCallback ), + mDataCapsSize( dataCapsSize ) + { + memset( (LPVOID)&mDataCaps[0], 0, 12 * sizeof( ULONG ) ); + + if (mDataCapsSize > 12) + { + mDataCapsSize = 12; + } + + for (ULONG d = 0; d < mDataCapsSize; d++) + { + mDataCaps[d] = pDataCaps[d]; + } + }; + + // (Inline) Destructor + virtual ~cDataCapabilitiesCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mDataCapsSize, (BYTE *)&mDataCaps[0] ); + } + }; + + /* Callback function */ + tFNDataCapabilities mpCallback; + + /* Callback arguments */ + BYTE mDataCapsSize; + ULONG mDataCaps[12]; +}; + +/*=========================================================================*/ +// Class cDataBearerCallback +/*=========================================================================*/ +class cDataBearerCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cDataBearerCallback( + tFNDataBearer pCallback, + ULONG dataBearer ) + : mpCallback( pCallback ), + mDataBearer( dataBearer ) + { }; + + // (Inline) Destructor + virtual ~cDataBearerCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mDataBearer ); + } + }; + + /* Callback function */ + tFNDataBearer mpCallback; + + /* Callback arguments */ + ULONG mDataBearer; +}; + +/*=========================================================================*/ +// Class cRoamingIndicatorCallback +/*=========================================================================*/ +class cRoamingIndicatorCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cRoamingIndicatorCallback( + tFNRoamingIndicator pCallback, + ULONG roaming ) + : mpCallback( pCallback ), + mRoaming( roaming ) + { }; + + // (Inline) Destructor + virtual ~cRoamingIndicatorCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mRoaming ); + } + }; + + /* Callback function */ + tFNRoamingIndicator mpCallback; + + /* Callback arguments */ + ULONG mRoaming; +}; + +/*=========================================================================*/ +// Class cSignalStrengthCallback +/*=========================================================================*/ +class cSignalStrengthCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cSignalStrengthCallback( + tFNSignalStrength pCallback, + INT8 signalStrength, + ULONG radioInterface ) + : mpCallback( pCallback ), + mSignalStrength( signalStrength ), + mRadioInterface( radioInterface ) + { }; + + // (Inline) Destructor + virtual ~cSignalStrengthCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mSignalStrength, mRadioInterface ); + } + }; + + /* Callback function */ + tFNSignalStrength mpCallback; + + /* Callback arguments */ + INT8 mSignalStrength; + ULONG mRadioInterface; +}; + +/*=========================================================================*/ +// Class cRFInfoCallback +/*=========================================================================*/ +class cRFInfoCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cRFInfoCallback( + tFNRFInfo pCallback, + ULONG radioInterface, + ULONG activeBandClass, + ULONG activeChannel ) + : mpCallback( pCallback ), + mRadioInterface( radioInterface ), + mActiveBandClass( activeBandClass ), + mActiveChannel( activeChannel ) + { }; + + // (Inline) Destructor + virtual ~cRFInfoCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mRadioInterface, mActiveBandClass, mActiveChannel ); + } + }; + + /* Callback function */ + tFNRFInfo mpCallback; + + /* Callback arguments */ + ULONG mRadioInterface; + ULONG mActiveBandClass; + ULONG mActiveChannel; +}; + +/*=========================================================================*/ +// Class cLURejectCallback +/*=========================================================================*/ +class cLURejectCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cLURejectCallback( + tFNLUReject pCallback, + ULONG serviceDomain, + ULONG rejectCause ) + : mpCallback( pCallback ), + mServiceDomain( serviceDomain ), + mRejectCause( rejectCause ) + { }; + + // (Inline) Destructor + virtual ~cLURejectCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mServiceDomain, mRejectCause ); + } + }; + + /* Callback function */ + tFNLUReject mpCallback; + + /* Callback arguments */ + ULONG mServiceDomain; + ULONG mRejectCause; +}; + +/*=========================================================================*/ +// Class cPLMNModeCallback +/*=========================================================================*/ +class cPLMNModeCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cPLMNModeCallback( + tFNPLMNMode pCallback, + ULONG mode ) + : mpCallback( pCallback ), + mMode( mode ) + { }; + + // (Inline) Destructor + virtual ~cPLMNModeCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mMode ); + } + }; + + /* Callback function */ + tFNPLMNMode mpCallback; + + /* Callback arguments */ + ULONG mMode; +}; + +/*=========================================================================*/ +// Class cNewSMSCallback +/*=========================================================================*/ +class cNewSMSCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cNewSMSCallback( + tFNNewSMS pCallback, + ULONG storageType, + ULONG messageIndex ) + : mpCallback( pCallback ), + mStorageType( storageType ), + mMessageIndex( messageIndex ) + { }; + + // (Inline) Destructor + virtual ~cNewSMSCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mStorageType, mMessageIndex ); + } + }; + + /* Callback function */ + tFNNewSMS mpCallback; + + /* Callback arguments */ + ULONG mStorageType; + ULONG mMessageIndex; +}; + +/*=========================================================================*/ +// Class cNewNMEACallback +/*=========================================================================*/ +class cNewNMEACallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cNewNMEACallback( + tFNNewNMEA pCallback, + std::string & nmea ) + : mpCallback( pCallback ) + { + memset( (LPVOID)&mNMEA[0], 0, 512 ); + + ULONG len = nmea.size(); + if (len > 0 && len < 512) + { + memcpy( (LPVOID)&mNMEA[0], + (LPCVOID)nmea.c_str(), + (SIZE_T)len ); + } + }; + + // (Inline) Destructor + virtual ~cNewNMEACallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0 && mNMEA[0] != 0) + { + mpCallback( &mNMEA[0] ); + } + }; + + /* Callback function */ + tFNNewNMEA mpCallback; + + /* Callback arguments */ + CHAR mNMEA[512]; +}; + +/*=========================================================================*/ +// Class cPDSStateCallback +/*=========================================================================*/ +class cPDSStateCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cPDSStateCallback( + tFNPDSState pCallback, + ULONG enabledState, + ULONG trackingState ) + : mpCallback( pCallback ), + mEnabledState( enabledState ), + mTrackingState( trackingState ) + { }; + + // (Inline) Destructor + virtual ~cPDSStateCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mEnabledState, mTrackingState ); + } + }; + + /* Callback function */ + tFNPDSState mpCallback; + + /* Callback arguments */ + ULONG mTrackingState; + ULONG mEnabledState; +}; + +/*=========================================================================*/ +// Class cCATEventCallback +/*=========================================================================*/ +class cCATEventCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cCATEventCallback( + tFNCATEvent pCallback, + ULONG eventID, + ULONG eventLen, + const BYTE * pEventData ) + : mpCallback( pCallback ), + mEventID( eventID ), + mEventLen( 0 ) + { + memset( (LPVOID)&mData[0], 0, 2048 ); + + if (pEventData != 0 && eventLen > 0 && eventLen < 2048) + { + mEventLen = eventLen; + memcpy( (LPVOID)&mData[0], + (LPCVOID)pEventData, + (SIZE_T)eventLen ); + } + }; + + // (Inline) Destructor + virtual ~cCATEventCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mEventID, mEventLen, &mData[0] ); + } + }; + + /* Callback function */ + tFNCATEvent mpCallback; + + /* Callback arguments */ + ULONG mEventID; + ULONG mEventLen; + BYTE mData[2048]; +}; + +/*=========================================================================*/ +// Class cOMADMAlertCallback +/*=========================================================================*/ +class cOMADMAlertCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cOMADMAlertCallback( + tFNOMADMAlert pCallback, + ULONG sessionType, + USHORT sessionID ) + : mpCallback( pCallback ), + mSessionType( sessionType ), + mSessionID( sessionID ) + { }; + + // (Inline) Destructor + virtual ~cOMADMAlertCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mSessionType, mSessionID ); + } + }; + + /* Callback function */ + tFNOMADMAlert mpCallback; + + /* Callback arguments */ + ULONG mSessionType; + USHORT mSessionID; +}; + +/*=========================================================================*/ +// Class cOMADMStateCallback +/*=========================================================================*/ +class cOMADMStateCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cOMADMStateCallback( + tFNOMADMState pCallback, + ULONG sessionState, + ULONG failureReason ) + : mpCallback( pCallback ), + mSessionState( sessionState ), + mFailureReason( failureReason ) + { }; + + // (Inline) Destructor + virtual ~cOMADMStateCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mSessionState, mFailureReason ); + } + }; + + /* Callback function */ + tFNOMADMState mpCallback; + + /* Callback arguments */ + ULONG mSessionState; + ULONG mFailureReason; +}; + +/*=========================================================================*/ +// Class cUSSDReleaseCallback +/*=========================================================================*/ +class cUSSDReleaseCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cUSSDReleaseCallback( tFNUSSDRelease pCallback ) + : mpCallback( pCallback ) + { }; + + // (Inline) Destructor + virtual ~cUSSDReleaseCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback(); + } + }; + + /* Callback function */ + tFNUSSDRelease mpCallback; +}; + +/*=========================================================================*/ +// Class cUSSDNotificationCallback +/*=========================================================================*/ +class cUSSDNotificationCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cUSSDNotificationCallback( + tFNUSSDNotification pCallback, + ULONG type, + const BYTE * pData ) + : mpCallback( pCallback ), + mType( type ), + mbData( false ) + { + memset( (LPVOID)&mData[0], 0, 512 ); + + // Data to copy? + if (pData != 0) + { + ULONG len = (ULONG)pData[1] + (ULONG)2; + memcpy( (LPVOID)&mData[0], (LPCVOID)pData, (SIZE_T)len ); + + mbData = true; + } + }; + + // (Inline) Destructor + virtual ~cUSSDNotificationCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + if (mbData == true) + { + mpCallback( mType, &mData[0] ); + } + else + { + mpCallback( mType, 0 ); + } + } + }; + + /* Callback function */ + tFNUSSDNotification mpCallback; + + /* Callback arguments */ + ULONG mType; + BYTE mData[512]; + + /* Did we get data? */ + bool mbData; +}; + +/*=========================================================================*/ +// Class cUSSDOriginationCallback +/*=========================================================================*/ +class cUSSDOriginationCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cUSSDOriginationCallback( + tFNUSSDOrigination pCallback, + ULONG errorCode, + ULONG failureCause, + const BYTE * pNetworkInfo, + const BYTE * pAlpha ) + : mpCallback( pCallback ), + mErrorCode( errorCode ), + mFailureCause( failureCause ), + mbNetwork( false ), + mbAlpha( 0 ) + { + memset( &mNetworkInfo[0], 0, 512 ); + memset( &mAlpha[0], 0, 512 ); + + // Data to copy? + if (pNetworkInfo != 0) + { + ULONG len = (ULONG)pNetworkInfo[1] + (ULONG)2; + memcpy( &mNetworkInfo[0], + pNetworkInfo, + len ); + + mbNetwork = true; + } + + if (pAlpha != 0) + { + ULONG len = (ULONG)pAlpha[1] + (ULONG)2; + memcpy( &mAlpha[0], + pAlpha, + len ); + + mbAlpha = true; + } + }; + + // (Inline) Destructor + virtual ~cUSSDOriginationCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + BYTE * pNetworkInfo = (mbNetwork == true ? &mNetworkInfo[0] : 0); + BYTE * pAlpha = (mbAlpha == true ? &mAlpha[0] : 0); + + mpCallback( mErrorCode, mFailureCause, pNetworkInfo, pAlpha ); + } + }; + + /* Callback function */ + tFNUSSDOrigination mpCallback; + + /* Callback arguments */ + ULONG mErrorCode; + ULONG mFailureCause; + BYTE mNetworkInfo[512]; + BYTE mAlpha[512]; + + /* Did we get data? */ + bool mbNetwork; + bool mbAlpha; +}; + +/*=========================================================================*/ +// Class cGobiConnectionMgmt +/*=========================================================================*/ +class cGobiConnectionMgmt : public cGobiQMICore +{ + public: + // Constructor + cGobiConnectionMgmt(); + + // Destructor + virtual ~cGobiConnectionMgmt(); + + // Connect to the specified Gobi device + virtual bool Connect( + LPCSTR pDeviceNode = 0, + LPCSTR pDeviceKey = 0 ); + + // Disconnect from the currently connected Gobi device + virtual bool Disconnect(); + + // Enable/disable session state callback function + eGobiError SetSessionStateCallback( tFNSessionState pCallback ); + + // Enables/disables the RX/TX byte counts callback function + eGobiError SetByteTotalsCallback( + tFNByteTotals pCallback, + BYTE interval ); + + // Enables/disables the serving system data capabilities callback + eGobiError SetDataCapabilitiesCallback( tFNDataCapabilities pCallback ); + + // Enable/disable data bearer callback function + eGobiError SetDataBearerCallback( tFNDataBearer pCallback ); + + // Enable/disable dormancy status callback function + eGobiError SetDormancyStatusCallback( tFNDormancyStatus pCallback ); + + // Enable/disable mobile IP status callback function + eGobiError SetMobileIPStatusCallback( tFNDormancyStatus pCallback ); + + // Enable/disable activation status callback function + eGobiError SetActivationStatusCallback( tFNActivationStatus pCallback ); + + // Enable/disable power operating mode callback function + eGobiError SetPowerCallback( tFNPower pCallback ); + + // Enable/disable wireless disable state callback function + eGobiError SetWirelessDisableCallback( tFNWirelessDisable pCallback ); + + // Enable/disable roaming indicator callback function + eGobiError SetRoamingIndicatorCallback( tFNRoamingIndicator pCallback ); + + // Enable/disable signal strength callback function + eGobiError SetSignalStrengthCallback( + tFNSignalStrength pCallback, + std::list thresholds ); + + // Enable/disable RF information callback function + eGobiError SetRFInfoCallback( tFNRFInfo pCallback ); + + // Enable/disable LU reject callback function + eGobiError SetLURejectCallback( tFNLUReject pCallback ); + + // Enable/disable PLMN mode callback function + eGobiError SetPLMNModeCallback( tFNPLMNMode pCallback ); + + // Enable/disable new SMS callback function + eGobiError SetNewSMSCallback( tFNNewSMS pCallback ); + + // Enable/disable NMEA sentence callback function + eGobiError SetNMEACallback( tFNNewNMEA pCallback ); + + // Enable/disable PDS service state callback function + eGobiError SetPDSStateCallback( tFNPDSState pCallback ); + + // Enable/disable CAT event callback function + eGobiError SetCATEventCallback( + tFNCATEvent pCallback, + ULONG eventMask, + ULONG * pErrorMask ); + + // Enable/disable OMA-DM NIA callback function + eGobiError SetOMADMAlertCallback( tFNOMADMAlert pCallback ); + + // Enable/disable OMA-DM state callback function + eGobiError SetOMADMStateCallback( tFNOMADMState pCallback ); + + // Enable/disable USSD release callback function + eGobiError SetUSSDReleaseCallback( tFNUSSDRelease pCallback ); + + // Enable/disable USSD notification callback function + eGobiError SetUSSDNotificationCallback( tFNUSSDNotification pCallback ); + + // Enable/disable USSD origination callback function + eGobiError SetUSSDOriginationCallback( tFNUSSDOrigination pCallback ); + + protected: + // Process new traffic + void ProcessTraffic( eQMIService svc ); + + // Process QMI traffic + void ProcessWDSBuffer( const sProtocolBuffer & buf ); + void ProcessDMSBuffer( const sProtocolBuffer & buf ); + void ProcessNASBuffer( const sProtocolBuffer & buf ); + void ProcessWMSBuffer( const sProtocolBuffer & buf ); + void ProcessPDSBuffer( const sProtocolBuffer & buf ); + void ProcessCATBuffer( const sProtocolBuffer & buf ); + void ProcessOMABuffer( const sProtocolBuffer & buf ); + void ProcessVoiceBuffer( const sProtocolBuffer & buf ); + + /* Is there an active thread? */ + bool mbThreadStarted; + + /* ID of traffic processing thread */ + pthread_t mThreadID; + + /* Traffic processing thread exit event */ + cEvent mExitEvent; + + /* Has the protocol server thread finished cleanup? */ + bool mThreadCleanupFinished; + + /* Number of buffers processed by ProcessTraffic() (per server) */ + ULONG mWDSItemsProcessed; + ULONG mDMSItemsProcessed; + ULONG mNASItemsProcessed; + ULONG mWMSItemsProcessed; + ULONG mPDSItemsProcessed; + ULONG mCATItemsProcessed; + ULONG mOMAItemsProcessed; + ULONG mVoiceItemsProcessed; + + /* Callback functions */ + tFNSessionState mpFNSessionState; + tFNByteTotals mpFNByteTotals; + tFNDataCapabilities mpFNDataCapabilities; + tFNDataBearer mpFNDataBearer; + tFNDormancyStatus mpFNDormancyStatus; + tFNMobileIPStatus mpFNMobileIPStatus; + tFNActivationStatus mpFNActivationStatus; + tFNPower mpFNPower; + tFNWirelessDisable mpFNWirelessDisable; + tFNRoamingIndicator mpFNRoamingIndicator; + tFNSignalStrength mpFNSignalStrength; + tFNRFInfo mpFNRFInfo; + tFNLUReject mpFNLUReject; + tFNPLMNMode mpPLMNMode; + tFNNewSMS mpFNNewSMS; + tFNNewNMEA mpFNNewNMEA; + tFNPDSState mpFNPDSState; + tFNCATEvent mpFNCATEvent; + tFNOMADMAlert mpFNOMADMAlert; + tFNOMADMState mpFNOMADMState; + tFNUSSDRelease mpFNUSSDRelease; + tFNUSSDNotification mpFNUSSDNotification; + tFNUSSDOrigination mpFNUSSDOrigination; + + // Traffic process thread gets full access + friend VOID * TrafficProcessThread( PVOID pArg ); +}; + +/*=========================================================================*/ +// Class cGobiConnectionMgmtDLL +/*=========================================================================*/ +class cGobiConnectionMgmtDLL +{ + public: + // Constructor + cGobiConnectionMgmtDLL(); + + // Destructor + virtual ~cGobiConnectionMgmtDLL(); + + // Return the GobiConnectionMgmt object + cGobiConnectionMgmt * GetAPI(); + + protected: + /* API interface object */ + cGobiConnectionMgmt * mpAPI; + + /* Above object allocation attempted? */ + bool mbAllocated; + + /* Synchronization object */ + mutable pthread_mutex_t mSyncSection; +}; + +extern cGobiConnectionMgmtDLL gConnectionDLL; diff --git a/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmtAPI.h b/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmtAPI.h new file mode 100755 index 0000000..955f391 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmtAPI.h @@ -0,0 +1,3329 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtAPI.h + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi 3000 + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +#ifndef GOBI_TYPEDEFS +#define GOBI_TYPEDEFS + +// Type Definitions +typedef unsigned long ULONG; +typedef unsigned long long ULONGLONG; +typedef signed char INT8; +typedef unsigned char BYTE; +typedef char CHAR; +typedef unsigned short WORD; +typedef unsigned short USHORT; +typedef const char * LPCSTR; + +#endif + +/*=========================================================================*/ +// Definitions +/*=========================================================================*/ + +#ifdef __cplusplus + extern "C" { +#endif + +// Session state callback function +typedef void (* tFNSessionState)( + ULONG state, + ULONG sessionEndReason ); + +// RX/TX byte counts callback function +typedef void (* tFNByteTotals)( + ULONGLONG totalBytesTX, + ULONGLONG totalBytesRX ); + +// Dormancy status callback function +typedef void (* tFNDormancyStatus)( ULONG dormancyStatus ); + +// Mobile IP status callback function +typedef void (* tFNMobileIPStatus)( ULONG mipStatus ); + +// Activation status callback function +typedef void (* tFNActivationStatus)( ULONG activationStatus ); + +// Power operating mode callback function +typedef void (* tFNPower)( ULONG operatingMode ); + +// Wireless disable callback function +typedef void (* tFNWirelessDisable)( ULONG bState ); + +// Serving system data capabilities callback function +typedef void (* tFNDataCapabilities)( + BYTE dataCapsSize, + BYTE * pDataCaps ); + +// Data bearer technology callback function +typedef void (* tFNDataBearer)( ULONG dataBearer ); + +// Roaming indicator callback function +typedef void (* tFNRoamingIndicator)( ULONG roaming ); + +// Signal strength callback function +typedef void (* tFNSignalStrength)( + INT8 signalStrength, + ULONG radioInterface ); + +// RF information callback function +typedef void (* tFNRFInfo)( + ULONG radioInterface, + ULONG activeBandClass, + ULONG activeChannel ); + +// LU reject callback function +typedef void (* tFNLUReject)( + ULONG serviceDomain, + ULONG rejectCause ); + +// PLMN mode callback function +typedef void (* tFNPLMNMode)( ULONG mode ); + +// New SMS message callback function +typedef void (* tFNNewSMS)( + ULONG storageType, + ULONG messageIndex ); + +// New NMEA sentence callback function +typedef void (* tFNNewNMEA)( LPCSTR pNMEA ); + +// PDS session state callback function +typedef void (* tFNPDSState)( + ULONG enabledStatus, + ULONG trackingStatus ); + +// CAT event callback function +typedef void (* tFNCATEvent)( + ULONG eventID, + ULONG eventLen, + BYTE * pEventData ); + +// OMA-DM network initiated alert callback function +typedef void (* tFNOMADMAlert)( + ULONG sessionType, + USHORT sessionID ); + +// OMA-DM state callback function +typedef void (* tFNOMADMState)( + ULONG sessionState, + ULONG failureReason ); + +// USSD release callback function +typedef void (* tFNUSSDRelease)(); + +// USSD notification callback function +typedef void (* tFNUSSDNotification)( + ULONG type, + BYTE * pNetworkInfo ); + +// USSD origination callback function +typedef void (* tFNUSSDOrigination)( + ULONG errorCode, + ULONG failureCause, + BYTE * pNetworkInfo, + BYTE * pAlpha ); + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + QCWWANEnumerateDevices + +DESCRIPTION: + This function enumerates the Gobi devices currently attached to the + system + +PARAMETERS: + pDevicesSize [I/O] - Upon input the maximum number of elements that the + device array can contain. Upon successful output + the actual number of elements in the device array + pDevices [ O ] - The device array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANEnumerateDevices( + BYTE * pDevicesSize, + BYTE * pDevices ); + +/*=========================================================================== +METHOD: + QCWWANConnect + +DESCRIPTION: + This function connects the CM API library to the specified Gobi + device + + Both device node and key are case sensitive + +PARAMETERS: + pDeviceNode [ I ] - The device node + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANConnect( + CHAR * pDeviceNode, + CHAR * pDeviceKey ); + +/*=========================================================================== +METHOD: + QCWWANCancel + +DESCRIPTION: + This function cancels the most recent outstanding request + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANCancel(); + +/*=========================================================================== +METHOD: + QCWWANDisconnect + +DESCRIPTION: + This function disconnects the CM API library from the currently + connected Gobi device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANDisconnect(); + +/*=========================================================================== +METHOD: + QCWWANGetConnectedDeviceID + +DESCRIPTION: + This function returns the Node/key of the device the Gobi CM API library + is currently connected to + +PARAMETERS: + deviceNodeSize [ I ] - The maximum number of characters (including NULL + terminator) that the device Node array can contain + pDeviceNode [ O ] - Device Node (NULL terminated string) + deviceKeySize [ I ] - The maximum number of characters (including NULL + terminator) that the device key array can contain + pDeviceKey [ O ] - Device key (NULL terminated string) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANGetConnectedDeviceID( + ULONG deviceNodeSize, + CHAR * pDeviceNode, + ULONG deviceKeySize, + CHAR * pDeviceKey ); + +/*=========================================================================== +METHOD: + GetSessionState + +DESCRIPTION: + This function returns the state of the current packet data session + +PARAMETERS: + pState [ O ] - State of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSessionState( ULONG * pState ); + +/*=========================================================================== +METHOD: + GetSessionDuration + +DESCRIPTION: + This function returns the duration of the current packet data session + +PARAMETERS: + pDuration [ O ] - Duration of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSessionDuration( ULONGLONG * pDuration ); + +/*=========================================================================== +METHOD: + GetDormancyState + +DESCRIPTION: + This function returns the dormancy state of the current packet + data session (when connected) + +PARAMETERS: + pState [ O ] - Dormancy state of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDormancyState( ULONG * pState ); + +/*=========================================================================== +METHOD: + GetAutoconnect (Deprecated) + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + pSetting [ O ] - NDIS autoconnect setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetAutoconnect( ULONG * pSetting ); + +/*=========================================================================== +METHOD: + SetAutoconnect (Deprecated) + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + setting [ I ] - NDIS autoconnect disabled (0) or enabled (non-zero) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetAutoconnect( ULONG setting ); + +/*=========================================================================== +METHOD: + GetEnhancedAutoconnect + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + pSetting [ O ] - NDIS autoconnect setting + pRoamSetting [ O ] - NDIS autoconnect roam setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetEnhancedAutoconnect( + ULONG * pSetting, + ULONG * pRoamSetting ); + +/*=========================================================================== +METHOD: + SetEnhancedAutoconnect + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + setting [ I ] - NDIS autoconnect setting + pRoamSetting [ I ] - (Optional) NDIS autoconnect roam setting + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetEnhancedAutoconnect( + ULONG setting, + ULONG * pRoamSetting ); + +/*=========================================================================== +METHOD: + SetDefaultProfile + +DESCRIPTION: + This function writes the default profile settings to the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being written + pPDPType [ I ] - (Optional) PDP type + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pName [ I ] - (Optional) The profile name or description + pAPNName [ I ] - (Optional) Access point name + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ); + +/*=========================================================================== +METHOD: + GetDefaultProfile + +DESCRIPTION: + This function reads the default profile settings from the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being read + pPDPType [ O ] - PDP type + pIPAddress [ O ] - Preferred assigned IPv4 address + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + pAuthentication [ O ] - Authentication algorithm bitmap + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the profile name array + can contain + pName [ O ] - The profile name or description + apnSize [ I ] - The maximum number of characters (including + NULL terminator) that the APN name array + can contain + pAPNName [ O ] - Access point name represented as a NULL + terminated string (empty string returned when + unknown) + userSize [ I ] - The maximum number of characters (including + NULL terminator) that the username array + can contain + pUsername [ O ] - Username used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ); + +/*=========================================================================== +METHOD: + StartDataSession + +DESCRIPTION: + These functions activate a packet data session + +PARAMETERS: + pTechnology [ I ] - (Optional) Technology bitmap + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pPrimaryNBNS [ I ] - (Optional) Primary NetBIOS NS IPv4 address + pSecondaryNBNS [ I ] - (Optional) Secondary NetBIOS NS IPv4 address + pAPNName [ I ] - (Optional) Access point name + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + pSessionId [ O ] - The assigned session ID + pFailureReason [ O ] - Upon call failure the failure reason provided + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG StartDataSession( + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword, + ULONG * pSessionId, + ULONG * pFailureReason ); + +/*=========================================================================== +METHOD: + CancelDataSession + +DESCRIPTION: + This function cancels an in-progress packet data session activation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CancelDataSession(); + +/*=========================================================================== +METHOD: + StopDataSession + +DESCRIPTION: + This function stops the current data session + +PARAMETERS: + sessionId [ I ] - The ID of the session to terminate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG StopDataSession( ULONG sessionId ); + +/*=========================================================================== +METHOD: + GetIPAddress + +DESCRIPTION: + This function returns the current packet data session IP address + +PARAMETERS: + pIPAddress [ O ] - Assigned IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetIPAddress( ULONG * pIPAddress ); + +/*=========================================================================== +METHOD: + GetConnectionRate + +DESCRIPTION: + This function returns connection rate information for the packet data + connection + +PARAMETERS: + pCurrentChannelTXRate [ O ] - Current channel TX rate (bps) + pCurrentChannelRXRate [ O ] - Current channel RX rate (bps) + pMaxChannelTXRate [ O ] - Maximum channel TX rate (bps) + pMaxChannelRXRate [ O ] - Maximum channel RX rate (bps) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetConnectionRate( + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ); + +/*=========================================================================== +METHOD: + GetPacketStatus + +DESCRIPTION: + This function returns the packet data transfer statistics since the start + of the current packet data session + +PARAMETERS: + pTXPacketSuccesses [ O ] - Packets transmitted without error + pRXPacketSuccesses [ O ] - Packets received without error + pTXPacketErrors [ O ] - Outgoing packets with framing errors + pRXPacketErrors [ O ] - Incoming packets with framing errors + pTXPacketOverflows [ O ] - Packets dropped because TX buffer overflowed + pRXPacketOverflows [ O ] - Packets dropped because RX buffer overflowed + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPacketStatus( + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ); + +/*=========================================================================== +METHOD: + GetByteTotals + +DESCRIPTION: + This function returns the RX/TX byte counts since the start of the + current packet data session + +PARAMETERS: + pTXTotalBytes [ O ] - Bytes transmitted without error + pRXTotalBytes [ O ] - Bytes received without error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetByteTotals( + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ); + +/*=========================================================================== +METHOD: + SetMobileIP + +DESCRIPTION: + This function sets the current mobile IP setting + +PARAMETERS: + mode [ I ] - Desired mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIP( ULONG mode ); + +/*=========================================================================== +METHOD: + GetMobileIP + +DESCRIPTION: + This function gets the current mobile IP setting + +PARAMETERS: + pMode [ O ] - Current mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIP( ULONG * pMode ); + +/*=========================================================================== +METHOD: + SetActiveMobileIPProfile + +DESCRIPTION: + This function sets the active mobile IP profile index + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Desired mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetActiveMobileIPProfile( + CHAR * pSPC, + BYTE index ); + +/*=========================================================================== +METHOD: + GetActiveMobileIPProfile + +DESCRIPTION: + This function gets the the active mobile IP profile index + +PARAMETERS: + pIndex [ O ] - Active mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetActiveMobileIPProfile( BYTE * pIndex ); + +/*=========================================================================== +METHOD: + SetMobileIPProfile + +DESCRIPTION: + This function sets the specified mobile IP profile settings + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Mobile IP profile ID + pEnabled [ I ] - (Optional) Enable MIP profile? + pAddress [ I ] - (Optional) Home IPv4 address + pPrimaryHA [ I ] - (Optional) Primary home agent IPv4 address + pSecondaryHA [ I ] - (Optional) Secondary home agent IPv4 address + pRevTunneling [ I ] - (Optional) Enable reverse tunneling? + pNAI [ I ] - (Optional) Network access identifier string + pHASPI [ I ] - (Optional) HA security parameter index + pAAASPI [ I ] - (Optional) AAA security parameter index + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPProfile( + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ); + +/*=========================================================================== +METHOD: + GetMobileIPProfile + +DESCRIPTION: + This function gets the specified mobile IP profile settings + +PARAMETERS: + index [ I ] - Mobile IP profile ID + pEnabled [ O ] - Mobile IP profile enabled? + pAddress [ O ] - Home IPv4 address + pPrimaryHA [ O ] - Primary home agent IPv4 address + pSecondaryHA [ O ] - Secondary home agent IPv4 address + pRevTunneling [ O ] - Reverse tunneling enabled? + naiSize [ I ] - The maximum number of characters (including NULL + terminator) that the NAI array can contain + pNAI [ O ] - Network access identifier string + pHASPI [ O ] - HA security parameter index + pAAASPI [ O ] - AAA security parameter index + pHAState [ O ] - HA key state + pAAAState [ O ] - AAA key state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIPProfile( + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ); + +/*=========================================================================== +METHOD: + SetMobileIPParameters + +DESCRIPTION: + This function sets the specified mobile IP parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pMode [ I ] - (Optional) Desired mobile IP setting + pRetryLimit [ I ] - (Optional) Retry attempt limit + pRetryInterval [ I ] - (Optional) Retry attempt interval + pReRegPeriod [ I ] - (Optional) Re-registration period + pReRegTraffic [ I ] - (Optional) Re-registration only with traffic? + pHAAuthenticator [ I ] - (Optional) MH-HA authenticator calculator? + pHA2002bis [ I ] - (Optional) MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPParameters( + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + +/*=========================================================================== +METHOD: + GetMobileIPParameters + +DESCRIPTION: + This function gets the mobile IP parameters + +PARAMETERS: + pMode [ O ] - Current mobile IP setting + pRetryLimit [ O ] - Retry attempt limit + pRetryInterval [ O ] - Retry attempt interval + pReRegPeriod [ O ] - Re-registration period + pReRegTraffic [ O ] - Re-registration only with traffic? + pHAAuthenticator [ O ] - MH-HA authenticator calculator? + pHA2002bis [ O ] - MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIPParameters( + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + +/*=========================================================================== +METHOD: + GetLastMobileIPError + +DESCRIPTION: + This function gets the last mobile IP error + +PARAMETERS: + pError [ O ] - Last mobile IP error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetLastMobileIPError( ULONG * pError ); + +/*=========================================================================== +METHOD: + SetDNSSettings + +DESCRIPTION: + This function sets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); + +/*=========================================================================== +METHOD: + GetDNSSettings + +DESCRIPTION: + This function gets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); + +/*=========================================================================== +METHOD: + GetANAAAAuthenticationStatus + +DESCRIPTION: + This function gets the AN-AAA authentication status + +PARAMETERS: + pStatus [ O ] - AN-AAA authentication status + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetANAAAAuthenticationStatus( ULONG * pStatus ); + +/*=========================================================================== +METHOD: + GetSignalStrengths + +DESCRIPTION: + This function gets the current available signal strengths (in dBm) + as measured by the device + +PARAMETERS: + pArraySizes [I/O] - Upon input the maximum number of elements + that each array can contain can contain. + Upon successful output the actual number + of elements in each array + pSignalStrengths [ O ] - Received signal strength array (dBm) + pRadioInterfaces [ O ] - Radio interface technology array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSignalStrengths( + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ); + +/*=========================================================================== +METHOD: + GetRFInfo (Public Method) + +DESCRIPTION: + This function gets the current RF information + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + RF info instance array can contain. Upon success + the actual number of elements in the RF info + instance array + pInstances [ O ] - The RF info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetRFInfo( + BYTE * pInstanceSize, + BYTE * pInstances ); + +/*=========================================================================== +METHOD: + PerformNetworkScan + +DESCRIPTION: + This function performs a scan for available networks + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PerformNetworkScan( + BYTE * pInstanceSize, + BYTE * pInstances ); + +/*=========================================================================== +METHOD: + PerformNetworkRATScan + +DESCRIPTION: + This function performs a scan for available networks (includes RAT) + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + pRATSize [I/O] - Upon input the maximum number of elements that the + RAT info instance array can contain. Upon success + the actual number of elements in the RAT info + instance array + pRATInstances [ O ] - The RAT info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PerformNetworkRATScan( + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ); + +/*=========================================================================== +METHOD: + InitiateNetworkRegistration + +DESCRIPTION: + This function initiates a network registration + +PARAMETERS: + regType [ I ] - Registration type + mcc [ I ] - Mobile country code (ignored for auto registration) + mnc [ I ] - Mobile network code (ignored for auto registration) + rat [ I ] - Radio access type (ignored for auto registration) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG InitiateNetworkRegistration( + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ); + +/*=========================================================================== +METHOD: + InitiateDomainAttach + +DESCRIPTION: + This function initiates a domain attach (or detach) + +PARAMETERS: + action [ I ] - PS attach action (attach or detach) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG InitiateDomainAttach( ULONG action ); + +/*=========================================================================== +METHOD: + GetServingNetwork + +DESCRIPTION: + Gets information regarding the system that currently provides service + to the device + +PARAMETERS: + pRegistrationState [ O ] - Registration state + pCSDomain [ O ] - Circuit switch domain status + pPSDomain [ O ] - Packet switch domain status + pRAN [ O ] - Radio access network + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. Upon + successful output the actual number of elements + in the radio interface array + pRadioIfaces [ O ] - The radio interface array + pRoaming [ O ] - Roaming indicator (0xFFFFFFFF - Unknown) + pMCC [ O ] - Mobile country code (0xFFFF - Unknown) + pMNC [ O ] - Mobile network code (0xFFFF - Unknown) + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the network name array + can contain + pName [ O ] - The network name or description represented + as a NULL terminated string (empty string + returned when unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServingNetwork( + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ); + +/*=========================================================================== +METHOD: + GetServingNetworkCapabilities + +DESCRIPTION: + Gets information regarding the data capabilities of the system that + currently provides service to the device + +PARAMETERS: + pDataCapsSize [I/O] - Upon input the maximum number of elements that the + data capabilities array can contain. Upon success + the actual number of elements in the data + capabilities array + pDataCaps [ O ] - The data capabilities array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServingNetworkCapabilities( + BYTE * pDataCapsSize, + BYTE * pDataCaps ); + +/*=========================================================================== +METHOD: + GetDataBearerTechnology + +DESCRIPTION: + This function retrieves the current data bearer technology (only + valid when connected) + +PARAMETERS: + pDataCaps [ O ] - The data bearer technology + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDataBearerTechnology( ULONG * pDataBearer ); + +/*=========================================================================== +METHOD: + GetHomeNetwork + +DESCRIPTION: + This function retrieves information about the home network of the device + +PARAMETERS: + pMCC [ O ] - Mobile country code + pMNC [ O ] - Mobile network code + nameSize [ I ] - The maximum number of characters (including NULL + terminator) that the network name array can contain + pName [ O ] - The network name or description represented as a NULL + terminated string (empty string returned when unknown) + pSID [ O ] - Home network system ID (0xFFFF - Unknown) + pNID [ O ] - Home network ID (0xFFFF - Unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetHomeNetwork( + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ); + +/*=========================================================================== +METHOD: + SetNetworkPreference + +DESCRIPTION: + This function sets the network registration preference + +PARAMETERS: + technologyPref [ I ] - Technology preference bitmap + duration [ I ] - Duration of active preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNetworkPreference( + ULONG technologyPref, + ULONG duration ); + +/*=========================================================================== +METHOD: + GetNetworkPreference + +DESCRIPTION: + This function returns the network registration preference + +PARAMETERS: + pTechnologyPref [ O ] - Technology preference bitmap + pDuration [ O ] - Duration of active preference + pPersistentTechnologyPref [ O ] - Persistent technology preference bitmap + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetNetworkPreference( + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ); + +/*=========================================================================== +METHOD: + SetCDMANetworkParameters + +DESCRIPTION: + This function sets the desired CDMA network parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pForceRev0 [ I ] - (Optional) Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ I ] - (Optional) Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ I ] - (Optional) Protocol mask for custom SCP config + pBroadcast [ I ] - (Optional) Broadcast mask for custom SCP config + pApplication [ I ] - (Optional) Application mask for custom SCP config + pRoaming [ I ] - (Optional) Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetCDMANetworkParameters( + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + +/*=========================================================================== +METHOD: + GetCDMANetworkParameters + +DESCRIPTION: + This function gets the current CDMA network parameters + +PARAMETERS: + pSCI [ O ] - Slot cycle index + pSCM [ O ] - Station class mark + pRegHomeSID [ O ] - Register on home SID? + pRegForeignSID [ O ] - Register on foreign SID? + pRegForeignNID [ O ] - Register on foreign NID? + pForceRev0 [ O ] - Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ O ] - Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ O ] - Protocol mask for custom SCP config + pBroadcast [ O ] - Broadcast mask for custom SCP config + pApplication [ O ] - Application mask for custom SCP config + pRoaming [ O ] - Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetCDMANetworkParameters( + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + +/*=========================================================================== +METHOD: + GetACCOLC + +DESCRIPTION: + This function returns the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pACCOLC [ O ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetACCOLC( BYTE * pACCOLC ); + +/*=========================================================================== +METHOD: + SetACCOLC + +DESCRIPTION: + This function sets the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + accolc [ I ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetACCOLC( + CHAR * pSPC, + BYTE accolc ); + +/*=========================================================================== +METHOD: + GetPLMNMode + +DESCRIPTION: + This function returns the PLMN mode from the CSP + +PARAMETERS: + pMode [ O ] - PLMN mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPLMNMode( ULONG * pMode ); + +/*=========================================================================== +METHOD: + GetPLMNName + +DESCRIPTION: + This function returns PLMN name information for the given MCC/MNC + +PARAMETERS: + mcc [ I ] - Mobile country code + mnc [ I ] - Mobile network code + pNamesSize [I/O] - Upon input the size in BYTEs of the name structure + array. Upon success the actual number of BYTEs + copied to the name structure array + pNames [ O ] - The name structure array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPLMNName( + USHORT mcc, + USHORT mnc, + ULONG * pNamesSize, + BYTE * pNames ); + +/*=========================================================================== +METHOD: + GetDeviceCapabilities + +DESCRIPTION: + This function gets device capabilities + +PARAMETERS: + pMaxTxChannelRate [ O ] - Maximum transmission rate (bps) + pMaxRxChannelRate [ O ] - Maximum reception rate (bps) + pDataServiceCapability [ O ] - CS/PS data service capability + pSimCapability [ O ] - Device SIM support + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. + Upon successful output the actual number + of elements in the radio interface array + pRadioIfaces [ O ] - The radio interface array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDeviceCapabilities( + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ); + +/*=========================================================================== +METHOD: + GetManufacturer + +DESCRIPTION: + This function returns the device manufacturer name + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetManufacturer( + BYTE stringSize, + CHAR * pString ); + +/*=========================================================================== +METHOD: + GetModelID + +DESCRIPTION: + This function returns the device model ID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetModelID( + BYTE stringSize, + CHAR * pString ); + +/*=========================================================================== +METHOD: + GetFirmwareRevision + +DESCRIPTION: + This function returns the device firmware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareRevision( + BYTE stringSize, + CHAR * pString ); + +/*=========================================================================== +METHOD: + GetFirmwareRevisions + +DESCRIPTION: + This function returns the device firmware (AMSS, boot, and PRI) + revisions + +PARAMETERS: + amssSize [ I ] - The maximum number of characters (including NULL + terminator) that the AMSS string array can contain + pAMSSString [ O ] - NULL terminated AMSS revision string + bootSize [ I ] - The maximum number of characters (including NULL + terminator) that the boot string array can contain + pBootString [ O ] - NULL terminated boot code revision string + priSize [ I ] - The maximum number of characters (including NULL + terminator) that the PRI string array can contain + pPRIString [ O ] - NULL terminated PRI revision string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareRevisions( + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ); + +/*=========================================================================== +METHOD: + GetFirmwareInfo + +DESCRIPTION: + Returns image information obtained from the current device firmware + +PARAMETERS: + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareInfo( + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ); + +/*=========================================================================== +METHOD: + GetVoiceNumber + +DESCRIPTION: + This function returns the voice number in use by the device + +PARAMETERS: + voiceNumberSize [ I ] - The maximum number of characters (including NULL + terminator) that the voice number array can + contain + pVoiceNumber [ O ] - Voice number (MDN or ISDN) string + minSize [ I ] - The maximum number of characters (including NULL + terminator) that the MIN array can contain + pMIN [ O ] - MIN string (empty string returned when MIN is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetVoiceNumber( + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ); + +/*=========================================================================== +METHOD: + GetIMSI + +DESCRIPTION: + This function returns the device IMSI + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetIMSI( + BYTE stringSize, + CHAR * pString ); + +/*=========================================================================== +METHOD: + GetSerialNumbers + +DESCRIPTION: + This command returns all serial numbers assigned to the device + +PARAMETERS: + esnSize [ I ] - The maximum number of characters (including NULL + terminator) that the ESN array can contain + pESNString [ O ] - ESN string (empty string returned when ESN is + not supported/programmed) + imeiSize [ I ] - The maximum number of characters (including NULL + terminator) that the IMEI array can contain + pIMEIString [ O ] - IMEI string (empty string returned when IMEI is + not supported/programmed) + meidSize [ I ] - The maximum number of characters (including NULL + terminator) that the MEID array can contain + pMEIDString [ O ] - MEID string (empty string returned when MEID is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSerialNumbers( + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ); + +/*=========================================================================== +METHOD: + SetLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + state [ I ] - Desired lock state + pCurrentPIN [ I ] - Current four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetLock( + ULONG state, + CHAR * pCurrentPIN ); + +/*=========================================================================== +METHOD: + QueryLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + pState [ O ] - Current lock state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QueryLock( ULONG * pState ); + +/*=========================================================================== +METHOD: + ChangeLockPIN + +DESCRIPTION: + This command sets the user lock code maintained by the device + +PARAMETERS: + pCurrentPIN [ O ] - Current four digit PIN string + pDesiredPIN [ O ] - New four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ChangeLockPIN( + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ); + +/*=========================================================================== +METHOD: + GetHardwareRevision + +DESCRIPTION: + This function returns the device hardware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetHardwareRevision( + BYTE stringSize, + CHAR * pString ); + +/*=========================================================================== +METHOD: + GetPRLVersion + +DESCRIPTION: + This function returns the version of the active Preferred Roaming List + (PRL) in use by the device + +PARAMETERS: + pPRLVersion [ O ] - The PRL version number + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPRLVersion( WORD * pPRLVersion ); + +/*=========================================================================== +METHOD: + GetERIFile + +DESCRIPTION: + This command returns the ERI file that is stored in EFS on the device + +PARAMETERS: + pFileSize [I/O] - Upon input the maximum number of bytes that the file + contents array can contain. Upon successful output + the actual number of bytes written to the file contents + array + pFile [ O ] - The file contents + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetERIFile( + ULONG * pFileSize, + BYTE * pFile ); + +/*=========================================================================== +METHOD: + ActivateAutomatic + +DESCRIPTION: + This function requests the device to perform automatic service activation + +PARAMETERS: + pActivationCode [ I ] - Activation code (maximum string length of 12) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ActivateAutomatic( CHAR * pActivationCode ); + +/*=========================================================================== +METHOD: + ActivateManual + +DESCRIPTION: + This function requests the device perform manual service activation, + after a successful request the device is then asked to reset + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + sid [ I ] - System identification number + pMDN [ I ] - Mobile Directory Number string + pMIN [ I ] - Mobile Identification Number string + prlSize [ I ] - (Optional) Size of PRL file array + pPRL [ I ] - (Optional) The PRL file contents + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ActivateManual( + CHAR * pSPC, + WORD sid, + CHAR * pMDN, + CHAR * pMIN, + ULONG prlSize, + BYTE * pPRL, + CHAR * pMNHA, + CHAR * pMNAAA ); + +/*=========================================================================== +METHOD: + ResetToFactoryDefaults + +DESCRIPTION: + This function requests the device reset configuration to factory defaults, + after a successful request the device is then asked to reset + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetToFactoryDefaults( CHAR * pSPC ); + +/*=========================================================================== +METHOD: + GetActivationState + +DESCRIPTION: + This function returns the device activation state + +PARAMETERS: + pActivationState [ O ] - Service activation state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetActivationState( ULONG * pActivationState ); + +/*=========================================================================== +METHOD: + SetPower + +DESCRIPTION: + This function sets the operating mode of the device + +PARAMETERS: + powerMode [ I ] - Selected operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPower( ULONG powerMode ); + +/*=========================================================================== +METHOD: + GetPower + +DESCRIPTION: + This function returns the operating mode of the device + +PARAMETERS: + pPowerMode [ O ] - Current operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPower( ULONG * pPowerMode ); + +/*=========================================================================== +METHOD: + GetOfflineReason + +DESCRIPTION: + This function returns the reason why the operating mode of the device + is currently offline + +PARAMETERS: + pReasonMask [ O ] - Bitmask of offline reasons + pbPlatform [ O ] - Offline due to being platform retricted? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetOfflineReason( + ULONG * pReasonMask, + ULONG * pbPlatform ); + +/*=========================================================================== +METHOD: + GetNetworkTime + +DESCRIPTION: + This function returns the current time of the device + +PARAMETERS: + pTimeStamp [ O ] - Count of 1.25ms that have elapsed from the start + of GPS time (Jan 6, 1980) + pTimeSource [ O ] - Source of the timestamp + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetNetworkTime( + ULONGLONG * pTimeCount, + ULONG * pTimeSource ); + +/*=========================================================================== +METHOD: + ValidateSPC + +DESCRIPTION: + This function validates the service programming code + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ValidateSPC( CHAR * pSPC ); + +/*=========================================================================== +METHOD: + DeleteSMS + +DESCRIPTION: + This function deletes one or more SMS messages from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + pMessageIndex [ I ] - (Optional) message index + pMessageTag [ I ] - (Optional) message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DeleteSMS( + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ); + +/*=========================================================================== +METHOD: + GetSMSList + +DESCRIPTION: + This function returns the list of SMS messages stored on the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + pRequestedTag [ I ] - Message index + pMessageListSize [I/O] - Upon input the maximum number of elements that the + message list array can contain. Upon successful + output the actual number of elements in the message + list array + pMessageList [ O ] - The message list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSList( + ULONG storageType, + ULONG * pRequestedTag, + ULONG * pMessageListSize, + BYTE * pMessageList ); + +/*=========================================================================== +METHOD: + GetSMS + +DESCRIPTION: + This function returns an SMS message from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + pMessageTag [ O ] - Message tag + pMessageFormat [ O ] - Message format + pMessageSize [I/O] - Upon input the maximum number of bytes that can be + written to the message array. Upon successful + output the actual number of bytes written to the + message array + pMessage [ I ] - The message contents array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMS( + ULONG storageType, + ULONG messageIndex, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ); + +/*=========================================================================== +METHOD: + ModifySMSStatus + +DESCRIPTION: + This function modifies the status of an SMS message saved in storage on + the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + messageTag [ I ] - Message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ModifySMSStatus( + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ); + +/*=========================================================================== +METHOD: + SaveSMS + +DESCRIPTION: + This function saves an SMS message to device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageIndex [ O ] - The message index assigned by the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SaveSMS( + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageIndex ); + +/*=========================================================================== +METHOD: + SendSMS + +DESCRIPTION: + This function sends an SMS message for immediate over the air transmission + +PARAMETERS: + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageFailureCode [ O ] - When the function fails due to an error sending + the message this parameter may contain the + message failure cause code (see 3GPP2 N.S0005 + Section 6.5.2.125). If the cause code is not + provided then the value will be 0xFFFFFFFF + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SendSMS( + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageFailureCode ); + +/*=========================================================================== +METHOD: + GetSMSCAddress + +DESCRIPTION: + This function returns the SMS center address + +PARAMETERS: + addressSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address array + can contain + pSMSCAddress [ 0 ] - The SMS center address represented as a NULL + terminated string + typeSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address type array + can contain + pSMSCType [ 0 ] - The SMS center address type represented as a NULL + terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSCAddress( + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ); + +/*=========================================================================== +METHOD: + SetSMSCAddress + +DESCRIPTION: + This function sets the SMS center address + +PARAMETERS: + pSMSCAddress [ I ] - The SMS center address represented as a NULL + terminated string + pSMSCType [ I ] - The SMS center address type represented as a NULL + terminated string (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSCAddress( + CHAR * pSMSCAddress, + CHAR * pSMSCType ); + +/*=========================================================================== +METHOD: + GetSMSRoutes + +DESCRIPTION: + This function gets the current incoming SMS routing information + +PARAMETERS: + pRouteSize [I/O] - Upon input the maximum number of elements that the + SMS route array can contain. Upon succes the actual + number of elements in the SMS route array + pRoutes [ O ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ); + +/*=========================================================================== +METHOD: + SetSMSRoutes + +DESCRIPTION: + This function sets the desired incoming SMS routing information + +PARAMETERS: + pRouteSize [ I ] - The number of elements in the SMS route array + pRoutes [ I ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ); + +/*=========================================================================== +METHOD: + UIMSetPINProtection + +DESCRIPTION: + This function enables or disables protection of UIM contents by a + given PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + bEnable [ I ] - Enable/disable PIN protection (0 = disable)? + pValue [ I ] - PIN value of the PIN to be enabled/disabled + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetPINProtection( + ULONG id, + ULONG bEnable, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMVerifyPIN + +DESCRIPTION: + This function verifies the PIN before accessing the UIM contents + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pValue [ I ] - PIN value of the PIN to verify + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMVerifyPIN( + ULONG id, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMUnblockPIN + +DESCRIPTION: + This function unblocks a blocked PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pPUKValue [ I ] - PUK value of the PIN to unblock + pNewValue [ I ] - New PIN value of the PIN to unblock + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockPIN( + ULONG id, + CHAR * pPUKValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMChangePIN + +DESCRIPTION: + This function change the PIN value + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pOldValue [ I ] - Old PIN value of the PIN to change + pNewValue [ I ] - New PIN value of the PIN to change + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangePIN( + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMGetPINStatus + +DESCRIPTION: + This function returns the status of the pin + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pStatus [ O ] - PIN status (0xFFFFFFFF = unknown) + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetPINStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMGetICCID + +DESCRIPTION: + This function returns the UIM ICCID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetICCID( + BYTE stringSize, + CHAR * pString ); +/*=========================================================================== +METHOD: + UIMGetControlKeyStatus + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetControlKeyStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMGetControlKeyBlockingStatus + +DESCRIPTION: + This function returns the blocking status of the specified facility + control key + +PARAMETERS: + id [ I ] - Facility ID + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + pbBlocking [ O ] - (Optional) Is the facility blocking? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetControlKeyBlockingStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ); + +/*=========================================================================== +METHOD: + UIMSetControlKeyProtection + +DESCRIPTION: + This function changes the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + status [ I ] - Control key status + pValue [ I ] - Control key de-personalization string + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + control key will be blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetControlKeyProtection( + ULONG id, + ULONG status, + CHAR * pValue, + ULONG * pVerifyRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMUnblockControlKey + +DESCRIPTION: + This function unblocks the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pValue [ I ] - Control key de-personalization string + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockControlKey( + ULONG id, + CHAR * pValue, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + GetPDSState + +DESCRIPTION: + This function returns the current PDS state + +PARAMETERS: + pEnabled [ O ] - Current PDS state (0 = disabled) + pTracking [ O ] - Current PDS tracking session state + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPDSState( + ULONG * pEnabled, + ULONG * pTracking ); + +/*=========================================================================== +METHOD: + SetPDSState + +DESCRIPTION: + This function sets the PDS state + +PARAMETERS: + enable [ I ] - Desired PDS state (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSState( ULONG enable ); + +/*=========================================================================== +METHOD: + PDSInjectTimeReference + +DESCRIPTION: + This function injects a system time into the PDS engine + +PARAMETERS: + sysTime [ I ] - System time + sysDiscontinuities [ I ] - Number of system time discontinuities + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeReference( + ULONGLONG systemTime, + USHORT systemDiscontinuities ); + +/*=========================================================================== +METHOD: + GetPDSDefaults + +DESCRIPTION: + This function returns the default tracking session configuration + +PARAMETERS: + pOperation [ O ] - Current session operating mode + pTimeout [ O ] - Maximum amount of time (seconds) to work on each fix + pInterval [ O ] - Interval (milliseconds) between fix requests + pAccuracy [ O ] - Current accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPDSDefaults( + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ); + +/*=========================================================================== +METHOD: + SetPDSDefaults + +DESCRIPTION: + This function sets the default tracking session configuration + +PARAMETERS: + operation [ I ] - Desired session operating mode + timeout [ I ] - Maximum amount of time (seconds) to work on each fix + interval [ I ] - Interval (milliseconds) between fix requests + accuracy [ I ] - Desired accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSDefaults( + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ); + +/*=========================================================================== +METHOD: + GetXTRAAutomaticDownload + +DESCRIPTION: + This function returns the XTRA automatic download configuration + +PARAMETERS: + pbEnabled [ O ] - Automatic download enabled? + pInterval [ O ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRAAutomaticDownload( + ULONG * pbEnabled, + USHORT * pInterval ); + +/*=========================================================================== +METHOD: + SetXTRAAutomaticDownload + +DESCRIPTION: + This function sets the XTRA automatic download configuration + +PARAMETERS: + bEnabled [ I ] - Automatic download enabled? + interval [ I ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRAAutomaticDownload( + ULONG bEnabled, + USHORT interval ); + +/*=========================================================================== +METHOD: + GetXTRANetwork + +DESCRIPTION: + This function returns the XTRA WWAN network preference + +PARAMETERS: + pPreference [ O ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRANetwork( ULONG * pPreference ); + +/*=========================================================================== +METHOD: + SetXTRANetwork + +DESCRIPTION: + This function sets the XTRA WWAN network preference + +PARAMETERS: + preference [ I ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRANetwork( ULONG preference ); + +/*=========================================================================== +METHOD: + GetXTRAValidity + +DESCRIPTION: + This function returns the XTRA database validity period + +PARAMETERS: + pGPSWeek [ O ] - Starting GPS week of validity period + pGPSWeekOffset [ O ] - Starting GPS week offset (minutes) of validity period + pDuration [ O ] - Length of validity period (hours) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRAValidity( + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ); + +/*=========================================================================== +METHOD: + ForceXTRADownload + +DESCRIPTION: + This function forces the XTRA database to be downloaded to the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ForceXTRADownload(); + +/*=========================================================================== +METHOD: + GetXTRADataState + +DESCRIPTION: + This function returns the XTRA data positioning state + +PARAMETERS: + pState [ O ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRADataState( ULONG * pState ); + +/*=========================================================================== +METHOD: + SetXTRADataState + +DESCRIPTION: + This function sets the XTRA data positioning state + +PARAMETERS: + state [ I ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRADataState( ULONG state ); + +/*=========================================================================== +METHOD: + GetXTRATimeState + +DESCRIPTION: + This function returns the XTRA time positioning state + +PARAMETERS: + pState [ O ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRATimeState( ULONG * pState ); + +/*=========================================================================== +METHOD: + SetXTRATimeState + +DESCRIPTION: + This function sets the XTRA time positioning state + +PARAMETERS: + state [ I ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRATimeState( ULONG state ); + +/*=========================================================================== +METHOD: + GetAGPSConfig + +DESCRIPTION: + This function returns the PDS AGPS configuration + +PARAMETERS: + pServerAddress [ O ] - IPv4 address of AGPS server + pServerPort [ O ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetAGPSConfig( + ULONG * pServerAddress, + ULONG * pServerPort ); + +/*=========================================================================== +METHOD: + SetAGPSConfig + +DESCRIPTION: + This function sets the PDS AGPS configuration + +PARAMETERS: + serverAddress [ I ] - IPv4 address of AGPS server + serverPort [ I ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetAGPSConfig( + ULONG serverAddress, + ULONG serverPort ); + +/*=========================================================================== +METHOD: + GetServiceAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking state for the service + +PARAMETERS: + pbAuto [ O ] - Automatic tracking session started for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServiceAutomaticTracking( ULONG * pbAuto ); + +/*=========================================================================== +METHOD: + SetServiceAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking state for the service + +PARAMETERS: + pbAuto [ I ] - Start automatic tracking session for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetServiceAutomaticTracking( ULONG bAuto ); + +/*=========================================================================== +METHOD: + GetPortAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ O ] - Automatic tracking enabled for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPortAutomaticTracking( ULONG * pbAuto ); + +/*=========================================================================== +METHOD: + SetPortAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ I ] - Enable automatic tracking for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPortAutomaticTracking( ULONG bAuto ); + +/*=========================================================================== +METHOD: + ResetPDSData + +DESCRIPTION: + This function resets the specified PDS data + +PARAMETERS: + pGPSDataMask [ I ] - Bitmask of GPS data to clear (optional) + pCellDataMask [ I ] - Bitmask of cell data to clear (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetPDSData( + ULONG * pGPSDataMask, + ULONG * pCellDataMask ); + +/*=========================================================================== +METHOD: + CATSendTerminalResponse + +DESCRIPTION: + This function sends the terminal response to the device + +PARAMETERS: + refID [ I ] - UIM reference ID (from CAT event) + dataLen [ I ] - Terminal response data length + pData [ I ] - Terminal response data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendTerminalResponse( + ULONG refID, + ULONG dataLen, + BYTE * pData ); + +/*=========================================================================== +METHOD: + CATSendEnvelopeCommand + +DESCRIPTION: + This function sends the envelope command to the device + +PARAMETERS: + cmdID [ I ] - Envelope command ID + dataLen [ I ] - Envelope command data length + pData [ I ] - Envelope command data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendEnvelopeCommand( + ULONG cmdID, + ULONG dataLen, + BYTE * pData ); + +/*=========================================================================== +METHOD: + GetSMSWake + +DESCRIPTION: + This function queries the state of the SMS wake functionality + +PARAMETERS: + pbEnabled [ O ] - SMS wake functionality enabled? + pWakeMask [ O ] - SMS wake mask (only relevant when enabled) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSWake( + ULONG * pbEnabled, + ULONG * pWakeMask ); + +/*=========================================================================== +METHOD: + SetSMSWake + +DESCRIPTION: + This function enables/disables the SMS wake functionality + +PARAMETERS: + bEnable [ I ] - Enable SMS wake functionality? + wakeMask [ I ] - SMS wake mask (only relevant when enabling) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSWake( + ULONG bEnable, + ULONG wakeMask ); + +/*=========================================================================== +METHOD: + OMADMStartSession + +DESCRIPTION: + This function starts an OMA-DM session + +PARAMETERS: + sessionType [ I ] - Type of session to initiate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMStartSession( ULONG sessionType ); + +/*=========================================================================== +METHOD: + OMADMCancelSession + +DESCRIPTION: + This function cancels an ongoing OMA-DM session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMCancelSession(); + +/*=========================================================================== +METHOD: + OMADMGetSessionInfo + +DESCRIPTION: + This function returns information related to the current (or previous + if no session is active) OMA-DM session + +PARAMETERS: + pSessionState [ O ] - State of session + pSessionType [ O ] - Type of session + pFailureReason [ O ] - Session failure reason (when state indicates failure) + pRetryCount [ O ] - Session retry count (when state indicates retrying) + pSessionPause [ O ] - Session pause timer (when state indicates retrying) + pTimeRemaining [ O ] - Pause time remaining (when state indicates retrying) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetSessionInfo( + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ); + +/*=========================================================================== +METHOD: + OMADMGetPendingNIA + +DESCRIPTION: + This function returns information about the pending network initiated + alert + +PARAMETERS: + pSessionType [ O ] - Type of session + pSessionID [ O ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetPendingNIA( + ULONG * pSessionType, + USHORT * pSessionID ); + +/*=========================================================================== +METHOD: + OMADMSendSelection + +DESCRIPTION: + This function sends the specified OMA-DM selection for the current + network initiated session + +PARAMETERS: + selection [ I ] - Selection + sessionID [ I ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSendSelection( + ULONG selection, + USHORT sessionID ); + +/*=========================================================================== +METHOD: + OMADMGetFeatureSettings + +DESCRIPTION: + This function returns the OMA-DM feature settings + +PARAMETERS: + pbProvisioning [ O ] - Device provisioning service update enabled + pbPRLUpdate [ O ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetFeatureSettings( + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ); + +/*=========================================================================== +METHOD: + OMADMSetProvisioningFeature + +DESCRIPTION: + This function sets the OMA-DM device provisioning service + update feature setting + +PARAMETERS: + bProvisioning [ I ] - Device provisioning service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSetProvisioningFeature( + ULONG bProvisioning ); + +/*=========================================================================== +METHOD: + OMADMSetPRLUpdateFeature + +DESCRIPTION: + This function sets the OMA-DM PRL service update feature setting + +PARAMETERS: + bPRLUpdate [ I ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSetPRLUpdateFeature( + ULONG bPRLUpdate ); + +/*=========================================================================== +METHOD: + OriginateUSSD + +DESCRIPTION: + This function initiates a USSD operation + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OriginateUSSD( BYTE * pInfo ); + +/*=========================================================================== +METHOD: + AnswerUSSD + +DESCRIPTION: + This function responds to a USSD request from the network + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AnswerUSSD( BYTE * pInfo ); + +/*=========================================================================== +METHOD: + CancelUSSD + +DESCRIPTION: + This function cancels an in-progress USSD operation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CancelUSSD(); + +/*=========================================================================== +METHOD: + UpgradeFirmware + +DESCRIPTION: + This function performs the following set of steps: + a) Verifies arguments + b) Updates firmware ID on device + c) Resets the device + + NOTE: Upon successful completion the above steps will have been completed, + however the actual upgrade of the firmware will necessarily then + follow. + +PARAMETERS: + pDestinationPath [ I ] - The fully qualified path to the destination folder + that the firmware download service will use + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UpgradeFirmware( CHAR * pDestinationPath ); + +/*=========================================================================== +METHOD: + GetImageInfo + +DESCRIPTION: + Returns image information obtained from the firmware image located at the + provided path + +PARAMETERS: + pPath [ I ] - Location of the firmware image + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImageInfo( + CHAR * pPath, + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ); + +/*=========================================================================== +METHOD: + GetImageStore + +DESCRIPTION: + Returns the image store folder, i.e. the folder co-located with the + QDL Service executable which (by default) contains one or more carrier + specific image subfolders + +PARAMETERS: + pathSize [ I ] - Maximum number of characters (including NULL + terminator) that can be copied to the image + store path array + pImageStorePath [ O ] - The path to the image store + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImageStore( + WORD pathSize, + CHAR * pImageStorePath ); + +/*=========================================================================== +METHOD: + SetSessionStateCallback + +DESCRIPTION: + This function enables/disables the session state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSessionStateCallback( tFNSessionState pCallback ); + +/*=========================================================================== +METHOD: + SetByteTotalsCallback + +DESCRIPTION: + This function enables/disables the RX/TX byte counts callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + interval [ I ] - Interval in seconds (ignored when disabling) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetByteTotalsCallback( + tFNByteTotals pCallback, + BYTE interval ); + +/*=========================================================================== +METHOD: + SetDataCapabilitiesCallback + +DESCRIPTION: + This function enables/disables the serving system data capabilities + callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDataCapabilitiesCallback( + tFNDataCapabilities pCallback ); + +/*=========================================================================== +METHOD: + SetDataBearerCallback + +DESCRIPTION: + This function enables/disables the data bearer status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDataBearerCallback( tFNDataBearer pCallback ); + +/*=========================================================================== +METHOD: + SetDormancyStatusCallback + +DESCRIPTION: + This function enables/disables the dormancy status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDormancyStatusCallback( + tFNDormancyStatus pCallback ); + +/*=========================================================================== +METHOD: + SetMobileIPStatusCallback + +DESCRIPTION: + This function enables/disables the mobile IP status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPStatusCallback( + tFNMobileIPStatus pCallback ); + +/*=========================================================================== +METHOD: + SetActivationStatusCallback + +DESCRIPTION: + This function enables/disables the activation status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetActivationStatusCallback( + tFNActivationStatus pCallback ); + +/*=========================================================================== +METHOD: + SetPowerCallback + +DESCRIPTION: + Enable/disable power operating mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG SetPowerCallback( tFNPower pCallback ); + +/*=========================================================================== +METHOD: + SetWirelessDisableCallback + +DESCRIPTION: + Enables/disables wireless disable state callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG SetWirelessDisableCallback( + tFNWirelessDisable pCallback ); + +/*=========================================================================== +METHOD: + SetRoamingIndicatorCallback + +DESCRIPTION: + This function enables/disables the roaming indicator callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetRoamingIndicatorCallback( + tFNRoamingIndicator pCallback ); + +/*=========================================================================== +METHOD: + SetSignalStrengthCallback + +DESCRIPTION: + This function enables/disables the signal strength callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + thresholdsSize [ I ] - Number of elements the threshold array contain + (a maximum of 5 thresholds is supported), must + be 0 when disabling the callback + pThresholds [ I ] - Signal threshold array (each entry in dBm), + must be 0 when disabling the callback + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSignalStrengthCallback( + tFNSignalStrength pCallback, + BYTE thresholdsSize, + INT8 * pThresholds ); + +/*=========================================================================== +METHOD: + SetRFInfoCallback + +DESCRIPTION: + This function enables/disables the RF information callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetRFInfoCallback( tFNRFInfo pCallback ); + +/*=========================================================================== +METHOD: + SetLURejectCallback + +DESCRIPTION: + This function enables/disables the LU reject callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetLURejectCallback( tFNLUReject pCallback ); + +/*=========================================================================== +METHOD: + SetPLMNModeCallback + +DESCRIPTION: + This function enables/disables the PLMN mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPLMNModeCallback( tFNPLMNMode pCallback ); + +/*=========================================================================== +METHOD: + SetNewSMSCallback + +DESCRIPTION: + This function enables/disables the new SMS callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNewSMSCallback( tFNNewSMS pCallback ); + +/*=========================================================================== +METHOD: + SetNMEACallback + +DESCRIPTION: + This function enables/disables the NMEA sentence callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNMEACallback( tFNNewNMEA pCallback ); + +/*=========================================================================== +METHOD: + SetPDSStateCallback + +DESCRIPTION: + This function enables/disables the PDS service state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSStateCallback( tFNPDSState pCallback ); + +/*=========================================================================== +METHOD: + SetCATEventCallback + +DESCRIPTION: + This function enables/disables the CAT event callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + eventMask [ I ] - Bitmask of CAT events to register for + pErrorMask [ O ] - Error bitmask + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetCATEventCallback( + tFNCATEvent pCallback, + ULONG eventMask, + ULONG * pErrorMask ); + +/*=========================================================================== +METHOD: + SetOMADMAlertCallback + +DESCRIPTION: + This function enables/disables the OMA-DM network initiated alert + callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetOMADMAlertCallback( tFNOMADMAlert pCallback ); + +/*=========================================================================== +METHOD: + SetOMADMStateCallback + +DESCRIPTION: + This function enables/disables the OMA-DM state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetOMADMStateCallback( tFNOMADMState pCallback ); + +/*=========================================================================== +METHOD: + SetUSSDReleaseCallback + +DESCRIPTION: + This function enables/disables the USSD release callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDReleaseCallback( tFNUSSDRelease pCallback ); + +/*=========================================================================== +METHOD: + SetUSSDNotificationCallback + +DESCRIPTION: + This function enables/disables the USSD notification callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDNotificationCallback( + tFNUSSDNotification pCallback ); + +/*=========================================================================== +METHOD: + SetUSSDOriginationCallback + +DESCRIPTION: + Enable/disable USSD origination callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDOriginationCallback( + tFNUSSDOrigination pCallback ); + +#ifdef __cplusplus + }; +#endif + diff --git a/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp b/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp new file mode 100755 index 0000000..b847ca4 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp @@ -0,0 +1,5021 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtExports.cpp + +DESCRIPTION: + QUALCOMM Gobi 3000 Connection Management API exports + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiConnectionMgmt.h" +#include "GobiConnectionMgmtAPI.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum length for adapter device path +const ULONG MAX_AI_DEVICE_PATH = 256; + +// Maximum length for adapter key +const ULONG MAX_AI_KEY = 16; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sAdapterInfo +// Struct to represent Gobi adapter info +/*=========================================================================*/ +struct sAdapterInfo +{ + public: + CHAR mPath[MAX_AI_DEVICE_PATH]; + CHAR mKey[MAX_AI_KEY]; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// Exported Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + QCWWANEnumerateDevices + +DESCRIPTION: + This function enumerates the Gobi devices currently attached to the + system + +PARAMETERS: + pDevicesSize [I/O] - Upon input the maximum number of elements that the + device array can contain. Upon successful output + the actual number of elements in the device array + pDevices [ O ] - The device array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANEnumerateDevices( + BYTE * pDevicesSize, + BYTE * pDevices ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + // Validate arguments + if (pDevicesSize == 0 || pDevices == 0) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxInstances = *pDevicesSize; + *pDevicesSize = 0; + + // Obtain adapter info + std::vector adapters; + adapters = pAPI->GetAvailableDevices(); + + ULONG sz = (ULONG)adapters.size(); + if (sz > (ULONG)maxInstances) + { + sz = (ULONG)maxInstances; + } + + sAdapterInfo * pOutput = (sAdapterInfo *)pDevices; + for (ULONG a = 0; a < sz; a++) + { + const cGobiConnectionMgmt::tDeviceID & id = adapters[a]; + + memset( &pOutput->mPath[0], 0, (SIZE_T)MAX_AI_DEVICE_PATH ); + memset( &pOutput->mKey[0], 0, (SIZE_T)MAX_AI_KEY ); + + ULONG len = id.first.size(); + if (len > 0) + { + if (len >= MAX_AI_DEVICE_PATH) + { + len = MAX_AI_DEVICE_PATH - 1; + } + + memcpy( (LPVOID)&pOutput->mPath[0], + (LPVOID)id.first.c_str(), + (SIZE_T)len ); + } + + len = id.second.size(); + if (len > 0) + { + if (len >= MAX_AI_KEY) + { + len = MAX_AI_KEY - 1; + } + + memcpy( (LPVOID)&pOutput->mKey[0], + (LPCVOID)id.second.c_str(), + (SIZE_T)len ); + } + + pOutput++; + } + + *pDevicesSize = (BYTE)sz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + QCWWANConnect + +DESCRIPTION: + This function connects the CM API library to the specified Gobi + device + + Both device node and key are case sensitive + +PARAMETERS: + pDeviceNode [ I ] - The device node + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANConnect( + CHAR * pDeviceNode, + CHAR * pDeviceKey ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + // Validate arguments + if (pDeviceNode == 0 && pDeviceKey != 0) + { + // If you specify a device key then you have to specify a device ID + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + bool bConnect = pAPI->Connect( (LPCSTR)pDeviceNode, + (LPCSTR)pDeviceKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + return (ULONG)eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + QCWWANCancel + +DESCRIPTION: + This function cancels the most recent outstanding request + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANCancel() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->CancelSend(); +} + +/*=========================================================================== +METHOD: + QCWWANDisconnect + +DESCRIPTION: + This function disconnects the CM API library from the currently + connected Gobi device + +PARAMETERS: + pState [ O ] - State of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANDisconnect() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + bool bDisco = pAPI->Disconnect(); + if (bDisco == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + return (ULONG)eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + QCWWANGetConnectedDeviceID + +DESCRIPTION: + This function returns the Node/key of the device the Gobi CM API library + is currently connected to + +PARAMETERS: + deviceNodeSize [ I ] - The maximum number of characters (including NULL + terminator) that the device Node array can contain + pDeviceNode [ O ] - Device Node (NULL terminated string) + deviceKeySize [ I ] - The maximum number of characters (including NULL + terminator) that the device key array can contain + pDeviceKey [ O ] - Device key (NULL terminated string) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANGetConnectedDeviceID( + ULONG deviceNodeSize, + CHAR * pDeviceNode, + ULONG deviceKeySize, + CHAR * pDeviceKey ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + // Validate arguments + if ( (deviceNodeSize == 0) + || (pDeviceNode == 0) + || (deviceKeySize == 0) + || (pDeviceKey == 0) ) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + *pDeviceNode = 0; + *pDeviceKey = 0; + + std::string devNode = ""; + std::string devKey = ""; + bool bOK = pAPI->GetConnectedDeviceID( devNode, devKey ); + if (bOK == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG lenNode = (ULONG)devNode.size(); + + // Space to perform the copy? + if (deviceNodeSize < lenNode + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pDeviceNode, (LPVOID)devNode.c_str(), lenNode ); + + // Enforce null termination + pDeviceNode[lenNode] = 0; + + ULONG lenKey = (ULONG)devKey.size(); + + // Space to perform the copy? + if (deviceKeySize < lenKey + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pDeviceKey, (LPVOID)devKey.c_str(), lenKey ); + + // Enforce null termination + pDeviceKey[lenKey] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSessionState + +DESCRIPTION: + This function returns the state of the current packet data session + +PARAMETERS: + pState [ O ] - State of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSessionState( ULONG * pState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSessionState( pState ); +} + +/*=========================================================================== +METHOD: + GetSessionDuration + +DESCRIPTION: + This function returns the duration of the current packet data session + +PARAMETERS: + pDuration [ O ] - Duration of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSessionDuration( ULONGLONG * pDuration ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSessionDuration( pDuration ); +} + +/*=========================================================================== +METHOD: + GetDormancyState + +DESCRIPTION: + This function returns the dormancy state of the current packet + data session (when connected) + +PARAMETERS: + pState [ O ] - Dormancy state of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDormancyState( ULONG * pState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetDormancyState( pState ); +} + +/*=========================================================================== +METHOD: + GetAutoconnect (Deprecated) + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + pSetting [ O ] - NDIS autoconnect setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetAutoconnect( ULONG * pSetting ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG dummy; + return (ULONG)pAPI->GetEnhancedAutoconnect( pSetting, &dummy ); +} + +/*=========================================================================== +METHOD: + SetAutoconnect (Deprecated) + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + setting [ I ] - NDIS autoconnect disabled (0) or enabled (non-zero) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetAutoconnect( ULONG setting ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetEnhancedAutoconnect( setting, 0 ); +} + +/*=========================================================================== +METHOD: + GetEnhancedAutoconnect + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + pSetting [ O ] - NDIS autoconnect setting + pRoamSetting [ O ] - NDIS autoconnect roam setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetEnhancedAutoconnect( + ULONG * pSetting, + ULONG * pRoamSetting ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetEnhancedAutoconnect( pSetting, pRoamSetting ); +} + +/*=========================================================================== +METHOD: + SetEnhancedAutoconnect + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + setting [ I ] - NDIS autoconnect setting + pRoamSetting [ I ] - (Optional) NDIS autoconnect roam setting + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetEnhancedAutoconnect( + ULONG setting, + ULONG * pRoamSetting ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetEnhancedAutoconnect( setting, pRoamSetting ); +} + + +/*=========================================================================== +METHOD: + SetDefaultProfile + +DESCRIPTION: + This function writes the default profile settings to the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being written + pPDPType [ I ] - (Optional) PDP type + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pName [ I ] - (Optional) The profile name or description + pAPNName [ I ] - (Optional) Access point name + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetDefaultProfile( profileType, + pPDPType, + pIPAddress, + pPrimaryDNS, + pSecondaryDNS, + pAuthentication, + pName, + pAPNName, + pUsername, + pPassword ); +} + +/*=========================================================================== +METHOD: + GetDefaultProfile + +DESCRIPTION: + This function reads the default profile settings from the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being read + pPDPType [ O ] - PDP type + pIPAddress [ O ] - Preferred assigned IPv4 address + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + pAuthentication [ O ] - Authentication algorithm bitmap + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the profile name array + can contain + pName [ O ] - The profile name or description + apnSize [ I ] - The maximum number of characters (including + NULL terminator) that the APN name array + can contain + pAPNName [ O ] - Access point name represented as a NULL + terminated string (empty string returned when + unknown) + userSize [ I ] - The maximum number of characters (including + NULL terminator) that the username array + can contain + pUsername [ O ] - Username used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetDefaultProfile( profileType, + pPDPType, + pIPAddress, + pPrimaryDNS, + pSecondaryDNS, + pAuthentication, + nameSize, + pName, + apnSize, + pAPNName, + userSize, + pUsername ); +} + +/*=========================================================================== +METHOD: + StartDataSession + +DESCRIPTION: + This function activates a packet data session + +PARAMETERS: + pTechnology [ I ] - (Optional) Technology bitmap + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pPrimaryNBNS [ I ] - (Optional) Primary NetBIOS NS IPv4 address + pSecondaryNBNS [ I ] - (Optional) Secondary NetBIOS NS IPv4 address + pAPNName [ I ] - (Optional) Access point name + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + pSessionId [ O ] - The assigned session ID + pFailureReason [ O ] - Upon call failure the failure reason provided + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG StartDataSession( + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword, + ULONG * pSessionId, + ULONG * pFailureReason ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->StartDataSession( pTechnology, + pPrimaryDNS, + pSecondaryDNS, + pPrimaryNBNS, + pSecondaryNBNS, + pAPNName, + pIPAddress, + pAuthentication, + pUsername, + pPassword, + pSessionId, + pFailureReason ); +} + +/*=========================================================================== +METHOD: + CancelDataSession + +DESCRIPTION: + This function cancels an in-progress packet data session activation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CancelDataSession() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->CancelDataSession(); +} + +/*=========================================================================== +METHOD: + StopDataSession + +DESCRIPTION: + This function stops the current data session + +PARAMETERS: + sessionId [ I ] - The ID of the session to terminate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG StopDataSession( ULONG sessionId ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->StopDataSession( sessionId ); +} + +/*=========================================================================== +METHOD: + GetIPAddress + +DESCRIPTION: + This function returns the current packet data session IP address + +PARAMETERS: + pIPAddress [ O ] - Assigned IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetIPAddress( ULONG * pIPAddress ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->GetIPAddress( pIPAddress ); +} + +/*=========================================================================== +METHOD: + GetConnectionRate + +DESCRIPTION: + This function returns connection rate information for the packet data + connection + +PARAMETERS: + pCurrentChannelTXRate [ O ] - Current channel TX rate (bps) + pCurrentChannelRXRate [ O ] - Current channel RX rate (bps) + pMaxChannelTXRate [ O ] - Maximum channel TX rate (bps) + pMaxChannelRXRate [ O ] - Maximum channel RX rate (bps) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetConnectionRate( + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetConnectionRate( pCurrentChannelTXRate, + pCurrentChannelRXRate, + pMaxChannelTXRate, + pMaxChannelRXRate ); +} + +/*=========================================================================== +METHOD: + GetPacketStatus + +DESCRIPTION: + This function returns the packet data transfer statistics since the start + of the current packet data session + +PARAMETERS: + pTXPacketSuccesses [ O ] - Packets transmitted without error + pRXPacketSuccesses [ O ] - Packets received without error + pTXPacketErrors [ O ] - Outgoing packets with framing errors + pRXPacketErrors [ O ] - Incoming packets with framing errors + pTXPacketOverflows [ O ] - Packets dropped because TX buffer overflowed + pRXPacketOverflows [ O ] - Packets dropped because RX buffer overflowed + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPacketStatus( + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPacketStatus( pTXPacketSuccesses, + pRXPacketSuccesses, + pTXPacketErrors, + pRXPacketErrors, + pTXPacketOverflows, + pRXPacketOverflows ); +} + +/*=========================================================================== +METHOD: + GetByteTotals + +DESCRIPTION: + This function returns the RX/TX byte counts since the start of the + current packet data session + +PARAMETERS: + pTXTotalBytes [ O ] - Bytes transmitted without error + pRXTotalBytes [ O ] - Bytes received without error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetByteTotals( + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetByteTotals( pTXTotalBytes, pRXTotalBytes ); +} + +/*=========================================================================== +METHOD: + SetMobileIP + +DESCRIPTION: + This function sets the current mobile IP setting + +PARAMETERS: + mode [ I ] - Desired mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIP( ULONG mode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetMobileIP( mode ); +} + +/*=========================================================================== +METHOD: + GetMobileIP + +DESCRIPTION: + This function gets the current mobile IP setting + +PARAMETERS: + pMode [ O ] - Current mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIP( ULONG * pMode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetMobileIP( pMode ); +} + +/*=========================================================================== +METHOD: + SetActiveMobileIPProfile + +DESCRIPTION: + This function sets the active mobile IP profile index + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Desired mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetActiveMobileIPProfile( + CHAR * pSPC, + BYTE index ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetActiveMobileIPProfile( pSPC, index ); +} + +/*=========================================================================== +METHOD: + GetActiveMobileIPProfile + +DESCRIPTION: + This function gets the the active mobile IP profile index + +PARAMETERS: + pIndex [ O ] - Active mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetActiveMobileIPProfile( BYTE * pIndex ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetActiveMobileIPProfile( pIndex ); +} + +/*=========================================================================== +METHOD: + SetMobileIPProfile + +DESCRIPTION: + This function sets the specified mobile IP profile settings + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Mobile IP profile ID + pEnabled [ I ] - (Optional) Enable MIP profile? + pAddress [ I ] - (Optional) Home IPv4 address + pPrimaryHA [ I ] - (Optional) Primary home agent IPv4 address + pSecondaryHA [ I ] - (Optional) Secondary home agent IPv4 address + bRevTunneling [ I ] - (Optional) Enable reverse tunneling? + pNAI [ I ] - (Optional) Network access identifier string + pHASPI [ I ] - (Optional) HA security parameter index + pAAASPI [ I ] - (Optional) AAA security parameter index + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPProfile( + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetMobileIPProfile( pSPC, + index, + pEnabled, + pAddress, + pPrimaryHA, + pSecondaryHA, + pRevTunneling, + pNAI, + pHASPI, + pAAASPI, + pMNHA, + pMNAAA ); +} + +/*=========================================================================== +METHOD: + GetMobileIPProfile + +DESCRIPTION: + This function gets the specified mobile IP profile settings + +PARAMETERS: + index [ I ] - Mobile IP profile ID + pEnabled [ O ] - Mobile IP profile enabled? + pAddress [ O ] - Home IPv4 address + pPrimaryHA [ O ] - Primary home agent IPv4 address + pSecondaryHA [ O ] - Secondary home agent IPv4 address + pRevTunneling [ O ] - Reverse tunneling enabled? + naiSize [ I ] - The maximum number of characters (including NULL + terminator) that the NAI array can contain + pNAI [ O ] - Network access identifier string + pHASPI [ O ] - HA security parameter index + pAAASPI [ O ] - AAA security parameter index + pHAState [ O ] - HA key state + pAAAState [ O ] - AAA key state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIPProfile( + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetMobileIPProfile( index, + pEnabled, + pAddress, + pPrimaryHA, + pSecondaryHA, + pRevTunneling, + naiSize, + pNAI, + pHASPI, + pAAASPI, + pHAState, + pAAAState ); +} + +/*=========================================================================== +METHOD: + SetMobileIPParameters + +DESCRIPTION: + This function sets the specified mobile IP parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pMode [ I ] - (Optional) Desired mobile IP setting + pRetryLimit [ I ] - (Optional) Retry attempt limit + pRetryInterval [ I ] - (Optional) Retry attempt interval + pReRegPeriod [ I ] - (Optional) Re-registration period + pReRegTraffic [ I ] - (Optional) Re-registration only with traffic? + pHAAuthenticator [ I ] - (Optional) MH-HA authenticator calculator? + pHA2002bis [ I ] - (Optional) MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPParameters( + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetMobileIPParameters( pSPC, + pMode, + pRetryLimit, + pRetryInterval, + pReRegPeriod, + pReRegTraffic, + pHAAuthenticator, + pHA2002bis ); +} + +/*=========================================================================== +METHOD: + GetMobileIPParameters + +DESCRIPTION: + This function gets the mobile IP parameters + +PARAMETERS: + pMode [ O ] - Current mobile IP setting + pRetryLimit [ O ] - Retry attempt limit + pRetryInterval [ O ] - Retry attempt interval + pReRegPeriod [ O ] - Re-registration period + pReRegTraffic [ O ] - Re-registration only with traffic? + pHAAuthenticator [ O ] - MH-HA authenticator calculator? + pHA2002bis [ O ] - MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIPParameters( + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetMobileIPParameters( pMode, + pRetryLimit, + pRetryInterval, + pReRegPeriod, + pReRegTraffic, + pHAAuthenticator, + pHA2002bis ); +} + +/*=========================================================================== +METHOD: + GetLastMobileIPError + +DESCRIPTION: + This function gets the last mobile IP error + +PARAMETERS: + pError [ O ] - Last mobile IP error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetLastMobileIPError( ULONG * pError ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetLastMobileIPError( pError ); +} + +/*=========================================================================== +METHOD: + SetDNSSettings + +DESCRIPTION: + This function sets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetDNSSettings( pPrimaryDNS, pSecondaryDNS ); +} + +/*=========================================================================== +METHOD: + GetDNSSettings + +DESCRIPTION: + This function gets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetDNSSettings( pPrimaryDNS, pSecondaryDNS ); +} + +/*=========================================================================== +METHOD: + GetANAAAAuthenticationStatus + +DESCRIPTION: + This function gets the AN-AAA authentication status + +PARAMETERS: + pStatus [ O ] - AN-AAA authentication status + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetANAAAAuthenticationStatus( ULONG * pStatus ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetANAAAAuthenticationStatus( pStatus ); +} + +/*=========================================================================== +METHOD: + GetSignalStrengths + +DESCRIPTION: + This function gets the current available signal strengths (in dBm) + as measured by the device + +PARAMETERS: + pArraySizes [I/O] - Upon input the maximum number of elements + that each array can contain can contain. + Upon successful output the actual number + of elements in each array + pSignalStrengths [ O ] - Received signal strength array (dBm) + pRadioInterfaces [ O ] - Radio interface technology array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSignalStrengths( + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSignalStrengths( pArraySizes, + pSignalStrengths, + pRadioInterfaces ); +} + +/*=========================================================================== +METHOD: + GetRFInfo + +DESCRIPTION: + This function gets the current RF information + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + RF info instance array can contain. Upon success + the actual number of elements in the RF info + instance array + pInstances [ O ] - The RF info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetRFInfo( + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetRFInfo( pInstanceSize, pInstances ); +} + + + +/*=========================================================================== +METHOD: + PerformNetworkScan + +DESCRIPTION: + This function performs a scan for available networks + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PerformNetworkScan( + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->PerformNetworkScan( pInstanceSize, pInstances ); +} + +/*=========================================================================== +METHOD: + PerformNetworkRATScan + +DESCRIPTION: + This function performs a scan for available networks (includes RAT) + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + pRATSize [I/O] - Upon input the maximum number of elements that the + RAT info instance array can contain. Upon success + the actual number of elements in the RAT info + instance array + pRATInstances [ O ] - The RAT info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PerformNetworkRATScan( + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->PerformNetworkRATScan( pInstanceSize, + pInstances, + pRATSize, + pRATInstances ); +} + +/*=========================================================================== +METHOD: + InitiateNetworkRegistration + +DESCRIPTION: + This function initiates a network registration + +PARAMETERS: + regType [ I ] - Registration type + mcc [ I ] - Mobile country code (ignored for auto registration) + mnc [ I ] - Mobile network code (ignored for auto registration) + rat [ I ] - Radio access type (ignored for auto registration) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG InitiateNetworkRegistration( + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->InitiateNetworkRegistration( regType, + mcc, + mnc, + rat ); +} + +/*=========================================================================== +METHOD: + InitiateDomainAttach + +DESCRIPTION: + This function initiates a domain attach (or detach) + +PARAMETERS: + action [ I ] - PS attach action (attach or detach) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG InitiateDomainAttach( ULONG action ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->InitiateDomainAttach( action ); +} + +/*=========================================================================== +METHOD: + GetServingNetwork + +DESCRIPTION: + Gets information regarding the system that currently provides service + to the device + +PARAMETERS: + pRegistrationState [ O ] - Registration state + pCSDomain [ O ] - Circuit switch domain status + pPSDomain [ O ] - Packet switch domain status + pRAN [ O ] - Radio access network + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. Upon + successful output the actual number of elements + in the radio interface array + pRadioIfaces [ O ] - The radio interface array + pRoaming [ O ] - Roaming indicator (0xFFFFFFFF - Unknown) + pMCC [ O ] - Mobile country code (0xFFFF - Unknown) + pMNC [ O ] - Mobile network code (0xFFFF - Unknown) + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the network name array + can contain + pName [ O ] - The network name or description represented + as a NULL terminated string (empty string + returned when unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServingNetwork( + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetServingNetwork( pRegistrationState, + pCSDomain, + pPSDomain, + pRAN, + pRadioIfacesSize, + pRadioIfaces, + pRoaming, + pMCC, + pMNC, + nameSize, + pName ); +} + +/*=========================================================================== +METHOD: + GetServingNetworkCapabilities + +DESCRIPTION: + Gets information regarding the data capabilities of the system that + currently provides service to the device + +PARAMETERS: + pDataCapsSize [I/O] - Upon input the maximum number of elements that the + data capabilities array can contain. Upon success + the actual number of elements in the data + capabilities array + pDataCaps [ O ] - The data capabilities array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServingNetworkCapabilities( + BYTE * pDataCapsSize, + BYTE * pDataCaps ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetServingNetworkCapabilities( pDataCapsSize, + pDataCaps ); +} + +/*=========================================================================== +METHOD: + GetDataBearerTechnology + +DESCRIPTION: + This function retrieves the current data bearer technology (only + valid when connected) + +PARAMETERS: + pDataCaps [ O ] - The data bearer technology + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDataBearerTechnology( ULONG * pDataBearer ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetDataBearerTechnology( pDataBearer ); +} + +/*=========================================================================== +METHOD: + GetHomeNetwork + +DESCRIPTION: + This function retrieves information about the home network of the device + +PARAMETERS: + pMCC [ O ] - Mobile country code + pMNC [ O ] - Mobile network code + nameSize [ I ] - The maximum number of characters (including NULL + terminator) that the network name array can contain + pName [ O ] - The network name or description represented as a NULL + terminated string (empty string returned when unknown) + pSID [ O ] - Home network system ID (0xFFFF - Unknown) + pNID [ O ] - Home network ID (0xFFFF - Unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetHomeNetwork( + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetHomeNetwork( pMCC, + pMNC, + nameSize, + pName, + pSID, + pNID ); +} + +/*=========================================================================== +METHOD: + SetNetworkPreference + +DESCRIPTION: + This function sets the network registration preference + +PARAMETERS: + technologyPref [ I ] - Technology preference bitmap + duration [ I ] - Duration of active preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNetworkPreference( + ULONG technologyPref, + ULONG duration ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetNetworkPreference( technologyPref, duration ); +} + +/*=========================================================================== +METHOD: + GetNetworkPreference + +DESCRIPTION: + This function returns the network registration preference + +PARAMETERS: + pTechnologyPref [ O ] - Technology preference bitmap + pDuration [ O ] - Duration of active preference + pPersistentTechnologyPref [ O ] - Persistent technology preference bitmap + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetNetworkPreference( + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetNetworkPreference( pTechnologyPref, + pDuration, + pPersistentTechnologyPref ); +} + +/*=========================================================================== +METHOD: + SetCDMANetworkParameters + +DESCRIPTION: + This function sets the desired CDMA network parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pForceRev0 [ I ] - (Optional) Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ I ] - (Optional) Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ I ] - (Optional) Protocol mask for custom SCP config + pBroadcast [ I ] - (Optional) Broadcast mask for custom SCP config + pApplication [ I ] - (Optional) Application mask for custom SCP config + pRoaming [ I ] - (Optional) Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetCDMANetworkParameters( + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetCDMANetworkParameters( pSPC, + pForceRev0, + pCustomSCP, + pProtocol, + pBroadcast, + pApplication, + pRoaming ); +} + +/*=========================================================================== +METHOD: + GetEVDONetworkParameters + +DESCRIPTION: + This function gets the current CDMA network parameters + +PARAMETERS: + pSCI [ O ] - Slot cycle index + pSCM [ O ] - Station class mark + pRegHomeSID [ O ] - Register on home SID? + pRegForeignSID [ O ] - Register on foreign SID? + pRegForeignNID [ O ] - Register on foreign NID? + pForceRev0 [ O ] - Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ O ] - Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ O ] - Protocol mask for custom SCP config + pBroadcast [ O ] - Broadcast mask for custom SCP config + pApplication [ O ] - Application mask for custom SCP config + pRoaming [ O ] - Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetCDMANetworkParameters( + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->GetCDMANetworkParameters( pSCI, + pSCM, + pRegHomeSID, + pRegForeignSID, + pRegForeignNID, + pForceRev0, + pCustomSCP, + pProtocol, + pBroadcast, + pApplication, + pRoaming ); +} + +/*=========================================================================== +METHOD: + GetACCOLC + +DESCRIPTION: + This function returns the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pACCOLC [ O ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetACCOLC( BYTE * pACCOLC ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetACCOLC( pACCOLC ); +} + +/*=========================================================================== +METHOD: + SetACCOLC + +DESCRIPTION: + This function sets the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + accolc [ I ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetACCOLC( + CHAR * pSPC, + BYTE accolc ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetACCOLC( pSPC, accolc ); +} + +/*=========================================================================== +METHOD: + GetPLMNMode + +DESCRIPTION: + This function returns the PLMN mode from the CSP + +PARAMETERS: + pMode [ O ] - PLMN mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPLMNMode( ULONG * pMode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->GetPLMNMode( pMode ); +} + +/*=========================================================================== +METHOD: + GetPLMNName + +DESCRIPTION: + This function returns PLMN name information for the given MCC/MNC + +PARAMETERS: + mcc [ I ] - Mobile country code + mnc [ I ] - Mobile network code + pNamesSize [I/O] - Upon input the size in BYTEs of the name structure + array. Upon success the actual number of BYTEs + copied to the name structure array + pNames [ O ] - The name structure array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPLMNName( + USHORT mcc, + USHORT mnc, + ULONG * pNamesSize, + BYTE * pNames ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->GetPLMNName( mcc, mnc, pNamesSize, pNames ); +} + +/*=========================================================================== +METHOD: + GetDeviceCapabilities + +DESCRIPTION: + This function gets device capabilities + +PARAMETERS: + pMaxTXChannelRate [ O ] - Maximum transmission rate (bps) + pMaxRXChannelRate [ O ] - Maximum reception rate (bps) + pDataServiceCapability [ O ] - CS/PS data service capability + pSimCapability [ O ] - Device SIM support + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. + Upon successful output the actual number + of elements in the radio interface array + pRadioIfaces [ O ] - The radio interface array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDeviceCapabilities( + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetDeviceCapabilities( pMaxTXChannelRate, + pMaxRXChannelRate, + pDataServiceCapability, + pSimCapability, + pRadioIfacesSize, + pRadioIfaces ); +} + +/*=========================================================================== +METHOD: + GetManufacturer + +DESCRIPTION: + This function returns the device manufacturer name + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetManufacturer( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetManufacturer( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + GetModelID + +DESCRIPTION: + This function returns the device model ID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetModelID( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetModelID( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + GetFirmwareRevision + +DESCRIPTION: + This function returns the device firmware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareRevision( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetFirmwareRevision( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + GetFirmwareRevisions + +DESCRIPTION: + This function returns the device firmware (AMSS, boot, and PRI) + revisions + +PARAMETERS: + amssSize [ I ] - The maximum number of characters (including NULL + terminator) that the AMSS string array can contain + pAMSSString [ O ] - NULL terminated AMSS revision string + bootSize [ I ] - The maximum number of characters (including NULL + terminator) that the boot string array can contain + pBootString [ O ] - NULL terminated boot code revision string + priSize [ I ] - The maximum number of characters (including NULL + terminator) that the PRI string array can contain + pPRIString [ O ] - NULL terminated PRI revision string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareRevisions( + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetFirmwareRevisions( amssSize, + pAMSSString, + bootSize, + pBootString, + priSize, + pPRIString ); +} + +/*=========================================================================== +METHOD: + GetFirmwareInfo + +DESCRIPTION: + Returns image information obtained from the current device firmware + +PARAMETERS: + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareInfo( + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetFirmwareInfo( pFirmwareID, + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); +} + +/*=========================================================================== +METHOD: + GetVoiceNumber + +DESCRIPTION: + This function returns the voice number in use by the device + +PARAMETERS: + voiceNumberSize [ I ] - The maximum number of characters (including NULL + terminator) that the voice number array can + contain + pVoiceNumber [ O ] - Voice number (MDN or ISDN) string + minSize [ I ] - The maximum number of characters (including NULL + terminator) that the MIN array can contain + pMIN [ O ] - MIN string (empty string returned when MIN is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetVoiceNumber( + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetVoiceNumber( voiceNumberSize, + pVoiceNumber, + minSize, + pMIN ); +} + +/*=========================================================================== +METHOD: + GetIMSI + +DESCRIPTION: + This function returns the device IMSI + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetIMSI( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetIMSI( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + GetSerialNumbers + +DESCRIPTION: + This command returns all serial numbers assigned to the device + +PARAMETERS: + esnSize [ I ] - The maximum number of characters (including NULL + terminator) that the ESN array can contain + pESNString [ O ] - ESN string (empty string returned when ESN is + not supported/programmed) + imeiSize [ I ] - The maximum number of characters (including NULL + terminator) that the IMEI array can contain + pIMEIString [ O ] - IMEI string (empty string returned when IMEI is + not supported/programmed) + meidSize [ I ] - The maximum number of characters (including NULL + terminator) that the MEID array can contain + pMEIDString [ O ] - MEID string (empty string returned when MEID is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSerialNumbers( + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSerialNumbers( esnSize, + pESNString, + imeiSize, + pIMEIString, + meidSize, + pMEIDString ); +} + +/*=========================================================================== +METHOD: + SetLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + state [ I ] - Desired lock state + pCurrentPIN [ I ] - Current four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetLock( + ULONG state, + CHAR * pCurrentPIN ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetLock( state, pCurrentPIN ); +} + +/*=========================================================================== +METHOD: + QueryLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + pState [ O ] - Current lock state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QueryLock( ULONG * pState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->QueryLock( pState ); +} + +/*=========================================================================== +METHOD: + ChangeLockPIN + +DESCRIPTION: + This command sets the user lock code maintained by the device + +PARAMETERS: + pCurrentPIN [ O ] - Current four digit PIN string + pDesiredPIN [ O ] - New four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ChangeLockPIN( + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->ChangeLockPIN( pCurrentPIN, pDesiredPIN ); +} + +/*=========================================================================== +METHOD: + GetHardwareRevision + +DESCRIPTION: + This function returns the device hardware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetHardwareRevision( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetHardwareRevision( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + GetPRLVersion + +DESCRIPTION: + This function returns the version of the active Preferred Roaming List + (PRL) in use by the device + +PARAMETERS: + pPRLVersion [ O ] - The PRL version number + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPRLVersion( WORD * pPRLVersion ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPRLVersion( pPRLVersion ); +} + +/*=========================================================================== +METHOD: + GetERIFile + +DESCRIPTION: + This command returns the ERI file that is stored in EFS on the device + +PARAMETERS: + pFileSize [I/O] - Upon input the maximum number of bytes that the file + contents array can contain. Upon successful output + the actual number of bytes written to the file contents + array + pFile [ O ] - The file contents + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetERIFile( + ULONG * pFileSize, + BYTE * pFile ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetERIFile( pFileSize, pFile ); +} + +/*=========================================================================== +METHOD: + ActivateAutomatic + +DESCRIPTION: + This function requests the device to perform automatic service activation + +PARAMETERS: + pActivationCode [ I ] - Activation code (maximum string length of 12) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ActivateAutomatic( CHAR * pActivationCode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->ActivateAutomatic( pActivationCode ); +} + +/*=========================================================================== +METHOD: + ActivateManual + +DESCRIPTION: + This function requests the device perform manual service activation + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + sid [ I ] - System identification number + pMDN [ I ] - Mobile Directory Number string + pMIN [ I ] - Mobile Identification Number string + prlSize [ I ] - (Optional) Size of PRL file array + pPRL [ I ] - (Optional) The PRL file contents + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ActivateManual( + CHAR * pSPC, + WORD sid, + CHAR * pMDN, + CHAR * pMIN, + ULONG prlSize, + BYTE * pPRL, + CHAR * pMNHA, + CHAR * pMNAAA ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->ActivateManual( pSPC, + sid, + pMDN, + pMIN, + prlSize, + pPRL, + pMNHA, + pMNAAA ); +} + +/*=========================================================================== +METHOD: + ResetToFactoryDefaults + +DESCRIPTION: + This function requests the device reset configuration to factory defaults + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetToFactoryDefaults( CHAR * pSPC ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->ResetToFactoryDefaults( pSPC ); +} + +/*=========================================================================== +METHOD: + GetActivationState + +DESCRIPTION: + This function returns the device activation state + +PARAMETERS: + pActivationState [ O ] - Service activation state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetActivationState( ULONG * pActivationState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetActivationState( pActivationState ); +} + +/*=========================================================================== +METHOD: + SetPower + +DESCRIPTION: + This function sets the operating mode of the device + +PARAMETERS: + powerMode [ I ] - Selected operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPower( ULONG powerMode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetPower( powerMode ); +} + +/*=========================================================================== +METHOD: + GetPower + +DESCRIPTION: + This function returns the operating mode of the device + +PARAMETERS: + pPowerMode [ O ] - Current operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPower( ULONG * pPowerMode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPower( pPowerMode ); +} + +/*=========================================================================== +METHOD: + GetOfflineReason + +DESCRIPTION: + This function returns the reason why the operating mode of the device + is currently offline + +PARAMETERS: + pReasonMask [ O ] - Bitmask of offline reasons + pbPlatform [ O ] - Offline due to being platform retricted? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetOfflineReason( + ULONG * pReasonMask, + ULONG * pbPlatform ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetOfflineReason( pReasonMask, pbPlatform ); +} + +/*=========================================================================== +METHOD: + GetNetworkTime + +DESCRIPTION: + This function returns the current time of the device + +PARAMETERS: + pTimeStamp [ O ] - Count of 1.25ms that have elapsed from the start + of GPS time (Jan 6, 1980) + pTimeSource [ O ] - Source of the timestamp + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetNetworkTime( + ULONGLONG * pTimeCount, + ULONG * pTimeSource ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetNetworkTime( pTimeCount, pTimeSource ); +} + +/*=========================================================================== +METHOD: + ValidateSPC + +DESCRIPTION: + This function validates the service programming code + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ValidateSPC( CHAR * pSPC ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->ValidateSPC( pSPC ); +} + +/*=========================================================================== +METHOD: + DeleteSMS + +DESCRIPTION: + This function deletes one or more SMS messages from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + pMessageIndex [ I ] - (Optional) message index + pMessageTag [ I ] - (Optional) message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DeleteSMS( + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->DeleteSMS( storageType, pMessageIndex, pMessageTag ); +} + +/*=========================================================================== +METHOD: + GetSMSList + +DESCRIPTION: + This function returns the list of SMS messages stored on the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + pRequestedTag [ I ] - Message index + pMessageListSize [I/O] - Upon input the maximum number of elements that the + message list array can contain. Upon successful + output the actual number of elements in the message + list array + pMessageList [ O ] - The message list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSList( + ULONG storageType, + ULONG * pRequestedTag, + ULONG * pMessageListSize, + BYTE * pMessageList ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSMSList( storageType, + pRequestedTag, + pMessageListSize, + pMessageList ); +} + +/*=========================================================================== +METHOD: + GetSMS + +DESCRIPTION: + This function returns an SMS message from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + pMessageTag [ O ] - Message tag + pMessageFormat [ O ] - Message format + pMessageSize [I/O] - Upon input the maximum number of bytes that can be + written to the message array. Upon successful + output the actual number of bytes written to the + message array + pMessage [ I ] - The message contents array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMS( + ULONG storageType, + ULONG messageIndex, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSMS( storageType, + messageIndex, + pMessageTag, + pMessageFormat, + pMessageSize, + pMessage ); +} + +/*=========================================================================== +METHOD: + ModifySMSStatus + +DESCRIPTION: + This function modifies the status of an SMS message saved in storage on + the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + messageTag [ I ] - Message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ModifySMSStatus( + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->ModifySMSStatus( storageType, messageIndex, messageTag ); +} + +/*=========================================================================== +METHOD: + SaveSMS + +DESCRIPTION: + This function saves an SMS message to device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageIndex [ O ] - The message index assigned by the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SaveSMS( + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageIndex ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SaveSMS( storageType, + messageFormat, + messageSize, + pMessage, + pMessageIndex ); +} + +/*=========================================================================== +METHOD: + SendSMS + +DESCRIPTION: + This function sends an SMS message for immediate over the air transmission + +PARAMETERS: + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageFailureCode [ O ] - When the function fails due to an error sending + the message this parameter may contain the + message failure cause code (see 3GPP2 N.S0005 + Section 6.5.2.125). If the cause code is not + provided then the value will be 0xFFFFFFFF + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SendSMS( + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageFailureCode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SendSMS( messageFormat, + messageSize, + pMessage, + pMessageFailureCode ); +} + +/*=========================================================================== +METHOD: + GetSMSCAddress + +DESCRIPTION: + This function returns the SMS center address + +PARAMETERS: + addressSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address array + can contain + pSMSCAddress [ 0 ] - The SMS center address represented as a NULL + terminated string + typeSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address type array + can contain + pSMSCType [ 0 ] - The SMS center address type represented as a NULL + terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSCAddress( + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSMSCAddress( addressSize, + pSMSCAddress, + typeSize, + pSMSCType ); +} + +/*=========================================================================== +METHOD: + SetSMSCAddress + +DESCRIPTION: + This function sets the SMS center address + +PARAMETERS: + pSMSCAddress [ 0 ] - The SMS center address represented as a NULL + terminated string + pSMSCType [ 0 ] - The SMS center address type represented as a NULL + terminated string (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSCAddress( + CHAR * pSMSCAddress, + CHAR * pSMSCType ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetSMSCAddress( pSMSCAddress, pSMSCType ); +} + +/*=========================================================================== +METHOD: + GetSMSRoutes + +DESCRIPTION: + This function gets the current incoming SMS routing information + +PARAMETERS: + pRouteSize [I/O] - Upon input the maximum number of elements that the + SMS route array can contain. Upon succes the actual + number of elements in the SMS route array + pRoutes [ O ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSMSRoutes( pRouteSize, pRoutes ); +} + +/*=========================================================================== +METHOD: + SetSMSRoutes + +DESCRIPTION: + This function sets the desired incoming SMS routing information + +PARAMETERS: + pRouteSize [ I ] - The number of elements in the SMS route array + pRoutes [ I ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetSMSRoutes( pRouteSize, pRoutes ); +} + +/*=========================================================================== +METHOD: + UIMSetPINProtection + +DESCRIPTION: + This function enables or disables protection of UIM contents by a + given PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + bEnable [ I ] - Enable/disable PIN protection (0 = disable)? + pValue [ I ] - PIN value of the PIN to be enabled/disabled + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetPINProtection( + ULONG id, + ULONG bEnable, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMSetPINProtection( id, + bEnable, + pValue, + pVerifyRetriesLeft, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMVerifyPIN + +DESCRIPTION: + This function verifies the PIN before accessing the UIM contents + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pValue [ I ] - PIN value of the PIN to verify + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMVerifyPIN( + ULONG id, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMVerifyPIN( id, + pValue, + pVerifyRetriesLeft, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMUnblockPIN + +DESCRIPTION: + This function unblocks a blocked PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pPUKValue [ I ] - PUK value of the PIN to unblock + pNewValue [ I ] - New PIN value of the PIN to unblock + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockPIN( + ULONG id, + CHAR * pPUKValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMUnblockPIN( id, + pPUKValue, + pNewValue, + pVerifyRetriesLeft, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMChangePIN + +DESCRIPTION: + This function change the PIN value + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pOldValue [ I ] - Old PIN value of the PIN to change + pNewValue [ I ] - New PIN value of the PIN to change + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangePIN( + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMChangePIN( id, + pOldValue, + pNewValue, + pVerifyRetriesLeft, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMGetPINStatus + +DESCRIPTION: + This function returns the status of the pin + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pStatus [ O ] - PIN status (0xFFFFFFFF = unknown) + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetPINStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMGetPINStatus( id, + pStatus, + pVerifyRetriesLeft, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMGetICCID + +DESCRIPTION: + This function returns the UIM ICCID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetICCID( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMGetICCID( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + UIMGetControlKeyStatus + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetControlKeyStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMGetControlKeyBlockingStatus( id, + pStatus, + pVerifyRetriesLeft, + pUnblockRetriesLeft, + 0 ); +} + +/*=========================================================================== +METHOD: + UIMGetControlKeyBlockingStatus + +DESCRIPTION: + This function returns the blocking status of the specified facility + control key + +PARAMETERS: + id [ I ] - Facility ID + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + pbBlocking [ O ] - (Optional) Is the facility blocking? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetControlKeyBlockingStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMGetControlKeyBlockingStatus( id, + pStatus, + pVerifyRetriesLeft, + pUnblockRetriesLeft, + pbBlocking); +} + +/*=========================================================================== +METHOD: + UIMSetControlKeyProtection + +DESCRIPTION: + This function changes the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + status [ I ] - Control key status + pValue [ I ] - Control key de-personalization string + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + control key will be blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetControlKeyProtection( + ULONG id, + ULONG status, + CHAR * pValue, + ULONG * pVerifyRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMSetControlKeyProtection( id, + status, + pValue, + pVerifyRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMUnblockControlKey + +DESCRIPTION: + This function unblocks the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pValue [ I ] - Control key de-personalization string + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockControlKey( + ULONG id, + CHAR * pValue, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMUnblockControlKey( id, + pValue, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + GetPDSState + +DESCRIPTION: + This function returns the current PDS state + +PARAMETERS: + pEnabled [ O ] - Current PDS state (0 = disabled) + pTracking [ O ] - Current PDS tracking session state + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPDSState( + ULONG * pEnabled, + ULONG * pTracking ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPDSState( pEnabled, pTracking ); +} + +/*=========================================================================== +METHOD: + SetPDSState + +DESCRIPTION: + This function sets the PDS state + +PARAMETERS: + enable [ I ] - Desired PDS state (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSState( ULONG enable ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPDSState( enable ); +} + +/*=========================================================================== +METHOD: + PDSInjectTimeReference + +DESCRIPTION: + This function injects a system time into the PDS engine + +PARAMETERS: + sysTime [ I ] - System time + sysDiscontinuities [ I ] - Number of system time discontinuities + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeReference( + ULONGLONG systemTime, + USHORT systemDiscontinuities ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->PDSInjectTimeReference( systemTime, + systemDiscontinuities ); +} + +/*=========================================================================== +METHOD: + GetPDSDefaults + +DESCRIPTION: + This function returns the default tracking session configuration + +PARAMETERS: + pOperation [ O ] - Current session operating mode + pTimeout [ O ] - Maximum amount of time (seconds) to work on each fix + pInterval [ O ] - Interval (milliseconds) between fix requests + pAccuracy [ O ] - Current accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPDSDefaults( + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPDSDefaults( pOperation, + pTimeout, + pInterval, + pAccuracy ); +} + +/*=========================================================================== +METHOD: + SetPDSDefaults + +DESCRIPTION: + This function sets the default tracking session configuration + +PARAMETERS: + operation [ I ] - Desired session operating mode + timeout [ I ] - Maximum amount of time (seconds) to work on each fix + interval [ I ] - Interval (milliseconds) between fix requests + accuracy [ I ] - Desired accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSDefaults( + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPDSDefaults( operation, + timeout, + interval, + accuracy ); +} + +/*=========================================================================== +METHOD: + GetXTRAAutomaticDownload + +DESCRIPTION: + This function returns the XTRA automatic download configuration + +PARAMETERS: + pbEnabled [ O ] - Automatic download enabled? + pInterval [ O ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRAAutomaticDownload( + ULONG * pbEnabled, + USHORT * pInterval ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetXTRAAutomaticDownload( pbEnabled, pInterval ); +} + +/*=========================================================================== +METHOD: + SetXTRAAutomaticDownload + +DESCRIPTION: + This function sets the XTRA automatic download configuration + +PARAMETERS: + bEnabled [ I ] - Automatic download enabled? + interval [ I ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRAAutomaticDownload( + ULONG bEnabled, + USHORT interval ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetXTRAAutomaticDownload( bEnabled, interval ); +} + +/*=========================================================================== +METHOD: + GetXTRANetwork + +DESCRIPTION: + This function returns the XTRA WWAN network preference + +PARAMETERS: + pPreference [ O ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRANetwork( ULONG * pPreference ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetXTRANetwork( pPreference ); +} + +/*=========================================================================== +METHOD: + SetXTRANetwork + +DESCRIPTION: + This function sets the XTRA WWAN network preference + +PARAMETERS: + preference [ I ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRANetwork( ULONG preference ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetXTRANetwork( preference ); +} + +/*=========================================================================== +METHOD: + GetXTRAValidity + +DESCRIPTION: + This function returns the XTRA database validity period + +PARAMETERS: + pGPSWeek [ O ] - Starting GPS week of validity period + pGPSWeekOffset [ O ] - Starting GPS week offset (minutes) of validity period + pDuration [ O ] - Length of validity period (hours) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRAValidity( + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetXTRAValidity( pGPSWeek, + pGPSWeekOffset, + pDuration ); +} + +/*=========================================================================== +METHOD: + ForceXTRADownload + +DESCRIPTION: + This function forces the XTRA database to be downloaded to the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ForceXTRADownload() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->ForceXTRADownload(); +} + +/*=========================================================================== +METHOD: + GetXTRADataState + +DESCRIPTION: + This function returns the XTRA data positioning state + +PARAMETERS: + pState [ O ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRADataState( ULONG * pState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetXTRADataState( pState ); +} + +/*=========================================================================== +METHOD: + SetXTRADataState + +DESCRIPTION: + This function sets the XTRA data positioning state + +PARAMETERS: + state [ I ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRADataState( ULONG state ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetXTRADataState( state ); +} + +/*=========================================================================== +METHOD: + GetXTRATimeState + +DESCRIPTION: + This function returns the XTRA time positioning state + +PARAMETERS: + pState [ O ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRATimeState( ULONG * pState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetXTRATimeState( pState ); +} + +/*=========================================================================== +METHOD: + SetXTRATimeState + +DESCRIPTION: + This function sets the XTRA time positioning state + +PARAMETERS: + state [ I ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRATimeState( ULONG state ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetXTRATimeState( state ); +} + +/*=========================================================================== +METHOD: + GetAGPSConfig + +DESCRIPTION: + This function returns the PDS AGPS configuration + +PARAMETERS: + pServerAddress [ O ] - IPv4 address of AGPS server + pServerPort [ O ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetAGPSConfig( + ULONG * pServerAddress, + ULONG * pServerPort ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetAGPSConfig( pServerAddress, pServerPort ); +} + +/*=========================================================================== +METHOD: + SetAGPSConfig + +DESCRIPTION: + This function sets the PDS AGPS configuration + +PARAMETERS: + serverAddress [ I ] - IPv4 address of AGPS server + serverPort [ I ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetAGPSConfig( + ULONG serverAddress, + ULONG serverPort ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetAGPSConfig( serverAddress, serverPort ); +} + +/*=========================================================================== +METHOD: + GetServiceAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking state for the service + +PARAMETERS: + pbAuto [ O ] - Automatic tracking session started for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServiceAutomaticTracking( ULONG * pbAuto ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetServiceAutomaticTracking( pbAuto ); +} + +/*=========================================================================== +METHOD: + SetServiceAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking state for the service + +PARAMETERS: + pbAuto [ I ] - Start automatic tracking session for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetServiceAutomaticTracking( ULONG bAuto ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetServiceAutomaticTracking( bAuto ); +} + +/*=========================================================================== +METHOD: + GetPortAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ O ] - Automatic tracking enabled for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPortAutomaticTracking( ULONG * pbAuto ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPortAutomaticTracking( pbAuto ); +} + +/*=========================================================================== +METHOD: + SetPortAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ I ] - Enable automatic tracking for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPortAutomaticTracking( ULONG bAuto ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPortAutomaticTracking( bAuto ); +} + +/*=========================================================================== +METHOD: + ResetPDSData + +DESCRIPTION: + This function resets the specified PDS data + +PARAMETERS: + pGPSDataMask [ I ] - Bitmask of GPS data to clear (optional) + pCellDataMask [ I ] - Bitmask of cell data to clear (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetPDSData( + ULONG * pGPSDataMask, + ULONG * pCellDataMask ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->ResetPDSData( pGPSDataMask, pCellDataMask ); +} + +/*=========================================================================== +METHOD: + CATSendTerminalResponse + +DESCRIPTION: + This function sends the terminal response to the device + +PARAMETERS: + refID [ I ] - UIM reference ID (from CAT event) + dataLen [ I ] - Terminal response data length + pData [ I ] - Terminal response data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendTerminalResponse( + ULONG refID, + ULONG dataLen, + BYTE * pData ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->CATSendTerminalResponse( refID, dataLen, pData ); +} + +/*=========================================================================== +METHOD: + CATSendEnvelopeCommand + +DESCRIPTION: + This function sends the envelope command to the device + +PARAMETERS: + cmdID [ I ] - Envelope command ID + dataLen [ I ] - Envelope command data length + pData [ I ] - Envelope command data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendEnvelopeCommand( + ULONG cmdID, + ULONG dataLen, + BYTE * pData ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->CATSendEnvelopeCommand( cmdID, dataLen, pData ); +} + +/*=========================================================================== +METHOD: + GetSMSWake + +DESCRIPTION: + This function queries the state of the SMS wake functionality + +PARAMETERS: + pbEnabled [ O ] - SMS wake functionality enabled? + pWakeMask [ O ] - SMS wake mask (only relevant when enabled) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSWake( + ULONG * pbEnabled, + ULONG * pWakeMask ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSMSWake( pbEnabled, pWakeMask ); +} + +/*=========================================================================== +METHOD: + SetSMSWake + +DESCRIPTION: + This function enables/disables the SMS wake functionality + +PARAMETERS: + bEnable [ I ] - Enable SMS wake functionality? + wakeMask [ I ] - SMS wake mask (only relevant when enabling) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSWake( + ULONG bEnable, + ULONG wakeMask ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetSMSWake( bEnable, wakeMask ); +} + +/*=========================================================================== +METHOD: + OMADMStartSession + +DESCRIPTION: + This function starts an OMA-DM session + +PARAMETERS: + sessionType [ I ] - Type of session to initiate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMStartSession( ULONG sessionType ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMStartSession( sessionType ); +} + +/*=========================================================================== +METHOD: + OMADMCancelSession + +DESCRIPTION: + This function cancels an ongoing OMA-DM session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMCancelSession() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMCancelSession(); +} + +/*=========================================================================== +METHOD: + OMADMGetSessionInfo + +DESCRIPTION: + This function returns information related to the current (or previous + if no session is active) OMA-DM session + +PARAMETERS: + pSessionState [ O ] - State of session + pSessionType [ O ] - Type of session + pFailureReason [ O ] - Session failure reason (when state indicates failure) + pRetryCount [ O ] - Session retry count (when state indicates retrying) + pSessionPause [ O ] - Session pause timer (when state indicates retrying) + pTimeRemaining [ O ] - Pause time remaining (when state indicates retrying) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetSessionInfo( + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMGetSessionInfo( pSessionState, + pSessionType, + pFailureReason, + pRetryCount, + pSessionPause, + pTimeRemaining ); +} + +/*=========================================================================== +METHOD: + OMADMGetPendingNIA + +DESCRIPTION: + This function returns information about the pending network initiated + alert + +PARAMETERS: + pSessionType [ O ] - Type of session + pSessionID [ O ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetPendingNIA( + ULONG * pSessionType, + USHORT * pSessionID ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMGetPendingNIA( pSessionType, pSessionID ); +} + +/*=========================================================================== +METHOD: + OMADMSendSelection + +DESCRIPTION: + This function sends the specified OMA-DM selection for the current + network initiated session + +PARAMETERS: + selection [ I ] - Selection + sessionID [ I ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSendSelection( + ULONG selection, + USHORT sessionID ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMSendSelection( selection, sessionID ); +} + +/*=========================================================================== +METHOD: + OMADMGetFeatureSettings + +DESCRIPTION: + This function returns the OMA-DM feature settings + +PARAMETERS: + pbProvisioning [ O ] - Device provisioning service update enabled + pbPRLUpdate [ O ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetFeatureSettings( + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMGetFeatureSettings( pbProvisioning, + pbPRLUpdate ); +} + +/*=========================================================================== +METHOD: + OMADMSetProvisioningFeature + +DESCRIPTION: + This function sets the OMA-DM device provisioning service + update feature setting + +PARAMETERS: + bProvisioning [ I ] - Device provisioning service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSetProvisioningFeature( + ULONG bProvisioning ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMSetProvisioningFeature( bProvisioning ); +} + +/*=========================================================================== +METHOD: + OMADMSetPRLUpdateFeature + +DESCRIPTION: + This function sets the OMA-DM PRL service update feature setting + +PARAMETERS: + bPRLUpdate [ I ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSetPRLUpdateFeature( + ULONG bPRLUpdate ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMSetPRLUpdateFeature( bPRLUpdate ); +} + +/*=========================================================================== +METHOD: + OriginateUSSD + +DESCRIPTION: + This function initiates a USSD operation + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OriginateUSSD( BYTE * pInfo ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OriginateUSSD( pInfo ); +} + +/*=========================================================================== +METHOD: + AnswerUSSD + +DESCRIPTION: + This function responds to a USSD request from the network + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AnswerUSSD( BYTE * pInfo ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->AnswerUSSD( pInfo ); +} + +/*=========================================================================== +METHOD: + CancelUSSD + +DESCRIPTION: + This function cancels an in-progress USSD operation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CancelUSSD() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->CancelUSSD(); +} + +/*=========================================================================== +METHOD: + UpgradeFirmware + +DESCRIPTION: + This function performs the following set of steps: + a) Verifies arguments + b) Updates firmware ID on device + c) Resets the device + + NOTE: Upon successful completion the above steps will have been completed, + however the actual upgrade of the firmware will necessarily then + follow. + +PARAMETERS: + pDestinationPath [ I ] - The fully qualified path to the destination folder + that the firmware download service will use + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UpgradeFirmware( CHAR * pDestinationPath ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UpgradeFirmware( pDestinationPath ); +} + +/*=========================================================================== +METHOD: + GetImageInfo + +DESCRIPTION: + Returns image information obtained from the firmware image located at the + provided path + +PARAMETERS: + pPath [ I ] - Location of the firmware image + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImageInfo( + CHAR * pPath, + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetImageInfo( pPath, + pFirmwareID, + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); +} + +/*=========================================================================== +METHOD: + GetImageStore + +DESCRIPTION: + Returns the image store folder, i.e. the folder co-located with the + QDL Service executable which (by default) contains one or more carrier + specific image subfolders + +PARAMETERS: + pathSize [ I ] - Maximum number of characters (including NULL + terminator) that can be copied to the image + store path array + pImageStorePath [ O ] - The path to the image store + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImageStore( + WORD pathSize, + CHAR * pImageStorePath ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetImageStore( pathSize, pImageStorePath ); +} + +/*=========================================================================== +METHOD: + SetSessionStateCallback + +DESCRIPTION: + This function enables/disables the session state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSessionStateCallback( tFNSessionState pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetSessionStateCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetByteTotalsCallback + +DESCRIPTION: + This function enables/disables the RX/TX byte counts callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + interval [ I ] - Interval in seconds (ignored when disabling) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetByteTotalsCallback( + tFNByteTotals pCallback, + BYTE interval ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetByteTotalsCallback( pCallback, interval ); +} + +/*=========================================================================== +METHOD: + SetDataCapabilitiesCallback + +DESCRIPTION: + This function enables/disables the serving system data capabilities + callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDataCapabilitiesCallback( + tFNDataCapabilities pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetDataCapabilitiesCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetDataBearerCallback + +DESCRIPTION: + This function enables/disables the data bearer status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDataBearerCallback( tFNDataBearer pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetDataBearerCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetDormancyStatusCallback + +DESCRIPTION: + This function enables/disables the dormancy status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDormancyStatusCallback( + tFNDormancyStatus pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetDormancyStatusCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetMobileIPStatusCallback + +DESCRIPTION: + This function enables/disables the mobile IP status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPStatusCallback( + tFNMobileIPStatus pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetMobileIPStatusCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetActivationStatusCallback + +DESCRIPTION: + This function enables/disables the activation status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetActivationStatusCallback( + tFNActivationStatus pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetActivationStatusCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetPowerCallback + +DESCRIPTION: + Enable/disable power operating mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPowerCallback( tFNPower pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPowerCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetWirelessDisableCallback + +DESCRIPTION: + Enable/disable wireless disable state callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetWirelessDisableCallback( + tFNWirelessDisable pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetWirelessDisableCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetRoamingIndicatorCallback + +DESCRIPTION: + This function enables/disables the roaming indicator callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetRoamingIndicatorCallback( + tFNRoamingIndicator pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetRoamingIndicatorCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetSignalStrengthCallback + +DESCRIPTION: + This function enables/disables the signal strength callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + thresholdsSize [ I ] - Number of elements the threshold array contain + (a maximum of 5 thresholds is supported), must + be 0 when disabling the callback + pThresholds [ I ] - Signal threshold array (each entry in dBm), + must be 0 when disabling the callback + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSignalStrengthCallback( + tFNSignalStrength pCallback, + BYTE thresholdsSize, + INT8 * pThresholds ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + if (thresholdsSize > 0 && pThresholds == 0) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + std::list thresholdsList; + for (BYTE t = 0; t < thresholdsSize; t++) + { + thresholdsList.push_back( pThresholds[t] ); + } + + return (ULONG)pAPI->SetSignalStrengthCallback( pCallback, thresholdsList ); +} + +/*=========================================================================== +METHOD: + SetRFInfoCallback + +DESCRIPTION: + This function enables/disables the RF information callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetRFInfoCallback( tFNRFInfo pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetRFInfoCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetLURejectCallback + +DESCRIPTION: + This function enables/disables the LU reject callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetLURejectCallback( tFNLUReject pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetLURejectCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetPLMNModeCallback + +DESCRIPTION: + Enable/disable PLMN mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPLMNModeCallback( tFNPLMNMode pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPLMNModeCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetNewSMSCallback + +DESCRIPTION: + This function enables/disables the new SMS callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNewSMSCallback( tFNNewSMS pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetNewSMSCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetNMEACallback + +DESCRIPTION: + This function enables/disables the NMEA sentence callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNMEACallback( tFNNewNMEA pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetNMEACallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetPDSStateCallback + +DESCRIPTION: + This function enables/disables the PDS service state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSStateCallback( tFNPDSState pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPDSStateCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetCATEventCallback + +DESCRIPTION: + This function enables/disables the CAT event callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + eventMask [ I ] - Bitmask of CAT events to register for + pErrorMask [ O ] - Error bitmask + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetCATEventCallback( + tFNCATEvent pCallback, + ULONG eventMask, + ULONG * pErrorMask ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetCATEventCallback( pCallback, eventMask, pErrorMask ); +} + +/*=========================================================================== +METHOD: + SetOMADMAlertCallback + +DESCRIPTION: + This function enables/disables the OMA-DM network initiated alert + callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetOMADMAlertCallback( tFNOMADMAlert pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetOMADMAlertCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetOMADMStateCallback + +DESCRIPTION: + This function enables/disables the OMA-DM state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetOMADMStateCallback( tFNOMADMState pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetOMADMStateCallback( pCallback ); +} + +#ifdef VOICE_SUPPORT +/*=========================================================================== +METHOD: + SetUSSDReleaseCallback + +DESCRIPTION: + Enable/disable USSD release callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDReleaseCallback( + tFNUSSDRelease pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetUSSDReleaseCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetUSSDNotificationCallback + +DESCRIPTION: + Enable/disable USSD notification callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDNotificationCallback( + tFNUSSDNotification pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetUSSDNotificationCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetUSSDOriginationCallback + +DESCRIPTION: + Enable/disable USSD origination callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDOriginationCallback( + tFNUSSDOrigination pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetUSSDOriginationCallback( pCallback ); +} +#endif + diff --git a/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/Makefile.am b/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/Makefile.am new file mode 100644 index 0000000..b6ac96c --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiConnectionMgmt/Makefile.am @@ -0,0 +1,31 @@ +INCLUDES = \ + -I$(top_srcdir)/Core \ + -I$(top_srcdir)/Shared + +lib_LTLIBRARIES = libGobiConnectionMgmt.la + +libGobiConnectionMgmt_la_CPPFLAGS = \ + -D WDS_SUPPORT \ + -D DMS_SUPPORT \ + -D NAS_SUPPORT \ + -D PDS_SUPPORT \ + -D CAT_SUPPORT \ + -D RMS_SUPPORT \ + -D OMA_SUPPORT \ + -D UIM_SUPPORT \ + -D WMS_SUPPORT \ + -D IMG2K_SUPPORT \ + -D IMG_SUPPORT \ + -D VOICE_SUPPORT + +libGobiConnectionMgmt_la_SOURCES = \ + GobiConnectionMgmtAPI.h \ + GobiConnectionMgmt.cpp \ + GobiConnectionMgmt.h \ + GobiConnectionMgmtExports.cpp + +libGobiConnectionMgmt_la_LIBADD = \ + $(top_builddir)/Database/QMI/libQMIDB.la \ + $(top_builddir)/Shared/libShared.la \ + $(top_builddir)/Core/libCore.la + diff --git a/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmt.cpp b/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmt.cpp new file mode 100755 index 0000000..8769be0 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmt.cpp @@ -0,0 +1,315 @@ +/*=========================================================================== +FILE: + GobiQMIImageMgmt.cpp + +DESCRIPTION: + QUALCOMM Image Management API for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + cGobiImageMgmtDLL + cGobiImageMgmt + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiImageMgmt.h" + +#include "QMIBuffers.h" +#include "QDLBuffers.h" + + +// Global object +cGobiImageMgmtDLL gImageDLL; + +/*=========================================================================*/ +// cGobiImageMgmtDLL Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiImageMgmtDLL (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiImageMgmtDLL::cGobiImageMgmtDLL() + : mpAPI( 0 ), + mbAllocated( false ) +{ + // Create sync CS + pthread_mutex_init( &mSyncSection, NULL ); +} + +/*=========================================================================== +METHOD: + ~cGobiImageMgmtDLL (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiImageMgmtDLL::~cGobiImageMgmtDLL() +{ + // Just in case + if (mpAPI != 0) + { + mpAPI->Cleanup(); + delete mpAPI; + mpAPI = 0; + } + + pthread_mutex_destroy( &mSyncSection ); +} + +/*=========================================================================== +METHOD: + GetAPI (Public Method) + +DESCRIPTION: + Return the cGobiImageMgmt object + +RETURN VALUE: + cGobiImageMgmt * +===========================================================================*/ +cGobiImageMgmt * cGobiImageMgmtDLL::GetAPI() +{ + pthread_mutex_lock( &mSyncSection ); + + bool bAlloc = mbAllocated; + + pthread_mutex_unlock( &mSyncSection ); + + if (bAlloc == true) + { + return mpAPI; + } + + pthread_mutex_lock( &mSyncSection ); + + mpAPI = new cGobiImageMgmt; + if (mpAPI != 0) + { + bool bAPI = mpAPI->Initialize(); + if (bAPI == false) + { + delete mpAPI; + mpAPI = 0; + } + } + + // We have tried to allocate/initialize the object + mbAllocated = true; + + pthread_mutex_unlock( &mSyncSection ); + return mpAPI; +} + +/*=========================================================================*/ +// cGobiImageMgmt Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiImageMgmt (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiImageMgmt::cGobiImageMgmt() + : cGobiQMICore(), + mTargetDeviceNode( "" ), + mTargetDeviceKey( "" ), + mQDL() +{ + // We require a DMS server + tServerConfig dmsSvr( eQMI_SVC_DMS, true ); + mServerConfig.insert( dmsSvr ); +} + +/*=========================================================================== +METHOD: + ~cGobiImageMgmt (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiImageMgmt::~cGobiImageMgmt() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiImageMgmt::Initialize() +{ + bool bRC = cGobiQMICore::Initialize(); + if (bRC == false) + { + return bRC; + } + + bRC = mQDL.Initialize(); + return bRC; +} + +/*=========================================================================== +METHOD: + Cleanup (Public Method) + +DESCRIPTION: + Cleanup the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiImageMgmt::Cleanup() +{ + mQDL.Cleanup(); + return cGobiQMICore::Cleanup(); +} + +/*=========================================================================== +METHOD: + GetDeviceID (Public Method) + +DESCRIPTION: + Set the ID of the device to target + +PARAMETERS: + deviceID [ I ] - The device ID as reported by Windows + deviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + void +===========================================================================*/ +void cGobiImageMgmt::GetDeviceID( + std::string & deviceID, + std::string & deviceKey ) +{ + deviceID = mTargetDeviceNode; + deviceKey = mTargetDeviceKey; +} + +/*=========================================================================== +METHOD: + SetDeviceID (Public Method) + +DESCRIPTION: + Set the ID of the device to target + +PARAMETERS: + pDeviceID [ I ] - The device ID as reported by Windows + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiImageMgmt::SetDeviceID( + LPCSTR pDeviceID, + LPCSTR pDeviceKey ) +{ + // Clear last error recorded + ClearLastError(); + + // If you specify a device key then you have to specify a device ID + if (pDeviceID == 0 && pDeviceKey != 0) + { + mLastError = eGOBI_ERR_INVALID_ARG; + return false; + } + + if (pDeviceID == 0 || pDeviceID[0] == 0) + { + mTargetDeviceNode.clear(); + mTargetDeviceKey.clear(); + } + else + { + mTargetDeviceNode = pDeviceID; + if (pDeviceKey == 0 || pDeviceKey[0] == 0) + { + mTargetDeviceKey.clear(); + } + else + { + mTargetDeviceKey = pDeviceKey; + } + } + + return true; +} + +/*=========================================================================== +METHOD: + ResetDevice (Public Method) + +DESCRIPTION: + This function resets the device + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiImageMgmt::ResetDevice() +{ + WORD msgID = (WORD)eQMI_DMS_SET_OPERATING_MODE; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, "5" ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} diff --git a/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmt.h b/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmt.h new file mode 100755 index 0000000..a14132e --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmt.h @@ -0,0 +1,186 @@ +/*=========================================================================== +FILE: + GobiImageMgmt.h + +DESCRIPTION: + QUALCOMM Image Management API for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + cGobiImageMgmtDLL + cGobiImageMgmt + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiQMICore.h" +#include "GobiQDLCore.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cGobiImageMgmt +/*=========================================================================*/ +class cGobiImageMgmt : public cGobiQMICore +{ + public: + // Constructor + cGobiImageMgmt(); + + // Destructor + virtual ~cGobiImageMgmt(); + + // Initialize the object + virtual bool Initialize(); + + // Cleanup the object + virtual bool Cleanup(); + + // Get the ID of the device to target + void GetDeviceID( + std::string & deviceID, + std::string & deviceKey ); + + // Set the ID of the device to target + bool SetDeviceID( + LPCSTR pDeviceID = 0, + LPCSTR pDeviceKey = 0 ); + + // This function resets the device + eGobiError ResetDevice(); + + // (Inline) Return the set of available Gobi QDL ports + std::vector GetAvailableQDLPorts() + { + return mQDL.GetAvailableQDLPorts(); + }; + + // (Inline) Set the timeout for QDL transactions + eGobiError SetQDLTimeout( ULONG to ) + { + return mQDL.SetQDLTimeout( to ); + }; + + // (Inline) Open the specified QDL port of the device + eGobiError OpenQDLPort( + std::string & portID, + ULONG bBARMode, + ULONG * pMajorVersion, + ULONG * pMinorVersion ) + { + return mQDL.OpenQDLPort( portID, + bBARMode, + pMajorVersion, + pMinorVersion ); + }; + + // (Inline) Close the specified QDL port of the device + eGobiError CloseQDLPort( bool bInformDevice ) + { + return mQDL.CloseQDLPort( bInformDevice ); + }; + + // (Inline) Get the images preference as from the device boot downloader + eGobiError GetQDLImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ) + { + return mQDL.GetQDLImagesPreference( pImageListSize, pImageList ); + }; + + // (Inline) Prepare the device boot downloader for an image write + eGobiError PrepareQDLImageWrite( + BYTE imageType, + ULONG imageSize, + ULONG * pBlockSize ) + { + return mQDL.PrepareQDLImageWrite( imageType, imageSize, pBlockSize ); + }; + + // (Inline) Write the specified image block to the device + eGobiError WriteQDLImageBlock( + USHORT sequenceNumber, + ULONG chunkSize, + BYTE * pImageBlock ) + { + return mQDL.WriteQDLImageBlock( sequenceNumber, + chunkSize, + pImageBlock ); + }; + + // (Inline) Request the device validate the written images + eGobiError ValidateQDLImages( BYTE * pImageType ) + { + return mQDL.ValidateQDLImages( pImageType ); + }; + + protected: + /* Device node/key of the device to target */ + std::string mTargetDeviceNode; + std::string mTargetDeviceKey; + + /* QDL protocol server */ + cGobiQDLCore mQDL; +}; + +/*=========================================================================*/ +// Class cGobiImageMgmtDLL +/*=========================================================================*/ +class cGobiImageMgmtDLL +{ + public: + // Constructor + cGobiImageMgmtDLL(); + + // Destructor + virtual ~cGobiImageMgmtDLL(); + + // Return the GobiImageMgmt object + cGobiImageMgmt * GetAPI(); + + protected: + /* API interface object */ + cGobiImageMgmt * mpAPI; + + /* Above object allocation attempted? */ + bool mbAllocated; + + /* Synchronization object */ + mutable pthread_mutex_t mSyncSection; +}; + +extern cGobiImageMgmtDLL gImageDLL; diff --git a/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmtAPI.h b/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmtAPI.h new file mode 100755 index 0000000..dc7f682 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmtAPI.h @@ -0,0 +1,416 @@ +/*=========================================================================== +FILE: + GobiImageMgmtAPI.h + +DESCRIPTION: + QUALCOMM Image Management API for Gobi 3000 + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +#ifndef GOBI_TYPEDEFS +#define GOBI_TYPEDEFS + +// Type Definitions +typedef unsigned long ULONG; +typedef unsigned long long ULONGLONG; +typedef signed char INT8; +typedef unsigned char BYTE; +typedef char CHAR; +typedef unsigned short WORD; +typedef unsigned short USHORT; +typedef const char * LPCSTR; + +#endif + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +/*=========================================================================*/ +// Definitions +/*=========================================================================*/ + +#ifdef __cplusplus + extern "C" { +#endif + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GobiEnumerateDevices + +DESCRIPTION: + This function enumerates the Gobi devices currently attached to the + system + +PARAMETERS: + pDevicesSize [I/O] - Upon input the maximum number of elements that the + device array can contain. Upon successful output + the actual number of elements in the device array + pDevices [ O ] - The device array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiEnumerateDevices( + BYTE * pDevicesSize, + BYTE * pDevices ); + +/*=========================================================================== +METHOD: + SetDeviceID + +DESCRIPTION: + This function sets the ID of the device to target + +PARAMETERS: + pDeviceID [ I ] - The device ID as reported by Windows + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDeviceID( + CHAR * pDeviceID, + CHAR * pDeviceKey ); + +/*=========================================================================== +METHOD: + GetImagesPreference + +DESCRIPTION: + This function gets the current images preference + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ); + +/*=========================================================================== +METHOD: + SetImagesPreference + +DESCRIPTION: + This function sets the current images preference + +PARAMETERS: + imageListSize [ I ] - The size in BYTEs of the image list array + pImageList [ I ] - The image list array + bForceDownload [ I ] - Force device to download images from host? + modemIndex [ I ] - Desired storage index for downloaded modem image + pImageTypesSize [I/O] - Upon input the maximum number of elements that + the download image types array can contain. + Upon successful output the actual number of + elements in the download image types array + pImageTypes [ O ] - The download image types array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetImagesPreference( + ULONG imageListSize, + BYTE * pImageList, + ULONG bForceDownload, + BYTE modemIndex, + ULONG * pImageTypesSize, + BYTE * pImageTypes ); + +/*=========================================================================== +METHOD: + GetBARMode + +DESCRIPTION: + This function returns the boot and recovery image download mode + +PARAMETERS: + pBARMode [ O ] - Boot and recovery image download mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetBARMode( ULONG * pBARMode ); + +/*=========================================================================== +METHOD: + SetBARMode + +DESCRIPTION: + This function requests the device enter boot and recovery image download + mode after the next reset + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetBARMode(); + +/*=========================================================================== +METHOD: + GetStoredImages + +DESCRIPTION: + This function gets the list of images stored on the device + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetStoredImages( + ULONG * pImageListSize, + BYTE * pImageList ); + +/*=========================================================================== +METHOD: + GetStoredImageInfo + +DESCRIPTION: + This function returns info about the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + pMajorVersion [ O ] - Major version of compatible boot downloader + pMinorVersion [ O ] - Minor version of compatible boot downloader + pVersionID [ O ] - Image version ID + pInfo [ O ] - Image info string + pLockID [ O ] - Image OEM lock ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetStoredImageInfo( + ULONG imageInfoSize, + BYTE * pImageInfo, + ULONG * pMajorVersion, + ULONG * pMinorVersion, + ULONG * pVersionID, + CHAR * pInfo, + ULONG * pLockID ); + +/*=========================================================================== +METHOD: + DeleteStoredImage + +DESCRIPTION: + This function deletes the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DeleteStoredImage( + ULONG imageInfoSize, + BYTE * pImageInfo ); + +/*=========================================================================== +METHOD: + ResetDevice + +DESCRIPTION: + This function resets the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetDevice(); + +/*=========================================================================== +METHOD: + GobiEnumerateQDLPorts + +DESCRIPTION: + This function enumerates the Gobi QDL port IDs currently attached to the + system + +PARAMETERS: + pPortSize [I/O] - Upon input the maximum number of elements that the + port ID array can contain. Upon successful output + the actual number of elements in the port ID array + pPorts [ O ] - Port ID array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiEnumerateQDLPorts( + BYTE * pPortSize, + BYTE * pPorts ); + +/*=========================================================================== +METHOD: + SetQDLTimeout + +DESCRIPTION: + This function sets the timeout for all subsequent QDL transactions + +PARAMETERS: + to [ O ] - Timeout (in milliseconds) for subsequent transactions + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetQDLTimeout( ULONG to ); + +/*=========================================================================== +METHOD: + OpenQDLPort + +DESCRIPTION: + This function opens the specified QDL port of the device + +PARAMETERS: + pPortID [ I ] - ID of QDL port to connect to + bBARMode [ I ] - Request boot and recovery mode feature + pMajorVersion [ O ] - Major version of the device boot downloader + pMinorVersion [ O ] - Minor version of the device boot downloader + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OpenQDLPort( + CHAR * pPortID, + ULONG bBARMode, + ULONG * pMajorVersion, + ULONG * pMinorVersion ); + +/*=========================================================================== +METHOD: + CloseQDLPort + +DESCRIPTION: + This function closes the currently open QDL port of the device + +PARAMETERS: + bInformDevice [ I ] - Inform device that QDL port is being closed? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CloseQDLPort( ULONG bInformDevice ); + +/*=========================================================================== +METHOD: + GetQDLImagesPreference + +DESCRIPTION: + This function gets the current images preference as reported by the + device boot downloader + +PARAMETERS: + pImageListSize [I/O] - Upon input the maximum number of elements that the + image info list can contain. Upon successful output + the actual number of elements in the image info list + pImageList [ O ] - The image info list + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetQDLImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ); + +/*=========================================================================== +METHOD: + PrepareQDLImageWrite + +DESCRIPTION: + This function prepares the device boot downloader for an image write + +PARAMETERS: + imageType [ I ] - Type of image being written + imageSize [ I ] - Size of image being written + pBlockSize [I/O] - Upon input the maximum size of image block supported + by host, upon successful output the maximum size of + image block supported by device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PrepareQDLImageWrite( + BYTE imageType, + ULONG imageSize, + ULONG * pBlockSize ); + +/*=========================================================================== +METHOD: + WriteQDLImageBlock + +DESCRIPTION: + This function writes the specified image block to the device + +PARAMETERS: + sequenceNumber [ I ] - Sequence number for image write + blockSize [ I ] - Size of image block + pImageBlock [ I ] - Image block + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WriteQDLImageBlock( + USHORT sequenceNumber, + ULONG blockSize, + BYTE * pImageBlock ); + +/*=========================================================================== +METHOD: + ValidateQDLImages + +DESCRIPTION: + This function requests the device validate the written images + +PARAMETERS: + pImageType [ O ] - Upon failure this may contain the type of the image + that failed validation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ValidateQDLImages( BYTE * pImageType ); + +#ifdef __cplusplus + }; +#endif diff --git a/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmtExports.cpp b/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmtExports.cpp new file mode 100755 index 0000000..d1a8555 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/GobiImageMgmtExports.cpp @@ -0,0 +1,923 @@ +/*=========================================================================== +FILE: + GobiImageMgmtExports.cpp + +DESCRIPTION: + QUALCOMM Image Management API for Gobi 3000 exports + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiImageMgmt.h" +#include "GobiImageMgmtAPI.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum length for adapter device path +const ULONG MAX_DI_DEVICE_PATH = 256; + +// Maximum length for adapter key +const ULONG MAX_DI_KEY = 16; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sDeviceInfo +// Struct to represent Gobi device info +/*=========================================================================*/ +struct sDeviceInfoElement +{ + public: + CHAR mPath[MAX_DI_DEVICE_PATH]; + CHAR mKey[MAX_DI_KEY]; +}; + +/*=========================================================================*/ +// Struct sPortInfo +// Struct to represent Gobi QDL port info +/*=========================================================================*/ +struct sPortInfoElement +{ + public: + CHAR mPath[MAX_DI_DEVICE_PATH]; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// Exported Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GobiEnumerateDevices + +DESCRIPTION: + This function enumerates the Gobi devices currently attached to the + system + +PARAMETERS: + pDevicesSize [I/O] - Upon input the maximum number of elements that the + device array can contain. Upon successful output + the actual number of elements in the device array + pDevices [ O ] - The device array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiEnumerateDevices( + BYTE * pDevicesSize, + BYTE * pDevices ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + // Validate arguments + if (pDevicesSize == 0 || pDevices == 0) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxInstances = *pDevicesSize; + *pDevicesSize = 0; + + // Obtain adapter info + std::vector adapters; + adapters = pAPI->GetAvailableDevices(); + + ULONG sz = (ULONG)adapters.size(); + if (sz > (ULONG)maxInstances) + { + sz = (ULONG)maxInstances; + } + + sDeviceInfoElement * pOutput = (sDeviceInfoElement *)pDevices; + for (ULONG a = 0; a < sz; a++) + { + const cGobiQMICore::tDeviceID & id = adapters[a]; + + memset( &pOutput->mPath[0], 0, (SIZE_T)MAX_DI_DEVICE_PATH ); + memset( &pOutput->mKey[0], 0, (SIZE_T)MAX_DI_KEY ); + + ULONG len = id.first.size(); + if (len > 0) + { + if (len >= MAX_DI_DEVICE_PATH) + { + len = MAX_DI_DEVICE_PATH - 1; + } + + LPCSTR pStr = (LPCSTR)id.first.c_str(); + memcpy( (LPVOID)&pOutput->mPath[0], + (LPCVOID)pStr, + (SIZE_T)len ); + } + + len = id.second.size(); + if (len > 0) + { + if (len >= MAX_DI_KEY) + { + len = MAX_DI_KEY - 1; + } + + LPCSTR pStr = (LPCSTR)id.second.c_str(); + memcpy( (LPVOID)&pOutput->mKey[0], + (LPCVOID)pStr, + (SIZE_T)len ); + } + + pOutput++; + } + + *pDevicesSize = (BYTE)sz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetDeviceID + +DESCRIPTION: + This function sets the ID of the device to target + +PARAMETERS: + pDeviceID [ I ] - The device ID as reported by Windows + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDeviceID( + CHAR * pDeviceID, + CHAR * pDeviceKey ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + bool bOK = pAPI->SetDeviceID( pDeviceID, pDeviceKey ); + if (bOK == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + return (ULONG)eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetImagesPreference + +DESCRIPTION: + This function gets the current images preference + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->GetImagesPreference( pImageListSize, + pImageList ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + SetImagesPreference + +DESCRIPTION: + This function sets the current images preference + +PARAMETERS: + imageListSize [ I ] - The size in BYTEs of the image list array + pImageList [ I ] - The image list array + bForceDownload [ I ] - Force device to download images from host? + modemIndex [ I ] - Desired storage index for downloaded modem image + pImageTypesSize [I/O] - Upon input the maximum number of elements that + the download image types array can contain. + Upon successful output the actual number of + elements in the download image types array + pImageTypes [ O ] - The download image types array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetImagesPreference( + ULONG imageListSize, + BYTE * pImageList, + ULONG bForceDownload, + BYTE modemIndex, + ULONG * pImageTypesSize, + BYTE * pImageTypes ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->SetImagesPreference( imageListSize, + pImageList, + bForceDownload, + modemIndex, + pImageTypesSize, + pImageTypes ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + GetBARMode + +DESCRIPTION: + This function returns the boot and recovery image download mode + +PARAMETERS: + pBARMode [ O ] - Boot and recovery image download mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetBARMode( ULONG * pBARMode ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->GetBARMode( pBARMode ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + SetBARMode + +DESCRIPTION: + This function requests the device enter boot and recovery image download + mode after the next reset + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetBARMode() +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->SetBARMode(); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + GetStoredImages + +DESCRIPTION: + This function gets the list of images stored on the device + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetStoredImages( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->GetStoredImages( pImageListSize, + pImageList ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + GetStoredImageInfo + +DESCRIPTION: + This function returns info about the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + pMajorVersion [ O ] - Major version of compatible boot downloader + pMinorVersion [ O ] - Minor version of compatible boot downloader + pVersionID [ O ] - Image version ID + pInfo [ O ] - Image info string + pLockID [ O ] - Image OEM lock ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetStoredImageInfo( + ULONG imageInfoSize, + BYTE * pImageInfo, + ULONG * pMajorVersion, + ULONG * pMinorVersion, + ULONG * pVersionID, + CHAR * pInfo, + ULONG * pLockID ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->GetStoredImageInfo( imageInfoSize, + pImageInfo, + pMajorVersion, + pMinorVersion, + pVersionID, + pInfo, + pLockID ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + DeleteStoredImage + +DESCRIPTION: + This function deletes the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DeleteStoredImage( + ULONG imageInfoSize, + BYTE * pImageInfo ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->DeleteStoredImage( imageInfoSize, + pImageInfo ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + ResetDevice + +DESCRIPTION: + This function resets the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetDevice() +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->ResetDevice(); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + GobiEnumerateQDLPorts + +DESCRIPTION: + This function enumerates the Gobi QDL port IDs currently attached to the + system + +PARAMETERS: + pPortSize [I/O] - Upon input the maximum number of elements that the + port ID array can contain. Upon successful output + the actual number of elements in the port ID array + pPorts [ O ] - Port ID array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiEnumerateQDLPorts( + BYTE * pPortSize, + BYTE * pPorts ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + // Validate arguments + if (pPortSize == 0 || *pPortSize == 0 || pPorts == 0) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + BYTE maxPorts = *pPortSize; + *pPortSize = 0; + + std::vector ports = pAPI->GetAvailableQDLPorts(); + ULONG portCount = (ULONG)ports.size(); + if (portCount > maxPorts) + { + portCount = (ULONG)maxPorts; + } + + sPortInfoElement * pOutput = (sPortInfoElement *)pPorts; + for (ULONG a = 0; a < portCount; a++) + { + memset( &pOutput->mPath[0], 0, (SIZE_T)MAX_DI_DEVICE_PATH ); + + ULONG len = ports[a].size(); + if (len > 0) + { + if (len >= MAX_DI_DEVICE_PATH) + { + len = MAX_DI_DEVICE_PATH - 1; + } + + LPCSTR pStr = ports[a].c_str(); + memcpy( (LPVOID)&pOutput->mPath[0], + (LPCVOID)pStr, + (SIZE_T)len ); + } + + pOutput++; + } + + *pPortSize = (BYTE)portCount; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetQDLTimeout + +DESCRIPTION: + This function sets the timeout for all subsequent QDL transactions + +PARAMETERS: + to [ O ] - Timeout (in milliseconds) for subsequent transactions + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetQDLTimeout( ULONG to ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetQDLTimeout( to ); +} + +/*=========================================================================== +METHOD: + OpenQDLPort + +DESCRIPTION: + This function opens the specified QDL port of the device + +PARAMETERS: + pPortID [ I ] - ID of QDL port to connect to + bBARMode [ I ] - Request boot and recovery mode feature + pMajorVersion [ O ] - Major version of the device boot downloader + pMinorVersion [ O ] - Minor version of the device boot downloader + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OpenQDLPort( + CHAR * pPortID, + ULONG bBARMode, + ULONG * pMajorVersion, + ULONG * pMinorVersion ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string strPortID( (const char *)pPortID ); + + return (ULONG)pAPI->OpenQDLPort( strPortID, + bBARMode, + pMajorVersion, + pMinorVersion ); +} + +/*=========================================================================== +METHOD: + CloseQDLPort + +DESCRIPTION: + This function closes the currently open QDL port of the device + +PARAMETERS: + bInformDevice [ I ] - Inform device that QDL port is being closed? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CloseQDLPort( ULONG bInformDevice ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + bool bTmp = (bInformDevice != 0); + return (ULONG)pAPI->CloseQDLPort( bTmp ); +} + +/*=========================================================================== +METHOD: + GetQDLImagesPreference + +DESCRIPTION: + This function gets the current images preference as reported by the + device boot downloader + +PARAMETERS: + pImageListSize [I/O] - Upon input the maximum number of elements that the + image info list can contain. Upon successful output + the actual number of elements in the image info list + pImageList [ O ] - The image info list + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetQDLImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetQDLImagesPreference( pImageListSize, + pImageList ); +} + +/*=========================================================================== +METHOD: + PrepareQDLImageWrite + +DESCRIPTION: + This function prepares the device boot downloader for an image write + +PARAMETERS: + imageType [ I ] - Type of image being written + imageSize [ I ] - Size of image being written + pBlockSize [I/O] - Upon input the maximum size of image block supported + by host, upon successful output the maximum size of + image block supported by device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PrepareQDLImageWrite( + BYTE imageType, + ULONG imageSize, + ULONG * pBlockSize ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->PrepareQDLImageWrite( imageType, + imageSize, + pBlockSize ); +} + +/*=========================================================================== +METHOD: + WriteQDLImageBlock + +DESCRIPTION: + This function writes the specified image block to the device + +PARAMETERS: + sequenceNumber [ I ] - Sequence number for image write + blockSize [ I ] - Size of image block + pImageBlock [ I ] - Image block + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WriteQDLImageBlock( + USHORT sequenceNumber, + ULONG blockSize, + BYTE * pImageBlock ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->WriteQDLImageBlock( sequenceNumber, + blockSize, + pImageBlock ); +} + +/*=========================================================================== +METHOD: + ValidateQDLImages + +DESCRIPTION: + This function requests the device validate the written images + +PARAMETERS: + pImageType [ O ] - Upon failure this may contain the type of the image + that failed validation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ValidateQDLImages( BYTE * pImageType ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->ValidateQDLImages( pImageType ); +} diff --git a/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/Makefile.am b/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/Makefile.am new file mode 100644 index 0000000..1b46c13 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiImageMgmt/Makefile.am @@ -0,0 +1,31 @@ +INCLUDES = \ + -I$(top_srcdir)/Core \ + -I$(top_srcdir)/Shared + +lib_LTLIBRARIES = libGobiImageMgmt.la + +libGobiImageMgmt_la_CPPFLAGS = \ + -D WDS_SUPPORT \ + -D DMS_SUPPORT \ + -D NAS_SUPPORT \ + -D PDS_SUPPORT \ + -D CAT_SUPPORT \ + -D RMS_SUPPORT \ + -D OMA_SUPPORT \ + -D UIM_SUPPORT \ + -D WMS_SUPPORT \ + -D IMG2K_SUPPORT \ + -D IMG_SUPPORT \ + -D VOICE_SUPPORT + +libGobiImageMgmt_la_SOURCES = \ + GobiImageMgmtAPI.h \ + GobiImageMgmt.h \ + GobiImageMgmt.cpp \ + GobiImageMgmtExports.cpp + +libGobiImageMgmt_la_LIBADD = \ + $(top_builddir)/Database/QMI/libQMIDB.la \ + $(top_builddir)/Shared/libShared.la \ + $(top_builddir)/Core/libCore.la + diff --git a/gobi-api/GobiAPI_1.0.40/GobiQDLService/99-GobiQDLService.rules b/gobi-api/GobiAPI_1.0.40/GobiQDLService/99-GobiQDLService.rules new file mode 100755 index 0000000..a19007e --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiQDLService/99-GobiQDLService.rules @@ -0,0 +1,40 @@ +#=========================================================================== +# FILE: +# 99-GobiQDLService.rules +# +# DESCRIPTION: +# Udev rules for Qualcomm Downloader application (GobiQDLService) +# +# PUBLIC CLASSES AND METHODS: +# +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +#============================================================================ + +ACTION=="add", SUBSYSTEM=="tty", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="920c", RUN+="/opt/Qualcomm/Gobi/GobiQDLService/GobiQDLService" + + diff --git a/gobi-api/GobiAPI_1.0.40/GobiQDLService/Main.cpp b/gobi-api/GobiAPI_1.0.40/GobiQDLService/Main.cpp new file mode 100755 index 0000000..427f10c --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiQDLService/Main.cpp @@ -0,0 +1,205 @@ +/*=========================================================================== +FILE: + Main.cpp + +DESCRIPTION: + Firmware downloader using cGobiQDLCore class + +PUBLIC CLASSES AND FUNCTIONS: + Run + main + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQDLCore.h" +#include "QDLBuffers.h" +#include "MemoryMappedFile.h" + +#include + +//--------------------------------------------------------------------------- +// Free Methods +//--------------------------------------------------------------------------- + +/*=========================================================================== +METHOD: + Run (Public Method) + +DESCRIPTION: + Simple QDL download + +RETURN VALUE: + bool +===========================================================================*/ +bool Run() +{ + cGobiQDLCore qdl; + bool bRC = qdl.Initialize(); + if (bRC == false) + { + syslog( LOG_INFO, "Failed to initialize QDL core" ); + return bRC; + } + + qdl.SetQDLTimeout( 10000 ); + + std::vector qdlPorts = qdl.GetAvailableQDLPorts(); + if (qdlPorts.size() == 0) + { + syslog( LOG_INFO, "No QDL devices found" ); + return false; + } + + std::string portName = qdlPorts[0]; + syslog( LOG_INFO, "Download started to port %s", portName.c_str() ); + + // Connect to port + ULONG maj = ULONG_MAX; + ULONG min = ULONG_MAX; + eGobiError err = qdl.OpenQDLPort( portName, 0, &maj, &min ); + if (err != eGOBI_ERR_NONE) + { + syslog( LOG_INFO, "OpenQDLPort( %s ) = %d", portName.c_str(), err ); + return false; + } + + ULONG bufSz = 12; + sQDLRawImageID buf[12]; + err = qdl.GetQDLImagesPreference( &bufSz, (BYTE *)&buf[0] ); + if (err != eGOBI_ERR_NONE) + { + syslog( LOG_INFO, "GetQDLImagesPreference() = %d", err ); + qdl.CloseQDLPort( false ); + return false; + } + + if (bufSz > 12) + { + syslog( LOG_INFO, "GetQDLImagesPreference(), bufSz = %lu", bufSz ); + qdl.CloseQDLPort( false ); + return false; + } + + bool bErr = false; + for (ULONG i = 0; i < bufSz; i++) + { + std::string img = ::GetImageByUniqueID( &buf[i].mImageID[0] ); + if (img.size() <= 0) + { + // Skip files we do not have access to + syslog( LOG_INFO, "GetImageByUniqueID() failure" ); + return false; + } + + ULONG fileMaj = 0; + ULONG fileMin = 0; + err = ::GetImageBootCompatibility( img.c_str(), + &fileMaj, + &fileMin ); + + if (err != eGOBI_ERR_NONE || fileMaj != maj) + { + // Skip files that may not be compatible + syslog( LOG_INFO, "GetImageBootCompatibility() failure [%d]", err ); + return false; + } + + cMemoryMappedFile imgFile( img.c_str() ); + syslog( LOG_INFO, "Downloading %s", img.c_str() ); + + LPVOID pImgData = imgFile.GetContents(); + ULONG imgSz = imgFile.GetSize(); + if (pImgData == 0 || imgSz == 0) + { + syslog( LOG_INFO, "Image file failure [%s]", img.c_str() ); + bErr = true; + return false; + } + + ULONG blockSz = QDL_MAX_CHUNK_SIZE; + err = qdl.PrepareQDLImageWrite( buf[i].mImageType, imgSz, &blockSz ); + if (err != eGOBI_ERR_NONE) + { + if (err == eGOBI_ERR_QDL_OPEN_SKIP) + { + // Device already has this file + continue; + } + else + { + syslog( LOG_INFO, "PrepareQDLImageWrite() = %d", err ); + bErr = true; + break; + } + } + + err = qdl.WriteQDLImageBlock( 0, imgSz, (BYTE *)pImgData ); + if (err != eGOBI_ERR_NONE) + { + syslog( LOG_INFO, "WriteQDLImageBlock() = %d", err ); + bErr = true; + break; + } + } + + if (bErr == false) + { + syslog( LOG_INFO, "Download completed" ); + BYTE errImg; + qdl.ValidateQDLImages( &errImg ); + } + + qdl.CloseQDLPort( true ); +} + +/*=========================================================================== +METHOD: + main (Public Method) + +DESCRIPTION: + Application entry point + +RETURN VALUE: + int - Process exit code +===========================================================================*/ +int main() +{ + // Add PID to log statements + openlog( "GobiQDLService", LOG_PID, LOG_USER ); + + bool bSuccess = Run(); + + closelog(); + + return (bSuccess ? 0 : -1 ); +} diff --git a/gobi-api/GobiAPI_1.0.40/GobiQDLService/Makefile.am b/gobi-api/GobiAPI_1.0.40/GobiQDLService/Makefile.am new file mode 100644 index 0000000..077372e --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/GobiQDLService/Makefile.am @@ -0,0 +1,28 @@ +INCLUDES = \ + -I$(top_srcdir)/Core \ + -I$(top_srcdir)/Shared + +bin_PROGRAMS = GobiQDLService + +GobiQDLService_CPPFLAGS = \ + -D WDS_SUPPORT \ + -D DMS_SUPPORT \ + -D NAS_SUPPORT \ + -D PDS_SUPPORT \ + -D CAT_SUPPORT \ + -D RMS_SUPPORT \ + -D OMA_SUPPORT \ + -D UIM_SUPPORT \ + -D WMS_SUPPORT \ + -D IMG2K_SUPPORT \ + -D IMG_SUPPORT \ + -D VOICE_SUPPORT + +GobiQDLService_SOURCES = Main.cpp + +GobiQDLService_LDADD = \ + $(top_builddir)/Database/QMI/libQMIDB.la \ + $(top_builddir)/Shared/libShared.la \ + $(top_builddir)/Core/libCore.la \ + -lrt + diff --git a/gobi-api/GobiAPI_1.0.40/INSTALL b/gobi-api/GobiAPI_1.0.40/INSTALL new file mode 100644 index 0000000..7d1c323 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/INSTALL @@ -0,0 +1,365 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/gobi-api/GobiAPI_1.0.40/Makefile.am b/gobi-api/GobiAPI_1.0.40/Makefile.am new file mode 100644 index 0000000..654c675 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Makefile.am @@ -0,0 +1,9 @@ +SUBDIRS= \ + Database \ + Shared \ + Core \ + GobiConnectionMgmt \ + GobiImageMgmt \ + GobiQDLService + +ACLOCAL_AMFLAGS = -I m4 diff --git a/gobi-api/GobiAPI_1.0.40/NEWS b/gobi-api/GobiAPI_1.0.40/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/gobi-api/GobiAPI_1.0.40/README b/gobi-api/GobiAPI_1.0.40/README new file mode 100644 index 0000000..e69de29 diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiError.h b/gobi-api/GobiAPI_1.0.40/Shared/GobiError.h new file mode 100755 index 0000000..20117d5 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiError.h @@ -0,0 +1,147 @@ +/*=========================================================================== +FILE: + GobiError.h + +DESCRIPTION: + QUALCOMM Gobi Errors + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "QMIEnum.h" +#include "QDLEnum.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// eGobiError Enumeration +// Gobi API Error Enumeration +/*=========================================================================*/ +enum eGobiError +{ + eGOBI_ERR_ENUM_BEGIN = -1, + + eGOBI_ERR_NONE, // 00 Success + eGOBI_ERR_GENERAL, // 01 General error + eGOBI_ERR_INTERNAL, // 02 Internal error + eGOBI_ERR_MEMORY, // 03 Memory error + eGOBI_ERR_INVALID_ARG, // 04 Invalid argument + eGOBI_ERR_BUFFER_SZ, // 05 Buffer too small + eGOBI_ERR_NO_DEVICE, // 06 Unable to detect device + eGOBI_ERR_INVALID_DEVID, // 07 Invalid device ID + eGOBI_ERR_NO_CONNECTION, // 08 No connection to device + eGOBI_ERR_IFACE, // 09 Unable to obtain required interace + eGOBI_ERR_CONNECT, // 10 Unable to connect to interface + eGOBI_ERR_REQ_SCHEDULE, // 11 Unable to schedule request + eGOBI_ERR_REQUEST, // 12 Error sending request + eGOBI_ERR_RESPONSE, // 13 Error receiving response + eGOBI_ERR_REQUEST_TO, // 14 Timeout while sending request + eGOBI_ERR_RESPONSE_TO, // 15 Timeout while receiving response + eGOBI_ERR_MALFORMED_RSP, // 16 Malformed response received + eGOBI_ERR_INVALID_RSP, // 17 Invalid/error response received + eGOBI_ERR_INVALID_FILE, // 18 Invalid file path + eGOBI_ERR_FILE_OPEN, // 19 Unable to open file + eGOBI_ERR_FILE_COPY, // 20 Unable to copy file + eGOBI_ERR_QDL_SCM, // 21 Unable to open service control mgr + eGOBI_ERR_NO_QDL_SVC, // 22 Unable to detect QDL service + eGOBI_ERR_NO_QDL_SVC_INFO, // 23 Unable to obtain QDL service info + eGOBI_ERR_NO_QDL_SVC_PATH, // 24 Unable to locate QSL service + eGOBI_ERR_QDL_SVC_CFG, // 25 Unable to reconfigure QDL service + eGOBI_ERR_QDL_SVC_IFACE, // 26 Unable to interface to QDL service + eGOBI_ERR_OFFLINE, // 27 Unable to set device offline + eGOBI_ERR_RESET, // 28 Unable to reset device + eGOBI_ERR_NO_SIGNAL, // 29 No available signal + eGOBI_ERR_MULTIPLE_DEVICES, // 30 Multiple devices detected + eGOBI_ERR_DRIVER, // 31 Error interfacing to driver + eGOBI_ERR_NO_CANCELABLE_OP, // 32 No cancelable operation is pending + eGOBI_ERR_CANCEL_OP, // 33 Error canceling outstanding operation + eGOBI_ERR_QDL_CRC, // 34 QDL image data CRC error + eGOBI_ERR_QDL_PARSING, // 35 QDL image data parsing error + eGOBI_ERR_QDL_AUTH, // 36 QDL image authentication error + eGOBI_ERR_QDL_WRITE, // 37 QDL image write error + eGOBI_ERR_QDL_OPEN_SIZE, // 38 QDL image size error + eGOBI_ERR_QDL_OPEN_TYPE, // 39 QDL image type error + eGOBI_ERR_QDL_OPEN_PROT, // 40 QDL memory protection error + eGOBI_ERR_QDL_OPEN_SKIP, // 41 QDL image not required + eGOBI_ERR_QDL_ERR_GENERAL, // 42 QDL general error + eGOBI_ERR_QDL_BAR_MODE, // 43 QDL BAR mode error + + eGOBI_ERR_ENUM_END, + + // Offset from which mapped QMI error codes start from (see eQMIErrorCode) + eGOBI_ERR_QMI_OFFSET = 1000, + + // Offset from which mapped QDL errors start from (see eQDLError) + eGOBI_ERR_QDL_OFFSET = 100000 +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eGobiError validity check + +PARAMETERS: + ec [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eGobiError ec ) +{ + bool retVal = false; + if (ec > eGOBI_ERR_ENUM_BEGIN && ec < eGOBI_ERR_ENUM_END) + { + retVal = true; + } + + if (ec >= eGOBI_ERR_QMI_OFFSET && ec < eGOBI_ERR_QDL_OFFSET) + { + ULONG tmp = (ULONG)ec - (ULONG)eGOBI_ERR_QMI_OFFSET; + retVal = ::IsValid( (eQMIErrorCode)tmp ); + } + + if (ec >= eGOBI_ERR_QDL_OFFSET) + { + ULONG tmp = (ULONG)ec - (ULONG)eGOBI_ERR_QDL_OFFSET; + retVal = ::IsValid( (eQDLError)tmp ); + } + + return retVal; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiImageDefinitions.h b/gobi-api/GobiAPI_1.0.40/Shared/GobiImageDefinitions.h new file mode 100755 index 0000000..5fd3d57 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiImageDefinitions.h @@ -0,0 +1,176 @@ +/*=========================================================================== +FILE: + GobiImageDefinitions.h + +DESCRIPTION: + QUALCOMM Gobi Image related definitions + +PUBLIC CLASSES AND FUNCTIONS: + eGobiDeviceType + eGobiMBNType + eGobiImageTech + eGobiImageCarrier + eGobiImageRegion + eGobiImageGPS + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// eGobiDeviceType Enumeration +// Gobi Device Interface Enumeration +/*=========================================================================*/ +enum eGobiDeviceType +{ + eGOBI_DEV_ENUM_BEGIN = -1, + + eGOBI_DEV_NET, // 0 - Network adapter + eGOBI_DEV_NMEA, // 1 - NMEA COM port + eGOBI_DEV_DIAG, // 2 - DIAG port + eGOBI_DEV_MODEM, // 3 - Modem + eGOBI_DEV_AT, // 4 - AT port + eGOBI_DEV_NET2, // 5 - Auxiliary network adapter + eGOBI_DEV_QDL, // 6 - QDL port (should always be last) + + eGOBI_DEV_ENUM_END +}; + +/*=========================================================================*/ +// eGobiMBNType Enumeration +// Gobi MBN File Type Enumeration +/*=========================================================================*/ +enum eGobiMBNType +{ + eGOBI_MBN_TYPE_ENUM_BEGIN = -1, + + eGOBI_MBN_TYPE_MODEM, // 0 - Modem/AMSS + eGOBI_MBN_TYPE_PRI, // 1 - PRI/UQCN + + eGOBI_MBN_TYPE_ENUM_END, +}; + +/*=========================================================================*/ +// eGobiImageTech Enumeration +// Gobi Image Technology Enumeration +/*=========================================================================*/ +enum eGobiImageTech +{ + eGOBI_IMG_TECH_CDMA = 0, // 0 - CDMA + eGOBI_IMG_TECH_UMTS // 1 - UMTS +}; + +/*=========================================================================*/ +// eGobiImageCarrier Enumeration +// Gobi Image Carrier Enumeration +/*=========================================================================*/ +enum eGobiImageCarrier +{ + eGOBI_IMG_CAR_GENERIC = 1, // 001 + eGOBI_IMG_CAR_FACTORY, // 002 + eGOBI_IMG_CAR_NORF, // 003 + + eGOBI_IMG_CAR_VERIZON = 101, // 101 + eGOBI_IMG_CAR_SPRINT, // 102 + eGOBI_IMG_CAR_ALLTEL, // 103 + eGOBI_IMG_CAR_BELL, // 104 + eGOBI_IMG_CAR_TELUS, // 105 + eGOBI_IMG_CAR_US, // 106 + eGOBI_IMG_CAR_TELSTRA1, // 107 + eGOBI_IMG_CAR_CHINA_UNICOM, // 108 + eGOBI_IMG_CAR_TELCOM_NZ, // 109 + eGOBI_IMG_CAR_SK_TELCOM1, // 110 + eGOBI_IMG_CAR_RELIANCE1, // 111 + eGOBI_IMG_CAR_TATA, // 112 + eGOBI_IMG_CAR_METROPCS, // 113 + eGOBI_IMG_CAR_LEAP, // 114 + eGOBI_IMG_CAR_KDDI, // 115 + eGOBI_IMG_CAR_IUSACELL, // 116 + eGOBI_IMG_CAR_CHINA_TELECOM, // 117 + eGOBI_IMG_CAR_OMH, // 118 + + eGOBI_IMG_CAR_ATT = 201, // 201 + eGOBI_IMG_CAR_VODAFONE, // 202 + eGOBI_IMG_CAR_TMOBILE, // 203 + eGOBI_IMG_CAR_ORANGE, // 204 + eGOBI_IMG_CAR_TELEFONICA, // 205 + eGOBI_IMG_CAR_TELCOM_ITALIA, // 206 + eGOBI_IMG_CAR_3, // 207 + eGOBI_IMG_CAR_O2, // 208 + eGOBI_IMG_CAR_SFR, // 209 + eGOBI_IMG_CAR_SWISSCOM, // 210 + eGOBI_IMG_CAR_CHINA_MOBILE, // 211 + eGOBI_IMG_CAR_TELSTRA2, // 212 + eGOBI_IMG_CAR_SINGTEL_OPTUS, // 213 + eGOBI_IMG_CAR_RELIANCE2, // 214 + eGOBI_IMG_CAR_BHARTI, // 215 + eGOBI_IMG_CAR_NTT_DOCOMO, // 216 + eGOBI_IMG_CAR_EMOBILE, // 217 + eGOBI_IMG_CAR_SOFTBANK, // 218 + eGOBI_IMG_CAR_KT_FREETEL, // 219 + eGOBI_IMG_CAR_SK_TELCOM2, // 220 + eGOBI_IMG_CAR_TELENOR, // 221 + eGOBI_IMG_CAR_NETCOM, // 222 + eGOBI_IMG_CAR_TELIASONERA, // 223 + eGOBI_IMG_CAR_AMX_TELCEL, // 224 + eGOBI_IMG_CAR_BRASIL_VIVO // 225 +}; + +/*=========================================================================*/ +// eGobiImageRegion Enumeration +// Gobi Image Region Enumeration +/*=========================================================================*/ +enum eGobiImageRegion +{ + eGOBI_IMG_REG_NA = 0, // 0 - North America + eGOBI_IMG_REG_LA, // 1 - Latin America + eGOBI_IMG_REG_EU, // 2 - Europe + eGOBI_IMG_REG_ASIA, // 3 - Asia + eGOBI_IMG_REG_AUS, // 4 - Australia + eGOBI_IMG_REG_GLOBAL // 5 - Global +}; + +/*=========================================================================*/ +// eGobiImageGPS Enumeration +// Gobi Image GPS Enumeration +/*=========================================================================*/ +enum eGobiImageGPS +{ + eGOBI_IMG_GPS_NONE = 0, // 0 - None + eGOBI_IMG_GPS_STAND_ALONE, // 1 - Stand-alone + eGOBI_IMG_GPS_ASSISTED, // 2 - Stand-alone + AGPS + XTRA + eGOBI_IMG_GPS_NO_XTRA // 3 - Stand-alone + AGPS +}; diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiMBNMgmt.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiMBNMgmt.cpp new file mode 100755 index 0000000..ec76759 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiMBNMgmt.cpp @@ -0,0 +1,943 @@ +/*=========================================================================== +FILE: + GobiMBNMgmt.cpp + +DESCRIPTION: + QUALCOMM Gobi MBN management functions for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + GetImageStore + GetImageInfo + GetImagesInfo + GetImageBootCompatibility + MapVersionInfo + GetImageByUniqueID + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiMBNMgmt.h" +#include "GobiError.h" + +#include "CoreUtilities.h" +#include "MemoryMappedFile.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Magic values for MBN (AMSS/UQCN) images +const ULONG MBN_LOCK_MAGIC = 0x809b1d80; +const ULONG MBN_BOOT_MAGIC = 0xFEDC1234; +const ULONG MBN_BUILD_MAGIC = 0xFEDC1235; +const ULONG UQCN_INFO_MAGIC = 0xFEDC1236; +const ULONG MBN_HASH_MAGIC = 0xFEDC1237; +const ULONG MBN_LOCK_AUTH_MAGIC = 0xFEDC1238; + +// Maximum length for an UQCN build info string (including NULL) +const ULONG MBN_BUILD_ID_LEN = 32; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sMBNBootRecord +// Struct to represent the MBN boot flash record +/*=========================================================================*/ +struct sMBNBootRecord +{ + public: + ULONG mMagic; // MBN_BOOT_MAGIC + WORD mMajorID; // Boot flash major version + WORD mMinorID; // Boot flash minor version +}; + +/*=========================================================================*/ +// Struct sMBNBuildRecord +// Struct to represent the build ID record +/*=========================================================================*/ +struct sMBNBuildIDRecord +{ + public: + ULONG mMagic; // MBN_BUILD_MAGIC + CHAR mBuildID[MBN_BUILD_ID_LEN]; // Build ID string +}; + +/*=========================================================================*/ +// Struct sUQCNVersionID +// Struct to represent the UQCN version ID +/*=========================================================================*/ +struct sUQCNVersionID +{ + public: + ULONG mMinorID : 7; + ULONG mXTRADisabled : 1; + ULONG mGPSDisabled : 1; + ULONG mReserved : 7; + ULONG mMajorID : 8; + ULONG mSystem : 2; + ULONG mCompatibility : 6; +}; + +/*=========================================================================*/ +// Struct sUQCNInfoRecord +// Struct to represent the UQCN information record +/*=========================================================================*/ +struct sUQCNInfoRecord +{ + public: + ULONG mMagic; // UQCN_INFO_MAGIC + sUQCNVersionID mVersionID; // Version ID + CHAR mInfo[MBN_BUILD_ID_LEN]; // Build info string +}; + +/*=========================================================================*/ +// Struct sMBNHashRecord +// Struct to represent the signature hash record +/*=========================================================================*/ +struct sMBNHashRecord +{ + public: + ULONG mMagic; // MBN_HASH_MAGIC + BYTE mUniqueID[MBN_UNIQUE_ID_LEN]; // Build ID string +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + ReverseBinaryDataSearch (Free Method) + +DESCRIPTION: + Search a data buffer for the first occurence of a specified + sequence of data (starting from the end of the buffer) + +PARAMETERS: + pBuffer [ I ] - Buffer being search + bufferLen [ I ] - Length of above buffer + pData [ I ] - Data to search for + dataLen [ I ] - Length of above buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +const BYTE * ReverseBinaryDataSearch( + const BYTE * pBuffer, + ULONG bufferLen, + const BYTE * pData, + ULONG dataLen ) +{ + // Handle empty cases + if (pBuffer == 0 || bufferLen == 0 || pData ==0 || dataLen == 0) + { + return 0; + } + + // Handle impossible case + if (dataLen > bufferLen) + { + return 0; + } + + const BYTE * pTmp = pBuffer + (bufferLen - dataLen); + while (pTmp > pBuffer) + { + int res = ::memcmp( (const void *)pTmp, + (const void *)pData, + (size_t)dataLen ); + + if (res == 0) + { + return pTmp; + } + + pTmp--; + } + + return 0; +} + +/*=========================================================================== +METHOD: + ParseUQCNVersion (Free Method) + +DESCRIPTION: + Parse UQCN version ID to image information + +PARAMETERS: + uqcnID [ I ] - UQCN ID + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + bool +===========================================================================*/ +bool ParseUQCNVersion( + ULONG uqcnID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + // Assume failure + bool bRC = false; + *pTechnology = ULONG_MAX; + *pCarrier = ULONG_MAX; + *pRegion = ULONG_MAX; + *pGPSCapability = ULONG_MAX; + + sUQCNVersionID * pID = (sUQCNVersionID *)&uqcnID; + if (pID->mSystem == 2) + { + // Successs is returned when the technology is valid + *pTechnology = (ULONG)eGOBI_IMG_TECH_UMTS; + bRC = true; + } + else if (pID->mSystem == 1) + { + // Successs is returned when the technology is valid + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + bRC = true; + } + + // Valid technology? + if (bRC == false) + { + return bRC; + } + + switch (pID->mMajorID) + { + case 0x00: + *pCarrier = (ULONG)eGOBI_IMG_CAR_FACTORY; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + break; + + case 0x01: + *pCarrier = (ULONG)eGOBI_IMG_CAR_VERIZON; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + break; + + case 0x02: + *pCarrier = (ULONG)eGOBI_IMG_CAR_SPRINT; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + break; + + case 0x03: + *pCarrier = (ULONG)eGOBI_IMG_CAR_ATT; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + break; + + case 0x04: + *pCarrier = (ULONG)eGOBI_IMG_CAR_VODAFONE; + *pRegion = (ULONG)eGOBI_IMG_REG_EU; + break; + + case 0x05: + *pCarrier = (ULONG)eGOBI_IMG_CAR_TMOBILE; + *pRegion = (ULONG)eGOBI_IMG_REG_EU; + break; + + case 0x09: + *pCarrier = (ULONG)eGOBI_IMG_CAR_GENERIC; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + break; + + case 0x0B: + *pCarrier = (ULONG)eGOBI_IMG_CAR_ORANGE; + *pRegion = (ULONG)eGOBI_IMG_REG_EU; + break; + + case 0x0C: + *pCarrier = (ULONG)eGOBI_IMG_CAR_TELEFONICA; + *pRegion = (ULONG)eGOBI_IMG_REG_EU; + break; + + case 0x0D: + *pCarrier = (ULONG)eGOBI_IMG_CAR_NTT_DOCOMO; + *pRegion = (ULONG)eGOBI_IMG_REG_ASIA; + break; + + case 0x0E: + *pCarrier = (ULONG)eGOBI_IMG_CAR_TELCOM_ITALIA; + *pRegion = (ULONG)eGOBI_IMG_REG_EU; + break; + + case 0x12: + *pCarrier = (ULONG)eGOBI_IMG_CAR_TELCOM_NZ; + *pRegion = (ULONG)eGOBI_IMG_REG_AUS; + break; + + case 0x13: + *pCarrier = (ULONG)eGOBI_IMG_CAR_CHINA_TELECOM; + *pRegion = (ULONG)eGOBI_IMG_REG_ASIA; + break; + + case 0x14: + *pCarrier = (ULONG)eGOBI_IMG_CAR_OMH; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + break; + + case 0x16: + *pCarrier = (ULONG)eGOBI_IMG_CAR_AMX_TELCEL; + *pRegion = (ULONG)eGOBI_IMG_REG_LA; + break; + + case 0x17: + *pCarrier = (ULONG)eGOBI_IMG_CAR_NORF; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + break; + + case 0x18: + *pCarrier = (ULONG)eGOBI_IMG_CAR_FACTORY; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + break; + + case 0x19: + *pCarrier = (ULONG)eGOBI_IMG_CAR_BRASIL_VIVO; + *pRegion = (ULONG)eGOBI_IMG_REG_LA; + break; + } + + // Set GPS capability + if (pID->mGPSDisabled == 1) + { + *pGPSCapability = (ULONG)eGOBI_IMG_GPS_NONE; + } + else if (*pCarrier == (ULONG)eGOBI_IMG_CAR_NORF) + { + // No RF with GPS results in stand-alone GPS support only + *pGPSCapability = (ULONG)eGOBI_IMG_GPS_STAND_ALONE; + } + else + { + if (pID->mXTRADisabled == 1) + { + *pGPSCapability = (ULONG)eGOBI_IMG_GPS_NO_XTRA; + } + else + { + *pGPSCapability = (ULONG)eGOBI_IMG_GPS_ASSISTED; + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ParseAMSSVersion (Free Method) + +DESCRIPTION: + Parse UQCN version ID to image information + +PARAMETERS: + pVersion [ I ] - Version string + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + bool +===========================================================================*/ +bool ParseAMSSVersion( + LPCSTR pVersion, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + // Assume failure + bool bRC = false; + *pTechnology = ULONG_MAX; + *pCarrier = ULONG_MAX; + *pRegion = ULONG_MAX; + *pGPSCapability = ULONG_MAX; + + // Validate arguments + if (pVersion == 0 || pVersion[0] == 0) + { + return bRC; + } + + std::string tmpVer = pVersion; + + // std::string version of MakeUpper() + transform( tmpVer.begin(), tmpVer.end(), tmpVer.begin(), toupper ); + + if ( (tmpVer.find( "STAUFH" ) != std::string::npos) + || (tmpVer.find( "STSUFH" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + *pCarrier = (ULONG)eGOBI_IMG_CAR_FACTORY; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + + bRC = true; + return bRC; + } + else if ( (tmpVer.find( "STAUVH" ) != std::string::npos) + || (tmpVer.find( "STSUVH" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + *pCarrier = (ULONG)eGOBI_IMG_CAR_VERIZON; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + + bRC = true; + return bRC; + } + else if ( (tmpVer.find( "STAUSH" ) != std::string::npos) + || (tmpVer.find( "STSUSH" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + *pCarrier = (ULONG)eGOBI_IMG_CAR_SPRINT; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + + bRC = true; + return bRC; + } + else if (tmpVer.find( "STSUCH" ) != std::string::npos) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + *pCarrier = (ULONG)eGOBI_IMG_CAR_CHINA_TELECOM; + *pRegion = (ULONG)eGOBI_IMG_REG_ASIA; + + bRC = true; + return bRC; + } + else if (tmpVer.find( "STSUOH" ) != std::string::npos) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + *pCarrier = (ULONG)eGOBI_IMG_CAR_OMH; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + + bRC = true; + return bRC; + } + else if ( (tmpVer.find( "STAUXN" ) != std::string::npos) + || (tmpVer.find( "STSUXN" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_UMTS; + *pCarrier = (ULONG)eGOBI_IMG_CAR_NORF; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + + bRC = true; + return bRC; + } + else if ( (tmpVer.find( "STAUFN" ) != std::string::npos) + || (tmpVer.find( "STSUFN" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_UMTS; + *pCarrier = (ULONG)eGOBI_IMG_CAR_FACTORY; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + + bRC = true; + return bRC; + } + else if ( (tmpVer.find( "STAUGN" ) != std::string::npos) + || (tmpVer.find( "STSUGN" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_UMTS; + *pCarrier = (ULONG)eGOBI_IMG_CAR_GENERIC; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + + bRC = true; + return bRC; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetImageStore (Public Method) + +DESCRIPTION: + Get the image store folder, i.e., the folder containing one or more + carrier-specific image subfolders + +RETURN VALUE: + std::string - Image Store +===========================================================================*/ +std::string GetImageStore() +{ + std::string imageStore = GetProgramPath(); + imageStore += "Images/3000/Generic"; + + return imageStore; +} + +/*=========================================================================== +METHOD: + GetImageInfo (Public Method) + +DESCRIPTION: + Get the image information for the image specified by the given fully + qualified path + +PARAMETERS: + pFilePath [ I ] - Fully qualified path to image file + pImageType [ O ] - Image type + pImageID [ O ] - Unique image ID + pVersionID [ O ] - Version ID + versionSize [ I ] - The maximum number of characters including the NULL + terminator that can be copied to the version array + pVersion [ O ] - NULL-terminated string representing the version + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError GetImageInfo( + LPCSTR pFilePath, + BYTE * pImageType, + BYTE * pImageID, + ULONG * pVersionID, + USHORT versionSize, + CHAR * pVersion ) +{ + // Validate arguments + if ( (pFilePath == 0) + || (pFilePath[0] == 0) + || (pImageType == 0) + || (pImageID == 0) + || (pVersionID == 0) + || (versionSize == 0) + || (pVersion == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Open up MBN file + cMemoryMappedFile mbnFile( pFilePath ); + const BYTE * pMBNData = (const BYTE *)mbnFile.GetContents(); + ULONG dataSz = mbnFile.GetSize(); + + // MBN file (sort of) valid? + if (pMBNData == 0) + { + return eGOBI_ERR_FILE_OPEN; + } + + if (dataSz <= 256) + { + return eGOBI_ERR_INVALID_FILE; + } + + // Skip to the end + pMBNData += (dataSz - 256); + + // Search for the UQCN specific info + const BYTE * pTmp = 0; + pTmp = ReverseBinaryDataSearch( pMBNData, + 256, + (const BYTE *)&UQCN_INFO_MAGIC, + (ULONG)sizeof( UQCN_INFO_MAGIC ) ); + + if (pTmp != 0) + { + const sUQCNInfoRecord * pRec = (const sUQCNInfoRecord *)pTmp; + *pVersionID = *(ULONG *)&pRec->mVersionID; + *pImageType = 1; + } + else + { + // Since we did not find UQCN info, presume this is an AMSS file + pTmp = ReverseBinaryDataSearch( pMBNData, + 256, + (const BYTE *)&MBN_BOOT_MAGIC, + (ULONG)sizeof( MBN_BOOT_MAGIC ) ); + + if (pTmp == 0) + { + return eGOBI_ERR_INVALID_FILE; + } + + const sMBNBootRecord * pRec = (const sMBNBootRecord *)pTmp; + *pVersionID = pRec->mMinorID; + *pImageType = 0; + } + + // Search for the unique ID + pTmp = ReverseBinaryDataSearch( pMBNData, + 256, + (const BYTE *)&MBN_HASH_MAGIC, + (ULONG)sizeof( MBN_HASH_MAGIC ) ); + + if (pTmp == 0) + { + return eGOBI_ERR_INVALID_FILE; + } + + // Copy the unique ID + const sMBNHashRecord * pHash = (const sMBNHashRecord *)pTmp; + memcpy( (LPVOID)pImageID, + (LPCVOID)&pHash->mUniqueID[0], + (SIZE_T)MBN_UNIQUE_ID_LEN ); + + + // Search for the build ID + pTmp = ReverseBinaryDataSearch( pMBNData, + 256, + (const BYTE *)&MBN_BUILD_MAGIC, + (ULONG)sizeof( MBN_BUILD_MAGIC ) ); + + if (pTmp == 0) + { + return eGOBI_ERR_INVALID_FILE; + } + + memset( (PVOID)&pVersion[0], 0, (SIZE_T)versionSize ); + + // Copy the MBN_BUILD_MAGIC ID + const sMBNBuildIDRecord * pRec = (const sMBNBuildIDRecord *)pTmp; + for (ULONG t = 0; t < MBN_BUILD_ID_LEN; t++) + { + if (t >= versionSize) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pVersion[t] = pRec->mBuildID[t]; + if (pRec->mBuildID[t] == 0) + { + break; + } + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetImagesInfo (Public Method) + +DESCRIPTION: + Return the info for the images located at the given path + +PARAMETERS: + path [ I ] - Fully qualified path + +RETURN VALUE: + std:vector - Vector of image information +===========================================================================*/ +std::vector GetImagesInfo( const std::string & path ) +{ + // Validate arguments + std::vector retVec; + if (path.size() <= 0) + { + return retVec; + } + + // Search all MBN files in the specified folder + std::string folderSearch = path; + + int folderLen = folderSearch.size(); + if (folderSearch[folderLen - 1] != '/') + { + folderSearch += '/'; + } + + std::vector files; + DepthSearch( folderSearch, + 0, + ".mbn", + files ); + + int fileNum = files.size(); + for (int i = 0; i < fileNum; i++) + { + std::string mbnName = files[i]; + + BYTE imageType = UCHAR_MAX; + BYTE imageID[16] = { 0 }; + ULONG versionID = ULONG_MAX; + USHORT versionSz = MAX_PATH * 2 + 1; + CHAR versionStr[MAX_PATH * 2 + 1] = { 0 }; + eGobiError rc = ::GetImageInfo( mbnName.c_str(), + &imageType, + &imageID[0], + &versionID, + versionSz, + &versionStr[0] ); + + if (rc == eGOBI_ERR_NONE) + { + sImageInfo ii; + ii.mImageType = (eGobiMBNType)imageType; + ii.mVersionID = versionID; + ii.mVersion = (LPCSTR)&versionStr[0]; + memcpy( (LPVOID)&ii.mImageID[0], (LPCVOID)&imageID[0], 16 ); + + retVec.push_back( ii ); + } + } + + return retVec; +} + +/*=========================================================================== +METHOD: + GetImageBootCompatibility (Public Method) + +DESCRIPTION: + Get the image boot compatibility for the image specified by the given + fully qualified path + +PARAMETERS: + pFilePath [ I ] - Fully qualified path to image file + pMajorVersion [ O ] - Major version of compatible boot downloader + pMinorVersion [ O ] - Minor version of compatible boot downloader + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError GetImageBootCompatibility( + LPCSTR pFilePath, + ULONG * pMajorVersion, + ULONG * pMinorVersion ) +{ + // Validate arguments + if ( (pFilePath == 0) + || (pFilePath[0] == 0) + || (pMajorVersion == 0) + || (pMinorVersion == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Open up MBN file + cMemoryMappedFile mbnFile( pFilePath ); + const BYTE * pMBNData = (const BYTE *)mbnFile.GetContents(); + ULONG dataSz = mbnFile.GetSize(); + + // MBN file (sort of) valid? + if (pMBNData == 0) + { + return eGOBI_ERR_FILE_OPEN; + } + + if (dataSz <= 256) + { + return eGOBI_ERR_INVALID_FILE; + } + + // Skip to the end + pMBNData += (dataSz - 256); + + const BYTE * pTmp = 0; + pTmp = ReverseBinaryDataSearch( pMBNData, + 256, + (const BYTE *)&MBN_BOOT_MAGIC, + (ULONG)sizeof( MBN_BOOT_MAGIC ) ); + + if (pTmp == 0) + { + return eGOBI_ERR_INVALID_FILE; + } + + const sMBNBootRecord * pRec = (const sMBNBootRecord *)pTmp; + *pMajorVersion = pRec->mMajorID; + *pMinorVersion = pRec->mMinorID; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + MapVersionInfo (Public Method) + +DESCRIPTION: + Map the specified version string to image capabilities + +PARAMETERS: + versionID [ I ] - Version ID + imageType [ I ] - Image type + pVersion [ I ] - Version string for image + pTechnology [ O ] - Technology type + pCarrier [ O ] - Carrier type + pRegion [ O ] - Region type + pGPSCapability [ O ] - GPS capability + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError MapVersionInfo( + ULONG versionID, + BYTE imageType, + LPCSTR pVersion, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + if ((eGobiMBNType)imageType == eGOBI_MBN_TYPE_MODEM) + { + // AMSS (modem) + bool bOK = ParseAMSSVersion( pVersion, + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); + + if (bOK == false) + { + return eGOBI_ERR_INVALID_ARG; + } + } + else if ((eGobiMBNType)imageType == eGOBI_MBN_TYPE_PRI) + { + // UQCN (PRI) + bool bOK = ParseUQCNVersion( versionID, + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); + + if (bOK == false) + { + return eGOBI_ERR_INVALID_ARG; + } + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetImageByUniqueID (Public Method) + +DESCRIPTION: + Return the fully qualified path to an image specified by unique ID + +PARAMETERS: + pImageID [ I ] - Unique image ID + +RETURN VALUE: + std::string - Fully qualified path to matching image +===========================================================================*/ +std::string GetImageByUniqueID( BYTE * pImageID ) +{ + // Validate arguments + std::string retStr = ""; + if (pImageID == 0) + { + return retStr; + } + + // Enumerate all folders of the image store + std::vector folders; + std::string imageStore = ::GetImageStore(); + EnumerateFolders( imageStore, folders ); + + // Did we find any folders? + ULONG foldersSz = (ULONG)folders.size(); + if (foldersSz == 0) + { + return retStr; + } + + // Go through each folder searching for a match + for (ULONG f = 0; f < foldersSz; f++) + { + // Search all MBN files in the specified folder + std::string folderSearch = folders[f]; + + int folderLen = folderSearch.size(); + if (folderSearch[folderLen - 1] != '/') + { + folderSearch += '/'; + } + + std::vector files; + DepthSearch( folderSearch, + 0, + ".mbn", + files ); + + int fileNum = files.size(); + for (int i = 0; i < fileNum; i++) + { + std::string mbnName = files[i]; + + BYTE imageType = UCHAR_MAX; + BYTE imageID[16] = { 0 }; + ULONG versionID = ULONG_MAX; + USHORT versionSz = MAX_PATH * 2 + 1; + CHAR versionStr[MAX_PATH * 2 + 1] = { 0 }; + eGobiError rc = ::GetImageInfo( mbnName.c_str(), + &imageType, + &imageID[0], + &versionID, + versionSz, + &versionStr[0] ); + + if (rc == eGOBI_ERR_NONE) + { + bool bMatch = true; + for (ULONG i = 0; i < 16; i++) + { + if (imageID[i] != pImageID[i]) + { + bMatch = false; + break; + } + } + + if (bMatch == true) + { + retStr = mbnName; + break; + } + } + } + + if (retStr.size() > 0) + { + break; + } + } + + return retStr; +} + diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiMBNMgmt.h b/gobi-api/GobiAPI_1.0.40/Shared/GobiMBNMgmt.h new file mode 100755 index 0000000..ff93d55 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiMBNMgmt.h @@ -0,0 +1,226 @@ +/*=========================================================================== +FILE: + GobiMBNMgmt.h + +DESCRIPTION: + QUALCOMM Gobi MBN management functions for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + sImageInfo + GetImageStore + GetImageInfo + GetImagesInfo + GetImageBootCompatibility + MapVersionInfo + GetImageByUniqueID + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiImageDefinitions.h" +#include "GobiError.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum length for unique image ID +const ULONG MBN_UNIQUE_ID_LEN = 16; + +/*=========================================================================*/ +// Struct sImageInfo +// Storage structure for Image information +/*=========================================================================*/ +struct sImageInfo +{ + public: + // Default constructor + sImageInfo() + : mImageType( eGOBI_MBN_TYPE_ENUM_BEGIN ), + mVersionID( ULONG_MAX ), + mVersion( "" ) + { + memset( (LPVOID)&mImageID[0], 0, MBN_UNIQUE_ID_LEN ); + }; + + // Is this object valid? + bool IsValid() const + { + return ( (mImageType != eGOBI_MBN_TYPE_ENUM_BEGIN) + && (mVersionID != ULONG_MAX) + && (mVersion.size() > 0) ); + }; + + /* Image type */ + eGobiMBNType mImageType; + + /* Unique image ID */ + BYTE mImageID[MBN_UNIQUE_ID_LEN]; + + /* Version ID */ + ULONG mVersionID; + + /* Version string */ + std::string mVersion; +}; + +/*=========================================================================*/ +// Public Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetImageStore (Public Method) + +DESCRIPTION: + Return the image store folder, i.e., the folder containing one or more + carrier-specific image subfolders + +RETURN VALUE: + std::string - Image Store +===========================================================================*/ +std::string GetImageStore(); + +/*=========================================================================== +METHOD: + GetImageInfo (Public Method) + +DESCRIPTION: + Get the image information for the image specified by the given fully + qualified path + +PARAMETERS: + pFilePath [ I ] - Fully qualified path to image file + pImageType [ O ] - Image type + pImageID [ O ] - Unique image ID + pVersionID [ O ] - Version ID + versionSize [ I ] - The maximum number of characters including the NULL + terminator that can be copied to the version array + pVersion [ O ] - NULL-terminated string representing the version + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError GetImageInfo( + LPCSTR pFilePath, + BYTE * pImageType, + BYTE * pImageID, + ULONG * pVersionID, + USHORT versionSize, + CHAR * pVersion ); + +/*=========================================================================== +METHOD: + GetImagesInfo (Public Method) + +DESCRIPTION: + Return the info for the images located at the given path + +PARAMETERS: + path [ I ] - Fully qualified path + +RETURN VALUE: + std:vector - Vector of image information +===========================================================================*/ +std::vector GetImagesInfo( const std::string & path ); + +/*=========================================================================== +METHOD: + GetImageBootCompatibility (Public Method) + +DESCRIPTION: + Get the image boot compatibility for the image specified by the given + fully qualified path + +PARAMETERS: + pFilePath [ I ] - Fully qualified path to image file + pMajorVersion [ O ] - Major version of compatible boot downloader + pMinorVersion [ O ] - Minor version of compatible boot downloader + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError GetImageBootCompatibility( + LPCSTR pFilePath, + ULONG * pMajorVersion, + ULONG * pMinorVersion ); + +/*=========================================================================== +METHOD: + MapVersionInfo (Public Method) + +DESCRIPTION: + Map the specified version string to image capabilities + +PARAMETERS: + versionID [ I ] - Version ID + imageType [ I ] - Image type + pVersion [ I ] - Version string for image + pTechnology [ O ] - Technology type + pCarrier [ O ] - Carrier type + pRegion [ O ] - Region type + pGPSCapability [ O ] - GPS capability + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError MapVersionInfo( + ULONG versionID, + BYTE imageType, + LPCSTR pVersion, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ); + +/*=========================================================================== +METHOD: + GetImageByUniqueID (Public Method) + +DESCRIPTION: + Return the fully qualified path to an image specified by unique ID + +PARAMETERS: + pImageID [ I ] - Unique image ID + +RETURN VALUE: + std::string - Fully qualified path to matching image +===========================================================================*/ +std::string GetImageByUniqueID( BYTE * pImageID ); + + diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQDLCore.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQDLCore.cpp new file mode 100755 index 0000000..9d3857b --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQDLCore.cpp @@ -0,0 +1,943 @@ +/*=========================================================================== +FILE: + GobiQDLCore.cpp + +DESCRIPTION: + QUALCOMM Gobi QDL Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQDLCore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQDLCore.h" + +#include "QDLBuffers.h" +#include "ProtocolNotification.h" +#include "CoreUtilities.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default/minimum timeout for QCWWAN QMI requests +const ULONG DEFAULT_GOBI_QDL_TIMEOUT = 4000; +const ULONG MINIMUM_GOBI_QDL_TIMEOUT = 2000; + +/*=========================================================================*/ +// cGobiQDLCore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiQDLCore (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiQDLCore::cGobiQDLCore() + : mQDL( 512, 512 ), + mQDLPortNode( "" ), + mQDLTimeout( DEFAULT_GOBI_QDL_TIMEOUT ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cGobiQDLCore (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiQDLCore::~cGobiQDLCore() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQDLCore::Initialize() +{ + // Nothing to do + return true; +} + +/*=========================================================================== +METHOD: + Cleanup (Public Method) + +DESCRIPTION: + Cleanup the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQDLCore::Cleanup() +{ + // Just in case + CloseQDLPort( false ); + + return true; +} + +/*=========================================================================== +METHOD: + GetAvailableQDLPorts (Public Method) + +DESCRIPTION: + Return the set of available Gobi QDL ports + +RETURN VALUE: + std::vector +===========================================================================*/ +std::vector cGobiQDLCore::GetAvailableQDLPorts() +{ + std::vector devices; + + std::string path = "/sys/bus/usb/devices/"; + + std::vector files; + DepthSearch( path, + 2, + "ttyUSB", + files ); + + int fileNum = files.size(); + for (int i = 0; i < fileNum; i++) + { + // Example "/sys/bus/usb/devices/8-1/8-1:1.1/ttyUSB0" + std::string nodePath = files[i]; + + int lastSlash = nodePath.find_last_of( "/" ); + + // This is what we want to return if everything else matches + std::string deviceNode = nodePath.substr( lastSlash + 1 ); + + // Move down one directory to the interface level + std::string curPath = nodePath.substr( 0, lastSlash ); + + // Read bInterfaceNumber + int handle = open( (curPath + "/bInterfaceNumber").c_str(), + O_RDONLY ); + if (handle == -1) + { + continue; + } + + char buff[4]; + memset( buff, 0, 4 ); + + bool bFound = false; + int ret = read( handle, buff, 2 ); + if (ret == 2) + { + // Interface 1 or 0 + ret = strncmp( buff, "01", 2 ); + if (ret == 0) + { + bFound = true; + } + ret = strncmp( buff, "00", 2 ); + if (ret == 0) + { + bFound = true; + } + + } + close( handle ); + + if (bFound == false) + { + continue; + } + + // Move down one directory to the device level + curPath = curPath.substr( 0, curPath.find_last_of( "/" ) ); + + // Read idVendor + handle = open( (curPath + "/idVendor").c_str(), O_RDONLY ); + if (handle == -1) + { + continue; + } + bFound = false; + ret = read( handle, buff, 4 ); + if (ret == 4) + { + ret = strncmp( buff, "05c6", 4 ); + if (ret == 0) + { + bFound = true; + } + } + close( handle ); + + if (bFound == false) + { + continue; + } + + // Read idProduct + handle = open( (curPath + "/idProduct").c_str(), O_RDONLY ); + if (handle == -1) + { + continue; + } + bFound = false; + ret = read( handle, buff, 4 ); + if (ret == 4) + { + ret = strncmp( buff, "920c", 4 ); + if (ret == 0) + { + bFound = true; + } + } + close( handle ); + + if (bFound == false) + { + continue; + } + + // Success! + devices.push_back( deviceNode ); + } + + return devices; +} + +/*=========================================================================== +METHOD: + SetQDLTimeout (Public Method) + +DESCRIPTION: + Set the timeout for all subsequent QDL transactions + +PARAMETERS: + to [ I ] - Timeout value (in milliseconds) + +RETURN VALUE: + eGobiError +===========================================================================*/ +eGobiError cGobiQDLCore::SetQDLTimeout( ULONG to ) +{ + if (to < MINIMUM_GOBI_QDL_TIMEOUT) + { + return eGOBI_ERR_INVALID_ARG; + } + + mQDLTimeout = to; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + OpenQDLPort (Public Method) + +DESCRIPTION: + This function opens the specified QDL port of the device + +PARAMETERS: + portID [ I ] - ID of QDL port to connect to + bBARMode [ I ] - Request boot and recovery mode feature + pMajorVersion [ O ] - Major version of the device boot downloader + pMinorVersion [ O ] - Minor version of the device boot downloader + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::OpenQDLPort( + std::string & portID, + ULONG bBARMode, + ULONG * pMajorVersion, + ULONG * pMinorVersion ) +{ + if (portID.empty() == true || pMajorVersion == 0 || pMinorVersion == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // First disconnect from current port (if any) + CloseQDLPort( false ); + + // Validate port ID + std::string foundDevice; + std::vector availPorts = GetAvailableQDLPorts(); + for (int index = 0; index < availPorts.size(); index++) + { + if (availPorts[index] == portID) + { + foundDevice = availPorts[index]; + break; + } + } + + if (foundDevice.empty() == true) + { + return eGOBI_ERR_INVALID_DEVID; + } + + // Initialize server (we don't care about the return code + // since the following Connect() call will fail if we are + // unable to initialize the server) + mQDL.Initialize(); + + // Connect to the port + std::string deviceStr = "/dev/" + foundDevice; + bool bOK = mQDL.Connect( deviceStr.c_str() ); + if (bOK == false) + { + return eGOBI_ERR_CONNECT; + } + + // Store port ID (we are connected) + mQDLPortNode = foundDevice; + + // Build the hello request + bool bBARFeature = bBARMode != 0; + sSharedBuffer * pHelloBuf = sQDLHello::BuildHelloReq( bBARFeature ); + if (pHelloBuf == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the hello request and wait for the response + sProtocolBuffer rsp; + rsp = SendQDL( pHelloBuf ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Extract major and minor boot downloader versions + ULONG majVer; + ULONG minVer; + sQDLHello helloRsp( rsp.GetSharedBuffer() ); + if (helloRsp.GetBootVersionInfo( majVer, minVer ) == false) + { + sQDLError errRsp( rsp.GetSharedBuffer() ); + if (errRsp.IsValid() == true) + { + eQDLError qdlErr = errRsp.GetErrorCode(); + return GetCorrectedQDLError( qdlErr ); + } + + return eGOBI_ERR_MALFORMED_RSP; + } + + // NOTE: in the current firmware implimentation, this cannot happen. + // No hello response will be received in case of feature mismatch. + if (bBARFeature == true) + { + const sQDLRawHelloRsp * pTmpRsp = helloRsp.GetResponse(); + if (pTmpRsp == 0) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + if ( (pTmpRsp->mFeatures & QDL_FEATURE_BAR_MODE) == 0) + { + return eGOBI_ERR_QDL_BAR_MODE; + } + } + + *pMajorVersion = majVer; + *pMinorVersion = minVer; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + CloseQDLPort (Public Method) + +DESCRIPTION: + This function closes the currently open QDL port of the device + +PARAMETERS: + bInformDevice [ I ] - Inform device that QDL port is being closed? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::CloseQDLPort( bool bInformDevice ) +{ + // Assume success + eGobiError rc = eGOBI_ERR_NONE; + if (mQDLPortNode.empty() == true) + { + rc = eGOBI_ERR_NO_CONNECTION; + } + else if (bInformDevice == true) + { + BYTE cmd = (BYTE)eQDL_CMD_SESSION_CLOSE_REQ; + eProtocolType pt = ePROTOCOL_QDL_TX; + + sSharedBuffer * pReq = 0; + pReq = new sSharedBuffer( (const BYTE *)&cmd, 1, pt ); + if (pReq == 0) + { + rc = eGOBI_ERR_MEMORY; + } + else + { + sProtocolBuffer rsp = SendQDL( pReq, 0, 0, false ); + rc = GetLastError(); + } + } + + mQDL.Disconnect(); + mQDL.Exit(); + + mQDLPortNode.clear(); + + return rc; +} + +/*=========================================================================== +METHOD: + GetQDLImagesPreference (Public Method) + +DESCRIPTION: + This function gets the current images preference as reported by the + device boot downloader + +PARAMETERS: + pImageListSize [I/O] - Upon input the maximum number of elements that the + image info list can contain. Upon successful output + the actual number of elements in the image info list + pImageList [ O ] - The image info list + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::GetQDLImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + if (pImageListSize == 0 || *pImageListSize == 0 || pImageList == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE cmd = (BYTE)eQDL_CMD_GET_IMAGE_PREF_REQ; + eProtocolType pt = ePROTOCOL_QDL_TX; + + sSharedBuffer * pReq = 0; + pReq = new sSharedBuffer( (const BYTE *)&cmd, 1, pt ); + if (pReq == 0) + { + return eGOBI_ERR_MEMORY; + } + + ULONG maxImages = (ULONG)*pImageListSize; + *pImageListSize = 0; + + sProtocolBuffer rsp = SendQDL( pReq ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + sQDLGetImagePref prefRsp( rsp.GetSharedBuffer() ); + if (prefRsp.IsValid() == false) + { + sQDLError errRsp( rsp.GetSharedBuffer() ); + if (errRsp.IsValid() == true) + { + eQDLError qdlErr = errRsp.GetErrorCode(); + return GetCorrectedQDLError( qdlErr ); + } + + return eGOBI_ERR_MALFORMED_RSP; + } + + std::list imageIDs = prefRsp.GetImageIDs(); + ULONG imageCount = (ULONG)imageIDs.size(); + if (imageCount > maxImages) + { + imageCount = maxImages; + } + + sQDLRawImageID * pOutList = (sQDLRawImageID *)pImageList; + std::list ::const_iterator pIter = imageIDs.begin(); + for (ULONG i = 0; i < imageCount; i++) + { + *pOutList++ = *pIter++; + } + + *pImageListSize = imageCount; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PrepareQDLImageWrite (Public Method) + +DESCRIPTION: + This function prepares the device boot downloader for an image write + +PARAMETERS: + imageType [ I ] - Type of image being written + imageSize [ I ] - Size of image being written + pBlockSize [I/O] - Upon input the maximum size of image block supported + by host, upon successful output the maximum size of + image block supported by device + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::PrepareQDLImageWrite( + BYTE imageType, + ULONG imageSize, + ULONG * pBlockSize ) +{ + eQDLImageType it = (eQDLImageType)imageType; + if (::IsValid( it ) == false) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (pBlockSize == 0 || *pBlockSize == 0 || *pBlockSize > QDL_MAX_CHUNK_SIZE) + { + return eGOBI_ERR_INVALID_ARG; + } + + sSharedBuffer * pReq = 0; + pReq = sQDLOpenUnframed::BuildOpenUnframedReq( it, imageSize, *pBlockSize ); + if (pReq == 0) + { + return eGOBI_ERR_MEMORY; + } + + sProtocolBuffer rsp = SendQDL( pReq ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + ULONG tmp; + sQDLOpenUnframed openRsp( rsp.GetSharedBuffer() ); + const sQDLRawOpenUnframedRsp * pTmp = openRsp.GetResponse(); + if (pTmp == 0 || openRsp.GetChunkSize( tmp ) == false) + { + sQDLError errRsp( rsp.GetSharedBuffer() ); + if (errRsp.IsValid() == true) + { + eQDLError qdlErr = errRsp.GetErrorCode(); + return GetCorrectedQDLError( qdlErr ); + } + + return eGOBI_ERR_MALFORMED_RSP; + } + + if (openRsp.IsSuccess() == false) + { + switch ((eQDLOpenStatus)pTmp->mStatus) + { + case eQDL_OPEN_STATUS_SIZE: + return eGOBI_ERR_QDL_OPEN_SIZE; + + case eQDL_OPEN_STATUS_BAD_TYPE: + return eGOBI_ERR_QDL_OPEN_TYPE; + + case eQDL_OPEN_STATUS_PROTECTION: + return eGOBI_ERR_QDL_OPEN_PROT; + + case eQDL_OPEN_STATUS_NOT_NEEDED: + return eGOBI_ERR_QDL_OPEN_SKIP; + } + + return eGOBI_ERR_QDL_ERR_GENERAL; + } + + *pBlockSize = tmp; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + WriteQDLImageBlock (Public Method) + +DESCRIPTION: + This function writes the specified image block to the device + +PARAMETERS: + sequenceNumber [ I ] - Sequence number for image write + blockSize [ I ] - Size of image block + pImageBlock [ I ] - Image block + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::WriteQDLImageBlock( + USHORT sequenceNumber, + ULONG blockSize, + BYTE * pImageBlock ) +{ + if (blockSize > QDL_MAX_CHUNK_SIZE || pImageBlock == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + sSharedBuffer * pReq = 0; + pReq = sQDLWriteUnframed::BuildWriteUnframedReq( sequenceNumber, + blockSize ); + + if (pReq == 0) + { + return eGOBI_ERR_MEMORY; + } + + sProtocolBuffer rsp = SendQDL( pReq, pImageBlock, blockSize ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + sQDLWriteUnframed writeRsp( rsp.GetSharedBuffer() ); + const sQDLRawWriteUnframedRsp * pTmp = writeRsp.GetResponse(); + if (pTmp == 0) + { + sQDLError errRsp( rsp.GetSharedBuffer() ); + if (errRsp.IsValid() == true) + { + eQDLError qdlErr = errRsp.GetErrorCode(); + return GetCorrectedQDLError( qdlErr ); + } + + return eGOBI_ERR_MALFORMED_RSP; + } + + if (writeRsp.IsSuccess() == false) + { + switch ((eQDLWriteStatus)pTmp->mStatus) + { + case eQDL_WRITE_STATUS_CRC: + return eGOBI_ERR_QDL_CRC; + + case eQDL_WRITE_STATUS_CONTENT: + return eGOBI_ERR_QDL_PARSING; + } + + return eGOBI_ERR_QDL_ERR_GENERAL; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ValidateQDLImages (Public Method) + +DESCRIPTION: + This function requests the device validate the written images + +PARAMETERS: + pImageType [ O ] - Upon failure this may contain the type of the image + that failed validation + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::ValidateQDLImages( BYTE * pImageType ) +{ + if (pImageType == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pImageType = UCHAR_MAX; + + BYTE cmd = (BYTE)eQDL_CMD_SESSION_DONE_REQ; + eProtocolType pt = ePROTOCOL_QDL_TX; + + sSharedBuffer * pReq = 0; + pReq = new sSharedBuffer( (const BYTE *)&cmd, 1, pt ); + if (pReq == 0) + { + return eGOBI_ERR_MEMORY; + } + + sProtocolBuffer rsp = SendQDL( pReq ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + sQDLDone doneRsp( rsp.GetSharedBuffer() ); + const sQDLRawDoneRsp * pTmp = doneRsp.GetResponse(); + if (pTmp == 0) + { + sQDLError errRsp( rsp.GetSharedBuffer() ); + if (errRsp.IsValid() == true) + { + eQDLError qdlErr = errRsp.GetErrorCode(); + return GetCorrectedQDLError( qdlErr ); + } + + return eGOBI_ERR_MALFORMED_RSP; + } + + if (doneRsp.IsSuccess() == false) + { + *pImageType = pTmp->mImageType; + switch ((eQDLDoneStatus)pTmp->mStatus) + { + case eQDL_DONE_STATUS_AUTH: + return eGOBI_ERR_QDL_AUTH; + + case eQDL_DONE_STATUS_WRITE: + return eGOBI_ERR_QDL_WRITE; + } + + return eGOBI_ERR_QDL_ERR_GENERAL; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SendQDL (Public Method) + +DESCRIPTION: + Send a QDL request and wait for and return response (if needed) + +PARAMETERS: + pRequest [ I ] - Request to schedule + pAuxData [ I ] - Auxiliary data for request + auxDataSz [ I ] - Size of auxiliary data + bWaitForResponse [ I ] - Wait for a response? + +RETURN VALUE: + sProtocolBuffer - The response (invalid when no response was received) +===========================================================================*/ +sProtocolBuffer cGobiQDLCore::SendQDL( + sSharedBuffer * pRequest, + const BYTE * pAuxData, + ULONG auxDataSz, + bool bWaitForResponse ) +{ + // Clear last error recorded + ClearLastError(); + + // Returned response + sProtocolBuffer rsp; + + // Validate the arguments + if (pRequest == 0) + { + mLastError = eGOBI_ERR_MEMORY; + return rsp; + } + + // We use the event based notification approach + cSyncQueue evts( 12, true ); + cProtocolQueueNotification pn( &evts ); + + // Process up to the indicated timeout + cEvent & sigEvt = evts.GetSignalEvent(); + + // Build the request object + sProtocolRequest req( pRequest, 0, mQDLTimeout, 1, 1, &pn ); + req.SetAuxiliaryData( pAuxData, auxDataSz ); + if (bWaitForResponse == false) + { + req.SetTXOnly(); + } + + // Are we connected? + if ( (mQDLPortNode.empty() == true) + || (mQDL.IsConnected() == false) ) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return rsp; + } + + // Grab the log from the server + const cProtocolLog & protocolLog = mQDL.GetLog(); + + // Schedule the request + ULONG reqID = mQDL.AddRequest( req ); + if (reqID == INVALID_REQUEST_ID) + { + mLastError = eGOBI_ERR_REQ_SCHEDULE; + return rsp; + } + + bool bReq = false; + bool bExit = false; + DWORD idx; + + // Process up to the indicated timeout + while (bExit == false) + { + int wc = sigEvt.Wait( mQDLTimeout, idx ); + if (wc == ETIME) + { + if (bReq == true) + { + mLastError = eGOBI_ERR_RESPONSE_TO; + } + else + { + mLastError = eGOBI_ERR_REQUEST_TO; + } + break; + } + else if (wc != 0) + { + mLastError = eGOBI_ERR_INTERNAL; + break; + } + + sProtocolNotificationEvent evt; + bool bEvt = evts.GetElement( idx, evt ); + if (bEvt == false) + { + mLastError = eGOBI_ERR_INTERNAL; + bExit = true; + break; + } + + switch (evt.mEventType) + { + case ePROTOCOL_EVT_REQ_ERR: + mLastError = eGOBI_ERR_REQUEST; + bExit = true; + break; + + case ePROTOCOL_EVT_RSP_ERR: + mLastError = eGOBI_ERR_RESPONSE; + bExit = true; + break; + + case ePROTOCOL_EVT_REQ_SENT: + { + bReq = true; + if (bWaitForResponse == false) + { + // Success! + bExit = true; + } + } + break; + + case ePROTOCOL_EVT_RSP_RECV: + // Success! + rsp = protocolLog.GetBuffer( evt.mParam2 ); + bExit = true; + break; + } + } + + if ( (mLastError == eGOBI_ERR_INTERNAL) + || (mLastError == eGOBI_ERR_REQUEST_TO) + || (mLastError == eGOBI_ERR_RESPONSE_TO) ) + { + // Remove the request as our protocol notification object is + // about to go out of scope and hence be destroyed + mQDL.RemoveRequest( reqID ); + } + + return rsp; +} + +/*=========================================================================== +METHOD: + GetConnectedPortID (Public Method) + +DESCRIPTION: + Get the device node of the currently connected Gobi device + +PARAMETERS: + devNode [ O ] - Device node (IE: ttyUSB0) + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQDLCore::GetConnectedPortID( std::string & devNode ) +{ + // Assume failure + bool bFound = false; + + devNode.clear(); + + // Were we once connected? + if (mQDLPortNode.size() > 0) + { + // Yes, but is our device still present? + // NOTE: This does not garantee the device did not leave and come back + std::vector devices = GetAvailableQDLPorts(); + ULONG deviceCount = (ULONG)devices.size(); + + for (ULONG a = 0; a < deviceCount; a++) + { + if (devices[a] == mQDLPortNode) + { + devNode = devices[a]; + + bFound = true; + break; + } + } + + if (bFound == false) + { + mLastError = eGOBI_ERR_NO_DEVICE; + } + } + else + { + // We are not connected + mLastError = eGOBI_ERR_NO_CONNECTION; + } + + return bFound; +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQDLCore.h b/gobi-api/GobiAPI_1.0.40/Shared/GobiQDLCore.h new file mode 100755 index 0000000..2787361 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQDLCore.h @@ -0,0 +1,168 @@ +/*=========================================================================== +FILE: + GobiQDLCore.h + +DESCRIPTION: + QUALCOMM Gobi QDL Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQDLCore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "QDLProtocolServer.h" +#include "GobiError.h" +#include "GobiMBNMgmt.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cGobiQDLCore +/*=========================================================================*/ +class cGobiQDLCore +{ + public: + // Constructor + cGobiQDLCore(); + + // Destructor + virtual ~cGobiQDLCore(); + + // Initialize the object + virtual bool Initialize(); + + // Cleanup the object + virtual bool Cleanup(); + + // Return the set of available Gobi QDL ports + std::vector GetAvailableQDLPorts(); + + // Set the timeout for QDL transactions + eGobiError SetQDLTimeout( ULONG to ); + + // Open the specified QDL port of the device + eGobiError OpenQDLPort( + std::string & portID, + ULONG bBARMode, + ULONG * pMajorVersion, + ULONG * pMinorVersion ); + + // Close the specified QDL port of the device + eGobiError CloseQDLPort( bool bInformDevice ); + + // Get the images preference as from the device boot downloader + eGobiError GetQDLImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ); + + // Prepare the device boot downloader for an image write + eGobiError PrepareQDLImageWrite( + BYTE imageType, + ULONG imageSize, + ULONG * pBlockSize ); + + // Write the specified image block to the device + eGobiError WriteQDLImageBlock( + USHORT sequenceNumber, + ULONG chunkSize, + BYTE * pImageBlock ); + + // Request the device validate the written images + eGobiError ValidateQDLImages( BYTE * pImageType ); + + // Send a QDL request and wait for and return response + sProtocolBuffer SendQDL( + sSharedBuffer * pRequest, + const BYTE * pAuxData = 0, + ULONG auxDataSz = 0, + bool bWAitForResponse = true ); + + // Get currently connected port ID + bool GetConnectedPortID( std::string & portNode ); + + // (Inline) Clear last error recorded + void ClearLastError() + { + mLastError = eGOBI_ERR_NONE; + }; + + // (Inline) Get last error recorded + eGobiError GetLastError() + { + return mLastError; + }; + + // (Inline) Return the last recorded error (if this happens to indicate + // that no error occurred then return eGOBI_ERR_INTERNAL) + eGobiError GetCorrectedLastError() + { + eGobiError ec = GetLastError(); + if (ec == eGOBI_ERR_NONE) + { + ec = eGOBI_ERR_INTERNAL; + } + + return ec; + }; + + // (Inline) Return the correct QDL error + eGobiError GetCorrectedQDLError( ULONG qdlError ) + { + ULONG ec = qdlError + (ULONG)eGOBI_ERR_QDL_OFFSET; + return (eGobiError)ec; + }; + + + protected: + /* QDL protocol server */ + cQDLProtocolServer mQDL; + + /* ID of QDL port device node is connected to */ + std::string mQDLPortNode; + + /* Timeout for QDL transactions (in milliseconds) */ + ULONG mQDLTimeout; + + /* Last error recorded */ + eGobiError mLastError; +}; + diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICore.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICore.cpp new file mode 100755 index 0000000..8ce7fad --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICore.cpp @@ -0,0 +1,1018 @@ +/*=========================================================================== +FILE: + GobiQMICore.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" +#include "ProtocolNotification.h" +#include "CoreUtilities.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default timeout for Gobi QMI requests +const ULONG DEFAULT_GOBI_QMI_TIMEOUT = 2000; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FindTLV (Free Method) + +DESCRIPTION: + Find the given TLV + +PARAMETERS: + tlvs [ I ] - TLV parsing input vector + tlvKey [ I ] - Key of the TLV that is to be found + +RETURN VALUE: + cDataParser::tParsedFields +===========================================================================*/ +sDB2NavInput FindTLV( + const std::vector & tlvs, + const sProtocolEntityKey & tlvKey ) +{ + sDB2NavInput retNI; + + // We need some TLVs to parse and a valid QMI DB key + ULONG tlvCount = (ULONG)tlvs.size(); + if (tlvCount == 0 || tlvKey.mKey.size() < 3) + { + return retNI; + } + + for (ULONG t = 0; t < tlvCount; t++) + { + const sDB2NavInput & ni = tlvs[t]; + if (tlvKey.mKey == ni.mKey) + { + retNI = ni; + break; + } + } + + return retNI; +} + +/*=========================================================================== +METHOD: + ParseTLV (Free Method) + +DESCRIPTION: + Parse the given TLV to fields + +PARAMETERS: + db [ I ] - Database to use + qmiBuf [ I ] - Original buffer containing TLV (locks data) + tlvs [ I ] - TLV parsing input vector + tlvKey [ I ] - Key of the TLV that is to be parsed + bFieldStrings [ I ] - Generate field value strings? + +RETURN VALUE: + cDataParser::tParsedFields +===========================================================================*/ +cDataParser::tParsedFields ParseTLV( + const cCoreDatabase & db, + const sProtocolBuffer & qmiBuf, + const std::vector & tlvs, + const sProtocolEntityKey & tlvKey, + bool bFieldStrings ) +{ + cDataParser::tParsedFields retFields; + + // We need some TLVs to parse and a valid QMI DB key + ULONG tlvCount = (ULONG)tlvs.size(); + if (tlvCount == 0 || tlvKey.mKey.size() < 3) + { + return retFields; + } + + for (ULONG t = 0; t < tlvCount; t++) + { + const sDB2NavInput & ni = tlvs[t]; + if (tlvKey.mKey == ni.mKey) + { + cDataParser dp( db, qmiBuf, tlvKey, ni.mpPayload, ni.mPayloadLen ); + dp.Parse( bFieldStrings, false ); + + retFields = dp.GetFields(); + break; + } + } + + return retFields; +} + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiQMICore (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiQMICore::cGobiQMICore() + : mbFailOnMultipleDevices( false ), + mDeviceNode( "" ), + mDeviceKey( "" ), + mLastError( eGOBI_ERR_NONE ), + mRequests( 16 ), + mLastNetStartID( (WORD)INVALID_QMI_TRANSACTION_ID ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cGobiQMICore (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + BOOL +===========================================================================*/ +cGobiQMICore::~cGobiQMICore() +{ + Cleanup(); +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Initialize() +{ + // Initialize database + mDB.Initialize(); + + // Allocate configured QMI servers + bool bOK = true; + std::set ::const_iterator pIter = mServerConfig.begin(); + while (pIter != mServerConfig.end()) + { + cQMIProtocolServer * pSvr = 0; + pSvr = new cQMIProtocolServer( pIter->first, 8192, 512 ); + if (pSvr == 0) + { + if (pIter->second == true) + { + bOK = false; + break; + } + } + else + { + mServers[pIter->first] = pSvr; + } + + pIter++; + } + + if (bOK == false) + { + Cleanup(); + } + + return bOK; +} + +/*=========================================================================== +METHOD: + Cleanup (Public Method) + +DESCRIPTION: + Cleanup the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Cleanup() +{ + Disconnect(); + + // Free allocated QMI servers + std::map ::const_iterator pIter; + pIter = mServers.begin(); + + while (pIter != mServers.end()) + { + cQMIProtocolServer * pSvr = pIter->second; + if (pSvr != 0) + { + delete pSvr; + } + + pIter++; + } + + mServers.clear(); + + return true; +} + +/*=========================================================================== +METHOD: + GetAvailableDevices (Public Method) + +DESCRIPTION: + Return the set of available Gobi network devices + +RETURN VALUE: + std::vector - Vector of device ID and device key pairs +===========================================================================*/ +std::vector +cGobiQMICore::GetAvailableDevices() +{ + std::vector devices; + + std::string path = "/sys/bus/usb/devices/"; + + std::vector files; + DepthSearch( path, + 3, + "qcqmi", + files ); + + int fileNum = files.size(); + for (int i = 0; i < fileNum; i++) + { + // Example "/sys/bus/usb/devices/8-1/8-1:1.0/GobiQMI/qcqmi0" + std::string nodePath = files[i]; + + int lastSlash = nodePath.find_last_of( "/" ); + + // This is what we want to return if everything else matches + std::string deviceNode = nodePath.substr( lastSlash + 1 ); + + // Move down two directories to the interface level + std::string curPath = nodePath.substr( 0, lastSlash ); + curPath = curPath.substr( 0, curPath.find_last_of( "/" ) ); + + // Read bInterfaceNumber + int handle = open( (curPath + "/bInterfaceNumber").c_str(), + O_RDONLY ); + if (handle == -1) + { + continue; + } + + char buff[4]; + memset( buff, 0, 4 ); + + bool bFound = false; + int ret = read( handle, buff, 2 ); + if (ret == 2) + { + ret = strncmp( buff, "00", 2 ); + if (ret == 0) + { + bFound = true; + } + + ret = strncmp( buff, "05", 2 ); + if (ret == 0) + { + bFound = true; + } + } + close( handle ); + + if (bFound == false) + { + continue; + } + + // Move down one directory to the device level + curPath = curPath.substr( 0, curPath.find_last_of( "/" ) ); + + // Read idVendor + handle = open( (curPath + "/idVendor").c_str(), O_RDONLY ); + if (handle == -1) + { + continue; + } + bFound = false; + ret = read( handle, buff, 4 ); + if (ret == 4) + { + ret = strncmp( buff, "05c6", 4 ); + if (ret == 0) + { + bFound = true; + } + } + close( handle ); + + if (bFound == false) + { + continue; + } + + // Read idProduct + handle = open( (curPath + "/idProduct").c_str(), O_RDONLY ); + if (handle == -1) + { + continue; + } + bFound = false; + ret = read( handle, buff, 4 ); + if (ret == 4) + { + ret = strncmp( buff, "920d", 4 ); + if (ret == 0) + { + bFound = true; + } + } + close( handle ); + + if (bFound == false) + { + continue; + } + + // Device node success! + + // Get MEID of device node (via ioctl) to use as key + std::string deviceStr = "/dev/" + deviceNode; + std::string key = cQMIProtocolServer::GetDeviceMEID( deviceStr ); + + tDeviceID device; + device.first = deviceNode; + device.second = key; + + devices.push_back( device ); + } + + return devices; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified (or first detected) Gobi device + + Both device node and key are case sensitive + +PARAMETERS: + pDeviceNode [ I ] - The device node + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Connect( + LPCSTR pDeviceNode, + LPCSTR pDeviceKey ) +{ + // Assume failure + bool bRC = false; + + // Clear last error recorded + ClearLastError(); + + // If you specify a device key then you have to specify a device ID + if (pDeviceNode == 0 && pDeviceKey != 0) + { + mLastError = eGOBI_ERR_INVALID_ARG; + return bRC; + } + + // First we terminate the current connection + Disconnect(); + + // Query system for list of active Gobi devices + std::vector devices = GetAvailableDevices(); + + // Did we find any devices? + ULONG deviceCount = (ULONG)devices.size(); + if (deviceCount == 0) + { + mLastError = eGOBI_ERR_NO_DEVICE; + return bRC; + } + + std::string deviceKey = ""; + if (pDeviceKey != 0) + { + deviceKey = pDeviceKey; + } + + // Filter that list to include only the specified device? + if (pDeviceNode != 0) + { + std::vector ::iterator current = devices.begin(); + while (current != devices.end()) + { + // Remove if device node doesn't match + if (current->first.compare( pDeviceNode ) != 0) + { + // Erase current element and update ourself to point to next + current = devices.erase( current ); + } + // Remove if invalid key is specified + else if (deviceKey.size() != 0 + && current->second.compare( deviceKey ) != 0) + { + current = devices.erase( current ); + } + // All necessary parameters match + else + { + current++; + } + } + } + + // Anything left after filtering? + deviceCount = (ULONG)devices.size(); + if (deviceCount == 0) + { + mLastError = eGOBI_ERR_NO_DEVICE; + return bRC; + } + + // Too many to choose from? + if (deviceCount > 1 && mbFailOnMultipleDevices == true) + { + mLastError = eGOBI_ERR_MULTIPLE_DEVICES; + return bRC; + } + + // Store device ID/key strings + mDeviceNode = devices[0].first; + mDeviceKey = devices[0].second; + + // Initalize/connect all configured QMI servers + std::map ::const_iterator pIter; + pIter = mServers.begin(); + + while (pIter != mServers.end()) + { + cQMIProtocolServer * pSvr = pIter->second; + if (pSvr != 0) + { + // Initialize server (we don't care about the return code + // since the following Connect() call will fail if we are + // unable to initialize the server) + pSvr->Initialize(); + + std::string deviceStr = "/dev/" + mDeviceNode; + bRC = pSvr->Connect( deviceStr.c_str() ); + if (bRC == false) + { + tServerConfig tsc( pIter->first, true ); + if (mServerConfig.find( tsc ) != mServerConfig.end()) + { + // Failure on essential server + break; + } + else + { + // QMI server non-essential (ignore failure) + bRC = true; + } + } + } + + pIter++; + } + + // Any server fail? + if (bRC == false) + { + // Yes, disconnect them all + Disconnect(); + + // ... and set the error code + mLastError = eGOBI_ERR_CONNECT; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the currently connected Gobi device + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Disconnect() +{ + // Clear last error recorded + ClearLastError(); + + // Assume failure + bool bRC = false; + if (mDeviceNode.size() > 0) + { + mDeviceNode.clear(); + mDeviceKey.clear(); + bRC = true; + } + else + { + mLastError = eGOBI_ERR_NO_CONNECTION; + } + + // Disconnect/clean-up all configured QMI servers + std::map ::const_iterator pIter; + pIter = mServers.begin(); + + while (pIter != mServers.end()) + { + cQMIProtocolServer * pSvr = pIter->second; + if (pSvr != 0) + { + pSvr->Disconnect(); + pSvr->Exit(); + } + + pIter++; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetConnectedDeviceID (Public Method) + +DESCRIPTION: + Get the device node/key of the currently connected Gobi device + +PARAMETERS: + devNode [ O ] - Device node (IE: qcqmi0) + devKey [ O ] - Device key (may be empty) + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::GetConnectedDeviceID( + std::string & devNode, + std::string & devKey ) +{ + // Clear last error recorded + ClearLastError(); + + // Assume failure + bool bFound = false; + devNode.clear(); + devKey.clear(); + + // Are all required servers connected? + bool bAllConnected = true; + + std::map ::const_iterator pIter; + pIter = mServers.begin(); + + while (pIter != mServers.end()) + { + tServerConfig tsc( pIter->first, true ); + cQMIProtocolServer * pSvr = pIter->second; + + if (mServerConfig.find( tsc ) != mServerConfig.end() && pSvr != 0) + { + if (pSvr->IsConnected() == false) + { + // Failure on essential server + bAllConnected = false; + break; + } + } + + pIter++; + } + + // Were we once connected? + if (mDeviceNode.size() > 0 && bAllConnected == true) + { + // Yes, but is our device still present? + // NOTE: This does not guarantee the device did not leave and come back + std::vector devices = GetAvailableDevices(); + ULONG deviceCount = (ULONG)devices.size(); + + for (ULONG a = 0; a < deviceCount; a++) + { + if (devices[a].first == mDeviceNode) + { + // If there is a device key specified, it must match. + if (mDeviceKey.size() > 0) + { + if (devices[a].second == mDeviceKey) + { + devNode = devices[a].first; + devKey = devices[a].second; + + bFound = true; + break; + } + } + else + { + devNode = devices[a].first; + + bFound = true; + break; + } + } + } + + if (bFound == false) + { + mLastError = eGOBI_ERR_NO_DEVICE; + } + } + else + { + // We are not connected + mLastError = eGOBI_ERR_NO_CONNECTION; + } + + return bFound; +} + +/*=========================================================================== +METHOD: + Send (Public Method) + +DESCRIPTION: + Send a request using the specified QMI protocol server and wait for (and + then return) the response + +PARAMETERS: + svc [ I ] - QMI service type + pRequest [ I ] - Request to schedule + to [ I ] - Timeout value (in milliseconds) + +RETURN VALUE: + sProtocolBuffer - The response (invalid when no response was received) +===========================================================================*/ +sProtocolBuffer cGobiQMICore::Send( + eQMIService svc, + sSharedBuffer * pRequest, + ULONG to ) +{ + // Clear last error recorded + ClearLastError(); + + // Returned response + sProtocolBuffer rsp; + + // Validate the arguments + if (pRequest == 0) + { + mLastError = eGOBI_ERR_MEMORY; + return rsp; + } + + // We use the event based notification approach + cSyncQueue evts( 12, true ); + cProtocolQueueNotification pn( &evts ); + + // Process up to the indicated timeout + cEvent & sigEvt = evts.GetSignalEvent(); + + // Build the request object + sProtocolRequest req( pRequest, 0, to, 1, 1, &pn ); + if (to == 0) + { + mLastError = eGOBI_ERR_INTERNAL; + return rsp; + } + + // Grab the server + cQMIProtocolServer * pSvr = GetServer( svc ); + if (pSvr == 0) + { + mLastError = eGOBI_ERR_INTERNAL; + return rsp; + } + + // Are we connected? + if (mDeviceNode.size() <= 0 || pSvr->IsConnected() == false) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return rsp; + } + + // Grab the log from the server + const cProtocolLog & protocolLog = pSvr->GetLog(); + + // Schedule the request + ULONG reqID = pSvr->AddRequest( req ); + if (reqID == INVALID_REQUEST_ID) + { + mLastError = eGOBI_ERR_REQ_SCHEDULE; + return rsp; + } + + // Store for external cancel + tServiceRequest sr( svc, reqID ); + mRequests.AddElement( sr ); + + bool bReq = false; + bool bExit = false; + DWORD idx; + + // Process up to the indicated timeout + while (bExit == false) + { + int wc = sigEvt.Wait( to, idx ); + if (wc == ETIME) + { + if (bReq == true) + { + mLastError = eGOBI_ERR_RESPONSE_TO; + } + else + { + mLastError = eGOBI_ERR_REQUEST_TO; + } + break; + } + else if (wc != 0) + { + mLastError = eGOBI_ERR_INTERNAL; + break; + } + + sProtocolNotificationEvent evt; + bool bEvt = evts.GetElement( idx, evt ); + if (bEvt == false) + { + mLastError = eGOBI_ERR_INTERNAL; + bExit = true; + break; + } + + switch (evt.mEventType) + { + case ePROTOCOL_EVT_REQ_ERR: + mLastError = eGOBI_ERR_REQUEST; + bExit = true; + break; + + case ePROTOCOL_EVT_RSP_ERR: + mLastError = eGOBI_ERR_RESPONSE; + bExit = true; + break; + + case ePROTOCOL_EVT_REQ_SENT: + { + // Are we doing WDS business? + if (svc == eQMI_SVC_WDS) + { + // Grab the as-sent request + DWORD id = evt.mParam2; + sProtocolBuffer tmpReq = protocolLog.GetBuffer( id ); + sSharedBuffer * pTmpRequest = tmpReq.GetSharedBuffer(); + if (pTmpRequest != 0) + { + // Check the message ID + sQMIServiceBuffer actualReq( pTmpRequest ); + ULONG msgID = actualReq.GetMessageID(); + if (msgID == (ULONG)eQMI_WDS_START_NET) + { + // Grab the transaction ID + mLastNetStartID = actualReq.GetTransactionID(); + } + } + } + + bReq = true; + } + break; + + case ePROTOCOL_EVT_RSP_RECV: + // Success! + rsp = protocolLog.GetBuffer( evt.mParam2 ); + bExit = true; + break; + } + } + + if ( (mLastError == eGOBI_ERR_INTERNAL) + || (mLastError == eGOBI_ERR_REQUEST_TO) + || (mLastError == eGOBI_ERR_RESPONSE_TO) ) + { + // Remove the request as our protocol notification object is + // about to go out of scope and hence be destroyed + pSvr->RemoveRequest( reqID ); + } + + // Check that the device is still there? + if ( (mLastError == eGOBI_ERR_REQUEST) + || (mLastError == eGOBI_ERR_RESPONSE) + || (mLastError == eGOBI_ERR_REQUEST_TO) + || (mLastError == eGOBI_ERR_RESPONSE_TO) ) + { + eGobiError tmp = mLastError; + + std::string dummy; + GetConnectedDeviceID( dummy, dummy ); + if (mLastError == eGOBI_ERR_NONE) + { + mLastError = tmp; + } + } + + return rsp; +} + +/*=========================================================================== +METHOD: + SendAndCheckReturn (Public Method) + +DESCRIPTION: + Send a request using the specified QMI protocol server and wait for (and + then validate) the response + +PARAMETERS: + svc [ I ] - QMI service type + pRequest [ I ] - Request to schedule + to [ I ] - Timeout value (in milliseconds) + +RETURN VALUE: + eGobiError - Corrected error code +===========================================================================*/ +eGobiError cGobiQMICore::SendAndCheckReturn( + eQMIService svc, + sSharedBuffer * pRequest, + ULONG to ) +{ + sProtocolBuffer rsp = Send( svc, pRequest, to ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + mLastError = eGOBI_ERR_MALFORMED_RSP; + return mLastError; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + mLastError = eGOBI_ERR_MALFORMED_RSP; + return mLastError; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Success! + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SendSimple (Public Method) + +DESCRIPTION: + Generate/send a request using the specified QMI protocol server and + wait for (and then return) the response + +PARAMETERS: + svc [ I ] - QMI service type + msgID [ I ] - QMI message ID of the request to generate + to [ I ] - Timeout value (in milliseconds) + + NOTE: The request has to be a single byte in length, i.e. just a + command code, in order for success + +RETURN VALUE: + sProtocolBuffer - The response (invalid when no response was received) +===========================================================================*/ +sProtocolBuffer cGobiQMICore::SendSimple( + eQMIService svc, + WORD msgID, + ULONG to ) +{ + // Clear last error recorded + ClearLastError(); + + sProtocolBuffer rsp; + + sSharedBuffer * pReq = 0; + pReq = sQMIServiceBuffer::BuildBuffer( svc, msgID ); + if (pReq == 0) + { + mLastError = eGOBI_ERR_MEMORY; + return rsp; + } + + rsp = Send( svc, pReq, to ); + return rsp; +} + +/*=========================================================================== +METHOD: + CancelSend (Public Method) + +DESCRIPTION: + Cancel the most recent in-progress Send() based operation + +RETURN VALUE: + eGobiError +===========================================================================*/ +eGobiError cGobiQMICore::CancelSend() +{ + ULONG reqs = mRequests.GetTotalCount(); + if (reqs == 0) + { + return eGOBI_ERR_NO_CANCELABLE_OP; + } + + tServiceRequest elem( eQMI_SVC_ENUM_BEGIN, INVALID_REQUEST_ID ); + bool bElem = mRequests.GetElement( --reqs, elem ); + if (bElem == false) + { + return eGOBI_ERR_INTERNAL; + } + + cQMIProtocolServer * pSvr = GetServer( elem.first ); + if (pSvr == 0) + { + return eGOBI_ERR_INTERNAL; + } + + + bool bRemove = pSvr->RemoveRequest( elem.second ); + if (bRemove == false) + { + return eGOBI_ERR_CANCEL_OP; + } + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICore.h b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICore.h new file mode 100755 index 0000000..0ef9c42 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICore.h @@ -0,0 +1,1028 @@ +/*=========================================================================== +FILE: + GobiQMICore.h + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "CoreDatabase.h" +#include "ProtocolBuffer.h" +#include "QMIProtocolServer.h" +#include "DataParser.h" +#include "DataPacker.h" +#include "DB2Utilities.h" +#include "SyncQueue.h" +#include "GobiError.h" +#include "GobiMBNMgmt.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default timeout for Gobi QMI requests +extern const ULONG DEFAULT_GOBI_QMI_TIMEOUT; + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +// Find the given TLV +sDB2NavInput FindTLV( + const std::vector & tlvs, + const sProtocolEntityKey & tlvKey ); + +// Parse the given TLV to fields +cDataParser::tParsedFields ParseTLV( + const cCoreDatabase & db, + const sProtocolBuffer & qmiBuf, + const std::vector & tlvs, + const sProtocolEntityKey & tlvKey, + bool bFieldStrings = false ); + +/*=========================================================================*/ +// Class cGobiQMICore +/*=========================================================================*/ +class cGobiQMICore +{ + public: + // Constructor + cGobiQMICore(); + + // Destructor + virtual ~cGobiQMICore(); + + // Initialize the object + virtual bool Initialize(); + + // Cleanup the object + virtual bool Cleanup(); + + // (Inline) Return the QMI database + const cCoreDatabase & GetDatabase() + { + return mDB; + }; + + // (Inline) Return the server as determined by the service type + cQMIProtocolServer * GetServer( eQMIService svc ) + { + cQMIProtocolServer * pSvr = 0; + + std::map ::const_iterator pIter; + pIter = mServers.find( svc ); + + if (pIter != mServers.end()) + { + pSvr = pIter->second; + } + + return pSvr; + }; + + // (Inline) Clear last error recorded + void ClearLastError() + { + mLastError = eGOBI_ERR_NONE; + }; + + // (Inline) Get last error recorded + eGobiError GetLastError() + { + return mLastError; + }; + + // (Inline) Return the last recorded error (if this happens to indicate + // that no error occurred then return eGOBI_ERR_INTERNAL) + eGobiError GetCorrectedLastError() + { + eGobiError ec = GetLastError(); + if (ec == eGOBI_ERR_NONE) + { + ec = eGOBI_ERR_INTERNAL; + } + + return ec; + }; + + // (Inline) Return the correct QMI error (if this happens to indicate + // that no error occurred then return the mapped eQMI_ERR_INTERNAL + // value) + eGobiError GetCorrectedQMIError( ULONG qmiErrorCode ) + { + ULONG ec = (ULONG)eQMI_ERR_INTERNAL + (ULONG)eGOBI_ERR_QMI_OFFSET; + if (qmiErrorCode != (ULONG)eQMI_ERR_NONE) + { + ec = qmiErrorCode + (ULONG)eGOBI_ERR_QMI_OFFSET; + } + + return (eGobiError)ec; + }; + + // Return the set of available Gobi devices + typedef std::pair tDeviceID; + virtual std::vector GetAvailableDevices(); + + // Connect to the specified (or first detected) Gobi device + virtual bool Connect( + LPCSTR pDeviceNode = 0, + LPCSTR pDeviceKey = 0 ); + + // Disconnect from the currently connected Gobi device + virtual bool Disconnect(); + + // Get the device ID of the currently connected Gobi device + virtual bool GetConnectedDeviceID( + std::string & devNode, + std::string & devKey ); + + // Send a request using the specified QMI protocol server and wait + // for (and then return) the response + sProtocolBuffer Send( + eQMIService svc, + sSharedBuffer * pRequest, + ULONG to = DEFAULT_GOBI_QMI_TIMEOUT ); + + // Send a request using the specified QMI protocol server and wait + // for (and then validate) the response + eGobiError SendAndCheckReturn( + eQMIService svc, + sSharedBuffer * pRequest, + ULONG to = DEFAULT_GOBI_QMI_TIMEOUT ); + + // Generate/send a request using the specified QMI protocol server + // and wait for (and then return) the response + sProtocolBuffer SendSimple( + eQMIService svc, + WORD msgID, + ULONG to = DEFAULT_GOBI_QMI_TIMEOUT ); + + // Cancel the most recent in-progress Send() based operation + eGobiError CancelSend(); + +#ifdef WDS_SUPPORT + // Return the state of the current packet data session + eGobiError GetSessionState( ULONG * pState ); + + // Return the duration of the current packet data session + eGobiError GetSessionDuration( ULONGLONG * pDuration ); + + // Return the active/total durations of the current packet data session + eGobiError GetSessionDurations( + ULONGLONG * pActiveDuration, + ULONGLONG * pTotalDuration ); + + // Return the dormancy state of the current packet session + eGobiError GetDormancyState( ULONG * pState ); + + // Return the current autoconnect data session setting + eGobiError GetEnhancedAutoconnect( + ULONG * pSetting, + ULONG * pRoamSetting ); + + // Set the autoconnect data session setting + eGobiError SetEnhancedAutoconnect( + ULONG setting, + ULONG * pRoamSetting ); + + // Write the default profile settings to the device + eGobiError SetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ); + + // Read the default profile settings from the device + eGobiError GetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ); + + // Activate a packet data session + eGobiError StartDataSession( + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword, + ULONG * pSessionId, + ULONG * pFailureReason ); + + // Cancel an in-progress packet data session activation + eGobiError CancelDataSession(); + + // Stop the current data session + eGobiError StopDataSession( ULONG sessionId ); + + // Return the current packet data session IP address + eGobiError GetIPAddress( ULONG * pIPAddress ); + + // Return connection rate information for the packet data connection + eGobiError GetConnectionRate( + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ); + + // Return the packet data transfer statistics + eGobiError GetPacketStatus( + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ); + + // Returns the RX/TX byte counts + eGobiError GetByteTotals( + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ); + + // Set the current mobile IP setting + eGobiError SetMobileIP( ULONG mode ); + + // Get the current mobile IP setting + eGobiError GetMobileIP( ULONG * pMode ); + + // Set the active mobile IP profile index + eGobiError SetActiveMobileIPProfile( + CHAR * pSPC, + BYTE index ); + + // Get the active mobile IP profile index + eGobiError GetActiveMobileIPProfile( BYTE * pIndex ); + + // Set the specified mobile IP profile settings + eGobiError SetMobileIPProfile( + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ); + + // Get the specified mobile IP profile settings + eGobiError GetMobileIPProfile( + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ); + + // Set the mobile IP parameters + eGobiError SetMobileIPParameters( + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + + // Get the mobile IP parameters + eGobiError GetMobileIPParameters( + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + + // Get the last mobile IP error + eGobiError GetLastMobileIPError( ULONG * pError ); + + // Set the DNS settings for the device + eGobiError SetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); + + // Get the DNS settings for the device + eGobiError GetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); +#endif + +#ifdef NAS_SUPPORT + // Get the AN-AAA authentication status + eGobiError GetANAAAAuthenticationStatus( ULONG * pStatus ); + + // Get the current available signal strengths (in dBm) + eGobiError GetSignalStrengths( + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ); + + // Get the current RF information + eGobiError GetRFInfo( + BYTE * pInstanceSize, + BYTE * pInstances ); + + // Perform a scan for available networks + eGobiError PerformNetworkScan( + BYTE * pInstanceSize, + BYTE * pInstances ); + + // Perform a scan for available networks (includes RAT) + eGobiError PerformNetworkRATScan( + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ); + + // Initiate a network registration + eGobiError InitiateNetworkRegistration( + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ); + + // Initiate a domain attach (or detach) + eGobiError InitiateDomainAttach( ULONG action ); + + // Get information regarding the system that currently provides service + eGobiError GetServingNetwork( + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ); + + // Get data capabilities of serving network system + eGobiError GetServingNetworkCapabilities( + BYTE * pDataCapssSize, + BYTE * pDataCaps ); + + // Retrieves the current data bearer technology + eGobiError GetDataBearerTechnology( ULONG * pDataBearer ); + + // Retrieve information about the home network of the device + eGobiError GetHomeNetwork( + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ); + + // Sets the network registration preference + eGobiError SetNetworkPreference( + ULONG technologyPref, + ULONG duration ); + + // Return the network registration preference + eGobiError GetNetworkPreference( + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ); + + // Set the current CDMA network parameters + eGobiError SetCDMANetworkParameters( + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + + // Return the current CDMA network parameters + eGobiError GetCDMANetworkParameters( + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + + // Return the Access Overload Class (ACCOLC) of the device + eGobiError GetACCOLC( BYTE * pACCOLC ); + + // Set the Access Overload Class (ACCOLC) of the device + eGobiError SetACCOLC( + CHAR * pSPC, + BYTE accolc ); + + // Return the PLMN mode from the CSP + eGobiError GetPLMNMode( ULONG * pMode ); + + // Return PLMN name information for the given MCC/MNC + eGobiError GetPLMNName( + USHORT mcc, + USHORT mnc, + ULONG * pNamesSize, + BYTE * pNames ); +#endif + +#ifdef DMS_SUPPORT + // Get device capabilities + eGobiError GetDeviceCapabilities( + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ); + + // Return the device manufacturer name + eGobiError GetManufacturer( + BYTE stringSize, + CHAR * pString ); + + // Return the device model ID + eGobiError GetModelID( + BYTE stringSize, + CHAR * pString ); + + // Return the device firmware revision + eGobiError GetFirmwareRevision( + BYTE stringSize, + CHAR * pString ); + + // Return the device firmware revisions + eGobiError GetFirmwareRevisions( + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ); + + // Return the voice number in use by the device + eGobiError GetVoiceNumber( + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ); + + // Return the device IMSI + eGobiError GetIMSI( + BYTE stringSize, + CHAR * pString ); + + // Return all serial numbers assigned to the device + eGobiError GetSerialNumbers( + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ); + + // Set the user lock state maintained by the device + eGobiError SetLock( + ULONG state, + CHAR * pCurrentPIN ); + + // Set the user lock state maintained by the device + eGobiError QueryLock( ULONG * pState ); + + // Set the user lock code maintained by the device + eGobiError ChangeLockPIN( + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ); + + // Return the device hardware revision + eGobiError GetHardwareRevision( + BYTE stringSize, + CHAR * pString ); + + // Return the version of the active Preferred Roaming List (PRL) + eGobiError GetPRLVersion( WORD * pPRLVersion ); + + // Return the ERI file that is stored in EFS on the device + eGobiError GetERIFile( + ULONG * pFileSize, + BYTE * pFile ); + + // Request the device to perform automatic service activation + eGobiError ActivateAutomatic( CHAR * pActivationCode ); + + // Request the device perform manual service activation + eGobiError ActivateManual( + CHAR * pSPC, + WORD sid, + CHAR * pMDN, + CHAR * pMIN, + ULONG prlSize, + BYTE * pPRL, + CHAR * pMNHA, + CHAR * pMNAAA ); + + // Requests the device reset configuration to factory defaults + eGobiError ResetToFactoryDefaults( CHAR * pSPC ); + + // Return the device activation state + eGobiError GetActivationState( ULONG * pActivationState ); + + // Set the operating mode of the device` + eGobiError SetPower( ULONG powerMode ); + + // Return the operating mode of the device + eGobiError GetPower( ULONG * pPowerMode ); + + // Return operating mode info from the device + eGobiError GetPowerInfo( + ULONG * pPowerMode, + ULONG * pReasonMask, + ULONG * pbPlatform ); + + // Return the reason why the device is currently offline + eGobiError GetOfflineReason( + ULONG * pReasonMask, + ULONG * pbPlatform ); + + // Return the current time of the device + eGobiError GetNetworkTime( + ULONGLONG * pTimeCount, + ULONG * pTimeSource ); + + // Validates the service programming code + eGobiError ValidateSPC( CHAR * pSPC ); +#endif + +#ifdef UIM_SUPPORT + // Enable or disable protection of UIM contents by a given PIN + eGobiError UIMSetPINProtection( + ULONG id, + ULONG bEnable, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + + // Verify the PIN before accessing the UIM contents + eGobiError UIMVerifyPIN( + ULONG id, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + + // Unblock a blocked PIN + eGobiError UIMUnblockPIN( + ULONG id, + CHAR * pPUKValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + + // Change the PIN value + eGobiError UIMChangePIN( + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + + // Return the status of the pin + eGobiError UIMGetPINStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + + // Return the UIM ICCID + eGobiError UIMGetICCID( + BYTE stringSize, + CHAR * pString ); + + // Return the blocking status of the specified facility control key + eGobiError UIMGetControlKeyBlockingStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ); + + // Change the specified facility control key + eGobiError UIMSetControlKeyProtection( + ULONG id, + ULONG status, + CHAR * pValue, + ULONG * pVerifyRetriesLeft ); + + // Unblock the specified facility control key + eGobiError UIMUnblockControlKey( + ULONG id, + CHAR * pValue, + ULONG * pUnblockRetriesLeft ); +#endif + +#ifdef WMS_SUPPORT + // Delete one or more SMS messages from device memory + eGobiError DeleteSMS( + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ); + + // Return the list of SMS messages stored on the device + eGobiError GetSMSList( + ULONG storageType, + ULONG * pRequestedTag, + ULONG * pMessageListSize, + BYTE * pMessageList ); + + // Return an SMS message from device memory + eGobiError GetSMS( + ULONG storageType, + ULONG messageIndex, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ); + + // Modify the status of an SMS message + eGobiError ModifySMSStatus( + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ); + + // Save an SMS message to device memory + eGobiError SaveSMS( + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageIndex ); + + // Send an SMS message for immediate over the air transmission + eGobiError SendSMS( + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageFailureCode ); + + // Return the SMS center address + eGobiError GetSMSCAddress( + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ); + + // Set the SMS center address + eGobiError SetSMSCAddress( + CHAR * pSMSCAddress, + CHAR * pSMSCType ); + + // Get the current incoming SMS routing information + eGobiError GetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ); + + // Set the desired incoming SMS routing information + eGobiError SetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ); +#endif + +#ifdef PDS_SUPPORT + // Return the current PDS state + eGobiError GetPDSState( + ULONG * pEnabled, + ULONG * pTracking ); + + // Set the PDS state + eGobiError SetPDSState( ULONG enable ); + + // Inject a system time into the PDS engine + eGobiError PDSInjectTimeReference( + ULONGLONG systemTime, + USHORT systemDiscontinuities ); + + // Return the default tracking session configuration + eGobiError GetPDSDefaults( + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ); + + // Set the default tracking session configuration + eGobiError SetPDSDefaults( + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ); + + // Return the XTRA automatic download configuration + eGobiError GetXTRAAutomaticDownload( + ULONG * pbEnabled, + USHORT * pInterval ); + + // Set the XTRA automatic download configuration + eGobiError SetXTRAAutomaticDownload( + ULONG bEnabled, + USHORT interval ); + + // Return the XTRA WWAN network preference + eGobiError GetXTRANetwork( ULONG * pPreference ); + + // Set the XTRA WWAN network preference + eGobiError SetXTRANetwork( ULONG preference ); + + // Return the XTRA database validity period + eGobiError GetXTRAValidity( + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ); + + // Force the XTRA database to be downloaded to the device + eGobiError ForceXTRADownload(); + + // Return the XTRA data positioning state + eGobiError GetXTRADataState( ULONG * pState ); + + // Set the XTRA data positioning state + eGobiError SetXTRADataState( ULONG state ); + + // Return the XTRA time positioning state + eGobiError GetXTRATimeState( ULONG * pState ); + + // Set the XTRA time positioning state + eGobiError SetXTRATimeState( ULONG state ); + + // Return the PDS AGPS configuration + eGobiError GetAGPSConfig( + ULONG * pServerAddress, + ULONG * pServerPort ); + + // Set the PDS AGPS configuration + eGobiError SetAGPSConfig( + ULONG serverAddress, + ULONG serverPort ); + + // Return the automatic tracking state for the service + eGobiError GetServiceAutomaticTracking( ULONG * pbAuto ); + + // Set the automatic tracking state for the service + eGobiError SetServiceAutomaticTracking( ULONG bAuto ); + + // Return the automatic tracking config for the NMEA COM port + eGobiError GetPortAutomaticTracking( ULONG * pbAuto ); + + // Set the automatic tracking config for the NMEA COM port + eGobiError SetPortAutomaticTracking( ULONG bAuto ); + + // Reset the specified PDS data + eGobiError ResetPDSData( + ULONG * pGPSDataMask, + ULONG * pCellDataMask ); +#endif + +#ifdef CAT_SUPPORT + // Send the terminal response to the device + eGobiError CATSendTerminalResponse( + ULONG refID, + ULONG dataLen, + BYTE * pData ); + + // Send the envelope command to the device + eGobiError CATSendEnvelopeCommand( + ULONG cmdID, + ULONG dataLen, + BYTE * pData ); +#endif + +#ifdef RMS_SUPPORT + // Query the state of the SMS wake functionality + eGobiError GetSMSWake( + ULONG * pbEnabled, + ULONG * pWakeMask ); + + // Enable/disable the SMS wake functionality + eGobiError SetSMSWake( + ULONG bEnable, + ULONG wakeMask ); +#endif + +#ifdef OMA_SUPPORT + // Start an OMA-DM session + eGobiError OMADMStartSession( ULONG sessionType ); + + // Cancel an ongoing OMA-DM session + eGobiError OMADMCancelSession(); + + // Return info related to the current (or previous) OMA-DM session + eGobiError OMADMGetSessionInfo( + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ); + + // Return information about the pending network initiated alert + eGobiError OMADMGetPendingNIA( + ULONG * pSessionType, + USHORT * pSessionID ); + + // Send the specified OMA-DM selection for the current network + // initiated session + eGobiError OMADMSendSelection( + ULONG selection, + USHORT sessionID ); + + // Return the OMA-DM feature settings + eGobiError OMADMGetFeatureSettings( + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ); + + // Set the OMA-DM device provisioning service update feature setting + eGobiError OMADMSetProvisioningFeature( ULONG bProvisioning ); + + // Set the OMA-DM PRL service update feature setting + eGobiError OMADMSetPRLUpdateFeature( ULONG bPRLUpdate ); +#endif + +#ifdef VOICE_SUPPORT + // Initiates a USSD operation + eGobiError OriginateUSSD( BYTE * pInfo ); + + // Respond to a USSD request from the network + eGobiError AnswerUSSD( BYTE * pInfo ); + + // Cancels an in-progress USSD operation + eGobiError CancelUSSD(); +#endif + +#ifdef IMG_SUPPORT + // Get the current image preference list + eGobiError GetImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ); + + // Set the current image preference list + eGobiError SetImagesPreference( + ULONG imageListSize, + BYTE * pImageList, + ULONG bForceDownload, + BYTE modemIndex, + ULONG * pImageTypesSize, + BYTE * pImageTypes ); + + // Return the boot and recovery image download mode + eGobiError GetBARMode( ULONG * pBARMode ); + + // Request the device enter boot and recovery image download mode + eGobiError SetBARMode(); + + // Get the list of images stored on the device + eGobiError GetStoredImages( + ULONG * pImageListSize, + BYTE * pImageList ); + + // Return info about the specified image from the device + eGobiError GetStoredImageInfo( + ULONG imageInfoSize, + BYTE * pImageInfo, + ULONG * pMajorVersion, + ULONG * pMinorVersion, + ULONG * pVersionID, + CHAR * pInfo, + ULONG * pLockID ); + + // Delete the specified image from the device + eGobiError DeleteStoredImage( + ULONG imageInfoSize, + BYTE * pImageInfo ); +#endif + +#ifdef IMG2K_SUPPORT + eGobiError GetFirmwareInfo( + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ); + + // Upgrade firmware + eGobiError UpgradeFirmware( CHAR * pDestinationPath ); + + // Return image information + eGobiError GetImageInfo( + CHAR * pPath, + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ); + + // Return the image store folder + eGobiError GetImageStore( + WORD pathSize, + CHAR * pImageStorePath ); +#endif + + protected: + /* Database used for packing/parsing QMI protocol entities */ + cCoreDatabase mDB; + + /* Service type/service is required for object operation */ + typedef std::pair tServerConfig; + + /* Servers object is configured to support */ + std::set mServerConfig; + + /* QMI protocol servers */ + std::map mServers; + + /* Fail connect attempts when multiple devices are present? */ + bool mbFailOnMultipleDevices; + + /* Device node that this object is currently connected to */ + std::string mDeviceNode; + + /* Device key string of connected device (may be empty) */ + std::string mDeviceKey; + + /* Last error recorded */ + eGobiError mLastError; + + /* Outstanding requests */ + typedef std::pair tServiceRequest; + cSyncQueue mRequests; + + /* Last recorded QMI_WDS_START_NET transaction ID */ + WORD mLastNetStartID; +}; diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreCAT.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreCAT.cpp new file mode 100755 index 0000000..1d36e0c --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreCAT.cpp @@ -0,0 +1,219 @@ +/*=========================================================================== +FILE: + GobiQMICoreCAT.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (CAT Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sCATTerminalResponseHdr +// Struct to represent a CAT terminal response header +/*=========================================================================*/ +struct sCATTerminalResponseHdr +{ + public: + ULONG mReferenceID; + USHORT mLength; + + // Terminal response data of 'mLength' follows +}; + +/*=========================================================================*/ +// Struct sCATEnvelopeCommandHdr +// Struct to represent a CAT envelope command header +/*=========================================================================*/ +struct sCATEnvelopeCommandHdr +{ + public: + USHORT mCommandID; + USHORT mLength; + + // Envelope command data of 'mLength' follows +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + CATSendTerminalResponse (Public Method) + +DESCRIPTION: + This function sends the terminal response to the device + +PARAMETERS: + refID [ I ] - UIM reference ID (from CAT event) + dataLen [ I ] - Terminal response data length + pData [ I ] - Terminal response data + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::CATSendTerminalResponse( + ULONG refID, + ULONG dataLen, + BYTE * pData ) +{ + const ULONG szTransHdr = (ULONG)sizeof( sQMIServiceRawTransactionHeader ); + const ULONG szMsgHdr = (ULONG)sizeof( sQMIRawMessageHeader ); + const ULONG szTLVHdr = (ULONG)sizeof( sQMIRawContentHeader ); + const ULONG szCATHdr = (ULONG)sizeof( sCATTerminalResponseHdr ); + + // Validate arguments + if (pData == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE buf[QMI_MAX_BUFFER_SIZE]; + + ULONG totalLen = szTransHdr + szMsgHdr+ szTLVHdr + szCATHdr + dataLen; + if (QMI_MAX_BUFFER_SIZE < totalLen) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)&buf[0]; + pTLV->mTypeID = 1; + pTLV->mLength = (WORD)(szCATHdr + dataLen); + + sCATTerminalResponseHdr * pCAT = (sCATTerminalResponseHdr *)&buf[szTLVHdr]; + pCAT->mReferenceID = refID; + pCAT->mLength = (USHORT)dataLen; + + pCAT++; + if (dataLen > 0) + { + memcpy( (LPVOID)pCAT, (LPCVOID)pData, (SIZE_T)dataLen ); + } + + sSharedBuffer * pReq = 0; + pReq = sQMIServiceBuffer::BuildBuffer( eQMI_SVC_CAT, + (WORD)eQMI_CAT_SEND_TERMINAL, + false, + false, + &buf[0], + szTLVHdr + szCATHdr + dataLen ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_CAT, pReq ); +} + +/*=========================================================================== +METHOD: + CATSendEnvelopeCommand (Public Method) + +DESCRIPTION: + This function sends the envelope command to the device + +PARAMETERS: + cmdID [ I ] - Envelope command ID + dataLen [ I ] - Envelope command data length + pData [ I ] - Envelope command data + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::CATSendEnvelopeCommand( + ULONG cmdID, + ULONG dataLen, + BYTE * pData ) +{ + const ULONG szTransHdr = (ULONG)sizeof( sQMIServiceRawTransactionHeader ); + const ULONG szMsgHdr = (ULONG)sizeof( sQMIRawMessageHeader ); + const ULONG szTLVHdr = (ULONG)sizeof( sQMIRawContentHeader ); + const ULONG szCATHdr = (ULONG)sizeof( sCATEnvelopeCommandHdr ); + + // Validate arguments + if (pData == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE buf[QMI_MAX_BUFFER_SIZE]; + + ULONG totalLen = szTransHdr + szMsgHdr+ szTLVHdr + szCATHdr + dataLen; + if (QMI_MAX_BUFFER_SIZE < totalLen) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)&buf[0]; + pTLV->mTypeID = 1; + pTLV->mLength = (WORD)(szCATHdr + dataLen); + + sCATEnvelopeCommandHdr * pCAT = (sCATEnvelopeCommandHdr *)&buf[szTLVHdr]; + pCAT->mCommandID = (USHORT)cmdID; + pCAT->mLength = (USHORT)dataLen; + + pCAT++; + if (dataLen > 0) + { + memcpy( (LPVOID)pCAT, (LPCVOID)pData, (SIZE_T)dataLen ); + } + + sSharedBuffer * pReq = 0; + pReq = sQMIServiceBuffer::BuildBuffer( eQMI_SVC_CAT, + (WORD)eQMI_CAT_SEND_ENVELOPE, + false, + false, + &buf[0], + szTLVHdr + szCATHdr + dataLen ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_CAT, pReq ); +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreDMS.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreDMS.cpp new file mode 100755 index 0000000..16499a8 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreDMS.cpp @@ -0,0 +1,2050 @@ +/*=========================================================================== +FILE: + GobiQMICoreDMS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (DMS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetDeviceCapabilities (Public Method) + +DESCRIPTION: + This function gets device capabilities + +PARAMETERS: + pMaxTXChannelRate [ O ] - Maximum transmission rate (bps) + pMaxRXChannelRate [ O ] - Maximum reception rate (bps) + pDataServiceCapability [ O ] - CS/PS data service capability + pSimCapability [ O ] - Device SIM support + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. + Upon successful output the actual number + of elements in the radio interface array + pRadioIfaces [ O ] - The radio interface array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetDeviceCapabilities( + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ) +{ + // Validate arguments + if ( (pMaxTXChannelRate == 0) + || (pMaxRXChannelRate == 0) + || (pDataServiceCapability == 0) + || (pSimCapability == 0) + || (pRadioIfacesSize == 0) + || (*pRadioIfacesSize == 0) + || (pRadioIfaces == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxRadioIfaces = (ULONG)*pRadioIfacesSize; + + // Assume failure + *pRadioIfacesSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_CAPS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 5) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the variables + *pMaxTXChannelRate = pf[0].mValue.mU32; + *pMaxRXChannelRate = pf[1].mValue.mU32; + *pDataServiceCapability = pf[2].mValue.mU32; + *pSimCapability = pf[3].mValue.mU8; + + ULONG activeRadioIfaces = (ULONG)pf[4].mValue.mU8; + if (pf.size() < 5 + activeRadioIfaces) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (activeRadioIfaces > maxRadioIfaces) + { + activeRadioIfaces = maxRadioIfaces; + } + + ULONG * pOutRadioIfaces = (ULONG *)pRadioIfaces; + for (ULONG r = 0; r < activeRadioIfaces; r++) + { + *pOutRadioIfaces++ = pf[5 + r].mValue.mU32; + } + + *pRadioIfacesSize = activeRadioIfaces; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetManufacturer (Public Method) + +DESCRIPTION: + This function returns the device manufacturer name + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetManufacturer( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_MANUFACTURER; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (stringSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pString[strLen] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetModelID (Public Method) + +DESCRIPTION: + This function returns the device model ID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetModelID( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_MODEL_ID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (stringSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pString[strLen] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetFirmwareRevision (Public Method) + +DESCRIPTION: + This function returns the device firmware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetFirmwareRevision( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_REV_ID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (PRI revision) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpPRI = pf[0].mValueString; + ULONG lenPRI = (ULONG)tmpPRI.size(); + + // Space to perform the copy? + if (stringSize < lenPRI + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)tmpPRI.c_str(), lenPRI + 1 ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetFirmwareRevisions (Public Method) + +DESCRIPTION: + This function returns the device firmware (AMSS, boot, and PRI) + revisions + +PARAMETERS: + amssSize [ I ] - The maximum number of characters (including NULL + terminator) that the AMSS string array can contain + pAMSSString [ O ] - NULL terminated AMSS revision string + bootSize [ I ] - The maximum number of characters (including NULL + terminator) that the boot string array can contain + pBootString [ O ] - NULL terminated boot code revision string + priSize [ I ] - The maximum number of characters (including NULL + terminator) that the PRI string array can contain + pPRIString [ O ] - NULL terminated PRI revision string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetFirmwareRevisions( + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ) +{ + // Validate arguments + if ( (amssSize == 0 || pAMSSString == 0) + || (bootSize == 0 || pBootString == 0) + || (priSize == 0 || pPRIString == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pAMSSString = 0; + *pBootString = 0; + *pPRIString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_REV_ID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (PRI revision) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpPRI = pf[0].mValueString; + ULONG lenPRI = (ULONG)tmpPRI.size(); + + // Space to perform the copy? + if (priSize < lenPRI + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pPRIString, (LPCSTR)tmpPRI.c_str(), lenPRI + 1 ); + + // Parse the TLV we want (boot code revision) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpBoot = pf[0].mValueString; + ULONG lenBoot = (ULONG)tmpBoot.size(); + + // Space to perform the copy? + if (bootSize < lenBoot + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pBootString, (LPCSTR)tmpBoot.c_str(), lenBoot + 1 ); + + // Parse the TLV we want (AMSS revision) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpAMSS = pf[0].mValueString; + ULONG lenAMSS = (ULONG)tmpAMSS.size(); + + // Space to perform the copy? + if (amssSize < lenAMSS + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pAMSSString, (LPCSTR)tmpAMSS.c_str(), lenAMSS + 1 ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetVoiceNumber (Public Method) + +DESCRIPTION: + This function returns the voice number in use by the device + +PARAMETERS: + voiceNumberSize [ I ] - The maximum number of characters (including NULL + terminator) that the voice number array can + contain + pVoiceNumber [ O ] - Voice number (MDN or ISDN) string + minSize [ I ] - The maximum number of characters (including NULL + terminator) that the MIN array can contain + pMIN [ O ] - MIN string (empty string returned when MIN is + not supported/programmed) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetVoiceNumber( + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ) +{ + // Validate arguments + if (voiceNumberSize == 0 || pVoiceNumber == 0 || minSize == 0 || pMIN == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pVoiceNumber = 0; + *pMIN = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_NUMBER; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + LONG strLen = pf1[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (voiceNumberSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pVoiceNumber, (LPCSTR)pf1[0].mValueString.c_str(), strLen ); + pVoiceNumber[strLen] = 0; + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() >= 1) + { + strLen = pf2[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (minSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pMIN, (LPCSTR)pf2[0].mValueString.c_str(), strLen ); + pMIN[strLen] = 0; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetIMSI (Public Method) + +DESCRIPTION: + This function returns the device IMSI + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetIMSI( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_IMSI; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (IMSI) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpIMSI = pf[0].mValueString; + ULONG lenIMSI = (ULONG)tmpIMSI.size(); + + // Space to perform the copy? + if (stringSize < lenIMSI + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)tmpIMSI.c_str(), lenIMSI + 1 ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSerialNumbers (Public Method) + +DESCRIPTION: + This command returns all serial numbers assigned to the device + +PARAMETERS: + esnSize [ I ] - The maximum number of characters (including NULL + terminator) that the ESN array can contain + pESNString [ O ] - ESN string (empty string returned when ESN is + not supported/programmed) + imeiSize [ I ] - The maximum number of characters (including NULL + terminator) that the IMEI array can contain + pIMEIString [ O ] - IMEI string (empty string returned when IMEI is + not supported/programmed) + meidSize [ I ] - The maximum number of characters (including NULL + terminator) that the MEID array can contain + pMEIDString [ O ] - MEID string (empty string returned when MEID is + not supported/programmed) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSerialNumbers( + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ) +{ + // Validate arguments + if ( (esnSize == 0) + || (pESNString == 0) + || (imeiSize == 0) + || (pIMEIString == 0) + || (meidSize == 0) + || (pMEIDString == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pESNString = 0; + *pIMEIString = 0; + *pMEIDString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_IDS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() >= 1) + { + LONG strLen = pf1[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (esnSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pESNString, (LPCSTR)pf1[0].mValueString.c_str(), strLen ); + pESNString[strLen] = 0; + } + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() >= 1) + { + LONG strLen = pf2[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (imeiSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pIMEIString, (LPCSTR)pf2[0].mValueString.c_str(), strLen ); + pIMEIString[strLen] = 0; + } + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey3( eDB2_ET_QMI_DMS_RSP, msgID, 18 ); + cDataParser::tParsedFields pf3 = ParseTLV( db, rsp, tlvs, tlvKey3 ); + if (pf3.size() >= 1) + { + LONG strLen = pf3[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (meidSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pMEIDString, (LPCSTR)pf3[0].mValueString.c_str(), strLen ); + pMEIDString[strLen] = 0; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetLock (Public Method) + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + state [ I ] - Desired lock state + pCurrentPIN [ I ] - Current four digit PIN string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetLock( + ULONG state, + CHAR * pCurrentPIN ) +{ + // Validate arguments + if (pCurrentPIN == 0 || pCurrentPIN[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string thePIN( pCurrentPIN ); + if (thePIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = thePIN.find_first_not_of( "0123456789" ); + std::string digitPIN = thePIN.substr( 0, nNonDigit ); + if (digitPIN.size() != thePIN.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_SET_USER_LOCK_STATE; + std::vector piv; + + // "%u %s" + std::ostringstream tmp; + tmp << (UINT)state << " " << thePIN; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} + +/*=========================================================================== +METHOD: + QueryLock (Public Method) + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + pState [ O ] - Current lock state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::QueryLock( ULONG * pState ) +{ + // Validate arguments + if (pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_USER_LOCK_STATE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the mode + *pState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ChangeLockPIN (Public Method) + +DESCRIPTION: + This command sets the user lock code maintained by the device + +PARAMETERS: + pCurrentPIN [ O ] - Current four digit PIN string + pDesiredPIN [ O ] - New four digit PIN string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ChangeLockPIN( + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ) +{ + // Validate arguments + if ( (pCurrentPIN == 0) + || (pCurrentPIN[0] == 0) + || (pDesiredPIN == 0) + || (pDesiredPIN[0] == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theCurPIN( pCurrentPIN ); + if (theCurPIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = theCurPIN.find_first_not_of( "0123456789" ); + std::string digitCurPIN = theCurPIN.substr( 0, nNonDigit ); + if (digitCurPIN.size() != theCurPIN.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theNewPIN( pDesiredPIN ); + if (theNewPIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + nNonDigit = theNewPIN.find_first_not_of( "0123456789" ); + std::string digitNewPIN = theNewPIN.substr( 0, nNonDigit ); + if (digitNewPIN.size() != theNewPIN.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_SET_USER_LOCK_CODE; + std::vector piv; + + // "%s %s" + std::ostringstream tmp; + tmp << theCurPIN << " " << theNewPIN; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetHardwareRevision (Public Method) + +DESCRIPTION: + This function returns the device hardware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetHardwareRevision( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_MSM_ID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (stringSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pString[strLen] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetPRLVersion (Public Method) + +DESCRIPTION: + This function returns the version of the active Preferred Roaming List + (PRL) in use by the device + +PARAMETERS: + pPRLVersion [ O ] - The PRL version number + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPRLVersion( WORD * pPRLVersion ) +{ + // Validate arguments + if (pPRLVersion == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_PRL_VERSION; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pPRLVersion = pf[0].mValue.mU16; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetERIFile (Public Method) + +DESCRIPTION: + This command returns the ERI file that is stored in EFS on the device + +PARAMETERS: + pFileSize [I/O] - Upon input the maximum number of bytes that the file + contents array can contain. Upon successful output + the actual number of bytes written to the file contents + array + pFile [ O ] - The file contents + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetERIFile( + ULONG * pFileSize, + BYTE * pFile ) +{ + // Validate arguments + if (pFileSize == 0 || *pFileSize == 0 || pFile == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + ULONG maxFileSize = *pFileSize; + *pFileSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_READ_ERI_FILE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG fileSz = pf[0].mValue.mU16; + if (pf.size() < 1 + fileSz) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to copy into? + if (fileSz > maxFileSize) + { + return eGOBI_ERR_BUFFER_SZ; + } + + for (ULONG f = 0; f < fileSz; f++) + { + pFile[f] = pf[1 + f].mValue.mU8; + } + + *pFileSize = fileSz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ActivateAutomatic (Public Method) + +DESCRIPTION: + This function requests the device to perform automatic service activation + +PARAMETERS: + pActivationCode [ I ] - Activation code (maximum string length of 12) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ActivateAutomatic( CHAR * pActivationCode ) +{ + // Validate arguments + if ( (pActivationCode == 0) + || (pActivationCode[0] == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string ac( pActivationCode ); + if (ac.size() > 12) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_ACTIVATE_AUTOMATIC; + std::vector piv; + + std::ostringstream tmp; + tmp << (ULONG)ac.size() << " \"" << ac << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + /// Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest, 300000 ); +} + +/*=========================================================================== +METHOD: + ActivateManual (Public Method) + +DESCRIPTION: + This function requests the device perform manual service activation, + after a successful request the device is then asked to reset + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + sid [ I ] - System identification number + pMDN [ I ] - Mobile Directory Number string + pMIN [ I ] - Mobile Identification Number string + prlSize [ I ] - (Optional) Size of PRL file array + pPRL [ I ] - (Optional) The PRL file contents + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ActivateManual( + CHAR * pSPC, + WORD sid, + CHAR * pMDN, + CHAR * pMIN, + ULONG prlSize, + BYTE * pPRL, + CHAR * pMNHA, + CHAR * pMNAAA ) +{ + // Validate arguments + if ( (pSPC == 0) + || (pSPC[0] == 0) + || (pMDN == 0) + || (pMDN[0] == 0) + || (pMIN == 0) + || (pMIN[0] == 0) + || (prlSize > QMI_DMS_MAX_PRL_SIZE) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theMDN( pMDN ); + if (theMDN.size() > 16) + { + return eGOBI_ERR_INVALID_ARG; + } + + nNonDigit = theMDN.find_first_not_of( "0123456789" ); + std::string digitMDN = theMDN.substr( 0, nNonDigit ); + if (digitMDN.size() != theMDN.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theMIN( pMIN ); + if (theMIN.size() > 16) + { + return eGOBI_ERR_INVALID_ARG; + } + + nNonDigit = theMIN.find_first_not_of( "0123456789" ); + std::string digitMIN = theMIN.substr( 0, nNonDigit ); + if (digitMIN.size() != theMIN.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theMNHA; + if (pMNHA != 0 && pMNHA[0] != 0) + { + theMNHA = pMNHA; + if (theMNHA.size() > 16) + { + return eGOBI_ERR_INVALID_ARG; + } + } + + std::string theMNAAA; + if (pMNAAA != 0 && pMNAAA[0] != 0) + { + theMNAAA = pMNAAA; + if (theMNAAA.size() > 16) + { + return eGOBI_ERR_INVALID_ARG; + } + } + + WORD msgID = (WORD)eQMI_DMS_ACTIVATE_MANUAL; + std::vector piv; + + // "%s %u %d %s %d %s" + std::ostringstream tmp; + tmp << spc << " " << (UINT)sid << " " << theMDN.size() << " " << theMDN + << " " << theMIN.size() << " " << theMIN; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + if (theMNHA.size() > 0) + { + sProtocolEntityKey pek1( eDB2_ET_QMI_DMS_REQ, msgID, 17 ); + std::ostringstream tmp; + tmp << (int)theMNHA.size() << " \"" << theMNHA << "\""; + + sDB2PackingInput pi1( pek1, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi1 ); + } + + if (theMNAAA.size() > 0) + { + sProtocolEntityKey pek1( eDB2_ET_QMI_DMS_REQ, msgID, 18 ); + std::ostringstream tmp; + tmp << (int)theMNAAA.size() << " \"" << theMNAAA << "\""; + + sDB2PackingInput pi1( pek1, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi1 ); + } + + // Do we need to go through the anguish of the segmented PRL? + if (prlSize > 0) + { + ULONG blockSz = QMI_DMS_MAX_PRL_BLOCK; + + // Determine number of writes + ULONG writes = prlSize / blockSz; + if ((prlSize % blockSz) != 0) + { + writes++; + } + + ULONG offset = 0; + ULONG to = DEFAULT_GOBI_QMI_TIMEOUT; + + // Generate and send requests + eGobiError err = eGOBI_ERR_NONE; + for (ULONG w = 0; w < writes; w++) + { + if (w == writes - 1) + { + to = 300000; + if ((prlSize % blockSz) != 0) + { + blockSz = prlSize % blockSz; + } + } + + std::vector pivLocal = piv; + + // "%u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)prlSize << " " << (UINT)blockSz + << " " << (UINT)w; + for (ULONG p = 0; p < blockSz; p++) + { + tmp2 << " " << (UINT)pPRL[offset + p]; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 19 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + pivLocal.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, pivLocal ); + + // Send the QMI request, check result, and return + err = SendAndCheckReturn( eQMI_SVC_DMS, pRequest, to ); + if (err != eGOBI_ERR_NONE) + { + break; + } + else + { + offset += blockSz; + } + } + + if (err != eGOBI_ERR_NONE) + { + return err; + } + } + else + { + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + eGobiError rc = SendAndCheckReturn( eQMI_SVC_DMS, pRequest, 300000 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + } + + // Ask device to power down + eGobiError rc = SetPower( 5 ); + if (rc != eGOBI_ERR_NONE) + { + return eGOBI_ERR_RESET; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ResetToFactoryDefaults (Public Method) + +DESCRIPTION: + This function requests the device reset configuration to factory defaults, + after a successful request the device is then asked to reset + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ResetToFactoryDefaults( CHAR * pSPC ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_FACTORY_DEFAULTS; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)spc.c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request and check result + eGobiError rc = SendAndCheckReturn( eQMI_SVC_DMS, pRequest, 300000 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Ask device to power down + rc = SetPower( 5 ); + if (rc != eGOBI_ERR_NONE) + { + return eGOBI_ERR_RESET; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetActivationState (Public Method) + +DESCRIPTION: + This function returns the device activation state + +PARAMETERS: + pActivationState [ O ] - Service activation state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetActivationState( ULONG * pActivationState ) +{ + // Validate arguments + if (pActivationState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_ACTIVATED_STATE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pActivationState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetPower (Public Method) + +DESCRIPTION: + This function sets the operating mode of the device + +PARAMETERS: + powerMode [ I ] - Selected operating mode + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetPower( ULONG powerMode ) +{ + WORD msgID = (WORD)eQMI_DMS_SET_OPERATING_MODE; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)powerMode; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetPower (Public Method) + +DESCRIPTION: + This function returns the operating mode of the device + +PARAMETERS: + pPowerMode [ O ] - Current operating mode + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPower( ULONG * pPowerMode ) +{ + // Validate arguments + if (pPowerMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pPowerMode = ULONG_MAX; + + ULONG reasonMask = 0; + ULONG bPlatform = 0; + eGobiError rc = GetPowerInfo( pPowerMode, &reasonMask, &bPlatform ); + return rc; +} + +/*=========================================================================== +METHOD: + GetPowerInfo (Public Method) + +DESCRIPTION: + This function returns operating mode info from the device + +PARAMETERS: + pPowerMode [ O ] - Current operating mode + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPowerInfo( + ULONG * pPowerMode, + ULONG * pReasonMask, + ULONG * pbPlatform ) +{ + // Validate arguments + if (pPowerMode == 0 || pReasonMask == 0 || pbPlatform == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pPowerMode = ULONG_MAX; + *pReasonMask = 0; + *pbPlatform = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_OPERTAING_MODE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pPowerMode = pf[0].mValue.mU32; + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + + // Convert back to a bitmask + ULONG fieldCount = (ULONG)pf.size(); + if (fieldCount > 16) + { + fieldCount = 16; + } + + for (ULONG f = 0; f < fieldCount; f++) + { + ULONG val = (ULONG)pf[f].mValue.mU8 & 0x00000001; + *pReasonMask |= (val << f); + } + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pbPlatform = (ULONG)pf[0].mValue.mU8; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetOfflineReason + +DESCRIPTION: + This function returns the reason why the operating mode of the device + is currently offline + +PARAMETERS: + pReasonMask [ O ] - Bitmask of offline reasons + pbPlatform [ O ] - Offline due to being platform retricted? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetOfflineReason( + ULONG * pReasonMask, + ULONG * pbPlatform ) +{ + // Validate arguments + if (pReasonMask == 0 || pbPlatform == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pReasonMask = 0; + *pbPlatform = 0; + + ULONG powerMode = 0; + eGobiError rc = GetPowerInfo( &powerMode, pReasonMask, pbPlatform ); + + return rc; +} + +/*=========================================================================== +METHOD: + GetNetworkTime (Public Method) + +DESCRIPTION: + This function returns the current time of the device + +PARAMETERS: + pTimeStamp [ O ] - Count of 1.25ms that have elapsed from the start + of GPS time (Jan 6, 1980) + pTimeSource [ O ] - Source of the timestamp + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetNetworkTime( + ULONGLONG * pTimeCount, + ULONG * pTimeSource ) +{ + // Validate arguments + if (pTimeCount == 0 || pTimeSource == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_TIME; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pTimeCount = pf[0].mValue.mU64; + *pTimeSource = pf[1].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ValidateSPC (Public Method) + +DESCRIPTION: + This function validates the service programming code + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ValidateSPC( CHAR * pSPC ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_VALIDATE_SPC; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)spc.c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request and check result + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreImg.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreImg.cpp new file mode 100755 index 0000000..5f1d9c7 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreImg.cpp @@ -0,0 +1,656 @@ +/*=========================================================================== +FILE: + GobiQMICoreImg.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (Image Management) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetImagesPreference (Public Method) + +DESCRIPTION: + This function gets the current images preference + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + // Validate arguments + if ( (pImageListSize == 0) + || (*pImageListSize == 0) + || (pImageList == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSz = *pImageListSize; + *pImageListSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_FIRMWARE_PREF; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Try to find TLV ID 1 + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 1 ); + if (pIter == tlvs.end()) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Enough space to copy result? + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG needSz = (ULONG)pHdr->mLength; + if (needSz == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pImageListSize = needSz; + if (needSz > maxSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHdr++; + const BYTE * pData = (const BYTE *)pHdr; + + memcpy( (LPVOID)pImageList, + (LPCVOID)pData, + (SIZE_T)needSz ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetImagesPreference (Public Method) + +DESCRIPTION: + This function sets the current images preference + +PARAMETERS: + imageListSize [ I ] - The size in BYTEs of the image list array + pImageList [ I ] - The image list array + bForceDownload [ I ] - Force device to download images from host? + modemIndex [ I ] - Desired storage index for downloaded modem image + pImageTypesSize [I/O] - Upon input the maximum number of elements that + the download image types array can contain. + Upon successful output the actual number of + elements in the download image types array + pImageTypes [ O ] - The download image types array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetImagesPreference( + ULONG imageListSize, + BYTE * pImageList, + ULONG bForceDownload, + BYTE modemIndex, + ULONG * pImageTypesSize, + BYTE * pImageTypes ) +{ + // Validate arguments + if ( (imageListSize == 0) + || (pImageList == 0) + || (pImageTypesSize == 0) + || (*pImageTypesSize == 0) + || (pImageTypes == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSz = *pImageTypesSize; + *pImageTypesSize = 0; + + WORD msgID = (WORD)eQMI_DMS_SET_FIRMWARE_PREF; + std::vector piv; + + sProtocolEntityKey pek1( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi1( pek1, pImageList, imageListSize ); + piv.push_back( pi1 ); + + BYTE bOverride = 0; + if (bForceDownload != 0) + { + bOverride = 1; + sProtocolEntityKey pek2( eDB2_ET_QMI_DMS_REQ, msgID, 16 ); + sDB2PackingInput pi2( pek2, &bOverride, 1 ); + piv.push_back( pi2 ); + } + + if (modemIndex != UCHAR_MAX) + { + sProtocolEntityKey pek3( eDB2_ET_QMI_DMS_REQ, msgID, 17 ); + sDB2PackingInput pi3( pek3, &modemIndex, 1 ); + piv.push_back( pi3 ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Try to find TLV ID 1 + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 1 ); + if (pIter == tlvs.end()) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Enough space to copy result? + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG dataLen = (ULONG)pHdr->mLength; + if (dataLen == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + pHdr++; + const BYTE * pData = (const BYTE *)pHdr; + BYTE typeCount = *pData++; + if (typeCount != 0) + { + if (dataLen != (ULONG)typeCount + 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pImageTypesSize = typeCount; + if (typeCount > maxSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pImageTypes, + (LPCVOID)pData, + (SIZE_T)typeCount ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetBARMode (Public Method) + +DESCRIPTION: + This function returns the boot and recovery image download mode + +PARAMETERS: + pBARMode [ O ] - Boot and recovery image download mode + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetBARMode( ULONG * pBARMode ) +{ + // Validate arguments + if (pBARMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_IMG_DLOAD_MODE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the state + *pBARMode = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetBARMode (Public Method) + +DESCRIPTION: + This function requests the device enter boot and recovery image download + mode after the next reset + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetBARMode() +{ + WORD msgID = (WORD)eQMI_DMS_SET_IMG_DLOAD_MODE; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetStoredImages (Public Method) + +DESCRIPTION: + This function gets the list of images stored on the device + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetStoredImages( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + // Validate arguments + if ( (pImageListSize == 0) + || (*pImageListSize == 0) + || (pImageList == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSz = *pImageListSize; + + // Assume failure + *pImageListSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_LIST_FIRMWARE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Try to find TLV ID 1 + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 1 ); + if (pIter == tlvs.end()) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Enough space to copy result? + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG needSz = (ULONG)pHdr->mLength; + + *pImageListSize = needSz; + if (needSz > maxSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHdr++; + const BYTE * pData = (const BYTE *)pHdr; + + memcpy( (LPVOID)pImageList, + (LPCVOID)pData, + (SIZE_T)needSz ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetStoredImageInfo (Public Method) + +DESCRIPTION: + This function returns info about the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + pMajorVersion [ O ] - Major version of compatible boot downloader + pMinorVersion [ O ] - Minor version of compatible boot downloader + pVersionID [ O ] - Image version ID + pInfo [ O ] - Image info string + pLockID [ O ] - Image OEM lock ID + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetStoredImageInfo( + ULONG imageInfoSize, + BYTE * pImageInfo, + ULONG * pMajorVersion, + ULONG * pMinorVersion, + ULONG * pVersionID, + CHAR * pInfo, + ULONG * pLockID ) +{ + // Validate arguments + if ( (imageInfoSize == 0) + || (pImageInfo == 0) + || (pMajorVersion == 0) + || (pMinorVersion == 0) + || (pVersionID == 0) + || (pInfo == 0) + || (pLockID == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pMajorVersion = ULONG_MAX; + *pMinorVersion = ULONG_MAX; + *pVersionID = ULONG_MAX; + *pLockID = ULONG_MAX; + pInfo[0] = 0; + + + WORD msgID = (WORD)eQMI_DMS_GET_FIRMWARE_INFO; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, pImageInfo, imageInfoSize ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Keep track of the number of TLVs we actually processed + ULONG tlvCount = 0; + + // Parse the TLV we want (by DB key) + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + tlvCount++; + *pMajorVersion = (ULONG)pf[0].mValue.mU16; + *pMinorVersion = (ULONG)pf[1].mValue.mU16; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + tlvCount++; + *pVersionID = pf[0].mValue.mU32; + + LONG strLen = pf[1].mValueString.size(); + if (strLen > 0 && strLen <= 32) + { + memcpy( pInfo, pf[1].mValueString.c_str(), strLen ); + + if (strLen < 32) + { + pInfo[strLen] = 0; + } + } + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 18 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + tlvCount++; + *pLockID = pf[0].mValue.mU32; + } + + if (tlvCount == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + DeleteStoredImage (Public Method) + +DESCRIPTION: + This function deletes the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::DeleteStoredImage( + ULONG imageInfoSize, + BYTE * pImageInfo ) +{ + // Validate arguments + if (imageInfoSize == 0 || pImageInfo == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_DELETE_FIRMWARE; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, pImageInfo, imageInfoSize ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreImg2k.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreImg2k.cpp new file mode 100755 index 0000000..09ee728 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreImg2k.cpp @@ -0,0 +1,562 @@ +/*=========================================================================== +FILE: + GobiQMICoreImg2k.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (Image Management, G2k API) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiMBNMgmt.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetGenericImage (Free Method) + +DESCRIPTION: + Return a compatible AMSS generic image + +PARAMETERS: + uqcnInfo [ I ] - UQCN image needing a compatible AMSS generic image + +RETURN VALUE: + sImageInfo - Generic image information +===========================================================================*/ +sImageInfo GetGenericImage( const sImageInfo & uqcnInfo ) +{ + // Validate arguments + sImageInfo amssInfo; + + // Obtain the technology/carrier of the UQCN + ULONG uqcnTech; + ULONG uqcnCarrier; + ULONG dummy; + eGobiError rc = ::MapVersionInfo( uqcnInfo.mVersionID, + (BYTE)uqcnInfo.mImageType, + uqcnInfo.mVersion.c_str(), + &uqcnTech, + &uqcnCarrier, + &dummy, + &dummy ); + + if (rc != eGOBI_ERR_NONE) + { + return amssInfo; + } + + // Recursively enumerate all folders of the image store + std::vector folders; + std::string imageStore = ::GetImageStore(); + EnumerateFolders( imageStore, folders ); + + // Did we find any folders? + ULONG foldersSz = (ULONG)folders.size(); + if (foldersSz == 0) + { + return amssInfo; + } + + // Go through each folder searching for a compatible generic AMSS image + for (ULONG f = 0; f < foldersSz; f++) + { + // Search all MBN files in the specified folder + std::string folderSearch = folders[f]; + + int folderLen = folderSearch.size(); + if (folderSearch[folderLen - 1] != '/') + { + folderSearch += '/'; + } + + std::vector files; + DepthSearch( folderSearch, + 0, + ".mbn", + files ); + + int fileNum = files.size(); + for (int i = 0; i < fileNum; i++) + { + std::string mbnName = files[i]; + + BYTE imageType = UCHAR_MAX; + BYTE imageID[16] = { 0 }; + ULONG versionID = ULONG_MAX; + USHORT versionSz = MAX_PATH * 2 + 1; + CHAR versionStr[MAX_PATH * 2 + 1] = { 0 }; + rc = ::GetImageInfo( mbnName.c_str(), + &imageType, + &imageID[0], + &versionID, + versionSz, + &versionStr[0] ); + + if (rc == eGOBI_ERR_NONE) + { + if ((eGobiMBNType)imageType == eGOBI_MBN_TYPE_MODEM) + { + ULONG amssTech; + ULONG amssCarrier; + rc = ::MapVersionInfo( versionID, + imageType, + (LPCSTR)&versionStr[0], + &amssTech, + &amssCarrier, + &dummy, + &dummy ); + + if (rc == eGOBI_ERR_NONE) + { + if ( (amssTech == uqcnTech) + && (amssCarrier == (ULONG)eGOBI_IMG_CAR_GENERIC) ) + { + amssInfo.mImageType = (eGobiMBNType)imageType; + amssInfo.mVersionID = versionID; + amssInfo.mVersion = (LPCSTR)&versionStr[0]; + memcpy( (LPVOID)&amssInfo.mImageID[0], + (LPCVOID)&imageID[0], + MBN_UNIQUE_ID_LEN ); + break; + } + } + } + } + } + } + + // Success + return amssInfo; +} + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetFirmwareInfo (Public Method) + +DESCRIPTION: + Returns image information obtained from the current device firmware + +PARAMETERS: + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetFirmwareInfo( + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + // Validate arguments + if ( (pFirmwareID == 0) + || (pTechnology == 0) + || (pCarrier == 0) + || (pRegion == 0) + || (pGPSCapability == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Do we have a device node? + if (mDeviceNode.empty() == true) + { + return eGOBI_ERR_NO_CONNECTION; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_REV_ID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string uqcnIDString = pf[0].mValueString; + LONG strLen = uqcnIDString.size(); + if (strLen != 8) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string idString1 = uqcnIDString.substr( 0, 2 ); + std::string idString2 = uqcnIDString.substr( 2, 2 ); + std::string idString3 = uqcnIDString.substr( 4, 2 ); + std::string idString4 = uqcnIDString.substr( 6, 2 ); + + ULONG id1 = 0; + ULONG id2 = 0; + ULONG id3 = 0; + ULONG id4 = 0; + bool bID1 = StringToULONG( idString1.c_str(), 16, id1 ); + bool bID2 = StringToULONG( idString2.c_str(), 16, id2 ); + bool bID3 = StringToULONG( idString3.c_str(), 16, id3 ); + bool bID4 = StringToULONG( idString4.c_str(), 16, id4 ); + + if (bID1 == false || bID2 == false || bID3 == false || bID4 == false) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG uqcnID = (id1 << 24) | (id2 << 16) | (id3 << 8) | id4; + + // Parse the TLV we want (AMSS revision) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pFirmwareID = uqcnID; + eGobiError err = ::MapVersionInfo( uqcnID, + (BYTE)eGOBI_MBN_TYPE_PRI, + pf[0].mValueString.c_str(), + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); + + return err; +} + +/*=========================================================================== +METHOD: + UpgradeFirmware (Public Method) + +DESCRIPTION: + This function performs the following set of steps: + a) Verifies arguments + b) Updates firmware ID on device + c) Resets the device + + NOTE: Upon successful completion the above steps will have been completed, + however the actual upgrade of the firmware will necessarily then + follow. + +PARAMETERS: + pDestinationPath [ I ] - The fully qualified path to the destination folder + that the firmware download service will use + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UpgradeFirmware( CHAR * pDestinationPath ) +{ + // Validate arguments + if (pDestinationPath == 0 || pDestinationPath[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Do we have a device ID? + if (mDeviceNode.empty() == true) + { + return eGOBI_ERR_NO_CONNECTION; + } + + // Use that to validate the image store for this device + std::string tmpPath( pDestinationPath ); + int tmpPathlen = tmpPath.size(); + if (tmpPath[tmpPathlen - 1] != '/') + { + tmpPath += '/'; + } + + std::string imageStore = ::GetImageStore(); + if (tmpPath.find( imageStore ) == std::string::npos) + { + return eGOBI_ERR_INVALID_FILE; + } + + sImageInfo amssInfo; + sImageInfo uqcnInfo; + std::vector images; + images = ::GetImagesInfo( tmpPath ); + + ULONG imageCount = (ULONG)images.size(); + for (ULONG i = 0; i < imageCount; i++) + { + const sImageInfo & ii = images[i]; + if (ii.mImageType == eGOBI_MBN_TYPE_MODEM) + { + amssInfo = ii; + } + else if (ii.mImageType == eGOBI_MBN_TYPE_PRI) + { + uqcnInfo = ii; + } + } + + if (uqcnInfo.IsValid() == false) + { + return eGOBI_ERR_INVALID_FILE; + } + + if (amssInfo.IsValid() == false) + { + amssInfo = GetGenericImage( uqcnInfo ); + + // Still bad? + if (amssInfo.IsValid() == false) + { + return eGOBI_ERR_INVALID_FILE; + } + } + + WORD msgID = (WORD)eQMI_DMS_SET_FIRMWARE_PREF; + std::vector piv; + + std::ostringstream amssIDStr; + std::ostringstream uqcnIDStr; + for (ULONG v = 0; v < 16; v++) + { + amssIDStr << " " << (ULONG)amssInfo.mImageID[v]; + uqcnIDStr << " " << (ULONG)uqcnInfo.mImageID[v]; + } + + // "2 0%s %d \"%s\" 1%s %d \"%s\"" + std::ostringstream tmp; + tmp << "2 0" << amssIDStr.str() << " " << amssInfo.mVersion.size() + << " \"" << amssInfo.mVersion << "\" 1" << uqcnIDStr.str() + << " " << uqcnInfo.mVersion.size() << " \"" + << uqcnInfo.mVersion << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, tmp.str().c_str() ); + piv.push_back( pi ); + + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + eGobiError rc = SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Ask device to power down + rc = SetPower( 5 ); + if (rc != eGOBI_ERR_NONE) + { + return eGOBI_ERR_RESET; + } + + return rc; +} + +/*=========================================================================== +METHOD: + GetImageInfo (Public Method) + +DESCRIPTION: + Returns image information obtained from the firmware image located at the + provided path + +PARAMETERS: + pPath [ I ] - Location of the firmware image + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetImageInfo( + CHAR * pPath, + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + // Validate arguments + if ( (pPath == 0) + || (pPath[0] == 0) + || (pFirmwareID == 0) + || (pTechnology == 0) + || (pCarrier == 0) + || (pRegion == 0) + || (pGPSCapability == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Do we have a device ID? + if (mDeviceNode.empty() == true) + { + return eGOBI_ERR_NO_CONNECTION; + } + + // Use that to validate the image store for this device + std::string tmpPath( pPath ); + int tmpPathlen = tmpPath.size(); + if (tmpPath[tmpPathlen - 1] != '/') + { + tmpPath += '/'; + } + + std::string imageStore = ::GetImageStore(); + if (tmpPath.find( imageStore ) < 0) + { + return eGOBI_ERR_INVALID_FILE; + } + + std::vector images; + images = ::GetImagesInfo( tmpPath ); + + ULONG imageCount = (ULONG)images.size(); + for (ULONG i = 0; i < imageCount; i++) + { + const sImageInfo & ii = images[i]; + if (ii.mImageType == eGOBI_MBN_TYPE_PRI) + { + *pFirmwareID = ii.mVersionID; + return ::MapVersionInfo( ii.mVersionID, + (BYTE)ii.mImageType, + ii.mVersion.c_str(), + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); + } + } + + return eGOBI_ERR_INVALID_FILE; +} + +/*=========================================================================== +METHOD: + GetImageStore (Public Method) + +DESCRIPTION: + Returns the image store folder, i.e. the folder co-located with the + QDL Service executable which (by default) contains one or more carrier + specific image subfolders + +PARAMETERS: + pathSize [ I ] - Maximum number of characters (including NULL + terminator) that can be copied to the image + store path array + pImageStorePath [ O ] - The path to the image store + + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetImageStore( + WORD pathSize, + CHAR * pImageStorePath ) +{ + // Do we have a device ID? + if (mDeviceNode.size() == true) + { + return eGOBI_ERR_NO_CONNECTION; + } + + std::string imageStore = ::GetImageStore(); + + // Copy over image store + LONG strLen = imageStore.size(); + if (pathSize < (ULONG)strLen + 1) + { + pImageStorePath[0] = 0; + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pImageStorePath, + (LPCVOID)imageStore.c_str(), + (SIZE_T)strLen ); + + pImageStorePath[strLen] = 0; + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreNAS.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreNAS.cpp new file mode 100755 index 0000000..27c2278 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreNAS.cpp @@ -0,0 +1,1986 @@ +/*=========================================================================== +FILE: + GobiQMICoreNAS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (NAS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum length for a scanned network description +const ULONG MAX_SNI_DESCRIPTION_LEN = 255; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sEVDOCustomSCPConfig +// Struct to represent CDMA 1xEV-DO custom SCP config +/*=========================================================================*/ +struct sEVDOCustomSCPConfig +{ + public: + BYTE mbActive; + ULONG mProtocolMask; + ULONG mBroadcastMask; + ULONG mApplicationMask; +}; + +/*=========================================================================*/ +// Struct sScannedNetworkInfo +// Struct to represent scanned network information +/*=========================================================================*/ +struct sScannedNetworkInfo +{ + public: + USHORT mMCC; + USHORT mMNC; + ULONG mInUse; + ULONG mRoaming; + ULONG mForbidden; + ULONG mPreferred; + CHAR mDescription[MAX_SNI_DESCRIPTION_LEN]; +}; + +/*=========================================================================*/ +// Struct sScannedNetworkRATInfo +// Struct to represent scanned network RAT information +/*=========================================================================*/ +struct sScannedNetworkRATInfo +{ + public: + USHORT mMCC; + USHORT mMNC; + ULONG mRAT; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetANAAAAuthenticationStatus (Public Method) + +DESCRIPTION: + This function gets the AN-AAA authentication status + +PARAMETERS: + pStatus [ O ] - AN-AAA authentication status + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetANAAAAuthenticationStatus( ULONG * pStatus ) +{ + // Validate arguments + if (pStatus == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_AAA_AUTH_STATUS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the index + *pStatus = (ULONG)pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSignalStrengths (Public Method) + +DESCRIPTION: + This function gets the current available signal strengths (in dBm) + as measured by the device + +PARAMETERS: + pArraySizes [I/O] - Upon input the maximum number of elements + that each array can contain can contain. + Upon successful output the actual number + of elements in each array + pSignalStrengths [ O ] - Received signal strength array (dBm) + pRadioInterfaces [ O ] - Radio interface technology array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSignalStrengths( + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ) +{ + // Validate arguments + if ( (pArraySizes == 0) + || (*pArraySizes == 0) + || (pSignalStrengths == 0) + || (pRadioInterfaces == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSignals = (ULONG)*pArraySizes; + + // Assume failure + *pArraySizes = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_RSSI; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 2) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Remove any values outside the legal range + std::map sigMap; + + INT8 sigVal = pf[0].mValue.mS8; + ULONG radioVal = pf[1].mValue.mU32; + if (sigVal <= -30 && sigVal > -125 && radioVal != 0) + { + sigMap[radioVal] = sigVal; + } + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() > 2) + { + ULONG fi = 0; + ULONG auxSigs = (ULONG)pf[fi++].mValue.mU16; + if (pf.size() >= 1 + 2 * auxSigs) + { + for (ULONG s = 0; s < auxSigs; s++, fi += 2) + { + sigVal = pf[fi].mValue.mS8; + radioVal = pf[fi + 1].mValue.mU32; + if (sigVal <= -30 && sigVal > -125 && radioVal != 0) + { + sigMap[radioVal] = sigVal; + } + } + } + } + + ULONG sigCount = 0; + std::map ::const_iterator pIter; + for (pIter = sigMap.begin(); pIter != sigMap.end(); pIter++, sigCount++) + { + if (sigCount < maxSignals) + { + pSignalStrengths[sigCount] = pIter->second; + pRadioInterfaces[sigCount] = pIter->first; + *pArraySizes = sigCount + 1; + } + } + + // No valid signals? + if (sigCount == 0) + { + return eGOBI_ERR_NO_SIGNAL; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetRFInfo (Public Method) + +DESCRIPTION: + This function gets the current RF information + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + RF info instance array can contain. Upon success + the actual number of elements in the RF info + instance array + pInstances [ O ] - The RF info instance array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetRFInfo( + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + // Validate arguments + if (pInstanceSize == 0 || *pInstanceSize == 0 || pInstances == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxInstances = *pInstanceSize; + *pInstanceSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_RF_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + + ULONG fieldCount = (ULONG)pf.size(); + if (fieldCount < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + BYTE ifaceCount = pf[0].mValue.mU8; + if (fieldCount < 1 + ((ULONG)ifaceCount * 3)) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (ifaceCount > maxInstances) + { + ifaceCount = maxInstances; + } + + ULONG * pOutput = (ULONG *)pInstances; + for (BYTE i = 0; i < ifaceCount; i++) + { + ULONG offset = 3 * (ULONG)i; + + *pOutput++ = pf[offset + 1].mValue.mU32; + *pOutput++ = pf[offset + 2].mValue.mU32; + *pOutput++ = (ULONG)pf[offset + 3].mValue.mU16; + } + + *pInstanceSize = ifaceCount; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PerformNetworkScan (Public Method) + +DESCRIPTION: + This function performs a scan for available networks + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::PerformNetworkScan( + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + // Validate arguments + if ( (pInstanceSize == 0) + || (*pInstanceSize == 0) + || (pInstances == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxInstances = *pInstanceSize; + + // Assume failure + *pInstanceSize = 0; + + // This can take a really long time + ULONG to = MAX_REQ_TIMEOUT; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_SCAN_NETS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID, to ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + + ULONG maxIdx = (ULONG)pf.size(); + if (maxIdx-- < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG idx = 0; + BYTE netCount = pf[idx++].mValue.mU8; + if (netCount > maxInstances) + { + netCount = maxInstances; + } + + sScannedNetworkInfo * pNet = (sScannedNetworkInfo *)pInstances; + for (BYTE i = 0; i < netCount; i++) + { + // Validate field count + if (idx + 6 > maxIdx) + { + return eGOBI_ERR_INVALID_RSP; + } + + pNet->mMCC = pf[idx++].mValue.mU16; + pNet->mMNC = pf[idx++].mValue.mU16; + pNet->mInUse = pf[idx++].mValue.mU32; + pNet->mRoaming = pf[idx++].mValue.mU32; + pNet->mForbidden = pf[idx++].mValue.mU32; + pNet->mPreferred = pf[idx++].mValue.mU32; + + memset( &pNet->mDescription[0], 0, (SIZE_T)MAX_SNI_DESCRIPTION_LEN ); + + BYTE descLen = pf[idx++].mValue.mU8; + if (descLen > 0) + { + std::string netDesc( pf[idx++].mValueString ); + + ULONG actualLen = netDesc.size(); + if (actualLen >= MAX_SNI_DESCRIPTION_LEN) + { + actualLen = MAX_SNI_DESCRIPTION_LEN - 1; + } + + memcpy( (LPVOID)&pNet->mDescription[0], + (LPCSTR)netDesc.c_str(), + (SIZE_T)actualLen ); + } + + pNet++; + } + + *pInstanceSize = netCount; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PerformNetworkRATScan (Public Method) + +DESCRIPTION: + This function performs a scan for available networks (includes RAT) + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + pRATSize [I/O] - Upon input the maximum number of elements that the + RAT info instance array can contain. Upon success + the actual number of elements in the RAT info + instance array + pRATInstances [ O ] - The RAT info instance array + + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::PerformNetworkRATScan( + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ) +{ + // Validate arguments + if ( (pInstanceSize == 0) + || (*pInstanceSize == 0) + || (pInstances == 0) + || (pRATSize == 0) + || (*pRATSize == 0) + || (pRATInstances == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxInstances = *pInstanceSize; + BYTE maxRATInstances = *pRATSize; + + // Assume failure + *pInstanceSize = 0; + *pRATSize = 0; + + // This can take a really long time + ULONG to = MAX_REQ_TIMEOUT; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_SCAN_NETS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID, to ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + + ULONG maxIdx = (ULONG)pf.size(); + if (maxIdx-- < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG idx = 0; + BYTE netCount = pf[idx++].mValue.mU8; + if (netCount > maxInstances) + { + netCount = maxInstances; + } + + sScannedNetworkInfo * pNet = (sScannedNetworkInfo *)pInstances; + for (BYTE i = 0; i < netCount; i++) + { + // Validate field count + if (idx + 6 > maxIdx) + { + return eGOBI_ERR_INVALID_RSP; + } + + pNet->mMCC = pf[idx++].mValue.mU16; + pNet->mMNC = pf[idx++].mValue.mU16; + pNet->mInUse = pf[idx++].mValue.mU32; + pNet->mRoaming = pf[idx++].mValue.mU32; + pNet->mForbidden = pf[idx++].mValue.mU32; + pNet->mPreferred = pf[idx++].mValue.mU32; + + memset( &pNet->mDescription[0], 0, (SIZE_T)MAX_SNI_DESCRIPTION_LEN ); + + BYTE descLen = pf[idx++].mValue.mU8; + if (descLen > 0) + { + std::string netDesc( pf[idx++].mValueString ); + + ULONG actualLen = netDesc.size(); + if (actualLen >= MAX_SNI_DESCRIPTION_LEN) + { + actualLen = MAX_SNI_DESCRIPTION_LEN - 1; + } + + LPCSTR pNetDesc = netDesc.c_str(); + memcpy( (LPVOID)&pNet->mDescription[0], + (LPCVOID)pNetDesc, + (SIZE_T)actualLen ); + } + + pNet++; + } + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + + maxIdx = (ULONG)pf.size(); + if (maxIdx-- < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + idx = 0; + BYTE ratCount = pf[idx++].mValue.mU8; + if (ratCount > maxRATInstances) + { + ratCount = maxRATInstances; + } + + sScannedNetworkRATInfo * pRAT = (sScannedNetworkRATInfo *)pRATInstances; + for (BYTE r = 0; r < ratCount; r++) + { + // Validate field count + if (idx + 2 > maxIdx) + { + return eGOBI_ERR_INVALID_RSP; + } + + pRAT->mMCC = pf[idx++].mValue.mU16; + pRAT->mMNC = pf[idx++].mValue.mU16; + pRAT->mRAT = pf[idx++].mValue.mU32; + pRAT++; + } + + *pInstanceSize = netCount; + *pRATSize = ratCount; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + InitiateNetworkRegistration (Public Method) + +DESCRIPTION: + This function initiates a network registration + +PARAMETERS: + regType [ I ] - Registration type + mcc [ I ] - Mobile country code (ignored for auto registration) + mnc [ I ] - Mobile network code (ignored for auto registration) + rat [ I ] - Radio access type (ignored for auto registration) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::InitiateNetworkRegistration( + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ) +{ + WORD msgID = (WORD)eQMI_NAS_REGISTER_NET; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)regType; + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + if (regType == 2) + { + // We need to add the manual registration data + // "%hu %hu %u" + std::ostringstream tmp2; + tmp2 << (USHORT)mcc << " " << (USHORT)mnc << " " + << (UINT)rat; + + pek = sProtocolEntityKey( eDB2_ET_QMI_NAS_REQ, msgID, 16 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_NAS, pRequest, 30000 ); +} + +/*=========================================================================== +METHOD: + InitiateDomainAttach (Public Method) + +DESCRIPTION: + This function initiates a domain attach (or detach) + +PARAMETERS: + action [ I ] - PS attach action (attach or detach) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::InitiateDomainAttach( ULONG action ) +{ + WORD msgID = (WORD)eQMI_NAS_ATTACH_DETACH; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)action; + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_NAS, pRequest, 30000 ); +} + +/*=========================================================================== +METHOD: + GetServingNetwork (Public Method) + +DESCRIPTION: + Gets information regarding the system that currently provides service + to the device + +PARAMETERS: + pRegistrationState [ O ] - Registration state + pCSDomain [ O ] - Circuit switch domain status + pPSDomain [ O ] - Packet switch domain status + pRAN [ O ] - Radio access network + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. Upon + successful output the actual number of elements + in the radio interface array + pRadioIfaces [ O ] - The radio interface array + pRoaming [ O ] - Roaming indicator (0xFFFFFFFF - Unknown) + pMCC [ O ] - Mobile country code (0xFFFF - Unknown) + pMNC [ O ] - Mobile network code (0xFFFF - Unknown) + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the network name array + can contain + pName [ O ] - The network name or description represented + as a NULL terminated string (empty string + returned when unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetServingNetwork( + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ) +{ + // Validate arguments + if ( (pRegistrationState == 0) + || (pCSDomain == 0) + || (pPSDomain == 0) + || (pRAN == 0) + || (pRadioIfacesSize == 0) + || (*pRadioIfacesSize == 0) + || (pRadioIfaces == 0) + || (pRoaming == 0) + || (pMCC == 0) + || (pMNC == 0) + || (nameSize == 0) + || (pName == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxRadioIfaces = *pRadioIfacesSize; + + // Assume failure + *pRadioIfacesSize = 0; + *pRoaming = ULONG_MAX; + *pMCC = USHRT_MAX; + *pMNC = USHRT_MAX; + *pName = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_SS_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() < 5) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the variables + *pRegistrationState = pf1[0].mValue.mU32; + *pCSDomain = pf1[1].mValue.mU32; + *pPSDomain = pf1[2].mValue.mU32; + *pRAN = pf1[3].mValue.mU32; + + BYTE activeRadioIfaces = pf1[4].mValue.mU8; + if (pf1.size() < 5 + (ULONG)activeRadioIfaces) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (activeRadioIfaces > maxRadioIfaces) + { + activeRadioIfaces = maxRadioIfaces; + } + + ULONG * pOutRadioIfaces = (ULONG *)pRadioIfaces; + for (ULONG r = 0; r < activeRadioIfaces; r++) + { + *pOutRadioIfaces++ = pf1[5 + r].mValue.mU32; + } + + *pRadioIfacesSize = activeRadioIfaces; + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() >= 1) + { + *pRoaming = pf2[0].mValue.mU32; + } + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey3( eDB2_ET_QMI_NAS_RSP, msgID, 18 ); + cDataParser::tParsedFields pf3 = ParseTLV( db, rsp, tlvs, tlvKey3 ); + if (pf3.size() >= 3) + { + *pMCC = pf3[0].mValue.mU16; + *pMNC = pf3[1].mValue.mU16; + + // Network name? + if (pf3[2].mValue.mU8 > 0 && pf3.size() >= 4) + { + LONG strLen = pf3[3].mValueString.size(); + if (strLen > 0) + { + // Space to perform the copy? + if (nameSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pName, (LPCSTR)pf3[3].mValueString.c_str(), strLen ); + pName[strLen] = 0; + } + } + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetServingNetworkCapabilities (Public Method) + +DESCRIPTION: + Gets information regarding the data capabilities of the system that + currently provides service to the device + +PARAMETERS: + pDataCapsSize [I/O] - Upon input the maximum number of elements that the + data capabilities array can contain. Upon success + the actual number of elements in the data + capabilities array + pDataCaps [ O ] - The data capabilities array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetServingNetworkCapabilities( + BYTE * pDataCapsSize, + BYTE * pDataCaps ) +{ + // Validate arguments + if ( (pDataCapsSize == 0) + || (*pDataCapsSize == 0) + || (pDataCaps == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxDataCaps = *pDataCapsSize; + + // Assume failure + *pDataCapsSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_SS_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + BYTE activeDataCaps = pf[0].mValue.mU8; + if (pf.size() < 1 + (ULONG)activeDataCaps) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (activeDataCaps > maxDataCaps) + { + activeDataCaps = maxDataCaps; + } + + ULONG * pOutDataCaps = (ULONG *)pDataCaps; + for (ULONG d = 0; d < activeDataCaps; d++) + { + *pOutDataCaps++ = pf[1 + d].mValue.mU32; + } + + *pDataCapsSize = activeDataCaps; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetDataBearerTechnology (Public Method) + +DESCRIPTION: + This function retrieves the current data bearer technology (only + valid when connected) + +PARAMETERS: + pDataCaps [ O ] - The data bearer technology + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetDataBearerTechnology( ULONG * pDataBearer ) +{ + // Validate arguments + if (pDataBearer == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_DATA_BEARER; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the state + *pDataBearer = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetHomeNetwork (Public Method) + +DESCRIPTION: + This function retrieves information about the home network of the device + +PARAMETERS: + pMCC [ O ] - Mobile country code + pMNC [ O ] - Mobile network code + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the network name array + can contain + pName [ O ] - The network name or description represented + as a NULL terminated string (empty string + returned when unknown) + pSID [ O ] - Home network system ID (0xFFFF - Unknown) + pNID [ O ] - Home network ID (0xFFFF - Unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetHomeNetwork( + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ) +{ + // Validate arguments + if ( (pMCC == 0) + || (pMNC == 0) + || (nameSize == 0) + || (pName == 0) + || (pSID == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pName = 0; + *pSID = USHRT_MAX; + *pNID = USHRT_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_HOME_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the variables + *pMCC = pf1[0].mValue.mU16; + *pMNC = pf1[1].mValue.mU16; + + // Network name? + if (pf1[2].mValue.mU8 > 0 && pf1.size() >= 4) + { + LONG strLen = pf1[3].mValueString.size(); + if (strLen > 0) + { + // Space to perform the copy? + if (nameSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pName, (LPCSTR)pf1[3].mValueString.c_str(), strLen ); + pName[strLen] = 0; + } + } + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() >= 2) + { + *pSID = pf2[0].mValue.mU16; + *pNID = pf2[1].mValue.mU16; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetNetworkPreference (Public Method) + +DESCRIPTION: + This function sets the network registration preference + +PARAMETERS: + technologyPref [ I ] - Technology preference bitmap + duration [ I ] - Duration of active preference + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetNetworkPreference( + ULONG technologyPref, + ULONG duration ) +{ + // Buffer to hold technology preference TLV (ID = 1) + const ULONG TLV_HDR_SZ = (ULONG)sizeof( sQMIRawContentHeader ); + BYTE req[3 + TLV_HDR_SZ]; + + // Fill out TLV header + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)&req[0]; + pTLV->mLength = 3; + pTLV->mTypeID = 1; + + // Copy packed technology preference WORD as-is + WORD * pTmp = (WORD *)&req[TLV_HDR_SZ]; + *pTmp = (WORD)technologyPref; + + // Fill out duration + req[TLV_HDR_SZ + 2] = (BYTE)duration; + + // Pack TLV into a QMI NAS request + sSharedBuffer * pRequest = 0; + pRequest = sQMIServiceBuffer::BuildBuffer( eQMI_SVC_NAS, + eQMI_NAS_SET_TECH_PREF, + false, + false, + &req[0], + 3 + TLV_HDR_SZ ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_NAS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetNetworkPreference (Public Method) + +DESCRIPTION: + This function returns the network registration preference + +PARAMETERS: + pTechnologyPref [ O ] - Technology preference bitmap + pDuration [ O ] - Duration of active preference + pPersistentTechnologyPref [ O ] - Persistent technology preference bitmap + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetNetworkPreference( + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ) +{ + // Validate arguments + if ( (pTechnologyPref == 0) + || (pDuration == 0) + || (pPersistentTechnologyPref == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_TECH_PREF; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + sDB2NavInput ni1 = FindTLV( tlvs, tlvKey1 ); + if (ni1.mPayloadLen < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + const BYTE * pData = ni1.mpPayload; + const WORD * pTmp = (const WORD *)pData; + pData += 2; + + // Populate the variables + *pTechnologyPref = (ULONG)*pTmp; + *pDuration = (ULONG)*pData; + + // Until we know any better the persistent setting is the current setting + *pPersistentTechnologyPref = *pTechnologyPref; + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + sDB2NavInput ni2 = FindTLV( tlvs, tlvKey2 ); + if (ni2.mPayloadLen >= 2) + { + pTmp = (const WORD *)ni2.mpPayload; + *pPersistentTechnologyPref = (ULONG)*pTmp; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetCDMANetworkParameters (Public Method) + +DESCRIPTION: + This function sets the desired CDMA network parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pForceRev0 [ I ] - (Optional) Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ I ] - (Optional) Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ I ] - (Optional) Protocol mask for custom SCP config + pBroadcast [ I ] - (Optional) Broadcast mask for custom SCP config + pApplication [ I ] - (Optional) Application mask for custom SCP config + pRoaming [ I ] - (Optional) Roaming preference + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetCDMANetworkParameters( + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + // If you specify one of the custom SCP config fields then you must + // specify them all + ULONG scpCount = 0; + if (pCustomSCP != 0) + { + scpCount++; + } + + if (pProtocol != 0) + { + scpCount++; + } + + if (pBroadcast != 0) + { + scpCount++; + } + + if (pApplication != 0) + { + scpCount++; + } + + if (scpCount != 0 && scpCount != 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Rev. 0 and SCP custom config are mutually exclusive + if (pForceRev0 != 0 && scpCount == 4) + { + if (*pForceRev0 != 0 && *pCustomSCP != 0) + { + return eGOBI_ERR_INVALID_ARG; + } + } + + WORD msgID = (WORD)eQMI_NAS_SET_NET_PARAMS; + std::vector piv; + + // Need to start with SPC? + if (pForceRev0 != 0 || scpCount == 4) + { + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)spc.c_str() ); + piv.push_back( pi ); + } + + if (pForceRev0 != 0) + { + // "%u" + std::ostringstream tmp; + tmp << (UINT)(*pForceRev0 == 0 ? 0 : 1); + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 20 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (scpCount == 4) + { + // "%u %u %u %u %u %u %u %u %u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)(*pCustomSCP == 0 ? 0 : 1) + << (UINT)(*pProtocol & 0x00000001 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000002 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000004 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000008 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000010 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000020 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000040 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000080 ? 1 : 0) + << (UINT)(*pBroadcast & 0x00000001 ? 1 : 0) + << (UINT)(*pApplication & 0x00000001 ? 1 : 0) + << (UINT)(*pApplication & 0x00000002 ? 1 : 0); + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 21 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pRoaming != 0) + { + // "%u" + std::ostringstream tmp; + tmp << (UINT)*pRoaming; + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 22 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // We require something to actually configure + if (piv.size() == 0) + { + // Much ado about nothing + return eGOBI_ERR_INVALID_ARG; + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_NAS, pRequest, 5000 ); +} + +/*=========================================================================== +METHOD: + GetCDMANetworkParameters (Public Method) + +DESCRIPTION: + This function gets the current CDMA network parameters + +PARAMETERS: + pSCI [ O ] - Slot cycle index + pSCM [ O ] - Station class mark + pRegHomeSID [ O ] - Register on home SID? + pRegForeignSID [ O ] - Register on foreign SID? + pRegForeignNID [ O ] - Register on foreign NID? + pForceRev0 [ O ] - Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ O ] - Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ O ] - Protocol mask for custom SCP config + pBroadcast [ O ] - Broadcast mask for custom SCP config + pApplication [ O ] - Application mask for custom SCP config + pRoaming [ O ] - Roaming preference + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetCDMANetworkParameters( + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + // Validate arguments + if ( (pSCI == 0) + || (pSCM == 0) + || (pRegHomeSID == 0) + || (pRegForeignSID == 0) + || (pRegForeignNID == 0) + || (pForceRev0 == 0) + || (pCustomSCP == 0) + || (pProtocol == 0) + || (pBroadcast == 0) + || (pApplication == 0) + || (pRoaming == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSCI = UCHAR_MAX; + *pSCM = UCHAR_MAX; + *pRegHomeSID = UCHAR_MAX; + *pRegForeignSID = UCHAR_MAX; + *pRegForeignNID = UCHAR_MAX; + *pForceRev0 = UCHAR_MAX; + *pCustomSCP = UCHAR_MAX; + *pProtocol = ULONG_MAX; + *pBroadcast = ULONG_MAX; + *pApplication = ULONG_MAX; + *pRoaming = UCHAR_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_NET_PARAMS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLVs we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pSCI = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 18 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pSCM = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 19 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 3) + { + *pRegHomeSID = pf[0].mValue.mU8; + *pRegForeignSID = pf[0].mValue.mU8; + *pRegForeignNID = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 20 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pForceRev0 = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_NAS_RSP, msgID, 21 ); + sDB2NavInput ni = FindTLV( tlvs, tlvKey ); + if (ni.mPayloadLen >= (ULONG)sizeof( sEVDOCustomSCPConfig )) + { + const sEVDOCustomSCPConfig * pData = 0; + pData = (const sEVDOCustomSCPConfig *)ni.mpPayload; + + *pCustomSCP = pData->mbActive; + *pProtocol = pData->mProtocolMask; + *pBroadcast = pData->mBroadcastMask; + *pApplication = pData->mApplicationMask; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 22 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pRoaming = pf[0].mValue.mU32; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetACCOLC (Public Method) + +DESCRIPTION: + This function returns the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pACCOLC [ O ] - The ACCOLC + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetACCOLC( BYTE * pACCOLC ) +{ + // Validate arguments + if (pACCOLC == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_ACCOLC; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the ACCOLC + *pACCOLC = pf[0].mValue.mU8; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetACCOLC (Public Method) + +DESCRIPTION: + This function sets the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + accolc [ I ] - The ACCOLC + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetACCOLC( + CHAR * pSPC, + BYTE accolc ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_NAS_SET_ACCOLC; + std::vector piv; + + // "%s %u" + std::ostringstream tmp; + tmp << spc << " " << (UINT)accolc; + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_NAS, pRequest, 5000 ); +} + +/*=========================================================================== +METHOD: + GetPLMNMode (Public Method) + +DESCRIPTION: + This function returns the PLMN mode from the CSP + +PARAMETERS: + pMode [ O ] - PLMN mode + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPLMNMode( ULONG * pMode ) +{ + // Validate arguments + if (pMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_PLMN_MODE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the PLMN mode + *pMode = (ULONG)pf[0].mValue.mU8; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetPLMNName (Public Method) + +DESCRIPTION: + This function returns PLMN name information for the given MCC/MNC + +PARAMETERS: + mcc [ I ] - Mobile country code + mnc [ I ] - Mobile network code + pNamesSize [I/O] - Upon input the size in BYTEs of the name structure + array. Upon success the actual number of BYTEs + copied to the name structure array + pNames [ O ] - The name structure array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPLMNName( + USHORT mcc, + USHORT mnc, + ULONG * pNamesSize, + BYTE * pNames ) +{ + // Validate arguments + if ( (pNamesSize == 0) + || (*pNamesSize == 0) + || (pNames == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSz = *pNamesSize; + *pNamesSize = 0; + + + WORD msgID = (WORD)eQMI_NAS_GET_PLMN_NAME; + std::vector piv; + + // "%hu %hu" + std::ostringstream tmp; + tmp << mcc << " " << mnc; + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + + sProtocolBuffer rsp = Send( eQMI_SVC_NAS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Try to find TLV ID 16 + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 16 ); + if (pIter == tlvs.end()) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Enough space to copy result? + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG needSz = (ULONG)pHdr->mLength; + if (needSz == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pNamesSize = needSz; + if (needSz > maxSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHdr++; + const BYTE * pData = (const BYTE *)pHdr; + + memcpy( (LPVOID)pNames, + (LPCVOID)pData, + (SIZE_T)needSz ); + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreOMA.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreOMA.cpp new file mode 100755 index 0000000..713a7ab --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreOMA.cpp @@ -0,0 +1,535 @@ +/*=========================================================================== +FILE: + GobiQMICoreOMA.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (OMA-DM Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + OMADMStartSession (Public Method) + +DESCRIPTION: + This function starts an OMA-DM session + +PARAMETERS: + sessionType [ I ] - Type of session to initiate + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMStartSession( ULONG sessionType ) +{ + WORD msgID = (WORD)eQMI_OMA_START_SESSION; + std::vector piv; + + std::ostringstream tmp; + tmp << sessionType; + + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_OMA, pRequest ); +} + +/*=========================================================================== +METHOD: + OMADMCancelSession (Public Method) + +DESCRIPTION: + This function cancels an ongoing OMA-DM session + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMCancelSession() +{ + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_OMA_CANCEL_SESSION; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_OMA, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + OMADMGetSessionInfo (Public Method) + +DESCRIPTION: + This function returns information related to the current (or previous + if no session is active) OMA-DM session + +PARAMETERS: + pSessionState [ O ] - State of session + pSessionType [ O ] - Type of session + pFailureReason [ O ] - Session failure reason (when state indicates failure) + pRetryCount [ O ] - Session retry count (when state indicates retrying) + pSessionPause [ O ] - Session pause timer (when state indicates retrying) + pTimeRemaining [ O ] - Pause time remaining (when state indicates retrying) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMGetSessionInfo( + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ) +{ + // Validate arguments + if ( (pSessionState == 0) + || (pSessionType == 0) + || (pFailureReason == 0) + || (pRetryCount == 0) + || (pSessionPause == 0) + || (pTimeRemaining == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSessionState = ULONG_MAX; + *pSessionType = ULONG_MAX; + *pFailureReason = ULONG_MAX; + *pRetryCount = UCHAR_MAX; + *pSessionPause = USHRT_MAX; + *pTimeRemaining = USHRT_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_OMA_GET_SESSION_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_OMA, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // How many parameters did we populate? + ULONG params = 0; + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLVs we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_OMA_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pSessionState = pf[0].mValue.mU32; + *pSessionType = pf[1].mValue.mU32; + params += 2; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_OMA_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pFailureReason = pf[0].mValue.mU32; + params++; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_OMA_RSP, msgID, 18 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 3) + { + *pRetryCount = pf[0].mValue.mU8; + *pSessionPause = pf[1].mValue.mU16; + *pTimeRemaining = pf[2].mValue.mU16; + params += 3; + } + + if (params == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + OMADMGetPendingNIA (Public Method) + +DESCRIPTION: + This function returns information about the pending network initiated + alert + +PARAMETERS: + pSessionType [ O ] - Type of session + pSessionID [ O ] - Unique session ID + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMGetPendingNIA( + ULONG * pSessionType, + USHORT * pSessionID ) +{ + // Validate arguments + if (pSessionType == 0 || pSessionID == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSessionType = ULONG_MAX; + *pSessionID = USHRT_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_OMA_GET_SESSION_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_OMA, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // How many parameters did we populate? + ULONG params = 0; + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLVs we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_OMA_RSP, msgID, 19 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pSessionType = pf[0].mValue.mU32; + *pSessionID = pf[1].mValue.mU16; + params += 2; + } + + if (params == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + OMADMSendSelection (Public Method) + +DESCRIPTION: + This function sends the specified OMA-DM selection for the current + network initiated session + +PARAMETERS: + selection [ I ] - Selection + sessionID [ I ] - Unique session ID + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMSendSelection( + ULONG selection, + USHORT sessionID ) +{ + WORD msgID = (WORD)eQMI_OMA_SEND_SELECTION; + std::vector piv; + + std::ostringstream tmp; + tmp << selection << " " << sessionID; + + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_OMA, pRequest ); +} + +/*=========================================================================== +METHOD: + OMADMGetFeatureSettings (Public Method) + +DESCRIPTION: + This function returns the OMA-DM feature settings + +PARAMETERS: + pbProvisioning [ O ] - Device provisioning service update enabled + pbPRLUpdate [ O ] - PRL service update enabled + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMGetFeatureSettings( + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ) +{ + // Validate arguments + if (pbProvisioning == 0 || pbPRLUpdate == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pbProvisioning = ULONG_MAX; + *pbPRLUpdate = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_OMA_GET_FEATURES; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_OMA, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // How many parameters did we populate? + ULONG params = 0; + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLVs we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_OMA_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pbProvisioning = pf[0].mValue.mU32; + params++; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_OMA_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pbPRLUpdate = pf[0].mValue.mU32; + params++; + } + + if (params == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + OMADMSetProvisioningFeature (Public Method) + +DESCRIPTION: + This function sets the OMA-DM device provisioning service + update feature setting + +PARAMETERS: + bProvisioning [ I ] - Device provisioning service update enabled + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMSetProvisioningFeature( + ULONG bProvisioning ) +{ + WORD msgID = (WORD)eQMI_OMA_SET_FEATURES; + std::vector piv; + + std::ostringstream tmp; + tmp << (ULONG)(bProvisioning != 0); + + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_OMA, pRequest ); +} + +/*=========================================================================== +METHOD: + OMADMSetPRLUpdateFeature (Public Method) + +DESCRIPTION: + This function sets the OMA-DM PRL service update feature setting + +PARAMETERS: + bPRLUpdate [ I ] - PRL service update enabled + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMSetPRLUpdateFeature( + ULONG bPRLUpdate ) +{ + WORD msgID = (WORD)eQMI_OMA_SET_FEATURES; + std::vector piv; + + std::ostringstream tmp; + tmp << (ULONG)(bPRLUpdate != 0); + + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_OMA, pRequest ); +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICorePDS.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICorePDS.cpp new file mode 100755 index 0000000..b3cc60d --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICorePDS.cpp @@ -0,0 +1,1292 @@ +/*=========================================================================== +FILE: + GobiQMICorePDS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (PDS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetPDSState (Public Method) + +DESCRIPTION: + This function returns the current PDS state + +PARAMETERS: + pEnabled [ O ] - Current PDS state (0 = disabled) + pTracking [ O ] - Current PDS tracking session state + + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPDSState( + ULONG * pEnabled, + ULONG * pTracking ) +{ + // Validate arguments + if (pEnabled == 0 || pTracking == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pEnabled = ULONG_MAX; + *pTracking = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_STATE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 2) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pEnabled = pf[0].mValue.mU32; + *pTracking = pf[1].mValue.mU32; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetPDSState (Public Method) + +DESCRIPTION: + This function sets the PDS state + +PARAMETERS: + enable [ I ] - Desired PDS state (0 = disable) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetPDSState( ULONG enable ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_STATE; + std::vector piv; + + LPCSTR pVal = enable != 0 ? "1" : "0"; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, pVal ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest, 5000 ); +} + +/*=========================================================================== +METHOD: + PDSInjectTimeReference (Public Method) + +DESCRIPTION: + This function injects a system time into the PDS engine + +PARAMETERS: + sysTime [ I ] - System time + sysDiscontinuities [ I ] - Number of system time discontinuities + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::PDSInjectTimeReference( + ULONGLONG systemTime, + USHORT systemDiscontinuities ) +{ + WORD msgID = (WORD)eQMI_PDS_INJECT_TIME; + std::vector piv; + + std::ostringstream tmp; + tmp << systemTime << " " << systemDiscontinuities; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetPDSDefaults (Public Method) + +DESCRIPTION: + This function returns the default tracking session configuration + +PARAMETERS: + pOperation [ O ] - Current session operating mode + pTimeout [ O ] - Maximum amount of time (seconds) to work on each fix + pInterval [ O ] - Interval (milliseconds) between fix requests + pAccuracy [ O ] - Current accuracy threshold (meters) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPDSDefaults( + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ) +{ + // Validate arguments + if (pOperation == 0 || pTimeout == 0 || pInterval == 0 || pAccuracy == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pOperation = ULONG_MAX; + *pTimeout = UCHAR_MAX; + *pInterval = ULONG_MAX; + *pAccuracy = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_DEFAULTS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 4) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Original QMI doc claimed milliseconds, turned out to be seconds + ULONG apiInterval = pf[2].mValue.mU32 * 1000; + + *pOperation = pf[0].mValue.mU32; + *pTimeout = pf[1].mValue.mU8; + *pInterval = apiInterval; + *pAccuracy = pf[3].mValue.mU32; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetPDSDefaults (Public Method) + +DESCRIPTION: + This function sets the default tracking session configuration + +PARAMETERS: + operation [ I ] - Desired session operating mode + timeout [ I ] - Maximum amount of time (seconds) to work on each fix + interval [ I ] - Interval (milliseconds) between fix requests + accuracy [ I ] - Desired accuracy threshold (meters) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetPDSDefaults( + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_DEFAULTS; + std::vector piv; + + // Original QMI doc claimed milliseconds, turned out to be seconds + ULONG qmiInterval = interval / 1000; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)operation << " " << (UINT)timeout << " " << (UINT)qmiInterval + << " " << (UINT)accuracy; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetXTRAAutomaticDownload (Public Method) + +DESCRIPTION: + This function returns the XTRA automatic download configuration + +PARAMETERS: + pbEnabled [ O ] - Automatic download enabled? + pInterval [ O ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetXTRAAutomaticDownload( + ULONG * pbEnabled, + USHORT * pInterval ) +{ + // Validate arguments + if (pbEnabled == 0 || pInterval == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pbEnabled = ULONG_MAX; + *pInterval = USHRT_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_XTRA_PARAMS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 2) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pbEnabled = pf[0].mValue.mU32; + *pInterval = pf[1].mValue.mU16; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetXTRAAutomaticDownload (Public Method) + +DESCRIPTION: + This function sets the XTRA automatic download configuration + +PARAMETERS: + bEnabled [ I ] - Automatic download enabled? + interval [ I ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetXTRAAutomaticDownload( + ULONG bEnabled, + USHORT interval ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_XTRA_PARAMS; + std::vector piv; + + // "%u %hu" + std::ostringstream tmp; + tmp << (UINT)bEnabled << " " << (USHORT)interval; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetXTRANetwork (Public Method) + +DESCRIPTION: + This function returns the XTRA WWAN network preference + +PARAMETERS: + pPreference [ O ] - XTRA WWAN network preference + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetXTRANetwork( ULONG * pPreference ) +{ + // Validate arguments + if (pPreference == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pPreference = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_XTRA_PARAMS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 18 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pPreference = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetXTRANetwork (Public Method) + +DESCRIPTION: + This function sets the XTRA WWAN network preference + +PARAMETERS: + preference [ I ] - XTRA WWAN network preference + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetXTRANetwork( ULONG preference ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_XTRA_PARAMS; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)preference; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 18 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetXTRAValidity (Public Method) + +DESCRIPTION: + This function returns the XTRA database validity period + +PARAMETERS: + pGPSWeek [ O ] - Starting GPS week of validity period + pGPSWeekOffset [ O ] - Starting GPS week offset (minutes) of validity period + pDuration [ O ] - Length of validity period (hours) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetXTRAValidity( + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ) +{ + // Validate arguments + if (pGPSWeek == 0 || pGPSWeekOffset == 0 || pDuration == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pGPSWeek = USHRT_MAX; + *pGPSWeekOffset = USHRT_MAX; + *pDuration = USHRT_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_XTRA_PARAMS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 19 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pGPSWeek = pf[0].mValue.mU16; + *pGPSWeekOffset = pf[1].mValue.mU16; + *pDuration = pf[2].mValue.mU16; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ForceXTRADownload (Public Method) + +DESCRIPTION: + This function forces the XTRA database to be downloaded to the device + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ForceXTRADownload() +{ + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_FORCE_XTRA_DL; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetXTRADataState (Public Method) + +DESCRIPTION: + This function returns the XTRA data positioning state + +PARAMETERS: + pState [ O ] - XTRA data positioning state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetXTRADataState( ULONG * pState ) +{ + // Validate arguments + if (pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pState = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_METHODS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetXTRADataState (Public Method) + +DESCRIPTION: + This function sets the XTRA data positioning state + +PARAMETERS: + state [ I ] - XTRA data positioning state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetXTRADataState( ULONG state ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_METHODS; + std::vector piv; + + std::ostringstream tmp; + tmp << state; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetXTRATimeState (Public Method) + +DESCRIPTION: + This function returns the XTRA time positioning state + +PARAMETERS: + pState [ O ] - XTRA time positioning state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetXTRATimeState( ULONG * pState ) +{ + // Validate arguments + if (pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pState = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_METHODS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetXTRATimeState (Public Method) + +DESCRIPTION: + This function sets the XTRA time positioning state + +PARAMETERS: + state [ I ] - XTRA time positioning state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetXTRATimeState( ULONG state ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_METHODS; + std::vector piv; + + std::ostringstream tmp; + tmp << state; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetAGPSConfig (Public Method) + +DESCRIPTION: + This function returns the PDS AGPS configuration + +PARAMETERS: + pServerAddress [ O ] - IPv4 address of AGPS server + pServerPort [ O ] - Port number of AGPS server + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetAGPSConfig( + ULONG * pServerAddress, + ULONG * pServerPort ) +{ + // Validate arguments + if (pServerAddress == 0 || pServerPort == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pServerAddress = ULONG_MAX; + *pServerPort = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_AGPS_CONFIG; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 5) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pServerAddress = (ip4 | ip3 | ip2 | ip1); + *pServerPort = pf[4].mValue.mU32; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetAGPSConfig (Public Method) + +DESCRIPTION: + This function sets the PDS AGPS configuration + +PARAMETERS: + serverAddress [ I ] - IPv4 address of AGPS server + serverPort [ I ] - Port number of AGPS server + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetAGPSConfig( + ULONG serverAddress, + ULONG serverPort ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_AGPS_CONFIG; + std::vector piv; + + ULONG ip4 = (serverAddress & 0x000000FF); + ULONG ip3 = (serverAddress & 0x0000FF00) >> 8; + ULONG ip2 = (serverAddress & 0x00FF0000) >> 16; + ULONG ip1 = (serverAddress & 0xFF000000) >> 24; + + + // "%u %u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1 << " " << (UINT)serverPort; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetServiceAutomaticTracking (Public Method) + +DESCRIPTION: + This function returns the automatic tracking state for the service + +PARAMETERS: + pbAuto [ O ] - Automatic tracking session started for service? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetServiceAutomaticTracking( ULONG * pbAuto ) +{ + // Validate arguments + if (pbAuto == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_SVC_AUTOTRACK; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pbAuto = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetServiceAutomaticTracking (Public Method) + +DESCRIPTION: + This function sets the automatic tracking state for the service + +PARAMETERS: + pbAuto [ I ] - Start automatic tracking session for service? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetServiceAutomaticTracking( ULONG bAuto ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_SVC_AUTOTRACK; + std::vector piv; + + std::ostringstream tmp; + tmp << (ULONG)(bAuto != 0); + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetPortAutomaticTracking (Public Method) + +DESCRIPTION: + This function returns the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ O ] - Automatic tracking enabled for NMEA COM port? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPortAutomaticTracking( ULONG * pbAuto ) +{ + // Validate arguments + if (pbAuto == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_COM_AUTOTRACK; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pbAuto = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetPortAutomaticTracking (Public Method) + +DESCRIPTION: + This function sets the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ I ] - Enable automatic tracking for NMEA COM port? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetPortAutomaticTracking( ULONG bAuto ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_COM_AUTOTRACK; + std::vector piv; + + std::ostringstream tmp; + tmp << (ULONG)(bAuto != 0); + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + ResetPDSData (Public Method) + +DESCRIPTION: + This function resets the specified PDS data + +PARAMETERS: + pGPSDataMask [ I ] - Bitmask of GPS data to clear (optional) + pCellDataMask [ I ] - Bitmask of cell data to clear (optional) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ResetPDSData( + ULONG * pGPSDataMask, + ULONG * pCellDataMask ) +{ + // Validate arguments (one must be present) + if (pGPSDataMask == 0 && pCellDataMask == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_PDS_RESET_DATA; + std::vector piv; + + if (pGPSDataMask != 0) + { + ULONG mask = *pGPSDataMask; + + // Note that we are being lazy here by specifying more arguments + // than the DB description defines; that will not cause a problem + // and we don't want to have to update this code should more bits + // be defined + std::ostringstream tmp; + for (ULONG b = 0; b < 32; b++) + { + ULONG bit = mask & 0x00000001; + mask = mask >> 1; + + tmp << bit << " "; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pCellDataMask != 0) + { + ULONG mask = *pCellDataMask; + + std::ostringstream tmp; + for (ULONG b = 0; b < 32; b++) + { + ULONG bit = mask & 0x00000001; + mask = mask >> 1; + + tmp << bit << " "; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreRMS.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreRMS.cpp new file mode 100755 index 0000000..b8c3037 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreRMS.cpp @@ -0,0 +1,187 @@ +/*=========================================================================== +FILE: + GobiQMICoreRMS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (RMS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetSMSWake + +DESCRIPTION: + This function queries the state of the SMS wake functionality + +PARAMETERS: + pbEnabled [ O ] - SMS wake functionality enabled? + pWakeMask [ O ] - SMS wake mask (only relevant when enabled) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSMSWake( + ULONG * pbEnabled, + ULONG * pWakeMask ) +{ + // Validate arguments + if (pbEnabled == 0 || pWakeMask == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pbEnabled = ULONG_MAX; + *pWakeMask = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_RMS_GET_SMS_WAKE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_RMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Try to find TLVs ID 16/17 + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 16 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + if (pHdr->mLength < (WORD)1) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + const BYTE * pData = (const BYTE *)++pHdr; + *pbEnabled = (ULONG)*pData; + } + + pIter = tlvs.find( 17 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + if (pHdr->mLength < (WORD)4) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + const ULONG * pData = (const ULONG *)++pHdr; + *pWakeMask = *pData; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetSMSWake + +DESCRIPTION: + This function enables/disables the SMS wake functionality + +PARAMETERS: + bEnable [ I ] - Enable SMS wake functionality? + wakeMask [ I ] - SMS wake mask (only relevant when enabling) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetSMSWake( + ULONG bEnable, + ULONG wakeMask ) +{ + WORD msgID = (WORD)eQMI_RMS_SET_SMS_WAKE; + std::vector piv; + + BYTE enableTmp = (BYTE)(bEnable == 0 ? 0 : 1 ); + sProtocolEntityKey pek1( eDB2_ET_QMI_RMS_REQ, msgID, 16 ); + sDB2PackingInput pi1( pek1, &enableTmp, 1 ); + piv.push_back( pi1 ); + + if (bEnable != 0) + { + sProtocolEntityKey pek2( eDB2_ET_QMI_RMS_REQ, msgID, 17 ); + sDB2PackingInput pi2( pek2, (const BYTE *)&wakeMask, 4 ); + piv.push_back( pi2 ); + } + + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_RMS, pRequest ); +} + diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreSMS.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreSMS.cpp new file mode 100755 index 0000000..789280d --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreSMS.cpp @@ -0,0 +1,940 @@ +/*=========================================================================== +FILE: + GobiQMICoreSMS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (SMS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + DeleteSMS (Public Method) + +DESCRIPTION: + This function deletes one or more SMS messages from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + pMessageIndex [ I ] - (Optional) message index + pMessageTag [ I ] - (Optional) message tag + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::DeleteSMS( + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ) +{ + WORD msgID = (WORD)eQMI_WMS_DELETE; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)storageType; + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + if (pMessageIndex != 0) + { + std::ostringstream tmp2; + tmp2 << (UINT)*pMessageIndex; + + sProtocolEntityKey pek1( eDB2_ET_QMI_WMS_REQ, msgID, 16 ); + sDB2PackingInput pi1( pek1, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi1 ); + } + + if (pMessageTag != 0) + { + std::ostringstream tmp2; + tmp2 << (UINT)*pMessageTag; + + sProtocolEntityKey pek1( eDB2_ET_QMI_WMS_REQ, msgID, 17 ); + sDB2PackingInput pi1( pek1, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi1 ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WMS, pRequest, 10000 ); +} + +/*=========================================================================== +METHOD: + GetSMSList (Public Method) + +DESCRIPTION: + This function returns the list of SMS messages stored on the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + pRequestedTag [ I ] - Message index + pMessageListSize [I/O] - Upon input the maximum number of elements that the + message list array can contain. Upon successful + output the actual number of elements in the message + list array + pMessageList [ O ] - The message list array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSMSList( + ULONG storageType, + ULONG * pRequestedTag, + ULONG * pMessageListSize, + BYTE * pMessageList ) +{ + // Validate arguments + if (pMessageListSize == 0 || *pMessageListSize == 0 || pMessageList == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxMessageListSz = *pMessageListSize; + + // Assume failure + *pMessageListSize = 0; + + WORD msgID = (WORD)eQMI_WMS_GET_MSG_LIST; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)storageType; + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + if (pRequestedTag != 0) + { + std::ostringstream tmp2; + tmp2 << (UINT)*pRequestedTag; + + sProtocolEntityKey pek1( eDB2_ET_QMI_WMS_REQ, msgID, 16 ); + sDB2PackingInput pi1( pek1, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi1 ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG messageListSz = pf[0].mValue.mU32; + if (messageListSz == 0) + { + // No stored messages, but not necessarily a failure + return eGOBI_ERR_NONE; + } + + if (pf.size() < (1 + (messageListSz * 2)) ) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (maxMessageListSz < messageListSz) + { + messageListSz = maxMessageListSz; + } + + ULONG m = 0; + ULONG mf = 1; + ULONG * pData = (ULONG *)pMessageList; + for (m = 0; m < messageListSz; m++) + { + *pData++ = pf[mf++].mValue.mU32; + *pData++ = pf[mf++].mValue.mU32; + } + + *pMessageListSize = messageListSz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSMS (Public Method) + +DESCRIPTION: + This function returns an SMS message from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + pMessageTag [ O ] - Message tag + pMessageFormat [ O ] - Message format + pMessageSize [I/O] - Upon input the maximum number of bytes that can be + written to the message array. Upon successful + output the actual number of bytes written to the + message array + pMessage [ I ] - The message contents array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSMS( + ULONG storageType, + ULONG messageIndex, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ) +{ + // Validate arguments + if ( (pMessageTag == 0) + || (pMessageFormat == 0) + || (pMessageSize == 0) + || (*pMessageSize == 0) + || (pMessage == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxMessageSz = *pMessageSize; + + // Assume failure + *pMessageSize = 0; + + WORD msgID = (WORD)eQMI_WMS_RAW_READ; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)storageType << " " << (UINT)messageIndex; + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pMessageTag = pf[0].mValue.mU32; + *pMessageFormat = pf[1].mValue.mU32; + + ULONG messageSz = (ULONG)pf[2].mValue.mU16; + if (messageSz == 0) + { + // There has to be message data + return eGOBI_ERR_INVALID_RSP; + } + + if (pf.size() < 3 + messageSz) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (maxMessageSz < messageSz) + { + // We have to be able to copy the whole message + return eGOBI_ERR_BUFFER_SZ; + } + + // Copy message data + for (ULONG b = 0; b < messageSz; b++) + { + pMessage[b] = pf[3 + b].mValue.mU8; + } + + *pMessageSize = messageSz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ModifySMSStatus (Public Method) + +DESCRIPTION: + This function modifies the status of an SMS message saved in storage on + the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + messageTag [ I ] - Message tag + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ModifySMSStatus( + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ) +{ + WORD msgID = (WORD)eQMI_WMS_MODIFY_TAG; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)storageType << " " << (UINT)messageIndex << " " + << (UINT)messageTag; + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WMS, pRequest, 5000 ); +} + +/*=========================================================================== +METHOD: + SaveSMS (Public Method) + +DESCRIPTION: + This function saves an SMS message to device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageIndex [ O ] - The message index assigned by the device + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SaveSMS( + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageIndex ) +{ + // Validate arguments + if (messageSize == 0 || pMessage == 0 || pMessageIndex == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WMS_RAW_WRITE; + std::vector piv; + + // "%u %u %u" + std::ostringstream tmp; + tmp << (UINT)storageType << " " << (UINT)messageFormat + << " " << (UINT)messageSize; + + for (ULONG b = 0; b < messageSize; b++) + { + tmp << " " << (UINT)pMessage[b]; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WMS, pRequest, 10000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pMessageIndex = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SendSMS (Public Method) + +DESCRIPTION: + This function sends an SMS message for immediate over the air transmission + +PARAMETERS: + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageFailureCode [ O ] - When the function fails due to an error sending + the message this parameter may contain the + message failure cause code (see 3GPP2 N.S0005 + Section 6.5.2.125). If the cause code is not + provided then the value will be 0xFFFFFFFF + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SendSMS( + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageFailureCode ) +{ + // Validate arguments + if (messageSize == 0 || pMessage == 0 || pMessageFailureCode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume we have no message failure cause code + *pMessageFailureCode = ULONG_MAX; + + WORD msgID = (WORD)eQMI_WMS_RAW_SEND; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)messageFormat << " " << (UINT)messageSize; + + for (ULONG b = 0; b < messageSize; b++) + { + tmp << " " << (UINT)pMessage[b]; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WMS, pRequest, 300000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pMessageFailureCode = (ULONG)pf[0].mValue.mU16; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSMSCAddress (Public Method) + +DESCRIPTION: + Return the SMS center address + +PARAMETERS: + addressSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address array + can contain + pSMSCAddress [ 0 ] - The SMS center address represented as a NULL + terminated string + typeSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address type array + can contain + pSMSCType [ 0 ] - The SMS center address type represented as a NULL + terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSMSCAddress( + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ) +{ + // Validate arguments + if (addressSize == 0 || pSMSCAddress == 0 || typeSize == 0 || pSMSCType == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + pSMSCAddress[0] = 0; + pSMSCType[0] = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WMS_GET_SMSC_ADDR; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + LONG strLen = pf[0].mValueString.size(); + if (strLen > 0) + { + // Space to perform the copy? + if (typeSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pSMSCType, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pSMSCType[strLen] = 0; + } + + strLen = pf[2].mValueString.size(); + if (strLen > 0) + { + // Space to perform the copy? + if (addressSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pSMSCAddress, (LPCSTR)pf[2].mValueString.c_str(), strLen ); + pSMSCAddress[strLen] = 0; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetSMSCAddress (Public Method) + +DESCRIPTION: + Set the SMS center address + +PARAMETERS: + pSMSCAddress [ I ] - The SMS center address represented as a NULL + terminated string (maximum of 21 characters, + including NULL) + pSMSCType [ I ] - The SMS center address type represented as a NULL + terminated string (optional) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetSMSCAddress( + CHAR * pSMSCAddress, + CHAR * pSMSCType ) +{ + // Validate arguments + if (pSMSCAddress == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WMS_SET_SMSC_ADDR; + std::vector piv; + + std::ostringstream addr; + if (pSMSCAddress[0] != 0) + { + addr << "\"" << pSMSCAddress << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)addr.str().c_str() ); + piv.push_back( pi ); + + if (pSMSCType != 0) + { + std::ostringstream addrType; + if (pSMSCType[0] != 0) + { + addrType << "\"" << pSMSCType << "\""; + } + + pek = sProtocolEntityKey( eDB2_ET_QMI_WMS_REQ, msgID, 16 ); + pi = sDB2PackingInput( pek, (LPCSTR)addrType.str().c_str() ); + piv.push_back( pi ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WMS, pRequest, 5000 ); +} + +/*=========================================================================== +METHOD: + GetSMSRoutes (Public Method) + +DESCRIPTION: + Get the current incoming SMS routing information + +PARAMETERS: + pRouteSize [I/O] - Upon input the maximum number of elements that the + SMS route array can contain. Upon succes the actual + number of elements in the SMS route array + pRoutes [ O ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + // Validate arguments + if (pRouteSize == 0 || *pRouteSize == 0 || pRoutes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxRoutes = *pRouteSize; + *pRouteSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WMS_GET_ROUTES; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WMS, msgID, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG fi = 0; + ULONG routeCount = (ULONG)pf[fi++].mValue.mU16; + if ((ULONG)pf.size() < 1 + 4 * routeCount) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (routeCount > (ULONG)maxRoutes) + { + routeCount = (ULONG)maxRoutes; + } + + ULONG * pRouteArray = (ULONG *)pRoutes; + for (ULONG r = 0; r < routeCount; r++) + { + // Message type + *pRouteArray++ = pf[fi++].mValue.mU32; + + // Message class + *pRouteArray++ = pf[fi++].mValue.mU32; + + // Storage type + *pRouteArray++ = pf[fi++].mValue.mU32; + + // Receipt action + *pRouteArray++ = pf[fi++].mValue.mU32; + } + + *pRouteSize = (BYTE)routeCount; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetSMSRoutes (Public Method) + +DESCRIPTION: + Set the desired incoming SMS routing information + +PARAMETERS: + pRouteSize [ I ] - The number of elements in the SMS route array + pRoutes [ I ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + // Validate arguments + if (pRouteSize == 0 || *pRouteSize == 0 || pRoutes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Format up the request + ULONG routeCount = (ULONG)*pRouteSize; + + // %u + std::ostringstream tmp; + tmp << routeCount; + + ULONG * pRouteArray = (ULONG *)pRoutes; + for (ULONG r = 0; r < routeCount; r++) + { + // Message type, class, storage type, receipt action + for (ULONG f = 0; f < 4; f++) + { + // tmp += " %u" + tmp << " " << *pRouteArray++; + } + } + + WORD msgID = (WORD)eQMI_WMS_SET_ROUTES; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WMS, pRequest, 5000 ); +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreUIM.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreUIM.cpp new file mode 100755 index 0000000..e293d22 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreUIM.cpp @@ -0,0 +1,965 @@ +/*=========================================================================== +FILE: + GobiQMICoreUIM.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (UIM Access) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + UIMSetPINProtection (Public Method) + +DESCRIPTION: + This function enables or disables protection of UIM contents by a + given PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + bEnable [ I ] - Enable/disable PIN protection (0 = disable)? + pValue [ I ] - PIN value of the PIN to be enabled/disabled + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMSetPINProtection( + ULONG id, + ULONG bEnable, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if ( (pValue == 0) + || (pValue[0] == 0) + || (pVerifyRetriesLeft == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_SET_PIN_PROT; + std::vector piv; + + std::string val( pValue ); + ULONG valSz = val.size(); + + if (bEnable != 0) + { + bEnable = 1; + } + + // "%u %u %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)bEnable << " " << (UINT)valSz + << " \"" << val << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pVerifyRetriesLeft = (ULONG)pf[0].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[1].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMVerifyPIN (Public Method) + +DESCRIPTION: + This function verifies the PIN before accessing the UIM contents + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pValue [ I ] - PIN value of the PIN to verify + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMVerifyPIN( + ULONG id, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if ( (pValue == 0) + || (pValue[0] == 0) + || (pVerifyRetriesLeft == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_PIN_VERIFY; + std::vector piv; + + std::string val( pValue ); + ULONG valSz = val.size(); + + // "%u %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)valSz << " \"" << val << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pVerifyRetriesLeft = (ULONG)pf[0].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[1].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMUnblockPIN (Public Method) + +DESCRIPTION: + This function unblocks a blocked PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pPUKValue [ I ] - PUK value of the PIN to unblock + pNewValue [ I ] - New PIN value of the PIN to unblock + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMUnblockPIN( + ULONG id, + CHAR * pPUKValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if ( (pPUKValue == 0) + || (pPUKValue[0] == 0) + || (pNewValue == 0) + || (pNewValue[0] == 0) + || (pVerifyRetriesLeft == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_PIN_UNBLOCK; + std::vector piv; + + std::string val1( pPUKValue ); + ULONG val1Sz = val1.size(); + + std::string val2( pNewValue ); + ULONG val2Sz = val2.size(); + + // "%u %u \"%s\" %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)val1Sz << " \"" << val1 << "\" " + << (UINT)val2Sz << " \"" << val2 << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pVerifyRetriesLeft = (ULONG)pf[0].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[1].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMChangePIN (Public Method) + +DESCRIPTION: + This function change the PIN value + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pOldValue [ I ] - Old PIN value of the PIN to change + pNewValue [ I ] - New PIN value of the PIN to change + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMChangePIN( + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if ( (pOldValue == 0) + || (pOldValue[0] == 0) + || (pNewValue == 0) + || (pNewValue[0] == 0) + || (pVerifyRetriesLeft == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_PIN_CHANGE; + std::vector piv; + + std::string val1( pOldValue ); + ULONG val1Sz = val1.size(); + + std::string val2( pNewValue ); + ULONG val2Sz = val2.size(); + + // "%u %u \"%s\" %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)val1Sz << " \"" << val1 << "\" " + << (UINT)val2Sz << " \"" << val2 << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pVerifyRetriesLeft = (ULONG)pf[0].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[1].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMGetPINStatus (Public Method) + +DESCRIPTION: + This function returns the status of the pin + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pStatus [ O ] - PIN status (0xFFFFFFFF = unknown) + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMGetPINStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pStatus == 0 || pVerifyRetriesLeft == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pStatus = ULONG_MAX; + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_UIM_GET_PIN_STATUS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + ULONG tlvID = 16 + id; + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, tlvID ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pStatus = pf[0].mValue.mU32; + *pVerifyRetriesLeft = (ULONG)pf[1].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[2].mValue.mU8; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMGetICCID (Public Method) + +DESCRIPTION: + This function returns the UIM ICCID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMGetICCID( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_UIM_GET_ICCID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (IMSI) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpICCID = pf[0].mValueString; + ULONG lenICCID = (ULONG)tmpICCID.size(); + + // Space to perform the copy? + if (stringSize < lenICCID + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)tmpICCID.c_str(), lenICCID + 1 ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMGetControlKeyBlockingStatus (Public Method) + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + pbBlocking [ O ] - (Optional) Is the facility blocking? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMGetControlKeyBlockingStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ) +{ + // Validate arguments + if ( (pStatus == 0) + || (pVerifyRetriesLeft == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pStatus = ULONG_MAX; + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + if (pbBlocking != 0) + { + *pbBlocking = 0; + } + + WORD msgID = (WORD)eQMI_DMS_UIM_GET_CK_STATUS; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)id; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the required TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pStatus = pf[0].mValue.mU32; + *pVerifyRetriesLeft = (ULONG)pf[1].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[2].mValue.mU8; + + if (pbBlocking != 0) + { + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() > 0) + { + *pbBlocking = 1; + } + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMSetControlKeyProtection (Public Method) + +DESCRIPTION: + This function changes the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + status [ I ] - Control key status + pValue [ I ] - Control key de-personalization string + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + control key will be blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMSetControlKeyProtection( + ULONG id, + ULONG status, + CHAR * pValue, + ULONG * pVerifyRetriesLeft ) +{ + // Validate arguments + if ( (pValue == 0) + || (pValue[0] == 0) + || (pVerifyRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pVerifyRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_SET_CK_PROT; + std::vector piv; + + std::string val( pValue ); + ULONG valSz = val.size(); + + //"%u %u %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)status << " " << (UINT)valSz + << " \"" << val << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pVerifyRetriesLeft = (ULONG)pf[0].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMUnblockControlKey (Public Method) + +DESCRIPTION: + This function unblocks the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pValue [ I ] - Control key de-personalization string + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMUnblockControlKey( + ULONG id, + CHAR * pValue, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if ( (pValue == 0) + || (pValue[0] == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pUnblockRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_UNBLOCK_CK; + std::vector piv; + + std::string val( pValue ); + ULONG valSz = val.size(); + + // "%u %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)valSz << " \"" << val << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pUnblockRetriesLeft = (ULONG)pf[0].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreWDS.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreWDS.cpp new file mode 100755 index 0000000..9a6677d --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMICoreWDS.cpp @@ -0,0 +1,2804 @@ +/*=========================================================================== +FILE: + GobiQMICoreWDS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (WDS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetSessionState (Public Method) + +DESCRIPTION: + This function returns the state of the current packet data session + +PARAMETERS: + pState [ O ] - State of the current packet session + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSessionState( ULONG * pState ) +{ + // Validate arguments + if (pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_PKT_STATUS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the state + *pState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSessionDuration (Public Method) + +DESCRIPTION: + This function returns the duration of the current packet data session + +PARAMETERS: + pDuration [ O ] - Duration of the current packet session + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSessionDuration( ULONGLONG * pDuration ) +{ + // Validate arguments + if (pDuration == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_DURATION; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the state + *pDuration = pf[0].mValue.mU64; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSessionDurations (Public Method) + +DESCRIPTION: + This function returns the the active/total durations of the current + packet data session + +PARAMETERS: + pActiveDuration [ O ] - Active duration of the current packet session + pTotalDuration [ O ] - Total duration of the current packet session + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSessionDurations( + ULONGLONG * pActiveDuration, + ULONGLONG * pTotalDuration ) +{ + // Validate arguments + if (pActiveDuration == 0 || pTotalDuration == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_DURATION; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the total duration + *pTotalDuration = pf[0].mValue.mU64; + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the active duration + *pActiveDuration = pf[0].mValue.mU64; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetDormancyState (Public Method) + +DESCRIPTION: + This function returns the dormancy state of the current packet + data session (when connected) + +PARAMETERS: + pState [ O ] - Dormancy state of the current packet session + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetDormancyState( ULONG * pState ) +{ + // Validate arguments + if (pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_DORMANCY; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the state + *pState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetEnhancedAutoconnect (Public Method) + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + pSetting [ O ] - NDIS autoconnect setting + pRoamSetting [ O ] - NDIS autoconnect roam setting + + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetEnhancedAutoconnect( + ULONG * pSetting, + ULONG * pRoamSetting ) +{ + // Validate arguments + if (pSetting == 0 || pRoamSetting == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSetting = ULONG_MAX; + *pRoamSetting = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_AUTOCONNECT; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pSetting = (ULONG)pf[0].mValue.mU32; + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() > 0) + { + *pRoamSetting = (ULONG)pf[0].mValue.mU32; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetEnhancedAutoconnect (Public Method) + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + setting [ I ] - NDIS autoconnect setting + pRoamSetting [ I ] - (Optional) NDIS autoconnect roam setting + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetEnhancedAutoconnect( + ULONG setting, + ULONG * pRoamSetting ) +{ + WORD msgID = (WORD)eQMI_WDS_SET_AUTOCONNECT; + std::vector piv; + + // "%u" + std::ostringstream tmp; + tmp << setting; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, tmp.str().c_str() ); + piv.push_back( pi ); + + if (pRoamSetting != 0) + { + std::ostringstream tmp2; + tmp2 << *pRoamSetting; + + sProtocolEntityKey pek1( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + sDB2PackingInput pi1( pek1, tmp2.str().c_str() ); + piv.push_back( pi1 ); + } + + ULONG to = 5000; + if (setting == 1) + { + // Connections can take a long time + to = 300000; + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest, to ); +} + +/*=========================================================================== +METHOD: + SetDefaultProfile (Public Method) + +DESCRIPTION: + This function writes the default profile settings to the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being written + pPDPType [ I ] - (Optional) PDP type + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pName [ I ] - (Optional) The profile name or description + pAPNName [ I ] - (Optional) Access point name + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ) +{ + WORD msgID = (WORD)eQMI_WDS_MODIFY_PROFILE; + std::vector piv; + + // "%u 1" + std::ostringstream tmp; + tmp << (UINT)profileType << " 1"; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + if (pName != 0) + { + std::ostringstream tmp2; + if (pName[0] != 0) + { + tmp2 << "\"" << pName << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pPDPType != 0) + { + // "%u" + std::ostringstream tmp2; + tmp2 << (UINT)*pPDPType; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pAPNName != 0) + { + std::ostringstream tmp2; + if (pAPNName[0] != 0) + { + tmp2 << "\"" << pAPNName << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 20 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pPrimaryDNS != 0) + { + ULONG ip4 = (*pPrimaryDNS & 0x000000FF); + ULONG ip3 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 21 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pSecondaryDNS != 0) + { + ULONG ip4 = (*pSecondaryDNS & 0x000000FF); + ULONG ip3 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 22 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pUsername != 0) + { + std::ostringstream tmp2; + if (pUsername[0] != 0) + { + tmp2 << "\"" << pUsername << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 27 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pPassword != 0) + { + std::ostringstream tmp2; + if (pPassword[0] != 0) + { + tmp2 << "\"" << pPassword << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 28 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pAuthentication != 0) + { + ULONG pap = *pAuthentication & 0x00000001; + ULONG chap = *pAuthentication & 0x00000002; + + // "%u %u" + std::ostringstream tmp2; + tmp2 << (UINT)pap << " " << (UINT)chap; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 29 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pIPAddress != 0) + { + ULONG ip4 = (*pIPAddress & 0x000000FF); + ULONG ip3 = (*pIPAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pIPAddress & 0x00FF0000) >> 16; + ULONG ip1 = (*pIPAddress & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 30 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // We need to be doing something here (beyond profile type) + if (piv.size() <= 1) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Pack up and send the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetDefaultProfile (Public Method) + +DESCRIPTION: + This function reads the default profile settings from the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being read + pPDPType [ O ] - PDP type + pIPAddress [ O ] - Preferred assigned IPv4 address + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + pAuthentication [ O ] - Authentication algorithm bitmap + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the profile name array + can contain + pName [ O ] - The profile name or description + apnSize [ I ] - The maximum number of characters (including + NULL terminator) that the APN name array + can contain + pAPNName [ O ] - Access point name represented as a NULL + terminated string (empty string returned when + unknown) + userSize [ I ] - The maximum number of characters (including + NULL terminator) that the username array + can contain + pUsername [ O ] - Username used during authentication + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ) +{ + // Validate arguments + if ( (pPDPType == 0) + || (pIPAddress == 0) + || (pPrimaryDNS == 0) + || (pSecondaryDNS == 0) + || (pAuthentication == 0) + || (nameSize == 0) + || (pName == 0) + || (apnSize == 0) + || (pAPNName == 0) + || (userSize == 0) + || (pUsername == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pPDPType = ULONG_MAX; + *pIPAddress = ULONG_MAX; + *pPrimaryDNS = ULONG_MAX; + *pSecondaryDNS = ULONG_MAX; + *pAuthentication = ULONG_MAX; + pName[0] = 0; + pAPNName[0] = 0; + pUsername[0] = 0; + + WORD msgID = (WORD)eQMI_WDS_GET_DEFAULTS; + std::vector piv; + + // "%u 0" + std::ostringstream tmp; + tmp << (UINT)profileType << " 0"; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WDS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (nameSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pName, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pName[strLen] = 0; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pPDPType = pf[0].mValue.mU32; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 20 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (apnSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pAPNName, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pAPNName[strLen] = 0; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 21 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 4) + { + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pPrimaryDNS = (ip4 | ip3 | ip2 | ip1); + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 22 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 4) + { + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pSecondaryDNS = (ip4 | ip3 | ip2 | ip1); + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 27 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (userSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pUsername, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pUsername[strLen] = 0; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 29 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + ULONG pap = (ULONG)pf[0].mValue.mU8; + ULONG chap = (ULONG)pf[1].mValue.mU8 << 1; + + *pAuthentication = (pap | chap); + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 30 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 4) + { + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pIPAddress = (ip4 | ip3 | ip2 | ip1); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + StartDataSession (Public Method) + +DESCRIPTION: + This function activates a packet data session + +PARAMETERS: + pTechnology [ I ] - (Optional) Technology bitmap + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pPrimaryNBNS [ I ] - (Optional) Primary NetBIOS NS IPv4 address + pSecondaryNBNS [ I ] - (Optional) Secondary NetBIOS NS IPv4 address + pAPNName [ I ] - (Optional) Access point name + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + pSessionId [ O ] - The assigned session ID + pFailureReason [ O ] - Upon call failure the failure reason + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::StartDataSession( + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword, + ULONG * pSessionId, + ULONG * pFailureReason ) +{ + *pFailureReason = (ULONG)eQMI_CALL_END_REASON_UNSPECIFIED; + + // Validate arguments + if (pSessionId == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_START_NET; + std::vector piv; + + if (pTechnology != 0) + { + ULONG umts = *pTechnology & 0x00000001; + ULONG cdma = *pTechnology & 0x00000002; + + // "%u %u" + std::ostringstream tmp; + tmp << (UINT)umts << " " << (UINT)cdma; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 48 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pPrimaryDNS != 0) + { + ULONG ip4 = (*pPrimaryDNS & 0x000000FF); + ULONG ip3 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pSecondaryDNS != 0) + { + ULONG ip4 = (*pSecondaryDNS & 0x000000FF); + ULONG ip3 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pPrimaryNBNS != 0) + { + ULONG ip4 = (*pPrimaryNBNS & 0x000000FF); + ULONG ip3 = (*pPrimaryNBNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryNBNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pPrimaryNBNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 18 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pSecondaryNBNS != 0) + { + ULONG ip4 = (*pSecondaryNBNS & 0x000000FF); + ULONG ip3 = (*pSecondaryNBNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryNBNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pSecondaryNBNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 19 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pAPNName != 0) + { + std::ostringstream tmp; + if (pAPNName[0] != 0) + { + tmp << "\"" << pAPNName << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 20 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pIPAddress != 0) + { + ULONG ip4 = (*pIPAddress & 0x000000FF); + ULONG ip3 = (*pIPAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pIPAddress & 0x00FF0000) >> 16; + ULONG ip1 = (*pIPAddress & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 21 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pAuthentication != 0) + { + ULONG pap = *pAuthentication & 0x00000001; + ULONG chap = *pAuthentication & 0x00000002; + + // "%u %u" + std::ostringstream tmp; + tmp << (UINT)pap << " " << (UINT)chap; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 22 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pUsername != 0) + { + std::ostringstream tmp; + if (pUsername[0] != 0) + { + tmp << "\"" << pUsername << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 23 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pPassword != 0) + { + std::ostringstream tmp; + if (pPassword[0] != 0) + { + tmp << "\"" << pPassword << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 24 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + sProtocolBuffer rsp; + if (piv.size() > 0) + { + // Pack up and send the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + else + { + rsp = Send( eQMI_SVC_WDS, pRequest, 300000 ); + } + } + else + { + // Generate and send the QMI request + rsp = SendSimple( eQMI_SVC_WDS, msgID, 300000 ); + } + + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pFailureReason = pf[0].mValue.mU32; + } + + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the session ID + *pSessionId = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + CancelDataSession (Public Method) + +DESCRIPTION: + Cancel an in-progress packet data session activation + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::CancelDataSession() +{ + if (mLastNetStartID == (WORD)INVALID_QMI_TRANSACTION_ID) + { + return eGOBI_ERR_NO_CANCELABLE_OP; + } + + WORD msgID = (WORD)eQMI_WDS_ABORT; + std::vector piv; + + // %hu + std::ostringstream tmp; + tmp << mLastNetStartID; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + mLastNetStartID = (WORD)INVALID_QMI_TRANSACTION_ID; + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest, 60000 ); +} + +/*=========================================================================== +METHOD: + StopDataSession (Public Method) + +DESCRIPTION: + This function stops the current data session + +PARAMETERS: + sessionId [ I ] - The ID of the session to terminate + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::StopDataSession( ULONG sessionId ) +{ + WORD msgID = (WORD)eQMI_WDS_STOP_NET; + std::vector piv; + + // "%u" + std::ostringstream tmp; + tmp << (UINT)sessionId; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest, 60000 ); +} + +/*=========================================================================== +METHOD: + GetIPAddress + +DESCRIPTION: + This function returns the current packet data session IP address + +PARAMETERS: + pIPAddress [ I ] - Assigned IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetIPAddress( ULONG * pIPAddress ) +{ + // Validate arguments + if (pIPAddress == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pIPAddress = ULONG_MAX; + + WORD msgID = (WORD)eQMI_WDS_GET_SETTINGS; + std::vector piv; + + std::string tmp = "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0"; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WDS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLVs we want (IP address) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 30 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 4) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pIPAddress = (ip4 | ip3 | ip2 | ip1); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetConnectionRate (Public Method) + +DESCRIPTION: + This function returns connection rate information for the packet data + connection + +PARAMETERS: + pCurrentChannelTXRate [ O ] - Current channel TX rate (bps) + pCurrentChannelRXRate [ O ] - Current channel RX rate (bps) + pMaxChannelTXRate [ O ] - Maximum channel TX rate (bps) + pMaxChannelRXRate [ O ] - Maximum channel RX rate (bps) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetConnectionRate( + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ) +{ + // Validate arguments + if ( (pCurrentChannelTXRate == 0) + || (pCurrentChannelRXRate == 0) + || (pMaxChannelTXRate == 0) + || (pMaxChannelRXRate == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_RATES; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 4) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the rates + *pCurrentChannelTXRate = pf[0].mValue.mU32; + *pCurrentChannelRXRate = pf[1].mValue.mU32; + *pMaxChannelTXRate = pf[2].mValue.mU32; + *pMaxChannelRXRate = pf[3].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetPacketStatus (Public Method) + +DESCRIPTION: + This function returns the packet data transfer statistics since the start + of the current packet data session + +PARAMETERS: + pTXPacketSuccesses [ O ] - Packets transmitted without error + pRXPacketSuccesses [ O ] - Packets received without error + pTXPacketErrors [ O ] - Outgoing packets with framing errors + pRXPacketErrors [ O ] - Incoming packets with framing errors + pTXPacketOverflows [ O ] - Packets dropped because TX buffer overflowed + pRXPacketOverflows [ O ] - Packets dropped because RX buffer overflowed + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPacketStatus( + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ) +{ + // Validate arguments + if ( (pTXPacketSuccesses == 0) + || (pRXPacketSuccesses == 0) + || (pTXPacketErrors == 0) + || (pRXPacketErrors == 0) + || (pTXPacketOverflows == 0) + || (pRXPacketOverflows == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_GET_STATISTICS; + std::vector piv; + + std::string tmp = "1 1 1 1 1 1 0 0"; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WDS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLVs we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey3( eDB2_ET_QMI_WDS_RSP, msgID, 18 ); + cDataParser::tParsedFields pf3 = ParseTLV( db, rsp, tlvs, tlvKey3 ); + if (pf3.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey4( eDB2_ET_QMI_WDS_RSP, msgID, 19 ); + cDataParser::tParsedFields pf4 = ParseTLV( db, rsp, tlvs, tlvKey4 ); + if (pf4.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey5( eDB2_ET_QMI_WDS_RSP, msgID, 20 ); + cDataParser::tParsedFields pf5 = ParseTLV( db, rsp, tlvs, tlvKey5 ); + if (pf5.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey6( eDB2_ET_QMI_WDS_RSP, msgID, 21 ); + cDataParser::tParsedFields pf6 = ParseTLV( db, rsp, tlvs, tlvKey5 ); + if (pf6.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the statistics + *pTXPacketSuccesses = pf1[0].mValue.mU32; + *pRXPacketSuccesses = pf2[0].mValue.mU32; + *pTXPacketErrors = pf3[0].mValue.mU32; + *pRXPacketErrors = pf4[0].mValue.mU32; + *pTXPacketOverflows = pf5[0].mValue.mU32; + *pRXPacketOverflows = pf6[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetByteTotals (Public Method) + +DESCRIPTION: + This function returns the RX/TX byte counts since the start of the + current packet data session + +PARAMETERS: + pTXTotalBytes [ O ] - Bytes transmitted without error + pRXTotalBytes [ O ] - Bytes received without error + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetByteTotals( + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ) +{ + // Validate arguments + if (pTXTotalBytes == 0 || pRXTotalBytes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_GET_STATISTICS; + std::vector piv; + + std::string tmp = "0 0 0 0 0 0 1 1"; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WDS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_WDS_RSP, msgID, 25 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_WDS_RSP, msgID, 26 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the statistics + *pTXTotalBytes = pf1[0].mValue.mU64; + *pRXTotalBytes = pf2[0].mValue.mU64; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetMobileIP (Public Method) + +DESCRIPTION: + This function sets the current mobile IP setting + +PARAMETERS: + mode [ I ] - Desired mobile IP setting + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetMobileIP( ULONG mode ) +{ + WORD msgID = (WORD)eQMI_WDS_SET_MIP; + std::vector piv; + + // "%u" + std::ostringstream tmp; + tmp << (UINT)mode; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetMobileIP (Public Method) + +DESCRIPTION: + This function gets the current mobile IP setting + +PARAMETERS: + pMode [ I ] - Desired mobile IP setting + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetMobileIP( ULONG * pMode ) +{ + // Validate arguments + if (pMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_MIP; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the mode + *pMode = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetActiveMobileIPProfile (Public Method) + +DESCRIPTION: + This function sets the active mobile IP profile index + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Desired mobile IP profile index + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetActiveMobileIPProfile( + CHAR * pSPC, + BYTE index ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_SET_ACTIVE_MIP; + std::vector piv; + + // "%s %u" + std::ostringstream tmp; + tmp << spc << " " << (UINT)index; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetActiveMobileIPProfile (Public Method) + +DESCRIPTION: + This function gets the the active mobile IP profile index + +PARAMETERS: + pIndex [ O ] - Active mobile IP profile index + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetActiveMobileIPProfile( BYTE * pIndex ) +{ + // Validate arguments + if (pIndex == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_ACTIVE_MIP; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the index + *pIndex = pf[0].mValue.mU8; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetMobileIPProfile (Public Method) + +DESCRIPTION: + This function sets the specified mobile IP profile settings + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Mobile IP profile ID + pEnabled [ I ] - (Optional) Enable MIP profile? + pAddress [ I ] - (Optional) Home IPv4 address + pPrimaryHA [ I ] - (Optional) Primary home agent IPv4 address + pSecondaryHA [ I ] - (Optional) Secondary home agent IPv4 address + pRevTunneling [ I ] - (Optional) Enable reverse tunneling? + pNAI [ I ] - (Optional) Network access identifier string + pHASPI [ I ] - (Optional) HA security parameter index + pAAASPI [ I ] - (Optional) AAA security parameter index + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetMobileIPProfile( + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_SET_MIP_PROFILE; + std::vector piv; + + // "%s %u" + std::ostringstream tmp; + tmp << spc << " " << (UINT)index; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Enabled flag provided? + if (pEnabled != 0) + { + // "%u" + std::ostringstream tmp2; + tmp2 << (UINT)(*pEnabled == 0 ? 0 : 1); + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // Home address provided? + if (pAddress != 0) + { + ULONG ip4 = (*pAddress & 0x000000FF); + ULONG ip3 = (*pAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pAddress & 0x00FF0000) >> 16; + ULONG ip1 = (*pAddress & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // Primary HA address provided? + if (pPrimaryHA != 0) + { + ULONG ip4 = (*pPrimaryHA & 0x000000FF); + ULONG ip3 = (*pPrimaryHA & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryHA & 0x00FF0000) >> 16; + ULONG ip1 = (*pPrimaryHA & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 18 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // Secondary HA address provided? + if (pSecondaryHA != 0) + { + ULONG ip4 = (*pSecondaryHA & 0x000000FF); + ULONG ip3 = (*pSecondaryHA & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryHA & 0x00FF0000) >> 16; + ULONG ip1 = (*pSecondaryHA & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 19 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // Reverse tunneling flag provided? + if (pRevTunneling != 0) + { + // "%u" + std::ostringstream tmp2; + tmp2 << (UINT)(*pRevTunneling == 0 ? 0 : 1); + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 20 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // NAI provided? + if (pNAI != 0) + { + std::ostringstream tmp2; + if (pNAI[0] != 0) + { + tmp2 << "\"" << pNAI << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 21 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // HA SPI provided? + if (pHASPI != 0) + { + // "%u" + std::ostringstream tmp2; + tmp2 << (UINT)*pHASPI; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 22 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // AAA SPI provided? + if (pAAASPI != 0) + { + // "%u" + std::ostringstream tmp2; + tmp2 << (UINT)*pAAASPI; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 23 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // MN-HA key provided? + if (pMNHA != 0) + { + std::ostringstream tmp2; + if (pMNHA[0] != 0) + { + tmp2 << "\"" << pMNHA << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 24 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // MN-AAA key provided? + if (pMNAAA != 0) + { + std::ostringstream tmp2; + if (pMNAAA[0] != 0) + { + tmp2 << "\"" << pMNAAA << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 25 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // We require at least one of the optional arguments + if (piv.size() <= 1) + { + // Much ado about nothing + return eGOBI_ERR_INVALID_ARG; + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetMobileIPProfile (Public Method) + +DESCRIPTION: + This function gets the specified mobile IP profile settings + +PARAMETERS: + index [ I ] - Mobile IP profile ID + pEnabled [ O ] - MIP profile enabled? + pAddress [ O ] - Home IPv4 address + pPrimaryHA [ O ] - Primary home agent IPv4 address + pSecondaryHA [ O ] - Secondary home agent IPv4 address + pRevTunneling [ O ] - Reverse tunneling enabled? + naiSize [ I ] - The maximum number of characters (including NULL + terminator) that the NAI array can contain + pNAI [ O ] - Network access identifier string + pHASPI [ O ] - HA security parameter index + pAAASPI [ O ] - AAA security parameter index + pHAState [ O ] - HA key state + pAAAState [ O ] - AAA key state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetMobileIPProfile( + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ) +{ + + // Validate arguments + if ( (pEnabled == 0) + || (pAddress == 0) + || (pPrimaryHA == 0) + || (pSecondaryHA == 0) + || (pRevTunneling == 0) + || (naiSize == 0) + || (pNAI == 0) + || (pHASPI == 0) + || (pAAASPI == 0) + || (pHAState == 0) + || (pAAAState == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume errors + *pEnabled = UCHAR_MAX; + *pAddress = ULONG_MAX; + *pPrimaryHA = ULONG_MAX; + *pSecondaryHA = ULONG_MAX; + *pRevTunneling = UCHAR_MAX; + *pHASPI = ULONG_MAX; + *pAAASPI = ULONG_MAX; + *pHAState = ULONG_MAX; + *pAAAState = ULONG_MAX; + + WORD msgID = (WORD)eQMI_WDS_GET_MIP_PROFILE; + std::vector piv; + + // "%u" + std::ostringstream arg; + arg << (UINT)index; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)arg.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WDS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() >= 1) + { + *pEnabled = pf1[0].mValue.mU8; + } + + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() >= 4) + { + ULONG ip4 = (ULONG)pf2[0].mValue.mU8; + ULONG ip3 = (ULONG)pf2[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf2[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf2[3].mValue.mU8 << 24; + *pAddress = (ip4 | ip3 | ip2 | ip1); + } + + + sProtocolEntityKey tlvKey3( eDB2_ET_QMI_WDS_RSP, msgID, 18 ); + cDataParser::tParsedFields pf3 = ParseTLV( db, rsp, tlvs, tlvKey3 ); + if (pf3.size() >= 4) + { + ULONG ip4 = (ULONG)pf3[0].mValue.mU8; + ULONG ip3 = (ULONG)pf3[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf3[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf3[3].mValue.mU8 << 24; + *pPrimaryHA = (ip4 | ip3 | ip2 | ip1); + } + + sProtocolEntityKey tlvKey4( eDB2_ET_QMI_WDS_RSP, msgID, 19 ); + cDataParser::tParsedFields pf4 = ParseTLV( db, rsp, tlvs, tlvKey4 ); + if (pf4.size() >= 4) + { + ULONG ip4 = (ULONG)pf4[0].mValue.mU8; + ULONG ip3 = (ULONG)pf4[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf4[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf4[3].mValue.mU8 << 24; + *pSecondaryHA = (ip4 | ip3 | ip2 | ip1); + } + + sProtocolEntityKey tlvKey5( eDB2_ET_QMI_WDS_RSP, msgID, 20 ); + cDataParser::tParsedFields pf5 = ParseTLV( db, rsp, tlvs, tlvKey5 ); + if (pf5.size() >= 1) + { + *pRevTunneling = pf5[0].mValue.mU8; + } + + sProtocolEntityKey tlvKey6( eDB2_ET_QMI_WDS_RSP, msgID, 21 ); + cDataParser::tParsedFields pf6 = ParseTLV( db, rsp, tlvs, tlvKey6 ); + if (pf6.size() >= 1) + { + LONG strLen = pf6[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (naiSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pNAI, (LPCSTR)pf6[0].mValueString.c_str(), strLen ); + pNAI[strLen] = 0; + } + + sProtocolEntityKey tlvKey7( eDB2_ET_QMI_WDS_RSP, msgID, 22 ); + cDataParser::tParsedFields pf7 = ParseTLV( db, rsp, tlvs, tlvKey7 ); + if (pf7.size() >= 1) + { + *pHASPI = pf7[0].mValue.mU32; + } + + sProtocolEntityKey tlvKey8( eDB2_ET_QMI_WDS_RSP, msgID, 23 ); + cDataParser::tParsedFields pf8 = ParseTLV( db, rsp, tlvs, tlvKey8 ); + if (pf8.size() >= 1) + { + *pAAASPI = pf8[0].mValue.mU32; + } + sProtocolEntityKey tlvKey9( eDB2_ET_QMI_WDS_RSP, msgID, 26 ); + cDataParser::tParsedFields pf9 = ParseTLV( db, rsp, tlvs, tlvKey9 ); + if (pf9.size() >= 1) + { + *pHAState = pf9[0].mValue.mU32; + } + + sProtocolEntityKey tlvKey10( eDB2_ET_QMI_WDS_RSP, msgID, 27 ); + cDataParser::tParsedFields pf10 = ParseTLV( db, rsp, tlvs, tlvKey10 ); + if (pf10.size() >= 1) + { + *pAAAState = pf10[0].mValue.mU32; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetMobileIPParameters (Public Method) + +DESCRIPTION: + This function sets the specified mobile IP parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pMode [ I ] - (Optional) Desired mobile IP setting + pRetryLimit [ I ] - (Optional) Retry attempt limit + pRetryInterval [ I ] - (Optional) Retry attempt interval + pReRegPeriod [ I ] - (Optional) Re-registration period + pReRegTraffic [ I ] - (Optional) Re-registration only with traffic? + pHAAuthenticator [ I ] - (Optional) MH-HA authenticator calculator? + pHA2002bis [ I ] - (Optional) MH-HA RFC 2002bis authentication? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetMobileIPParameters( + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_SET_MIP_PARAMS; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)spc.c_str() ); + piv.push_back( pi ); + + // Mode provided? + if (pMode != 0) + { + // "%u" + std::ostringstream tmp; + tmp << (UINT)*pMode; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Retry limit provided? + if (pRetryLimit != 0) + { + std::ostringstream tmp; + tmp << (UINT)*pRetryLimit; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Retry interval provided? + if (pRetryInterval != 0) + { + std::ostringstream tmp; + tmp << (UINT)*pRetryInterval; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 18 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Re-registration period provided? + if (pReRegPeriod != 0) + { + std::ostringstream tmp; + tmp << (UINT)*pReRegPeriod; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 19 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Re-registration on traffic flag provided? + if (pReRegTraffic != 0) + { + std::ostringstream tmp; + tmp << (UINT)(*pReRegTraffic == 0 ? 0 : 1); + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 20 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // HA authenticator flag provided? + if (pHAAuthenticator != 0) + { + std::ostringstream tmp; + tmp << (UINT)(*pHAAuthenticator == 0 ? 0 : 1); + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 21 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // HA RFC2002bis authentication flag provided? + if (pHA2002bis != 0) + { + std::ostringstream tmp; + tmp << (UINT)(*pHA2002bis == 0 ? 0 : 1); + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 22 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // We require at least one of the optional arguments + if (piv.size() <= 1) + { + // Much ado about nothing + return eGOBI_ERR_INVALID_ARG; + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetMobileIPParameters (Public Method) + +DESCRIPTION: + This function gets the mobile IP parameters + +PARAMETERS: + pMode [ 0 ] - Current mobile IP setting + pRetryLimit [ 0 ] - Retry attempt limit + pRetryInterval [ 0 ] - Retry attempt interval + pReRegPeriod [ 0 ] - Re-registration period + pReRegTraffic [ 0 ] - Re-registration only with traffic? + pHAAuthenticator [ 0 ] - MH-HA authenticator calculator? + pHA2002bis [ 0 ] - MH-HA RFC 2002bis authentication? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetMobileIPParameters( + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + // Validate arguments + if ( (pMode == 0) + || (pRetryLimit == 0) + || (pRetryInterval == 0) + || (pReRegPeriod == 0) + || (pReRegTraffic == 0) + || (pHAAuthenticator == 0) + || (pHA2002bis == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pMode = ULONG_MAX; + *pRetryLimit = UCHAR_MAX; + *pRetryInterval = UCHAR_MAX; + *pReRegPeriod = UCHAR_MAX; + *pReRegTraffic = UCHAR_MAX; + *pHAAuthenticator = UCHAR_MAX; + *pHA2002bis = UCHAR_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_MIP_PARAMS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pMode = pf[0].mValue.mU32; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pRetryLimit = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 18 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pRetryInterval = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 19 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pReRegPeriod = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 20 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pReRegTraffic = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 21 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pHAAuthenticator = pf[0].mValue.mU8; + } + + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 22 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pHA2002bis = pf[0].mValue.mU8; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetLastMobileIPError (Public Method) + +DESCRIPTION: + This function gets the last mobile IP error + +PARAMETERS: + pError [ 0 ] - Last mobile IP error + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetLastMobileIPError( ULONG * pError ) +{ + // Validate arguments + if (pError == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_LAST_MIP_STATUS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the index + *pError = (ULONG)pf[0].mValue.mU8; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetDNSSettings + +DESCRIPTION: + This function sets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + // Validate arguments + if (pPrimaryDNS == 0 && pSecondaryDNS == 0) + { + // At least one must be specified + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_SET_DNS; + std::vector piv; + + if (pPrimaryDNS != 0) + { + ULONG ip4 = (*pPrimaryDNS & 0x000000FF); + ULONG ip3 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pSecondaryDNS != 0) + { + ULONG ip4 = (*pSecondaryDNS & 0x000000FF); + ULONG ip3 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Pack up and send the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetDNSSettings + +DESCRIPTION: + This function gets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + // Validate arguments + if (pPrimaryDNS == 0 || pSecondaryDNS == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pPrimaryDNS = 0; + *pSecondaryDNS = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_DNS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 4) + { + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pPrimaryDNS = (ip4 | ip3 | ip2 | ip1); + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 4) + { + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pSecondaryDNS = (ip4 | ip3 | ip2 | ip1); + } + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/GobiAPI_1.0.40/Shared/GobiQMIVoice.cpp b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMIVoice.cpp new file mode 100755 index 0000000..99120ae --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/GobiQMIVoice.cpp @@ -0,0 +1,205 @@ +/*=========================================================================== +FILE: + GobiQMICoreVoice.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (Voice Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sUSSDInfo +// Struct to represent USSD/Alpha information header +/*=========================================================================*/ +struct sUSSDInfoHdr +{ + public: + BYTE mDCS; + BYTE mLength; + + // Data of 'mLength' follows +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + OriginateUSSD (Public Method) + +DESCRIPTION: + This function initiates a USSD operation + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OriginateUSSD( BYTE * pInfo ) +{ + // Validate arguments + if (pInfo == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + const ULONG INFO_HDR_SZ = (ULONG)sizeof( sUSSDInfoHdr ); + + sUSSDInfoHdr * pInInfo = (sUSSDInfoHdr *)pInfo; + ULONG infoLen = pInInfo->mLength + INFO_HDR_SZ; + + WORD msgID = (WORD)eQMI_VOICE_ASYNC_ORIG_USSD; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_VOICE_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (const BYTE *)pInfo, infoLen ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + return SendAndCheckReturn( eQMI_SVC_VOICE, pRequest, 300000 ); +} + +/*=========================================================================== +METHOD: + AnswerUSSD (Public Method) + +DESCRIPTION: + This function responds to a USSD request from the network + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::AnswerUSSD( BYTE * pInfo ) +{ + // Validate arguments + if (pInfo == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + const ULONG INFO_HDR_SZ = (ULONG)sizeof( sUSSDInfoHdr ); + + sUSSDInfoHdr * pInInfo = (sUSSDInfoHdr *)pInfo; + ULONG infoLen = pInInfo->mLength + INFO_HDR_SZ; + + WORD msgID = (WORD)eQMI_VOICE_ANSWER_USSD; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_VOICE_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (const BYTE *)pInfo, infoLen ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_VOICE, pRequest, 300000 ); +} + +/*=========================================================================== +METHOD: + CancelUSSD (Public Method) + +DESCRIPTION: + This function cancels an in-progress USSD operation + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::CancelUSSD() +{ + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_VOICE_CANCEL_USSD; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_VOICE, msgID, 30000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + diff --git a/gobi-api/GobiAPI_1.0.40/Shared/Makefile.am b/gobi-api/GobiAPI_1.0.40/Shared/Makefile.am new file mode 100644 index 0000000..dfa9640 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/Shared/Makefile.am @@ -0,0 +1,41 @@ +noinst_LTLIBRARIES = libShared.la + +INCLUDES = \ + -I$(top_srcdir)/Core + +libShared_la_CPPFLAGS = \ + -D WDS_SUPPORT \ + -D DMS_SUPPORT \ + -D NAS_SUPPORT \ + -D PDS_SUPPORT \ + -D CAT_SUPPORT \ + -D RMS_SUPPORT \ + -D OMA_SUPPORT \ + -D UIM_SUPPORT \ + -D WMS_SUPPORT \ + -D IMG2K_SUPPORT \ + -D IMG_SUPPORT \ + -D VOICE_SUPPORT + +libShared_la_SOURCES = \ + GobiError.h \ + GobiImageDefinitions.h \ + GobiMBNMgmt.cpp \ + GobiMBNMgmt.h \ + GobiQDLCore.cpp \ + GobiQDLCore.h \ + GobiQMICoreCAT.cpp \ + GobiQMICore.cpp \ + GobiQMICoreDMS.cpp \ + GobiQMICore.h \ + GobiQMICoreImg2k.cpp \ + GobiQMICoreImg.cpp \ + GobiQMICoreNAS.cpp \ + GobiQMICoreOMA.cpp \ + GobiQMICorePDS.cpp \ + GobiQMICoreRMS.cpp \ + GobiQMICoreSMS.cpp \ + GobiQMICoreUIM.cpp \ + GobiQMICoreWDS.cpp \ + GobiQMIVoice.cpp + diff --git a/gobi-api/GobiAPI_1.0.40/autogen.sh b/gobi-api/GobiAPI_1.0.40/autogen.sh new file mode 100755 index 0000000..4fa6c5d --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/autogen.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. +# NOTE +# This autogen.sh is only used when building libqcdm separately from ModemManager + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. +REQUIRED_AUTOMAKE_VERSION=1.7 +PKG_NAME=GobiAPI + +(test -f $srcdir/configure.ac \ + && test -f $srcdir/Core/QDLEnum.h) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +} + +(cd $srcdir; + mkdir m4 + autoreconf --install --symlink && + autoreconf && + ./configure --enable-maintainer-mode $@ +) diff --git a/gobi-api/GobiAPI_1.0.40/configure.ac b/gobi-api/GobiAPI_1.0.40/configure.ac new file mode 100644 index 0000000..7f772f4 --- /dev/null +++ b/gobi-api/GobiAPI_1.0.40/configure.ac @@ -0,0 +1,30 @@ +AC_PREREQ(2.52) + +AC_INIT(GobiAPI, 1.0.40, foo@it.com, GobiAPI) +AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +AM_MAINTAINER_MODE + +AC_CONFIG_MACRO_DIR([m4]) + +AC_CONFIG_HEADERS(config.h) + +dnl Required programs +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_CXX +AC_PROG_INSTALL +LT_INIT + +AC_CONFIG_FILES([ +Makefile +Core/Makefile +Database/Makefile +Database/QMI/Makefile +Shared/Makefile +GobiConnectionMgmt/Makefile +GobiImageMgmt/Makefile +GobiQDLService/Makefile +]) +AC_OUTPUT + diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/Comm.cpp b/gobi-api/Gobi_2011-11-28-1533/Core/Comm.cpp new file mode 100755 index 0000000..56ec857 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/Comm.cpp @@ -0,0 +1,643 @@ +/*=========================================================================== +FILE: + Comm.cpp + +DESCRIPTION: + Implementation of cComm class + +PUBLIC CLASSES AND METHODS: + cComm + This class wraps low level port communications + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "Comm.h" +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +// Thread commands +#define START_READ_CMD 0 +#define STOP_READ_CMD 1 +#define EXIT_CMD 2 + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + RxThread (Free Method) + +DESCRIPTION: + Thread for simulating asynchronous reads + +PARAMETERS: + pData [ I ] Asynchronous read object + +RETURN VALUE: + void * - thread exit value (always 0) +===========================================================================*/ +void * RxThread( void * pData ) +{ + cComm * pComm = (cComm*)pData; + if (pComm == NULL || pComm->IsValid() == false) + { + return 0; + } + + fd_set inputSet, outputSet; + FD_ZERO( &inputSet ); + FD_SET( pComm->mCommandPipe[READING], &inputSet ); + int largestFD = pComm->mCommandPipe[READING]; + + int status = 0; + while (true) + { + // No FD_COPY() available + memcpy( &outputSet, &inputSet, sizeof( fd_set ) ); + + status = select( largestFD + 1, &outputSet, NULL, NULL, NULL ); + if (status <= 0) + { + TRACE( "error %d in select, errno %d\n", status, errno ); + break; + } + + if (FD_ISSET( pComm->mCommandPipe[READING], &outputSet ) == true) + { + // Read from the pipe + BYTE cmd; + status = read( pComm->mCommandPipe[READING], &cmd, 1 ); + if (status != 1) + { + TRACE( "cmd error %d\n", status ); + break; + } + + if (cmd == START_READ_CMD) + { + FD_SET( pComm->mPort, &inputSet ); + largestFD = std::max( pComm->mPort, + pComm->mCommandPipe[READING] ); + } + else if (cmd == STOP_READ_CMD) + { + FD_CLR( pComm->mPort, &inputSet ); + largestFD = pComm->mCommandPipe[READING]; + } + else + { + // EXIT_CMD or anything else + break; + } + } + else if (FD_ISSET( pComm->mPort, &outputSet ) == true) + { + // Stop watching for read data + FD_CLR( pComm->mPort, &inputSet ); + largestFD = pComm->mCommandPipe[READING]; + + // Perform a read + status = read( pComm->mPort, + pComm->mpBuffer, + pComm->mBuffSz ); + + cIOCallback * pCallback = pComm->mpRxCallback; + pComm->mpRxCallback = 0; + + if (pCallback == (cIOCallback *)1) + { + // We wanted to read, but not to be notified + } + else if (status >= 0) + { + pCallback->IOComplete( 0, status ); + } + else + { + pCallback->IOComplete( status, 0 ); + } + } + } + + return 0; +}; + +/*=========================================================================*/ +// cComm Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cComm (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cComm::cComm() + : mPortName( "" ), + mPort( INVALID_HANDLE_VALUE ), + mpRxCallback( 0 ), + mbCancelWrite( false ), + mpBuffer( 0 ), + mBuffSz( 0 ), + mRxThreadID( 0 ) +{ + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; +} + +/*=========================================================================== +METHOD: + ~cComm (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cComm::~cComm() +{ + // Disconnect from current port + Disconnect(); + + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + Bool +===========================================================================*/ +bool cComm::IsValid() +{ + // Nothing to do, dependant on extended class functionality + return true; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified port + +PARAMETERS: + pPort [ I ] - Name of port to open (IE: /dev/qcqmi0) + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::Connect( LPCSTR pPort ) +{ + if (IsValid() == false || pPort == 0 || pPort[0] == 0) + { + return false; + } + + if (mPort != INVALID_HANDLE_VALUE) + { + Disconnect(); + } + + // Initialize command pipe for read thread + int nRet = pipe( mCommandPipe ); + if (nRet != 0) + { + TRACE( "cComm:Connect() pipe creation failed %d\n", nRet ); + return false; + } + + // Start the read thread + nRet = pthread_create( &mRxThreadID, + 0, + RxThread, + this ); + if (nRet != 0) + { + TRACE( "cComm::Connect() pthread_create = %d\n", nRet ); + + Disconnect(); + return false; + } + + // Opening the com port + mPort = open( pPort, O_RDWR ); + if (mPort == INVALID_HANDLE_VALUE) + { + Disconnect(); + return false; + } + + // Save port name + mPortName = pPort; + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + RunIOCTL (Public Method) + +DESCRIPTION: + Run an IOCTL on the open file handle + +PARAMETERS: + ioctlReq [ I ] - ioctl request value + pData [I/O] - input or output specific to ioctl request value + +RETURN VALUE: + int - ioctl return value (0 for success) +===========================================================================*/ +int cComm::RunIOCTL( + UINT ioctlReq, + void * pData ) +{ + if (mPort == INVALID_HANDLE_VALUE) + { + TRACE( "Invalid file handle\n" ); + return -EBADFD; + } + + return ioctl( mPort, ioctlReq, pData ); +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the current port + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::Disconnect() +{ + // Assume success + bool bRC = true; + + if (mCommandPipe[WRITING] != INVALID_HANDLE_VALUE) + { + if (mRxThreadID != 0) + { + // Notify the thread to exit + BYTE byte = EXIT_CMD; + write( mCommandPipe[WRITING], &byte, 1 ); + + // And wait for it + TRACE( "cComm::Disconnnect() joining thread %d\n", mRxThreadID ); + int nRC = pthread_join( mRxThreadID, 0 ); + if (nRC != 0) + { + TRACE( "failed to join thread %d\n", nRC ); + bRC = false; + } + + mRxThreadID = 0; + } + + close( mCommandPipe[WRITING] ); + close( mCommandPipe[READING] ); + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; + } + + if (mPort != INVALID_HANDLE_VALUE) + { + close( mPort ); + mPort = INVALID_HANDLE_VALUE; + } + + mPortName.clear(); + return bRC; +} + +/*=========================================================================== +METHOD: + ConfigureSettings (Public Method) + +DESCRIPTION: + Configure the port with the passed in parameters + +PARAMETERS: + pSettings [ I ] - Desired port settings + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::ConfigureSettings( termios * pSettings ) +{ + if (mPort == INVALID_HANDLE_VALUE || pSettings == 0) + { + return false; + } + + tcflush( mPort, TCIOFLUSH ); + int nRC = tcsetattr( mPort, TCSANOW, pSettings ); + if (nRC == -1) + { + return false; + } + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + GetSettings (Public Method) + +DESCRIPTION: + Return the current port settings + +PARAMETERS: + pSettings [ I ] - Current port settings + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::GetSettings( termios * pSettings ) +{ + if (mPort == INVALID_HANDLE_VALUE || pSettings == 0) + { + return false; + } + + // Get the COM port settings + int nRC = tcgetattr( mPort, pSettings ); + if (nRC == -1) + { + return false; + } + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + CancelIO (Public Method) + +DESCRIPTION: + Cancel any in-progress I/O + +PARAMETERS: + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelIO() +{ + if (mPort == INVALID_HANDLE_VALUE) + { + return false; + } + + bool bRxCancel = CancelRx(); + bool bTxCancel = CancelTx(); + + return (bRxCancel && bTxCancel); +} + +/*=========================================================================== +METHOD: + CancelRx (Public Method) + +DESCRIPTION: + Cancel any in-progress receive operation + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelRx() +{ + if (mPort == INVALID_HANDLE_VALUE + || mCommandPipe[WRITING] == INVALID_HANDLE_VALUE + || mpRxCallback == 0 + || mRxThreadID == 0) + { + TRACE( "cannot cancel, thread not active\n" ); + return false; + } + + // Notify the thread to stop reading + BYTE byte = STOP_READ_CMD; + int nRC = write( mCommandPipe[WRITING], &byte, 1 ); + if (nRC != 1) + { + TRACE( "error %d canceling read\n", nRC ); + return false; + } + + // Remove the old callback + mpRxCallback = 0; + + return true; +} + +/*=========================================================================== +METHOD: + CancelTx (Public Method) + +DESCRIPTION: + Cancel any in-progress transmit operation + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelTx() +{ + if (mPort == INVALID_HANDLE_VALUE) + { + return false; + } + + mbCancelWrite = true; + + return true; +} + +/*=========================================================================== +METHOD: + RxData (Public Method) + +DESCRIPTION: + Receive data + +PARAMETERS: + pBuf [ I ] - Buffer to contain received data + bufSz [ I ] - Amount of data to be received + pCallback [ I ] - Callback object to be exercised when the + operation completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::RxData( + BYTE * pBuf, + ULONG bufSz, + cIOCallback * pCallback ) +{ + if (IsValid() == false || mpRxCallback != 0) + { + return false; + } + + if (pCallback == 0) + { + // Not interested in being notified, but we still need a value + // for this so that only one outstanding I/O operation is active + // at any given point in time + mpRxCallback = (cIOCallback * )1; + } + else + { + mpRxCallback = pCallback; + } + + mpBuffer = pBuf; + mBuffSz = bufSz; + + // Notify the thread to stop reading + BYTE byte = START_READ_CMD; + int nRC = write( mCommandPipe[WRITING], &byte, 1 ); + if (nRC != 1) + { + TRACE( "error %d starting read\n", nRC ); + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + TxData (Public Method) + +DESCRIPTION: + Transmit data + +PARAMETERS: + pBuf [ I ] - Data to be transmitted + bufSz [ I ] - Amount of data to be transmitted + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::TxData( + const BYTE * pBuf, + ULONG bufSz ) +{ + if (IsValid() == false) + { + return false; + } + +#ifdef DEBUG + ULONGLONG nStart = GetTickCount(); +#endif + + // Allow ourselves to be interupted + mbCancelWrite = false; + + // This seems a bit pointless, but we're still going verify + // the device is ready for writing, and give it up to + // (1000 + num bytes) MS to be ready (in 100 MS chunks) + + struct timeval TimeOut; + fd_set set; + + int nReady = 0; + int nCount = 0; + + while ( nReady == 0 ) + { + if (mbCancelWrite == true) + { + TRACE( "cComm::TxData() write canceled before device was ready\n" ); + return false; + } + + if (nCount >= (1000 + bufSz) / 100) + { + // Timeout is expired + break; + } + + FD_ZERO( &set ); + FD_SET( mPort, &set ); + TimeOut.tv_sec = 0; + TimeOut.tv_usec = 100000; + nReady = select( mPort + 1, NULL, &set, NULL, &TimeOut ); + + nCount++; + } + + if (nReady <= 0) + { + TRACE( "cComm::TxData() Unable to get device ready for" + " Write, error %d: %s\n", + nReady, + strerror( nReady) ); + return false; + } + + int nRet = write( mPort, pBuf, bufSz ); + if (nRet != bufSz) + { + TRACE( "cComm::TxData() write returned %d instead of %lu\n", + nRet, + bufSz ); + return false; + } + +#ifdef DEBUG + TRACE( "Write of %lu bytes took %llu miliseconds\n", bufSz, GetTickCount() - nStart ); +#endif + + return true; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/Comm.h b/gobi-api/Gobi_2011-11-28-1533/Core/Comm.h new file mode 100755 index 0000000..cf0a8cd --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/Comm.h @@ -0,0 +1,159 @@ +/*=========================================================================== +FILE: + Comm.h + +DESCRIPTION: + Declaration of cComm class + +PUBLIC CLASSES AND METHODS: + cComm + This class wraps low level port communications + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Event.h" + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// Class cIOCallback +/*=========================================================================*/ +class cIOCallback +{ + public: + // (Inline) Constructor + cIOCallback() { }; + + // (Inline) Destructor + virtual ~cIOCallback() { }; + + // The I/O has been completed, process the results + virtual void IOComplete( + DWORD status, + DWORD bytesTransferred ) = 0; +}; + +/*=========================================================================*/ +// Class cComm +/*=========================================================================*/ +class cComm +{ + public: + // Constructor + cComm(); + + // Destructor + virtual ~cComm(); + + // Is this object valid? + virtual bool IsValid(); + + // Connect to the specified port + virtual bool Connect( LPCSTR pPort ); + + // Run an IOCTL on the open file handle + int RunIOCTL( + UINT ioctlReq, + void * pData ); + + // Disconnect from the current port + virtual bool Disconnect(); + + // Configure the port with the passed in parameters + bool ConfigureSettings( termios * pSettings ); + + // Return the current port settings + bool GetSettings( termios * pSettings ); + + // Cancel any in-progress I/O + bool CancelIO(); + + // Cancel any in-progress receive operation + bool CancelRx(); + + // Cancel any in-progress transmit operation + bool CancelTx(); + + // Receive data + virtual bool RxData( + BYTE * pBuf, + ULONG bufSz, + cIOCallback * pCallback ); + + // Transmit data + virtual bool TxData( + const BYTE * pBuf, + ULONG bufSz ); + + // (Inline) Return current port name + virtual std::string GetPortName() const + { + return mPortName; + }; + + // Are we currently connected to a port? + bool IsConnected() + { + return (mPort != INVALID_HANDLE_VALUE); + }; + + protected: + /* Name of current port */ + std::string mPortName; + + /* Handle to COM port */ + int mPort; + + /* Read callbacks */ + cIOCallback * mpRxCallback; + + // Cancel the write request? + bool mbCancelWrite; + + /* Buffer */ + BYTE * mpBuffer; + + /* Buffer size */ + ULONG mBuffSz; + + /* Pipe for comunication with thread */ + int mCommandPipe[2]; + + /* Thread ID of Rx Thread. */ + pthread_t mRxThreadID; + + // Rx thread is allowed complete access + friend void * RxThread( void * pData ); +}; diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/Event.cpp b/gobi-api/Gobi_2011-11-28-1533/Core/Event.cpp new file mode 100755 index 0000000..ad7f941 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/Event.cpp @@ -0,0 +1,437 @@ +/*=========================================================================== +FILE: + Event.cpp + +DESCRIPTION: + Implementation of cEvent class + +PUBLIC CLASSES AND METHODS: + WaitOnMultipleEvents + cEvent + Functionality to mimic Windows events using UNIX pipes (enhanced + somewhat to allow one to specify a DWORD value to pass through + when signalling the event) + + WARNING: + This class is not designed to be thread safe + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "Event.h" + +/*=========================================================================== +METHOD: + WaitOnMultipleEvents (Free Method) + +DESCRIPTION: + Wait for any of the events to be set and return the value + + Note: If multiple events are set, only the event specified by + eventIndex will be read from. Run this function again + to get the next event. + +PARAMETERS: + events [ I ] - Vector of events which may be signaled + timeoutMS [ I ] - Relative timeout length (in milliseconds) + val [ O ] - Associated value upon success + eventIndex [ O ] - Index of event which was signaled + +RETURN VALUE: + Return code + positive for number of events set + -ETIME on timeout + negative errno value on failure +===========================================================================*/ +int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ) +{ + // Check internal pipes' status + for (int index = 0; index < events.size(); index++) + { + int error = events[index]->mError; + if (error != 0) + { + TRACE( "cEvent %d has error %d\n", index, error ); + return -error; + } + } + + // Initialize the FD set + fd_set fds; + FD_ZERO( &fds ); + + // Add each item to the FD set, keeping track of the largest, + // which is used for select() + int largestFD = 0; + for (int index = 0; index < events.size(); index++) + { + int pipe = events[index]->mPipes[READING]; + FD_SET( pipe, &fds ); + + largestFD = std::max( pipe, largestFD ); + } + + struct timeval timeOut; + + // Add avoiding an overflow on (long)usec + timeOut.tv_sec = timeoutMS / 1000l; + timeOut.tv_usec = ( timeoutMS % 1000l ) * 1000l; + + // Wait for activity on the pipes for the specified amount of time + int rc = select( largestFD + 1, &fds, 0, 0, &timeOut ); + if (rc == -1) + { + TRACE( "WaitOnMultipleEvents error %d\n", errno ); + return -errno; + } + else if (rc == 0) + { + // No activity on the pipes + return -ETIME; + } + + int numSignaled = rc; + + // Only read from first pipe which was signaled + int signaled = -1; + for (int index = 0; index < events.size(); index++) + { + int pipe = events[index]->mPipes[READING]; + if (FD_ISSET( pipe, &fds ) != 0) + { + signaled = index; + break; + } + } + + if (signaled == -1) + { + // Odd, no one was signaled + return -ENODATA; + } + + DWORD tempVal = 0; + rc = events[signaled]->Read( tempVal ); + if (rc == 0) + { + // Success + val = tempVal; + eventIndex = signaled; + return numSignaled; + } + else + { + // failure + return rc; + } +} + +/*=========================================================================*/ +// cEvent Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cEvent (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cEvent::cEvent() + : mError( 0 ) +{ + int rc = pipe( mPipes ); + if (rc != 0) + { + mError = errno; + TRACE( "cEvent - Error %d creating pipe, %s\n", + mError, + strerror( mError ) ); + } +} + +/*=========================================================================== +METHOD: + ~cEvent (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cEvent::~cEvent() +{ + // Check internal pipe status + if (mError == 0) + { + Close(); + mError = EBADF; + } +} + +/*=========================================================================== +METHOD: + Close (Internal Method) + +DESCRIPTION: + Close pipe + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Close() +{ + int retCode = 0; + + int rc = close( mPipes[READING] ); + mPipes[READING] = -1; + + if (rc != 0) + { + retCode = errno; + TRACE( "cEvent - Error %d deleting pipe[READING], %s\n", + retCode, + strerror( retCode ) ); + } + + rc = close( mPipes[WRITING] ); + mPipes[WRITING] = -1; + + if (rc != 0) + { + retCode = errno; + TRACE( "cEvent - Error %d deleting pipe[WRITING], %s\n", + retCode, + strerror( retCode ) ); + } + + return retCode; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Set/signal the event with the specified value + +PARAMETERS: + val [ I ] - Value to pass through with signal + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Set( DWORD val ) +{ + // Check internal pipe status + if (mError != 0) + { + return mError; + } + + PBYTE pWrite = (PBYTE)&val; + + int writeSize = sizeof( DWORD ); + while (writeSize > 0) + { + int bytesWritten = write( mPipes[WRITING], pWrite, writeSize ); + if (bytesWritten == -1) + { + // Store error from write + int writeErr = errno; + + // First error? + if (mError == 0) + { + // Yes, save the error + mError = writeErr; + } + + // We cannot recover from this error + Close(); + return writeErr; + } + + pWrite += bytesWritten; + writeSize -= bytesWritten; + } + + // Success + return 0; +} + +/*=========================================================================== +METHOD: + Wait (Free Method) + +DESCRIPTION: + Wait for the event to be signalled and return the read in value + +PARAMETERS: + timeoutMS [ I ] - Relative timeout length (in milliseconds) + val [ O ] - Associated value upon success + +RETURN VALUE: + Return code + 0 on success + ETIME on timeout + errno value on failure +===========================================================================*/ +int cEvent::Wait( + DWORD timeoutMS, + DWORD & val ) +{ + // Check internal pipe status + if (mError != 0) + { + return mError; + } + + fd_set fds; + FD_ZERO( &fds ); + FD_SET( mPipes[READING], &fds ); + + struct timeval timeOut; + + // Add avoiding an overflow on (long)usec + timeOut.tv_sec = timeoutMS / 1000l; + timeOut.tv_usec = ( timeoutMS % 1000l ) * 1000l; + + // Wait for activity on the pipe for the specified amount of time + int rc = select( mPipes[READING] + 1, &fds, 0, 0, &timeOut ); + if (rc == -1) + { + // Store error from select + int selectErr = errno; + + // First error? + if (mError == 0) + { + // Yes, save the error + mError = selectErr; + } + + // We cannot recover from this error + Close(); + return selectErr; + } + else if (rc == 0) + { + // No activity on the pipe + return ETIME; + } + + return Read( val ); +} + +/*=========================================================================== +METHOD: + Clear (Free Method) + +DESCRIPTION: + Read and discard all values currently in the pipe +===========================================================================*/ +void cEvent::Clear() +{ + DWORD unusedVal; + int rc = 0; + while (rc == 0) + { + rc = Wait( (DWORD)0, unusedVal ); + } +} + + +/*=========================================================================== +METHOD: + Read (Internal Method) + +DESCRIPTION: + Read a DWORD from the pipe + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Read( DWORD & val ) +{ + DWORD tempVal; + PBYTE pRead = (PBYTE)&tempVal; + + int readSize = sizeof( DWORD ); + while (readSize > 0) + { + int bytesRead = read( mPipes[READING], pRead, readSize ); + if (bytesRead <= 0) + { + // Store error from read + int readErr = errno; + if (readErr == 0) + { + // Hard error! This should NEVER happen for a pipe + ASSERT( 0 ); + readErr = EBADF; + } + + // First error? + if (mError == 0) + { + // Yes, store the error + mError = readErr; + } + + // We cannot recover from this error + Close(); + return readErr; + } + + pRead += bytesRead; + readSize -= bytesRead; + } + + val = tempVal; + + return 0; +} \ No newline at end of file diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/Event.h b/gobi-api/Gobi_2011-11-28-1533/Core/Event.h new file mode 100755 index 0000000..65ee8d9 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/Event.h @@ -0,0 +1,117 @@ +/*=========================================================================== +FILE: + Event.h + +DESCRIPTION: + Declaration of cEvent class + +PUBLIC CLASSES AND METHODS: + WaitOnMultipleEvents + cEvent + Functionality to mimic Windows events using UNIX pipes (enhanced + somewhat to allow one to specify a DWORD value to pass through + when signalling the event) + + WARNING: + This class is not designed to be thread safe + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include + +//--------------------------------------------------------------------------- +// Prototype +//--------------------------------------------------------------------------- + +class cEvent; + +/*=========================================================================*/ +// Free methods +/*=========================================================================*/ + +// Wait for any of the events to be set and return the value +int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ); + +/*=========================================================================*/ +// Class cEvent +/*=========================================================================*/ +class cEvent +{ + public: + // Constructor + cEvent(); + + // Destructor + ~cEvent(); + + // Set/signal the event with the specified value + int Set( DWORD val ); + + // Wait for the event to be signalled and return the read in value + int Wait( + DWORD timeoutMS, + DWORD & val ); + + // Read and discard all values currently in the pipe + void Clear(); + + protected: + // Close pipe (used in errors or normal exit) + int Close(); + + // Read from the pipe + int Read( DWORD & val ); + + /* Internal error status */ + int mError; + + /* Internal pipes */ + int mPipes[2]; + + // WaitOnMultipleEvents gets full access + friend int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ); +}; + diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolBuffer.cpp b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolBuffer.cpp new file mode 100755 index 0000000..fa92918 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolBuffer.cpp @@ -0,0 +1,222 @@ +/*=========================================================================== +FILE: + ProtocolBuffer.cpp + +DESCRIPTION: + Generic protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sProtocolBuffer + Simple struct to represent a protocol buffer using a reference counted + (shared) buffer, this allows us to use in in several places without + copying it once in each place. A few base services are provided + but the main purpose is to provide a class to inherit off of for + specific protocols + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolBuffer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sProtocolBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Constructor (default) + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer() + : mpData( 0 ), + mbValid( false ) +{ + // Object is currently invalid + mTimestamp = EMPTY_TIME; +} + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Constructor (parameterized) + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the DIAG data + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer( sSharedBuffer * pBuffer ) + : mpData( 0 ), + mbValid( false ) +{ + mTimestamp = EMPTY_TIME; + + time_t rawtime; + time( &rawtime ); + tm * timestamp = localtime( &rawtime ); + if (timestamp != 0) + { + mTimestamp = *timestamp; + } + + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->Release(); + mpData = 0; + } + + mpData = pBuffer; + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + } + + // NOTE: Derived classes need to call their own validation method + // in their constructors since the override might try to access + // data that is not yet in place + sProtocolBuffer::Validate(); +} + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Copy constructor + +PARAMETERS: + copyThis [ I ] - sProtocolBuffer to base the new one on + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer( const sProtocolBuffer & copyThis ) + : mpData( copyThis.mpData ), + mTimestamp( copyThis.mTimestamp ), + mbValid( copyThis.mbValid ) +{ + // Bump reference count for shared buffer + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + mbValid = false; + } +} + +/*=========================================================================== +METHOD: + operator = (Public Method) + +DESCRIPTION: + Assignment operator + +PARAMETERS: + copyThis [ I ] - sProtocolBuffer to base the new one on + +RETURN VALUE: + sProtocolBuffer & +===========================================================================*/ +sProtocolBuffer & sProtocolBuffer::operator = ( const sProtocolBuffer & copyThis ) +{ + // Do we already have data? + if (mpData != 0) + { + // Is it different than what we are duplicating? + if (mpData != copyThis.mpData) + { + // Yes, release our current buffer + mpData->Release(); + } + } + + mpData = copyThis.mpData; + mTimestamp = copyThis.mTimestamp; + mbValid = copyThis.mbValid; + + // Bump reference count for shared buffer + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + mbValid = false; + } + + return *this; +} + +/*=========================================================================== +METHOD: + ~sProtocolBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::~sProtocolBuffer() +{ + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->Release(); + mpData = 0; + } + else if (mpData != 0) + { + ASSERT( 0 ); + } + + mbValid = false; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolBuffer.h b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolBuffer.h new file mode 100755 index 0000000..4faf115 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolBuffer.h @@ -0,0 +1,162 @@ +/*=========================================================================== +FILE: + ProtocolBuffer.h + +DESCRIPTION: + Generic protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sProtocolBuffer + Simple struct to represent a protocol buffer using a reference counted + (shared) buffer, this allows us to use in in several places without + copying it once in each place. A few base services are provided + but the main purpose is to provide a class to inherit off of for + specific protocols + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "SharedBuffer.h" +#include "ProtocolEnum.h" + +static const tm EMPTY_TIME = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + +/*=========================================================================*/ +// Struct sProtocolBuffer +/*=========================================================================*/ +struct sProtocolBuffer +{ + public: + // Constructor (default) + sProtocolBuffer(); + + // Constructor (parameterized) + sProtocolBuffer( sSharedBuffer * pBuffer ); + + // Copy constructor + sProtocolBuffer( const sProtocolBuffer & copyThis ); + + // Assignment operator + sProtocolBuffer & operator = ( const sProtocolBuffer & copyThis ); + + // Destructor + virtual ~sProtocolBuffer(); + + // (Inline) Get buffer + const BYTE * GetBuffer() const + { + BYTE * pRet = 0; + if (IsValid() == true) + { + pRet = (BYTE *)mpData->GetBuffer(); + } + + return (const BYTE *)pRet; + }; + + // (Inline) Get buffer size + ULONG GetSize() const + { + ULONG size = 0; + if (IsValid() == true) + { + size = mpData->GetSize(); + } + + return size; + }; + + // (Inline) Return the protocol type + eProtocolType GetType() const + { + eProtocolType pt = ePROTOCOL_ENUM_BEGIN; + if (IsValid() == true) + { + pt = (eProtocolType)mpData->GetType(); + } + + return pt; + }; + + // (Inline) Return the shared buffer + sSharedBuffer * GetSharedBuffer() const + { + sSharedBuffer * pRet = 0; + if (IsValid() == true) + { + pRet = mpData; + } + + return pRet; + }; + + // (Inline) Return the timestamp + tm GetTimestamp() const + { + tm ft = EMPTY_TIME; + + if (IsValid() == true) + { + ft = mTimestamp; + } + + return ft; + }; + + // (Inline) Is this buffer valid? + virtual bool IsValid() const + { + return mbValid; + }; + + protected: + // (Inline) Validate buffer + virtual bool Validate() + { + // Do we have a shared buffer and is it valid? + mbValid = (mpData != 0 && mpData->IsValid()); + return mbValid; + }; + + /* Our data buffer */ + sSharedBuffer * mpData; + + /* Time buffer was created */ + tm mTimestamp; + + /* Has this buffer been validated? (NOTE: *NOT* set in base) */ + bool mbValid; +}; diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolEnum.h b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolEnum.h new file mode 100755 index 0000000..44b26e5 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolEnum.h @@ -0,0 +1,236 @@ +/*=========================================================================== +FILE: + ProtocolEnum.h + +DESCRIPTION: + Generic protocol enumerations and related methods + +PUBLIC ENUMERATIONS AND METHODS: + eProtocolType + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// eProtocolType Enumeration +// +// NOTE: QMI protocol types need to be in the same order as eQMIService +// with RX added first then TX +/*=========================================================================*/ +enum eProtocolType +{ + ePROTOCOL_ENUM_BEGIN = -1, + + ePROTOCOL_COMMAND, // 000 Protocol server command + ePROTOCOL_AT, // 001 AT command protocol + ePROTOCOL_NMEA, // 002 NMEA (GPS) protocol + ePROTOCOL_DIAG_RX, // 003 DIAG protocol (incoming) + ePROTOCOL_DIAG_TX, // 004 DIAG protocol (outgoing) + ePROTOCOL_DOWNLOAD_RX, // 005 Download protocol (incoming) + ePROTOCOL_DOWNLOAD_TX, // 006 Download protocol (outgoing) + ePROTOCOL_SDOWNLOAD_RX, // 007 Streaming download protocol (incoming) + ePROTOCOL_SDOWNLOAD_TX, // 008 Streaming download protocol (outgoing) + ePROTOCOL_QDL_RX, // 009 QDL streaming protocol (incoming) + ePROTOCOL_QDL_TX, // 010 QDL streaming protocol (outgoing) + + ePROTOCOL_QMI_CTL_RX = 60, // 060 QMI CTL protocol (incoming) + ePROTOCOL_QMI_CTL_TX, // 061 QMI CTL protocol (outgoing) + ePROTOCOL_QMI_WDS_RX, // 062 QMI WDS protocol (incoming) + ePROTOCOL_QMI_WDS_TX, // 063 QMI WDS protocol (outgoing) + ePROTOCOL_QMI_DMS_RX, // 064 QMI DMS protocol (incoming) + ePROTOCOL_QMI_DMS_TX, // 065 QMI DMS protocol (outgoing) + ePROTOCOL_QMI_NAS_RX, // 066 QMI NAS protocol (incoming) + ePROTOCOL_QMI_NAS_TX, // 067 QMI NAS protocol (outgoing) + ePROTOCOL_QMI_QOS_RX, // 068 QMI QOS protocol (incoming) + ePROTOCOL_QMI_QOS_TX, // 069 QMI QOS protocol (outgoing) + ePROTOCOL_QMI_WMS_RX, // 070 QMI WMS protocol (incoming) + ePROTOCOL_QMI_WMS_TX, // 071 QMI WMS protocol (outgoing) + ePROTOCOL_QMI_PDS_RX, // 072 QMI PDS protocol (incoming) + ePROTOCOL_QMI_PDS_TX, // 073 QMI PDS protocol (outgoing) + ePROTOCOL_QMI_AUTH_RX, // 074 QMI AUTH protocol (incoming) + ePROTOCOL_QMI_AUTH_TX, // 075 QMI AUTH protocol (outgoing) + ePROTOCOL_QMI_AT_RX, // 076 QMI AUTH protocol (incoming) + ePROTOCOL_QMI_AT_TX, // 077 QMI AUTH protocol (outgoing) + ePROTOCOL_QMI_VOICE_RX, // 078 QMI Voice protocol (incoming) + ePROTOCOL_QMI_VOICE_TX, // 079 QMI Voice protocol (outgoing) + ePROTOCOL_QMI_CAT2_RX, // 080 QMI CAT (new) protocol (incoming) + ePROTOCOL_QMI_CAT2_TX, // 081 QMI CAT (new) protocol (outgoing) + ePROTOCOL_QMI_UIM_RX, // 082 QMI UIM protocol (incoming) + ePROTOCOL_QMI_UIM_TX, // 083 QMI UIM protocol (outgoing) + ePROTOCOL_QMI_PBM_RX, // 084 QMI PBM protocol (incoming) + ePROTOCOL_QMI_PBM_TX, // 085 QMI PBM protocol (outgoing) + ePROTOCOL_QMI_13_RX, // 086 QMI service ID 13 protocol (incoming) + ePROTOCOL_QMI_13_TX, // 087 QMI service ID 13 protocol (outgoing) + ePROTOCOL_QMI_14_RX, // 088 QMI service ID 14 protocol (incoming) + ePROTOCOL_QMI_14_TX, // 089 QMI service ID 14 protocol (outgoing) + ePROTOCOL_QMI_15_RX, // 090 QMI service ID 15 protocol (incoming) + ePROTOCOL_QMI_15_TX, // 091 QMI service ID 15 protocol (outgoing) + ePROTOCOL_QMI_LOC_RX, // 092 QMI UIM protocol (incoming) + ePROTOCOL_QMI_LOC_TX, // 093 QMI UIM protocol (outgoing) + ePROTOCOL_QMI_SAR_RX, // 094 QMI PBM protocol (incoming) + ePROTOCOL_QMI_SAR_TX, // 095 QMI PBM protocol (outgoing) + ePROTOCOL_QMI_18_RX, // 096 QMI service ID 18 protocol (incoming) + ePROTOCOL_QMI_18_TX, // 097 QMI service ID 18 protocol (outgoing) + ePROTOCOL_QMI_19_RX, // 098 QMI service ID 19 protocol (incoming) + ePROTOCOL_QMI_19_TX, // 099 QMI service ID 19 protocol (outgoing) + ePROTOCOL_QMI_RMTFS_RX, // 100 QMI RMTFS protocol (incoming) + ePROTOCOL_QMI_RMTFS_TX, // 101 QMI RMTFS protocol (outgoing) + ePROTOCOL_QMI_21_RX, // 102 QMI service ID 21 protocol (incoming) + ePROTOCOL_QMI_21_TX, // 103 QMI service ID 21 protocol (outgoing) + ePROTOCOL_QMI_22_RX, // 104 QMI service ID 22 protocol (incoming) + ePROTOCOL_QMI_22_TX, // 105 QMI service ID 22 protocol (outgoing) + ePROTOCOL_QMI_23_RX, // 106 QMI service ID 23 protocol (incoming) + ePROTOCOL_QMI_23_TX, // 107 QMI service ID 23 protocol (outgoing) + ePROTOCOL_QMI_24_RX, // 108 QMI service ID 24 protocol (incoming) + ePROTOCOL_QMI_24_TX, // 109 QMI service ID 24 protocol (outgoing) + + ePROTOCOL_QMI_CAT_RX = 508, // 508 QMI CAT protocol (incoming) + ePROTOCOL_QMI_CAT_TX, // 509 QMI CAT protocol (outgoing) + ePROTOCOL_QMI_RMS_RX, // 510 QMI RMS protocol (incoming) + ePROTOCOL_QMI_RMS_TX, // 511 QMI RMS protocol (outgoing) + ePROTOCOL_QMI_OMA_RX, // 512 QMI OMA protocol (incoming) + ePROTOCOL_QMI_OMA_TX, // 513 QMI OMA protocol (outgoing) + + ePROTOCOL_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eProtocolType validity check + +PARAMETERS: + pt [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eProtocolType pt ) +{ + bool retVal = false; + if ( (pt > ePROTOCOL_ENUM_BEGIN && pt <= ePROTOCOL_QDL_TX) + || (pt >= ePROTOCOL_QMI_CTL_RX && pt <= ePROTOCOL_QMI_24_TX) + || (pt >= ePROTOCOL_QMI_CAT_RX && pt < ePROTOCOL_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocol (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocol( eProtocolType pt ) +{ + bool retVal = false; + if ( (pt >= ePROTOCOL_QMI_CTL_RX && pt <= ePROTOCOL_QMI_24_TX) + || (pt >= ePROTOCOL_QMI_CAT_RX && pt < ePROTOCOL_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocolRX (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol and if so in the + incoming direction? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocolRX( eProtocolType pt ) +{ + bool retVal = false; + + // QMI protocol values that are even are RX + if ( (IsQMIProtocol( pt ) == true) + && ((DWORD)pt % 2 == 0) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocolTX (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol and if so in the + outgoing direction? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocolTX( eProtocolType pt ) +{ + bool retVal = false; + + // QMI protocol values that are odd are TX + if ( (IsQMIProtocol( pt ) == true) + && ((DWORD)pt % 2 == 1) ) + { + retVal = true; + } + + return retVal; +}; diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolLog.cpp b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolLog.cpp new file mode 100755 index 0000000..3f06639 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolLog.cpp @@ -0,0 +1,190 @@ +/*=========================================================================== +FILE: + ProtocolLog.h + +DESCRIPTION: + Simple protocol 'log' class definition + +PUBLIC CLASSES AND METHODS: + cProtocolLog + This class stores protocol buffers in to a flat array (actually a + double-ended queue) so that they can be accessed by other objects + during the flow of normal processing. Note that the storage is + in-memory and therefore finite + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolLog.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// The maximum number of in-memory buffers we allow +const ULONG MAX_PROTOCOL_BUFFERS = 1024 * 16; + +/*=========================================================================*/ +// cProtocolLog Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolLog (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + maxBuffers [ I ] - Maximum number of buffers to store in the log + +RETURN VALUE: + None +===========================================================================*/ +cProtocolLog::cProtocolLog( ULONG maxBuffers ) + : mLog( maxBuffers > MAX_PROTOCOL_BUFFERS ? MAX_PROTOCOL_BUFFERS : maxBuffers, + true ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cProtocolLog (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cProtocolLog::~cProtocolLog() +{ + // Empty out the log + Clear(); +} + +/*=========================================================================== +METHOD: + AddBuffer (Public Method) + +DESCRIPTION: + Add an protocol buffer to the end of the log + +PARAMETERS: + buff [ I ] - Protocol buffer to add + +RETURN VALUE: + ULONG - Index of newly added buffer (INVALID_LOG_INDEX upon failure) +===========================================================================*/ +ULONG cProtocolLog::AddBuffer( sProtocolBuffer & buf ) +{ + ULONG idx = INVALID_LOG_INDEX; + if (buf.IsValid() == false) + { + return idx; + } + + bool bRC = mLog.AddElement( buf, idx ); + if (bRC == false) + { + idx = INVALID_LOG_INDEX; + } + + return idx; +} + +/*=========================================================================== +METHOD: + GetBuffer (Public Method) + +DESCRIPTION: + Return the protocol buffer at the given index from the log + +PARAMETERS: + idx [ I ] - Index of protocol buffer to obtain + +RETURN VALUE: + sProtocolBuffer - Protocol buffer +===========================================================================*/ +sProtocolBuffer cProtocolLog::GetBuffer( ULONG idx ) const +{ + sProtocolBuffer buf; + mLog.GetElement( idx, buf ); + return buf; +} + +/*=========================================================================== +METHOD: + GetSignalEvent (Public Method) + +DESCRIPTION: + Return the underlying signal event, which will be set when + the log is updated. + +RETURN VALUE: + cEvent - Signal event +===========================================================================*/ +cEvent & cProtocolLog::GetSignalEvent() const +{ + return mLog.GetSignalEvent(); +} + +/*=========================================================================== +METHOD: + GetCount (Public Method) + +DESCRIPTION: + Return the total number of buffers added to the log + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cProtocolLog::GetCount() const +{ + return mLog.GetTotalCount(); +} + +/*=========================================================================== +METHOD: + Clear (Public Method) + +DESCRIPTION: + Clear the log + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolLog::Clear() +{ + mLog.EmptyQueue(); +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolLog.h b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolLog.h new file mode 100755 index 0000000..99aab76 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolLog.h @@ -0,0 +1,91 @@ +/*=========================================================================== +FILE: + ProtocolLog.h + +DESCRIPTION: + Simple protocol 'log' class declaration + +PUBLIC CLASSES AND METHODS: + cProtocolLog + This class stores protocol buffers in to a flat array (actually a + double-ended queue) so that they can be accessed by other objects + during the flow of normal processing. Note that the storage is + in-memory and therefore finite + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "SyncQueue.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +const ULONG INVALID_LOG_INDEX = ULONG_MAX; + +/*=========================================================================*/ +// Class cProtocolLog +/*=========================================================================*/ +class cProtocolLog +{ + public: + // Constructor + cProtocolLog( ULONG maxBuffers ); + + // Destructor + virtual ~cProtocolLog(); + + // Add an protocol buffer to the end of the log + virtual ULONG AddBuffer( sProtocolBuffer & buf ); + + // Return the protocol buffer at the given index from the log + virtual sProtocolBuffer GetBuffer( ULONG idx ) const; + + // Return the underlying signal event + virtual cEvent & GetSignalEvent() const; + + // Return the total number of buffers added to the log + virtual ULONG GetCount() const; + + // Clear the log + virtual void Clear(); + + protected: + /* The underlying 'log' */ + cSyncQueue mLog; +}; diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolNotification.cpp b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolNotification.cpp new file mode 100755 index 0000000..55ebace --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolNotification.cpp @@ -0,0 +1,171 @@ +/*=========================================================================== +FILE: + ProtocolNotification.cpp + +DESCRIPTION: + Implementation of cProtocolNotification base class and derivations + +PUBLIC CLASSES AND METHODS: + sProtocolNotificationEvent + Generic protocol event notification structure + + cProtocolNotification + This abstract base class provides notification of protocol server + events sent from the protocol server to protocol server clients + + cProtocolQueueNotification + This class provides notification via a cSyncQueue object + populated with sProtocolNotificationEvent objects + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolNotification.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cProtocolQueueNotification Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pSQ [ I ] - Sync queue to utilize + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::cProtocolQueueNotification( + cSyncQueue * pSQ ) + : mpSQ( pSQ ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Copy constructor + +PARAMETERS: + notifier [ I ] - Notifier to base the new one on + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::cProtocolQueueNotification( + const cProtocolQueueNotification & notifier ) + : mpSQ( notifier.mpSQ ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::~cProtocolQueueNotification() +{ + mpSQ = 0; +} + +/*=========================================================================== +METHOD: + Clone (Public Method) + +DESCRIPTION: + Return an allocated copy of this object downcasted to our base class + +RETURN VALUE: + cProtocolNotification * : Cloned object (0 on error) +===========================================================================*/ +cProtocolNotification * cProtocolQueueNotification::Clone() const +{ + cProtocolQueueNotification * pCopy = 0; + + try + { + pCopy = new cProtocolQueueNotification( *this ); + } + catch (...) + { + // Simply return 0 + } + + return ((cProtocolNotification *)pCopy); +} + +/*=========================================================================== +METHOD: + Notify (Public Method) + +DESCRIPTION: + Notify view of a protocol event by adding notification structure to + the underlying sync queue (which will provide the notification + by signalling an event) + +PARAMETERS: + eventType [ I ] - Protocol event type + param1 [ I ] - Event type specific argument (see header description) + param2 [ I ] - Event type specific argument (see header description) + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolQueueNotification::Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const +{ + sProtocolNotificationEvent evt( eventType, param1, param2 ); + if (evt.IsValid() == true && mpSQ != 0 && mpSQ->IsValid() == true) + { + sProtocolNotificationEvent elem( eventType, param1, param2 ); + mpSQ->AddElement( elem ); + } +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolNotification.h b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolNotification.h new file mode 100755 index 0000000..d941d99 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolNotification.h @@ -0,0 +1,237 @@ +/*=========================================================================== +FILE: + ProtocolNotification.h + +DESCRIPTION: + Declaration of cProtocolNotification base class and derivations + +PUBLIC CLASSES AND METHODS: + sProtocolNotificationEvent + Generic protocol event notification structure + + cProtocolNotification + This abstract base class provides notification of protocol server + events sent from the protocol server to protocol server clients + + cProtocolQueueNotification + This class provides notification via a cSyncQueue object + populated with sProtocolNotificationEvent objects + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "SyncQueue.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +enum eProtocolEventType +{ + ePROTOCOL_EVT_BEGIN = -1, + + ePROTOCOL_EVT_REQ_ERR, // There was an error sending the request + ePROTOCOL_EVT_REQ_SENT, // The request has been sent + + ePROTOCOL_EVT_RSP_ERR, // There was an error receiving the response + ePROTOCOL_EVT_RSP_RECV, // The response has been received + + ePROTOCOL_EVT_AUX_TU_SENT, // Auxiliary data transmission unit sent + + ePROTOCOL_EVT_END +}; + +// NOTE: The arguments for each event are currently as follows: +// +// ePROTOCOL_EVT_REQ_ERR +// param1: Request ID +// param2: Error code +// +// ePROTOCOL_EVT_REQ_SENT +// param1: Request ID +// param2: Index of request buffer in associated protocol log + +// ePROTOCOL_EVT_RSP_ERR +// param1: Request ID +// param2: Error code +// +// ePROTOCOL_EVT_RSP_RECV +// param1: Request ID +// param2: Index of response buffer in associated protocol log +// +// ePROTOCOL_EVT_AUX_TU_SENT +// param1: Request ID +// param2: Size of transmission unit + +// NOTE: To handle protoocl events using the Windows notifier add the following +// prototype to your Window class header file: +// +// afx_msg LRESULT OnProtocolEvent( +// WPARAM wParam, +// LPARAM lParam ); +// +// Then add an entry to the message map in your Window class source file: +// +// BEGIN_MESSAGE_MAP( CView, CChildView ) +// ON_MESSAGE( PROTOCOL_WM_BASE + (ULONG)ePROTOCOL_EVT_XXX, OnProtocolEvent ) +// END_MESSAGE_MAP() +// +// Finally write the handler itself: +// +// LRESULT CView::OnProtocolEvent( +// WPARAM wParam, +// LPARAM lParam ) +// { +// Do something +// return 0; +// } + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eProtocolEventType validity check + +PARAMETERS: + evtType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eProtocolEventType evtType ) +{ + bool bRC = false; + if (evtType > ePROTOCOL_EVT_BEGIN && evtType < ePROTOCOL_EVT_END) + { + bRC = true; + } + + return bRC; +}; + +/*=========================================================================*/ +// Struct sProtocolNotificationEvent +/*=========================================================================*/ +struct sProtocolNotificationEvent +{ + public: + // (Inline) Default constructor (results in invalid object) + sProtocolNotificationEvent() + : mEventType( ePROTOCOL_EVT_BEGIN ), + mParam1( 0 ), + mParam2( 0 ) + { + // Nothing to do + }; + + // (Inline) Parameter constructor + sProtocolNotificationEvent( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) + : mEventType( eventType ), + mParam1( param1 ), + mParam2( param2 ) + { + // Nothing to do + }; + + // (Inline) Is this object valid? + bool IsValid() + { + return ::IsValid( mEventType ); + } + + /* Event type */ + eProtocolEventType mEventType; + + /* First parameter (see above) */ + DWORD mParam1; + + /* Second parameter (see above) */ + DWORD mParam2; +}; + +/*=========================================================================*/ +// Class cProtocolNotification +// +// This abstract base class provides notification of protocol server +// events sent from the protocol server to protocol server clients +/*=========================================================================*/ +class cProtocolNotification +{ + public: + // Return an allocated copy of this object + virtual cProtocolNotification * Clone() const = 0; + + // Notify view of a protocol event + virtual void Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const = 0; +}; + +/*=========================================================================*/ +// Class cProtocolQueueNotification +// +// This class provides notification via a cSyncQueue object +// populated with sProtocolNotificationEvent objects +/*=========================================================================*/ +class cProtocolQueueNotification : public cProtocolNotification +{ + public: + // Constructor + cProtocolQueueNotification( cSyncQueue * pSQ ); + + // Copy constructor + cProtocolQueueNotification( const cProtocolQueueNotification & notifier ); + + // Destructor + virtual ~cProtocolQueueNotification(); + + // Return a copy of this object + virtual cProtocolNotification * Clone() const; + + // Notify view of a MIS event + virtual void Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const; + + protected: + /* Event notification queue */ + mutable cSyncQueue * mpSQ; +}; diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolRequest.cpp b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolRequest.cpp new file mode 100755 index 0000000..de1f6ba --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolRequest.cpp @@ -0,0 +1,254 @@ +/*=========================================================================== +FILE: + ProtocolRequest.cpp + +DESCRIPTION: + Generic protocol request/command related structures and + affliated methods, these structures are used by clients of + the protocol server to specify outgoing requests + +PUBLIC CLASSES AND METHODS: + sProtocolRequest + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" + +#include "ProtocolRequest.h" +#include "ProtocolNotification.h" +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default protocol request timeout +const ULONG DEFAULT_REQ_TIMEOUT = 1000; + +// Minimum and maximum allowable timeout values (in milliseconds) +const ULONG MIN_REQ_TIMEOUT = 100; +const ULONG MAX_REQ_TIMEOUT = 300000; + +// Minimum number of attempts a request can be scheduled for +const ULONG MIN_REQ_ATTEMPTS = 1; + +// Value to indicate that a request is to be sent out indefinately +const ULONG INFINITE_REQS = 0xFFFFFFFF; + +// Minimum/default amount of time between repeated requests (in milliseconds) +const ULONG MIN_REQ_FREQUENCY = 10; +const ULONG DEFAULT_REQ_FREQUENCY = 100; + +/*=========================================================================*/ +// sProtocolRequest Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Parameterized constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer representing the request (must be + valid) + + schedule [ I ] - When (from now, in milliseconds) to send the first + request, this isn't a hard value as the request is + only guaranteed to go out after this time elapses + + timeout [ I ] - Milliseconds to wait for a response to an individual + request before declaring a timeout. Regardless of + what is passed in the timeout value used will be + between MIN/MAX_REQ_TIMEOUT + + requests [ I ] - Number of request attempts to make, this isn't a + retry count rather this value is used to specify + repeating requests. Regardless of what is passed in + the requests value used will be at least + MIN_REQ_ATTEMPTS + + frequency [ I ] - If the 'requests' value is greater than the + MIN_REQ_ATTEMPTS than this represents the amount of + time to wait between requests (from the completion of + the last request attempt, in milliseconds), again this + isn't a hard value. Regardless of what is passed in + the frequency value used will be at least + MIN_REQ_FREQUENCY + + pNotifier [ I ] - Status notification mechanism (may be 0) + + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( + sSharedBuffer * pBuffer, + ULONG schedule, + ULONG timeout, + ULONG requests, + ULONG frequency, + cProtocolNotification * pNotifier ) + : sProtocolBuffer( pBuffer ), + mSchedule( schedule ), + mTimeout( DEFAULT_REQ_TIMEOUT ), + mRequests( MIN_REQ_ATTEMPTS ), + mFrequency( DEFAULT_REQ_FREQUENCY ), + mpNotifier( 0 ), + mpAuxData( 0 ), + mAuxDataSize( 0 ), + mbTXOnly( false ) +{ + // Constrain requested timeout to allowable range + if (timeout < MIN_REQ_TIMEOUT) + { + timeout = MIN_REQ_TIMEOUT; + } + + if (timeout > MAX_REQ_TIMEOUT) + { + timeout = MAX_REQ_TIMEOUT; + } + + mTimeout = timeout; + + // Constrain request attempts + if (requests >= MIN_REQ_ATTEMPTS) + { + mRequests = requests; + } + + // Constrain frequency + if (frequency >= MIN_REQ_FREQUENCY) + { + mFrequency = frequency; + } + + // Clone notifier? + if (pNotifier != 0) + { + mpNotifier = pNotifier->Clone(); + } +} + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Parameterized constructor (notification with defaults) + +PARAMETERS: + pBuffer [ I ] - Shareable buffer representing the request (must be + valid) + + pNotifier [ I ] - Status notification mechanism (may be 0) + + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( + sSharedBuffer * pBuffer, + cProtocolNotification * pNotifier ) + : sProtocolBuffer( pBuffer ), + mSchedule( 0 ), + mTimeout( DEFAULT_REQ_TIMEOUT ), + mRequests( MIN_REQ_ATTEMPTS ), + mFrequency( DEFAULT_REQ_FREQUENCY ), + mpNotifier( pNotifier ), + mpAuxData( 0 ), + mAuxDataSize( 0 ), + mbTXOnly( false ) +{ + // Clone notifier? + if (pNotifier != 0) + { + mpNotifier = pNotifier->Clone(); + } + + Validate(); +} + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Copy constructor + +PARAMETERS: + req [ I ] - Request to copy + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( const sProtocolRequest & req ) + : sProtocolBuffer( req ), + mSchedule( req.mSchedule ), + mTimeout( req.mTimeout ), + mRequests( req.mRequests ), + mFrequency( req.mFrequency ), + mpNotifier( 0 ), + mpAuxData( req.mpAuxData ), + mAuxDataSize( req.mAuxDataSize ), + mbTXOnly( req.mbTXOnly ) +{ + // Clone notifier? + if (req.mpNotifier != 0) + { + mpNotifier = req.mpNotifier->Clone(); + } + + Validate(); +} + +/*=========================================================================== +METHOD: + ~sProtocolRequest + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::~sProtocolRequest() +{ + // Delete cloned notifier? + if (mpNotifier != 0) + { + delete mpNotifier; + mpNotifier = 0; + } +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolRequest.h b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolRequest.h new file mode 100755 index 0000000..c710e3a --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolRequest.h @@ -0,0 +1,193 @@ +/*=========================================================================== +FILE: + ProtocolRequest.h + +DESCRIPTION: + Generic protocol request/command related structures and + affliated methods, these structures are used by clients of + the protocol server to specify outgoing protocol requests + +PUBLIC CLASSES AND METHODS: + sProtocolRequest + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +class cProtocolNotification; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default protocol request timeout +extern const ULONG DEFAULT_REQ_TIMEOUT; + +// Minimum and maximum allowable timeout values (in milliseconds) +extern const ULONG MIN_REQ_TIMEOUT; +extern const ULONG MAX_REQ_TIMEOUT; + +// Minimum number of attempts a request can be scheduled for +extern const ULONG MIN_REQ_ATTEMPTS; + +// Value to indicate that a request is to be sent out indefinately +extern const ULONG INFINITE_REQS; + +// Minimum/default amount of time between repeated requests (in milliseconds) +extern const ULONG MIN_REQ_FREQUENCY; +extern const ULONG DEFAULT_REQ_FREQUENCY; + +/*=========================================================================*/ +// Struct sProtocolRequest +// +// Structure to represent a generic request packet, including all the +// information needed to schedule the request, send the request, and +// (optionally) reschedule the request for another TX/RX attempt +// +// The default parameters schedule an immediate request (indicated by +// passing in '0' for the schedule parameter) to be sent once with +// the default timeout value +/*=========================================================================*/ +struct sProtocolRequest : public sProtocolBuffer +{ + public: + // Parameterized constructor + sProtocolRequest( + sSharedBuffer * pBuffer, + ULONG schedule = 0, + ULONG timeout = DEFAULT_REQ_TIMEOUT, + ULONG requests = MIN_REQ_ATTEMPTS, + ULONG frequency = DEFAULT_REQ_FREQUENCY, + cProtocolNotification * pNotifier = 0 ); + + // Parameterized constructor (notification with defaults) + sProtocolRequest( + sSharedBuffer * pBuffer, + cProtocolNotification * pNotifier ); + + // Copy constructor + sProtocolRequest( const sProtocolRequest & req ); + + // Destructor + virtual ~sProtocolRequest(); + + // (Inline) Get schedule value (value is in milliseconds) + ULONG GetSchedule() const + { + return mSchedule; + }; + + // (Inline) Get timeout value + ULONG GetTimeout() const + { + return mTimeout; + }; + + // (Inline) Get requests value + ULONG GetRequests() const + { + return mRequests; + }; + + // (Inline) Get frequency value (value is in milliseconds) + ULONG GetFrequency() const + { + return mFrequency; + }; + + const cProtocolNotification * GetNotifier() const + { + return mpNotifier; + }; + + // (Inline) Set auxiliary data + void SetAuxiliaryData( + const BYTE * pData, + ULONG dataSz ) + { + mpAuxData = pData; + mAuxDataSize = dataSz; + }; + + // (Inline) Get auxiliary data + const BYTE * GetAuxiliaryData( ULONG & dataSz ) const + { + dataSz = mAuxDataSize; + return mpAuxData; + }; + + // (Inline) Set TX only flag + void SetTXOnly() + { + mbTXOnly = true; + }; + + // (Inline) Get TX only flag + bool IsTXOnly() const + { + return mbTXOnly; + }; + + protected: + /* Schedule (approximately when to send the initial request) */ + ULONG mSchedule; + + /* Timeout value for receiving a response */ + ULONG mTimeout; + + /* Number of requests to schedule (must be at least one) */ + ULONG mRequests; + + /* Frequency (approximately how long to wait before next request) */ + ULONG mFrequency; + + /* Notification object */ + cProtocolNotification * mpNotifier; + + /* Auxiliary data */ + const BYTE * mpAuxData; + + /* Auxilary data size */ + ULONG mAuxDataSize; + + /* TX only (i.e. do not wait for a response) ? */ + bool mbTXOnly; +}; + diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolServer.cpp b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolServer.cpp new file mode 100755 index 0000000..e7605f4 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolServer.cpp @@ -0,0 +1,1728 @@ +/*=========================================================================== +FILE: + ProtocolServer.cpp + +DESCRIPTION: + Generic protocol packet server + +PUBLIC CLASSES AND METHODS: + cProtocolServer + Abstract base class for protocol servers + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" + +#include "ProtocolServer.h" +#include "ProtocolNotification.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid request ID +const ULONG INVALID_REQUEST_ID = 0; + +// Default activity timeout value +const ULONG DEFAULT_WAIT = 100; + +// MTU (Maximum Transmission Unit) for auxiliary data (QC USB imposed) +const ULONG MAX_AUX_MTU_SIZE = 1024 * 256; + +// USB's MaxPacketSize +const ULONG MAX_PACKET_SIZE = 512; + +// Maximum amount of time to wait on external access synchronization object +#ifdef DEBUG + // For the sake of debugging do not be so quick to assume failure + const ULONG DEADLOCK_TIME = 180000; +#else + const ULONG DEADLOCK_TIME = 10000; +#endif + +// Maximum amount of time to wait for the protocol server to process a command +const ULONG COMMAND_TIME = DEADLOCK_TIME; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + ScheduleThread (Free Method) + +DESCRIPTION: + Watch schedule for event to process or timeout + +PARAMETERS: + pArg [ I ] - The protocol server object + +RETURN VALUE: + void * - thread exit value (always NULL) +===========================================================================*/ +void * ScheduleThread( PVOID pArg ) +{ + // Do we have a server? + cProtocolServer * pServer = (cProtocolServer *)pArg; + if (pServer == 0) + { + TRACE( "ScheduleThread started with empty pArg." + " Unable to locate cProtocolServer\n" ); + + ASSERT( 0 ); + return NULL; + } + + TRACE( "Schedule thread [%lu] started\n", + pthread_self() ); + + // Default wait event + timespec toTime = TimeIn( DEFAULT_WAIT ); + + // Return value checking + int nRet; + + while (pServer->mbExiting == false) + { + DWORD nTemp; + nRet = pServer->mThreadScheduleEvent.Wait( TimeFromNow( toTime ), nTemp ); + if (nRet != 0 && nRet != ETIME) + { + // Error condition + TRACE( "ScheduleThread [%lu] ScheduleThread wait error %d, %s\n", + pthread_self(), + nRet, + strerror( nRet ) ); + break; + } + + // Time to exit? + if (pServer->mbExiting == true) + { + break; + } + + // Get Schedule Mutex (non-blocking) + nRet = pthread_mutex_trylock( &pServer->mScheduleMutex ); + if (nRet == EBUSY) + { + // Not an error, we're just too slow + // Someone else got to the ScheduleMutex before us + // We'll wait for the signal again + toTime = TimeIn( DEFAULT_WAIT ); + TRACE( "ScheduleThread [%lu] unable to lock ScheduleMutex\n", + pthread_self() ); + continue; + } + else if (nRet != 0) + { + // Error condition + TRACE( "ScheduleThread [%lu] mScheduleMutex error %d, %s\n", + pthread_self(), + nRet, + strerror( nRet ) ); + break; + } + + // Verify time. In the rare event it does move backward + // it would simply place all our schedule items as due now + pServer->CheckSystemTime(); + + // Default next wait period + toTime = TimeIn( DEFAULT_WAIT ); + + timespec curTime = TimeIn( 0 ); + + if (pServer->mpActiveRequest != 0) + { + if (pServer->mpActiveRequest->mbWaitingForResponse == true) + { + // Waiting on a response, this takes priority over the next + // scheduled event + + // Has timeout expired? + if (pServer->mActiveRequestTimeout <= curTime) + { + // Response timeout + + // Note: This may clear mpActiveRequest + pServer->RxTimeout(); + } + else + { + // Active response timer is not yet due to expire + // Default timeout again, or this response's timeout? + if (pServer->mActiveRequestTimeout <= toTime) + { + toTime = pServer->mActiveRequestTimeout; + } + } + } + else + { + // This should never happen + + TRACE( "ScheduleThread() Sequencing error: " + "Active request %lu is not waiting for response ???\n", + pServer->mpActiveRequest->mID ); + + break; + } + } + + if (pServer->mpActiveRequest == 0 + && pServer->mRequestSchedule.size() > 0) + { + // No response timer active, ready to start the next + // scheduled item if due + + timespec scheduledItem = pServer->GetNextRequestTime(); + + // Is item due to be scheduled? + if (scheduledItem <= curTime) + { + // Process scheduled item + pServer->ProcessRequest(); + } + else + { + // Scheduled item is not yet due to be processed + // Default timeout again, or this item's start time? + if (scheduledItem <= toTime) + { + toTime = scheduledItem; + } + } + } + + /*TRACE( "Updated timer at %llu waiting %lu\n", + GetTickCount(), + TimeFromNow( toTime ) ); */ + + // Unlock schedule mutex + nRet = pthread_mutex_unlock( &pServer->mScheduleMutex ); + if (nRet != 0) + { + TRACE( "ScheduleThread Unable to unlock schedule mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + } + + TRACE( "Schedule thread [%lu] exited\n", + pthread_self() ); + + return NULL; +} + +/*=========================================================================== +METHOD: + TimeIn (Free Method) + +DESCRIPTION: + Fill timespec with the time it will be in specified milliseconds + Relative time to Absolute time + +PARAMETERS: + millis [ I ] - Milliseconds from current time + +RETURN VALUE: + timespec - resulting time (from epoc) + NOTE: tv_sec of 0 is an error +===========================================================================*/ +timespec TimeIn( ULONG millis ) +{ + timespec outTime; + + int nRC = clock_gettime( CLOCK_REALTIME, &outTime ); + if (nRC == 0) + { + // Add avoiding an overflow on (long)nsec + outTime.tv_sec += millis / 1000l; + outTime.tv_nsec += ( millis % 1000l ) * 1000000l; + + // Check if we need to carry + if (outTime.tv_nsec >= 1000000000l) + { + outTime.tv_sec += outTime.tv_nsec / 1000000000l; + outTime.tv_nsec = outTime.tv_nsec % 1000000000l; + } + } + else + { + outTime.tv_sec = 0; + outTime.tv_nsec = 0; + } + + return outTime; +} + +/*=========================================================================== +METHOD: + TimeFromNow (Free Method) + +DESCRIPTION: + Find the milliseconds from current time this timespec will occur + Absolute time to Relative time + +PARAMETERS: + time [ I ] - Absolute time + +RETURN VALUE: + Milliseconds in which absolute time will occur + 0 if time has passed or error has occured +===========================================================================*/ +ULONG TimeFromNow( timespec time ) +{ + // Assume failure + ULONG nOutTime = 0; + + timespec now; + int nRC = clock_gettime( CLOCK_REALTIME, &now ); + if (nRC == -1) + { + TRACE( "Error %d with gettime, %s\n", errno, strerror( errno ) ); + return nOutTime; + } + + if (time <= now) + { + return nOutTime; + } + + nOutTime = (time.tv_sec - now.tv_sec) * 1000l; + nOutTime += (time.tv_nsec - now.tv_nsec) / 1000000l; + + return nOutTime; +} + +/*=========================================================================== +METHOD: + GetTickCount (Free Method) + +DESCRIPTION: + Provide a number for sequencing reference, similar to the windows + ::GetTickCount(). + + NOTE: This number is based on the time since epoc, not + uptime. + +PARAMETERS: + +RETURN VALUE: + ULONGLONG - Number of milliseconds system has been up +===========================================================================*/ +ULONGLONG GetTickCount() +{ + timespec curtime = TimeIn( 0 ); + + ULONGLONG outtime = curtime.tv_sec * 1000LL; + outtime += curtime.tv_nsec / 1000000LL; + + return outtime; +} + +/*=========================================================================*/ +// cProtocolServerRxCallback Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + IOComplete (Free Method) + +DESCRIPTION: + The I/O has been completed, process the results + +PARAMETERS: + status [ I ] - Status of operation + bytesReceived [ I ] - Bytes received during operation + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServerRxCallback::IOComplete( + DWORD status, + DWORD bytesReceived ) +{ + if (mpServer != 0) + { + mpServer->RxComplete( status, bytesReceived ); + } +} + +/*=========================================================================*/ +// cProtocolServer::sProtocolReqRsp Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolServer::sProtocolReqRsp (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + requestInfo [ I ] - Underlying request object + requestID [ I ] - Request ID + auxDataMTU [ I ] - MTU (Maximum Transmission Unit) for auxiliary data + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::sProtocolReqRsp::sProtocolReqRsp( + const sProtocolRequest & requestInfo, + ULONG requestID, + ULONG auxDataMTU ) + : mRequest( requestInfo ), + mID( requestID ), + mAttempts( 0 ), + mEncodedSize( requestInfo.GetSize() ), + mRequiredAuxTxs( 0 ), + mCurrentAuxTx( 0 ), + mbWaitingForResponse( false ) +{ + ULONG auxDataSz = 0; + const BYTE * pAuxData = requestInfo.GetAuxiliaryData( auxDataSz ); + + // Compute the number of required auxiliary data transmissions? + if (auxDataMTU > 0 && pAuxData != 0 && auxDataSz > 0) + { + mRequiredAuxTxs = 1; + if (auxDataSz > auxDataMTU) + { + mRequiredAuxTxs = auxDataSz / auxDataMTU; + if ((auxDataSz % auxDataMTU) != 0) + { + mRequiredAuxTxs++; + } + } + } +} + +/*=========================================================================== +METHOD: + cProtocolServer::sProtocolReqRsp (Public Method) + +DESCRIPTION: + Coop constructor + +PARAMETERS: + reqRsp [ I ] - Object being copied + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::sProtocolReqRsp::sProtocolReqRsp( + const sProtocolReqRsp & reqRsp ) + : mRequest( reqRsp.mRequest ), + mID( reqRsp.mID ), + mAttempts( reqRsp.mAttempts ), + mEncodedSize( reqRsp.mEncodedSize ), + mRequiredAuxTxs( reqRsp.mRequiredAuxTxs ), + mCurrentAuxTx( reqRsp.mCurrentAuxTx ), + mbWaitingForResponse( reqRsp.mbWaitingForResponse ) +{ + // Nothing to do +}; + +/*=========================================================================*/ +// cProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + rxType [ I ] - Protocol type to assign to incoming data + txType [ I ] - Protocol type to verify for outgoing data + bufferSzRx [ I ] - Size of data buffer for incoming data + logSz [ I ] - Size of log (number of buffers) + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::cProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ) + : mComm(), + mRxCallback(), + mScheduleThreadID( 0 ), + mThreadScheduleEvent(), + mbExiting( false ), + mpServerControl( 0 ), + mLastRequestID( 1 ), + mpActiveRequest( 0 ), + mpRxBuffer( 0 ), + mRxBufferSize( bufferSzRx ), + mRxType( rxType ), + mTxType( txType ), + mLog( logSz ) +{ + mLastTime = TimeIn( 0 ); + + // Allocate receive buffer? + if (mRxBufferSize > 0 && mComm.IsValid() == true) + { + mpRxBuffer = new BYTE[mRxBufferSize]; + } + + // Before continuing verify receive buffer was allocated + if (mpRxBuffer != 0) + { + // Schedule mutex + int nRet = pthread_mutex_init( &mScheduleMutex, NULL ); + if (nRet != 0) + { + TRACE( "Unable to init schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + } +} + +/*=========================================================================== +METHOD: + ~cProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (destroys sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::~cProtocolServer() +{ + // This should have already been called, but ... + Exit(); + + // Schedule mutex + int nRet = pthread_mutex_destroy( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to destroy schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + } + + // Free receive buffer + if (mpRxBuffer != 0) + { + delete [] mpRxBuffer; + mpRxBuffer = 0; + } +} + +/*=========================================================================== +METHOD: + HandleRemoveRequest (Public Method) + +DESCRIPTION: + Remove a previously added protocol request + + Note: if a request is being processed, it cannot be inturrupted + +PARAMETERS: + reqID [ I ] - Server assigned request ID + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::HandleRemoveRequest( ULONG reqID ) +{ + // Assume failure + bool bRC = false; + + // Find and erase request from request map + std::map ::iterator pReqIter; + pReqIter = mRequestMap.find( reqID ); + + if (pReqIter != mRequestMap.end()) + { + sProtocolReqRsp * pReqRsp = pReqIter->second; + if (pReqRsp != 0) + { + delete pReqRsp; + } + + mRequestMap.erase( pReqIter ); + + // Success! + bRC = true; + + // Find and erase request from schedule + bool bFound = false; + int entryIndex = -1; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + while (pScheduleIter != mRequestSchedule.end()) + { + entryIndex++; + + tSchedule entry = *pScheduleIter; + if (entry.second == reqID) + { + bFound = true; + mRequestSchedule.erase( pScheduleIter ); + break; + } + else + { + pScheduleIter++; + } + } + + // Note: schedule will be updated when mutex is unlocked/signaled + } + else if (mpActiveRequest != 0 && mpActiveRequest->mID == reqID) + { + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Cancel the response timer (when active) + if (mpActiveRequest->mbWaitingForResponse == true) + { + // Schedule will be updated when mutex is unlocked + + // Failure to receive response, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_ERR, + (DWORD)reqID, + ECANCELED ); + } + } + else + { + // This is the active request, cancel the underlying transmit + // Note: Because ProcessRequest and RemoveRequest are both muxed + // with ScheduleMutex, it is impossible to for the write + // to actually be in progress when this code is reached. + mComm.CancelTx(); + + // Failure to send request, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_ERR, + (DWORD)reqID, + ECANCELED ); + } + } + + // Now delete the request + delete mpActiveRequest; + mpActiveRequest = 0; + + // Success! + bRC = true; + } + else + { + TRACE( "cProtocolServer::RemoveRequest( %lu )," + " invalid request ID\n", + reqID ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ScheduleRequest (Internal Method) + +DESCRIPTION: + Schedule a request for transmission + +PARAMETERS: + reqID [ I ] - ID of the request being scheduled this ID must exist + in the internal request/schedule maps + + schedule [ I ] - Value in milliseconds that indicates the approximate + time from now that the request is to be sent out, the + actual time that the request is sent will be greater + than or equal to this value dependant on requests + scheduled before the request in question and + standard server processing time + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::ScheduleRequest( + ULONG reqID, + ULONG schedule ) +{ + // Assume failure + bool bRC = false; + + // Schedule adjust is in milliseconds + timespec schTimer = TimeIn( schedule ); + + // Create the schedule entry + tSchedule newEntry( schTimer, reqID ); + + // Fit this request into the schedule (ordered by scheduled time) + mRequestSchedule.insert( newEntry ); + + // Note: timer will be updated when mScheduleMutex is unlocked + + return bRC; +} + +/*=========================================================================== +METHOD: + RescheduleActiveRequest (Internal Method) + +DESCRIPTION: + Reschedule (or cleanup) the active request + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RescheduleActiveRequest() +{ + // Are there more attempts to be made? + if (mpActiveRequest->mAttempts < mpActiveRequest->mRequest.GetRequests()) + { + // Yes, first reset the request + mpActiveRequest->Reset(); + + // Now add it back to the request map + mRequestMap[mpActiveRequest->mID] = mpActiveRequest; + + TRACE( "RescheduleActiveRequest(): req %lu rescheduled\n", mpActiveRequest->mID ); + + // Lastly reschedule the request + ScheduleRequest( mpActiveRequest->mID, + mpActiveRequest->mRequest.GetFrequency() ); + + } + else + { + TRACE( "RescheduleActiveRequest(): req %lu removed\n", mpActiveRequest->mID ); + + // No, we are through with this request + delete mpActiveRequest; + } + + // There is no longer an active request + mpActiveRequest = 0; + +} + +/*=========================================================================== +METHOD: + ProcessRequest (Internal Method) + +DESCRIPTION: + Process a single outgoing protocol request, this consists of removing + the request ID from the head of the schedule, looking up the internal + request object in the request map, sending out the request, and setting + up the response timer (if a response is required) + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: +===========================================================================*/ +void cProtocolServer::ProcessRequest() +{ + // Is there already an active request? + if (mpActiveRequest != 0) + { + return; + } + + // Grab request ID from the schedule + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + // Did we find the request? + if (pScheduleIter == mRequestSchedule.end()) + { + // No + return; + } + + // Yes, grab the request ID + ULONG reqID = pScheduleIter->second; + + // Remove from schedule + mRequestSchedule.erase( pScheduleIter ); + + // Look up the internal request object + std::map ::iterator pReqIter; + pReqIter = mRequestMap.find( reqID ); + + // Request not found around? + if (pReqIter == mRequestMap.end() || pReqIter->second == 0) + { + // No + return; + } + + // Set this request as the active request + mpActiveRequest = pReqIter->second; + + TRACE( "ProcessRequest(): req %lu started\n", mpActiveRequest->mID ); + + // Remove request from pending request map + mRequestMap.erase( pReqIter ); + + // Extract the underlying request + const sProtocolRequest & req = mpActiveRequest->mRequest; + + // Increment attempt count? + if (req.GetRequests() != INFINITE_REQS) + { + // This request isn't an indefinite one, so keep track of each attempt + mpActiveRequest->mAttempts++; + } + + bool bTxSuccess = false; + + // Encode data for transmission? + bool bEncoded = false; + sSharedBuffer * pEncoded = 0; + pEncoded = EncodeTxData( req.GetSharedBuffer(), bEncoded ); + if (bEncoded == false) + { + // Note: no longer asynchronus + // Send the request data + bTxSuccess = mComm.TxData( req.GetBuffer(), + req.GetSize() ); + } + else if (bEncoded == true) + { + if (pEncoded != 0 && pEncoded->IsValid() == true) + { + // Note: no longer asynchronus + // Send the request data + mpActiveRequest->mEncodedSize = pEncoded->GetSize(); + bTxSuccess = mComm.TxData( pEncoded->GetBuffer(), + pEncoded->GetSize() ); + } + } + + if (bTxSuccess == true) + { + TRACE( "ProcessRequest(): req %lu finished\n", mpActiveRequest->mID ); + TxComplete(); + } + else + { + TxError(); + TRACE( "ProcessRequest(): req finished with a TxError\n" ); + } + + return; +} + +/*=========================================================================== +METHOD: + CheckSystemTime (Internal Method) + +DESCRIPTION: + Check that system time hasn't moved backwards. Since we use the system + time for scheduling requests we need to periodically check that the + user (or system itself) hasn't reset system time backwards, if it has + then we reschedule everything to the current system time. This disrupts + the schedule but avoids stranding requests + + Updates mLastTime + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool: System time moved backwards? +===========================================================================*/ +bool cProtocolServer::CheckSystemTime() +{ + // Assume that time is still marching forward + bool bAdjust = false; + + timespec curTime = TimeIn( 0 ); + + if (curTime < mLastTime) + { + // Looks like the system clock has been adjusted to an earlier + // value, go through the current schedule and adjust each timer + // to reflect the adjustment. This isn't an exact approach but + // it prevents requests from being stranded which is our goal + + // Note: set iterators are constant. This means we need to + // create a set with the new data, we can't modify this one + + std::set < tSchedule, std::less > tempSchedule; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + while (pScheduleIter != mRequestSchedule.end()) + { + tSchedule entry = *pScheduleIter; + entry.first.tv_sec = curTime.tv_sec; + entry.first.tv_nsec = curTime.tv_nsec; + tempSchedule.insert( entry ); + + pScheduleIter++; + } + + mRequestSchedule = tempSchedule; + + // Update mActiveRequestTimeout + if ( (mpActiveRequest != 0) + && (mpActiveRequest->mbWaitingForResponse == true) ) + { + // Restart active request's timeout + ULONG mTimeout = mpActiveRequest->mRequest.GetTimeout(); + mActiveRequestTimeout = TimeIn( mTimeout ); + } + + TRACE( "Time has moved backwards, schedule updated\n" ); + + // Indicate the change + bAdjust = true; + } + + mLastTime.tv_sec = curTime.tv_sec; + mLastTime.tv_nsec = curTime.tv_nsec; + + return bAdjust; +} + +/*=========================================================================== +METHOD: + RxComplete (Internal Method) + +DESCRIPTION: + Handle completion of receive data operation + +PARAMETERS: + status [ I ] - Status of operation + bytesReceived [ I ] - Number of bytes received + +SEQUENCING: + This method is sequenced according to the schedule mutex + i.e. any other thread that needs to modify the schedule + will block until this method completes + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RxComplete( + DWORD status, + DWORD bytesReceived ) +{ + if (status != NO_ERROR) + { + TRACE( "cProtocolServer::RxComplete() = %lu\n", status ); + } + + // Error with the read + if (status != NO_ERROR || bytesReceived == 0) + { + // Setup the next read + mComm.RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + + return; + } + + // Get Schedule Mutex + if (GetScheduleMutex() == false) + { + TRACE( "RxComplete(), unable to get schedule Mutex\n" ); + return; + } + + TRACE( "RxComplete() - Entry at %llu\n", GetTickCount() ); + + // Decode data + bool bAbortTx = false; + ULONG rspIdx = INVALID_LOG_INDEX; + bool bRsp = DecodeRxData( bytesReceived, rspIdx, bAbortTx ); + + // Is there an active request that needs to be aborted + if (mpActiveRequest != 0 && bAbortTx == true) + { + // Yes, terminate the transmission and handle the error + mComm.CancelTx(); + TxError(); + } + // Is there an active request and a valid response? + else if (mpActiveRequest != 0 && bRsp == true) + { + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Notify client that response was received + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_RECV, + (DWORD)mpActiveRequest->mID, + (DWORD)rspIdx ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); + } + + // Setup the next read + mComm.RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + + TRACE( "RxComplete() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return; + } + + return; +} + +/*=========================================================================== +METHOD: + RxTimeout (Internal Method) + +DESCRIPTION: + Handle the response timer expiring + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RxTimeout() +{ + // No active request? + if (mpActiveRequest == 0) + { + TRACE( "RxTimeout() with no active request\n" ); + ASSERT( 0 ); + } + + TRACE( "RxTimeout() for req %lu\n", mpActiveRequest->mID ); + + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Failure to receive response, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_ERR, + (DWORD)mpActiveRequest->mID, + (DWORD)0 ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); +} + +/*=========================================================================== +METHOD: + TxComplete (Internal Method) + +DESCRIPTION: + Handle completion of transmit data operation + +PARAMETERS: + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::TxComplete() +{ + // No active request? + if (mpActiveRequest == 0) + { + TRACE( "TxComplete() called with no active request\n" ); + ASSERT( 0 ); + } + + TRACE( "TxComplete() req %lu started\n", mpActiveRequest->mID ); + + ULONG reqID = mpActiveRequest->mID; + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Notify client of auxiliary data being sent? + if (mpActiveRequest->mRequiredAuxTxs && mpActiveRequest->mCurrentAuxTx) + { + pNotifier->Notify( ePROTOCOL_EVT_AUX_TU_SENT, + (DWORD)reqID, + (DWORD)mpActiveRequest->mEncodedSize ); + } + + // Check for more auxiliary data to transmit + if (mpActiveRequest->mCurrentAuxTx < mpActiveRequest->mRequiredAuxTxs) + { + ULONG auxDataSz = 0; + const BYTE * pAuxData = req.GetAuxiliaryData( auxDataSz ); + if (auxDataSz > 0 && pAuxData != 0) + { + bool bRC = false; + + // Adjust for current MTU + pAuxData += (mpActiveRequest->mCurrentAuxTx * MAX_AUX_MTU_SIZE); + mpActiveRequest->mCurrentAuxTx++; + + // Last MTU? + if (mpActiveRequest->mCurrentAuxTx == mpActiveRequest->mRequiredAuxTxs) + { + // More than one MTU? + if (mpActiveRequest->mRequiredAuxTxs > 1) + { + auxDataSz = (auxDataSz % MAX_AUX_MTU_SIZE); + if (auxDataSz == 0) + { + auxDataSz = MAX_AUX_MTU_SIZE; + } + } + + if (auxDataSz % MAX_PACKET_SIZE == 0) + { + // If last write of unframed write request is divisible + // by 512, break off last byte and send seperatly. + TRACE( "TxComplete() Special case, break off last byte\n" ); + + bRC = mComm.TxData( pAuxData, + auxDataSz - 1 ); + + if (bRC == true) + { + bRC = mComm.TxData( pAuxData + auxDataSz -1, + 1 ); + } + } + else + { + bRC = mComm.TxData( pAuxData, + auxDataSz ); + } + } + else if (mpActiveRequest->mRequiredAuxTxs > 1) + { + auxDataSz = MAX_AUX_MTU_SIZE; + + bRC = mComm.TxData( pAuxData, + auxDataSz ); + } + + if (bRC == true) + { + mpActiveRequest->mEncodedSize = auxDataSz; + TxComplete(); + } + else + { + TxError(); + } + + return; + } + } + + // Another successful transmission, add the buffer to the log + ULONG reqIdx = INVALID_LOG_INDEX; + + sProtocolBuffer pb( req.GetSharedBuffer() ); + reqIdx = mLog.AddBuffer( pb ); + + // Notify client? + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_SENT, (DWORD)reqID, (DWORD)reqIdx ); + } + + // Wait for a response? + if (mpActiveRequest->mRequest.IsTXOnly() == false) + { + // We now await the response + mpActiveRequest->mbWaitingForResponse = true; + mActiveRequestTimeout = TimeIn( mpActiveRequest->mRequest.GetTimeout() ); + } + else + { + // Reschedule request as needed + RescheduleActiveRequest(); + } +} + +/*=========================================================================== +METHOD: + TxError (Internal Method) + +DESCRIPTION: + Handle transmit data operation error be either rescheduling the + request or cleaning it up + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::TxError() +{ + // No active request? + if (mpActiveRequest == 0) + { + return; + } + + ULONG reqID = mpActiveRequest->mID; + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Failure to send request, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_ERR, (DWORD)reqID, (DWORD)0 ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the protocol server by starting up the schedule thread + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Initialize() +{ + // Assume failure + bool bRC = false; + + mbExiting = false; + + // Get mScheduleMutex + if (GetScheduleMutex() == true) + { + if (mScheduleThreadID == 0) + { + // Yes, start thread + int nRet = pthread_create( &mScheduleThreadID, + NULL, + ScheduleThread, + this ); + if (nRet == 0) + { + // Success! + bRC = true; + } + } + } + else + { + TRACE( "cProtocolServer::Initialize(), unable to aquire ScheduleMutex\n" ); + return false; + } + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return false; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Exit (Public Method) + +DESCRIPTION: + Exit the protocol server by exiting the schedule thread (if necessary) + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Exit() +{ + // Assume failure + bool bRC = false; + + if (mScheduleThreadID != 0) + { + if (GetScheduleMutex() == false) + { + // This should never happen + return false; + } + + // Check that mScheduleTheadID is still not 0 + if (mScheduleThreadID == 0) + { + printf( "mScheduleThreadID was zero!!!\n" ); + ReleaseScheduleMutex( false ); + return false; + } + + // Set exit event + mbExiting = true; + + // Signal a schedule update + if (mThreadScheduleEvent.Set( 1 ) != 0) + { + // This should never happen + return false; + } + + TRACE( "Joining ScheduleThread %lu\n", mScheduleThreadID ); + + // Allow process to continue until it finishes + int nRet = pthread_join( mScheduleThreadID, NULL ); + if (nRet == ESRCH) + { + TRACE( "ScheduleThread has exited already\n" ); + } + else if (nRet != 0) + { + TRACE( "Unable to join ScheduleThread. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + TRACE( "cProtocolServer::Exit(), completed thread %lu\n", + (ULONG)mScheduleThreadID ); + + bRC = true; + + // Release "handle" + mScheduleThreadID = 0; + + // Release mutex lock, don't signal ScheduleThread + if (ReleaseScheduleMutex( false ) == false) + { + // This should never happen + return false; + } + } + else + { + // No ScheduleThread + bRC = true; + } + + // Free any allocated requests + std::map ::iterator pReqIter; + pReqIter = mRequestMap.begin(); + + while (pReqIter != mRequestMap.end()) + { + sProtocolReqRsp * pReqRsp = pReqIter->second; + if (pReqRsp != 0) + { + delete pReqRsp; + } + + pReqIter++; + } + + mRequestMap.clear(); + + // Free log + mLog.Clear(); + + return bRC; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the given communications port + +PARAMETERS: + pPort [ I ] - String pointer representing the device node to + connect to (IE: /dev/qcqmi0) + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Connect( LPCSTR pPort ) +{ + // Assume failure + bool bRC = false; + if (pPort == 0 || pPort[0] == 0) + { + return bRC; + } + + // Connect to device + + // Set callback + mRxCallback.SetServer( this ); + + // Override to initialize port with protocol specific options + bRC = mComm.Connect( pPort ); + if (bRC == true) + { + bRC = InitializeComm(); + if (bRC == true) + { + // Setup the initial read + mComm.RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the current communications port + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Disconnect() +{ + // Disconnect + + // Cancel any outstanding I/O + mComm.CancelIO(); + + // Empty callback + mRxCallback.SetServer( 0 ); + + // Cleanup COM port + CleanupComm(); + + // Now disconnect + return mComm.Disconnect(); +} + +/*=========================================================================== +METHOD: + IsConnected (Public Method) + +DESCRIPTION: + Are we currently connected to a port? + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::IsConnected() +{ + return mComm.IsConnected(); +} + +/*=========================================================================== +METHOD: + AddRequest (Public Method) + +DESCRIPTION: + Add an outgoing protocol request to the protocol server request queue + +PARAMETERS: + req [ I ] - Request being added + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + ULONG - ID of scheduled request (INVALID_REQUEST_ID upon error) +===========================================================================*/ +ULONG cProtocolServer::AddRequest( const sProtocolRequest & req ) +{ + // Assume failure + ULONG reqID = INVALID_REQUEST_ID; + + // Server not configured for sending requests? + if (IsValid( mTxType ) == false) + { + return reqID; + } + + // Request type not valid for server? + if (req.GetType() != mTxType) + { + return reqID; + } + + // Invalide request? + if (ValidateRequest( req ) == false) + { + return reqID; + } + + // Get mScheduleMutex + if (GetScheduleMutex() == true) + { + TRACE( "AddRequest() - Entry at %llu\n", GetTickCount() ); + + // Grab next available request ID + if (++mLastRequestID == 0) + { + mLastRequestID++; + } + + reqID = mLastRequestID; + while (mRequestMap.find( reqID ) != mRequestMap.end()) + { + reqID++; + } + + // Wrap in our internal structure + sProtocolReqRsp * pReqRsp = 0; + pReqRsp = new sProtocolReqRsp( req, reqID, MAX_AUX_MTU_SIZE ); + + if (pReqRsp != 0) + { + // Add to request map + mRequestMap[reqID] = pReqRsp; + + // ... and schedule + ScheduleRequest( reqID, req.GetSchedule() ); + } + + TRACE( "AddRequest() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return INVALID_REQUEST_ID; + } + } + else + { + TRACE( "cProtocolServer::AddRequest(), unable to get schedule Mutex\n" ); + } + + return reqID; +} + +/*=========================================================================== +METHOD: + RemoveRequest (Public Method) + +DESCRIPTION: + Remove a previously added protocol request + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + + Note: If a request is being written, it cannot be inturrupted as + both ProcessRequest and RemoveRequest depend on the ScheduleMutex + and the write is synchronus. If the request has been written but + the read has not been triggered it can be removed. + +PARAMETERS: + reqID [ I ] - ID of request being removed + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::RemoveRequest( ULONG reqID ) +{ + // Assume failure + bool bRC = false; + + // Get Schedule Mutex + if (GetScheduleMutex() == true) + { + TRACE( "RemoveRequest() - Entry at %llu\n", GetTickCount() ); + + bRC = HandleRemoveRequest( reqID ); + + TRACE( "RemoveRequest() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return false; + } + } + else + { + TRACE( "cProtocolServer::RemoveRequest(), unable to get mScheduleMutex\n" ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetScheduleMutex (Internal Method) + +DESCRIPTION: + Get the schedule mutex. Additionally a check is applied to verify the + DEADLOCK_TIME was not exceeded + +SEQUENCING: + This function will block until the mScheduleMutex is aquired + +PARAMETERS: + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::GetScheduleMutex() +{ + ULONGLONG nStart = GetTickCount(); + + //TRACE( "Locking Schedule mutex\n" ); + int nRet = pthread_mutex_lock( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to lock schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + ULONGLONG nEnd = GetTickCount(); + if (nEnd - nStart > DEADLOCK_TIME) + { + TRACE( "Deadlock time exceeded: took %llu ms\n", nEnd - nStart ); + ReleaseScheduleMutex( true ); + return false; + } + + //TRACE( "Locked ScheduleMutex\n" ); + return true; +} + +/*=========================================================================== +METHOD: + ReleaseScheduleMutex (Internal Method) + +DESCRIPTION: + Release lock on the schedule mutex + +SEQUENCING: + Calling process must have lock + +PARAMETERS: + bSignalThread [ I ] - Signal Schedule thread as well? + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::ReleaseScheduleMutex( bool bSignalThread ) +{ + if (bSignalThread == true) + { + if (mThreadScheduleEvent.Set( 1 ) != 0) + { + return false; + } + } + + int nRet = pthread_mutex_unlock( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to unlock schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return true; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolServer.h b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolServer.h new file mode 100755 index 0000000..a5ba9b8 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/ProtocolServer.h @@ -0,0 +1,351 @@ +/*=========================================================================== +FILE: + ProtocolServer.h + +DESCRIPTION: + Generic protocol packet server + +PUBLIC CLASSES AND METHODS: + cProtocolServer + Abstract base class for protocol servers + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Comm.h" +#include "ProtocolRequest.h" +#include "ProtocolLog.h" +#include "Event.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +class cProtocolServer; +struct sServerControl; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid request ID +extern const ULONG INVALID_REQUEST_ID; + +// Fill timespec with the time it will be in specified milliseconds +// Relative time to Absolute time +timespec TimeIn( ULONG millis ); + +// Find the milliseconds from current time this timespec will occur +// Absolute time to Relative time +ULONG TimeFromNow( timespec time ); + +// Provide a number for sequencing reference, similar to the windows function +ULONGLONG GetTickCount(); + +// timespec < comparison method +inline bool operator< (const timespec & first, const timespec & second) +{ + return ( (first.tv_sec < second.tv_sec) + ||( (first.tv_sec == second.tv_sec) + &&(first.tv_nsec < second.tv_nsec) ) ); +} + +// timespec <= comparison method +inline bool operator<= (const timespec & first, const timespec & second) +{ + return ( (first.tv_sec < second.tv_sec) + ||( (first.tv_sec == second.tv_sec) + &&(first.tv_nsec <= second.tv_nsec) ) ); +} + +/*=========================================================================*/ +// Class cProtocolServerRxCallback +/*=========================================================================*/ +class cProtocolServerRxCallback +{ + public: + // (Inline) Constructor + cProtocolServerRxCallback() + : mpServer( 0 ) + { }; + + // (Inline) Destructor + virtual ~cProtocolServerRxCallback() { }; + + // (Inline) Set server object to pass results to + void SetServer( cProtocolServer * pServer ) + { + mpServer = pServer; + }; + + // The I/O has been completed, process the results + virtual void IOComplete( + DWORD status, + DWORD bytesReceived ); + + protected: + /* Protocol server to interact with */ + cProtocolServer * mpServer; +}; + +/*=========================================================================*/ +// Class cProtocolServer +/*=========================================================================*/ +class cProtocolServer +{ + public: + // Constructor + cProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cProtocolServer(); + + // Initialize the protocol server + bool Initialize(); + + // Exit the protocol server + bool Exit(); + + // Connect to the given communications port + bool Connect( LPCSTR pPort ); + + // Disconnect from target + bool Disconnect(); + + // Are we currently connected to a port? + bool IsConnected(); + + // Add an outgoing protocol request to the protocol server request queue + ULONG AddRequest( const sProtocolRequest & req ); + + // Remove a previously added protocol request + bool RemoveRequest( ULONG reqID ); + + // (Inline) Return the protocol log + const cProtocolLog & GetLog() + { + return mLog; + }; + + protected: + // Internal protocol server request/response structure, used to track + // info related to sending out a request + struct sProtocolReqRsp + { + public: + // Constructor + sProtocolReqRsp( + const sProtocolRequest & requestInfo, + ULONG requestID, + ULONG auxDataMTU ); + + // Copy constructor + sProtocolReqRsp( const sProtocolReqRsp & reqRsp ); + + // (Inline) Reset for next transmission attempt + void Reset() + { + mEncodedSize = mRequest.GetSize(); + + mCurrentAuxTx = 0; + mbWaitingForResponse = 0; + }; + + /* Request ID */ + ULONG mID; + + /* Number of times this request has been attempted */ + ULONG mAttempts; + + /* Size of encoded data being transmitted */ + ULONG mEncodedSize; + + /* Number of required auxiliary data transmissions */ + ULONG mRequiredAuxTxs; + + /* Current auxiliary data transmission */ + ULONG mCurrentAuxTx; + + /* Are we currently waiting for a response? */ + bool mbWaitingForResponse; + + /* Underlying protocol request */ + sProtocolRequest mRequest; + }; + + // Handle the remove request + bool HandleRemoveRequest( ULONG reqID ); + + // Schedule a request for transmission + bool ScheduleRequest( + ULONG reqID, + ULONG schedule ); + + // (Inline) Get next request's time from mRequestSchedule + timespec GetNextRequestTime() + { + timespec outTime; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + tSchedule entry = *pScheduleIter; + + outTime = entry.first; + return outTime; + } + + // (Inline) Validate a request that is about to be scheduled + virtual bool ValidateRequest( const sProtocolRequest & req ) + { + return req.IsValid(); + }; + + // Reschedule (or cleanup) the active request + void RescheduleActiveRequest(); + + // Process a single outgoing protocol request + void ProcessRequest(); + + // Check that system time hasn't moved backwards + bool CheckSystemTime(); + + // Perform protocol specific communications port initialization + virtual bool InitializeComm() = 0; + + // Perform protocol specific communications port cleanup + virtual bool CleanupComm() = 0; + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) = 0; + + // Decode incoming data into packets returning the last response + virtual bool DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ) = 0; + + // Handle completion of receive data operation + void RxComplete( + DWORD status, + DWORD bytesReceived ); + + // Handle the response timer expiring + void RxTimeout(); + + // Handle completion of transmit data operation + virtual void TxComplete(); + + // Handle a transmission error + void TxError(); + + /* Underlying communications object */ + cComm mComm; + + /* Rx callback */ + cProtocolServerRxCallback mRxCallback; + + /* ID of Schedule thread */ + pthread_t mScheduleThreadID; + + // ScheduleThread signal event + cEvent mThreadScheduleEvent; + + // Schedule mutex + // Ensures exclusive access to mRequestSchedule + pthread_mutex_t mScheduleMutex; + + // Is the thread in the process of exiting? + // (no new commands will be accepted) + bool mbExiting; + + /* Client/server thread control object */ + sSharedBuffer * mpServerControl; + + /* Protocol request schedule (scheduled time/request ID) */ + typedef std::pair tSchedule; + std::set < tSchedule, std::less > mRequestSchedule; + + /* Last system time value (used to check for time changes) */ + timespec mLastTime; + + /* Protocol request map (request ID mapped to internal req/rsp struct) */ + std::map mRequestMap; + + /* Last assigned request ID */ + ULONG mLastRequestID; + + /* Current request being processed */ + sProtocolReqRsp * mpActiveRequest; + + /* Absolute timeout for mpActiveRequest + based on when write was completed */ + timespec mActiveRequestTimeout; + + /* Data buffer for incoming data */ + BYTE * mpRxBuffer; + + /* Size of above buffer (i.e. how much data to read in at once) */ + ULONG mRxBufferSize; + + /* Protocol type for incoming/outgoing data*/ + eProtocolType mRxType; + eProtocolType mTxType; + + /* Protocol log */ + cProtocolLog mLog; + + // Get a lock on ScheduleMutex + bool GetScheduleMutex(); + + // Release lock on ScheduleMutex + // Signal ScheduleThread if desired + bool ReleaseScheduleMutex( bool bSignalThread = true ); + + // Schedule Thread gets full access + friend void * ScheduleThread( PVOID pArg ); + + // Callback objects get full access + friend class cProtocolServerRxCallback; +}; + diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/QMIBuffers.cpp b/gobi-api/Gobi_2011-11-28-1533/Core/QMIBuffers.cpp new file mode 100755 index 0000000..a128b84 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/QMIBuffers.cpp @@ -0,0 +1,366 @@ +/*=========================================================================== +FILE: + QMIBuffers.cpp + +DESCRIPTION: + QMI service protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQMIControlRawTransactionHeader + sQMIServiceRawTransactionHeader + sQMIRawMessageHeader + sQMIRawContentHeader + + sQMIServiceBuffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sQMIServiceBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQMIServiceBuffer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the DIAG data + +RETURN VALUE: + None +===========================================================================*/ +sQMIServiceBuffer::sQMIServiceBuffer( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQMIServiceBuffer::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQMIServiceBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQMIServiceBuffer::~sQMIServiceBuffer() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + GetResult (Public Method) + +DESCRIPTION: + Return contents of mandatory result content + +PARAMETERS: + returnCode [ I ] - The return code (should be eQMIResultCode) + errorCode [ I ] - The error code (should be eQMIErrorCode) + +RETURN VALUE: + bool +===========================================================================*/ +bool sQMIServiceBuffer::GetResult( + ULONG & returnCode, + ULONG & errorCode ) +{ + if (IsResponse() == false) + { + return false; + } + + std::map ::const_iterator pIter; + pIter = mContents.find( QMI_TLV_ID_RESULT ); + if (pIter == mContents.end()) + { + return false; + } + + const sQMIRawContentHeader * pContent = pIter->second; + if (pContent == 0) + { + ASSERT( 0 ); + return false; + } + + if (pContent->mLength != 4) + { + return false; + } + + const WORD * pData = (const WORD *)(++pContent); + + returnCode = (ULONG)*pData++; + errorCode = (ULONG)*pData; + + return true; +} + +/*=========================================================================== +METHOD: + BuildBuffer (Static Public Method) + +DESCRIPTION: + Build a QMI request + +PARAMETERS: + serviceType [ I ] - QMI service type + msgID [ I ] - The QMI message request ID + bResponse [ I ] - Build a response? + bIndication [ I ] - Build an indication? + pPayload [ I ] - Payload + payloadLen [ I ] - Size of above payload + +RETURN VALUE: + sSharedBuffer * : The request in an allocated buffer (0 on error) +===========================================================================*/ +sSharedBuffer * sQMIServiceBuffer::BuildBuffer( + eQMIService serviceType, + WORD msgID, + bool bResponse, + bool bIndication, + const BYTE * pPayload, + ULONG payloadLen ) +{ + const ULONG szTransHdr = (ULONG)sizeof(sQMIServiceRawTransactionHeader); + const ULONG szMsgHdr = (ULONG)sizeof(sQMIRawMessageHeader); + const ULONG totalHdrSz = szTransHdr + szMsgHdr; + + // Truncate payload? + if (payloadLen > (QMI_MAX_BUFFER_SIZE - totalHdrSz)) + { + payloadLen = QMI_MAX_BUFFER_SIZE - totalHdrSz; + } + + // Make sure length agrees with pointer + if (pPayload == 0) + { + payloadLen = 0; + } + + // Allocate buffer + PBYTE pBuffer = new BYTE[payloadLen + totalHdrSz]; + if (pBuffer == 0) + { + return 0; + } + + // Format header + sQMIServiceRawTransactionHeader * pHdr = 0; + pHdr = (sQMIServiceRawTransactionHeader *)&pBuffer[0]; + pHdr->mCompound = 0; + pHdr->mResponse = 0; + pHdr->mIndication = 0; + pHdr->mReserved = 0; + pHdr->mTransactionID = 1; + + bool bTX = true; + if (bResponse == true) + { + pHdr->mResponse = 1; + bTX = false; + } + else if (bIndication == true) + { + pHdr->mIndication = 1; + bTX = false; + } + + pHdr++; + + // Format message header + sQMIRawMessageHeader * pMsg = 0; + pMsg = (sQMIRawMessageHeader *)pHdr; + pMsg->mMessageID = msgID; + pMsg->mLength = (WORD)payloadLen; + + // Copy in payload? + if (payloadLen > 0 && pPayload != 0) + { + memcpy( (LPVOID)&pBuffer[totalHdrSz], + (LPCVOID)&pPayload[0], + (SIZE_T)payloadLen ); + } + + // Compute total size + ULONG sz = payloadLen + totalHdrSz; + + // Build and return the shared buffer + eProtocolType pt = MapQMIServiceToProtocol( serviceType, bTX ); + sSharedBuffer * pBuf = new sSharedBuffer( sz, pBuffer, pt ); + return pBuf; +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this open unframed request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQMIServiceBuffer::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (IsQMIProtocol( pt ) == false) + { + mbValid = bRC; + return bRC; + } + + const ULONG szTransHdr = (ULONG)sizeof(sQMIServiceRawTransactionHeader); + const ULONG szMsgHdr = (ULONG)sizeof(sQMIRawMessageHeader); + const ULONG szContentHdr = (ULONG)sizeof(sQMIRawContentHeader); + + // Must be enough space for both headers + ULONG sz = GetSize(); + if (sz < szTransHdr + szMsgHdr) + { + mbValid = bRC; + return bRC; + } + + const BYTE * pBuffer = GetBuffer(); + + // Obtain transaction header + const sQMIServiceRawTransactionHeader * pTransHdr = 0; + pTransHdr = (const sQMIServiceRawTransactionHeader *)pBuffer; + pBuffer += szTransHdr; + + // This is required to be 0 + if (pTransHdr->mCompound != 0) + { + mbValid = bRC; + return bRC; + } + + // These are mutually exclusive + if (pTransHdr->mIndication == 1 && pTransHdr->mResponse == 1) + { + mbValid = bRC; + return bRC; + } + + // Requests/responses required valid transaction IDs + if ( (pTransHdr->mIndication == 0) + && (pTransHdr->mTransactionID == (WORD)INVALID_QMI_TRANSACTION_ID) ) + { + mbValid = bRC; + return bRC; + } + + if ( (pTransHdr->mResponse == 1 || pTransHdr->mIndication == 1) + && (IsQMIProtocolRX( pt ) == false) ) + { + mbValid = bRC; + return bRC; + } + + if ( (pTransHdr->mResponse == 0 && pTransHdr->mIndication == 0) + && (IsQMIProtocolTX( pt ) == false) ) + { + mbValid = bRC; + return bRC; + } + + // Obtain message header + const sQMIRawMessageHeader * pMsgHdr = 0; + pMsgHdr = (const sQMIRawMessageHeader *)pBuffer; + pBuffer += szMsgHdr; + + // Validate reported length + if (sz != ((ULONG)pMsgHdr->mLength + szTransHdr + szMsgHdr)) + { + mbValid = bRC; + return bRC; + } + + // Extract content TLV structures + ULONG contentProcessed = 0; + ULONG contentSz = (ULONG)pMsgHdr->mLength; + while (contentProcessed < contentSz) + { + const sQMIRawContentHeader * pContent = 0; + pContent = (const sQMIRawContentHeader *)pBuffer; + + ULONG tlvLen = szContentHdr + pContent->mLength; + + contentProcessed += tlvLen; + if (contentProcessed <= contentSz) + { + mContents[(ULONG)pContent->mTypeID] = pContent; + } + else + { + mContents.clear(); + + mbValid = bRC; + return bRC; + } + + pBuffer += tlvLen; + } + + // Validate TLV reported lengths + if (contentProcessed != contentSz) + { + mbValid = bRC; + return bRC; + } + + // Success! + bRC = true; + + mbValid = bRC; + return mbValid; +} + diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/QMIBuffers.h b/gobi-api/Gobi_2011-11-28-1533/Core/QMIBuffers.h new file mode 100755 index 0000000..f160e2a --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/QMIBuffers.h @@ -0,0 +1,391 @@ +/*=========================================================================== +FILE: + QMIBuffers.h + +DESCRIPTION: + QMI service protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQMUXHeader + sQMIControlRawTransactionHeader + sQMIServiceRawTransactionHeader + sQMIRawMessageHeader + sQMIRawContentHeader + + sQMIServiceBuffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "QMIEnum.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// QMI maximum buffer size (cannot be larger than MAX_SHARED_BUFFER_SIZE) +const ULONG QMI_MAX_BUFFER_SIZE = MAX_SHARED_BUFFER_SIZE; + +// Content ID for mandatory result TLV +const ULONG QMI_TLV_ID_RESULT = 2; + +/*=========================================================================== +METHOD: + MapQMIServiceToProtocol (Inline Method) + +DESCRIPTION: + Map QMI service type (eQMIService) and direction to a protocol type + (eProtocolType) + +PARAMETERS: + serviceType [ I ] - Enum value being mapped + bTransmission [ I ] - Is this a transmission (TX vs. RX)? + +RETURN VALUE: + eProtocolType +===========================================================================*/ +inline eProtocolType MapQMIServiceToProtocol( + eQMIService serviceType, + bool bTransmission = true ) +{ + eProtocolType pt = ePROTOCOL_ENUM_BEGIN; + if (IsValid( serviceType ) == false) + { + return pt; + } + + DWORD tmp = ((DWORD)serviceType * 2) + (DWORD)ePROTOCOL_QMI_CTL_RX; + if (bTransmission == true) + { + tmp++; + } + + if (IsQMIProtocol( (eProtocolType)tmp ) == true) + { + pt = (eProtocolType)tmp; + } + + return pt; +}; + +/*=========================================================================== +METHOD: + MapProtocolToQMIService (Inline Method) + +DESCRIPTION: + Map protocol type (eProtocolType) to QMI service type (eQMIService) + +PARAMETERS: + protocolType [ I ] - Enum value being mapped + +RETURN VALUE: + bool +===========================================================================*/ +inline eQMIService MapProtocolToQMIService( eProtocolType protocolType ) +{ + eQMIService st = eQMI_SVC_ENUM_BEGIN; + if (IsQMIProtocol( protocolType ) == false) + { + return st; + } + + DWORD tmp = ((DWORD)protocolType - (DWORD)ePROTOCOL_QMI_CTL_RX) / 2; + if (IsValid( (eQMIService)tmp ) == true) + { + st = (eQMIService)tmp; + } + + return st; +}; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sQMUXHeader +// Struct to represent a QMUX transaction header (raw) +/*=========================================================================*/ +struct sQMUXHeader +{ + public: + WORD mLength; + BYTE mFlags; + BYTE mServiceType; + BYTE mClientID; +}; + +/*=========================================================================*/ +// Struct sQMIControlRawTransactionHeader +// Struct to represent a QMI control transaction header (raw) +/*=========================================================================*/ +struct sQMIControlRawTransactionHeader +{ + public: + BYTE mResponse : 1; // Is this a response transaction? + BYTE mIndication : 1; // Is this an indication transaction? + BYTE mReserved : 6; + + BYTE mTransactionID; // Transaction ID +}; + +/*=========================================================================*/ +// Struct sQMIServiceRawTransactionHeader +// Struct to represent a QMI service transaction header (raw) +/*=========================================================================*/ +struct sQMIServiceRawTransactionHeader +{ + public: + BYTE mCompound : 1; // Is this a compound transaction? + BYTE mResponse : 1; // Is this a response transaction? + BYTE mIndication : 1; // Is this an indication transaction? + BYTE mReserved : 5; + + WORD mTransactionID; // Transaction ID +}; + +/*=========================================================================*/ +// Struct sQMIRawMessageHeader +// Struct to represent a QMI (control/service) message header (raw) +/*=========================================================================*/ +struct sQMIRawMessageHeader +{ + public: + WORD mMessageID; // Message ID + WORD mLength; // Length of message (not including this header) +}; + +/*=========================================================================*/ +// Struct sQMIRawContentHeader +// Struct to represent a QMI (control/service) content +// (i.e Type/Length/Value, TLV) header (raw) +/*=========================================================================*/ +struct sQMIRawContentHeader +{ + public: + BYTE mTypeID; // Content type ID + WORD mLength; // Content length (not including this header) +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + + +/*=========================================================================*/ +// Struct sQMIServiceBuffer +// Struct to represent a QMI service channel request/response/indication +// (shared buffer) +/*=========================================================================*/ +struct sQMIServiceBuffer : public sProtocolBuffer +{ + public: + // Constructor + sQMIServiceBuffer( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQMIServiceBuffer(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bRequest = (pHdr->mResponse == 0 && pHdr->mIndication == 0); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bResponse = (pHdr->mResponse == 1); + } + + return bResponse; + }; + + // (Inline) Is this an indication? + bool IsIndication() const + { + bool bInd = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bInd = (pHdr->mIndication == 1); + } + + return bInd; + }; + + // (Inline) Return raw header + const sQMIServiceRawTransactionHeader * GetHeader() const + { + const sQMIServiceRawTransactionHeader * pHdr = 0; + if (IsValid() == true) + { + pHdr = (const sQMIServiceRawTransactionHeader *)GetBuffer(); + } + + return pHdr; + }; + + // (Inline) Return the message ID + ULONG GetMessageID() const + { + ULONG id = (ULONG)0xffffffff; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + pHdr++; + const sQMIRawMessageHeader * pMsgHdr = 0; + pMsgHdr = (sQMIRawMessageHeader *)pHdr; + + id = pMsgHdr->mMessageID; + } + + return id; + }; + + // (Inline) Return the transaction ID + WORD GetTransactionID() const + { + WORD id = (WORD)INVALID_QMI_TRANSACTION_ID; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + id = pHdr->mTransactionID; + } + + return id; + }; + + // (Inline) Return raw content array + const sQMIRawContentHeader * GetRawContents( ULONG & contentLen ) const + { + // Assume failure + ULONG len = 0; + const sQMIRawContentHeader * pRaw = 0; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + pHdr++; + const sQMIRawMessageHeader * pMsgHdr = 0; + pMsgHdr = (sQMIRawMessageHeader *)pHdr; + + len = pMsgHdr->mLength; + pMsgHdr++; + if (len > 0) + { + pRaw = (const sQMIRawContentHeader *)pMsgHdr; + } + } + + contentLen = len; + return pRaw; + }; + + // (Inline) Return content structures + std::map GetContents() const + { + return mContents; + }; + + // Return contents of mandatory result content + bool GetResult( + ULONG & returnCode, + ULONG & errorCode ); + + // Build a QMI request/response/indication + static sSharedBuffer * BuildBuffer( + eQMIService serviceType, + WORD msgID, + bool bResponse = false, + bool bIndication = false, + const BYTE * pData = 0, + ULONG dataLen = 0 ); + + protected: + // QMI protocol server has to be able to set the transaction ID + friend class cQMIProtocolServer; + + // Set the transaction ID + void SetTransactionID( WORD tid ) const + { + if (tid == (WORD)INVALID_QMI_TRANSACTION_ID || IsValid() == false) + { + return; + } + + sQMIServiceRawTransactionHeader * pHdr = 0; + pHdr = (sQMIServiceRawTransactionHeader *)GetHeader(); + if (pHdr != 0) + { + pHdr->mTransactionID = tid; + } + }; + + // Is this QMI request/response/indication packet valid? + virtual bool Validate(); + + /* Content TLV structures (indexed by type ID) */ + std::map mContents; + + private: + // Prevent 'upcopying' + sQMIServiceBuffer( const sProtocolBuffer & ); + sQMIServiceBuffer & operator = ( const sProtocolBuffer & ); +}; + diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/QMIEnum.h b/gobi-api/Gobi_2011-11-28-1533/Core/QMIEnum.h new file mode 100755 index 0000000..745556f --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/QMIEnum.h @@ -0,0 +1,1691 @@ +/*=========================================================================== +FILE: + QMIEnum.h + +DESCRIPTION: + QMI protocol enumerations and related methods + +PUBLIC ENUMERATIONS AND METHODS: + eQMIService + eQMIMessageCTL + eQMIMessageWDS + eQMIMessageDMS + eQMIMessageNAS + eQMIMessageWMS + eQMIMessagePDS + eQMIMessageAUTH + eQMIMessageAT + eQMIMessageVoice + eQMIMessageUIM + eQMIMessagePBM + eQMIMessageSAR + eQMIMessageRMTFS + eQMIMessageCAT + eQMIMessageRMS + eQMIMessageOMA + eQMIResultCode + eQMIErrorCode + eQMICallEndReason + eIPAddressType + eSMSMessageMode + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid QMI transaction ID +const ULONG INVALID_QMI_TRANSACTION_ID = 0; + +// QMI DMS PRL size constants +const ULONG QMI_DMS_MAX_PRL_SIZE = 16384; +const ULONG QMI_DMS_MAX_PRL_BLOCK = 256; + +/*=========================================================================*/ +// eQMIService Enumeration +// QMI Service Type Enumeration +/*=========================================================================*/ +enum eQMIService +{ + eQMI_SVC_ENUM_BEGIN = -1, + + eQMI_SVC_CONTROL, // 000 Control service + eQMI_SVC_WDS, // 001 Wireless data service + eQMI_SVC_DMS, // 002 Device management service + eQMI_SVC_NAS, // 003 Network access service + eQMI_SVC_QOS, // 004 Quality of service, err, service + eQMI_SVC_WMS, // 005 Wireless messaging service + eQMI_SVC_PDS, // 006 Position determination service + eQMI_SVC_AUTH, // 007 Authentication service + eQMI_SVC_AT, // 008 AT command processor service + eQMI_SVC_VOICE, // 009 Voice service + eQMI_SVC_CAT2, // 010 Card application toolkit service (new) + eQMI_SVC_UIM, // 011 UIM service + eQMI_SVC_PBM, // 012 Phonebook service + eQMI_SVC_RESERVED_13, // 013 Reserved + eQMI_SVC_RESERVED_14, // 014 Reserved + eQMI_SVC_RESERVED_15, // 015 Reserved + eQMI_SVC_LOC, // 016 Location service + eQMI_SVC_SAR, // 017 Specific absorption rate service + eQMI_SVC_RESERVED_18, // 018 Reserved + eQMI_SVC_RESERVED_19, // 019 Reserved + eQMI_SVC_RMTFS, // 020 Remote file system service + eQMI_SVC_RESERVED_21, // 021 Reserved + eQMI_SVC_RESERVED_22, // 022 Reserved + eQMI_SVC_RESERVED_23, // 023 Reserved + eQMI_SVC_RESERVED_24, // 024 Reserved + + eQMI_SVC_CAT = 224, // 224 Card application toolkit service + eQMI_SVC_RMS, // 225 Remote management service + eQMI_SVC_OMA, // 226 Open mobile alliance dev mgmt service + + eQMI_SVC_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIService validity check + +PARAMETERS: + svc [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIService svc ) +{ + bool retVal = false; + if ( (svc > eQMI_SVC_ENUM_BEGIN && svc <= eQMI_SVC_RESERVED_24) + || (svc >= eQMI_SVC_CAT && svc < eQMI_SVC_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageCTL Enumeration +// QMI Control Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageCTL +{ + eQMI_CTL_ENUM_BEGIN = -1, + + eQMI_CTL_SET_INSTANCE_ID = 32, // 32 Set the unique link instance ID + eQMI_CTL_GET_VERSION_INFO, // 33 Get supported service version info + eQMI_CTL_GET_CLIENT_ID, // 34 Get a unique client ID + eQMI_CTL_RELEASE_CLIENT_ID, // 35 Release the unique client ID + eQMI_CTL_REVOKE_CLIENT_ID_IND, // 36 Indication of client ID revocation + eQMI_CTL_INVALID_CLIENT_ID, // 37 Indication of invalid client ID + eQMI_CTL_SET_DATA_FORMAT, // 38 Set host driver data format + eQMI_CTL_SYNC, // 39 Synchronize client/server + eQMI_CTL_SYNC_IND = 39, // 39 Synchronize indication + eQMI_CTL_SET_EVENT, // 40 Set event report conditions + eQMI_CTL_EVENT_IND = 40, // 40 Event report indication + eQMI_CTL_SET_POWER_SAVE_CFG, // 41 Set power save config + eQMI_CTL_SET_POWER_SAVE_MODE, // 42 Set power save mode + eQMI_CTL_GET_POWER_SAVE_MODE, // 43 Get power save mode + + eQMI_CTL_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageCTL validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageCTL msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_CTL_SET_INSTANCE_ID && msgID < eQMI_CTL_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageWDS Enumeration +// QMI WDS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageWDS +{ + eQMI_WDS_ENUM_BEGIN = -1, + + eQMI_WDS_RESET, // 000 Reset WDS service state variables + eQMI_WDS_SET_EVENT, // 001 Set connection state report conditions + eQMI_WDS_EVENT_IND = 1, // 001 Connection state report indication + eQMI_WDS_ABORT, // 002 Abort previously issued WDS command + + eQMI_WDS_START_NET = 32, // 032 Start WDS network interface + eQMI_WDS_STOP_NET, // 033 Stop WDS network interface + eQMI_WDS_GET_PKT_STATUS, // 034 Get packet data connection status + eQMI_WDS_PKT_STATUS_IND = 34, // 034 Packet data connection status indication + eQMI_WDS_GET_RATES, // 035 Get current bit rates of the connection + eQMI_WDS_GET_STATISTICS, // 036 Get the packet data transfer statistics + eQMI_WDS_G0_DORMANT, // 037 Go dormant + eQMI_WDS_G0_ACTIVE, // 038 Go active + eQMI_WDS_CREATE_PROFILE, // 039 Create profile with specified settings + eQMI_WDS_MODIFY_PROFILE, // 040 Modify profile with specified settings + eQMI_WDS_DELETE_PROFILE, // 041 Delete the specified profile + eQMI_WDS_GET_PROFILE_LIST, // 042 Get all profiles + eQMI_WDS_GET_PROFILE, // 043 Get the specified profile + eQMI_WDS_GET_DEFAULTS, // 044 Get the default data session settings + eQMI_WDS_GET_SETTINGS, // 045 Get the runtime data session settings + eQMI_WDS_SET_MIP, // 046 Get the mobile IP setting + eQMI_WDS_GET_MIP, // 047 Set the mobile IP setting + eQMI_WDS_GET_DORMANCY, // 048 Get the dormancy status + + eQMI_WDS_GET_AUTOCONNECT = 52, // 052 Get the NDIS autoconnect setting + eQMI_WDS_GET_DURATION, // 053 Get the duration of data session + eQMI_WDS_GET_MODEM_STATUS, // 054 Get the modem status + eQMI_WDS_MODEM_IND = 54, // 054 Modem status indication + eQMI_WDS_GET_DATA_BEARER, // 055 Get the data bearer type + eQMI_WDS_GET_MODEM_INFO, // 056 Get the modem info + eQMI_WDS_MODEM_INFO_IND = 56, // 056 Modem info indication + + eQMI_WDS_GET_ACTIVE_MIP = 60, // 060 Get the active mobile IP profile + eQMI_WDS_SET_ACTIVE_MIP, // 061 Set the active mobile IP profile + eQMI_WDS_GET_MIP_PROFILE, // 062 Get mobile IP profile settings + eQMI_WDS_SET_MIP_PROFILE, // 063 Set mobile IP profile settings + eQMI_WDS_GET_MIP_PARAMS, // 064 Get mobile IP parameters + eQMI_WDS_SET_MIP_PARAMS, // 065 Set mobile IP parameters + eQMI_WDS_GET_LAST_MIP_STATUS, // 066 Get last mobile IP status + eQMI_WDS_GET_AAA_AUTH_STATUS, // 067 Get AN-AAA authentication status + eQMI_WDS_GET_CUR_DATA_BEARER, // 068 Get current data bearer + eQMI_WDS_GET_CALL_LIST, // 069 Get the call history list + eQMI_WDS_GET_CALL_ENTRY, // 070 Get an entry from the call history list + eQMI_WDS_CLEAR_CALL_LIST, // 071 Clear the call history list + eQMI_WDS_GET_CALL_LIST_MAX, // 072 Get maximum size of call history list + eQMI_WDS_GET_DEFAULT_PROF_NUM, // 073 Get default profile number + eQMI_WDS_SET_DEFAULT_PROF_NUM, // 074 Set default profile number + eQMI_WDS_RESET_PROFILE, // 075 Reset profile + eQMI_WDS_RESET_PROF_PARAM, // 076 Reset profile param to invalid + eQMI_WDS_SET_IP_FAMILY, // 077 Set the client IP family preference + + eQMI_WDS_SET_AUTOCONNECT = 81, // 081 Set the NDIS autoconnect setting + eQMI_WDS_GET_DNS, // 082 Get the DNS setting + eQMI_WDS_SET_DNS, // 083 Set the DNS setting + eQMI_WDS_GET_PRE_DORMANCY, // 084 Get the CDMA pre-dormancy settings + eQMI_WDS_SET_CAM_TIMER, // 085 Set the CAM timer + eQMI_WDS_GET_CAM_TIMER, // 086 Get the CAM timer + eQMI_WDS_SET_SCRM, // 087 Set SCRM status + eQMI_WDS_GET_SCRM, // 088 Get SCRM status + eQMI_WDS_SET_RDUD, // 089 Set RDUD status + eQMI_WDS_GET_RDUD, // 090 Get RDUD status + eQMI_WDS_GET_SIPMIP_CALL_TYPE, // 091 Set SIP/MIP call type + eQMI_WDS_SET_PM_PERIOD, // 092 Set EV-DO page monitor period + eQMI_WDS_PM_PERIOD_IND = 92, // 092 EV-DO page monitor period indication + eQMI_WDS_SET_FORCE_LONG_SLEEP, // 093 Set EV-DO force long sleep feature + eQMI_WDS_GET_PM_PERIOD, // 094 Get EV-DO page monitor period + eQMI_WDS_GET_CALL_THROTTLE, // 095 Get call throttle info + eQMI_WDS_GET_NSAPI, // 096 Get NSAPI + eQMI_WDS_SET_DUN_CTRL_PREF, // 097 Set DUN control preference + eQMI_WDS_GET_DUN_CTRL_INFO, // 098 Set DUN control info + eQMI_WDS_SET_DUN_CTRL_EVENT, // 099 Set DUN control event preference + eQMI_WDS_DUN_CTRL_IND = 99, // 099 DUN control event report indication + eQMI_WDS_PENDING_DUN_CTRL, // 100 Control pending DUN call + + eQMI_WDS_GET_DATA_SYS = 105, // 105 Get preferred data system + eQMI_WDS_GET_LAST_DATA_STATUS, // 106 Get last data call status + + eQMI_WDS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageWDS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageWDS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_WDS_ENUM_BEGIN && msgID <= eQMI_WDS_ABORT) + || (msgID >= eQMI_WDS_START_NET && msgID <= eQMI_WDS_GET_DORMANCY) + || (msgID >= eQMI_WDS_GET_AUTOCONNECT && msgID <= eQMI_WDS_MODEM_INFO_IND) + || (msgID >= eQMI_WDS_GET_ACTIVE_MIP && msgID <= eQMI_WDS_SET_IP_FAMILY) + || (msgID >= eQMI_WDS_SET_AUTOCONNECT && msgID <= eQMI_WDS_PENDING_DUN_CTRL) + || (msgID >= eQMI_WDS_GET_DATA_SYS && msgID < eQMI_WDS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageDMS Enumeration +// QMI DMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageDMS +{ + eQMI_DMS_ENUM_BEGIN = -1, + + eQMI_DMS_RESET, // 00 Reset DMS service state variables + eQMI_DMS_SET_EVENT, // 01 Set connection state report conditions + eQMI_DMS_EVENT_IND = 1, // 01 Connection state report indication + + eQMI_DMS_GET_CAPS = 32, // 32 Get the device capabilities + eQMI_DMS_GET_MANUFACTURER, // 33 Get the device manfacturer + eQMI_DMS_GET_MODEL_ID, // 34 Get the device model ID + eQMI_DMS_GET_REV_ID, // 35 Get the device revision ID + eQMI_DMS_GET_NUMBER, // 36 Get the assigned voice number + eQMI_DMS_GET_IDS, // 37 Get the ESN/IMEI/MEID + eQMI_DMS_GET_POWER_STATE, // 38 Get the get power state + eQMI_DMS_UIM_SET_PIN_PROT, // 39 UIM - Set PIN protection + eQMI_DMS_UIM_PIN_VERIFY, // 40 UIM - Verify PIN + eQMI_DMS_UIM_PIN_UNBLOCK, // 41 UIM - Unblock PIN + eQMI_DMS_UIM_PIN_CHANGE, // 42 UIM - Change PIN + eQMI_DMS_UIM_GET_PIN_STATUS, // 43 UIM - Get PIN status + eQMI_DMS_GET_MSM_ID = 44, // 44 Get MSM ID + eQMI_DMS_GET_OPERATING_MODE, // 45 Get the operating mode + eQMI_DMS_SET_OPERATING_MODE, // 46 Set the operating mode + eQMI_DMS_GET_TIME, // 47 Get timestamp from the device + eQMI_DMS_GET_PRL_VERSION, // 48 Get the PRL version + eQMI_DMS_GET_ACTIVATED_STATE, // 49 Get the activation state + eQMI_DMS_ACTIVATE_AUTOMATIC, // 50 Perform an automatic activation + eQMI_DMS_ACTIVATE_MANUAL, // 51 Perform a manual activation + eQMI_DMS_GET_USER_LOCK_STATE, // 52 Get the lock state + eQMI_DMS_SET_USER_LOCK_STATE, // 53 Set the lock state + eQMI_DMS_SET_USER_LOCK_CODE, // 54 Set the lock PIN + eQMI_DMS_READ_USER_DATA, // 55 Read user data + eQMI_DMS_WRITE_USER_DATA, // 56 Write user data + eQMI_DMS_READ_ERI_FILE, // 57 Read the enhanced roaming indicator file + eQMI_DMS_FACTORY_DEFAULTS, // 58 Reset to factory defaults + eQMI_DMS_VALIDATE_SPC, // 59 Validate service programming code + eQMI_DMS_UIM_GET_ICCID, // 60 Get UIM ICCID + eQMI_DMS_GET_FIRWARE_ID, // 61 Get firmware ID + eQMI_DMS_SET_FIRMWARE_ID, // 62 Set firmware ID + eQMI_DMS_GET_HOST_LOCK_ID, // 63 Get host lock ID + eQMI_DMS_UIM_GET_CK_STATUS, // 64 UIM - Get control key status + eQMI_DMS_UIM_SET_CK_PROT, // 65 UIM - Set control key protection + eQMI_DMS_UIM_UNBLOCK_CK, // 66 UIM - Unblock facility control key + eQMI_DMS_GET_IMSI, // 67 Get the IMSI + eQMI_DMS_UIM_GET_STATE, // 68 UIM - Get the UIM state + eQMI_DMS_GET_BAND_CAPS, // 69 Get the device band capabilities + eQMI_DMS_GET_FACTORY_ID, // 70 Get the device factory ID + eQMI_DMS_GET_FIRMWARE_PREF, // 71 Get firmware preference + eQMI_DMS_SET_FIRMWARE_PREF, // 72 Set firmware preference + eQMI_DMS_LIST_FIRMWARE, // 73 List all stored firmware + eQMI_DMS_DELETE_FIRMWARE, // 74 Delete specified stored firmware + eQMI_DMS_SET_TIME, // 75 Set device time + eQMI_DMS_GET_FIRMWARE_INFO, // 76 Get stored firmware info + eQMI_DMS_GET_ALT_NET_CFG, // 77 Get alternate network config + eQMI_DMS_SET_ALT_NET_CFG, // 78 Set alternate network config + eQMI_DMS_GET_IMG_DLOAD_MODE, // 79 Get next image download mode + eQMI_DMS_SET_IMG_DLOAD_MODE, // 80 Set next image download mode + eQMI_DMS_GET_SW_VERSION, // 81 Get software version + eQMI_DMS_SET_SPC, // 82 Set SPC + + eQMI_DMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageDMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageDMS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_DMS_ENUM_BEGIN && msgID <= eQMI_DMS_EVENT_IND) + || (msgID >= eQMI_DMS_GET_CAPS && msgID < eQMI_DMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageNAS Enumeration +// QMI NAS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageNAS +{ + eQMI_NAS_ENUM_BEGIN = -1, + + eQMI_NAS_RESET, // 00 Reset NAS service state variables + eQMI_NAS_ABORT, // 01 Abort previously issued NAS command + eQMI_NAS_SET_EVENT, // 02 Set NAS state report conditions + eQMI_NAS_EVENT_IND = 2, // 02 Connection state report indication + eQMI_NAS_SET_REG_EVENT, // 03 Set NAS registration report conditions + + eQMI_NAS_GET_RSSI = 32, // 32 Get the signal strength + eQMI_NAS_SCAN_NETS, // 33 Scan for visible network + eQMI_NAS_REGISTER_NET, // 34 Initiate a network registration + eQMI_NAS_ATTACH_DETACH, // 35 Initiate an attach or detach action + eQMI_NAS_GET_SS_INFO, // 36 Get info about current serving system + eQMI_NAS_SS_INFO_IND = 36, // 36 Current serving system info indication + eQMI_NAS_GET_HOME_INFO, // 37 Get info about home network + eQMI_NAS_GET_NET_PREF_LIST, // 38 Get the list of preferred networks + eQMI_NAS_SET_NET_PREF_LIST, // 39 Set the list of preferred networks + eQMI_NAS_GET_NET_BAN_LIST, // 40 Get the list of forbidden networks + eQMI_NAS_SET_NET_BAN_LIST, // 41 Set the list of forbidden networks + eQMI_NAS_SET_TECH_PREF, // 42 Set the technology preference + eQMI_NAS_GET_TECH_PREF, // 43 Get the technology preference + eQMI_NAS_GET_ACCOLC, // 44 Get the Access Overload Class + eQMI_NAS_SET_ACCOLC, // 45 Set the Access Overload Class + eQMI_NAS_GET_SYSPREF, // 46 Get the CDMA system preference + eQMI_NAS_GET_NET_PARAMS, // 47 Get various network parameters + eQMI_NAS_SET_NET_PARAMS, // 48 Set various network parameters + eQMI_NAS_GET_RF_INFO, // 49 Get the SS radio/band channel info + eQMI_NAS_GET_AAA_AUTH_STATUS, // 50 Get AN-AAA authentication status + eQMI_NAS_SET_SYS_SELECT_PREF, // 51 Set system selection preference + eQMI_NAS_GET_SYS_SELECT_PREF, // 52 Get system selection preference + eQMI_NAS_SYS_SELECT_IND = 52, // 52 System selection pref indication + + eQMI_NAS_SET_DDTM_PREF = 55, // 55 Set DDTM preference + eQMI_NAS_GET_DDTM_PREF, // 56 Get DDTM preference + eQMI_NAS_DDTM_IND = 56, // 56 DDTM preference indication + eQMI_NAS_GET_OPERATER_NAME, // 57 Get operator name data + eQMI_NAS_OPERATER_NAME_IND, // 58 Operator name data indication + eQMI_NAS_GET_PLMN_MODE, // 59 Get PLMN mode bit from CSP + eQMI_NAS_PLMN_MODE_IND, // 60 CSP PLMN mode bit indication + eQMI_NAS_UPDATE_AKEY, // 61 Update the A-KEY + eQMI_NAS_GET_3GPP2_SUBS_INFO, // 62 Get 3GPP2 subscription info + eQMI_NAS_SET_3GPP2_SUBS_INFO, // 63 Set 3GPP2 subscription info + eQMI_NAS_MOB_CAI_REV, // 64 Get mobile CAI revision information + eQMI_NAS_GET_RTRE_CONFIG, // 65 Get RTRE configuration information + eQMI_NAS_SET_RTRE_CONFIG, // 66 Set RTRE configuration information + eQMI_NAS_GET_CELL_LOC_INFO, // 67 Get cell location information + eQMI_NAS_GET_PLMN_NAME, // 68 Get operator name for specified network + eQMI_NAS_BIND_SUBS, // 69 Bind client to a specific subscription + eQMI_NAS_MANAGED_ROAMING_IND, // 70 Managed roaming indication + eQMI_NAS_DSB_PREF_IND, // 71 Dual standby preference indication + eQMI_NAS_SUBS_INFO_IND, // 72 Subscription info indication + eQMI_NAS_GET_MODE_PREF, // 73 Get mode preference + + eQMI_NAS_SET_DSB_PREF = 75, // 75 Set dual standby preference + eQMI_NAS_NETWORK_TIME_IND, // 76 Network time indication + eQMI_NAS_GET_SYSTEM_INFO, // 77 Get system info + eQMI_NAS_SYSTEM_INFO_IND, // 78 System info indication + eQMI_NAS_GET_SIGNAL_INFO, // 79 Get signal info + eQMI_NAS_CFG_SIGNAL_INFO, // 80 Configure signal info report + eQMI_NAS_SIGNAL_INFO_IND, // 81 Signal info indication + eQMI_NAS_GET_ERROR_RATE, // 82 Get error rate info + eQMI_NAS_ERROR_RATE_IND, // 83 Error rate indication + eQMI_NAS_EVDO_SESSION_IND, // 84 CDMA 1xEV-DO session close indication + eQMI_NAS_EVDO_UATI_IND, // 85 CDMA 1xEV-DO UATI update indication + eQMI_NAS_GET_EVDO_SUBTYPE, // 86 Get CDMA 1xEV-DO protocol subtype + eQMI_NAS_GET_EVDO_COLOR_CODE, // 87 Get CDMA 1xEV-DO color code + eQMI_NAS_GET_ACQ_SYS_MODE, // 88 Get current acquisition system mode + eQMI_NAS_SET_RX_DIVERSITY, // 89 Set the RX diversity + eQMI_NAS_GET_RX_TX_INFO, // 90 Get detailed RX/TX information + eQMI_NAS_UPDATE_AKEY_EXT, // 91 Update the A-KEY (extended) + eQMI_NAS_GET_DSB_PREF, // 92 Get dual standby preference + + eQMI_NAS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageNAS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageNAS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_NAS_ENUM_BEGIN && msgID <= eQMI_NAS_SET_REG_EVENT) + || (msgID >= eQMI_NAS_GET_RSSI && msgID <= eQMI_NAS_SYS_SELECT_IND) + || (msgID >= eQMI_NAS_SET_DDTM_PREF && msgID <= eQMI_NAS_GET_MODE_PREF) + || (msgID >= eQMI_NAS_SET_DSB_PREF && msgID < eQMI_NAS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageWMS Enumeration +// QMI WMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageWMS +{ + eQMI_WMS_ENUM_BEGIN = -1, + + eQMI_WMS_RESET, // 00 Reset WMS service state variables + eQMI_WMS_SET_EVENT, // 01 Set new message report conditions + eQMI_WMS_EVENT_IND = 1, // 01 New message report indication + + eQMI_WMS_RAW_SEND = 32, // 32 Send a raw message + eQMI_WMS_RAW_WRITE, // 33 Write a raw message to the device + eQMI_WMS_RAW_READ, // 34 Read a raw message from the device + eQMI_WMS_MODIFY_TAG, // 35 Modify message tag on the device + eQMI_WMS_DELETE, // 36 Delete message by index/tag/memory + + eQMI_WMS_GET_MSG_PROTOCOL = 48, // 48 Get the current message protocol + eQMI_WMS_GET_MSG_LIST, // 49 Get list of messages from the device + eQMI_WMS_SET_ROUTES, // 50 Set routes for message memory storage + eQMI_WMS_GET_ROUTES, // 51 Get routes for message memory storage + eQMI_WMS_GET_SMSC_ADDR, // 52 Get SMSC address + eQMI_WMS_SET_SMSC_ADDR, // 53 Set SMSC address + eQMI_WMS_GET_MSG_LIST_MAX, // 54 Get maximum size of SMS storage + eQMI_WMS_SEND_ACK, // 55 Send ACK + eQMI_WMS_SET_RETRY_PERIOD, // 56 Set retry period + eQMI_WMS_SET_RETRY_INTERVAL, // 57 Set retry interval + eQMI_WMS_SET_DC_DISCO_TIMER, // 58 Set DC auto-disconnect timer + eQMI_WMS_SET_MEMORY_STATUS, // 59 Set memory storage status + eQMI_WMS_SET_BC_ACTIVATION, // 60 Set broadcast activation + eQMI_WMS_SET_BC_CONFIG, // 61 Set broadcast config + eQMI_WMS_GET_BC_CONFIG, // 62 Get broadcast config + eQMI_WMS_MEMORY_FULL_IND, // 63 Memory full indication + eQMI_WMS_GET_DOMAIN_PREF, // 64 Get domain preference + eQMI_WMS_SET_DOMAIN_PREF, // 65 Set domain preference + eQMI_WMS_MEMORY_SEND, // 66 Send message from memory store + eQMI_WMS_GET_MSG_WAITING, // 67 Get message waiting info + eQMI_WMS_MSG_WAITING_IND, // 68 Message waiting indication + eQMI_WMS_SET_PRIMARY_CLIENT, // 69 Set client as primary client + eQMI_WMS_SMSC_ADDR_IND, // 70 SMSC address indication + eQMI_WMS_INDICATOR_REG, // 71 Register for indicators + eQMI_WMS_GET_TRANSPORT_INFO, // 72 Get transport layer info + eQMI_WMS_TRANSPORT_INFO_IND, // 73 Transport layer info indication + eQMI_WMS_GET_NW_REG_INFO, // 74 Get network registration info + eQMI_WMS_NW_REG_INFO_IND, // 75 Network registration info indication + eQMI_WMS_BIND_SUBSCRIPTION, // 76 Bind client to a subscription + eQMI_WMS_GET_INDICATOR_REG, // 77 Get indicator registration + eQMI_WMS_GET_SMS_PARAMETERS, // 78 Get SMS EF-SMSP parameters + eQMI_WMS_SET_SMS_PARAMETERS, // 79 Set SMS EF-SMSP parameters + eQMI_WMS_CALL_STATUS_IND, // 80 Call status indication + + eQMI_WMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageWMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageWMS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_WMS_ENUM_BEGIN && msgID <= eQMI_WMS_EVENT_IND) + || (msgID >= eQMI_WMS_RAW_SEND && msgID <= eQMI_WMS_DELETE) + || (msgID >= eQMI_WMS_GET_MSG_PROTOCOL && msgID < eQMI_WMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessagePDS Enumeration +// QMI PDS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessagePDS +{ + eQMI_PDS_ENUM_BEGIN = -1, + + eQMI_PDS_RESET, // 00 Reset PDS service state variables + eQMI_PDS_SET_EVENT, // 01 Set PDS report conditions + eQMI_PDS_EVENT_IND = 1, // 01 PDS report indication + + eQMI_PDS_GET_STATE = 32, // 32 Return PDS service state + eQMI_PDS_STATE_IND = 32, // 32 PDS service state indication + eQMI_PDS_SET_STATE, // 33 Set PDS service state + eQMI_PDS_START_SESSION, // 34 Start a PDS tracking session + eQMI_PDS_GET_SESSION_INFO, // 35 Get PDS tracking session info + eQMI_PDS_FIX_POSITION, // 36 Manual tracking session position + eQMI_PDS_END_SESSION, // 37 End a PDS tracking session + eQMI_PDS_GET_NMEA_CFG, // 38 Get NMEA sentence config + eQMI_PDS_SET_NMEA_CFG, // 39 Set NMEA sentence config + eQMI_PDS_INJECT_TIME, // 40 Inject a time reference + eQMI_PDS_GET_DEFAULTS, // 41 Get default tracking session config + eQMI_PDS_SET_DEFAULTS, // 42 Set default tracking session config + eQMI_PDS_GET_XTRA_PARAMS, // 43 Get the GPS XTRA parameters + eQMI_PDS_SET_XTRA_PARAMS, // 44 Set the GPS XTRA parameters + eQMI_PDS_FORCE_XTRA_DL, // 45 Force a GPS XTRA database download + eQMI_PDS_GET_AGPS_CONFIG, // 46 Get the AGPS mode configuration + eQMI_PDS_SET_AGPS_CONFIG, // 47 Set the AGPS mode configuration + eQMI_PDS_GET_SVC_AUTOTRACK, // 48 Get the service auto-tracking state + eQMI_PDS_SET_SVC_AUTOTRACK, // 49 Set the service auto-tracking state + eQMI_PDS_GET_COM_AUTOTRACK, // 50 Get COM port auto-tracking config + eQMI_PDS_SET_COM_AUTOTRACK, // 51 Set COM port auto-tracking config + eQMI_PDS_RESET_DATA, // 52 Reset PDS service data + eQMI_PDS_SINGLE_FIX, // 53 Request single position fix + eQMI_PDS_GET_VERSION, // 54 Get PDS service version + eQMI_PDS_INJECT_XTRA, // 55 Inject XTRA data + eQMI_PDS_INJECT_POSITION, // 56 Inject position data + eQMI_PDS_INJECT_WIFI, // 57 Inject Wi-Fi obtained data + eQMI_PDS_GET_SBAS_CONFIG, // 58 Get SBAS config + eQMI_PDS_SET_SBAS_CONFIG, // 59 Set SBAS config + eQMI_PDS_SEND_NI_RESPONSE, // 60 Send network initiated response + eQMI_PDS_INJECT_ABS_TIME, // 61 Inject absolute time + eQMI_PDS_INJECT_EFS, // 62 Inject EFS data + eQMI_PDS_GET_DPO_CONFIG, // 63 Get DPO config + eQMI_PDS_SET_DPO_CONFIG, // 64 Set DPO config + eQMI_PDS_GET_ODP_CONFIG, // 65 Get ODP config + eQMI_PDS_SET_ODP_CONFIG, // 66 Set ODP config + eQMI_PDS_CANCEL_SINGLE_FIX, // 67 Cancel single position fix + eQMI_PDS_GET_GPS_STATE, // 68 Get GPS state + eQMI_PDS_SET_PPM_EVT_REPORT, // 69 Set PPM event report + eQMI_PDS_SET_SPI_REPORT, // 70 Set SPI streaming reporting + eQMI_PDS_SET_SPI_RPT_IND = 70, // 70 Set SPI streaming indication + eQMI_PDS_SET_SPI_STATUS, // 71 Set SPI status + eQMI_PDS_SET_PPM_REPORT, // 72 Set PPM reporting state + eQMI_PDS_SET_PPM_RPT_IND = 72, // 72 Set PPM reporting state indication + eQMI_PDS_FORCE_RECEIVER_OFF, // 73 Force receiver off + + eQMI_PDS_GET_METHODS = 80, // 80 Get GPS position methods state + eQMI_PDS_SET_METHODS, // 81 Set GPS position methods state + eQMI_PDS_INJECT_SENSOR, // 82 Inject sensor data + eQMI_PDS_INJECT_TIME_SYNC, // 83 Inject time sync data + eQMI_PDS_GET_SENSOR_CFG, // 84 Get sensor config + eQMI_PDS_SET_SENSOR_CFG, // 85 Set sensor config + eQMI_PDS_GET_NAV_CFG, // 86 Get navigation config + eQMI_PDS_SET_NAV_CFG, // 87 Set navigation config + + eQMI_PDS_SET_WLAN_BLANK = 90, // 90 Set WLAN blanking + eQMI_PDS_SET_LBS_SC_RPT, // 91 Set LBS security challenge reporting + eQMI_PDS_LBS_SC_IND = 91, // 91 LBS security challenge indication + eQMI_PDS_SET_LBS_SC, // 92 Set LBS security challenge + eQMI_PDS_GET_LBS_ENCRYPT_CFG, // 93 Get LBS security encryption config + eQMI_PDS_SET_LBS_UPDATE_RATE, // 94 Set LBS security update rate + eQMI_PDS_SET_CELLDB_CONTROL, // 95 Set cell database control + eQMI_PDS_READY_IND, // 96 Ready indication + + eQMI_PDS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessagePDS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessagePDS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_PDS_ENUM_BEGIN && msgID <= eQMI_PDS_EVENT_IND) + || (msgID >= eQMI_PDS_GET_STATE && msgID <= eQMI_PDS_FORCE_RECEIVER_OFF) + || (msgID >= eQMI_PDS_GET_METHODS && msgID <= eQMI_PDS_SET_NAV_CFG) + || (msgID >= eQMI_PDS_SET_WLAN_BLANK && msgID < eQMI_PDS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageAUTH Enumeration +// QMI Authentication Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageAUTH +{ + eQMI_AUTH_ENUM_BEGIN = -1, + + eQMI_AUTH_START_EAP = 32, // 32 Start the EAP session + eQMI_AUTH_SEND_EAP, // 33 Send and receive EAP packets + eQMI_AUTH_EAP_RESULT_IND, // 34 EAP session result indication + eQMI_AUTH_GET_EAP_KEYS, // 35 Get the EAP session keys + eQMI_AUTH_END_EAP, // 36 End the EAP session + eQMI_AUTH_RUN_AKA, // 37 Runs the AKA algorithm + eQMI_AUTH_AKA_RESULT_IND, // 38 AKA algorithm result indication + + eQMI_AUTH_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageAUTH validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageAUTH msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_AUTH_START_EAP && msgID < eQMI_AUTH_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageAT Enumeration +// QMI AT Command Processor Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageAT +{ + eQMI_AT_ENUM_BEGIN = -1, + + eQMI_AT_RESET, // 00 Reset AT service state variables + + eQMI_AT_REG_COMMANDS = 32, // 32 Register AT commands to be forwarded + eQMI_AT_COMMAND_IND, // 33 AT command indication + eQMI_AT_SEND_RESPONSE, // 34 Send the response to an AT command + eQMI_AT_ABORT_IND, // 35 AT command abort indication + + eQMI_AT_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageAT validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageAT msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_AT_RESET) + || (msgID >= eQMI_AT_REG_COMMANDS && msgID < eQMI_AT_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + + +/*=========================================================================*/ +// eQMIMessageVoice Enumeration +// QMI Voice Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageVoice +{ + eQMI_VOICE_ENUM_BEGIN = -1, + + eQMI_VOICE_INDICATION_REG = 3, // 03 Set indication registration state + + eQMI_VOICE_CALL_ORIGINATE = 32, // 32 Originate a voice call + eQMI_VOICE_CALL_END, // 33 End a voice call + eQMI_VOICE_CALL_ANSWER, // 34 Answer incoming voice call + + eQMI_VOICE_GET_CALL_INFO = 36, // 36 Get call information + eQMI_VOICE_OTASP_STATUS_IND, // 37 OTASP/OTAPA event indication + eQMI_VOICE_INFO_REC_IND, // 38 New info record indication + eQMI_VOICE_SEND_FLASH, // 39 Send a simple flash + eQMI_VOICE_BURST_DTMF, // 40 Send a burst DTMF + eQMI_VOICE_START_CONT_DTMF, // 41 Starts a continuous DTMF + eQMI_VOICE_STOP_CONT_DTMF, // 42 Stops a continuous DTMF + eQMI_VOICE_DTMF_IND, // 43 DTMF event indication + eQMI_VOICE_SET_PRIVACY_PREF, // 44 Set privacy preference + eQMI_VOICE_PRIVACY_IND, // 45 Privacy change indication + eQMI_VOICE_ALL_STATUS_IND, // 46 Voice all call status indication + eQMI_VOICE_GET_ALL_STATUS, // 47 Get voice all call status + + eQMI_VOICE_MANAGE_CALLS = 49, // 49 Manage calls + eQMI_VOICE_SUPS_NOTIFICATION_IND, // 50 Supplementary service notifications + eQMI_VOICE_SET_SUPS_SERVICE, // 51 Manage supplementary service + eQMI_VOICE_GET_CALL_WAITING, // 52 Query sup service call waiting + eQMI_VOICE_GET_CALL_BARRING, // 53 Query sup service call barring + eQMI_VOICE_GET_CLIP, // 54 Query sup service CLIP + eQMI_VOICE_GET_CLIR, // 55 Query sup service CLIR + eQMI_VOICE_GET_CALL_FWDING, // 56 Query sup service call forwarding + eQMI_VOICE_SET_CALL_BARRING_PWD, // 57 Set call barring password + eQMI_VOICE_ORIG_USSD, // 58 Initiate USSD operation then wait + eQMI_VOICE_ANSWER_USSD, // 59 Answer USSD request + eQMI_VOICE_CANCEL_USSD, // 60 Cancel USSD operation + eQMI_VOICE_USSD_RELEASE_IND, // 61 USSD release indication + eQMI_VOICE_USSD_IND, // 62 USSD request/notification indication + eQMI_VOICE_UUS_IND, // 63 UUS information indication + eQMI_VOICE_SET_CONFIG, // 64 Set config + eQMI_VOICE_GET_CONFIG, // 65 Get config + eQMI_VOICE_SUPS_IND, // 66 Sup service request indication + eQMI_VOICE_ASYNC_ORIG_USSD, // 67 Initiate USSD operation + eQMI_VOICE_ASYNC_USSD_IND = 67, // 67 USSD request/notification indication + + eQMI_VOICE_BIND_SUBSCRIPTION, // 68 Bind subscription + eQMI_VOICE_ALS_SET_LINE_SW, // 69 ALS set line switching + eQMI_VOICE_ALS_SELECT_LINE, // 70 ALS select line + eQMI_VOICE_AOC_RESET_ACM, // 71 AOC reset ACM + eQMI_VOICE_AOC_SET_ACM_MAX, // 72 ACM set ACM maximum + eQMI_VOICE_AOC_GET_CM_INFO, // 73 AOC get call meter info + eQMI_VOICE_AOC_LOW_FUNDS_IND, // 74 AOC low funds indication + eQMI_VOICE_GET_COLP, // 75 Get COLP info + eQMI_VOICE_GET_COLR, // 76 Get COLR info + eQMI_VOICE_GET_CNAP, // 77 Get CNAP info + eQMI_VOICE_MANAGE_IP_CALLS, // 78 Manage VoIP calls + + eQMI_VOICE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageVoice validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageVoice msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_VOICE_INDICATION_REG) + || (msgID >= eQMI_VOICE_CALL_ORIGINATE && msgID <= eQMI_VOICE_CALL_ANSWER) + || (msgID >= eQMI_VOICE_GET_CALL_INFO && msgID <= eQMI_VOICE_GET_ALL_STATUS) + || (msgID >= eQMI_VOICE_MANAGE_CALLS && msgID < eQMI_VOICE_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageUIM Enumeration +// QMI UIM Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageUIM +{ + eQMI_UIM_ENUM_BEGIN = -1, + + eQMI_UIM_RESET, // 00 Reset + + eQMI_UIM_READ_TRANSPARENT = 32, // 32 Read data + eQMI_UIM_READ_TRANSPARENT_IND = 32, // 32 Read data indication + eQMI_UIM_READ_RECORD, // 33 Read one or more records + eQMI_UIM_READ_RECORD_IND = 33, // 33 Read records indication + eQMI_UIM_WRITE_TRANSPARENT, // 34 Write data + eQMI_UIM_WRITE_TRANSPARENT_IND = 34, // 34 Write data indication + eQMI_UIM_WRITE_RECORD, // 35 Write a record + eQMI_UIM_WRITE_RECORD_IND = 35, // 35 Write a record indication + eQMI_UIM_GET_FILE_ATTRIBUTES, // 36 Get file attributes + eQMI_UIM_GET_FILE_ATTRIBUTES_IND = 36, // 36 Get file attributes indication + eQMI_UIM_SET_PIN_PROTECTION, // 37 Set PIN protection + eQMI_UIM_SET_PIN_PROTECTION_IND = 37, // 37 Set PIN protection indication + eQMI_UIM_VERITFY_PIN, // 38 Verify PIN + eQMI_UIM_VERITFY_PIN_IND = 38, // 38 Verify PIN indication + eQMI_UIM_UNBLOCK_PIN, // 39 Unblock PIN + eQMI_UIM_UNBLOCK_PIN_IND = 39, // 39 Unblock PIN indication + eQMI_UIM_CHANGE_PIN, // 40 Change PIN + eQMI_UIM_CHANGE_PIN_IND = 40, // 40 Change PIN indication + eQMI_UIM_DEPERSONALIZATION, // 41 Depersonalization + eQMI_UIM_REFRESH_REGISTER, // 42 Refresh register + eQMI_UIM_REFRESH_OK, // 43 Validate refresh + eQMI_UIM_REFRESH_COMPLETE, // 44 Complete refresh + eQMI_UIM_GET_LAST_REFRESH_EVENT, // 45 Get last refresh event + eQMI_UIM_EVENT_REGISTRATION, // 46 Register for indications + eQMI_UIM_GET_CARD_STATUS, // 47 Get card status + eQMI_UIM_POWER_DOWN, // 48 Power down + eQMI_UIM_POWER_UP, // 49 Power up + eQMI_UIM_CARD_STATUS_IND, // 50 Card status indication + eQMI_UIM_REFRESH_IND, // 51 Refresh indication + eQMI_UIM_AUTHENTICATE, // 52 Authenticate + eQMI_UIM_AUTHENTICATE_IND = 52, // 52 Authenticate indication + eQMI_UIM_CLOSE_SESSION, // 53 Close session + eQMI_UIM_GET_SERVICE_STATUS, // 54 Get service status + eQMI_UIM_SET_SERVICE_STATUS, // 55 Set service status + eQMI_UIM_CHANGE_PROVISIONING, // 56 Change provisioning + eQMI_UIM_GET_LABEL, // 57 Get label + eQMI_UIM_GET_CONFIG, // 58 Get configuration + eQMI_UIM_SEND_ADPU, // 59 Send ADPU + eQMI_UIM_SAP_CONNECTION, // 60 SAP connection + eQMI_UIM_SAP_REQUEST, // 61 SAP request + eQMI_UIM_SAP_CONNECTION_IND, // 62 SAP connection indication + eQMI_UIM_LOGICAL_CHANNEL, // 63 Logical channel + eQMI_UIM_SUBSCRIPTION_OK, // 64 OK to publish subscription? + eQMI_UIM_GET_ATR, // 65 Get ATR + + eQMI_UIM_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageUIM validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageUIM msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_UIM_RESET) + || (msgID >= eQMI_UIM_READ_TRANSPARENT && msgID < eQMI_UIM_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessagePBM Enumeration +// QMI PBM Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessagePBM +{ + eQMI_PBM_ENUM_BEGIN = -1, + + eQMI_PBM_INDICATION_REG = 1, // 01 Set indication registration state + eQMI_PBM_GET_CAPABILITIES, // 02 Get phonebook capabilities by type + eQMI_PBM_GET_ALL_CAPABILITIES, // 03 Get all phonebook capabilities + eQMI_PBM_READ_RECORDS, // 04 Read phonebook records + eQMI_PBM_READ_RECORD_IND = 4, // 04 Read phonebook record indication + eQMI_PBM_WRITE_RECORD, // 05 Add/modify a phonebook record + eQMI_PBM_DELETE_RECORD, // 06 Delete a phonebook record + eQMI_PBM_DELETE_ALL_RECORDS, // 07 Delete all phonebook records + eQMI_PBM_SEARCH_RECORDS, // 08 Search phonebook records + eQMI_PBM_RECORD_UPDATE_IND, // 09 Phonebook record update indication + eQMI_PBM_REFRESH_IND, // 10 Phonebook refresh indication + eQMI_PBM_READY_IND, // 11 Phonebook ready indication + eQMI_PBM_EMERGENCY_LIST_IND, // 12 Phonebook emergency list indication + eQMI_PBM_ALL_READY_IND, // 13 All phonebooks ready indication + eQMI_PBM_GET_EMERGENCY_LIST, // 14 Get phonebook emergency list + eQMI_PBM_GET_ALL_GROUPS, // 15 Get all phonebook groups + eQMI_PBM_SET_GROUP_INFO, // 16 Set phonebook group info + eQMI_PBM_GET_STATE, // 17 Get phonebook state + eQMI_PBM_READ_ALL_HIDDEN_RECS, // 18 Read all hidden phonebook records + eQMI_PBM_HIDDEN_REC_STATUS_IND, // 19 Hidden record status indication + eQMI_PBM_GET_NEXT_EMPTY_REC_ID, // 20 Get next empty record ID + eQMI_PBM_GET_NEXT_REC_ID, // 21 Get next non-empty record ID + eQMI_PBM_GET_AAS_LIST, // 22 Get AAS list + eQMI_PBM_SET_AAS, // 23 Add/modify/delete AAS entry + eQMI_PBM_UPDATE_AAS_IND, // 24 AAS change indication + eQMI_PBM_UPDATE_GAS_IND, // 25 GAS change indication + eQMI_PBM_BIND_SUBSCRIPTION, // 26 Bind client to specific subscription + + eQMI_PBM_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessagePBM validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessagePBM msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_PBM_INDICATION_REG && msgID < eQMI_PBM_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageLOC Enumeration +// QMI LOC Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageLOC +{ + eQMI_LOC_ENUM_BEGIN = -1, + + eQMI_LOC_CLIENT_REVISION = 32, // 32 Send client revision to service + eQMI_LOC_REGISTER_EVENTS, // 33 Register for events/indications + eQMI_LOC_START, // 34 Start GPS session + eQMI_LOC_STOP, // 35 Start GPS session + eQMI_LOC_POSITION_REPORT_IND, // 36 Position report indication + eQMI_LOC_GNSS_SAT_INFO_IND, // 37 GNSS satellite info indication + eQMI_LOC_NMEA_IND, // 38 NMEA sentence indication + eQMI_LOC_NETWORK_REQ_IND, // 39 Network initiated request indication + eQMI_LOC_INJECT_TIME_REQ_IND, // 40 Inject time request indication + eQMI_LOC_INJECT_ORBITS_REQ_IND, // 41 Inject predicted orbits req ind + eQMI_LOC_INJECT_POS_REQ_IND, // 42 Inject position request indication + eQMI_LOC_ENGINE_STATE_IND, // 43 Engine state indication + eQMI_LOC_FIX_SESSION_STATE_IND, // 44 Fi session state indication + eQMI_LOC_WIFI_REQ_IND, // 45 Wi-Fi request indication + eQMI_LOC_SENSOR_DATA_IND, // 46 Sensor streaming ready status ind + eQMI_LOC_INJECT_TIME_SYNC_IND, // 47 Inject time sync data indication + eQMI_LOC_SPI_STREAM_REQ_IND, // 48 SPI streaming reports req indication + eQMI_LOC_SVR_CONNECTION_REQ_IND, // 49 Server connection req indication + eQMI_LOC_GET_REV_REQ, // 50 Get service revision + eQMI_LOC_GET_REV_REQ_IND = 50, // 50 Get service revision indication + eQMI_LOC_GET_FIX_CRIT, // 51 Get fix criteria + eQMI_LOC_GET_FIX_CRIT_IND = 51, // 51 Get fix criteria indication + eQMI_LOC_NI_USER_RSP, // 52 Network initiated user response + eQMI_LOC_NI_USER_RSP_IND = 52, // 52 Network initiated user response ind + eQMI_LOC_INJECT_ORBITS, // 53 Inject predicted orbits data + eQMI_LOC_INJECT_ORBITS_IND = 53, // 53 Inject predicted orbits indication + eQMI_LOC_GET_ORBIT_SRC, // 54 Get predicted orbits data source + eQMI_LOC_GET_ORBIT_SRC_IND = 54, // 54 Get predicted orbits data source ind + eQMI_LOC_GET_ORBIT_VLD, // 55 Get predicted orbits data validity + eQMI_LOC_GET_ORBIT_VLD_IND = 55, // 55 Get predicted orbits validity ind + eQMI_LOC_INJECT_UTC, // 56 Inject UTC time + eQMI_LOC_INJECT_UTC_IND = 56, // 56 Inject UTC time indication + eQMI_LOC_INJECT_POS, // 57 Inject position + eQMI_LOC_INJECT_POS_IND = 57, // 57 Inject position indication + eQMI_LOC_SET_ENG_LOCK, // 58 Set engine lock + eQMI_LOC_SET_ENG_LOCK_IND = 58, // 58 Set engine lock indication + eQMI_LOC_GET_ENG_LOCK, // 59 Get engine lock + eQMI_LOC_GET_ENG_LOCK_IND = 59, // 59 Get engine lock indication + eQMI_LOC_SET_SBAS_CFG, // 60 Set SBAS config + eQMI_LOC_SET_SBAS_CFG_IND = 60, // 60 Set SBAS config indication + eQMI_LOC_GET_SBAS_CFG, // 61 Get SBAS config + eQMI_LOC_GET_SBAS_CFG_IND = 61, // 61 Get SBAS config indication + eQMI_LOC_SET_NMEA_TYPS, // 62 Set NMEA sentence types + eQMI_LOC_SET_NMEA_TYPS_IND = 62, // 62 Set NMEA sentence types indication + eQMI_LOC_GET_NMEA_TYPS, // 63 Get NMEA sentence types + eQMI_LOC_GET_NMEA_TYPS_IND = 63, // 63 Get NMEA sentence types indication + eQMI_LOC_SET_LPM_CFG, // 64 Set low power mode config + eQMI_LOC_SET_LPM_CFG_IND = 64, // 64 Set low power mode config indication + eQMI_LOC_GET_LPM_CFG, // 65 Get low power mode config + eQMI_LOC_GET_LPM_CFG_IND = 65, // 65 Get low power mode config indication + eQMI_LOC_SET_SERVER, // 66 Set A-GPS server + eQMI_LOC_SET_SERVER_IND = 66, // 66 Set A-GPS server indication + eQMI_LOC_GET_SERVER, // 67 Set A-GPS server + eQMI_LOC_GET_SERVER_IND = 67, // 67 Set A-GPS server indication + eQMI_LOC_DEL_ASST_DATA, // 68 Delete assistance data + eQMI_LOC_DEL_ASST_DATA_IND = 68, // 68 Delete assistance data indication + eQMI_LOC_SET_XTRA_T, // 69 Set XTRA_T session control + eQMI_LOC_SET_XTRA_T_IND = 69, // 69 Set XTRA_T session control indication + eQMI_LOC_GET_XTRA_T, // 70 Get XTRA_T session control + eQMI_LOC_GET_XTRA_T_IND = 70, // 70 Get XTRA_T session control indication + eQMI_LOC_INJECT_WIFI, // 71 Inject Wi-Fi info + eQMI_LOC_INJECT_WIFI_IND = 71, // 71 Inject Wi-Fi info indication + eQMI_LOC_NOTIFY_WIFI, // 72 Notify server of Wi-Fi status + eQMI_LOC_NOTIFY_WIFI_IND = 72, // 72 Notify server of Wi-Fi status ind + eQMI_LOC_GET_REG_EVENTS, // 73 Get registered event status + eQMI_LOC_GET_REG_EVENTS_IND = 73,// 73 Get registered event status ind + eQMI_LOC_SET_OP_MODE, // 74 Set operation mode + eQMI_LOC_SET_OP_MODE_IND = 74, // 74 Set operation mode indication + eQMI_LOC_GET_OP_MODE, // 75 Get operation mode + eQMI_LOC_GET_OP_MODE_IND = 75, // 75 Get operation mode indication + eQMI_LOC_SET_SPI_STATUS, // 76 Set SPI status + eQMI_LOC_SET_SPI_STATUS_IND = 76,// 76 Set SPI status indication + eQMI_LOC_INJECT_SENSOR, // 77 Inject sensor data + eQMI_LOC_INJECT_SENSOR_IND = 77, // 77 Inject sensor data indication + eQMI_LOC_INJ_TIME_SYNC, // 78 Inject time sync data + eQMI_LOC_INJ_TIME_SYNC_IND = 78, // 78 Inject time sync data indication + eQMI_LOC_SET_CRADLE, // 79 Set cradle mount config + eQMI_LOC_SET_CRADLE_IND = 79, // 79 Set cradle mount config indication + eQMI_LOC_GET_CRADLE, // 80 Get cradle mount config + eQMI_LOC_GET_CRADLE_IND = 80, // 80 Get cradle mount config indication + eQMI_LOC_SET_EXT_POWER, // 81 Set external power config + eQMI_LOC_SET_EXT_POWER_IND = 81, // 81 Set external power config indication + eQMI_LOC_GET_EXT_POWER, // 82 Get external power config + eQMI_LOC_GET_EXT_POWER_IND = 82, // 82 Get external power config indication + eQMI_LOC_INFORM_CONN, // 83 Inform service of connection status + eQMI_LOC_INFORM_CONN_IND = 83, // 83 Inform connection status indication + eQMI_LOC_SET_PROTO_CFG, // 84 Set protocol config + eQMI_LOC_SET_PROTO_CFG_IND = 84, // 84 Set protocol config indication + eQMI_LOC_GET_PROTO_CFG, // 85 Get protocol config + eQMI_LOC_GET_PROTO_CFG_IND = 85, // 85 Get protocol config indication + eQMI_LOC_SET_SENSOR_CFG, // 86 Set sensor control config + eQMI_LOC_SET_SENSOR_CFG_IND = 86,// 86 Set sensor control config indication + eQMI_LOC_GET_SENSOR_CFG, // 87 Get sensor control config + eQMI_LOC_GET_SENSOR_CFG_IND = 87,// 87 Get sensor control config indication + eQMI_LOC_SET_SENSOR_PRP, // 88 Set sensor properties + eQMI_LOC_SET_SENSOR_PRP_IND = 88,// 88 Set sensor properties indication + eQMI_LOC_GET_SENSOR_PRP, // 89 Get sensor properties + eQMI_LOC_GET_SENSOR_PRP_IND = 89,// 89 Get sensor properties indication + eQMI_LOC_SET_SENSOR_PRF, // 90 Set sensor performance control + eQMI_LOC_SET_SENSOR_PRF_IND = 90,// 90 Set sensor performance control ind + eQMI_LOC_GET_SENSOR_PRF, // 91 Get sensor performance control + eQMI_LOC_GET_SENSOR_PRF_IND = 91,// 91 Get sensor performance control ind + + eQMI_LOC_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageLOC validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageLOC msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_LOC_CLIENT_REVISION && msgID < eQMI_LOC_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageSAR Enumeration +// QMI SAR Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageSAR +{ + eQMI_SAR_ENUM_BEGIN = -1, + + eQMI_SAR_SET_RF_SAR_STATE = 1, // 01 Set the RF SAR state + eQMI_SAR_GET_RF_SAR_STATE, // 02 Get the RF SAR state + + eQMI_SAR_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageSAR validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageSAR msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_SAR_SET_RF_SAR_STATE && msgID < eQMI_SAR_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageRMTFS Enumeration +// QMI Remote Filesystem Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageRMTFS +{ + eQMI_RMTFS_ENUM_BEGIN = -1, + + eQMI_RMTFS_OPEN = 1, // 01 Request an open + eQMI_RMTFS_CLOSE, // 02 Request a close + eQMI_RMTFS_IO_VECTOR, // 03 Request an I/O vector operation + eQMI_RMTFS_ALLOC_BUFFER, // 04 Allocate a buffer + eQMI_RMTFS_GET_DEV_ERROR, // 05 Return device error for last request + eQMI_RMTFS_FORCE_SYNC_IND, // 06 Force sync indication + + eQMI_RMTFS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageRMTFS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageRMTFS msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_RMTFS_OPEN && msgID < eQMI_RMTFS_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageCAT Enumeration +// QMI CAT Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageCAT +{ + eQMI_CAT_ENUM_BEGIN = -1, + + eQMI_CAT_RESET, // 00 Reset CAT service state variables + eQMI_CAT_SET_EVENT, // 01 Set new message report conditions + eQMI_CAT_EVENT_IND = 1, // 01 New message report indication + + eQMI_CAT_GET_STATE = 32, // 32 Get service state information + eQMI_CAT_SEND_TERMINAL, // 33 Send a terminal response + eQMI_CAT_SEND_ENVELOPE, // 34 Send an envelope command + eQMI_CAT_GET_EVENT, // 35 Get last message report + eQMI_CAT_SEND_DECODED_TERMINAL, // 36 Send a decoded terminal response + eQMI_CAT_SEND_DECODED_ENVELOPE, // 37 Send a decoded envelope command + eQMI_CAT_EVENT_CONFIRMATION, // 38 Event confirmation + eQMI_CAT_SCWS_OPEN_CHANNEL, // 39 Open a channel to a SCWS + eQMI_CAT_SCWS_OPEN_IND = 39, // 39 SCWS open channel indication + eQMI_CAT_SCWS_CLOSE_CHANNEL, // 40 Close a channel to a SCWS + eQMI_CAT_SCWS_CLOSE_IND = 40, // 40 SCWS close channel indication + eQMI_CAT_SCWS_SEND_DATA, // 41 Send data to a SCWS + eQMI_CAT_SCWS_SEND_IND = 41, // 41 SCWS send data indication + eQMI_CAT_SCWS_DATA_AVAILABLE, // 42 Indicate that data is available + eQMI_CAT_SCWS_CHANNEL_STATUS, // 43 Provide channel status + + eQMI_CAT_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageCAT validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageCAT msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_CAT_ENUM_BEGIN && msgID <= eQMI_CAT_EVENT_IND) + || (msgID >= eQMI_CAT_GET_STATE && msgID < eQMI_CAT_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageRMS Enumeration +// QMI RMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageRMS +{ + eQMI_RMS_ENUM_BEGIN = -1, + + eQMI_RMS_RESET, // 00 Reset RMS service state variables + + eQMI_RMS_GET_SMS_WAKE = 32, // 32 Get SMS wake settings + eQMI_RMS_SET_SMS_WAKE, // 33 Set SMS wake settings + + eQMI_RMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageRMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageRMS msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_RMS_RESET) + || (msgID >= eQMI_RMS_GET_SMS_WAKE && msgID < eQMI_RMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageOMA Enumeration +// QMI OMA-DM Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageOMA +{ + eQMI_OMA_ENUM_BEGIN = -1, + + eQMI_OMA_RESET, // 00 Reset OMA service state variables + eQMI_OMA_SET_EVENT, // 01 Set OMA report conditions + eQMI_OMA_EVENT_IND = 1, // 01 OMA report indication + + eQMI_OMA_START_SESSION = 32, // 32 Start client inititated session + eQMI_OMA_CANCEL_SESSION, // 33 Cancel session + eQMI_OMA_GET_SESSION_INFO, // 34 Get session information + eQMI_OMA_SEND_SELECTION, // 35 Send selection for net inititated msg + eQMI_OMA_GET_FEATURES, // 36 Get feature settings + eQMI_OMA_SET_FEATURES, // 37 Set feature settings + + eQMI_OMA_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageOMA validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageOMA msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_OMA_ENUM_BEGIN && msgID <= eQMI_OMA_EVENT_IND) + || (msgID >= eQMI_OMA_START_SESSION && msgID < eQMI_OMA_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIResultCode Enumeration +// QMI Result Code Enumeration +/*=========================================================================*/ +enum eQMIResultCode +{ + eQMI_RC_ENUM_BEGIN = -1, + + eQMI_RC_SUCCESS, // 00 Success + eQMI_RC_ERROR, // 01 Error + + eQMI_RC_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIResultCode validity check + +PARAMETERS: + rc [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIResultCode rc ) +{ + bool retVal = false; + if (rc > eQMI_RC_ENUM_BEGIN && rc < eQMI_RC_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIErrorCode Enumeration +// QMI Error Code Enumeration +/*=========================================================================*/ +enum eQMIErrorCode +{ + eQMI_ERR_ENUM_BEGIN = -1, + + eQMI_ERR_NONE, // 00 + eQMI_ERR_MALFORMED_MSG, // 01 + eQMI_ERR_NO_MEMORY, // 02 + eQMI_ERR_INTERNAL, // 03 + eQMI_ERR_ABORTED, // 04 + eQMI_ERR_CLIENT_IDS_EXHAUSTED, // 05 + eQMI_ERR_UNABORTABLE_TRANSACTION, // 06 + eQMI_ERR_INVALID_CLIENT_ID, // 07 + eQMI_ERR_NO_THRESHOLDS, // 08 + eQMI_ERR_INVALID_HANDLE, // 09 + eQMI_ERR_INVALID_PROFILE, // 10 + eQMI_ERR_INVALID_PIN_ID, // 11 + eQMI_ERR_INCORRECT_PIN, // 12 + eQMI_ERR_NO_NETWORK_FOUND, // 13 + eQMI_ERR_CALL_FAILED, // 14 + eQMI_ERR_OUT_OF_CALL, // 15 + eQMI_ERR_NOT_PROVISIONED, // 16 + eQMI_ERR_MISSING_ARG, // 17 + eQMI_ERR_18, // 18 + eQMI_ERR_ARG_TOO_LONG, // 19 + eQMI_ERR_20, // 20 + eQMI_ERR_21, // 21 + eQMI_ERR_INVALID_TX_ID, // 22 + eQMI_ERR_DEVICE_IN_USE, // 23 + eQMI_ERR_OP_NETWORK_UNSUPPORTED, // 24 + eQMI_ERR_OP_DEVICE_UNSUPPORTED, // 25 + eQMI_ERR_NO_EFFECT, // 26 + eQMI_ERR_NO_FREE_PROFILE, // 27 + eQMI_ERR_INVALID_PDP_TYPE, // 28 + eQMI_ERR_INVALID_TECH_PREF, // 29 + eQMI_ERR_INVALID_PROFILE_TYPE, // 30 + eQMI_ERR_INVALID_SERVICE_TYPE, // 31 + eQMI_ERR_INVALID_REGISTER_ACTION, // 32 + eQMI_ERR_INVALID_PS_ATTACH_ACTION, // 33 + eQMI_ERR_AUTHENTICATION_FAILED, // 34 + eQMI_ERR_PIN_BLOCKED, // 35 + eQMI_ERR_PIN_ALWAYS_BLOCKED, // 36 + eQMI_ERR_UIM_UNINITIALIZED, // 37 + eQMI_ERR_MAX_QOS_REQUESTS_IN_USE, // 38 + eQMI_ERR_INCORRECT_FLOW_FILTER, // 39 + eQMI_ERR_NETWORK_QOS_UNAWARE, // 40 + eQMI_ERR_INVALID_QOS_ID, // 41 + eQMI_ERR_REQUESTED_NUM_UNSUPPORTED, // 42 + eQMI_ERR_INTERFACE_NOT_FOUND, // 43 + eQMI_ERR_FLOW_SUSPENDED, // 44 + eQMI_ERR_INVALID_DATA_FORMAT, // 45 + eQMI_ERR_GENERAL, // 46 + eQMI_ERR_UNKNOWN, // 47 + eQMI_ERR_INVALID_ARG, // 48 + eQMI_ERR_INVALID_INDEX, // 49 + eQMI_ERR_NO_ENTRY, // 50 + eQMI_ERR_DEVICE_STORAGE_FULL, // 51 + eQMI_ERR_DEVICE_NOT_READY, // 52 + eQMI_ERR_NETWORK_NOT_READY, // 53 + eQMI_ERR_WMS_CAUSE_CODE, // 54 + eQMI_ERR_WMS_MESSAGE_NOT_SENT, // 55 + eQMI_ERR_WMS_MESSAGE_DELIVERY_FAILURE, // 56 + eQMI_ERR_WMS_INVALID_MESSAGE_ID, // 57 + eQMI_ERR_WMS_ENCODING, // 58 + eQMI_ERR_AUTHENTICATION_LOCK, // 59 + eQMI_ERR_INVALID_TRANSITION, // 60 + eQMI_ERR_61, // 61 + eQMI_ERR_62, // 62 + eQMI_ERR_63, // 63 + eQMI_ERR_64, // 64 + eQMI_ERR_SESSION_INACTIVE, // 65 + eQMI_ERR_SESSION_INVALID, // 66 + eQMI_ERR_SESSION_OWNERSHIP, // 67 + eQMI_ERR_INSUFFICIENT_RESOURCES, // 68 + eQMI_ERR_DISABLED, // 69 + eQMI_ERR_INVALID_OPERATION, // 70 + eQMI_ERR_INVALID_QMI_CMD, // 71 + eQMI_ERR_WMS_TPDU_TYPE, // 72 + eQMI_ERR_WMS_SMSC_ADDR, // 73 + eQMI_ERR_INFO_UNAVAILABLE, // 74 + eQMI_ERR_SEGMENT_TOO_LONG, // 75 + eQMI_ERR_SEGMENT_ORDER, // 76 + eQMI_ERR_BUNDLING_NOT_SUPPORTED, // 77 + eQMI_ERR_78, // 78 + eQMI_ERR_POLICY_MISMATCH, // 79 + eQMI_ERR_SIM_FILE_NOT_FOUND, // 80 + eQMI_ERR_EXTENDED_EXTERNAL, // 81 + eQMI_ERR_ACCESS_DENIED, // 82 + eQMI_ERR_HARDWARE_RESTRICTED, // 83 + eQMI_ERR_ACK_NOT_SENT, // 84 + + eQMI_ERR_INCOMPATIBLE_STATE = 90, // 90 + eQMI_ERR_FDN_RESTRICT, // 91 + eQMI_ERR_SUPS_FAILURE_CAUSE, // 92 + eQMI_ERR_NO_RADIO, // 93 + eQMI_ERR_NOT_SUPPORTED, // 94 + + eQMI_ERR_CARD_CALL_CONTROL_FAILED = 96, // 96 + eQMI_ERR_NETWORK_ABORTED, // 97 + + eQMI_ERR_CAT_EVT_REG_FAILED, // 61441 + eQMI_ERR_CAT_INVALID_TR, // 61442 + eQMI_ERR_CAT_INVALID_ENV_CMD, // 61443 + eQMI_ERR_CAT_ENV_CMD_BUSY, // 61444 + eQMI_ERR_CAT_ENV_CMD_FAIL, // 61445 + + eQMI_ERR_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIErrorCode validity check + +PARAMETERS: + ec [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIErrorCode ec ) +{ + bool retVal = false; + if ( (ec > eQMI_ERR_ENUM_BEGIN && ec <= eQMI_ERR_ACK_NOT_SENT) + || (ec >= eQMI_ERR_INCOMPATIBLE_STATE && ec <= eQMI_ERR_NOT_SUPPORTED) + || (ec == eQMI_ERR_CARD_CALL_CONTROL_FAILED) + || (ec == eQMI_ERR_NETWORK_ABORTED) + || (ec >= eQMI_ERR_CAT_EVT_REG_FAILED && ec < eQMI_ERR_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMICallEndReason Enumeration +// QMI Call End Reason Enumeration +/*=========================================================================*/ +enum eQMICallEndReason +{ + eQMI_CALL_END_REASON_BEGIN = -1, + + // General + eQMI_CALL_END_REASON_UNSPECIFIED = 1, // 1 + eQMI_CALL_END_REASON_CLIENT_END, // 2 + eQMI_CALL_END_REASON_NO_SRV, // 3 + eQMI_CALL_END_REASON_FADE, // 4 + eQMI_CALL_END_REASON_REL_NORMAL, // 5 + eQMI_CALL_END_REASON_ACC_IN_PROG, // 6 + eQMI_CALL_END_REASON_ACC_FAIL, // 7 + eQMI_CALL_END_REASON_REDIR_OR_HANDOFF, // 8 + eQMI_CALL_END_REASON_CLOSE_IN_PROGRESS, // 9 + eQMI_CALL_END_REASON_AUTH_FAILED, // 10 + eQMI_CALL_END_REASON_INTERNAL, // 11 + + // CDMA + eQMI_CALL_END_REASON_CDMA_LOCK = 500, // 500 + eQMI_CALL_END_REASON_INTERCEPT, // 501 + eQMI_CALL_END_REASON_REORDER, // 502 + eQMI_CALL_END_REASON_REL_SO_REJ, // 503 + eQMI_CALL_END_REASON_INCOM_CALL, // 504 + eQMI_CALL_END_REASON_ALERT_STOP, // 505 + eQMI_CALL_END_REASON_ACTIVATION, // 506 + eQMI_CALL_END_REASON_MAX_ACCESS_PROBE, // 507 + eQMI_CALL_END_REASON_CCS_NOT_SUPPORTED_BY_BS, // 508 + eQMI_CALL_END_REASON_NO_RESPONSE_FROM_BS, // 509 + eQMI_CALL_END_REASON_REJECTED_BY_BS, // 510 + eQMI_CALL_END_REASON_INCOMPATIBLE, // 511 + eQMI_CALL_END_REASON_ALREADY_IN_TC, // 512 + eQMI_CALL_END_REASON_USER_CALL_ORIG_DURING_GPS, // 513 + eQMI_CALL_END_REASON_USER_CALL_ORIG_DURING_SMS, // 514 + eQMI_CALL_END_REASON_NO_CDMA_SRV, // 515 + + // GSM/WCDMA + eQMI_CALL_END_REASON_CONF_FAILED = 1000, // 1000 + eQMI_CALL_END_REASON_INCOM_REJ, // 1001 + eQMI_CALL_END_REASON_NO_GW_SRV, // 1002 + eQMI_CALL_END_REASON_NETWORK_END, // 1003 + eQMI_CALL_END_REASON_LLC_SNDCP_FAILURE, // 1004 + eQMI_CALL_END_REASON_INSUFFICIENT_RESOURCES, // 1005 + eQMI_CALL_END_REASON_OPTION_TEMP_OOO, // 1006 + eQMI_CALL_END_REASON_NSAPI_ALREADY_USED, // 1007 + eQMI_CALL_END_REASON_REGULAR_DEACTIVATION, // 1008 + eQMI_CALL_END_REASON_NETWORK_FAILURE, // 1009 + eQMI_CALL_END_REASON_UMTS_REATTACH_REQ, // 1010 + eQMI_CALL_END_REASON_UMTS_PROTOCOL_ERROR, // 1011 + eQMI_CALL_END_REASON_OPERATOR_BARRING, // 1012 + eQMI_CALL_END_REASON_UNKNOWN_APN, // 1013 + eQMI_CALL_END_REASON_UNKNOWN_PDP, // 1014 + eQMI_CALL_END_REASON_GGSN_REJECT, // 1015 + eQMI_CALL_END_REASON_ACTIVATION_REJECT, // 1016 + eQMI_CALL_END_REASON_OPTION_NOT_SUPPORTED, // 1017 + eQMI_CALL_END_REASON_OPTION_UNSUBSCRIBED, // 1018 + eQMI_CALL_END_REASON_QOS_NOT_ACCEPTED, // 1019 + eQMI_CALL_END_REASON_TFT_SEMANTIC_ERROR, // 1020 + eQMI_CALL_END_REASON_TFT_SYNTAX_ERROR, // 1021 + eQMI_CALL_END_REASON_UNKNOWN_PDP_CONTEXT, // 1022 + eQMI_CALL_END_REASON_FILTER_SEMANTIC_ERROR, // 1023 + eQMI_CALL_END_REASON_FILTER_SYNTAX_ERROR, // 1024 + eQMI_CALL_END_REASON_PDP_WITHOUT_ACTIVE_TFT, // 1025 + eQMI_CALL_END_REASON_INVALID_TRANSACTION_ID, // 1026 + eQMI_CALL_END_REASON_MESSAGE_SEMANTIC_ERROR, // 1027 + eQMI_CALL_END_REASON_INVALID_MANDATORY_INFO, // 1028 + eQMI_CALL_END_REASON_TYPE_UNSUPPORTED, // 1029 + eQMI_CALL_END_REASON_MSG_TYPE_WRONG_FOR_STATE, // 1030 + eQMI_CALL_END_REASON_UNKNOWN_INFO_ELEMENT, // 1031 + eQMI_CALL_END_REASON_CONDITIONAL_IE_ERROR, // 1032 + eQMI_CALL_END_REASON_MSG_WRONG_FOR_PROTOCOL, // 1033 + eQMI_CALL_END_REASON_APN_TYPE_CONFLICT, // 1034 + eQMI_CALL_END_REASON_NO_GPRS_CONTEXT, // 1035 + eQMI_CALL_END_REASON_FEATURE_NOT_SUPPORTED, // 1036 + + // CDMA 1xEV-DO (HDR) + eQMI_CALL_END_REASON_CD_GEN_OR_BUSY = 1500, // 1500 + eQMI_CALL_END_REASON_CD_BILL_OR_AUTH, // 1501 + eQMI_CALL_END_REASON_CHG_HDR, // 1502 + eQMI_CALL_END_REASON_EXIT_HDR, // 1503 + eQMI_CALL_END_REASON_HDR_NO_SESSION , // 1504 + eQMI_CALL_END_REASON_HDR_ORIG_DURING_GPS_FIX, // 1505 + eQMI_CALL_END_REASON_HDR_CS_TIMEOUT , // 1506 + eQMI_CALL_END_REASON_HDR_RELEASED_BY_CM, // 1507 + + eQMI_CALL_END_REASON_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMICallEndReason validity check + +PARAMETERS: + err [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMICallEndReason err ) +{ + if ( (err >= eQMI_CALL_END_REASON_UNSPECIFIED) + && (err <= eQMI_CALL_END_REASON_INTERNAL) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CDMA_LOCK) + && (err <= eQMI_CALL_END_REASON_NO_CDMA_SRV) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CONF_FAILED) + && (err <= eQMI_CALL_END_REASON_FEATURE_NOT_SUPPORTED) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CD_GEN_OR_BUSY) + && (err <= eQMI_CALL_END_REASON_HDR_RELEASED_BY_CM) ) + { + return true; + } + + return false; +}; + diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/QMIProtocolServer.cpp b/gobi-api/Gobi_2011-11-28-1533/Core/QMIProtocolServer.cpp new file mode 100755 index 0000000..e1cb4a2 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/QMIProtocolServer.cpp @@ -0,0 +1,378 @@ +/*=========================================================================== +FILE: + QMIProtocolServer.h + +DESCRIPTION: + QMI protocol server + +PUBLIC CLASSES AND METHODS: + cQMIProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QMIProtocolServer.h" +#include "QMIBuffers.h" + +/*=========================================================================*/ +// cQMIProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cQMIProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + serviceType [ I ] - QMI service type requested + bufferSzRx [ I ] - Size of data buffer for incoming data + logSz [ I ] - Size of log (number of buffers) + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQMIProtocolServer::cQMIProtocolServer( + eQMIService serviceType, + ULONG bufferSzRx, + ULONG logSz ) + : cProtocolServer( MapQMIServiceToProtocol( serviceType, false ), + MapQMIServiceToProtocol( serviceType, true ), + bufferSzRx, + logSz ), + mLastTID( (WORD)INVALID_QMI_TRANSACTION_ID ), + mService( serviceType ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cQMIProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQMIProtocolServer::~cQMIProtocolServer() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the configured QMI service using the given QMI + control file + +PARAMETERS: + pControlFile [ I ] - QMI control file + +SEQUENCING: + This method is sequenced according to the command event, i.e. any + other thread that needs to send a command to the protocol server + thread will block until this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::Connect( LPCSTR pControlFile ) +{ + // Assume failure + bool bRC = false; + if (IsValid( mService ) == false || mService == eQMI_SVC_CONTROL) + { + return bRC; + } + + // Pass service file to base class for actual connection + bRC = cProtocolServer::Connect( pControlFile ); + + if (bRC == false) + { + TRACE( "QMI connect %d failed\n", mService ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateRequest (Internal Method) + +DESCRIPTION: + Validate a request that is about to be scheduled + +SEQUENCING: + This method is sequenced according to the command event, i.e. any + other thread that needs to send a command to the protocol server + thread will block until this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::ValidateRequest( const sProtocolRequest & req ) +{ + if (cProtocolServer::ValidateRequest( req ) == false) + { + return false; + } + + sQMIServiceBuffer qmiReq( req.GetSharedBuffer() ); + return qmiReq.IsValid(); +} + +/*=========================================================================== +METHOD: + InitializeComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port initialization + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::InitializeComm() +{ + // Setup the QMI Service type + int result = mComm.RunIOCTL( QMI_GET_SERVICE_FILE_IOCTL, + (void*)(unsigned long)mService ); + + TRACE( "ioctl status %d\n", result ); + + if (result == 0) + { + return true; + } + else + { + return false; + } +} + +/*=========================================================================== +METHOD: + CleanupComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port cleanup + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::CleanupComm() +{ + // Nothing to actually do here + return true; +} + +/*=========================================================================== +METHOD: + DecodeRxData (Internal Method) + +DESCRIPTION: + Decode incoming data into QMI indications/responses + +PARAMETERS: + bytesReceived [ I ] - Number of bytes to decoded + rspIdx [ O ] - Log index of last valid response (not used) + bAbortTx [ O ] - Response aborts current transmission? (not used) + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool - Was a response received? +===========================================================================*/ +bool cQMIProtocolServer::DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ) +{ + // Assume failure + bool bRC = false; + + rspIdx = INVALID_LOG_INDEX; + bAbortTx = false; + + // Something to decode from? + if (bytesReceived == 0) + { + return bRC; + } + + // Set protocol type (we have to be dealing with a valid QMI service) + eProtocolType pt = MapQMIServiceToProtocol( mService, false ); + if (pt == ePROTOCOL_ENUM_BEGIN) + { + return bRC; + } + + sSharedBuffer * pTmp = 0; + pTmp = new sSharedBuffer( mpRxBuffer, bytesReceived, pt ); + if (pTmp != 0) + { + sQMIServiceBuffer tmpBuf( pTmp ); + if (tmpBuf.IsValid() == true) + { + rspIdx = mLog.AddBuffer( tmpBuf ); + if (IsResponse( tmpBuf ) == true) + { + bRC = true; + } + else + { + rspIdx = INVALID_LOG_INDEX; + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + EncodeTxData (Internal Method) + +DESCRIPTION: + Encode data for transmission + +PARAMETERS: + pBuffer [ I ] - Data to be encoded + bEncoded [ O ] - Do we even encode data? + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + sSharedBuffer * - Encoded data (0 upon error when encoding is indicated) +===========================================================================*/ +sSharedBuffer * cQMIProtocolServer::EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) +{ + WORD tid = ++mLastTID; + if (tid == (WORD)INVALID_QMI_TRANSACTION_ID) + { + tid++; + } + + sQMIServiceBuffer tmpBuf( pBuffer ); + tmpBuf.SetTransactionID( tid ); + + // No actual encoding required as we alter the original request + bEncoded = false; + return 0; +}; + +/*=========================================================================== +METHOD: + IsResponse (Internal Method) + +DESCRIPTION: + Is the passed in data a response to the current request? + +PARAMETERS: + rsp [ I ] - Candidate response + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::IsResponse( const sProtocolBuffer & rsp ) +{ + // Assume not + bool bRC = false; + if ( (mpActiveRequest == 0) + || (mpActiveRequest->mRequest.IsValid() == false) + || (mpActiveRequest->mbWaitingForResponse == false) + || (rsp.IsValid() == false) ) + { + return bRC; + } + + sQMIServiceBuffer qmiReq( mpActiveRequest->mRequest.GetSharedBuffer() ); + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + + if (qmiReq.IsValid() == false || qmiRsp.IsValid() == false) + { + return bRC; + } + + if (qmiRsp.IsResponse() == false) + { + return bRC; + } + + WORD reqID = qmiReq.GetTransactionID(); + WORD rspID = qmiRsp.GetTransactionID(); + + if ( (reqID == (WORD)INVALID_QMI_TRANSACTION_ID) + || (rspID == (WORD)INVALID_QMI_TRANSACTION_ID) + || (reqID != rspID) ) + { + return bRC; + } + + // Sadly there are documentated cases of firmware returning responses + // with a matching transaction ID but a mismatching message ID. There + // is no reason for this to be considered valid behavior as of yet + ULONG reqMsgID = qmiReq.GetMessageID(); + ULONG rspMsgID = qmiRsp.GetMessageID(); + + if (reqMsgID != rspMsgID) + { + return bRC; + } + + bRC = true; + return bRC; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/QMIProtocolServer.h b/gobi-api/Gobi_2011-11-28-1533/Core/QMIProtocolServer.h new file mode 100755 index 0000000..f66632c --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/QMIProtocolServer.h @@ -0,0 +1,116 @@ +/*=========================================================================== +FILE: + QMIProtocolServer.h + +DESCRIPTION: + QMI protocol server + +PUBLIC CLASSES AND METHODS: + cQMIProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolServer.h" +#include "QMIEnum.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cQMIProtocolServer +/*=========================================================================*/ +class cQMIProtocolServer : public cProtocolServer +{ + public: + // Constructor + cQMIProtocolServer( + eQMIService serviceType, + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cQMIProtocolServer(); + + // Connect to the given QMI service using the configured QMI + // control file + bool Connect( LPCSTR pControlFile ); + + // (Inline) Return the QMI service type + eQMIService GetServiceType() + { + return mService; + }; + + protected: + // Validate a request that is about to be scheduled + virtual bool ValidateRequest( const sProtocolRequest & req ); + + // Perform protocol specific communications port initialization + virtual bool InitializeComm(); + + // Perform protocol specific communications port cleanup + virtual bool CleanupComm(); + + // Decode incoming data into packets returning the last response + virtual bool DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ); + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ); + + // Is the passed in data a response to the current request? + virtual bool IsResponse( const sProtocolBuffer & rsp ); + + // (Inline) Is the passed in data a response that aborts the + // current request? + virtual bool IsTxAbortResponse( const sProtocolBuffer & /* rsp */ ) + { + // QMI doesn't necessarily require this + return false; + }; + + /* Current transaction ID */ + SHORT mLastTID; + + /* Type of QMI service we are serving */ + eQMIService mService; +}; diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/SharedBuffer.cpp b/gobi-api/Gobi_2011-11-28-1533/Core/SharedBuffer.cpp new file mode 100755 index 0000000..f3292b5 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/SharedBuffer.cpp @@ -0,0 +1,375 @@ +/*=========================================================================== +FILE: + SharedBuffer.cpp + +DESCRIPTION: + Shareable protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + + sSharedBuffer + Simple struct to represent a reference counted shareable (no copy) + buffer, as the basis for all buffer related classes + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "SharedBuffer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Synchronization object +struct sSharedBufferSync +{ + public: + // Constructor + sSharedBufferSync() + : mbInitialized( false ) + { + int nRet = pthread_mutex_init( &mSyncSection, NULL ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to init sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + mbInitialized = true; + }; + + // Destructor + ~sSharedBufferSync() + { + mbInitialized = false; + int nRet = pthread_mutex_destroy( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to destroy sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + } + + }; + + // Lock sync object + void Lock() + { + if (mbInitialized == true) + { + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to lock sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + } + }; + + // Unlock sync object + void Unlock() + { + if (mbInitialized == true) + { + int nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to unlock sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + } + }; + + protected: + /* DIAG buffer critical section */ + pthread_mutex_t mSyncSection; + + /* Has this object been initialized? */ + bool mbInitialized; +}; + +// Global (across all shared buffers) reference count guard +sSharedBufferSync gRefCount; + +/*=========================================================================*/ +// sSharedBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sSharedBuffer (Public Method) + +DESCRIPTION: + Constructor (copy passed in buffer) + +PARAMETERS: + pDataToCopy [ I ] - The data buffer to copy (should be non-zero) + dataLen [ I ] - The length of the above buffer (should be > 1) + dataType [ I ] - Type of data (not used internal to class) + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::sSharedBuffer( + const BYTE * pDataToCopy, + ULONG dataLen, + ULONG dataType ) + : mpData( 0 ), + mSize( 0 ), + mType( dataType ), + mRefCount( 0 ) +{ + // Length not too small/not too big? + if (IsValidSize( dataLen ) == true) + { + // Yes, data actually exists? + if (pDataToCopy != 0) + { + // Yes, try to allocate memory + mpData = new BYTE[dataLen]; + if (mpData != 0) + { + // Now copy into our allocation + memcpy( (PVOID)mpData, + (LPCVOID)pDataToCopy, + (SIZE_T)dataLen ); + + // Now set the size, we do this last so that our double + // deletion logic is only applied if we had an allocation + // in the first place + mSize = dataLen; + } + } + } +} + +/*=========================================================================== +METHOD: + sSharedBuffer (Public Method) + +DESCRIPTION: + Constructor (assume ownership of passed in buffer) + +PARAMETERS: + dataLen [ I ] - The length of the above buffer (should be > 1) + pDataToOwn [ I ] - The data buffer to assume ownership of (should + be non-zero) + + dataType [ I ] - Type of data (not used internal to class) + + NOTE: The order is intentionally reversed from the previous constructor + to avoid any cases of mistaken identity (copy versus assume ownership) + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::sSharedBuffer( + ULONG dataLen, + PBYTE pDataToOwn, + ULONG dataType ) + : mpData( 0 ), + mSize( 0 ), + mType( dataType ), + mRefCount( 0 ) +{ + // Data actually exists? + if (pDataToOwn != 0) + { + // Yes, length not too small/not too big? + if (IsValidSize( dataLen ) == true) + { + // Yes, assume ownership of the passed in buffer + mpData = pDataToOwn; + mSize = dataLen; + } + else + { + // This data buffer is not acceptable to us, but we have assumed + // ownership of the memory which we will now free + delete [] pDataToOwn; + } + } +} + +/*=========================================================================== +METHOD: + ~sSharedBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::~sSharedBuffer() +{ + ASSERT( mRefCount == 0 ); + + // Buffer data to free? + if (mpData != 0) + { + // Yes, zero first byte for caution and then delete it + mpData[0] = 0; + delete [] mpData; + + // Even more caution, zero out pointer + mpData = 0; + } + else if (mSize != 0) + { + ASSERT( (PVOID)("Double deletion detected in ~sSharedBuffer") == 0 ); + } +} + +/*=========================================================================== +METHOD: + operator == (Public Method) + +DESCRIPTION: + Equality operator + +RETURN VALUE: + bool +===========================================================================*/ +bool sSharedBuffer::operator == ( const sSharedBuffer & refBuf ) const +{ + // Assume they are not equal + bool bEq = false; + + // The buffers must be the same + if (mpData == refBuf.mpData) + { + if (mSize == refBuf.mSize) + { + if (mRefCount == refBuf.mRefCount) + { + if (mType == refBuf.mType) + { + // The shared buffers are the same + bEq = true; + } + } + else + { + // Very odd - the buffers are the same, but not the ref count?!? + ASSERT( 0 ); + } + } + else + { + // Very odd - the buffers are the same, but not the size?!? + ASSERT( 0 ); + } + } + + return bEq; +} + +/*=========================================================================== +METHOD: + operator != (Public Method) + +DESCRIPTION: + Inequality operator + +RETURN VALUE: + bool +===========================================================================*/ +bool sSharedBuffer::operator != ( const sSharedBuffer & refBuf ) const +{ + if (*this == refBuf) + { + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + AddRef (Internal Method) + +DESCRIPTION: + Increment reference count + +RETURN VALUE: + None +===========================================================================*/ +void sSharedBuffer::AddRef() +{ + gRefCount.Lock(); + mRefCount++; + gRefCount.Unlock(); +} + +/*=========================================================================== +METHOD: + Release (Internal Method) + +DESCRIPTION: + Release reference, delete if reference count zero + +RETURN VALUE: + None +===========================================================================*/ +void sSharedBuffer::Release() +{ + gRefCount.Lock(); + + ASSERT( mRefCount != 0 ); + + // Decrement reference count + if (mRefCount > 0) + { + mRefCount--; + } + + // ... and delete if reference count now 0 + if (mRefCount == 0) + { + delete this; + } + + gRefCount.Unlock(); +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/SharedBuffer.h b/gobi-api/Gobi_2011-11-28-1533/Core/SharedBuffer.h new file mode 100755 index 0000000..11e23f8 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/SharedBuffer.h @@ -0,0 +1,166 @@ +/*=========================================================================== +FILE: + SharedBuffer.h + +DESCRIPTION: + Shareable buffer structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sSharedBuffer + Simple struct to represent a reference counted shareable (no copy) + buffer, as the basis for all buffer related classes + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +struct sProtocolBuffer; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum size of a shared buffer +const ULONG MAX_SHARED_BUFFER_SIZE = 1024 * 16 + 256; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sSharedBuffer +// +// Simple struct to represent a reference counted shareable (no copy) +// buffer, as the basis for all buffer related classes +// +// NOTE: Do *NOT* create instances of this structure on the stack, it +// must be dynamically allocated in order to function correctly +/*=========================================================================*/ +struct sSharedBuffer +{ + public: + // Constructor (copy passed in buffer) + sSharedBuffer( + const BYTE * pDataToCopy, + ULONG dataLen, + ULONG dataType ); + + // Constructor (assume ownership of passed in buffer) + sSharedBuffer( + ULONG dataLen, + PBYTE pDataToOwn, + ULONG dataType ); + + // Destructor + virtual ~sSharedBuffer(); + + // Equality operator + bool operator == ( const sSharedBuffer & ) const; + + // Inequality operator + bool operator != ( const sSharedBuffer & ) const; + + // (Inline) Get buffer + const BYTE * GetBuffer() const + { + return mpData; + }; + + // (Inline) Get buffer size + ULONG GetSize() const + { + return mSize; + }; + + // (Inline) Get buffer type + ULONG GetType() const + { + return mType; + }; + + // (Inline) Is this buffer valid? + bool IsValid() const + { + return (mpData != 0 && IsValidSize( mSize )); + }; + + // (Inline) Get reference count + ULONG GetRefCount() const + { + return mRefCount; + }; + + // (Static Inline) Is the passed in size within the allowable range + // a shared buffer? + static bool IsValidSize( ULONG sz ) + { + return (sz > 0 && sz <= MAX_SHARED_BUFFER_SIZE); + }; + + protected: + // Add reference + void AddRef(); + + // Release reference, delete if reference count zero + void Release(); + + /* Data */ + PBYTE mpData; + + /* Size of data */ + ULONG mSize; + + /* Type of data */ + ULONG mType; + + /* Reference count */ + ULONG mRefCount; + + private: + // Leave copy constructor and assignment operator unimplemented + // to prevent unintentional and unauthorized copying of the object + // (which would lead to bad reference counting) + sSharedBuffer( const sSharedBuffer & ); + sSharedBuffer & operator = ( const sSharedBuffer & ); + + friend struct sProtocolBuffer; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/StdAfx.h b/gobi-api/Gobi_2011-11-28-1533/Core/StdAfx.h new file mode 100755 index 0000000..afc1da0 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/StdAfx.h @@ -0,0 +1,176 @@ +/*=========================================================================== +FILE: + StdAfx.h + +DESCRIPTION: + Application Framework eXtenstions for Linux + +PUBLIC CLASSES AND FUNCTIONS: + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once +//--------------------------------------------------------------------------- +// Includes +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//--------------------------------------------------------------------------- +// Macro defination +//--------------------------------------------------------------------------- + +#define ASSERT( x ) assert( x ) + +#ifdef DEBUG + #define TRACE printf +#else + #define TRACE(...) +#endif + +//--------------------------------------------------------------------------- +// data type defination +//--------------------------------------------------------------------------- +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef CONST +#define CONST const +#endif + +typedef void VOID; +typedef unsigned long DWORD; +typedef int BOOL; +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef float FLOAT; +typedef long long LONGLONG; +typedef unsigned long long ULONGLONG; +typedef signed char INT8; +typedef double DOUBLE; + +typedef int INT; +typedef unsigned int UINT; +typedef unsigned int * PUINT; +typedef INT HANDLE; +typedef HANDLE HMODULE; + +typedef char CHAR; +typedef short SHORT; +typedef long LONG; + +typedef unsigned long ULONG; +typedef ULONG * PULONG; +typedef ULONG * ULONG_PTR; +typedef unsigned short USHORT; +typedef USHORT * PUSHORT; +typedef unsigned char UCHAR; +typedef UCHAR * PUCHAR; +typedef char * PSZ; + + +typedef CONST CHAR * LPCSTR; +typedef CHAR * LPSTR; + +typedef BYTE * PBYTE; +typedef BOOL * PBOOL; +typedef INT * PINT; +typedef UINT * LPINT; +typedef WORD * PWORD; +typedef PWORD LPWORD; +typedef LONG * LPLONG; +typedef DWORD * PDWORD; +typedef VOID * PVOID; +typedef PVOID LPVOID; +typedef const void * LPCVOID; + +typedef size_t SIZE_T; +typedef double DATE; + +// Error code +#define NO_ERROR 0L +#define ERROR_SUCCESS 0L +#define ERROR_NO_MORE_ITEMS 259L +#define ERROR_CRC 23L +#define ERROR_OUTOFMEMORY 14L +#define ERROR_CAN_NOT_COMPLETE 1003L +#define ERROR_REVISION_MISMATCH 1306L +#define ERROR_BAD_ARGUMENTS 160L +#define INVALID_SET_FILE_POINTER -1 +#define VALID_HANDLE_VALUE 0 +#define INVALID_HANDLE_VALUE -1 +#define INVALID_FILE_SZ -1 + +#define ERROR_GEN_FAILURE 31L +#define ERROR_FILE_NOT_FOUND 2L +#define ERROR_NOT_ENOUGH_MEMORY 8L +#define ERROR_INVALID_PARAMETER 87L +#define ERROR_BAD_FORMAT 11L + + +// Other Constant definitions +#define MAX_PATH 512 +#define INFINITE 0xffffffff + + +// SIOCIWFIRSTPRIV = 0x8BE0 + +// Device I/O control code for setting QMI service +#define QMI_GET_SERVICE_FILE_IOCTL 0x8BE0 + 1 + +// Device I/O control code for obtaining device VIDPID +#define QMI_GET_VIDPID_IOCTL 0x8BE0 + 2 + +// Device I/O control code for obtaining device MEID +#define QMI_GET_MEID_IOCTL 0x8BE0 + 3 + +// Define the directions for pipes +#define READING 0 +#define WRITING 1 diff --git a/gobi-api/Gobi_2011-11-28-1533/Core/SyncQueue.h b/gobi-api/Gobi_2011-11-28-1533/Core/SyncQueue.h new file mode 100755 index 0000000..015addf --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Core/SyncQueue.h @@ -0,0 +1,419 @@ +/*=========================================================================== +FILE: + SyncQueue.h + +DESCRIPTION: + Declaration/Implementation of cSyncQueue class + +PUBLIC CLASSES AND METHODS: + cSyncQueue + Synchronized shareable (across multiple threads) queue of + structures with event notifications + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include +#include "Event.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cSyncQueue +/*=========================================================================*/ +template class cSyncQueue +{ + public: + // (Inline) Constructor + cSyncQueue( + ULONG maxElements, + bool bSignalEvent = false ) + : mSignature( (ULONG)eSYNC_QUEUE_SIG ), + mSignalEvent(), + mbSignalEvent( bSignalEvent ), + mMaxElements( maxElements ), + mTotalElements( 0 ) + { + // Create sync CS + int nRet = pthread_mutex_init( &mSyncSection, NULL ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to init sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + }; + + // (Inline) Destructor + ~cSyncQueue() + { + if (IsValid() == false) + { + ASSERT( (PVOID)"Double deletion detected in ~cSyncQueue" == 0 ); + } + else + { + EmptyQueue(); + + mSignature = 0; + int nRet = pthread_mutex_destroy( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to destroy sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + } + + }; + + // (Inline) Add an element to the queue + bool AddElement( const tElementType & elem ) + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Are we out of space? + if ((ULONG)mElementDeque.size() >= mMaxElements) + { + // Yes, drop oldest element + mElementDeque.pop_front(); + } + + // Add new item to the queue + mElementDeque.push_back( elem ); + mTotalElements++; + + // Set event? + if (mbSignalEvent == true) + { + // Signal index of event + nRet = mSignalEvent.Set( mTotalElements - 1 ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to signal. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + } + + // Success! + bRC = true; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Add an element to the queue returning the index of + // the element + bool AddElement( + const tElementType & elem, + ULONG & idx ) + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Are we out of space? + if ((ULONG)mElementDeque.size() >= mMaxElements) + { + mElementDeque.pop_front(); + } + + // Add new item to the queue + mElementDeque.push_back( elem ); + idx = mTotalElements++; + + // Set event? + if (mbSignalEvent == true) + { + // Signal index of event + nRet = mSignalEvent.Set( mTotalElements - 1 ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to signal. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + } + + // Success! + bRC = true; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Return given element in the queue + bool GetElement( + ULONG idx, + tElementType & elem ) const + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Is this a current element index? + ULONG expiredIndices = mTotalElements - (ULONG)mElementDeque.size(); + if (idx >= expiredIndices) + { + // Yes, grab it from the deque + idx -= expiredIndices; + if (idx < (ULONG)mElementDeque.size()) + { + elem = mElementDeque[idx]; + bRC = true; + } + } + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Empty element queue + bool EmptyQueue() + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + + mElementDeque.clear(); + mTotalElements = 0; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + bRC = true; + return bRC; + }; + + // (Inline) Return the number of queued elements + ULONG GetQueueCount() const + { + ULONG elems = 0; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return elems; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + elems = (ULONG)mElementDeque.size(); + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + return elems; + }; + + // (Inline) Return the total number of elements added to queue + ULONG GetTotalCount() const + { + ULONG elems = 0; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return elems; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + elems = mTotalElements; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + return elems; + }; + + // (Inline) Return the signal event + cEvent & GetSignalEvent() const + { + return mSignalEvent; + }; + + // (Inline) Is this sync queue valid? + bool IsValid() const + { + return (mSignature == (ULONG)eSYNC_QUEUE_SIG); + }; + + protected: + // Object signature + enum eClassConstants + { + eSYNC_QUEUE_SIG = 0x1799A2BC + }; + + /* Object signature */ + ULONG mSignature; + + /* Multithreaded mutex type */ + mutable pthread_mutex_t mSyncSection; + + /* Signal event, set everytime an element is added (if configured) */ + mutable cEvent mSignalEvent; + + /* Use above signal event? */ + bool mbSignalEvent; + + /* Maximum number of elements to add to the deque */ + ULONG mMaxElements; + + /* Total number of elements added to the deque */ + ULONG mTotalElements; + + /* Element queue */ + std::deque mElementDeque; +}; diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000Translation.cpp b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000Translation.cpp new file mode 100755 index 0000000..a2a1ec3 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000Translation.cpp @@ -0,0 +1,101 @@ +/*=========================================================================== +FILE: + Gobi3000Translation.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetTLV + +DESCRIPTION: + Return the starting location and size of TLV buffer. + + NOTE: does not include the TLV header + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + type [ I ] - Type ID + pOutLen [ O ] - Length of the output buffer + ppOut [ O ] - Pointer to output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetTLV( + ULONG inLen, + const BYTE * pIn, + BYTE typeID, + ULONG * pOutLen, + const BYTE ** ppOut ) +{ + if (pIn == 0 || pOutLen == 0 || ppOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + for (ULONG offset = 0; + offset + sizeof( sQMIRawContentHeader ) <= inLen; + offset += sizeof( sQMIRawContentHeader )) + { + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pIn + offset); + + // Is it big enough to contain this TLV? + if (offset + sizeof( sQMIRawContentHeader ) + pHeader->mLength > inLen) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + if (pHeader->mTypeID == typeID) + { + *pOutLen = pHeader->mLength; + *ppOut = pIn + offset + sizeof( sQMIRawContentHeader ); + + return eGOBI_ERR_NONE; + } + + offset += pHeader->mLength; + } + + // TLV not found + return eGOBI_ERR_INVALID_RSP; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000Translation.h b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000Translation.h new file mode 100755 index 0000000..266cb7e --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000Translation.h @@ -0,0 +1,1028 @@ +/*=========================================================================== +FILE: + Gobi3000Translation.h + +DESCRIPTION: + QUALCOMM Tanslation for Gobi 3000 + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +#ifndef GOBI_TYPEDEFS +#define GOBI_TYPEDEFS + +// Type Definitions +typedef unsigned long ULONG; +typedef unsigned long * ULONG_PTR; +typedef unsigned long long ULONGLONG; +typedef signed char INT8; +typedef unsigned char UINT8; +typedef signed short INT16; +typedef unsigned short UINT16; +typedef signed int INT32; +typedef unsigned int UINT32; +typedef unsigned char BYTE; +typedef char CHAR; +typedef unsigned short WORD; +typedef unsigned short USHORT; +typedef const char * LPCSTR; + +#ifdef WINDOWS + typedef signed __int64 INT64; + typedef unsigned __int64 UINT64; +#else + typedef signed long long INT64; + typedef unsigned long long UINT64; +#endif + +#endif + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include +#include +#include +#include "GobiConnectionMgmtAPIStructs.h" + +//--------------------------------------------------------------------------- +// Prototypes +//--------------------------------------------------------------------------- + +// Get a TLV +ULONG GetTLV( + ULONG inLen, + const BYTE * pIn, + BYTE typeID, + ULONG * pOutLen, + const BYTE ** ppOut ); + +// WDS + +ULONG ParseGetSessionState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ); + +ULONG ParseGetSessionDuration( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pDuration ); + +ULONG ParseGetDormancyState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ); + +ULONG ParseGetEnhancedAutoconnect( + ULONG inLen, + const BYTE * pIn, + ULONG * pSetting, + ULONG * pRoamSetting ); + +ULONG PackSetEnhancedAutoconnect( + ULONG * pOutLen, + BYTE * pOut, + ULONG setting, + ULONG * pRoamSetting ); + +ULONG PackSetDefaultProfile( + ULONG * pOutLen, + BYTE * pOut, + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ); + +ULONG PackGetDefaultProfile( + ULONG * pOutLen, + BYTE * pOut, + ULONG profileType ); + +ULONG ParseGetDefaultProfile( + ULONG inLen, + const BYTE * pIn, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ); + +ULONG PackStartDataSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword ); + +ULONG ParseStartDataSession( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionId, + ULONG * pFailureReason ); + +ULONG PackStopDataSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG sessionId ); + +ULONG PackGetIPAddress( + ULONG * pOutLen, + BYTE * pOut ); + +ULONG ParseGetIPAddress( + ULONG inLen, + const BYTE * pIn, + ULONG * pIPAddress ); + +ULONG ParseGetConnectionRate( + ULONG inLen, + const BYTE * pIn, + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ); + +ULONG PackGetPacketStatus( + ULONG * pOutLen, + BYTE * pOut ); + +ULONG ParseGetPacketStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ); + +ULONG PackGetByteTotals( + ULONG * pOutLen, + BYTE * pOut ); + +ULONG ParseGetByteTotals( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ); + +ULONG PackSetMobileIP( + ULONG * pOutLen, + BYTE * pOut, + ULONG mode ); + +ULONG ParseGetMobileIP( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode ); + +ULONG PackSetActiveMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE index ); + +ULONG ParseGetActiveMobileIPProfile( + ULONG inLen, + const BYTE * pIn, + BYTE * pIndex ); + +ULONG PackSetMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ); + +ULONG PackGetMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + BYTE index ); + +ULONG ParseGetMobileIPProfile( + ULONG inLen, + const BYTE * pIn, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ); + +ULONG PackSetMobileIPParameters( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + +ULONG ParseGetMobileIPParameters( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + +ULONG ParseGetLastMobileIPError( + ULONG inLen, + const BYTE * pIn, + ULONG * pError ); + +ULONG PackSetDNSSettings( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); + +ULONG ParseGetDNSSettings( + ULONG inLen, + const BYTE * pIn, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); + +ULONG ParseGetDataBearerTechnology( + ULONG inLen, + const BYTE * pIn, + ULONG * pDataBearer ); + +// NAS + +ULONG ParseGetANAAAAuthenticationStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus ); + +ULONG ParseGetSignalStrength( + ULONG inLen, + const BYTE * pIn, + INT8 * pSignalStrength, + ULONG * pRadioInterface ); + +ULONG ParseGetSignalStrengths( + ULONG inLen, + const BYTE * pIn, + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ); + +ULONG ParseGetRFInfo( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances ); + +ULONG ParsePerformNetworkScan( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances ); + +ULONG ParsePerformNetworkRATScan( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ); + +ULONG PackInitiateNetworkRegistration( + ULONG * pOutLen, + BYTE * pOut, + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ); + +ULONG PackInitiateDomainAttach( + ULONG * pOutLen, + BYTE * pOut, + ULONG action ); + +ULONG ParseGetServingNetwork( + ULONG inLen, + const BYTE * pIn, + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ); + +ULONG ParseGetServingNetworkCapabilities( + ULONG inLen, + const BYTE * pIn, + BYTE * pDataCapsSize, + BYTE * pDataCaps ); + +ULONG ParseGetHomeNetwork( + ULONG inLen, + const BYTE * pIn, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ); + +ULONG PackSetNetworkPreference( + ULONG * pOutLen, + BYTE * pOut, + ULONG technologyPref, + ULONG duration ); + +ULONG ParseGetNetworkPreference( + ULONG inLen, + const BYTE * pIn, + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ); + +ULONG PackSetCDMANetworkParameters( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + +ULONG ParseGetCDMANetworkParameters( + ULONG inLen, + const BYTE * pIn, + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + +ULONG ParseGetACCOLC( + ULONG inLen, + const BYTE * pIn, + BYTE * pACCOLC ); + +ULONG PackSetACCOLC( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE accolc ); + +ULONG ParseGetPLMNMode( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode ); + +ULONG PackGetPLMNName( + ULONG * pOutLen, + BYTE * pOut, + USHORT mcc, + USHORT mnc ); + +ULONG ParseGetPLMNName( + ULONG inLen, + const BYTE * pIn, + ULONG * pNamesSize, + BYTE * pNames ); + +// DMS + +ULONG ParseGetDeviceCapabilities( + ULONG inLen, + const BYTE * pIn, + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ); + +ULONG ParseGetManufacturer( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseGetModelID( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseGetFirmwareRevision( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseGetFirmwareRevisions( + ULONG inLen, + const BYTE * pIn, + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ); + +ULONG ParseGetVoiceNumber( + ULONG inLen, + const BYTE * pIn, + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ); + +ULONG ParseGetIMSI( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseGetSerialNumbers( + ULONG inLen, + const BYTE * pIn, + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ); + +ULONG PackSetLock( + ULONG * pOutLen, + BYTE * pOut, + ULONG state, + CHAR * pCurrentPIN ); + +ULONG ParseQueryLock( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ); + +ULONG PackChangeLockPIN( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ); + +ULONG ParseGetHardwareRevision( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseGetPRLVersion( + ULONG inLen, + const BYTE * pIn, + WORD * pPRLVersion ); + +ULONG ParseGetERIFile( + ULONG inLen, + const BYTE * pIn, + ULONG * pFileSize, + BYTE * pFile ); + +ULONG PackActivateAutomatic( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pActivationCode ); + +ULONG PackResetToFactoryDefaults( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC ); + +ULONG ParseGetActivationState( + ULONG inLen, + const BYTE * pIn, + ULONG * pActivationState ); + +ULONG PackSetPower( + ULONG * pOutLen, + BYTE * pOut, + ULONG powerMode ); + +ULONG ParseGetPower( + ULONG inLen, + const BYTE * pIn, + ULONG * pPowerMode ); + +ULONG ParseGetOfflineReason( + ULONG inLen, + const BYTE * pIn, + ULONG * pReasonMask, + ULONG * pbPlatform ); + +ULONG ParseGetNetworkTime( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pTimeCount, + ULONG * pTimeSource ); + +ULONG PackValidateSPC( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC ); + +// SMS + +ULONG PackDeleteSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ); + +ULONG PackGetSMSList( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG * pRequestedTag ); + +ULONG ParseGetSMSList( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageListSize, + BYTE * pMessageList ); + +ULONG PackGetSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageIndex ); + +ULONG ParseGetSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ); + +ULONG PackModifySMSStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ); + +ULONG PackSaveSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage ); + +ULONG ParseSaveSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageIndex ); + +ULONG PackSendSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage ); + +ULONG ParseSendSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageFailureCode ); + +ULONG ParseGetSMSCAddress( + ULONG inLen, + const BYTE * pIn, + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ); + +ULONG PackSetSMSCAddress( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSMSCAddress, + CHAR * pSMSCType ); + +ULONG ParseGetSMSRoutes( + ULONG inLen, + const BYTE * pIn, + BYTE * pRouteSize, + BYTE * pRoutes ); + +ULONG PackSetSMSRoutes( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pRouteSize, + BYTE * pRoutes ); + +// DMS UIM + +ULONG PackUIMUnblockControlKey( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pValue ); + +ULONG ParseUIMUnblockControlKey( + ULONG inLen, + const BYTE * pIn, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMSetControlKeyProtection( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + ULONG status, + CHAR * pValue ); + +ULONG ParseUIMSetControlKeyProtection( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft ); + +ULONG PackUIMGetControlKeyBlockingStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG id ); + +ULONG ParseUIMGetControlKeyBlockingStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ); + +ULONG ParseUIMGetControlKeyStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMGetControlKeyStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG id ); + +ULONG ParseUIMGetICCID( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseUIMGetPINStatus( + ULONG inLen, + const BYTE * pIn, + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMChangePIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue ); + +ULONG ParseUIMChangePIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMUnblockPIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue ); + +ULONG ParseUIMUnblockPIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMVerifyPIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pValue ); + +ULONG ParseUIMVerifyPIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMSetPINProtection( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + ULONG bEnable, + CHAR * pValue ); + +ULONG ParseUIMSetPINProtection( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +// PDS + +ULONG ParseGetPDSState( + ULONG inLen, + const BYTE * pIn, + ULONG * pEnabled, + ULONG * pTracking ); + +ULONG PackSetPDSState( + ULONG * pOutLen, + BYTE * pOut, + ULONG enable ); + +ULONG PackPDSInjectTimeReference( + ULONG * pOutLen, + BYTE * pOut, + ULONGLONG systemTime, + USHORT systemDiscontinuities ); + +ULONG ParseGetPDSDefaults( + ULONG inLen, + const BYTE * pIn, + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ); + +ULONG PackSetPDSDefaults( + ULONG * pOutLen, + BYTE * pOut, + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ); + +ULONG ParseGetXTRAAutomaticDownload( + ULONG inLen, + const BYTE * pIn, + ULONG * pbEnabled, + USHORT * pInterval ); + +ULONG PackSetXTRAAutomaticDownload( + ULONG * pOutLen, + BYTE * pOut, + ULONG bEnabled, + USHORT interval ); + +ULONG ParseGetXTRANetwork( + ULONG inLen, + const BYTE * pIn, + ULONG * pPreference ); + +ULONG PackSetXTRANetwork( + ULONG * pOutLen, + BYTE * pOut, + ULONG preference ); + +ULONG ParseGetXTRAValidity( + ULONG inLen, + const BYTE * pIn, + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ); + +ULONG ParseGetXTRADataState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ); + +ULONG PackSetXTRADataState( + ULONG * pOutLen, + BYTE * pOut, + ULONG state ); + +ULONG ParseGetXTRATimeState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ); + +ULONG PackSetXTRATimeState( + ULONG * pOutLen, + BYTE * pOut, + ULONG state ); + +ULONG ParseGetAGPSConfig( + ULONG inLen, + const BYTE * pIn, + ULONG * pServerAddress, + ULONG * pServerPort ); + +ULONG PackSetAGPSConfig( + ULONG * pOutLen, + BYTE * pOut, + ULONG serverAddress, + ULONG serverPort ); + +ULONG ParseGetServiceAutomaticTracking( + ULONG inLen, + const BYTE * pIn, + ULONG * pbAuto ); + +ULONG PackSetServiceAutomaticTracking( + ULONG * pOutLen, + BYTE * pOut, + ULONG bAuto ); + +ULONG ParseGetPortAutomaticTracking( + ULONG inLen, + const BYTE * pIn, + ULONG * pbAuto ); + +ULONG PackSetPortAutomaticTracking( + ULONG * pOutLen, + BYTE * pOut, + ULONG bAuto ); + +ULONG PackResetPDSData( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pGPSDataMask, + ULONG * pCellDataMask ); + +// CAT + +ULONG PackCATSendTerminalResponse( + ULONG * pOutLen, + BYTE * pOut, + ULONG refID, + ULONG dataLen, + BYTE * pData ); + +ULONG PackCATSendEnvelopeCommand( + ULONG * pOutLen, + BYTE * pOut, + ULONG cmdID, + ULONG dataLen, + BYTE * pData ); + +// RMS + +ULONG ParseGetSMSWake( + ULONG inLen, + const BYTE * pIn, + ULONG * pbEnabled, + ULONG * pWakeMask ); + +ULONG PackSetSMSWake( + ULONG * pOutLen, + BYTE * pOut, + ULONG bEnable, + ULONG wakeMask ); + +// OMADM + +ULONG PackOMADMStartSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG sessionType ); + +ULONG ParseOMADMGetSessionInfo( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ); + +ULONG ParseOMADMGetPendingNIA( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionType, + USHORT * pSessionID ); + +ULONG PackOMADMSendSelection( + ULONG * pOutLen, + BYTE * pOut, + ULONG selection, + USHORT sessionID ); + +ULONG ParseOMADMGetFeatureSettings( + ULONG inLen, + const BYTE * pIn, + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ); + +ULONG PackOMADMSetProvisioningFeature( + ULONG * pOutLen, + BYTE * pOut, + ULONG bProvisioning ); + +ULONG PackOMADMSetPRLUpdateFeature( + ULONG * pOutLen, + BYTE * pOut, + ULONG bPRLUpdate ); + +// Voice + +ULONG PackOriginateUSSD( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pInfo ); + +ULONG PackAnswerUSSD( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pInfo ); + diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationCAT.cpp b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationCAT.cpp new file mode 100755 index 0000000..07aa31a --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationCAT.cpp @@ -0,0 +1,177 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationCAT.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (Card Application Toolkit Service) + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + PackCATSendTerminalResponse + +DESCRIPTION: + This function sends the terminal response to the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + refID [ I ] - UIM reference ID (from CAT event) + dataLen [ I ] - Terminal response data length + pData [ I ] - Terminal response data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackCATSendTerminalResponse( + ULONG * pOutLen, + BYTE * pOut, + ULONG refID, + ULONG dataLen, + BYTE * pData ) +{ + // Validate arguments + if (pOut == 0 || pData == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx01Sz = sizeof( sCATSendTerminalResponseRequest_TerminalResponseType ) + + (WORD)dataLen; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sCATSendTerminalResponseRequest_TerminalResponseType * pTLVx01; + pTLVx01 = (sCATSendTerminalResponseRequest_TerminalResponseType*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mReferenceID = refID; + pTLVx01->mTerminalResponseLength = (UINT16)dataLen; + + offset += sizeof( sCATSendTerminalResponseRequest_TerminalResponseType ); + + if (dataLen > 0) + { + memcpy( pOut + offset, pData, dataLen ); + offset += dataLen; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackCATSendEnvelopeCommand + +DESCRIPTION: + This function sends the envelope command to the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + cmdID [ I ] - Envelope command ID + dataLen [ I ] - Envelope command data length + pData [ I ] - Envelope command data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackCATSendEnvelopeCommand( + ULONG * pOutLen, + BYTE * pOut, + ULONG cmdID, + ULONG dataLen, + BYTE * pData ) +{ + // Validate arguments + if (pOut == 0 || dataLen == 0 || pData == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx01Sz = sizeof( sCATEnvelopeCommandRequest_EnvelopeCommand ) + + (WORD)dataLen; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sCATEnvelopeCommandRequest_EnvelopeCommand * pTLVx01; + pTLVx01 = (sCATEnvelopeCommandRequest_EnvelopeCommand*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mEnvelopeCommandType = (eQMICATEnvelopeCommandType)cmdID; + pTLVx01->mEnvelopeLength = (UINT16)dataLen; + + offset += sizeof( sCATEnvelopeCommandRequest_EnvelopeCommand ); + + if (dataLen > 0) + { + memcpy( pOut + offset, pData, dataLen ); + offset += dataLen; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationDMS.cpp b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationDMS.cpp new file mode 100755 index 0000000..029af08 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationDMS.cpp @@ -0,0 +1,1483 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationDMS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (DMS Service) + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + ParseGetDeviceCapabilities + +DESCRIPTION: + This function gets device capabilities + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMaxTXChannelRate [ O ] - Maximum transmission rate (bps) + pMaxRXChannelRate [ O ] - Maximum reception rate (bps) + pDataServiceCapability [ O ] - CS/PS data service capability + pSimCapability [ O ] - Device SIM support + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. + Upon successful output the actual number + of elements in the radio interface array + pRadioIfaces [ O ] - The radio interface array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetDeviceCapabilities( + ULONG inLen, + const BYTE * pIn, + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ) +{ + // Validate arguments + if (pIn == 0 + || pMaxTXChannelRate == 0 + || pMaxRXChannelRate == 0 + || pDataServiceCapability == 0 + || pSimCapability == 0 + || pRadioIfacesSize == 0 + || *pRadioIfacesSize == 0 + || pRadioIfaces == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxRadioIfaces = (ULONG)*pRadioIfacesSize; + + // Assume failure + *pRadioIfacesSize = 0; + + const sDMSGetDeviceCapabilitiesResponse_Capabilities * pTLVx01; + ULONG structSzx01 = sizeof( sDMSGetDeviceCapabilitiesResponse_Capabilities ); + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < structSzx01) + { + return eGOBI_ERR_BUFFER_SZ; + } + + // Populate the variables + *pMaxTXChannelRate = pTLVx01->mMaxTXRatebps; + *pMaxRXChannelRate = pTLVx01->mMaxRXRatebps; + *pDataServiceCapability = pTLVx01->mDataServiceCapability; + + // SIM capability should be treated as a boolean, even though it's not + *pSimCapability = (pTLVx01->mSIMSupported == 0 ? 0 : 1); + + ULONG activeRadioIfaces = pTLVx01->mRadioInterfaceCount; + if (activeRadioIfaces > maxRadioIfaces) + { + activeRadioIfaces = maxRadioIfaces; + } + + const eQMIDMSRadioInterfaces * pInRadioInterfaces; + + // Verify there is room for the array in the TLV + if (outLenx01 < structSzx01 + + sizeof( eQMIDMSRadioInterfaces ) * activeRadioIfaces) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pInRadioInterfaces = (const eQMIDMSRadioInterfaces *) + ((const BYTE *)pTLVx01 + structSzx01); + + ULONG * pOutRadioIfaces = (ULONG *)pRadioIfaces; + for (ULONG r = 0; r < activeRadioIfaces; r++) + { + *pOutRadioIfaces = *pInRadioInterfaces; + pOutRadioIfaces++; + pInRadioInterfaces++; + } + + *pRadioIfacesSize = activeRadioIfaces; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetManufacturer + +DESCRIPTION: + This function returns the device manufacturer name + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetManufacturer( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Find the manufacturer + // sDMSGetDeviceManfacturerResponse_Manfacturer only contains this + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (stringSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, pTLVx01, outLenx01 ); + pString[outLenx01] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetModelID + +DESCRIPTION: + This function returns the device model ID + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetModelID( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Find the model + // sDMSGetDeviceModelResponse_Model only contains the model + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (stringSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, pTLVx01, outLenx01 ); + pString[outLenx01] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetFirmwareRevision + +DESCRIPTION: + This function returns the device firmware revision + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetFirmwareRevision( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Find the PRI revision + // sDMSGetDeviceRevisionResponse_UQCNRevision only contains this + const CHAR * pTLVx11; + ULONG outLenx11; + ULONG rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (stringSize < outLenx11 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, pTLVx11, outLenx11 ); + pString[outLenx11] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetFirmwareRevisions + +DESCRIPTION: + This function returns the device firmware (AMSS, boot, and PRI) + revisions + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + amssSize [ I ] - The maximum number of characters (including NULL + terminator) that the AMSS string array can contain + pAMSSString [ O ] - NULL terminated AMSS revision string + bootSize [ I ] - The maximum number of characters (including NULL + terminator) that the boot string array can contain + pBootString [ O ] - NULL terminated boot code revision string + priSize [ I ] - The maximum number of characters (including NULL + terminator) that the PRI string array can contain + pPRIString [ O ] - NULL terminated PRI revision string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetFirmwareRevisions( + ULONG inLen, + const BYTE * pIn, + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ) +{ + // Validate arguments + if (pIn == 0 + || amssSize == 0 || pAMSSString == 0 + || bootSize == 0 || pBootString == 0 + || priSize == 0 || pPRIString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pAMSSString = 0; + *pBootString = 0; + *pPRIString = 0; + + // Find the AMSS version + // sDMSGetDeviceRevisionResponse_Revision only contains this + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (amssSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pAMSSString, pTLVx01, outLenx01 ); + pAMSSString[outLenx01] = 0; + + // Find the Boot version + // sDMSGetDeviceRevisionResponse_BootCodeRevision only contains this + const CHAR * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (bootSize < outLenx10 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pBootString, pTLVx10, outLenx10 ); + pBootString[outLenx10] = 0; + + // The PRI version is returned by ParseGetFirmwareRevision() + rc = ParseGetFirmwareRevision( inLen, pIn, priSize, pPRIString ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetVoiceNumber + +DESCRIPTION: + This function returns the voice number in use by the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + voiceNumberSize [ I ] - The maximum number of characters (including NULL + terminator) that the voice number array can + contain + pVoiceNumber [ O ] - Voice number (MDN or ISDN) string + minSize [ I ] - The maximum number of characters (including NULL + terminator) that the MIN array can contain + pMIN [ O ] - MIN string (empty string returned when MIN is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetVoiceNumber( + ULONG inLen, + const BYTE * pIn, + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ) +{ + // Validate arguments + if (pIn == 0 + || voiceNumberSize == 0 || pVoiceNumber == 0 + || minSize == 0 || pMIN == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pVoiceNumber = 0; + *pMIN = 0; + + // Find the Voice number + // sDMSGetDeviceVoiceNumberResponse_VoiceNumber only contains this + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (voiceNumberSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pVoiceNumber, pTLVx01, outLenx01 ); + pVoiceNumber[outLenx01] = 0; + + // Find the Mobile ID (optional) + // sDMSGetDeviceVoiceNumberResponse_MobileIDNumber only contains this + const CHAR * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + // Space to perform the copy? + if (minSize < outLenx10 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pMIN, pTLVx10, outLenx10 ); + pMIN[outLenx10] = 0; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetIMSI + +DESCRIPTION: + This function returns the device IMSI + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetIMSI( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Find the IMSI + // sDMSGetDeviceVoiceNumberResponse_IMSI only contains this + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (stringSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, pTLVx01, outLenx01 ); + pString[outLenx01] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSerialNumbers + +DESCRIPTION: + This command returns all serial numbers assigned to the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + esnSize [ I ] - The maximum number of characters (including NULL + terminator) that the ESN array can contain + pESNString [ O ] - ESN string (empty string returned when ESN is + not supported/programmed) + imeiSize [ I ] - The maximum number of characters (including NULL + terminator) that the IMEI array can contain + pIMEIString [ O ] - IMEI string (empty string returned when IMEI is + not supported/programmed) + meidSize [ I ] - The maximum number of characters (including NULL + terminator) that the MEID array can contain + pMEIDString [ O ] - MEID string (empty string returned when MEID is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSerialNumbers( + ULONG inLen, + const BYTE * pIn, + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ) +{ + // Validate arguments + if (pIn == 0 + || esnSize == 0 || pESNString == 0 + || imeiSize == 0 || pIMEIString == 0 + || meidSize == 0 || pMEIDString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pESNString = 0; + *pIMEIString = 0; + *pMEIDString = 0; + + // Find the ESN + // sDMSGetDeviceSerialNumbersResponse_ESN only contains this + const CHAR * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (esnSize < outLenx10 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pESNString, pTLVx10, outLenx10 ); + pESNString[outLenx10] = 0; + + // Find the IMEI + // sDMSGetDeviceSerialNumbersResponse_IMEI only contains this + const CHAR * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (imeiSize < outLenx11 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pIMEIString, pTLVx11, outLenx11 ); + pIMEIString[outLenx11] = 0; + + // Find the MEID + // sDMSGetDeviceSerialNumbersResponse_MEID only contains this + const CHAR * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (meidSize < outLenx12 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pMEIDString, pTLVx12, outLenx12 ); + pMEIDString[outLenx12] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + state [ I ] - Desired lock state + pCurrentPIN [ I ] - Current four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetLock( + ULONG * pOutLen, + BYTE * pOut, + ULONG state, + CHAR * pCurrentPIN ) +{ + // Validate arguments + if (pOut == 0 || pCurrentPIN == 0 || pCurrentPIN[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string thePIN( pCurrentPIN ); + if (thePIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (thePIN.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSSetLockStateRequest_LockState ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSSetLockStateRequest_LockState * pTLVx01; + pTLVx01 = (sDMSSetLockStateRequest_LockState*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mLockState = (eQMIDMSLockStates)state; + memcpy( &pTLVx01->mLockCode[0], thePIN.c_str(), thePIN.size() ); + + offset += tlvx01Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseQueryLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pState [ O ] - Current lock state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseQueryLock( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ) +{ + // Validate arguments + if (pIn == 0 || pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the state + const sDMSGetLockStateResponse_LockState * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSGetLockStateResponse_LockState )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pState = pTLVx01->mLockState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackChangeLockPIN + +DESCRIPTION: + This command sets the user lock code maintained by the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pCurrentPIN [ I ] - Current four digit PIN string + pDesiredPIN [ I ] - New four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackChangeLockPIN( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ) +{ + // Validate arguments + if (pOut == 0 + || pCurrentPIN == 0 || pCurrentPIN[0] == 0 + || pDesiredPIN == 0 || pDesiredPIN[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theCurPIN( pCurrentPIN ); + if (theCurPIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (theCurPIN.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theNewPIN( pDesiredPIN ); + if (theNewPIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (theNewPIN.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSSetLockCodeRequest_LockCode ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSSetLockCodeRequest_LockCode * pTLVx01; + pTLVx01 = (sDMSSetLockCodeRequest_LockCode*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mCurrentLockCode[0], + theCurPIN.c_str(), + theCurPIN.size() ); + + memcpy( &pTLVx01->mNewLockCode[0], + theNewPIN.c_str(), + theNewPIN.size() ); + + offset += tlvx01Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetHardwareRevision + +DESCRIPTION: + This function returns the device hardware revision + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetHardwareRevision( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the hardware revision + // sDMSGetHardwareRevisionResponse_HardwareRevision only contains this + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (stringSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, pTLVx01, outLenx01 ); + pString[outLenx01] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPRLVersion + +DESCRIPTION: + This function returns the version of the active Preferred Roaming List + (PRL) in use by the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pPRLVersion [ O ] - The PRL version number + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPRLVersion( + ULONG inLen, + const BYTE * pIn, + WORD * pPRLVersion ) +{ + // Validate arguments + if (pIn == 0 || pPRLVersion == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the state + const sDMSGetPRLVersionResponse_PRLVersion * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSGetPRLVersionResponse_PRLVersion )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pPRLVersion = pTLVx01->mPRLVersion; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetERIFile + +DESCRIPTION: + This command returns the ERI file that is stored in EFS on the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pFileSize [I/O] - Upon input the maximum number of bytes that the file + contents array can contain. Upon successful output + the actual number of bytes written to the file contents + array + pFile [ O ] - The file contents + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetERIFile( + ULONG inLen, + const BYTE * pIn, + ULONG * pFileSize, + BYTE * pFile ) +{ + // Validate arguments + if (pIn == 0 || pFileSize == 0 || *pFileSize == 0 || pFile == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + ULONG maxFileSize = *pFileSize; + *pFileSize = 0; + + // Find the state + const sDMSReadERIDataResponse_UserData * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSReadERIDataResponse_UserData )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG fileSz = pTLVx01->mDataLength; + const BYTE * pInFile; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sDMSReadERIDataResponse_UserData ) + + sizeof( BYTE ) * fileSz) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Space to copy into? + if (fileSz > maxFileSize) + { + return eGOBI_ERR_BUFFER_SZ; + } + + // Align to the first array element + pInFile = (const BYTE *)pTLVx01 + + sizeof( sDMSReadERIDataResponse_UserData ); + + // Perform the copy + memcpy( pFile, pInFile, fileSz ); + *pFileSize = fileSz; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackActivateAutomatic + +DESCRIPTION: + This function requests the device to perform automatic service activation + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pActivationCode [ I ] - Activation code (maximum string length of 12) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackActivateAutomatic( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pActivationCode ) +{ + // Validate arguments + if (pOut == 0 || pActivationCode == 0 || pActivationCode[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string ac( pActivationCode ); + if (ac.size() > 12) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSActivateAutomaticRequest_ActivationCode ) + + (WORD)ac.size(); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSActivateAutomaticRequest_ActivationCode * pTLVx01; + pTLVx01 = (sDMSActivateAutomaticRequest_ActivationCode*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mCodeLength = (UINT8)ac.size(); + + memcpy( (BYTE *)pTLVx01 + + sizeof( sDMSActivateAutomaticRequest_ActivationCode ), + ac.c_str(), + ac.size() ); + + offset += tlvx01Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackResetToFactoryDefaults + +DESCRIPTION: + This function requests the device reset configuration to factory defaults + + CHANGES: + * The client must manually reset the device after this request completes + using DMSSetOperatingMode() + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackResetToFactoryDefaults( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSResetFactoryDefaultsRequest_SPC ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The SPC + sDMSResetFactoryDefaultsRequest_SPC * pTLVx01; + pTLVx01 = (sDMSResetFactoryDefaultsRequest_SPC*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetActivationState + +DESCRIPTION: + This function returns the device activation state + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pActivationState [ O ] - Service activation state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetActivationState( + ULONG inLen, + const BYTE * pIn, + ULONG * pActivationState ) +{ + // Validate arguments + if (pIn == 0 || pActivationState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the state + const sDMSGetActivationStateResponse_ActivationState * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSGetActivationStateResponse_ActivationState )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pActivationState = pTLVx01->mActivationState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetPower + +DESCRIPTION: + This function sets the operating mode of the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied to pOut + pOut [ O ] - Output buffer + powerMode [ I ] - Selected operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetPower( + ULONG * pOutLen, + BYTE * pOut, + ULONG powerMode ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSSetOperatingModeRequest_OperatingMode ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // Set the mode + sDMSSetOperatingModeRequest_OperatingMode * pTLVx01; + pTLVx01 = (sDMSSetOperatingModeRequest_OperatingMode*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mOperatingMode = (eQMIDMSOperatingModes)powerMode; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPower + +DESCRIPTION: + This function returns the operating mode of the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pPowerMode [ O ] - Current operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPower( + ULONG inLen, + const BYTE * pIn, + ULONG * pPowerMode ) +{ + // Validate arguments + if (pIn == 0 || pPowerMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pPowerMode = 0xffffffff; + + // Find the mode + const sDMSGetOperatingModeResponse_OperatingMode * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSGetOperatingModeResponse_OperatingMode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pPowerMode = pTLVx01->mOperatingMode; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetOfflineReason + +DESCRIPTION: + This function returns the reason why the operating mode of the device + is currently offline + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pReasonMask [ O ] - Bitmask of offline reasons + pbPlatform [ O ] - Offline due to being platform retricted? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetOfflineReason( + ULONG inLen, + const BYTE * pIn, + ULONG * pReasonMask, + ULONG * pbPlatform ) +{ + // Validate arguments + if (pIn == 0 || pReasonMask == 0 || pbPlatform == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pReasonMask = 0; + *pbPlatform = 0; + + // Find the reason mask (optional) + const sDMSGetOperatingModeResponse_OfflineReason * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sDMSGetOperatingModeResponse_OfflineReason )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Copy the bitmask to pReasonMask + *pReasonMask = *(WORD*)pTLVx10; + } + + // Find the platform restriction (optional) + const sDMSGetOperatingModeResponse_PlatformRestricted * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sDMSGetOperatingModeResponse_PlatformRestricted )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Copy the value + *pbPlatform = pTLVx11->mPlatformRestricted; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetNetworkTime + +DESCRIPTION: + This function returns the current time of the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pTimeCount [ O ] - Count of 1.25ms that have elapsed from the start + of GPS time (Jan 6, 1980) + pTimeSource [ O ] - Source of the timestamp + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetNetworkTime( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pTimeCount, + ULONG * pTimeSource ) +{ + // Validate arguments + if (pIn == 0 || pTimeCount == 0 || pTimeSource == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the reason mask + const sDMSGetTimestampResponse_Timestamp * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSGetTimestampResponse_Timestamp )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Get the values + *pTimeCount = pTLVx01->mTimestamp; + // mSource is of type eQMIDMSTimestampSources + *pTimeSource = pTLVx01->mSource; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackValidateSPC + +DESCRIPTION: + This function validates the service programming code + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - Six digit service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackValidateSPC( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSValidateSPCRequest_SPC ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The SPC + sDMSValidateSPCRequest_SPC * pTLVx01; + pTLVx01 = (sDMSValidateSPCRequest_SPC*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationNAS.cpp b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationNAS.cpp new file mode 100755 index 0000000..da5a645 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationNAS.cpp @@ -0,0 +1,2022 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationNAS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (NAS Service) + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +// Maximum length for a scanned network description +const ULONG MAX_SNI_DESCRIPTION_LEN = 255; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sEVDOCustomSCPConfig +// Struct to represent CDMA 1xEV-DO custom SCP config +/*=========================================================================*/ +struct sEVDOCustomSCPConfig +{ + public: + BYTE mbActive; + ULONG mProtocolMask; + ULONG mBroadcastMask; + ULONG mApplicationMask; +}; + +/*=========================================================================*/ +// Struct sScannedNetworkInfo +// Struct to represent scanned network information +/*=========================================================================*/ +struct sScannedNetworkInfo +{ + public: + USHORT mMCC; + USHORT mMNC; + ULONG mInUse; + ULONG mRoaming; + ULONG mForbidden; + ULONG mPreferred; + CHAR mDescription[MAX_SNI_DESCRIPTION_LEN]; +}; + +/*=========================================================================*/ +// Struct sScannedNetworkRATInfo +// Struct to represent scanned network RAT information +/*=========================================================================*/ +struct sScannedNetworkRATInfo +{ + public: + USHORT mMCC; + USHORT mMNC; + ULONG mRAT; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================== +METHOD: + ParseGetANAAAAuthenticationStatus + +DESCRIPTION: + This function gets the AN-AAA authentication status + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pStatus [ O ] - AN-AAA authentication status + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetANAAAAuthenticationStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus ) +{ + // Validate arguments + if (pIn == 0 || pStatus == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sNASGetANAAAAuthenticationStatusResponse_Status * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sNASGetANAAAAuthenticationStatusResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pStatus = pTLVx01->mANAAAAuthenticationStatus; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSignalStrength + +DESCRIPTION: + This function gets the current signal strength (in dBm) as measured by + the device, the signal strength returned will be one of the currently + available technologies with preference CDMA 1xEV-DO, CDMA, AMPS, + WCDMA, GSM + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSignalStrength [ O ] - Received signal strength (dBm) + pRadioInterface [ O ] - Radio interface technology + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSignalStrength( + ULONG inLen, + const BYTE * pIn, + INT8 * pSignalStrength, + ULONG * pRadioInterface ) +{ + // Validate arguments + if (pSignalStrength == 0 || pRadioInterface == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG sigSz = 12; + INT8 sigs[12]; + ULONG radios[12]; + ULONG qcErr = ParseGetSignalStrengths( inLen, + pIn, + &sigSz, + &sigs[0], + &radios[0] ); + if (qcErr != eGOBI_ERR_NONE) + { + return qcErr; + } + + std::map sigMap; + for (ULONG s = 0; s < sigSz; s++) + { + sigMap[radios[s]] = sigs[s]; + } + + std::map ::const_iterator pIter; + + // HDR? + pIter = sigMap.find( 2 ); + if (pIter != sigMap.end()) + { + *pSignalStrength = pIter->second; + *pRadioInterface = pIter->first; + + return eGOBI_ERR_NONE; + } + + // CDMA? + pIter = sigMap.find( 1 ); + if (pIter != sigMap.end()) + { + *pSignalStrength = pIter->second; + *pRadioInterface = pIter->first; + + return eGOBI_ERR_NONE; + } + + // AMPS? + pIter = sigMap.find( 3 ); + if (pIter != sigMap.end()) + { + *pSignalStrength = pIter->second; + *pRadioInterface = pIter->first; + + return eGOBI_ERR_NONE; + } + + // WCDMA? + pIter = sigMap.find( 5 ); + if (pIter != sigMap.end()) + { + *pSignalStrength = pIter->second; + *pRadioInterface = pIter->first; + + return eGOBI_ERR_NONE; + } + + // GSM? + pIter = sigMap.find( 4 ); + if (pIter != sigMap.end()) + { + *pSignalStrength = pIter->second; + *pRadioInterface = pIter->first; + + return eGOBI_ERR_NONE; + } + + // Error values + *pSignalStrength = -128; + *pRadioInterface = 0; + + return eGOBI_ERR_NO_SIGNAL; +} + +/*=========================================================================== +METHOD: + ParseGetSignalStrengths + +DESCRIPTION: + This function gets the current available signal strengths (in dBm) + as measured by the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pArraySizes [I/O] - Upon input the maximum number of elements + that each array can contain can contain. + Upon successful output the actual number + of elements in each array + pSignalStrengths [ O ] - Received signal strength array (dBm) + pRadioInterfaces [ O ] - Radio interface technology array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSignalStrengths( + ULONG inLen, + const BYTE * pIn, + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ) +{ + // Validate arguments + if (pIn == 0 + || pArraySizes == 0 + || *pArraySizes == 0 + || pSignalStrengths == 0 + || pRadioInterfaces == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSignals = (ULONG)*pArraySizes; + + // Assume failure + *pArraySizes = 0; + + // Find the first signal strength value + const sNASGetSignalStrengthResponse_SignalStrength * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sNASGetSignalStrengthResponse_SignalStrength )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Weed out bogus values + std::map sigMap; + + INT8 sigVal = pTLVx01->mSignalStrengthdBm; + ULONG radioVal = pTLVx01->mRadioInterface; + if (sigVal <= -30 && sigVal > -125 && radioVal != 0) + { + sigMap[radioVal] = sigVal; + } + + // Handle list, if present + const sNASGetSignalStrengthResponse_SignalStrengthList * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sNASGetSignalStrengthResponse_SignalStrengthList )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG auxSigs = pTLVx10->mNumberOfInfoInstances; + if (auxSigs > maxSignals) + { + auxSigs = maxSignals; + } + + const sNASGetSignalStrengthResponse_SignalStrengthList::sInfo * pInfo; + + // Verify there is room for the array in the TLV + if (outLenx10 < sizeof( sNASGetSignalStrengthResponse_SignalStrengthList ) + + sizeof( sNASGetSignalStrengthResponse_SignalStrengthList::sInfo ) + * auxSigs) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pInfo = (const sNASGetSignalStrengthResponse_SignalStrengthList::sInfo *) + ((const BYTE *)pTLVx10 + + sizeof( sNASGetSignalStrengthResponse_SignalStrengthList )); + + for (ULONG s = 0; s < auxSigs; s++) + { + sigVal = pInfo->mSignalStrengthdBm; + radioVal = pInfo->mRadioInterface; + if (sigVal <= -30 && sigVal > -125 && radioVal != 0) + { + sigMap[radioVal] = sigVal; + } + + // Move pInfo forward one element + pInfo++; + } + } + + ULONG sigCount = 0; + std::map ::const_iterator pIter; + for (pIter = sigMap.begin(); pIter != sigMap.end(); pIter++, sigCount++) + { + if (sigCount < maxSignals) + { + pSignalStrengths[sigCount] = pIter->second; + pRadioInterfaces[sigCount] = pIter->first; + *pArraySizes = sigCount + 1; + } + } + + // No valid signals? + if (sigCount == 0) + { + return eGOBI_ERR_NO_SIGNAL; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetRFInfo + +DESCRIPTION: + This function gets the current RF information + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pInstanceSize [I/O] - Upon input the maximum number of elements that the + RF info instance array can contain. Upon success + the actual number of elements in the RF info + instance array + pInstances [ O ] - The RF info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetRFInfo( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + // Validate arguments + if (pIn == 0 + || pInstanceSize == 0 + || *pInstanceSize == 0 + || pInstances == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxInstances = *pInstanceSize; + *pInstanceSize = 0; + + // Find the TLV + const sNASGetRFInfoResponse_RFInfo * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sNASGetRFInfoResponse_RFInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + BYTE ifaceCount = pTLVx01->mNumberOfInstances; + if (ifaceCount > maxInstances) + { + ifaceCount = maxInstances; + } + + const sNASGetRFInfoResponse_RFInfo::sInstance * pInstance; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sNASGetRFInfoResponse_RFInfo ) + + sizeof( sNASGetRFInfoResponse_RFInfo::sInstance ) + * ifaceCount) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pInstance = (const sNASGetRFInfoResponse_RFInfo::sInstance *) + ((const BYTE *)pTLVx01 + + sizeof( sNASGetRFInfoResponse_RFInfo )); + + ULONG * pOutput = (ULONG *)pInstances; + for (BYTE i = 0; i < ifaceCount; i++) + { + *pOutput++ = pInstance->mRadioInterface; + *pOutput++ = pInstance->mActiveBandClass; + *pOutput++ = pInstance->mActiveChannel; + + // Move pInstance forward one element + pInstance++; + } + + *pInstanceSize = ifaceCount; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParsePerformNetworkScan + +DESCRIPTION: + This function performs a scan for available networks + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParsePerformNetworkScan( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + // Validate arguments + if (pIn == 0 + || pInstanceSize == 0 + || *pInstanceSize == 0 + || pInstances == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxInstances = *pInstanceSize; + + // Assume failure + *pInstanceSize = 0; + + // Find the TLV + const sNASPerformNetworkScanResponse_NetworkInfo * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sNASPerformNetworkScanResponse_NetworkInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + UINT16 netCount = pTLVx10->mNumberOfInfoInstances; + if (netCount > maxInstances) + { + netCount = maxInstances; + } + + const sNASPerformNetworkScanResponse_NetworkInfo::sNetworkInfo * pNetInfo; + + // Align to the first array element + pNetInfo = (const sNASPerformNetworkScanResponse_NetworkInfo::sNetworkInfo *) + ((const BYTE *)pTLVx10 + + sizeof( sNASPerformNetworkScanResponse_NetworkInfo )); + ULONG offset = sizeof( sNASPerformNetworkScanResponse_NetworkInfo ); + + sScannedNetworkInfo * pNet = (sScannedNetworkInfo *)pInstances; + for (BYTE i = 0; i < netCount; i++) + { + // Check TLV size + if (offset > outLenx10) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + pNet->mMCC = pNetInfo->mMobileCountryCode; + pNet->mMNC = pNetInfo->mMobileNetworkCode; + pNet->mInUse = pNetInfo->mInUseStatus; + pNet->mRoaming = pNetInfo->mRoamingStatus; + pNet->mForbidden = pNetInfo->mForbiddenStatus; + pNet->mPreferred = pNetInfo->mPreferredStatus; + + memset( &pNet->mDescription[0], 0, MAX_SNI_DESCRIPTION_LEN ); + + BYTE descLen = pNetInfo->mDescriptionLength; + if (descLen > 0) + { + // Move pNetInfo forward + pNetInfo++; + offset += sizeof( sNASPerformNetworkScanResponse_NetworkInfo::sNetworkInfo ); + + // Check TLV size + if (offset > outLenx10) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + std::string netDesc( (LPCSTR)pNetInfo ); + + ULONG actualLen = (ULONG)netDesc.size(); + if (actualLen >= MAX_SNI_DESCRIPTION_LEN) + { + actualLen = MAX_SNI_DESCRIPTION_LEN - 1; + } + + LPCSTR pNetDesc = netDesc.c_str(); + memcpy( &pNet->mDescription[0], pNetDesc, actualLen ); + + // Move pNetInfo past string + pNetInfo = (const sNASPerformNetworkScanResponse_NetworkInfo::sNetworkInfo *) + ((const BYTE *)pNetInfo + descLen); + offset += descLen; + } + + pNet++; + } + + *pInstanceSize = (BYTE)netCount; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParsePerformNetworkRATScan + +DESCRIPTION: + This function performs a scan for available networks (includes RAT) + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + pRATSize [I/O] - Upon input the maximum number of elements that the + RAT info instance array can contain. Upon success + the actual number of elements in the RAT info + instance array + pRATInstances [ O ] - The RAT info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParsePerformNetworkRATScan( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ) +{ + // Validate arguments + if (pIn == 0 + || pInstanceSize == 0 + || *pInstanceSize == 0 + || pInstances == 0 + || pRATSize == 0 + || *pRATSize == 0 + || pRATInstances == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxRATInstances = *pRATSize; + + // Assume failure + *pInstanceSize = 0; + *pRATSize = 0; + + // First, generate the instances using ParsePerformNetworkScan + ULONG rc = ParsePerformNetworkScan( inLen, pIn, pInstanceSize, pInstances ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Now find the RAT info too + + // Find the TLV + const sNASPerformNetworkScanResponse_NetworkRAT * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx11 < sizeof( sNASPerformNetworkScanResponse_NetworkRAT )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + UINT16 ratCount = pTLVx11->mNumberOfInfoInstances; + if (ratCount > maxRATInstances) + { + ratCount = maxRATInstances; + } + + const sNASPerformNetworkScanResponse_NetworkRAT::sInfo * pRatInfo; + + // Verify there is room for the array in the TLV + if (outLenx11 < sizeof( sNASPerformNetworkScanResponse_NetworkRAT ) + + sizeof( sNASPerformNetworkScanResponse_NetworkRAT::sInfo ) + * ratCount) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pRatInfo = (const sNASPerformNetworkScanResponse_NetworkRAT::sInfo *) + ((const BYTE *)pTLVx11 + + sizeof( sNASPerformNetworkScanResponse_NetworkRAT )); + + sScannedNetworkRATInfo * pRAT = (sScannedNetworkRATInfo *)pRATInstances; + for (BYTE r = 0; r < ratCount; r++) + { + pRAT->mMCC = pRatInfo->mMobileCountryCode; + pRAT->mMNC = pRatInfo->mMobileNetworkCode; + pRAT->mRAT = pRatInfo->mRadioAccessTechnology; + + pRAT++; + pRatInfo++; + } + + *pRATSize = (BYTE)ratCount; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackInitiateNetworkRegistration + +DESCRIPTION: + This function initiates a network registration + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + regType [ I ] - Registration type + mcc [ I ] - Mobile country code (ignored for auto registration) + mnc [ I ] - Mobile network code (ignored for auto registration) + rat [ I ] - Radio access type (ignored for auto registration) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackInitiateNetworkRegistration( + ULONG * pOutLen, + BYTE * pOut, + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Set the action + + // Check size + WORD tlvx01Sz = sizeof( sNASInitiateNetworkRegisterRequest_Action ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sNASInitiateNetworkRegisterRequest_Action * pTLVx01; + pTLVx01 = (sNASInitiateNetworkRegisterRequest_Action*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mRegisterAction = (eQMINASRegisterActions)regType; + + offset += tlvx01Sz; + + // Set the info + + // Check size + WORD tlvx10Sz = sizeof( sNASInitiateNetworkRegisterRequest_ManualInfo ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset = sizeof( sQMIRawContentHeader ); + + sNASInitiateNetworkRegisterRequest_ManualInfo * pTLVx10; + pTLVx10 = (sNASInitiateNetworkRegisterRequest_ManualInfo*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mMobileCountryCode = mcc; + pTLVx10->mMobileNetworkCode = mnc; + pTLVx10->mRadioAccessTechnology = (eQMINASRadioAccessTechnologies)rat; + + offset += tlvx10Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackInitiateDomainAttach + +DESCRIPTION: + This function initiates a domain attach (or detach) + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + action [ I ] - PS attach action (attach or detach) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackInitiateDomainAttach( + ULONG * pOutLen, + BYTE * pOut, + ULONG action ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx10Sz = sizeof( sNASInitiateAttachRequest_Action ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sNASInitiateAttachRequest_Action * pTLVx10; + pTLVx10 = (sNASInitiateAttachRequest_Action*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mPSAttachAction = (eQMINASPSAttachActions)action; + + offset += tlvx10Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetServingNetwork + +DESCRIPTION: + Gets information regarding the system that currently provides service + to the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pRegistrationState [ O ] - Registration state + pCSDomain [ O ] - Circuit switch domain status + pPSDomain [ O ] - Packet switch domain status + pRAN [ O ] - Radio access network + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. Upon + successful output the actual number of elements + in the radio interface array + pRadioIfaces [ O ] - The radio interface array + pRoaming [ O ] - Roaming indicator (0xFFFFFFFF - Unknown) + pMCC [ O ] - Mobile country code (0xFFFF - Unknown) + pMNC [ O ] - Mobile network code (0xFFFF - Unknown) + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the network name array + can contain + pName [ O ] - The network name or description represented + as a NULL terminated string (empty string + returned when unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetServingNetwork( + ULONG inLen, + const BYTE * pIn, + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ) +{ + // Validate arguments + if (pIn == 0 + || pRegistrationState == 0 + || pCSDomain == 0 + || pPSDomain == 0 + || pRAN == 0 + || pRadioIfacesSize == 0 + || *pRadioIfacesSize == 0 + || pRadioIfaces == 0 + || pRoaming == 0 + || pMCC == 0 + || pMNC == 0 + || nameSize == 0 + || pName == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxRadioIfaces = *pRadioIfacesSize; + + // Assume failure + *pRadioIfacesSize = 0; + *pRoaming = 0xffffffff; + *pMCC = 0xffff; + *pMNC = 0xffff; + *pName = 0; + + // Parse the serving system (mandatory) + + // Find the TLV + const sNASGetServingSystemResponse_ServingSystem * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sNASGetServingSystemResponse_ServingSystem )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Populate the variables + *pRegistrationState = pTLVx01->mRegistrationState; + *pCSDomain = pTLVx01->mCSAttachState; + *pPSDomain = pTLVx01->mPSAttachState; + *pRAN = pTLVx01->mRegisteredNetwork; + + BYTE activeRadioIfaces = pTLVx01->mNumberOfRadioInterfacesInUse; + if (activeRadioIfaces > maxRadioIfaces) + { + activeRadioIfaces = maxRadioIfaces; + } + + const eQMINASRadioInterfaces * pRadioInfo; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sNASGetServingSystemResponse_ServingSystem ) + + sizeof( eQMINASRadioInterfaces ) * activeRadioIfaces) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pRadioInfo = (const eQMINASRadioInterfaces *) + ((const BYTE *)pTLVx01 + + sizeof( sNASGetServingSystemResponse_ServingSystem )); + + ULONG * pOutRadioIfaces = (ULONG *)pRadioIfaces; + for (ULONG r = 0; r < activeRadioIfaces; r++) + { + *pOutRadioIfaces = *pRadioInfo; + pOutRadioIfaces++; + pRadioInfo++; + } + + *pRadioIfacesSize = activeRadioIfaces; + + // Find the roaming indicator (optional) + const sNASGetServingSystemResponse_RoamingIndicator * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sNASGetServingSystemResponse_RoamingIndicator )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Get the values + *pRoaming = (eQMINASRoamingIndicators)pTLVx10->mRoamingIndicator; + } + + // Find the PLMN (optional) + const sNASGetServingSystemResponse_CurrentPLMN * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx12 < sizeof( sNASGetServingSystemResponse_CurrentPLMN )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMCC = pTLVx12->mMobileCountryCode; + *pMNC = pTLVx12->mMobileNetworkCode; + + ULONG descLen = pTLVx12->mDescriptionLength; + const CHAR * pDesc; + + // Verify there is room for the array in the TLV + if (outLenx12 < sizeof( sNASGetServingSystemResponse_CurrentPLMN ) + + sizeof( CHAR ) * descLen) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Space to perform the copy? + if (nameSize < descLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + // Align to the first array element + pDesc = (const CHAR *)((const BYTE *)pTLVx12 + + sizeof( sNASGetServingSystemResponse_CurrentPLMN )); + + memcpy( pName, pDesc, descLen ); + pName[descLen] = 0; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetServingNetworkCapabilities + +DESCRIPTION: + Gets information regarding the data capabilities of the system that + currently provides service to the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pDataCapsSize [I/O] - Upon input the maximum number of elements that the + data capabilities array can contain. Upon success + the actual number of elements in the data + capabilities array + pDataCaps [ O ] - The data capabilities array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetServingNetworkCapabilities( + ULONG inLen, + const BYTE * pIn, + BYTE * pDataCapsSize, + BYTE * pDataCaps ) +{ + // Validate arguments + if (pIn == 0 + || pDataCapsSize == 0 + || *pDataCapsSize == 0 + || pDataCaps == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxDataCaps = *pDataCapsSize; + + // Assume failure + *pDataCapsSize = 0; + + // Find the TLV + const sNASGetServingSystemResponse_DataServices * pTLVx11; + ULONG outLenx11; + ULONG rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx11 < sizeof( sNASGetServingSystemResponse_DataServices )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + BYTE activeDataCaps = pTLVx11->mNumberOfDataCapabilities; + if (activeDataCaps > maxDataCaps) + { + activeDataCaps = maxDataCaps; + } + + const eQMINASDataServiceCapabilities2 * pInDataCaps; + + // Verify there is room for the array in the TLV + if (outLenx11 < sizeof( sNASGetServingSystemResponse_DataServices ) + + sizeof( eQMINASDataServiceCapabilities2 ) * activeDataCaps) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pInDataCaps = (const eQMINASDataServiceCapabilities2 *) + ((const BYTE *)pTLVx11 + + sizeof( sNASGetServingSystemResponse_DataServices )); + + ULONG * pOutDataCaps = (ULONG *)pDataCaps; + for (ULONG d = 0; d < activeDataCaps; d++) + { + *pOutDataCaps = *pInDataCaps; + pOutDataCaps++; + pInDataCaps++; + } + + *pDataCapsSize = activeDataCaps; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetHomeNetwork + +DESCRIPTION: + This function retrieves information about the home network of the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMCC [ O ] - Mobile country code + pMNC [ O ] - Mobile network code + nameSize [ I ] - The maximum number of characters (including NULL + terminator) that the network name array can contain + pName [ O ] - The network name or description represented as a NULL + terminated string (empty string returned when unknown) + pSID [ O ] - Home network system ID (0xFFFF - Unknown) + pNID [ O ] - Home network ID (0xFFFF - Unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetHomeNetwork( + ULONG inLen, + const BYTE * pIn, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ) +{ + // Validate arguments + if (pIn == 0 + || pMCC == 0 + || pMNC == 0 + || nameSize == 0 + || pName == 0 + || pSID == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pName = 0; + *pSID = 0xffff; + *pNID = 0xffff; + + // Find the name (mandatory) + const sNASGetHomeNetworkResponse_HomeNetwork * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sNASGetHomeNetworkResponse_HomeNetwork )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Populate the variables + *pMCC = pTLVx01->mMobileCountryCode; + *pMNC = pTLVx01->mMobileNetworkCode; + + ULONG descLen = pTLVx01->mDescriptionLength; + const CHAR * pDesc; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sNASGetHomeNetworkResponse_HomeNetwork ) + + sizeof( CHAR ) * descLen) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Space to perform the copy? + if (nameSize < descLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + // Align to the first array element + pDesc = (const CHAR *)((const BYTE *)pTLVx01 + + sizeof( sNASGetHomeNetworkResponse_HomeNetwork )); + + memcpy( pName, pDesc, descLen ); + pName[descLen] = 0; + + + // Find the SID/NID (optional) + const sNASGetHomeNetworkResponse_HomeIDs * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sNASGetHomeNetworkResponse_HomeIDs )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSID = pTLVx10->mSystemID; + *pNID = pTLVx10->mNetworkID; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetNetworkPreference + +DESCRIPTION: + This function sets the network registration preference + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + technologyPref [ I ] - Technology preference bitmap + duration [ I ] - Duration of active preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetNetworkPreference( + ULONG * pOutLen, + BYTE * pOut, + ULONG technologyPref, + ULONG duration ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sNASSetTechnologyPreferenceRequest_Preference ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sNASSetTechnologyPreferenceRequest_Preference * pTLVx01; + pTLVx01 = (sNASSetTechnologyPreferenceRequest_Preference*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Copy technology preference WORD as-is + memcpy( &pTLVx01->mValOfTechnology, &technologyPref, 2 ); + + pTLVx01->mDuration = (eQMINASTechPrefDurations)duration; + + offset += tlvx01Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetNetworkPreference + +DESCRIPTION: + This function returns the network registration preference + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pTechnologyPref [ O ] - Technology preference bitmap + pDuration [ O ] - Duration of active preference + pPersistentTechnologyPref [ O ] - Persistent technology preference bitmap + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetNetworkPreference( + ULONG inLen, + const BYTE * pIn, + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ) +{ + // Validate arguments + if (pIn == 0 + || pTechnologyPref == 0 + || pDuration == 0 + || pPersistentTechnologyPref == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the preference (mandatory) + const sNASGetTechnologyPreferenceResponse_ActivePreference * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sNASGetTechnologyPreferenceResponse_ActivePreference )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Copy technology preference WORD as-is + *pTechnologyPref = 0; + memcpy( pTechnologyPref, &pTLVx01->mValOfTechnology, 2 ); + + *pDuration = pTLVx01->mDuration; + + + // Until we know any better the persistent setting is the current setting + *pPersistentTechnologyPref = *pTechnologyPref; + + // Find the persistant technology preference (optional) + const sNASGetTechnologyPreferenceResponse_PersistentPreference * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sNASGetTechnologyPreferenceResponse_PersistentPreference )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Copy technology preference WORD as-is + *pTechnologyPref = 0; + memcpy( pPersistentTechnologyPref, &pTLVx10->mValOfTechnology, 2 ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetCDMANetworkParameters + +DESCRIPTION: + This function sets the desired CDMA network parameters + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - Six digit service programming code + pForceRev0 [ I ] - (Optional) Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ I ] - (Optional) Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ I ] - (Optional) Protocol mask for custom SCP config + pBroadcast [ I ] - (Optional) Broadcast mask for custom SCP config + pApplication [ I ] - (Optional) Application mask for custom SCP config + pRoaming [ I ] - (Optional) Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetCDMANetworkParameters( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // If you specify one of the custom SCP config fields then you must + // specify them all + ULONG scpCount = 0; + if (pCustomSCP != 0) + { + scpCount++; + } + + if (pProtocol != 0) + { + scpCount++; + } + + if (pBroadcast != 0) + { + scpCount++; + } + + if (pApplication != 0) + { + scpCount++; + } + + if (scpCount != 0 && scpCount != 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Rev. 0 and SCP custom config are mutually exclusive + if (pForceRev0 != 0 && scpCount == 4) + { + if (*pForceRev0 != 0 && *pCustomSCP != 0) + { + return eGOBI_ERR_INVALID_ARG; + } + } + + sQMIRawContentHeader * pHeader; + ULONG offset = 0; + + // Need to start with SPC? + if (pForceRev0 != 0 || scpCount == 4) + { + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx10Sz = sizeof( sNASSetNetworkParametersRequest_SPC ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sNASSetNetworkParametersRequest_SPC * pTLVx10; + pTLVx10 = (sNASSetNetworkParametersRequest_SPC*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the values + memcpy( &pTLVx10->mSPC[0], spc.c_str(), spc.size() ); + + offset += tlvx10Sz; + } + + // Force Rev. 0? + if (pForceRev0 != 0) + { + // Check size + WORD tlvx14Sz = sizeof( sNASSetNetworkParametersRequest_CDMA1xEVDORevision ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx14Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x14; + pHeader->mLength = tlvx14Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sNASSetNetworkParametersRequest_CDMA1xEVDORevision * pTLVx14; + pTLVx14 = (sNASSetNetworkParametersRequest_CDMA1xEVDORevision*)(pOut + offset); + memset( pTLVx14, 0, tlvx14Sz ); + + // Set the value + pTLVx14->mForceCDMA1xEVDORev0 = (*pForceRev0 == 0 ? 0 : 1); + + offset += tlvx14Sz; + } + + if (scpCount == 4) + { + // Check size + WORD tlvx15Sz = sizeof( sNASSetNetworkParametersRequest_CDMA1xEVDOSCPCustom ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx15Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x15; + pHeader->mLength = tlvx15Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sNASSetNetworkParametersRequest_CDMA1xEVDOSCPCustom * pTLVx15; + pTLVx15 = (sNASSetNetworkParametersRequest_CDMA1xEVDOSCPCustom*)(pOut + offset); + memset( pTLVx15, 0, tlvx15Sz ); + + // Set the values + pTLVx15->mCDMA1xEVDOSCPCustomConfig = (*pCustomSCP == 0 ? 0 : 1); + + // The pProtocol bitmask + pTLVx15->mSubtype2PhysicalLayer = (*pProtocol & 0x00000001 ? 1 : 0); + pTLVx15->mEnhancedCCMAC = (*pProtocol & 0x00000002 ? 1 : 0); + pTLVx15->mEnhancedACMAC = (*pProtocol & 0x00000004 ? 1 : 0); + pTLVx15->mEnhancedFTCMAC = (*pProtocol & 0x00000008 ? 1 : 0); + pTLVx15->mSubtype3RTCMAC = (*pProtocol & 0x00000010 ? 1 : 0); + pTLVx15->mSubtype1RTCMAC = (*pProtocol & 0x00000020 ? 1 : 0); + pTLVx15->mEnhancedIdle = (*pProtocol & 0x00000040 ? 1 : 0); + pTLVx15->mGenericMultimodeCapableDiscPort + = (*pProtocol & 0x00000080 ? 1 : 0); + + pTLVx15->mGenericBroadcast = (*pBroadcast & 0x00000001 ? 1 : 0); + + pTLVx15->mSNMultiflowPacketApplication + = (*pApplication & 0x00000001 ? 1 : 0); + + pTLVx15->mSNEnhancedMultiflowPacketApplication + = (*pApplication & 0x00000002 ? 1 : 0); + + offset += tlvx15Sz; + } + + if (pRoaming != 0) + { + // Check size + WORD tlvx16Sz = sizeof( sNASSetNetworkParametersRequest_Roaming ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx16Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x16; + pHeader->mLength = tlvx16Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sNASSetNetworkParametersRequest_Roaming * pTLVx16; + pTLVx16 = (sNASSetNetworkParametersRequest_Roaming*)(pOut + offset); + memset( pTLVx16, 0, tlvx16Sz ); + + // Set the values + pTLVx16->mRoamPreference = (eQMINASRoamingPreferences)*pRoaming; + + offset += tlvx16Sz; + } + + // At least one of the optional parameters must have been set + if (offset == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetCDMANetworkParameters + +DESCRIPTION: + This function gets the current CDMA network parameters + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSCI [ O ] - Slot cycle index + pSCM [ O ] - Station class mark + pRegHomeSID [ O ] - Register on home SID? + pRegForeignSID [ O ] - Register on foreign SID? + pRegForeignNID [ O ] - Register on foreign NID? + pForceRev0 [ O ] - Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ O ] - Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ O ] - Protocol mask for custom SCP config + pBroadcast [ O ] - Broadcast mask for custom SCP config + pApplication [ O ] - Application mask for custom SCP config + pRoaming [ O ] - Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetCDMANetworkParameters( + ULONG inLen, + const BYTE * pIn, + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + // Validate arguments + if (pIn == 0 + || pSCI == 0 + || pSCM == 0 + || pRegHomeSID == 0 + || pRegForeignSID == 0 + || pRegForeignNID == 0 + || pForceRev0 == 0 + || pCustomSCP == 0 + || pProtocol == 0 + || pBroadcast == 0 + || pApplication == 0 + || pRoaming == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSCI = 0xff; + *pSCM = 0xff; + *pRegHomeSID = 0xff; + *pRegForeignSID = 0xff; + *pRegForeignNID = 0xff; + *pForceRev0 = 0xff; + *pCustomSCP = 0xff; + *pProtocol = 0xffffffff; + *pBroadcast = 0xffffffff; + *pApplication = 0xffffffff; + *pRoaming = 0xff; + + // Find the SCI + const sNASGetNetworkParametersResponse_SCI * pTLVx11; + ULONG outLenx11; + ULONG rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sNASGetNetworkParametersResponse_SCI )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSCI = pTLVx11->mSlotCycleIndex; + } + + // Find the SCM + const sNASGetNetworkParametersResponse_SCM * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx12 < sizeof( sNASGetNetworkParametersResponse_SCM )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSCM = pTLVx12->mStationClassMark; + } + + // Find the Registration + const sNASGetNetworkParametersResponse_Registration * pTLVx13; + ULONG outLenx13; + rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx13 < sizeof( sNASGetNetworkParametersResponse_Registration )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRegHomeSID = pTLVx13->mRegisterOnHomeSystem; + *pRegForeignSID = pTLVx13->mRegisterOnForeignSystem; + *pRegForeignNID = pTLVx13->mRegisterOnForeignNetwork; + } + + // Rev. 0? + const sNASGetNetworkParametersResponse_CDMA1xEVDORevision * pTLVx14; + ULONG outLenx14; + rc = GetTLV( inLen, pIn, 0x14, &outLenx14, (const BYTE **)&pTLVx14 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx14 < sizeof( sNASGetNetworkParametersResponse_CDMA1xEVDORevision )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRegHomeSID = pTLVx14->mForceCDMA1xEVDORev0; + } + + // We're lazy, so we'll just typecast all the bitmask members from + // sNASGetNetworkParametersResponse_CDMA1xEVDOSCPCustom into their + // respective container parameters + const sEVDOCustomSCPConfig * pTLVx15; + ULONG outLenx15; + rc = GetTLV( inLen, pIn, 0x15, &outLenx15, (const BYTE **)&pTLVx15 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx15 < sizeof( sEVDOCustomSCPConfig )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pCustomSCP = pTLVx15->mbActive; + *pProtocol = pTLVx15->mProtocolMask; + *pBroadcast = pTLVx15->mBroadcastMask; + *pApplication = pTLVx15->mApplicationMask; + } + + // Roaming? + const sNASGetNetworkParametersResponse_Roaming * pTLVx16; + ULONG outLenx16; + rc = GetTLV( inLen, pIn, 0x16, &outLenx16, (const BYTE **)&pTLVx16 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx16 < sizeof( sNASGetNetworkParametersResponse_Roaming )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRoaming = (eQMINASRoamingPreferences)pTLVx16->mRoamPreference; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetACCOLC + +DESCRIPTION: + This function returns the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pACCOLC [ O ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetACCOLC( + ULONG inLen, + const BYTE * pIn, + BYTE * pACCOLC ) +{ + // Validate arguments + if (pIn == 0 || pACCOLC == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the ACCOLC (mandatory) + const sNASGetACCOLCResponse_ACCOLC * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sNASGetACCOLCResponse_ACCOLC )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pACCOLC = pTLVx01->mACCOLC; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetACCOLC + +DESCRIPTION: + This function sets the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + accolc [ I ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetACCOLC( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE accolc ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sNASSetACCOLCRequest_ACCOLC ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sNASSetACCOLCRequest_ACCOLC * pTLVx01; + pTLVx01 = (sNASSetACCOLCRequest_ACCOLC*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + pTLVx01->mACCOLC = accolc; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPLMNMode + +DESCRIPTION: + This function returns the PLMN mode from the CSP + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMode [ O ] - PLMN mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPLMNMode( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode ) +{ + // Validate arguments + if (pIn == 0 || pMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the mode (mandatory) + const sNASGetCSPPLMNModeResponse_Mode * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx10 < sizeof( sNASGetCSPPLMNModeResponse_Mode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMode = pTLVx10->mRestrictManualPLMNSelection; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetPLMNName + +DESCRIPTION: + This function returns PLMN name information for the given MCC/MNC + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + mcc [ I ] - Mobile country code + mnc [ I ] - Mobile network code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetPLMNName( + ULONG * pOutLen, + BYTE * pOut, + USHORT mcc, + USHORT mnc ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sNASGetPLMNNameRequest_PLMN ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sNASGetPLMNNameRequest_PLMN * pTLVx01; + pTLVx01 = (sNASGetPLMNNameRequest_PLMN*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mMobileCountryCode = mcc; + pTLVx01->mMobileNetworkCode = mnc; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPLMNName + +DESCRIPTION: + This function returns PLMN name information for the given MCC/MNC + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pNamesSize [I/O] - Upon input the size in BYTEs of the name structure + array. Upon success the actual number of BYTEs + copied to the name structure array + pNames [ O ] - The name structure array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPLMNName( + ULONG inLen, + const BYTE * pIn, + ULONG * pNamesSize, + BYTE * pNames ) +{ + // Validate arguments + if (pIn == 0 || *pNamesSize == 0 || pNames == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + const BYTE * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // The output format just happens to be the same as + // sNASGetPLMNNameResponse_Name. Copy the full TLV to pNames + if (outLenx10 > *pNamesSize) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pNames, pTLVx10, outLenx10 ); + *pNamesSize = outLenx10; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationOMA.cpp b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationOMA.cpp new file mode 100755 index 0000000..93810fb --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationOMA.cpp @@ -0,0 +1,481 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationOMA.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (OMADM Service) + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + PackOMADMStartSession + +DESCRIPTION: + This function starts an OMA-DM session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + sessionType [ I ] - Type of session to initiate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackOMADMStartSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG sessionType ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add sessionType + + // Check size + WORD tlvx10Sz = sizeof( sOMAStartSessionRequest_Type ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sOMAStartSessionRequest_Type * pTLVx10; + pTLVx10 = (sOMAStartSessionRequest_Type*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mSessionType = (eQMIOMASessionTypes)sessionType; + + offset += tlvx10Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseOMADMGetSessionInfo + +DESCRIPTION: + This function returns information related to the current (or previous + if no session is active) OMA-DM session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSessionState [ O ] - State of session + pSessionType [ O ] - Type of session + pFailureReason [ O ] - Session failure reason (when state indicates failure) + pRetryCount [ O ] - Session retry count (when state indicates retrying) + pSessionPause [ O ] - Session pause timer (when state indicates retrying) + pTimeRemaining [ O ] - Pause time remaining (when state indicates retrying) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseOMADMGetSessionInfo( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ) +{ + // Validate arguments + if (pIn == 0 || pSessionState == 0 || pSessionType == 0 + || pFailureReason == 0 || pRetryCount == 0 || pSessionPause == 0 + || pTimeRemaining == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the first TLV + const sOMAGetSessionInfoResponse_Info * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sOMAGetSessionInfoResponse_Info )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSessionState = pTLVx10->mSessionState; + *pSessionType = pTLVx10->mSessionType; + + // Find the second TLV + const sOMAGetSessionInfoResponse_Failure * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx11 < sizeof( sOMAGetSessionInfoResponse_Failure )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pFailureReason = pTLVx11->mSessionFailure; + + // Find the third TLV + const sOMAGetSessionInfoResponse_Retry * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx12 < sizeof( sOMAGetSessionInfoResponse_Retry )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRetryCount = pTLVx12->mRetryCount; + *pSessionPause = pTLVx12->mRetryPauseTimer; + *pTimeRemaining = pTLVx12->mRemainingTime; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseOMADMGetPendingNIA + +DESCRIPTION: + This function returns information about the pending network initiated + alert + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSessionType [ O ] - Type of session + pSessionID [ O ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseOMADMGetPendingNIA( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionType, + USHORT * pSessionID ) +{ + // Validate arguments + if (pIn == 0 || pSessionType == 0 || pSessionID == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sOMAGetSessionInfoResponse_NIA * pTLVx13; + ULONG outLenx13; + ULONG rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx13 < sizeof( sOMAGetSessionInfoResponse_NIA )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSessionID = pTLVx13->mSessionID; + *pSessionType = pTLVx13->mSessionType; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackOMADMSendSelection + +DESCRIPTION: + This function sends the specified OMA-DM selection for the current + network initiated session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + selection [ I ] - Selection + sessionID [ I ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackOMADMSendSelection( + ULONG * pOutLen, + BYTE * pOut, + ULONG selection, + USHORT sessionID ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add selection and session ID + + // Check size + WORD tlvx10Sz = sizeof( sOMASendSelectionRequest_Type ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sOMASendSelectionRequest_Type * pTLVx10; + pTLVx10 = (sOMASendSelectionRequest_Type*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the values + pTLVx10->mSelection = (eQMIOMASelections)selection; + pTLVx10->mSessionID = sessionID; + + offset += tlvx10Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseOMADMGetFeatureSettings + +DESCRIPTION: + This function returns the OMA-DM feature settings + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pbProvisioning [ O ] - Device provisioning service update enabled + pbPRLUpdate [ O ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseOMADMGetFeatureSettings( + ULONG inLen, + const BYTE * pIn, + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ) +{ + // Validate arguments + if (pIn == 0 || pbProvisioning == 0 || pbPRLUpdate == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the first TLV + const sOMAGetFeaturesResponse_Provisioning * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sOMAGetFeaturesResponse_Provisioning )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbProvisioning = pTLVx10->mDeviceProvisioningServiceUpdateEnabled; + + // Find the second TLV + const sOMAGetFeaturesResponse_PRLUpdate * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sOMAGetFeaturesResponse_PRLUpdate )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbPRLUpdate = pTLVx11->mPRLServiceUpdateEnabled; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackOMADMSetProvisioningFeature + +DESCRIPTION: + This function sets the OMA-DM device provisioning service + update feature setting + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + bProvisioning [ I ] - Device provisioning service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackOMADMSetProvisioningFeature( + ULONG * pOutLen, + BYTE * pOut, + ULONG bProvisioning ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add bProvisioning + + // Check size + WORD tlvx10Sz = sizeof( sOMASetFeaturesRequest_Provisioning ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sOMASetFeaturesRequest_Provisioning * pTLVx10; + pTLVx10 = (sOMASetFeaturesRequest_Provisioning*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mDeviceProvisioningServiceUpdateEnabled = (INT8)bProvisioning; + + offset += tlvx10Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackOMADMSetPRLUpdateFeature + +DESCRIPTION: + This function sets the OMA-DM PRL service update feature setting + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + bPRLUpdate [ I ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackOMADMSetPRLUpdateFeature( + ULONG * pOutLen, + BYTE * pOut, + ULONG bPRLUpdate ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add bPRLUpdate + + // Check size + WORD tlvx11Sz = sizeof( sOMASetFeaturesRequest_PRLUpdate ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sOMASetFeaturesRequest_PRLUpdate * pTLVx11; + pTLVx11 = (sOMASetFeaturesRequest_PRLUpdate*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Set the value + pTLVx11->mPRLServiceUpdateEnabled = (INT8)bPRLUpdate; + + offset += tlvx11Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationPDS.cpp b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationPDS.cpp new file mode 100755 index 0000000..ece4df7 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationPDS.cpp @@ -0,0 +1,1207 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationPDS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (Position Determination Service) + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + PackResetPDSData + +DESCRIPTION: + This function resets the specified PDS data + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pGPSDataMask [ I ] - Bitmask of GPS data to clear (optional) + pCellDataMask [ I ] - Bitmask of cell data to clear (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackResetPDSData( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pGPSDataMask, + ULONG * pCellDataMask ) +{ + // Validate arguments (at least one mask must be present) + if (pOut == 0 || (pGPSDataMask == 0 && pCellDataMask == 0)) + { + return eGOBI_ERR_INVALID_ARG; + } + + sQMIRawContentHeader * pHeader; + ULONG offset = 0; + + // Optionally add pGPSDataMask + if (pGPSDataMask != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sPDSResetPDSDataRequest_GPSData ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + offset += sizeof( sQMIRawContentHeader ); + + sPDSResetPDSDataRequest_GPSData * pTLVx10; + pTLVx10 = (sPDSResetPDSDataRequest_GPSData*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Typecast the input over the bitmask + *(ULONG *)pTLVx10 = *pGPSDataMask; + offset += tlvx10Sz; + } + + // Optionally add pCellDataMask + if (pCellDataMask != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sPDSResetPDSDataRequest_CellData ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + offset += sizeof( sQMIRawContentHeader ); + + sPDSResetPDSDataRequest_CellData * pTLVx11; + pTLVx11 = (sPDSResetPDSDataRequest_CellData*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Typecast the input over the bitmask + *(ULONG *)pTLVx11 = *pCellDataMask; + offset += tlvx11Sz; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetPortAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + bAuto [ I ] - Enable automatic tracking for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetPortAutomaticTracking( + ULONG * pOutLen, + BYTE * pOut, + ULONG bAuto ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add bAuto + + // Check size + WORD tlvx01Sz = sizeof( sPDSSetCOMPortAutoTrackingConfigRequest_Config ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetCOMPortAutoTrackingConfigRequest_Config * pTLVx01; + pTLVx01 = (sPDSSetCOMPortAutoTrackingConfigRequest_Config*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mAutoTrackingEnabled = (bAuto == 0 ? 0 : 1); + + offset += tlvx01Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPortAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pbAuto [ O ] - Automatic tracking enabled for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPortAutomaticTracking( + ULONG inLen, + const BYTE * pIn, + ULONG * pbAuto ) +{ + // Validate arguments + if (pIn == 0 || pbAuto == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find pbAuto + const sPDSGetCOMPortAutoTrackingConfigResponse_Config * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sPDSGetCOMPortAutoTrackingConfigResponse_Config )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbAuto = pTLVx01->mAutoTrackingEnabled; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetServiceAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking state for the service + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pbAuto [ I ] - Start automatic tracking session for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetServiceAutomaticTracking( + ULONG * pOutLen, + BYTE * pOut, + ULONG bAuto ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add bAuto + + // Check size + WORD tlvx01Sz = sizeof( sPDSSetServiceAutoTrackingStateRequest_State ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetServiceAutoTrackingStateRequest_State * pTLVx01; + pTLVx01 = (sPDSSetServiceAutoTrackingStateRequest_State*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mAutoTrackingEnabled = (bAuto == 0 ? 0 : 1); + + offset += tlvx01Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} +/*=========================================================================== +METHOD: + ParseGetServiceAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking state for the service + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pbAuto [ O ] - Automatic tracking session started for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetServiceAutomaticTracking( + ULONG inLen, + const BYTE * pIn, + ULONG * pbAuto ) +{ + // Validate arguments + if (pIn == 0 || pbAuto == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find pbAuto + const sPDSGetServiceAutoTrackingStateResponse_State * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sPDSGetServiceAutoTrackingStateResponse_State )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbAuto = pTLVx01->mAutoTrackingEnabled; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetAGPSConfig + +DESCRIPTION: + This function sets the PDS AGPS configuration + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + serverAddress [ I ] - IPv4 address of AGPS server + serverPort [ I ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetAGPSConfig( + ULONG * pOutLen, + BYTE * pOut, + ULONG serverAddress, + ULONG serverPort ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx10Sz = sizeof( sPDSSetAGPSConfigRequest_Server ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetAGPSConfigRequest_Server * pTLVx10; + pTLVx10 = (sPDSSetAGPSConfigRequest_Server*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + ULONG ip0 = (serverAddress & 0x000000FF); + ULONG ip1 = (serverAddress & 0x0000FF00) >> 8; + ULONG ip2 = (serverAddress & 0x00FF0000) >> 16; + ULONG ip3 = (serverAddress & 0xFF000000) >> 24; + + // Set the values + pTLVx10->mServerAddress[0] = (INT8)ip0; + pTLVx10->mServerAddress[1] = (INT8)ip1; + pTLVx10->mServerAddress[2] = (INT8)ip2; + pTLVx10->mServerAddress[3] = (INT8)ip3; + pTLVx10->mServerPort = serverPort; + + offset += tlvx10Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetAGPSConfig + +DESCRIPTION: + This function returns the PDS AGPS configuration + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pServerAddress [ O ] - IPv4 address of AGPS server + pServerPort [ O ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetAGPSConfig( + ULONG inLen, + const BYTE * pIn, + ULONG * pServerAddress, + ULONG * pServerPort ) +{ + // Validate arguments + if (pIn == 0 || pServerAddress == 0 || pServerPort == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find arguments + const sPDSGetAGPSConfigResponse_ServerAddress * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sPDSGetAGPSConfigResponse_ServerAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pServerPort = pTLVx01->mServerPort; + + ULONG ip0 = (ULONG)pTLVx01->mServerAddress[0]; + ULONG ip1 = (ULONG)pTLVx01->mServerAddress[1] << 8; + ULONG ip2 = (ULONG)pTLVx01->mServerAddress[2] << 16; + ULONG ip3 = (ULONG)pTLVx01->mServerAddress[3] << 24; + *pServerAddress = (ip0 | ip1 | ip2 | ip3); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetXTRATimeState + +DESCRIPTION: + This function sets the XTRA time positioning state + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + state [ I ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetXTRATimeState( + ULONG * pOutLen, + BYTE * pOut, + ULONG state ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add state + + // Check size + WORD tlvx10Sz = sizeof( sPDSSetPositionMethodsStateRequest_XTRATime ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetPositionMethodsStateRequest_XTRATime * pTLVx10; + pTLVx10 = (sPDSSetPositionMethodsStateRequest_XTRATime*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mMethodState = (eQMIPDSMethodStates)state; + + offset += tlvx10Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetXTRATimeState + +DESCRIPTION: + This function returns the XTRA time positioning state + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pState [ O ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetXTRATimeState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ) +{ + // Validate arguments + if (pIn == 0 || pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find pState + const sPDSGetPositionMethodsStateResponse_XTRATime * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sPDSGetPositionMethodsStateResponse_XTRATime )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pState = pTLVx10->mMethodState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetXTRADataState + +DESCRIPTION: + This function sets the XTRA data positioning state + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + state [ I ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetXTRADataState( + ULONG * pOutLen, + BYTE * pOut, + ULONG state ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add state + + // Check size + WORD tlvx10Sz = sizeof( sPDSSetPositionMethodsStateRequest_XTRAData ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetPositionMethodsStateRequest_XTRAData * pTLVx10; + pTLVx10 = (sPDSSetPositionMethodsStateRequest_XTRAData*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mMethodState = (eQMIPDSMethodStates)state; + + offset += tlvx10Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetXTRADataState + +DESCRIPTION: + This function returns the XTRA data positioning state + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pState [ O ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetXTRADataState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ) +{ + // Validate arguments + if (pIn == 0 || pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find pState + const sPDSGetPositionMethodsStateResponse_XTRAData * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sPDSGetPositionMethodsStateResponse_XTRAData )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pState = pTLVx10->mMethodState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetXTRAValidity + +DESCRIPTION: + This function returns the XTRA database validity period + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pGPSWeek [ O ] - Starting GPS week of validity period + pGPSWeekOffset [ O ] - Starting GPS week offset (minutes) of validity period + pDuration [ O ] - Length of validity period (hours) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetXTRAValidity( + ULONG inLen, + const BYTE * pIn, + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ) +{ + // Validate arguments + if (pIn == 0 || pGPSWeek == 0 || pGPSWeekOffset == 0 || pDuration == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find arguments + const sPDSGetXTRAParametersResponse_Validity * pTLVx13; + ULONG outLenx13; + ULONG rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx13 < sizeof( sPDSGetXTRAParametersResponse_Validity )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pDuration = pTLVx13->mValidPeriodDurationInHours; + *pGPSWeek = pTLVx13->mValidPeriodGPSStartWeek; + *pGPSWeekOffset = pTLVx13->mValidPeriodGPSStartWeekOffsetInMinutes; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetXTRANetwork + +DESCRIPTION: + This function sets the XTRA WWAN network preference + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + preference [ I ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetXTRANetwork( + ULONG * pOutLen, + BYTE * pOut, + ULONG preference ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add preference + + // Check size + WORD tlvx12Sz = sizeof( sPDSSetXTRAParametersRequest_Network ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx12Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x12; + pHeader->mLength = tlvx12Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetXTRAParametersRequest_Network * pTLVx12; + pTLVx12 = (sPDSSetXTRAParametersRequest_Network*)(pOut + offset); + memset( pTLVx12, 0, tlvx12Sz ); + + // Set the value + pTLVx12->mWWANNetworkPreference = (eQMIPDSWWANNetworkPreferences)preference; + + offset += tlvx12Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetXTRANetwork + +DESCRIPTION: + This function returns the XTRA WWAN network preference + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pPreference [ O ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetXTRANetwork( + ULONG inLen, + const BYTE * pIn, + ULONG * pPreference ) +{ + // Validate arguments + if (pIn == 0 || pPreference == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find pPreference + const sPDSGetXTRAParametersResponse_Network * pTLVx12; + ULONG outLenx12; + ULONG rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx12 < sizeof( sPDSGetXTRAParametersResponse_Network )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pPreference = pTLVx12->mWWANNetworkPreference; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetXTRAAutomaticDownload + +DESCRIPTION: + This function sets the XTRA automatic download configuration + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + bEnabled [ I ] - Automatic download enabled? + interval [ I ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetXTRAAutomaticDownload( + ULONG * pOutLen, + BYTE * pOut, + ULONG bEnabled, + USHORT interval ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx10Sz = sizeof( sPDSSetXTRAParametersRequest_Automatic ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetXTRAParametersRequest_Automatic * pTLVx10; + pTLVx10 = (sPDSSetXTRAParametersRequest_Automatic*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mAutomaticDownloadEnabled = (bEnabled == 0 ? 0 : 1); + pTLVx10->mDownloadIntervalInHours = interval; + + offset += tlvx10Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetXTRAAutomaticDownload + +DESCRIPTION: + This function returns the XTRA automatic download configuration + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pbEnabled [ O ] - Automatic download enabled? + pInterval [ O ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetXTRAAutomaticDownload( + ULONG inLen, + const BYTE * pIn, + ULONG * pbEnabled, + USHORT * pInterval ) +{ + // Validate arguments + if (pIn == 0 || pbEnabled == 0 || pInterval == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find arguments + const sPDSGetXTRAParametersResponse_Automatic * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sPDSGetXTRAParametersResponse_Automatic )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbEnabled = pTLVx10->mAutomaticDownloadEnabled; + *pInterval = pTLVx10->mDownloadIntervalInHours; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPDSState + +DESCRIPTION: + This function returns the current PDS state + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pEnabled [ O ] - Current PDS state (0 = disabled) + pTracking [ O ] - Current PDS tracking session state + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPDSState( + ULONG inLen, + const BYTE * pIn, + ULONG * pEnabled, + ULONG * pTracking ) +{ + // Validate arguments + if (pIn == 0 || pEnabled == 0 || pTracking == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find arguments + const sPDSGetServiceStateResponse_State * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sPDSGetServiceStateResponse_State )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pEnabled = pTLVx01->mServiceEnabled; + *pTracking = pTLVx01->mTrackingSessionState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetPDSState + +DESCRIPTION: + This function sets the PDS state + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + enable [ I ] - Desired PDS state (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetPDSState( + ULONG * pOutLen, + BYTE * pOut, + ULONG enable ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add enable + + // Check size + WORD tlvx01Sz = sizeof( sPDSSetServiceStateRequest_State ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetServiceStateRequest_State * pTLVx01; + pTLVx01 = (sPDSSetServiceStateRequest_State*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mServiceEnabled = (enable == 0 ? 0 : 1); + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackPDSInjectTimeReference + +DESCRIPTION: + This function injects a system time into the PDS engine + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + sysTime [ I ] - System time + sysDiscontinuities [ I ] - Number of system time discontinuities + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackPDSInjectTimeReference( + ULONG * pOutLen, + BYTE * pOut, + ULONGLONG systemTime, + USHORT systemDiscontinuities ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx01Sz = sizeof( sPDSInjectTimeReferenceRequest_Time ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSInjectTimeReferenceRequest_Time * pTLVx01; + pTLVx01 = (sPDSInjectTimeReferenceRequest_Time*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mSystemTimeMilliseconds = systemTime; + pTLVx01->mSystemDiscontinuties = systemDiscontinuities; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPDSDefaults + +DESCRIPTION: + This function returns the default tracking session configuration + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOperation [ O ] - Current session operating mode + pTimeout [ O ] - Maximum amount of time (seconds) to work on each fix + pInterval [ O ] - Interval (milliseconds) between fix requests + pAccuracy [ O ] - Current accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPDSDefaults( + ULONG inLen, + const BYTE * pIn, + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ) +{ + // Validate arguments + if (pIn == 0 || pOperation == 0 || pTimeout == 0 + || pInterval == 0 || pAccuracy == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find arguments + const sPDSGetDefaultsResponse_Defaults * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sPDSGetDefaultsResponse_Defaults )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pOperation = pTLVx01->mSessionOperation; + *pTimeout = pTLVx01->mTimeoutSeconds; + *pInterval = pTLVx01->mFixRequestIntervalSeconds; + *pAccuracy = pTLVx01->mDesiredAccuracyMeters; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetPDSDefaults + +DESCRIPTION: + This function sets the default tracking session configuration + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + operation [ I ] - Desired session operating mode + timeout [ I ] - Maximum amount of time (seconds) to work on each fix + interval [ I ] - Interval (milliseconds) between fix requests + accuracy [ I ] - Desired accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetPDSDefaults( + ULONG * pOutLen, + BYTE * pOut, + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx01Sz = sizeof( sPDSSetDefaultsRequest_Defaults ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetDefaultsRequest_Defaults * pTLVx01; + pTLVx01 = (sPDSSetDefaultsRequest_Defaults*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mDesiredAccuracyMeters = accuracy; + pTLVx01->mFixRequestIntervalSeconds = interval; + pTLVx01->mSessionOperation = (eQMIPDSOperationTypes)operation; + pTLVx01->mTimeoutSeconds = timeout; + + offset += tlvx01Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationRMS.cpp b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationRMS.cpp new file mode 100755 index 0000000..6f441ac --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationRMS.cpp @@ -0,0 +1,188 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationRMS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (Remote Management Service) + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + ParseGetSMSWake + +DESCRIPTION: + This function queries the state of the SMS wake functionality + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pbEnabled [ O ] - SMS wake functionality enabled? + pWakeMask [ O ] - SMS wake mask (only relevant when enabled) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSMSWake( + ULONG inLen, + const BYTE * pIn, + ULONG * pbEnabled, + ULONG * pWakeMask ) +{ + // Validate arguments + if (pIn == 0 || pbEnabled == 0 || pWakeMask == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the first TLV + const sRMSGetSMSWakeResponse_State * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sRMSGetSMSWakeResponse_State )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Find the second TLV + const sRMSGetSMSWakeRequest_Mask * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx11 < sizeof( sRMSGetSMSWakeRequest_Mask )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbEnabled = pTLVx10->mSMSWakeEnabled; + *pWakeMask = pTLVx11->mMask; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetSMSWake + +DESCRIPTION: + This function enables/disables the SMS wake functionality + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + bEnable [ I ] - Enable SMS wake functionality? + wakeMask [ I ] - SMS wake mask (only relevant when enabling) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetSMSWake( + ULONG * pOutLen, + BYTE * pOut, + ULONG bEnable, + ULONG wakeMask ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add bEnable + + // Check size + WORD tlvx10Sz = sizeof( sRMSSetSMSWakeRequest_State ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sRMSSetSMSWakeRequest_State * pTLVx10; + pTLVx10 = (sRMSSetSMSWakeRequest_State*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mSMSWakeEnabled = (INT8)bEnable; + + offset += tlvx10Sz; + + // Add wakeMask if enabled + if (bEnable != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sRMSSetSMSWakeRequest_Mask ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sRMSSetSMSWakeRequest_Mask * pTLVx11; + pTLVx11 = (sRMSSetSMSWakeRequest_Mask*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Set the value + pTLVx11->mMask = wakeMask; + + offset += tlvx11Sz; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationUIM.cpp b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationUIM.cpp new file mode 100755 index 0000000..d41ad37 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationUIM.cpp @@ -0,0 +1,1170 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationUIM.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (DMS_UIM Service) + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + ParseUIMUnblockControlKey + +DESCRIPTION: + This function unblocks the specified facility control key + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMUnblockControlKey( + ULONG inLen, + const BYTE * pIn, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMUnblockControlKeyResponse_Status * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMUnblockControlKeyResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pUnblockRetriesLeft = pTLVx10->mRemainingUnblockRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMUnblockControlKey + +DESCRIPTION: + This function unblocks the specified facility control key + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - Facility ID + pValue [ I ] - Control key de-personalization string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMUnblockControlKey( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pValue ) +{ + // Validate arguments + if (pOut == 0 + || pValue == 0 + || pValue[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string val( pValue ); + UINT8 valSz = (UINT8)val.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMUnblockControlKeyRequest_Facility ) + valSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSUIMUnblockControlKeyRequest_Facility * pTLVx01; + pTLVx01 = (sDMSUIMUnblockControlKeyRequest_Facility*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mFacility = (eQMIDMSUIMFacility)id; + pTLVx01->mControlKeyLength = valSz; + + offset += sizeof( sDMSUIMUnblockControlKeyRequest_Facility ); + + memcpy( (pOut + offset), (LPCSTR)val.c_str(), valSz ); + offset += valSz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMSetControlKeyProtection + +DESCRIPTION: + This function changes the specified facility control key + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + control key will be blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMSetControlKeyProtection( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pVerifyRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMSetControlKeyProtectionResponse_Status * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMSetControlKeyProtectionResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx10->mRemainingVerifyRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMSetControlKeyProtection + +DESCRIPTION: + This function changes the specified facility control key + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - Facility ID + status [ I ] - Control key status + pValue [ I ] - Control key de-personalization string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMSetControlKeyProtection( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + ULONG status, + CHAR * pValue ) +{ + // Validate arguments + if (pOut == 0 + || pValue == 0 + || pValue[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string val( pValue ); + UINT8 valSz = (UINT8)val.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMSetControlKeyProtectionRequest_Facility ) + valSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSUIMSetControlKeyProtectionRequest_Facility * pTLVx01; + pTLVx01 = (sDMSUIMSetControlKeyProtectionRequest_Facility*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mFacility = (eQMIDMSUIMFacility)id; + pTLVx01->mFacilityState = (eQMIDMSUIMFacilityStates)status; + pTLVx01->mControlKeyLength = (UINT8)valSz; + + offset += sizeof( sDMSUIMSetControlKeyProtectionRequest_Facility ); + + memcpy( (pOut + offset), val.c_str(), valSz ); + offset += valSz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMGetControlKeyBlockingStatus + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + pbBlocking [ O ] - (Optional) Is the facility blocking? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMGetControlKeyBlockingStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ) +{ + // Validate arguments + if (pIn == 0 + || pStatus == 0 + || pVerifyRetriesLeft == 0 + || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the first arguments + const sDMSUIMGetControlKeyStatusResponse_Status * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sDMSUIMGetControlKeyStatusResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx01->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx01->mRemainingUnblockRetries; + *pStatus = pTLVx01->mFacilityState; + + // Find the last (optional) argument + if (pbBlocking != 0) + { + const sDMSUIMGetControlKeyStatusResponse_Blocking * pTLVx10; + ULONG tlvLenx10; + rc = GetTLV( inLen, pIn, 0x10, &tlvLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (tlvLenx10 < sizeof( sDMSUIMGetControlKeyStatusResponse_Blocking )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbBlocking = pTLVx10->mOperationBlocking; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMGetControlKeyBlockingStatus + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - Facility ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMGetControlKeyBlockingStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG id ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add id + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMGetControlKeyStatusRequest_Facility ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSUIMGetControlKeyStatusRequest_Facility * pTLVx01; + pTLVx01 = (sDMSUIMGetControlKeyStatusRequest_Facility*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mFacility = (eQMIDMSUIMFacility)id; + + offset += tlvx01Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMGetControlKeyStatus + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMGetControlKeyStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 + || pStatus == 0 + || pVerifyRetriesLeft == 0 + || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the arguments + const sDMSUIMGetControlKeyStatusResponse_Status * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sDMSUIMGetControlKeyStatusResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx01->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx01->mRemainingUnblockRetries; + *pStatus = pTLVx01->mFacilityState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMGetControlKeyStatus + +DESCRIPTION: + This function requests the status of the specified facility control key + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - Facility ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMGetControlKeyStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG id ) +{ + // Request is the same as PackUIMGetControlKeyBlockingStatus + return PackUIMGetControlKeyBlockingStatus( pOutLen, + pOut, + id ); +} + +/*=========================================================================== +METHOD: + ParseUIMGetICCID + +DESCRIPTION: + This function returns the UIM ICCID + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMGetICCID( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMGetICCIDResponse_ICCID * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sDMSUIMGetICCIDResponse_ICCID )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // The TLV only contains the string + + // Space to perform the copy? + if (stringSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, (const CHAR*)pTLVx01, outLenx01 ); + pString[outLenx01] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMGetPINStatus + +DESCRIPTION: + This function returns the status of the pin + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + id [ I ] - PIN ID (1/2) + pStatus [ O ] - PIN status (0xFFFFFFFF = unknown) + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMGetPINStatus( + ULONG inLen, + const BYTE * pIn, + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 + || id < 1 + || id > 2 + || pStatus == 0 + || pVerifyRetriesLeft == 0 + || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG tlvLen; + + // The typeID is either 0x11 or 0x12 + if (id == 1) + { + const sDMSUIMGetPINStatusResponse_PIN1Status * pTLV11; + ULONG rc = GetTLV( inLen, pIn, 0x11, &tlvLen, (const BYTE **)&pTLV11 ); + + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (tlvLen < sizeof( sDMSUIMGetPINStatusResponse_PIN1Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLV11->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLV11->mRemainingUnblockRetries; + *pStatus = pTLV11->mPINStatus; + } + else if (id == 2) + { + const sDMSUIMGetPINStatusResponse_PIN2Status * pTLV12; + ULONG rc = GetTLV( inLen, pIn, 0x12, &tlvLen, (const BYTE **)&pTLV12 ); + + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (tlvLen < sizeof( sDMSUIMGetPINStatusResponse_PIN2Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLV12->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLV12->mRemainingUnblockRetries; + *pStatus = pTLV12->mPINStatus; + } + else + { + return eGOBI_ERR_INVALID_ARG; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMChangePIN + +DESCRIPTION: + This function changes the PIN value + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMChangePIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pVerifyRetriesLeft == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMChangePINResponse_RetryInfo * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMChangePINResponse_RetryInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx10->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx10->mRemainingUnblockRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMChangePIN + +DESCRIPTION: + This function changes the PIN value + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - PIN ID (1/2) + pOldValue [ I ] - Old PIN value of the PIN to change + pNewValue [ I ] - New PIN value of the PIN to change + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMChangePIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue ) +{ + // Validate arguments + if (pOut == 0 + || id < 1 + || id > 2 + || pOldValue == 0 + || pOldValue[0] == 0 + || pNewValue == 0 + || pNewValue[0] == 0 ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string oldVal( pOldValue ); + ULONG oldValSz = (ULONG)oldVal.size(); + std::string newVal( pNewValue ); + ULONG newValSz = (ULONG)newVal.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMChangePINRequest_Info ) + + (WORD)oldValSz + (WORD)newValSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // First part of the TLV + sDMSUIMChangePINRequest_Info1 * pTLVx01_1; + pTLVx01_1 = (sDMSUIMChangePINRequest_Info1*)(pOut + offset); + memset( pTLVx01_1, 0, tlvx01Sz ); + + pTLVx01_1->mPINID = (UINT8)id; + pTLVx01_1->mOldPINLength = (UINT8)oldValSz; + offset += sizeof( sDMSUIMChangePINRequest_Info1 ); + + // mOldPINValue string + memcpy( (pOut + offset), oldVal.c_str(), oldValSz ); + offset += oldValSz; + + // Second part of the TLV + sDMSUIMChangePINRequest_Info2 * pTLVx01_2; + pTLVx01_2 = (sDMSUIMChangePINRequest_Info2*)(pOut + offset); + + pTLVx01_2->mNewPINLength = (UINT8)newValSz; + offset += sizeof( sDMSUIMChangePINRequest_Info2 ); + + // mNewPINValue string + memcpy( (pOut + offset), newVal.c_str(), newValSz ); + offset += newValSz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMUnblockPIN + +DESCRIPTION: + This function unblocks a blocked PIN + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMUnblockPIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pVerifyRetriesLeft == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMUnblockPINResponse_RetryInfo * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMUnblockPINResponse_RetryInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx10->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx10->mRemainingUnblockRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMUnblockPIN + +DESCRIPTION: + This function unblocks a blocked PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pPUKValue [ I ] - PUK value of the PIN to unblock + pNewValue [ I ] - New PIN value of the PIN to unblock + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMUnblockPIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pPUKValue, + CHAR * pNewValue ) +{ + // Validate arguments + if (pOut == 0 + || id < 1 + || id > 2 + || pPUKValue == 0 + || pPUKValue[0] == 0 + || pNewValue == 0 + || pNewValue[0] == 0 ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string oldVal( pPUKValue ); + ULONG oldValSz = (ULONG)oldVal.size(); + std::string newVal( pNewValue ); + ULONG newValSz = (ULONG)newVal.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMUnblockPINRequest_Info ) + + (WORD)oldValSz + (WORD)newValSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // First part of the TLV + sDMSUIMUnblockPINRequest_Info1 * pTLVx01_1; + pTLVx01_1 = (sDMSUIMUnblockPINRequest_Info1*)(pOut + offset); + memset( pTLVx01_1, 0, tlvx01Sz ); + + pTLVx01_1->mPINID = (UINT8)id; + pTLVx01_1->mPUKLength = (UINT8)oldValSz; + offset += sizeof( sDMSUIMUnblockPINRequest_Info1 ); + + // mPUKValue string + memcpy( (pOut + offset), oldVal.c_str(), oldValSz ); + offset += oldValSz; + + // Second part of the TLV + sDMSUIMUnblockPINRequest_Info2 * pTLVx01_2; + pTLVx01_2 = (sDMSUIMUnblockPINRequest_Info2*)(pOut + offset); + + pTLVx01_2->mNewPINLength = (UINT8)newValSz; + offset += sizeof( sDMSUIMUnblockPINRequest_Info2 ); + + // mNewPINValue string + memcpy( (pOut + offset), newVal.c_str(), newValSz ); + offset += newValSz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMVerifyPIN + +DESCRIPTION: + This function verifies the PIN before accessing the UIM contents + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMVerifyPIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pVerifyRetriesLeft == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMVerifyPINResponse_RetryInfo * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMVerifyPINResponse_RetryInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx10->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx10->mRemainingUnblockRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMVerifyPIN + +DESCRIPTION: + This function verifies the PIN before accessing the UIM contents + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - PIN ID (1/2) + pValue [ I ] - PIN value of the PIN to verify + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMVerifyPIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pValue ) +{ + // Validate arguments + if (pOut == 0 + || id < 1 + || id > 2 + || pValue == 0 + || pValue[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string val( pValue ); + UINT8 valSz = (UINT8)val.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMVerifyPINRequest_Info ) + valSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSUIMVerifyPINRequest_Info * pTLVx01; + pTLVx01 = (sDMSUIMVerifyPINRequest_Info*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mPINID = (UINT8)id; + pTLVx01->mPINLength = valSz; + offset += sizeof( sDMSUIMVerifyPINRequest_Info ); + + // Add mPINValue + memcpy( (pOut + offset), val.c_str(), valSz ); + offset += valSz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMSetPINProtection + +DESCRIPTION: + This function enables or disables protection of UIM contents by a + given PIN + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMSetPINProtection( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pVerifyRetriesLeft == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMSetPINProtectionResponse_RetryInfo * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMSetPINProtectionResponse_RetryInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx10->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx10->mRemainingUnblockRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMSetPINProtection + +DESCRIPTION: + This function enables or disables protection of UIM contents by a + given PIN + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - PIN ID (1/2) + bEnable [ I ] - Enable/disable PIN protection (0 = disable)? + pValue [ I ] - PIN value of the PIN to be enabled/disabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMSetPINProtection( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + ULONG bEnable, + CHAR * pValue ) +{ + // Validate arguments + if (pOut == 0 + || id < 1 + || id > 2 + || pValue == 0 + || pValue[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string val( pValue ); + ULONG valSz = (ULONG)val.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMSetPINProtectionRequest_Info ) + (WORD)valSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSUIMSetPINProtectionRequest_Info * pTLVx01; + pTLVx01 = (sDMSUIMSetPINProtectionRequest_Info*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mPINID = (UINT8)id; + pTLVx01->mPINEnabled = (bEnable == 0 ? 0 : 1); + pTLVx01->mPINLength = (UINT8)valSz; + + offset += sizeof( sDMSUIMSetPINProtectionRequest_Info ); + + // Add mPINValue + memcpy( (pOut + offset), val.c_str(), valSz ); + offset += valSz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationVoice.cpp b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationVoice.cpp new file mode 100755 index 0000000..7d1a4c8 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationVoice.cpp @@ -0,0 +1,174 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationVoice.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (Voice Service for USSD) + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sUSSDInfo +// Struct to represent USSD/Alpha information header +/*=========================================================================*/ +struct sUSSDInfoHdr +{ + public: + BYTE mDCS; + BYTE mLength; + + // Data of 'mLength' follows +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================== +METHOD: + PackOriginateUSSD + +DESCRIPTION: + This function initiates a USSD operation + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackOriginateUSSD( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pInfo ) +{ + // Validate arguments + if (pOut == 0 || pInfo == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + const WORD INFO_HDR_SZ = sizeof( sUSSDInfoHdr ); + + // This assumes that pInfo is at least 2 bytes long + sUSSDInfoHdr * pInInfo = (sUSSDInfoHdr *)pInfo; + WORD infoLen = pInInfo->mLength + INFO_HDR_SZ; + + // Check size + if (*pOutLen < sizeof( sQMIRawContentHeader ) + infoLen) + { + return eGOBI_ERR_BUFFER_SZ; + } + + // Add pInfo + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = infoLen; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // No pTLVx01 since pInfo is our TLV + memcpy( (pOut + offset), pInfo, infoLen ); + + offset += infoLen; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackAnswerUSSD + +DESCRIPTION: + This function responds to a USSD request from the network + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackAnswerUSSD( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pInfo ) +{ + // Validate arguments + if (pOut == 0 || pInfo == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + const WORD INFO_HDR_SZ = sizeof( sUSSDInfoHdr ); + + // This assumes that pInfo is at least 2 bytes long + sUSSDInfoHdr * pInInfo = (sUSSDInfoHdr *)pInfo; + WORD infoLen = pInInfo->mLength + INFO_HDR_SZ; + + // Check size + if (*pOutLen < sizeof( sQMIRawContentHeader ) + infoLen) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = infoLen; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // No pTLVx01 since pInfo is our TLV + memcpy( (pOut + offset), pInfo, infoLen ); + + offset += infoLen; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationWDS.cpp b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationWDS.cpp new file mode 100755 index 0000000..9a22144 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationWDS.cpp @@ -0,0 +1,3486 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationWDS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (WDS Service) + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + ParseGetSessionState + +DESCRIPTION: + This function returns the state of the current packet data session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pState [ O ] - State of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSessionState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ) +{ + // Validate arguments + if (pIn == 0 || pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sWDSGetPacketServiceStatusResponse_Status * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetPacketServiceStatusResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pState = pTLVx01->mConnectionStatus; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSessionDuration + +DESCRIPTION: + This function returns the duration of the current packet data session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pDuration [ O ] - Duration of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSessionDuration( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pDuration ) +{ + // Validate arguments + if (pIn == 0 || pDuration == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sWDSGetDataSessionDurationResponse_Duration * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetDataSessionDurationResponse_Duration )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pDuration = pTLVx01->mDataSessionDuration; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetDormancyState + +DESCRIPTION: + This function returns the dormancy state of the current packet + data session (when connected) + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pState [ O ] - Dormancy state of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetDormancyState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ) +{ + // Validate arguments + if (pIn == 0 || pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sWDSGetDormancyResponse_DormancyStatus * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetDormancyResponse_DormancyStatus )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pState = pTLVx01->mDormancyStatus; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetEnhancedAutoconnect + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSetting [ O ] - NDIS autoconnect setting + pRoamSetting [ O ] - NDIS autoconnect roam setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetEnhancedAutoconnect( + ULONG inLen, + const BYTE * pIn, + ULONG * pSetting, + ULONG * pRoamSetting ) +{ + // Validate arguments + if (pIn == 0 || pSetting == 0 || pRoamSetting == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSetting = 0xffffffff; + *pRoamSetting = 0xffffffff; + + // Find the first TLV + const sWDSGetAutoconnectSettingResponse_Autoconnect * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetAutoconnectSettingResponse_Autoconnect )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSetting = pTLVx01->mAutoconnectSetting; + + // Find the second TLV (optional) + const sWDSGetAutoconnectSettingResponse_Roam * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + // Is the TLV large enough? + if (outLenx10 < sizeof( sWDSGetAutoconnectSettingResponse_Roam )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRoamSetting = pTLVx10->mAutoconnectRoamSetting; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetEnhancedAutoconnect + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + setting [ I ] - NDIS autoconnect setting + pRoamSetting [ I ] - (Optional) NDIS autoconnect roam setting + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetEnhancedAutoconnect( + ULONG * pOutLen, + BYTE * pOut, + ULONG setting, + ULONG * pRoamSetting ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add setting + + // Check size + WORD tlvx01Sz = sizeof( sWDSSetAutoconnectSettingRequest_Autoconnect ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSSetAutoconnectSettingRequest_Autoconnect * pTLVx01; + pTLVx01 = (sWDSSetAutoconnectSettingRequest_Autoconnect*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mAutoconnectSetting = (eQMIWDSAutoconnectSettings)setting; + + offset += tlvx01Sz; + + // Add roam setting, if specified + if (pRoamSetting != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWDSSetAutoconnectSettingRequest_Roam ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetAutoconnectSettingRequest_Roam * pTLVx10; + pTLVx10 = (sWDSSetAutoconnectSettingRequest_Roam*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mAutoconnectRoamSetting = (eQMIWDSAutoconnectRoamSettings)*pRoamSetting; + + offset += tlvx10Sz; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetDefaultProfile + +DESCRIPTION: + This function writes the default profile settings to the device, the + default profile is used during autoconnect + + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + profileType [ I ] - Profile type being written + pPDPType [ I ] - (Optional) PDP type + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pName [ I ] - (Optional) The profile name or description + pAPNName [ I ] - (Optional) Access point name + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetDefaultProfile( + ULONG * pOutLen, + BYTE * pOut, + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add profileType + + // Check size + WORD tlvx01Sz = sizeof( sWDSModifyProfileRequest_ProfileIdentifier ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_ProfileIdentifier * pTLVx01; + pTLVx01 = (sWDSModifyProfileRequest_ProfileIdentifier*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mProfileType = (eQMIProfileTypes)profileType; + pTLVx01->mProfileIndex = 1; + + offset += tlvx01Sz; + + // Add name, if specified + if (pName != 0) + { + std::string name( pName ); + + // Check size + WORD tlvx10Sz = (WORD)name.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( pOut + offset, name.c_str(), name.size() ); + + offset += tlvx10Sz; + } + + // Add PDP type, if specified + if (pPDPType != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWDSModifyProfileRequest_PDPType ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_PDPType * pTLVx11; + pTLVx11 = (sWDSModifyProfileRequest_PDPType*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Set the value + pTLVx11->mPDPType = (eQMIPDPTypes)*pPDPType; + + offset += tlvx11Sz; + } + + // Add APN Name, if specified + if (pAPNName != 0) + { + std::string apnName( pAPNName ); + + // Check size + WORD tlvx14Sz = (WORD)apnName.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx14Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x14; + pHeader->mLength = tlvx14Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), apnName.c_str(), apnName.size() ); + + offset += tlvx14Sz; + } + + // Add Primary DNS, if specified + if (pPrimaryDNS != 0) + { + // Check size + WORD tlvx15Sz = sizeof( sWDSModifyProfileRequest_PrimaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx15Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x15; + pHeader->mLength = tlvx15Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_PrimaryDNS * pTLVx15; + pTLVx15 = (sWDSModifyProfileRequest_PrimaryDNS*)(pOut + offset); + memset( pTLVx15, 0, tlvx15Sz ); + + ULONG ip0 = (*pPrimaryDNS & 0x000000FF); + ULONG ip1 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx15->mIPV4Address[0] = (INT8)ip0; + pTLVx15->mIPV4Address[1] = (INT8)ip1; + pTLVx15->mIPV4Address[2] = (INT8)ip2; + pTLVx15->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx15Sz; + } + + // Add Secondary DNS, if specified + if (pSecondaryDNS != 0) + { + // Check size + WORD tlvx16Sz = sizeof( sWDSModifyProfileRequest_SecondaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx16Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x16; + pHeader->mLength = tlvx16Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_SecondaryDNS * pTLVx16; + pTLVx16 = (sWDSModifyProfileRequest_SecondaryDNS*)(pOut + offset); + memset( pTLVx16, 0, tlvx16Sz ); + + ULONG ip0 = (*pSecondaryDNS & 0x000000FF); + ULONG ip1 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx16->mIPV4Address[0] = (INT8)ip0; + pTLVx16->mIPV4Address[1] = (INT8)ip1; + pTLVx16->mIPV4Address[2] = (INT8)ip2; + pTLVx16->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx16Sz; + } + + // Add Username, if specified + if (pUsername != 0) + { + std::string username( pUsername ); + + // Check size + WORD tlvx1BSz = (WORD)username.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx1BSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x1B; + pHeader->mLength = tlvx1BSz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), username.c_str(), username.size() ); + + offset += tlvx1BSz; + } + + // Add Password, if specified + if (pPassword != 0) + { + std::string password( pPassword ); + + // Check size + WORD tlvx1CSz = (WORD)password.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx1CSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x1C; + pHeader->mLength = tlvx1CSz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), password.c_str(), password.size() ); + + offset += tlvx1CSz; + } + + // Add Authentication, if specified + if (pAuthentication != 0) + { + // Check size + WORD tlvx1DSz = sizeof( sWDSModifyProfileRequest_Authentication ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx1DSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x1D; + pHeader->mLength = tlvx1DSz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_Authentication * pTLVx1D; + pTLVx1D = (sWDSModifyProfileRequest_Authentication*)(pOut + offset); + memset( pTLVx1D, 0, tlvx1DSz ); + + // Set the value + pTLVx1D->mEnablePAP = ((*pAuthentication & 0x00000001) != 0); + pTLVx1D->mEnableCHAP = ((*pAuthentication & 0x00000002) != 0); + + offset += tlvx1DSz; + } + + // Add IP Address, if specified + if (pIPAddress != 0) + { + // Check size + WORD tlvx1ESz = sizeof( sWDSModifyProfileRequest_IPAddress ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx1ESz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x1E; + pHeader->mLength = tlvx1ESz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_IPAddress * pTLVx1E; + pTLVx1E = (sWDSModifyProfileRequest_IPAddress*)(pOut + offset); + memset( pTLVx1E, 0, tlvx1ESz ); + + ULONG ip0 = (*pIPAddress & 0x000000FF); + ULONG ip1 = (*pIPAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pIPAddress & 0x00FF0000) >> 16; + ULONG ip3 = (*pIPAddress & 0xFF000000) >> 24; + + // Set the value + pTLVx1E->mIPV4Address[0] = (INT8)ip0; + pTLVx1E->mIPV4Address[1] = (INT8)ip1; + pTLVx1E->mIPV4Address[2] = (INT8)ip2; + pTLVx1E->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx1ESz; + } + + // At least one of the optional parameters must have been set + if (offset <= sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetDefaultProfile + +DESCRIPTION: + This function reads the default profile settings from the device, the + default profile is used during autoconnect + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + profileType [ I ] - Profile type being read + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetDefaultProfile( + ULONG * pOutLen, + BYTE * pOut, + ULONG profileType ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add profileType + + // Check size + WORD tlvx01Sz = sizeof( sWDSGetDefaultSettingsRequest_ProfileType ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSGetDefaultSettingsRequest_ProfileType * pTLVx01; + pTLVx01 = (sWDSGetDefaultSettingsRequest_ProfileType*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mProfileType = (eQMIProfileTypes)profileType; + + offset += tlvx01Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetDefaultProfile + +DESCRIPTION: + This function reads the default profile settings from the device, the + default profile is used during autoconnect + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pPDPType [ O ] - PDP type + pIPAddress [ O ] - Preferred assigned IPv4 address + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + pAuthentication [ O ] - Authentication algorithm bitmap + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the profile name array + can contain + pName [ O ] - The profile name or description + apnSize [ I ] - The maximum number of characters (including + NULL terminator) that the APN name array + can contain + pAPNName [ O ] - Access point name represented as a NULL + terminated string (empty string returned when + unknown) + userSize [ I ] - The maximum number of characters (including + NULL terminator) that the username array + can contain + pUsername [ O ] - Username used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetDefaultProfile( + ULONG inLen, + const BYTE * pIn, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ) +{ + // Validate arguments + if (pIn == 0 + || pPDPType == 0 + || pIPAddress == 0 + || pPrimaryDNS == 0 + || pSecondaryDNS == 0 + || pAuthentication == 0 + || nameSize == 0 + || pName == 0 + || apnSize == 0 + || pAPNName == 0 + || userSize == 0 + || pUsername == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Set defaults + *pPDPType = 0xffffffff; + *pIPAddress = 0xffffffff; + *pPrimaryDNS = 0xffffffff; + *pSecondaryDNS = 0xffffffff; + *pAuthentication = 0xffffffff; + pName[0] = 0; + pAPNName[0] = 0; + pUsername[0] = 0; + + // Find the name + const sWDSGetDefaultSettingsResponse_ProfileName * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (nameSize < outLenx10 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pName, (const BYTE *)pTLVx10, outLenx10 ); + + // Null terminate + pName[outLenx10] = 0; + } + + // Find the PDP type + const sWDSGetDefaultSettingsResponse_PDPType * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sWDSGetDefaultSettingsResponse_PDPType )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pPDPType = pTLVx11->mPDPType; + } + + // Find the APN name + const sWDSGetDefaultSettingsResponse_APNName * pTLVx14; + ULONG outLenx14; + rc = GetTLV( inLen, pIn, 0x14, &outLenx14, (const BYTE **)&pTLVx14 ); + if (rc == eGOBI_ERR_NONE) + { + if (apnSize < outLenx14 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pAPNName, (const BYTE *)pTLVx14, outLenx14 ); + + // Null terminate + pAPNName[outLenx14] = 0; + } + + // Find the Primary DNS + const sWDSGetDefaultSettingsResponse_PrimaryDNS * pTLVx15; + ULONG outLenx15; + rc = GetTLV( inLen, pIn, 0x15, &outLenx15, (const BYTE **)&pTLVx15 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx15 < sizeof( sWDSGetDefaultSettingsResponse_PrimaryDNS )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx15->mIPV4Address[0]; + ULONG ip1 = pTLVx15->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx15->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx15->mIPV4Address[3] << 24; + + *pPrimaryDNS = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Secondary DNS + const sWDSGetDefaultSettingsResponse_SecondaryDNS * pTLVx16; + ULONG outLenx16; + rc = GetTLV( inLen, pIn, 0x16, &outLenx16, (const BYTE **)&pTLVx16 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx16 < sizeof( sWDSGetDefaultSettingsResponse_SecondaryDNS )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx16->mIPV4Address[0]; + ULONG ip1 = pTLVx16->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx16->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx16->mIPV4Address[3] << 24; + + *pSecondaryDNS = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Username + const sWDSGetDefaultSettingsResponse_APNName * pTLVx1B; + ULONG outLenx1B; + rc = GetTLV( inLen, pIn, 0x1B, &outLenx1B, (const BYTE **)&pTLVx1B ); + if (rc == eGOBI_ERR_NONE) + { + if (userSize < outLenx1B + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pAPNName, (const BYTE *)pTLVx1B, outLenx1B ); + + // Null terminate + pAPNName[outLenx1B] = 0; + } + + // Find the Authentication + const sWDSGetDefaultSettingsResponse_Authentication * pTLVx1D; + ULONG outLenx1D; + rc = GetTLV( inLen, pIn, 0x1D, &outLenx1D, (const BYTE **)&pTLVx1D ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1D < sizeof( sWDSGetDefaultSettingsResponse_Authentication )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG pap = pTLVx1D->mEnablePAP; + ULONG chap = pTLVx1D->mEnableCHAP << 1; + + *pAuthentication = (pap | chap); + } + + // Find the IP Address + const sWDSGetDefaultSettingsResponse_IPAddress * pTLVx1E; + ULONG outLenx1E; + rc = GetTLV( inLen, pIn, 0x1E, &outLenx1E, (const BYTE **)&pTLVx1E ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1E < sizeof( sWDSGetDefaultSettingsResponse_IPAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx1E->mIPV4Address[0]; + ULONG ip1 = pTLVx1E->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx1E->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx1E->mIPV4Address[3] << 24; + + *pIPAddress = (ip0 | ip1 | ip2 | ip3); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackStartDataSession + +DESCRIPTION: + This function activates a packet data session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pTechnology [ I ] - (Optional) Technology bitmap + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pPrimaryNBNS [ I ] - (Optional) Primary NetBIOS NS IPv4 address + pSecondaryNBNS [ I ] - (Optional) Secondary NetBIOS NS IPv4 address + pAPNName [ I ] - (Optional) Access point name + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackStartDataSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + sQMIRawContentHeader * pHeader; + ULONG offset = 0; + + // Add technology, if specified + if (pTechnology != 0) + { + // Check size + WORD tlvx30Sz = sizeof( sWDSStartNetworkInterfaceRequest_TechnologyPreference ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx30Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x30; + pHeader->mLength = tlvx30Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_TechnologyPreference * pTLVx30; + pTLVx30 = (sWDSStartNetworkInterfaceRequest_TechnologyPreference*)(pOut + offset); + memset( pTLVx30, 0, tlvx30Sz ); + + // Set the value + pTLVx30->mEnable3GPP = ((*pTechnology & 0x00000001) != 0); + pTLVx30->mEnable3GPP2 = ((*pTechnology & 0x00000002) != 0); + + offset += tlvx30Sz; + } + + // Add Primary DNS, if specified + if (pPrimaryDNS != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWDSStartNetworkInterfaceRequest_PrimaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_PrimaryDNS * pTLVx10; + pTLVx10 = (sWDSStartNetworkInterfaceRequest_PrimaryDNS*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + ULONG ip0 = (*pPrimaryDNS & 0x000000FF); + ULONG ip1 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx10->mIPV4Address[0] = (INT8)ip0; + pTLVx10->mIPV4Address[1] = (INT8)ip1; + pTLVx10->mIPV4Address[2] = (INT8)ip2; + pTLVx10->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx10Sz; + } + + // Add Secondary DNS, if specified + if (pSecondaryDNS != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWDSStartNetworkInterfaceRequest_SecondaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_SecondaryDNS * pTLVx11; + pTLVx11 = (sWDSStartNetworkInterfaceRequest_SecondaryDNS*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + ULONG ip0 = (*pSecondaryDNS & 0x000000FF); + ULONG ip1 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx11->mIPV4Address[0] = (INT8)ip0; + pTLVx11->mIPV4Address[1] = (INT8)ip1; + pTLVx11->mIPV4Address[2] = (INT8)ip2; + pTLVx11->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx11Sz; + } + + // Add Primary NBNS, if specified + if (pPrimaryNBNS != 0) + { + // Check size + WORD tlvx12Sz = sizeof( sWDSStartNetworkInterfaceRequest_PrimaryNBNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx12Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x12; + pHeader->mLength = tlvx12Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_PrimaryNBNS * pTLVx12; + pTLVx12 = (sWDSStartNetworkInterfaceRequest_PrimaryNBNS*)(pOut + offset); + memset( pTLVx12, 0, tlvx12Sz ); + + ULONG ip0 = (*pPrimaryNBNS & 0x000000FF); + ULONG ip1 = (*pPrimaryNBNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryNBNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pPrimaryNBNS & 0xFF000000) >> 24; + + // Set the value + pTLVx12->mIPV4Address[0] = (INT8)ip0; + pTLVx12->mIPV4Address[1] = (INT8)ip1; + pTLVx12->mIPV4Address[2] = (INT8)ip2; + pTLVx12->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx12Sz; + } + + // Add Secondary NBNS, if specified + if (pSecondaryNBNS != 0) + { + // Check size + WORD tlvx13Sz = sizeof( sWDSStartNetworkInterfaceRequest_SecondaryNBNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx13Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x13; + pHeader->mLength = tlvx13Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_SecondaryNBNS * pTLVx13; + pTLVx13 = (sWDSStartNetworkInterfaceRequest_SecondaryNBNS*)(pOut + offset); + memset( pTLVx13, 0, tlvx13Sz ); + + ULONG ip0 = (*pSecondaryNBNS & 0x000000FF); + ULONG ip1 = (*pSecondaryNBNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryNBNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pSecondaryNBNS & 0xFF000000) >> 24; + + // Set the value + pTLVx13->mIPV4Address[0] = (INT8)ip0; + pTLVx13->mIPV4Address[1] = (INT8)ip1; + pTLVx13->mIPV4Address[2] = (INT8)ip2; + pTLVx13->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx13Sz; + } + + // Add APN Name, if specified + if (pAPNName != 0) + { + std::string apnName( pAPNName ); + + // Check size + WORD tlvx14Sz = (WORD)apnName.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx14Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x14; + pHeader->mLength = tlvx14Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), apnName.c_str(), apnName.size() ); + + offset += tlvx14Sz; + } + + // Add IP Address, if specified + if (pIPAddress != 0) + { + // Check size + WORD tlvx15Sz = sizeof( sWDSStartNetworkInterfaceRequest_IPAddress ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx15Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x15; + pHeader->mLength = tlvx15Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_IPAddress * pTLVx15; + pTLVx15 = (sWDSStartNetworkInterfaceRequest_IPAddress*)(pOut + offset); + memset( pTLVx15, 0, tlvx15Sz ); + + ULONG ip0 = (*pIPAddress & 0x000000FF); + ULONG ip1 = (*pIPAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pIPAddress & 0x00FF0000) >> 16; + ULONG ip3 = (*pIPAddress & 0xFF000000) >> 24; + + // Set the value + pTLVx15->mIPV4Address[0] = (INT8)ip0; + pTLVx15->mIPV4Address[1] = (INT8)ip1; + pTLVx15->mIPV4Address[2] = (INT8)ip2; + pTLVx15->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx15Sz; + } + + // Add Authentication, if specified + if (pAuthentication != 0) + { + // Check size + WORD tlvx16Sz = sizeof( sWDSStartNetworkInterfaceRequest_Authentication ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx16Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x16; + pHeader->mLength = tlvx16Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_Authentication * pTLVx16; + pTLVx16 = (sWDSStartNetworkInterfaceRequest_Authentication*)(pOut + offset); + memset( pTLVx16, 0, tlvx16Sz ); + + // Set the value + pTLVx16->mEnablePAP = ((*pAuthentication & 0x00000001) != 0); + pTLVx16->mEnableCHAP = ((*pAuthentication & 0x00000002) != 0); + + offset += tlvx16Sz; + } + + // Add Username, if specified + if (pUsername != 0) + { + std::string username( pUsername ); + + // Check size + WORD tlvx17Sz = (WORD)username.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx17Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x17; + pHeader->mLength = tlvx17Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), username.c_str(), username.size() ); + + offset += tlvx17Sz; + } + + // Add Password, if specified + if (pPassword != 0) + { + std::string password( pPassword ); + + // Check size + WORD tlvx18Sz = (WORD)password.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx18Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x18; + pHeader->mLength = tlvx18Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), password.c_str(), password.size() ); + + offset += tlvx18Sz; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseStartDataSession + +DESCRIPTION: + This function activates a packet data session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSessionId [ O ] - The assigned session ID + pFailureReason [ O ] - Upon call failure the failure reason provided + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseStartDataSession( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionId, + ULONG * pFailureReason ) +{ + // Validate arguments + if (pIn == 0 + || pSessionId == 0 + || pFailureReason == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check mandatory response + const sResultCode * pTLVx02; + ULONG outLenx02; + ULONG rc = GetTLV( inLen, pIn, 0x02, &outLenx02, (const BYTE **)&pTLVx02 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx02 < sizeof( sResultCode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + if (pTLVx02->mQMIResult != eQMIResults_Success) + { + rc = pTLVx02->mQMIError + eGOBI_ERR_QMI_OFFSET; + } + + if (rc != eGOBI_ERR_NONE) + { + // Still parse call end reason, if present + const sWDSStartNetworkInterfaceResponse_CallEndReason * pTLVx10; + ULONG outLenx10; + ULONG rc2 = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc2 == eGOBI_ERR_NONE) + { + if (outLenx10 >= sizeof( sWDSStartNetworkInterfaceResponse_CallEndReason )) + { + *pFailureReason = pTLVx10->mCallEnd; + } + } + + return rc; + } + + // Find the Session ID + const sWDSStartNetworkInterfaceResponse_PacketDataHandle * pTLVx01; + ULONG outLenx01; + rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx01 < sizeof( sWDSStartNetworkInterfaceResponse_PacketDataHandle )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSessionId = pTLVx01->mPacketDataHandle; + } + + // Session ID is mandatory, if it failed return that error + return rc; +} + +/*=========================================================================== +METHOD: + PackStopDataSession + +DESCRIPTION: + This function stops the current data session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + sessionId [ I ] - The ID of the session to terminate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackStopDataSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG sessionId ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add session ID + + // Check size + WORD tlvx01Sz = sizeof( sWDSStopNetworkInterfaceRequest_PacketDataHandle ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSStopNetworkInterfaceRequest_PacketDataHandle * pTLVx01; + pTLVx01 = (sWDSStopNetworkInterfaceRequest_PacketDataHandle*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mPacketDataHandle = sessionId; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetIPAddress + +DESCRIPTION: + This function returns the current packet data session IP address + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetIPAddress( + ULONG * pOutLen, + BYTE * pOut ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Request the settings + + // Check size + WORD tlvx10Sz = sizeof( sWDSGetCurrentSettingsRequest_RequestedSettings ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSGetCurrentSettingsRequest_RequestedSettings * pTLVx10; + pTLVx10 = (sWDSGetCurrentSettingsRequest_RequestedSettings*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mIPAddress = true; + + offset += tlvx10Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetIPAddress + +DESCRIPTION: + This function returns the current packet data session IP address + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pIPAddress [ O ] - Assigned IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetIPAddress( + ULONG inLen, + const BYTE * pIn, + ULONG * pIPAddress ) +{ + // Validate arguments + if (pIn == 0 || pIPAddress == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the IP Address + const sWDSGetDefaultSettingsResponse_IPAddress * pTLVx1E; + ULONG outLenx1E; + ULONG rc = GetTLV( inLen, pIn, 0x1E, &outLenx1E, (const BYTE **)&pTLVx1E ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1E < sizeof( sWDSGetDefaultSettingsResponse_IPAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx1E->mIPV4Address[0]; + ULONG ip1 = pTLVx1E->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx1E->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx1E->mIPV4Address[3] << 24; + + *pIPAddress = (ip0 | ip1 | ip2 | ip3); + } + + // If no IP address is found, fail + return rc; +} + +/*=========================================================================== +METHOD: + ParseGetConnectionRate + +DESCRIPTION: + This function returns connection rate information for the packet data + connection + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pCurrentChannelTXRate [ O ] - Current channel TX rate (bps) + pCurrentChannelRXRate [ O ] - Current channel RX rate (bps) + pMaxChannelTXRate [ O ] - Maximum channel TX rate (bps) + pMaxChannelRXRate [ O ] - Maximum channel RX rate (bps) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetConnectionRate( + ULONG inLen, + const BYTE * pIn, + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ) +{ + // Validate arguments + if (pIn == 0 + || pCurrentChannelTXRate == 0 + || pCurrentChannelRXRate == 0 + || pMaxChannelTXRate == 0 + || pMaxChannelRXRate == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the rates + const sWDSGetChannelRatesResponse_ChannelRates * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx01 < sizeof( sWDSGetChannelRatesResponse_ChannelRates )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Get the values + *pCurrentChannelTXRate = pTLVx01->mChannelTXRatebps; + *pCurrentChannelRXRate = pTLVx01->mChannelRXRatebps; + *pMaxChannelTXRate = pTLVx01->mMaxChannelTXRatebps; + *pMaxChannelRXRate = pTLVx01->mMaxChannelRXRatebps; + } + + // If no rates are found, fail + return rc; +} + +/*=========================================================================== +METHOD: + PackGetPacketStatus + +DESCRIPTION: + This function returns the packet data transfer statistics since the start + of the current packet data session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetPacketStatus( + ULONG * pOutLen, + BYTE * pOut ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Request the settings + + // Check size + WORD tlvx01Sz = sizeof( sWDSGetPacketStatisticsRequest_PacketStatsMask ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSGetPacketStatisticsRequest_PacketStatsMask * pTLVx01; + pTLVx01 = (sWDSGetPacketStatisticsRequest_PacketStatsMask*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mReportTXPacketSuccesses = true; + pTLVx01->mReportRXPacketSuccesses = true; + pTLVx01->mReportTXPacketErrors = true; + pTLVx01->mReportRXPacketErrors = true; + pTLVx01->mReportTXOverflows = true; + pTLVx01->mReportRXOverflows = true; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPacketStatus + +DESCRIPTION: + This function returns the packet data transfer statistics since the start + of the current packet data session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pTXPacketSuccesses [ O ] - Packets transmitted without error + pRXPacketSuccesses [ O ] - Packets received without error + pTXPacketErrors [ O ] - Outgoing packets with framing errors + pRXPacketErrors [ O ] - Incoming packets with framing errors + pTXPacketOverflows [ O ] - Packets dropped because TX buffer overflowed + pRXPacketOverflows [ O ] - Packets dropped because RX buffer overflowed + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPacketStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ) +{ + // Validate arguments + if (pIn == 0 + || pTXPacketSuccesses == 0 + || pRXPacketSuccesses == 0 + || pTXPacketErrors == 0 + || pRXPacketErrors == 0 + || pTXPacketOverflows == 0 + || pRXPacketOverflows == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // NOTE: All TLVs are required. If any fail then all fail + + // Find the TX packet sucesses + const sWDSGetPacketStatisticsResponse_TXPacketSuccesses * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWDSGetPacketStatisticsResponse_TXPacketSuccesses )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the RX packet sucesses + const sWDSGetPacketStatisticsResponse_RXPacketSuccesses * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sWDSGetPacketStatisticsResponse_RXPacketSuccesses )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the TX packet errors + const sWDSGetPacketStatisticsResponse_TXPacketErrors * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx12 < sizeof( sWDSGetPacketStatisticsResponse_TXPacketErrors )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the RX packet errors + const sWDSGetPacketStatisticsResponse_RXPacketErrors * pTLVx13; + ULONG outLenx13; + rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx13 < sizeof( sWDSGetPacketStatisticsResponse_RXPacketErrors )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the TX packet overflows + const sWDSGetPacketStatisticsResponse_TXOverflows * pTLVx14; + ULONG outLenx14; + rc = GetTLV( inLen, pIn, 0x14, &outLenx14, (const BYTE **)&pTLVx14 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx14 < sizeof( sWDSGetPacketStatisticsResponse_TXOverflows )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the RX packet overflows + const sWDSGetPacketStatisticsResponse_RXOverflows * pTLVx15; + ULONG outLenx15; + rc = GetTLV( inLen, pIn, 0x15, &outLenx15, (const BYTE **)&pTLVx15 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx15 < sizeof( sWDSGetPacketStatisticsResponse_RXOverflows )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Populate the statistics + *pTXPacketSuccesses = pTLVx10->mTXPacketSuccesses; + *pRXPacketSuccesses = pTLVx11->mRXPacketSuccesses; + *pTXPacketErrors = pTLVx12->mTXPacketErrors; + *pRXPacketErrors = pTLVx13->mRXPacketErrors; + *pTXPacketOverflows = pTLVx14->mTXOverflows; + *pRXPacketOverflows = pTLVx15->mRXOverflows; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetByteTotals + +DESCRIPTION: + This function returns the RX/TX byte counts since the start of the + current packet data session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetByteTotals( + ULONG * pOutLen, + BYTE * pOut ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Request the settings + + // Check size + WORD tlvx01Sz = sizeof( sWDSGetPacketStatisticsRequest_PacketStatsMask ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSGetPacketStatisticsRequest_PacketStatsMask * pTLVx01; + pTLVx01 = (sWDSGetPacketStatisticsRequest_PacketStatsMask*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mTXByteTotal = true; + pTLVx01->mRXByteTotal = true; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetByteTotals + +DESCRIPTION: + This function returns the RX/TX byte counts since the start of the + current packet data session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pTXTotalBytes [ O ] - Bytes transmitted without error + pRXTotalBytes [ O ] - Bytes received without error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetByteTotals( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ) +{ + // Validate arguments + if (pIn == 0 + || pTXTotalBytes == 0 + || pRXTotalBytes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // NOTE: All TLVs are required. If any fail then all fail + + // Find the TX bytes + const sWDSGetPacketStatisticsResponse_TXBytes * pTLVx19; + ULONG outLenx19; + ULONG rc = GetTLV( inLen, pIn, 0x19, &outLenx19, (const BYTE **)&pTLVx19 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx19 < sizeof( sWDSGetPacketStatisticsResponse_TXBytes )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the RX bytes + const sWDSGetPacketStatisticsResponse_RXBytes * pTLVx1A; + ULONG outLenx1A; + rc = GetTLV( inLen, pIn, 0x1A, &outLenx1A, (const BYTE **)&pTLVx1A ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1A < sizeof( sWDSGetPacketStatisticsResponse_RXBytes )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Populate the statistics + *pTXTotalBytes = pTLVx19->mTXByteTotal; + *pRXTotalBytes = pTLVx1A->mRXByteTotal; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetMobileIP + +DESCRIPTION: + This function sets the current mobile IP setting + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + mode [ I ] - Desired mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetMobileIP( + ULONG * pOutLen, + BYTE * pOut, + ULONG mode ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Set the mode + + // Check size + WORD tlvx01Sz = sizeof( sWDSSetMIPModeRequest_MobileIPMode ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSSetMIPModeRequest_MobileIPMode * pTLVx01; + pTLVx01 = (sWDSSetMIPModeRequest_MobileIPMode*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mMIPMode = (eQMIMobileIPModes)mode; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetMobileIP + +DESCRIPTION: + This function gets the current mobile IP setting + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMode [ O ] - Current mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetMobileIP( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode ) +{ + // Validate arguments + if (pIn == 0 || pMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the mode + const sWDSGetMIPModeResponse_MobileIPMode * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx01 < sizeof( sWDSGetMIPModeResponse_MobileIPMode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMode = pTLVx01->mMIPMode; + } + + return rc; +} + +/*=========================================================================== +METHOD: + PackSetActiveMobileIPProfile + +DESCRIPTION: + This function sets the active mobile IP profile index + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - Six digit service programming code + index [ I ] - Desired mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetActiveMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE index ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWDSSetActiveMIPProfileRequest_Index ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSSetActiveMIPProfileRequest_Index * pTLVx01; + pTLVx01 = (sWDSSetActiveMIPProfileRequest_Index*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + pTLVx01->mProfileIndex = index; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetActiveMobileIPProfile + +DESCRIPTION: + This function gets the the active mobile IP profile index + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pIndex [ O ] - Active mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetActiveMobileIPProfile( + ULONG inLen, + const BYTE * pIn, + BYTE * pIndex ) +{ + // Validate arguments + if (pIn == 0 || pIndex == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the mode + const sWDSGetActiveMIPProfileResponse_Index * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx01 < sizeof( sWDSGetActiveMIPProfileResponse_Index )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pIndex = pTLVx01->mProfileIndex; + } + + return rc; +} + +/*=========================================================================== +METHOD: + PackSetMobileIPProfile + +DESCRIPTION: + This function sets the specified mobile IP profile settings + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - Six digit service programming code + index [ I ] - Mobile IP profile ID + pEnabled [ I ] - (Optional) Enable MIP profile? + pAddress [ I ] - (Optional) Home IPv4 address + pPrimaryHA [ I ] - (Optional) Primary home agent IPv4 address + pSecondaryHA [ I ] - (Optional) Secondary home agent IPv4 address + bRevTunneling [ I ] - (Optional) Enable reverse tunneling? + pNAI [ I ] - (Optional) Network access identifier string + pHASPI [ I ] - (Optional) HA security parameter index + pAAASPI [ I ] - (Optional) AAA security parameter index + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWDSSetMIPProfileRequest_Index ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_Index * pTLVx01; + pTLVx01 = (sWDSSetMIPProfileRequest_Index*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + pTLVx01->mProfileIndex = index; + + offset += tlvx01Sz; + + // Add Enabled, if specified + if (pEnabled != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWDSSetMIPProfileRequest_State ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_State * pTLVx10; + pTLVx10 = (sWDSSetMIPProfileRequest_State*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mEnabled = (*pEnabled == 0 ? 0 : 1); + + offset += tlvx10Sz; + } + + // Add Home Address, if specified + if (pAddress != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWDSSetMIPProfileRequest_HomeAddress ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_HomeAddress * pTLVx11; + pTLVx11 = (sWDSSetMIPProfileRequest_HomeAddress*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + ULONG ip0 = (*pAddress & 0x000000FF); + ULONG ip1 = (*pAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pAddress & 0x00FF0000) >> 16; + ULONG ip3 = (*pAddress & 0xFF000000) >> 24; + + // Set the value + pTLVx11->mIPV4Address[0] = (INT8)ip0; + pTLVx11->mIPV4Address[1] = (INT8)ip1; + pTLVx11->mIPV4Address[2] = (INT8)ip2; + pTLVx11->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx11Sz; + } + + // Add Primary Home Agent Address, if specified + if (pPrimaryHA != 0) + { + // Check size + WORD tlvx12Sz = sizeof( sWDSSetMIPProfileRequest_PrimaryHomeAgentAddress ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx12Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x12; + pHeader->mLength = tlvx12Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_PrimaryHomeAgentAddress * pTLVx12; + pTLVx12 = (sWDSSetMIPProfileRequest_PrimaryHomeAgentAddress*)(pOut + offset); + memset( pTLVx12, 0, tlvx12Sz ); + + ULONG ip0 = (*pPrimaryHA & 0x000000FF); + ULONG ip1 = (*pPrimaryHA & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryHA & 0x00FF0000) >> 16; + ULONG ip3 = (*pPrimaryHA & 0xFF000000) >> 24; + + // Set the value + pTLVx12->mIPV4Address[0] = (INT8)ip0; + pTLVx12->mIPV4Address[1] = (INT8)ip1; + pTLVx12->mIPV4Address[2] = (INT8)ip2; + pTLVx12->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx12Sz; + } + + // Add Secondary Home Agent Address, if specified + if (pSecondaryHA != 0) + { + // Check size + WORD tlvx13Sz = sizeof( sWDSSetMIPProfileRequest_SecondaryHomeAgentAddress ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx13Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x13; + pHeader->mLength = tlvx13Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_SecondaryHomeAgentAddress * pTLVx13; + pTLVx13 = (sWDSSetMIPProfileRequest_SecondaryHomeAgentAddress*)(pOut + offset); + memset( pTLVx13, 0, tlvx13Sz ); + + ULONG ip0 = (*pSecondaryHA & 0x000000FF); + ULONG ip1 = (*pSecondaryHA & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryHA & 0x00FF0000) >> 16; + ULONG ip3 = (*pSecondaryHA & 0xFF000000) >> 24; + + // Set the value + pTLVx13->mIPV4Address[0] = (INT8)ip0; + pTLVx13->mIPV4Address[1] = (INT8)ip1; + pTLVx13->mIPV4Address[2] = (INT8)ip2; + pTLVx13->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx13Sz; + } + + // Add reverse tunneling, if specified + if (pRevTunneling != 0) + { + // Check size + WORD tlvx14Sz = sizeof( sWDSSetMIPProfileRequest_ReverseTunneling ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx14Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x14; + pHeader->mLength = tlvx14Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_ReverseTunneling * pTLVx14; + pTLVx14 = (sWDSSetMIPProfileRequest_ReverseTunneling*)(pOut + offset); + memset( pTLVx14, 0, tlvx14Sz ); + + // Set the value + pTLVx14->mReverseTunneling = (*pRevTunneling == 0 ? 0 : 1); + + offset += tlvx14Sz; + } + + // Add NAI, if specified + if (pNAI != 0) + { + std::string nai( pNAI ); + + // Check size + WORD tlvx15Sz = (WORD)nai.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx15Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x15; + pHeader->mLength = tlvx15Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), nai.c_str(), nai.size() ); + + offset += tlvx15Sz; + } + + // Add HA SPI, if specified + if (pHASPI != 0) + { + // Check size + WORD tlvx16Sz = sizeof( sWDSSetMIPProfileRequest_HASPI ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx16Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x16; + pHeader->mLength = tlvx16Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_HASPI * pTLVx16; + pTLVx16 = (sWDSSetMIPProfileRequest_HASPI*)(pOut + offset); + memset( pTLVx16, 0, tlvx16Sz ); + + // Set the value + pTLVx16->mHASPI = *pHASPI; + + offset += tlvx16Sz; + } + + // Add AAA SPI, if specified + if (pAAASPI != 0) + { + // Check size + WORD tlvx17Sz = sizeof( sWDSSetMIPProfileRequeste_AAASPI ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx17Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x17; + pHeader->mLength = tlvx17Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequeste_AAASPI * pTLVx17; + pTLVx17 = (sWDSSetMIPProfileRequeste_AAASPI*)(pOut + offset); + memset( pTLVx17, 0, tlvx17Sz ); + + // Set the value + pTLVx17->mAAASPI = *pAAASPI; + + offset += tlvx17Sz; + } + + // Add MN-HA key, if specified + if (pMNHA != 0) + { + std::string mnha( pMNHA ); + + // Check size + WORD tlvx18Sz = (WORD)mnha.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx18Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x18; + pHeader->mLength = tlvx18Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), mnha.c_str(), mnha.size() ); + + offset += tlvx18Sz; + } + + // Add MN-AAA key, if specified + if (pMNHA != 0) + { + std::string mnaaa( pMNAAA ); + + // Check size + WORD tlvx19Sz = (WORD)mnaaa.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx19Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x19; + pHeader->mLength = tlvx19Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), mnaaa.c_str(), mnaaa.size() ); + + offset += tlvx19Sz; + } + + // At least one of the optional parameters must have been set + if (offset <= sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetMobileIPProfile + +DESCRIPTION: + This function gets the specified mobile IP profile settings + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + index [ I ] - Mobile IP profile ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + BYTE index ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWDSGetMIPProfileRequest_Index ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSGetMIPProfileRequest_Index * pTLVx01; + pTLVx01 = (sWDSGetMIPProfileRequest_Index*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mProfileIndex = index; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetMobileIPProfile + +DESCRIPTION: + This function gets the specified mobile IP profile settings + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pEnabled [ O ] - Mobile IP profile enabled? + pAddress [ O ] - Home IPv4 address + pPrimaryHA [ O ] - Primary home agent IPv4 address + pSecondaryHA [ O ] - Secondary home agent IPv4 address + pRevTunneling [ O ] - Reverse tunneling enabled? + naiSize [ I ] - The maximum number of characters (including NULL + terminator) that the NAI array can contain + pNAI [ O ] - Network access identifier string + pHASPI [ O ] - HA security parameter index + pAAASPI [ O ] - AAA security parameter index + pHAState [ O ] - HA key state + pAAAState [ O ] - AAA key state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetMobileIPProfile( + ULONG inLen, + const BYTE * pIn, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ) +{ + // Validate arguments + if (pIn == 0 + || pEnabled == 0 + || pAddress == 0 + || pPrimaryHA == 0 + || pSecondaryHA == 0 + || pRevTunneling == 0 + || naiSize == 0 + || pNAI == 0 + || pHASPI == 0 + || pAAASPI == 0 + || pHAState == 0 + || pAAAState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume errors + *pEnabled = 0xff; + *pAddress = 0xffffffff; + *pPrimaryHA = 0xffffffff; + *pSecondaryHA = 0xffffffff; + *pRevTunneling = 0xff; + *pHASPI = 0xffffffff; + *pAAASPI = 0xffffffff; + *pHAState = 0xffffffff; + *pAAAState = 0xffffffff; + + // Find the State + const sWDSGetMIPProfileResponse_State * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWDSGetMIPProfileResponse_State )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pEnabled = pTLVx10->mEnabled; + } + + // Find the Home Address + const sWDSGetMIPProfileResponse_HomeAddress * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sWDSGetMIPProfileResponse_HomeAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx11->mIPV4Address[0]; + ULONG ip1 = pTLVx11->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx11->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx11->mIPV4Address[3] << 24; + + *pAddress = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Primary Home Agent Address + const sWDSGetMIPProfileResponse_PrimaryHomeAgentAddress * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx12 < sizeof( sWDSGetMIPProfileResponse_PrimaryHomeAgentAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx12->mIPV4Address[0]; + ULONG ip1 = pTLVx12->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx12->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx12->mIPV4Address[3] << 24; + + *pPrimaryHA = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Secondary Home Agent Address + const sWDSGetMIPProfileResponse_SecondaryHomeAgentAddress * pTLVx13; + ULONG outLenx13; + rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx13 < sizeof( sWDSGetMIPProfileResponse_SecondaryHomeAgentAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx13->mIPV4Address[0]; + ULONG ip1 = pTLVx13->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx13->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx13->mIPV4Address[3] << 24; + + *pSecondaryHA = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Reverse tunneling, if enabled + const sWDSGetMIPProfileResponse_ReverseTunneling * pTLVx14; + ULONG outLenx14; + rc = GetTLV( inLen, pIn, 0x14, &outLenx14, (const BYTE **)&pTLVx14 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWDSGetMIPProfileResponse_ReverseTunneling )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRevTunneling = pTLVx14->mReverseTunneling; + } + + // Find the NAI, if enabled + const sWDSGetMIPProfileResponse_NAI * pTLVx15; + ULONG outLenx15; + rc = GetTLV( inLen, pIn, 0x15, &outLenx15, (const BYTE **)&pTLVx15 ); + if (rc == eGOBI_ERR_NONE) + { + if (naiSize < outLenx15 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pNAI, (const BYTE *)pTLVx15, outLenx15 ); + + // Null terminate + pNAI[outLenx15] = 0; + } + + // Find the HA SPI + const sWDSGetMIPProfileResponse_HASPI * pTLVx16; + ULONG outLenx16; + rc = GetTLV( inLen, pIn, 0x16, &outLenx16, (const BYTE **)&pTLVx16 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx16 < sizeof( sWDSGetMIPProfileResponse_HASPI )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pHASPI = pTLVx16->mHASPI; + } + + // Find the AAA SPI + const sWDSGetMIPProfileResponse_AAASPI * pTLVx17; + ULONG outLenx17; + rc = GetTLV( inLen, pIn, 0x17, &outLenx17, (const BYTE **)&pTLVx17 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx17 < sizeof( sWDSGetMIPProfileResponse_AAASPI )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pAAASPI = pTLVx17->mAAASPI; + } + + // Find the HA state + const sWDSGetMIPProfileResponse_HAState * pTLVx1A; + ULONG outLenx1A; + rc = GetTLV( inLen, pIn, 0x1A, &outLenx1A, (const BYTE **)&pTLVx1A ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1A < sizeof( sWDSGetMIPProfileResponse_HAState )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pHAState = pTLVx1A->mKeyState; + } + + // Find the AAA state + const sWDSGetMIPProfileResponse_AAAState * pTLVx1B; + ULONG outLenx1B; + rc = GetTLV( inLen, pIn, 0x1B, &outLenx1B, (const BYTE **)&pTLVx1B ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1B < sizeof( sWDSGetMIPProfileResponse_AAAState )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pAAAState = pTLVx1B->mKeyState; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetMobileIPParameters + +DESCRIPTION: + This function sets the specified mobile IP parameters + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - Six digit service programming code + pMode [ I ] - (Optional) Desired mobile IP setting + pRetryLimit [ I ] - (Optional) Retry attempt limit + pRetryInterval [ I ] - (Optional) Retry attempt interval + pReRegPeriod [ I ] - (Optional) Re-registration period + pReRegTraffic [ I ] - (Optional) Re-registration only with traffic? + pHAAuthenticator [ I ] - (Optional) MH-HA authenticator calculator? + pHA2002bis [ I ] - (Optional) MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetMobileIPParameters( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWDSSetMIPParametersRequest_SPC ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_SPC * pTLVx01; + pTLVx01 = (sWDSSetMIPParametersRequest_SPC*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + + offset += tlvx01Sz; + + // Add Mode, if specified + if (pMode != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWDSSetMIPParametersRequest_MobileIPMode ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_MobileIPMode * pTLVx10; + pTLVx10 = (sWDSSetMIPParametersRequest_MobileIPMode*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mMIPMode = (eQMIMobileIPModes)*pMode; + + offset += tlvx10Sz; + } + + // Add Retry Limit, if specified + if (pRetryLimit != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWDSSetMIPParametersRequest_RetryAttemptLimit ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_RetryAttemptLimit * pTLVx11; + pTLVx11 = (sWDSSetMIPParametersRequest_RetryAttemptLimit*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Set the value + pTLVx11->mRetryAttemptLimit = *pRetryLimit; + + offset += tlvx11Sz; + } + + // Add Retry interval, if specified + if (pRetryInterval != 0) + { + // Check size + WORD tlvx12Sz = sizeof( sWDSSetMIPParametersRequest_RetryAttemptInterval ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx12Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x12; + pHeader->mLength = tlvx12Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_RetryAttemptInterval * pTLVx12; + pTLVx12 = (sWDSSetMIPParametersRequest_RetryAttemptInterval*)(pOut + offset); + memset( pTLVx12, 0, tlvx12Sz ); + + // Set the value + pTLVx12->mRetryAttemptInterval = *pRetryInterval; + + offset += tlvx12Sz; + } + + // Add Re-registration period, if specified + if (pReRegPeriod != 0) + { + // Check size + WORD tlvx13Sz = sizeof( sWDSSetMIPParametersRequest_ReRegistrationPeriod ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx13Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x13; + pHeader->mLength = tlvx13Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_ReRegistrationPeriod * pTLVx13; + pTLVx13 = (sWDSSetMIPParametersRequest_ReRegistrationPeriod*)(pOut + offset); + memset( pTLVx13, 0, tlvx13Sz ); + + // Set the value + pTLVx13->mReRegistrationPeriod = *pReRegPeriod; + + offset += tlvx13Sz; + } + + // Add Re-registration on traffic flag, if specified + if (pReRegTraffic != 0) + { + // Check size + WORD tlvx14Sz = sizeof( sWDSSetMIPParametersRequest_ReRegistrationOnlyWithTraffic ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx14Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x14; + pHeader->mLength = tlvx14Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_ReRegistrationOnlyWithTraffic * pTLVx14; + pTLVx14 = (sWDSSetMIPParametersRequest_ReRegistrationOnlyWithTraffic*)(pOut + offset); + memset( pTLVx14, 0, tlvx14Sz ); + + // Set the value + pTLVx14->mReRegistrationOnlyWithTraffic = (*pReRegTraffic == 0 ? 0 : 1); + + offset += tlvx14Sz; + } + + // Add HA authenticator flag, if specified + if (pHAAuthenticator != 0) + { + // Check size + WORD tlvx15Sz = sizeof( sWDSSetMIPParametersRequest_MNHAAuthenticatorCalculator ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx15Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x15; + pHeader->mLength = tlvx15Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_MNHAAuthenticatorCalculator * pTLVx15; + pTLVx15 = (sWDSSetMIPParametersRequest_MNHAAuthenticatorCalculator*)(pOut + offset); + memset( pTLVx15, 0, tlvx15Sz ); + + // Set the value + pTLVx15->mMNHAAuthenticatorCalculator = (*pHAAuthenticator == 0 ? 0 : 1); + + offset += tlvx15Sz; + } + + // Add HA RFC2002bis authentication flag, if specified + if (pHA2002bis != 0) + { + // Check size + WORD tlvx16Sz = sizeof( sWDSSetMIPParametersRequest_MNHARFC2002BISAuthentication ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx16Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x16; + pHeader->mLength = tlvx16Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_MNHARFC2002BISAuthentication * pTLVx16; + pTLVx16 = (sWDSSetMIPParametersRequest_MNHARFC2002BISAuthentication*)(pOut + offset); + memset( pTLVx16, 0, tlvx16Sz ); + + // Set the value + pTLVx16->mMNHARFC2002BISAuthentication = (*pHA2002bis == 0 ? 0 : 1); + + offset += tlvx16Sz; + } + + // At least one of the optional parameters must have been set + if (offset <= sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetMobileIPParameters + +DESCRIPTION: + This function gets the mobile IP parameters + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMode [ O ] - Current mobile IP setting + pRetryLimit [ O ] - Retry attempt limit + pRetryInterval [ O ] - Retry attempt interval + pReRegPeriod [ O ] - Re-registration period + pReRegTraffic [ O ] - Re-registration only with traffic? + pHAAuthenticator [ O ] - MH-HA authenticator calculator? + pHA2002bis [ O ] - MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetMobileIPParameters( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + // Validate arguments + if (pIn == 0 + || pMode == 0 + || pRetryLimit == 0 + || pRetryInterval == 0 + || pReRegPeriod == 0 + || pReRegTraffic == 0 + || pHAAuthenticator == 0 + || pHA2002bis == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pMode = 0xffffffff; + *pRetryLimit = 0xff; + *pRetryInterval = 0xff; + *pReRegPeriod = 0xff; + *pReRegTraffic = 0xff; + *pHAAuthenticator = 0xff; + *pHA2002bis = 0xff; + + // Find the mode + const sWDSGetMIPParametersResponse_MobileIPMode * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWDSGetMIPParametersResponse_MobileIPMode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMode = pTLVx10->mMIPMode; + } + + // Find the Retry limit + const sWDSGetMIPParametersResponse_RetryAttemptLimit * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sWDSGetMIPParametersResponse_RetryAttemptLimit )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRetryLimit = pTLVx11->mRetryAttemptLimit; + } + + // Find the Retry Interval + const sWDSGetMIPParametersResponse_RetryAttemptInterval * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx12 < sizeof( sWDSGetMIPParametersResponse_RetryAttemptInterval )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRetryInterval = pTLVx12->mRetryAttemptInterval; + } + + // Find the Re-registration period + const sWDSGetMIPParametersResponse_ReRegistrationPeriod * pTLVx13; + ULONG outLenx13; + rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx13 < sizeof( sWDSGetMIPParametersResponse_ReRegistrationPeriod )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pReRegPeriod = pTLVx13->mReRegistrationPeriod; + } + + // Find the Re-register on traffic flag + const sWDSGetMIPParametersResponse_ReRegistrationOnlyWithTraffic * pTLVx14; + ULONG outLenx14; + rc = GetTLV( inLen, pIn, 0x14, &outLenx14, (const BYTE **)&pTLVx14 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx14 < sizeof( sWDSGetMIPParametersResponse_ReRegistrationOnlyWithTraffic )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pReRegTraffic = pTLVx14->mReRegistrationOnlyWithTraffic; + } + + // Find the HA authenticator + const sWDSGetMIPParametersResponse_MNHAAuthenticatorCalculator * pTLVx15; + ULONG outLenx15; + rc = GetTLV( inLen, pIn, 0x15, &outLenx15, (const BYTE **)&pTLVx15 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx15 < sizeof( sWDSGetMIPParametersResponse_MNHAAuthenticatorCalculator )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pHAAuthenticator = pTLVx15->mMNHAAuthenticatorCalculator; + } + + // Find the HA RFC2002bis authentication flag + const sWDSGetMIPParametersResponse_MNHARFC2002BISAuthentication * pTLVx16; + ULONG outLenx16; + rc = GetTLV( inLen, pIn, 0x16, &outLenx16, (const BYTE **)&pTLVx16 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx16 < sizeof( sWDSGetMIPParametersResponse_MNHARFC2002BISAuthentication )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pHA2002bis = pTLVx16->mMNHARFC2002BISAuthentication; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetLastMobileIPError + +DESCRIPTION: + This function gets the last mobile IP error + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pError [ O ] - Last mobile IP error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetLastMobileIPError( + ULONG inLen, + const BYTE * pIn, + ULONG * pError ) +{ + // Validate arguments + if (pIn == 0 || pError == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sWDSGetLastMIPStatusResponse_Status * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetLastMIPStatusResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pError = pTLVx01->mLastMIPStatus; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetDNSSettings + +DESCRIPTION: + This function sets the DNS settings for the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetDNSSettings( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + // Validate arguments + // At least one must be specified + if (pOut == 0 || (pPrimaryDNS == 0 && pSecondaryDNS == 0)) + { + return eGOBI_ERR_INVALID_ARG; + } + + sQMIRawContentHeader * pHeader; + ULONG offset = 0; + + // Add Primary DNS, if specified + if (pPrimaryDNS != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWDSSetDNSSettingRequest_PrimaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetDNSSettingRequest_PrimaryDNS * pTLVx10; + pTLVx10 = (sWDSSetDNSSettingRequest_PrimaryDNS*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + ULONG ip0 = (*pPrimaryDNS & 0x000000FF); + ULONG ip1 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx10->mIPV4Address[0] = (INT8)ip0; + pTLVx10->mIPV4Address[1] = (INT8)ip1; + pTLVx10->mIPV4Address[2] = (INT8)ip2; + pTLVx10->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx10Sz; + } + + // Add Secondary DNS, if specified + if (pSecondaryDNS != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWDSSetDNSSettingRequest_SecondaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetDNSSettingRequest_SecondaryDNS * pTLVx11; + pTLVx11 = (sWDSSetDNSSettingRequest_SecondaryDNS*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + ULONG ip0 = (*pSecondaryDNS & 0x000000FF); + ULONG ip1 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx11->mIPV4Address[0] = (INT8)ip0; + pTLVx11->mIPV4Address[1] = (INT8)ip1; + pTLVx11->mIPV4Address[2] = (INT8)ip2; + pTLVx11->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx11Sz; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetDNSSettings + +DESCRIPTION: + This function gets the DNS settings for the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetDNSSettings( + ULONG inLen, + const BYTE * pIn, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + // Validate arguments + if (pIn == 0 || pPrimaryDNS == 0 || pSecondaryDNS == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the Primary DNS + const sWDSGetDNSSettingResponse_PrimaryDNS * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWDSGetDNSSettingResponse_PrimaryDNS )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx10->mIPV4Address[0]; + ULONG ip1 = pTLVx10->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx10->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx10->mIPV4Address[3] << 24; + + *pPrimaryDNS = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Secondary DNS + const sWDSGetDNSSettingResponse_SecondaryDNS * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sWDSGetDNSSettingResponse_SecondaryDNS )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx11->mIPV4Address[0]; + ULONG ip1 = pTLVx11->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx11->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx11->mIPV4Address[3] << 24; + + *pSecondaryDNS = (ip0 | ip1 | ip2 | ip3); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetDataBearerTechnology + +DESCRIPTION: + This function retrieves the current data bearer technology (only + valid when connected) + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pDataCaps [ O ] - The data bearer technology + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetDataBearerTechnology( + ULONG inLen, + const BYTE * pIn, + ULONG * pDataBearer ) +{ + // Validate arguments + if (pIn == 0 || pDataBearer == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sWDSGetDataBearerTechnologyResponse_Technology * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetDataBearerTechnologyResponse_Technology )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pDataBearer = pTLVx01->mDataBearerTechnology; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationWMS.cpp b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationWMS.cpp new file mode 100755 index 0000000..da6ade8 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Gobi3000Translation/Gobi3000TranslationWMS.cpp @@ -0,0 +1,1121 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationWMS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (WMS Service) + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + PackDeleteSMS + +DESCRIPTION: + This function deletes one or more SMS messages from device memory + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + storageType [ I ] - SMS message storage type + pMessageIndex [ I ] - (Optional) message index + pMessageTag [ I ] - (Optional) message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackDeleteSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSDeleteRequest_MemoryStorage ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The SPC + sWMSDeleteRequest_MemoryStorage * pTLVx01; + pTLVx01 = (sWMSDeleteRequest_MemoryStorage*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mStorageType = (eQMIWMSStorageTypes)storageType; + + offset += tlvx01Sz; + + // Add the Message index, if specified + if (pMessageIndex != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWMSDeleteRequest_MessageIndex ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // The SPC + sWMSDeleteRequest_MessageIndex * pTLVx10; + pTLVx10 = (sWMSDeleteRequest_MessageIndex*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the values + pTLVx10->mStorageIndex = *pMessageIndex; + + offset += tlvx10Sz; + } + + // Add the Message tag, if specified + if (pMessageTag != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWMSDeleteRequest_MessageTag ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // The SPC + sWMSDeleteRequest_MessageTag * pTLVx11; + pTLVx11 = (sWMSDeleteRequest_MessageTag*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Set the values + pTLVx11->mMessageTag = (eQMIWMSMessageTags)*pMessageTag; + + offset += tlvx11Sz; + } + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetSMSList + +DESCRIPTION: + This function returns the list of SMS messages stored on the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + storageType [ I ] - SMS message storage type + pRequestedTag [ I ] - Message index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetSMSList( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG * pRequestedTag ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSListMessagesRequest_MemoryStorage ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The storage type + sWMSListMessagesRequest_MemoryStorage * pTLVx01; + pTLVx01 = (sWMSListMessagesRequest_MemoryStorage*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mStorageType = (eQMIWMSStorageTypes)storageType; + + offset += tlvx01Sz; + + // Add the Message tag, if specified + if (pRequestedTag != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWMSListMessagesRequest_MessageTag ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // The SPC + sWMSListMessagesRequest_MessageTag * pTLVx10; + pTLVx10 = (sWMSListMessagesRequest_MessageTag*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the values + pTLVx10->mMessageTag = (eQMIWMSMessageTags)*pRequestedTag; + + offset += tlvx10Sz; + } + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSMSList + +DESCRIPTION: + This function returns the list of SMS messages stored on the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMessageListSize [I/O] - Upon input the maximum number of elements that the + message list array can contain. Upon successful + output the actual number of elements in the message + list array + pMessageList [ O ] - The message list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSMSList( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageListSize, + BYTE * pMessageList ) +{ + // Validate arguments + if (pIn == 0 || pMessageListSize == 0 + || *pMessageListSize == 0 || pMessageList == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxMessageListSz = *pMessageListSize; + + // Assume failure + *pMessageListSize = 0; + + // Find the messages + const sWMSListMessagesResponse_MessageList * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sWMSListMessagesResponse_MessageList )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG messageListSz = pTLVx01->mNumberOfMessages; + if (messageListSz == 0) + { + // No stored messages, but not necessarily a failure + return eGOBI_ERR_NONE; + } + + if (maxMessageListSz < messageListSz) + { + messageListSz = maxMessageListSz; + } + + const sWMSListMessagesResponse_MessageList::sMessage * pMessages; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sWMSListMessagesResponse_MessageList ) + + sizeof( sWMSListMessagesResponse_MessageList::sMessage ) + * messageListSz) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pMessages = (const sWMSListMessagesResponse_MessageList::sMessage *) + ((const BYTE *)pTLVx01 + + sizeof( sWMSListMessagesResponse_MessageList )); + + ULONG * pData = (ULONG *)pMessageList; + for (ULONG m = 0; m < messageListSz; m++) + { + *pData++ = pMessages->mStorageIndex; + *pData++ = pMessages->mMessageTag; + pMessages++; + } + + *pMessageListSize = messageListSz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetSMS + +DESCRIPTION: + This function returns an SMS message from device memory + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageIndex ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSRawReadRequest_MessageIndex ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The index + sWMSRawReadRequest_MessageIndex * pTLVx01; + pTLVx01 = (sWMSRawReadRequest_MessageIndex*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mStorageType = (eQMIWMSStorageTypes)storageType; + pTLVx01->mStorageIndex = messageIndex; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSMS + +DESCRIPTION: + This function returns an SMS message from device memory + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMessageTag [ O ] - Message tag + pMessageFormat [ O ] - Message format + pMessageSize [I/O] - Upon input the maximum number of bytes that can be + written to the message array. Upon successful + output the actual number of bytes written to the + message array + pMessage [ O ] - The message contents array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ) +{ + // Validate arguments + if (pIn == 0 + || pMessageTag == 0 + || pMessageFormat == 0 + || pMessageSize == 0 + || *pMessageSize == 0 + || pMessage == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxMessageSz = *pMessageSize; + + // Assume failure + *pMessageSize = 0; + + // Find the messages + const sWMSRawReadResponse_MessageData * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sWMSRawReadResponse_MessageData )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMessageTag = pTLVx01->mMessageTag; + *pMessageFormat = pTLVx01->mMessageFormat; + + ULONG messageSz = pTLVx01->mRawMessageLength; + if (messageSz == 0) + { + // No stored messages, but not necessarily a failure + return eGOBI_ERR_NONE; + } + + if (messageSz > maxMessageSz) + { + messageSz = maxMessageSz; + } + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sWMSRawReadResponse_MessageData ) + messageSz) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + memcpy( pMessage, + pTLVx01 + sizeof( sWMSRawReadResponse_MessageData ), + messageSz ); + + *pMessageSize = messageSz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackModifySMSStatus + +DESCRIPTION: + This function modifies the status of an SMS message saved in storage on + the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + messageTag [ I ] - Message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackModifySMSStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSModifyTagRequest_MessageTag ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The index + sWMSModifyTagRequest_MessageTag * pTLVx01; + pTLVx01 = (sWMSModifyTagRequest_MessageTag*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mStorageType = (eQMIWMSStorageTypes)storageType; + pTLVx01->mStorageIndex = messageIndex; + pTLVx01->mMessageTag = (eQMIWMSMessageTags)messageTag; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSaveSMS + +DESCRIPTION: + This function saves an SMS message to device memory + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + storageType [ I ] - SMS message storage type + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSaveSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage ) +{ + // Validate arguments + if (pOut == 0 || messageSize == 0 || pMessage == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSRawWriteRequest_MessageData ) + + (WORD)messageSize; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The index + sWMSRawWriteRequest_MessageData * pTLVx01; + pTLVx01 = (sWMSRawWriteRequest_MessageData*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mStorageType = (eQMIWMSStorageTypes)storageType; + pTLVx01->mMessageFormat = (eQMIWMSMessageFormats)messageFormat; + pTLVx01->mRawMessageLength = (UINT16)messageSize; + + offset += sizeof( sWMSRawWriteRequest_MessageData ); + + // Add the message + memcpy( (pOut + offset), pMessage, messageSize ); + + offset += messageSize; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseSaveSMS + +DESCRIPTION: + This function saves an SMS message to device memory + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMessageIndex [ O ] - The message index assigned by the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseSaveSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageIndex ) +{ + // Validate arguments + if (pIn == 0 || pMessageIndex == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the messages + const sWMSRawWriteResponse_MessageIndex * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sWMSRawWriteResponse_MessageIndex )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMessageIndex = pTLVx01->mStorageIndex; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSendSMS + +DESCRIPTION: + This function sends an SMS message for immediate over the air transmission + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSendSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage ) +{ + // Validate arguments + if (pOut == 0 || messageSize == 0 || pMessage == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSRawSendRequest_MessageData ) + + (WORD)messageSize; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The index + sWMSRawSendRequest_MessageData * pTLVx01; + pTLVx01 = (sWMSRawSendRequest_MessageData*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mMessageFormat = (eQMIWMSMessageFormats)messageFormat; + pTLVx01->mRawMessageLength = (UINT16)messageSize; + + offset += sizeof( sWMSRawSendRequest_MessageData ); + + // Add the message + memcpy( (pOut + offset), pMessage, messageSize ); + + offset += messageSize; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseSendSMS + +DESCRIPTION: + This function sends an SMS message for immediate over the air transmission + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMessageFailureCode [ O ] - When the function fails due to an error sending + the message this parameter may contain the + message failure cause code (see 3GPP2 N.S0005 + Section 6.5.2.125). If the cause code is not + provided then the value will be 0xFFFFFFFF + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseSendSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageFailureCode ) +{ + // Validate arguments + if (pIn == 0 || pMessageFailureCode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume we have no message failure cause code + *pMessageFailureCode = 0xffffffff; + + // Check mandatory response + const sResultCode * pTLVx02; + ULONG outLenx02; + ULONG rc = GetTLV( inLen, pIn, 0x02, &outLenx02, (const BYTE **)&pTLVx02 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx02 < sizeof( sResultCode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + if (pTLVx02->mQMIResult != eQMIResults_Success) + { + rc = pTLVx02->mQMIError + eGOBI_ERR_QMI_OFFSET; + } + + if (rc != eGOBI_ERR_NONE) + { + // Check for the failure code (optional) + const sWMSRawSendResponse_CauseCode * pTLVx10; + ULONG outLenx10; + ULONG rc2 = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc2 == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWMSRawSendResponse_CauseCode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMessageFailureCode = pTLVx10->mCauseCode; + } + } + + return rc; +} + +/*=========================================================================== +METHOD: + ParseGetSMSCAddress + +DESCRIPTION: + This function returns the SMS center address + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + addressSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address array + can contain + pSMSCAddress [ O ] - The SMS center address represented as a NULL + terminated string + typeSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address type array + can contain + pSMSCType [ O ] - The SMS center address type represented as a NULL + terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSMSCAddress( + ULONG inLen, + const BYTE * pIn, + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ) +{ + // Validate arguments + if (pIn == 0 + || addressSize == 0 || pSMSCAddress == 0 + || typeSize == 0 || pSMSCType == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume empty + pSMSCAddress[0] = 0; + pSMSCType[0] = 0; + + // Get the address (mandatory) + const sWMSGetSMSCAddressResponse_Address * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sWMSRawSendResponse_CauseCode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Handle the type as a string (maximum 3 chars) + std::string smscType( &pTLVx01->mSMSCAddressType[0], 3 ); + + // Is the SMSC type present? (optional) + ULONG smscTypeLen = (ULONG)smscType.size(); + if (smscTypeLen > 0) + { + // Space to perform copy? + if (typeSize < smscTypeLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pSMSCType, &pTLVx01->mSMSCAddressType[0], smscTypeLen ); + pSMSCType[smscTypeLen] = 0; + } + + // Treat the address as a null terminated string + std::string smscAddr( (const CHAR *)pTLVx01 + + sizeof( sWMSGetSMSCAddressResponse_Address ), + pTLVx01->mSMSCAddressLength ); + + ULONG smscAddrLen = (ULONG)smscAddr.size(); + if (addressSize < smscAddrLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pSMSCAddress, smscAddr.c_str(), addressSize ); + pSMSCAddress[addressSize] = 0; + + return rc; +} + +/*=========================================================================== +METHOD: + PackSetSMSCAddress + +DESCRIPTION: + This function sets the SMS center address + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSMSCAddress [ I ] - The SMS center address represented as a NULL + terminated string + pSMSCType [ I ] - The SMS center address type represented as a NULL + terminated string (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetSMSCAddress( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSMSCAddress, + CHAR * pSMSCType ) +{ + // Validate arguments + if (pOut == 0 || pSMSCAddress == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // The TLV contains only the address + std::string smscAddr( pSMSCAddress ); + + // Check size + WORD tlvx01Sz = (WORD)smscAddr.size(); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + memcpy( (pOut + offset), smscAddr.c_str(), tlvx01Sz ); + offset += tlvx01Sz; + + // smscType is optional + if (pSMSCType != 0) + { + // The TLV contains only the type + std::string smscType( pSMSCType ); + + if (smscType.size() != 0) + { + // Check size + WORD tlvx10Sz = (WORD)smscType.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + memcpy( (pOut + offset), smscType.c_str(), tlvx10Sz ); + offset += tlvx10Sz; + } + } + + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSMSRoutes + +DESCRIPTION: + This function gets the current incoming SMS routing information + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pRouteSize [I/O] - Upon input the maximum number of elements that the + SMS route array can contain. Upon succes the actual + number of elements in the SMS route array + pRoutes [ O ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSMSRoutes( + ULONG inLen, + const BYTE * pIn, + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + // Validate arguments + if (pIn == 0 || pRouteSize == 0 || *pRouteSize == 0 || pRoutes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxRoutes = *pRouteSize; + *pRouteSize = 0; + + // Get the route list + const sWMSGetRoutesResponse_RouteList * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sWMSGetRoutesResponse_RouteList )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG routeCount = pTLVx01->mNumberOfRoutes; + if (routeCount > (ULONG)maxRoutes) + { + routeCount = (ULONG)maxRoutes; + } + + const sWMSGetRoutesResponse_RouteList::sRoute * pInRoute; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sWMSGetRoutesResponse_RouteList ) + + sizeof( sWMSGetRoutesResponse_RouteList::sRoute ) + * routeCount) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pInRoute = (const sWMSGetRoutesResponse_RouteList::sRoute *) + ((const BYTE *)pTLVx01 + + sizeof( sWMSGetRoutesResponse_RouteList )); + + ULONG * pRouteArray = (ULONG *)pRoutes; + for (ULONG r = 0; r < routeCount; r++) + { + *pRouteArray++ = pInRoute->mMessageType; + *pRouteArray++ = pInRoute->mMessageClass; + *pRouteArray++ = pInRoute->mStorageType; + *pRouteArray++ = pInRoute->mRouteValue; + pInRoute++; + } + + *pRouteSize = (BYTE)routeCount; + return rc; +} + +/*=========================================================================== +METHOD: + PackSetSMSRoutes + +DESCRIPTION: + This function sets the desired incoming SMS routing information + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied to pOut + pOut [ O ] - Output buffer + pRouteSize [ I ] - The number of elements in the SMS route array + pRoutes [ I ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetSMSRoutes( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + // Validate arguments + if (pOut == 0 || pRouteSize == 0 || *pRouteSize == 0 || pRoutes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + UINT16 routeCount = (ULONG)*pRouteSize; + + // Check size + WORD tlvx01Sz = sizeof( sWMSSetRoutesRequest_RouteList ) + + sizeof( sWMSSetRoutesRequest_RouteList::sRoute ) * routeCount; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // Add route count + sWMSSetRoutesRequest_RouteList * pTLVx01; + pTLVx01 = (sWMSSetRoutesRequest_RouteList*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mNumberOfRoutes = routeCount; + offset += sizeof( sWMSSetRoutesRequest_RouteList ); + + sWMSSetRoutesRequest_RouteList::sRoute * pOutRoute; + + // Align to the first array element + pOutRoute = (sWMSSetRoutesRequest_RouteList::sRoute *)(pOut + offset); + + // Add the routes + ULONG * pRouteArray = (ULONG *)pRoutes; + for (ULONG r = 0; r < routeCount; r++) + { + pOutRoute->mMessageType = (eQMIWMSMessageTypes)*pRouteArray++; + pOutRoute->mMessageClass = (eQMIWMSMessageClasses)*pRouteArray++; + pOutRoute->mStorageType = (eQMIWMSStorageTypes)*pRouteArray++; + pOutRoute->mReceiptAction = (eQMIWMSReceiptActions)*pRouteArray++; + pOutRoute++; + offset += sizeof( sWMSSetRoutesRequest_RouteList::sRoute ); + } + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmt.cpp b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmt.cpp new file mode 100755 index 0000000..7342d0a --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmt.cpp @@ -0,0 +1,606 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmt.cpp + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi + +PUBLIC CLASSES AND FUNCTIONS: + CGobiConnectionMgmtDLL + cGobiConnectionMgmt + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Stdafx.h" +#include "GobiConnectionMgmt.h" +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Global object +CGobiConnectionMgmtDLL gDLL; + +// Interval between traffic processing loop iterations (milliseconds) +const ULONG TRAFFIC_INTERVAL_MS = 300000; + +// Maximum amount of time to wait for the traffic thread to exit +const ULONG THREAD_EXIT_TIME = 2000; + +/*=========================================================================== +METHOD: + TrafficProcessThread (Free Method) + +DESCRIPTION: + QMI traffic process thread - processes all traffic in order to fire + off QMI traffic related callbacks + +PARAMETERS: + pArg [ I ] - Object to interface to + +RETURN VALUE: + void * - thread exit value (always 0) +===========================================================================*/ +void * TrafficProcessThread( PVOID pArg ) +{ + // Keep running? + bool bRun = false; + + // Create a vector of the objects to wait on + std::vector events; + + // Store the index to service type for use later + std::map services; + + // Grab API object + cGobiConnectionMgmt * pAPI = (cGobiConnectionMgmt *)pArg; + if (pAPI != 0) + { + // Time to go to work + bRun = true; + + // Add the thread exit event + events.push_back( &pAPI->mExitEvent ); + + // Grab signal events for our protocol servers + std::map ::const_iterator pIter; + pIter = pAPI->mServers.begin(); + while (pIter != pAPI->mServers.end()) + { + eQMIService svc = pIter->first; + cQMIProtocolServer * pServer = pAPI->GetServer( svc ); + if (pServer != 0) + { + // Grab the log from the server + const cProtocolLog & log = pServer->GetLog(); + + // Grab the Signal event, if it exists + cEvent & sigEvent = log.GetSignalEvent(); + + services[events.size()] = svc; + events.push_back( &sigEvent ); + } + + pIter++; + } + } + + TRACE( "GobiConnectionMgmt traffic thread [%u] started\n", + (UINT)pthread_self() ); + + // Loop waiting for exit event + while (bRun == true) + { + // Wait for activity + DWORD ignoredVal, index; + int nRet = WaitOnMultipleEvents( events, + TRAFFIC_INTERVAL_MS, + ignoredVal, + index ); + + // Timeout + if (nRet == -ETIME) + { + // Do nothing + } + // Error? + else if (nRet <= 0) + { + TRACE( "GobiConnectionMgmt traffic thread wait error %d\n", nRet ); + bRun = false; + } + // Exit event? + else if (index == 0) + { + bRun = false; + } + else if (index < events.size()) + { + // Run ProcessTraffic() for this service type + if (services.find( index ) != services.end()) + { + pAPI->ProcessTraffic( services[index] ); + } + } + else + { + // Fatal error + bRun = false; + } + } + + TRACE( "GobiConnectionMgmt traffic thread [%u] exited\n", + (UINT)pthread_self() ); + + if (pAPI != 0) + { + pAPI->mThreadCleanupFinished = true; + } + + return 0; +} + +/*=========================================================================== +METHOD: + CallbackThread (Free Method) + +DESCRIPTION: + Thread to execute a callback asynchronously + +PARAMETERS: + pArg [ I ] - The cGobiCMCallback object + +RETURN VALUE: + void * - thread exit value (always 0) +===========================================================================*/ +void * CallbackThread( PVOID pArg ) +{ + cGobiCMCallback * pCB = (cGobiCMCallback *)pArg; + if (pCB == 0) + { + ASSERT( 0 ); + return 0; + } + + pCB->Call(); + + delete pCB; + pCB = 0; + + return 0; +} + +/*=========================================================================*/ +// CGobiConnectionMgmtDLL Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + CGobiConnectionMgmtDLL (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +CGobiConnectionMgmtDLL::CGobiConnectionMgmtDLL() +{ + // Create sync CS + pthread_mutex_init( &mSyncSection, NULL ); +} + +/*=========================================================================== +METHOD: + ~CGobiConnectionMgmtDLL (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +CGobiConnectionMgmtDLL::~CGobiConnectionMgmtDLL() +{ + std::map tmpAPI = mAPI; + std::map ::const_iterator pIter; + pIter = tmpAPI.begin(); + + while (pIter != tmpAPI.end()) + { + cGobiConnectionMgmt * pAPI = pIter->second; + if (pAPI != 0) + { + pAPI->Cleanup(); + delete pAPI; + } + + pIter++; + } + + mAPI.clear(); + + pthread_mutex_destroy( &mSyncSection ); +} + +/*=========================================================================== +METHOD: + CreateAPI (Public Method) + +DESCRIPTION: + Create a new API object + +RETURN VALUE: + GOBIHANDLE - Handle to new API object (0 upon failure) +===========================================================================*/ +GOBIHANDLE CGobiConnectionMgmtDLL::CreateAPI() +{ + pthread_mutex_lock( &mSyncSection ); + + cGobiConnectionMgmt * pAPI = new cGobiConnectionMgmt; + if (pAPI != 0) + { + bool bInit = pAPI->Initialize(); + if (bInit == true) + { + mAPI[(GOBIHANDLE)pAPI] = pAPI; + } + } + + pthread_mutex_unlock( &mSyncSection ); + + return (GOBIHANDLE)pAPI; +} + +/*=========================================================================== +METHOD: + DeleteAPI (Public Method) + +DESCRIPTION: + Delete an existing API object + +PARAMETERS: + handle [ I ] - Handle to API object to return + +RETURN VALUE: + None +===========================================================================*/ +void CGobiConnectionMgmtDLL::DeleteAPI( GOBIHANDLE handle ) +{ + pthread_mutex_lock( &mSyncSection ); + + std::map ::iterator pIter; + pIter = mAPI.find( handle ); + if (pIter != mAPI.end()) + { + cGobiConnectionMgmt * pAPI = pIter->second; + delete pAPI; + + mAPI.erase( pIter ); + } + + pthread_mutex_unlock( &mSyncSection ); +} + +/*=========================================================================== +METHOD: + GetAPI (Public Method) + +DESCRIPTION: + Return the requested API object + +PARAMETERS: + handle [ I ] - Handle to API object to return + +RETURN VALUE: + cGobiConnectionMgmt * +===========================================================================*/ +cGobiConnectionMgmt * CGobiConnectionMgmtDLL::GetAPI( GOBIHANDLE handle ) +{ + cGobiConnectionMgmt * pAPI = 0; + + pthread_mutex_lock( &mSyncSection ); + + std::map ::const_iterator pIter; + pIter = mAPI.find( handle ); + if (pIter != mAPI.end()) + { + pAPI = pIter->second; + } + + pthread_mutex_unlock( &mSyncSection ); + + return pAPI; +} + +/*=========================================================================*/ +// cGobiConnectionMgmt Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiConnectionMgmt (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmt::cGobiConnectionMgmt() + : cGobiQMICore(), + mbThreadStarted( false ), + mThreadID( 0 ), + mThreadCleanupFinished( false ) +{ + // Nothing to do but init those variables +} + +/*=========================================================================== +METHOD: + ~cGobiConnectionMgmt (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmt::~cGobiConnectionMgmt() +{ + Disconnect(); +} + +/*=========================================================================== +METHOD: + ProcessTraffic (Internal Method) + +DESCRIPTION: + Process traffic in a QMI server protocol log, this is done to + exercise QMI indication related callbacks + +PARAMETERS: + svc [ I ] - QMI Service type + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessTraffic( eQMIService svc ) +{ + ULONG count = 0; + + std::map ::iterator pIter; + pIter = mServers.find( svc ); + if (pIter == mServers.end()) + { + return; + } + + sServerInfo & si = pIter->second; + cQMIProtocolServer * pSvr = si.mpServer; + if (pSvr == 0) + { + return; + } + + // Grab the service ID from the service + eQMIService svcID = pSvr->GetServiceType(); + if (svcID == eQMI_SVC_ENUM_BEGIN) + { + return; + } + + // Grab the log from the server + const cProtocolLog & logSvr = pSvr->GetLog(); + + // New items to process? + count = logSvr.GetCount(); + if (count != INVALID_LOG_INDEX && count > si.mLogsProcessed) + { + for (ULONG i = si.mLogsProcessed; i < count; i++) + { + sProtocolBuffer buf = logSvr.GetBuffer( i ); + if (buf.IsValid() == false) + { + continue; + } + + eProtocolType pt = buf.GetType(); + if (IsQMIProtocolRX( pt ) == false) + { + continue; + } + + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsIndication() == false) + { + continue; + } + + ULONG msgID = qmiBuf.GetMessageID(); + + tCallbackKey ck( svcID, msgID ); + std::map ::iterator pIter; + pIter = mCallbacks.find( ck ); + if (pIter == mCallbacks.end()) + { + continue; + } + + ULONG outLen = 0; + const BYTE * pOutput = (const BYTE *)qmiBuf.GetRawContents( outLen ); + tCallbackValue cv = pIter->second; + + cGenericCallback * pCB = 0; + pCB = new cGenericCallback( cv.first, + svcID, + msgID, + cv.second, + outLen, + pOutput ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + + si.mLogsProcessed = count; + } +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified Gobi device + +PARAMETERS: + pQMIFile [ I ] - QMI control file to connect to + services [ I ] - QMI services to connect to + +RETURN VALUE: + std::set - Services successfuly configured +===========================================================================*/ +std::set cGobiConnectionMgmt::Connect( + LPCSTR pQMIFile, + std::set & services ) +{ + std::set svcs = cGobiQMICore::Connect( pQMIFile, services ); + if (svcs.size() > 0) + { + // Start the traffic processing thread? + if (mbThreadStarted == false) + { + // Clear mExitEvent; + mExitEvent.Clear(); + + pthread_create( &mThreadID, + NULL, + TrafficProcessThread, + this ); + + mbThreadStarted = true; + } + } + + return svcs; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the currently connected Gobi device + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiConnectionMgmt::Disconnect() +{ + // Clear all callback function pointers + mCallbacks.clear(); + + // Exit traffic processing thread + if (mbThreadStarted == true) + { + // Signal thread to exit + mExitEvent.Set( 0 ); + + // If we are not being called from the thread itself then wait for + // it to exit, if not then it will have to exit automatically + if (pthread_self() != mThreadID) + { + if (mThreadID != 0) + { + pthread_join( mThreadID, NULL ); + } + } + } + + // Clear out thread handle/ID + mbThreadStarted = false; + mThreadID = 0; + + return cGobiQMICore::Disconnect(); +} + +/*=========================================================================== +METHOD: + SetGenericCallback (Public Method) + +DESCRIPTION: + Enable/disable generic callback function + +PARAMETERS: + svcID [ I ] - Service ID to monitor + msgID [ I ] - Message ID to look for + pCallback [ I ] - Generic callback pointer + userValue [ I ] - User value to pass back to callback + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetGenericCallback( + ULONG svcID, + ULONG msgID, + tFNGenericCallback pCallback, + ULONG_PTR userValue ) +{ + // Assume success + eGobiError rc = eGOBI_ERR_NONE; + + tCallbackKey ck( svcID, msgID ); + std::map ::iterator pIter; + pIter = mCallbacks.find( ck ); + + bool bOn = (pCallback != 0 && pIter == mCallbacks.end()); + bool bOff = (pCallback == 0 && pIter != mCallbacks.end()); + bool bReplace = (pCallback != 0 && pIter != mCallbacks.end()); + if (bOn == true || bReplace == true) + { + tCallbackValue cv( pCallback, userValue ); + mCallbacks[ck] = cv; + } + else if (bOff == true) + { + mCallbacks.erase( pIter ); + } + + return rc; +} diff --git a/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmt.h b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmt.h new file mode 100755 index 0000000..2ffd20a --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmt.h @@ -0,0 +1,270 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmt.h + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi + +PUBLIC CLASSES AND FUNCTIONS: + CGobiConnectionMgmtDLL + cGobiConnectionMgmt + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Handle to Gobi API +typedef ULONG_PTR GOBIHANDLE; + +extern "C" +{ + // Generic callback function pointer + typedef void (* tFNGenericCallback)( + ULONG svcID, + ULONG msgID, + ULONG_PTR userValue, + ULONG outLen, + const BYTE * pOut ); + +}; + +// CallbackThread prototype +// Thread to execute a callback asynchronously +void * CallbackThread( PVOID pArg ); + +/*=========================================================================*/ +// Class cGobiCMCallback +/*=========================================================================*/ +class cGobiCMCallback +{ + public: + // (Inline) Constructor + cGobiCMCallback() + { }; + + // (Inline) Destructor + virtual ~cGobiCMCallback() + { }; + + // (Inline) Initialize the callback object by starting the thread + bool Initialize() + { + // Start the thread + pthread_t threadID; + pthread_attr_t attributes; + pthread_attr_init( &attributes ); + pthread_attr_setdetachstate( &attributes, PTHREAD_CREATE_DETACHED ); + + int nRC = pthread_create( &threadID, + &attributes, + CallbackThread, + this ); + + if (nRC == 0) + { + // Success! + return true; + } + + return false; + }; + + protected: + // Call the function + virtual void Call() = 0; + + // Function thread gets full access + friend void * CallbackThread( PVOID pArg ); +}; + +/*=========================================================================*/ +// Class cGenericCallback +/*=========================================================================*/ +class cGenericCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cGenericCallback( + tFNGenericCallback pCallback, + ULONG svcID, + ULONG msgID, + ULONG_PTR userValue, + ULONG outLen, + const BYTE * pOut ) + : mServiceID( svcID ), + mMessageID( msgID ), + mUserValue( userValue ), + mOutputLen( 0 ), + mpCallback( pCallback ) + { + memset( &mOutput[0], 0, QMI_MAX_BUFFER_SIZE ); + if (outLen <= QMI_MAX_BUFFER_SIZE && pOut != 0) + { + mOutputLen = outLen; + memcpy( &mOutput[0], pOut, outLen ); + } + }; + + // (Inline) Destructor + virtual ~cGenericCallback() + { + mpCallback = 0; + }; + + protected: + /* Service ID */ + ULONG mServiceID; + + /* Message ID */ + ULONG mMessageID; + + /* User value */ + ULONG_PTR mUserValue; + + /* Actual size of output content */ + ULONG mOutputLen; + + /* Output content buffer */ + BYTE mOutput[QMI_MAX_BUFFER_SIZE]; + + /* Callback function */ + tFNGenericCallback mpCallback; + + // Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mServiceID, + mMessageID, + mUserValue, + mOutputLen, + (const BYTE *)&mOutput[0] ); + } + }; +}; + +/*=========================================================================*/ +// Class cGobiConnectionMgmt +/*=========================================================================*/ +class cGobiConnectionMgmt : public cGobiQMICore +{ + public: + // Constructor + cGobiConnectionMgmt(); + + // Destructor + virtual ~cGobiConnectionMgmt(); + + // Connect to the specified Gobi device interface + virtual std::set Connect( + LPCSTR pInterface, + std::set & services ); + + // Disconnect from the currently connected device interface + virtual bool Disconnect(); + + // Enable/disable generic callback function + eGobiError SetGenericCallback( + ULONG svcID, + ULONG msgID, + tFNGenericCallback pCallback, + ULONG_PTR userValue ); + + protected: + // Process new traffic + void ProcessTraffic( eQMIService svc ); + + /* Is there an active thread? */ + bool mbThreadStarted; + + /* ID of traffic processing thread */ + pthread_t mThreadID; + + /* Traffic processing thread exit event */ + cEvent mExitEvent; + + /* Has the protocol server thread finished cleanup? */ + bool mThreadCleanupFinished; + + /* Generic callback function key/value */ + typedef std::pair tCallbackKey; + typedef std::pair tCallbackValue; + + /* Callback functions */ + std::map mCallbacks; + + // Traffic process thread gets full access + friend VOID * TrafficProcessThread( PVOID pArg ); +}; + +/*=========================================================================*/ +// Class CGobiConnectionMgmtDLL +/*=========================================================================*/ +class CGobiConnectionMgmtDLL +{ + public: + // Constructor + CGobiConnectionMgmtDLL(); + + // Destructor + virtual ~CGobiConnectionMgmtDLL(); + + // Create a new API object + GOBIHANDLE CreateAPI(); + + // Delete an existing API object + void DeleteAPI( GOBIHANDLE handle ); + + // Return the requested API object + cGobiConnectionMgmt * GetAPI( GOBIHANDLE handle ); + + protected: + /* API interface object */ + std::map mAPI; + + /* Synchronization object */ + mutable pthread_mutex_t mSyncSection; +}; + +extern CGobiConnectionMgmtDLL gDLL; diff --git a/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPI.h b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPI.h new file mode 100755 index 0000000..bf95fb1 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPI.h @@ -0,0 +1,12502 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtAPI.h + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +#ifndef GOBI_TYPEDEFS +#define GOBI_TYPEDEFS + +// Type Definitions +typedef unsigned long ULONG; +typedef unsigned long * ULONG_PTR; +typedef unsigned long long ULONGLONG; +typedef signed char INT8; +typedef unsigned char UINT8; +typedef signed short INT16; +typedef unsigned short UINT16; +typedef signed int INT32; +typedef unsigned int UINT32; +typedef unsigned char BYTE; +typedef char CHAR; +typedef unsigned short WORD; +typedef unsigned short USHORT; +typedef const char * LPCSTR; + +#ifdef WINDOWS + typedef signed __int64 INT64; + typedef unsigned __int64 UINT64; +#else + typedef signed long long INT64; + typedef unsigned long long UINT64; +#endif + +#endif + +/*=========================================================================*/ +// Definitions +/*=========================================================================*/ + +// Handle to Gobi API +typedef ULONG_PTR GOBIHANDLE; + +#ifdef __cplusplus + extern "C" { +#endif + +// Geeneric callback function pointer +typedef void (* tFNGenericCallback)( + ULONG svcID, + ULONG msgID, + GOBIHANDLE handle, + ULONG outLen, + const BYTE * pOut ); + +#ifdef __cplusplus + }; +#endif + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GobiConnect + +DESCRIPTION: + This function connects the CM API library to the specified Gobi + device + +PARAMETERS: + pQMIFile [ I ] - Device interface to connect to + pServicesCount [I/O] - Upon input the number of QMI services to connect to, + upon output the number of QMI services successfully + connected to + pServices [I/O] - Upon input the array of QMI service IDs to connect + to, upon output the array of QMI service IDs + successfully connected to + pHandle [ O ] - The returned Gobi interface handle + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiConnect( + LPCSTR pInterface, + ULONG * pServicesCount, + ULONG * pServices, + GOBIHANDLE * pHandle ); + +/*=========================================================================== +METHOD: + GobiCancel + +DESCRIPTION: + This function cancels the most recent outstanding request for the + specified QMI service + +PARAMETERS: + handle [ I ] - Gobi interface handle + svcID [ I ] - Service whose outstanding request is to be cancelled + pTXID [ O ] - QMI transaction ID of outstanding request + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiCancel( + GOBIHANDLE handle, + ULONG svcID, + ULONG * pTXID ); + +/*=========================================================================== +METHOD: + GobiDisconnect + +DESCRIPTION: + This function disconnects the CM API library from the currently + connected Gobi device + +PARAMETERS: + handle [ I ] - Gobi interface handle + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiDisconnect( GOBIHANDLE handle ); + +/*=========================================================================== +METHOD: + SetGenericCallback + +DESCRIPTION: + This function enables/disables a generic callback + +PARAMETERS: + handle [ I ] - Gobi interface handle + svcID [ I ] - Service ID to monitor + msgID [ I ] - Message ID to look for + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG SetGenericCallback( + GOBIHANDLE handle, + ULONG svcID, + ULONG msgID, + tFNGenericCallback pCallback ); + +/*=========================================================================== +METHOD: + WDSReset + +DESCRIPTION: + The function sends 'WDS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetEventReport + +DESCRIPTION: + The function sends 'WDS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSAbort + +DESCRIPTION: + The function sends 'WDS/Abort Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSAbort( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSStartNetworkInterface + +DESCRIPTION: + The function sends 'WDS/Start Network Interface Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSStartNetworkInterface( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSStopNetworkInterface + +DESCRIPTION: + The function sends 'WDS/Stop Network Interface Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSStopNetworkInterface( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetPacketServiceStatus + +DESCRIPTION: + The function sends 'WDS/Get Packet Service Status Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPacketServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetChannelRates + +DESCRIPTION: + The function sends 'WDS/Get Channel Rates Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetChannelRates( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetPacketStatistics + +DESCRIPTION: + The function sends 'WDS/Get Packet Statistics Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPacketStatistics( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGoDormant + +DESCRIPTION: + The function sends 'WDS/Go Dormant Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGoDormant( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGoActive + +DESCRIPTION: + The function sends 'WDS/Go Active Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGoActive( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSCreateProfile + +DESCRIPTION: + The function sends 'WDS/Create Profile Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSCreateProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSModifyProfile + +DESCRIPTION: + The function sends 'WDS/Modify Profile Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSModifyProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSDeleteProfile + +DESCRIPTION: + The function sends 'WDS/Delete Profile Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSDeleteProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetProfileList + +DESCRIPTION: + The function sends 'WDS/Get Profile List Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetProfileList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetProfileSettings + +DESCRIPTION: + The function sends 'WDS/Get Profile Settings Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetProfileSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDefaultSettings + +DESCRIPTION: + The function sends 'WDS/Get Default Settings Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDefaultSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCurrentSettings + +DESCRIPTION: + The function sends 'WDS/Get Current Settings Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCurrentSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetMIPMode + +DESCRIPTION: + The function sends 'WDS/Set MIP Mode Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetMIPMode + +DESCRIPTION: + The function sends 'WDS/Get MIP Mode Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDormancy + +DESCRIPTION: + The function sends 'WDS/Get Dormancy Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDormancy( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetAutoconnectSetting + +DESCRIPTION: + The function sends 'WDS/Get Autoconnect Setting Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetAutoconnectSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDataSessionDuration + +DESCRIPTION: + The function sends 'WDS/Get Data Session Duration Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDataSessionDuration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetModemStatus + +DESCRIPTION: + The function sends 'WDS/Get Modem Status Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetModemStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDataBearerTechnology + +DESCRIPTION: + The function sends 'WDS/Get Data Bearer Technology Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDataBearerTechnology( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetModemInfo + +DESCRIPTION: + The function sends 'WDS/Get Modem Info Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetModemInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetActiveMIPProfile + +DESCRIPTION: + The function sends 'WDS/Get Active MIP Profile Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetActiveMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetActiveMIPProfile + +DESCRIPTION: + The function sends 'WDS/Set Active MIP Profile Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetActiveMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetMIPProfile + +DESCRIPTION: + The function sends 'WDS/Get MIP Profile Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetMIPProfile + +DESCRIPTION: + The function sends 'WDS/Set MIP Profile Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetMIPParameters + +DESCRIPTION: + The function sends 'WDS/Get MIP Parameters Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetMIPParameters + +DESCRIPTION: + The function sends 'WDS/Set MIP Parameters Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetLastMIPStatus + +DESCRIPTION: + The function sends 'WDS/Get Last MIP Status Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetLastMIPStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetANAAAAuthenticationStatus + +DESCRIPTION: + The function sends 'WDS/Get AN-AAA Authentication Status Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetANAAAAuthenticationStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCurrentDataBearerTechnology + +DESCRIPTION: + The function sends 'WDS/Get Current Data Bearer Technology Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCurrentDataBearerTechnology( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCallList + +DESCRIPTION: + The function sends 'WDS/Get Call List Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCallRecord + +DESCRIPTION: + The function sends 'WDS/Get Call Record Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSClearCallList + +DESCRIPTION: + The function sends 'WDS/Clear Call List Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSClearCallList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCallListMaxSize + +DESCRIPTION: + The function sends 'WDS/Get Call List Max Size Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallListMaxSize( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDefaultProfileNumber + +DESCRIPTION: + The function sends 'WDS/Get Default Profile Number Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDefaultProfileNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetDefaultProfileNumber + +DESCRIPTION: + The function sends 'WDS/Set Default Profile Number Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDefaultProfileNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSResetProfile + +DESCRIPTION: + The function sends 'WDS/Reset Profile Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSResetProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSResetProfileParamToInvalid + +DESCRIPTION: + The function sends 'WDS/Reset Profile Param To Invalid Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSResetProfileParamToInvalid( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetIPFamilyPreference + +DESCRIPTION: + The function sends 'WDS/Set IP Family Preference Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetIPFamilyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetAutoconnectSetting + +DESCRIPTION: + The function sends 'WDS/Set Autoconnect Setting Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetAutoconnectSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDNSSetting + +DESCRIPTION: + The function sends 'WDS/Get DNS Setting Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDNSSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetDNSSetting + +DESCRIPTION: + The function sends 'WDS/Set DNS Setting Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDNSSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCDMAPreDormancySettings + +DESCRIPTION: + The function sends 'WDS/Get CDMA Pre-Dormancy Settings Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCDMAPreDormancySettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetCAMTimer + +DESCRIPTION: + The function sends 'WDS/Set CAM Timer Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetCAMTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCAMTimer + +DESCRIPTION: + The function sends 'WDS/Get CAM Timer Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCAMTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetSCRM + +DESCRIPTION: + The function sends 'WDS/Set SCRM Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetSCRM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetSCRM + +DESCRIPTION: + The function sends 'WDS/Get SCRM Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetSCRM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetRDUD + +DESCRIPTION: + The function sends 'WDS/Set RDUD Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetRDUD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetRDUD + +DESCRIPTION: + The function sends 'WDS/Get RDUD Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetRDUD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetSIPMIPCallType + +DESCRIPTION: + The function sends 'WDS/Get SIP/MIP Call Type Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetSIPMIPCallType( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetEVDOPageMonitorPeriod + +DESCRIPTION: + The function sends 'WDS/Set EV-DO Page Monitor Period Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEVDOPageMonitorPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetEVDOLongSleep + +DESCRIPTION: + The function sends 'WDS/Set EV-DO Long Sleep Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEVDOLongSleep( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetEVDOPageMonitorPeriod + +DESCRIPTION: + The function sends 'WDS/Get EV-DO Page Monitor Period Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetEVDOPageMonitorPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCallThrottleInfo + +DESCRIPTION: + The function sends 'WDS/Get Call Throttle Info Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallThrottleInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetNSAPI + +DESCRIPTION: + The function sends 'WDS/Get NSAPI Request' (0x0060) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetNSAPI( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetDUNCallControlPreference + +DESCRIPTION: + The function sends 'WDS/Set DUN Call Control Preference Request' (0x0061) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDUNCallControlPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDUNCallControlInfo + +DESCRIPTION: + The function sends 'WDS/Get DUN Call Control Info Request' (0x0062) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDUNCallControlInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetDUNCallControlEventReport + +DESCRIPTION: + The function sends 'WDS/Set DUN Call Control Event Report Request' (0x0063) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDUNCallControlEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSPendingDUNCallControl + +DESCRIPTION: + The function sends 'WDS/Pending DUN Call Control Request' (0x0064) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSPendingDUNCallControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetPreferredDataSystem + +DESCRIPTION: + The function sends 'WDS/Get Preferred Data System Request' (0x0069) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPreferredDataSystem( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetLastDataCallStatus + +DESCRIPTION: + The function sends 'WDS/Get Last Data Call Status Request' (0x006A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetLastDataCallStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSReset + +DESCRIPTION: + The function sends 'DMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetEventReport + +DESCRIPTION: + The function sends 'DMS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceCapabilities + +DESCRIPTION: + The function sends 'DMS/Get Device Capabilities Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceManfacturer + +DESCRIPTION: + The function sends 'DMS/Get Device Manfacturer Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceManfacturer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceModel + +DESCRIPTION: + The function sends 'DMS/Get Device Model Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceModel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceRevision + +DESCRIPTION: + The function sends 'DMS/Get Device Revision Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceVoiceNumber + +DESCRIPTION: + The function sends 'DMS/Get Device Voice Number Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceVoiceNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceSerialNumbers + +DESCRIPTION: + The function sends 'DMS/Get Device Serial Numbers Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceSerialNumbers( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetPowerState + +DESCRIPTION: + The function sends 'DMS/Get Power State Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetPowerState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMSetPINProtection + +DESCRIPTION: + The function sends 'DMS/UIM Set PIN Protection Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMSetPINProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMVerifyPIN + +DESCRIPTION: + The function sends 'DMS/UIM Verify PIN Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMVerifyPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMUnblockPIN + +DESCRIPTION: + The function sends 'DMS/UIM Unblock PIN Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMUnblockPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMChangePIN + +DESCRIPTION: + The function sends 'DMS/UIM Change PIN Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMChangePIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMGetPINStatus + +DESCRIPTION: + The function sends 'DMS/UIM Get PIN Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetPINStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetHardwareRevision + +DESCRIPTION: + The function sends 'DMS/Get Hardware Revision Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetHardwareRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetOperatingMode + +DESCRIPTION: + The function sends 'DMS/Get Operating Mode Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetOperatingMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetOperatingMode + +DESCRIPTION: + The function sends 'DMS/Set Operating Mode Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetOperatingMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetTimestamp + +DESCRIPTION: + The function sends 'DMS/Get Timestamp Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetTimestamp( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetPRLVersion + +DESCRIPTION: + The function sends 'DMS/Get PRL Version Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetPRLVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetActivationState + +DESCRIPTION: + The function sends 'DMS/Get Activation State Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetActivationState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSActivateAutomatic + +DESCRIPTION: + The function sends 'DMS/Activate Automatic Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSActivateAutomatic( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSActivateManual + +DESCRIPTION: + The function sends 'DMS/Activate Manual Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSActivateManual( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetLockState + +DESCRIPTION: + The function sends 'DMS/Get Lock State Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetLockState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetLockState + +DESCRIPTION: + The function sends 'DMS/Set Lock State Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetLockState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetLockCode + +DESCRIPTION: + The function sends 'DMS/Set Lock Code Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetLockCode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSReadUserData + +DESCRIPTION: + The function sends 'DMS/Read User Data Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReadUserData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSWriteUserData + +DESCRIPTION: + The function sends 'DMS/Write User Data Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSWriteUserData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSReadERIData + +DESCRIPTION: + The function sends 'DMS/Read ERI Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReadERIData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSResetFactoryDefaults + +DESCRIPTION: + The function sends 'DMS/Reset Factory Defaults Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSResetFactoryDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSValidateSPC + +DESCRIPTION: + The function sends 'DMS/Validate SPC Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSValidateSPC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMGetICCID + +DESCRIPTION: + The function sends 'DMS/UIM Get ICCID Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetICCID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMGetHostLockID + +DESCRIPTION: + The function sends 'DMS/UIM Get Host Lock ID Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetHostLockID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMGetControlKeyStatus + +DESCRIPTION: + The function sends 'DMS/UIM Get Control Key Status Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetControlKeyStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMSetControlKeyProtection + +DESCRIPTION: + The function sends 'DMS/UIM Set Control Key Protection Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMSetControlKeyProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMUnblockControlKey + +DESCRIPTION: + The function sends 'DMS/UIM Unblock Control Key Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMUnblockControlKey( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetIMSI + +DESCRIPTION: + The function sends 'DMS/Get IMSI Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetIMSI( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetUIMState + +DESCRIPTION: + The function sends 'DMS/Get UIM State Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetUIMState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetBandCapabilities + +DESCRIPTION: + The function sends 'DMS/Get Band Capabilities Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetBandCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetFactorySerialNumber + +DESCRIPTION: + The function sends 'DMS/Get Factory Serial Number Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetFactorySerialNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetDeviceTime + +DESCRIPTION: + The function sends 'DMS/Set Device Time Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetDeviceTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetSoftwareVersion + +DESCRIPTION: + The function sends 'DMS/Get Software Version Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetSoftwareVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetSPC + +DESCRIPTION: + The function sends 'DMS/Set SPC Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetSPC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASReset + +DESCRIPTION: + The function sends 'NAS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASAbort + +DESCRIPTION: + The function sends 'NAS/Abort Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASAbort( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetEventReport + +DESCRIPTION: + The function sends 'NAS/Set Event Report Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetRegistrationEventReport + +DESCRIPTION: + The function sends 'NAS/Set Registration Event Report Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRegistrationEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetSignalStrength + +DESCRIPTION: + The function sends 'NAS/Get Signal Strength Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSignalStrength( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASPerformNetworkScan + +DESCRIPTION: + The function sends 'NAS/Perform Network Scan Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASPerformNetworkScan( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASInitiateNetworkRegister + +DESCRIPTION: + The function sends 'NAS/Initiate Network Register Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASInitiateNetworkRegister( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASInitiateAttach + +DESCRIPTION: + The function sends 'NAS/Initiate Attach Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASInitiateAttach( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetServingSystem + +DESCRIPTION: + The function sends 'NAS/Get Serving System Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetServingSystem( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetHomeNetwork + +DESCRIPTION: + The function sends 'NAS/Get Home Network Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetHomeNetwork( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetPreferredNetworks + +DESCRIPTION: + The function sends 'NAS/Get Preferred Networks Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetPreferredNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetPreferredNetworks + +DESCRIPTION: + The function sends 'NAS/Set Preferred Networks Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetPreferredNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetForbiddenNetworks + +DESCRIPTION: + The function sends 'NAS/Get Forbidden Networks Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetForbiddenNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetForbiddenNetworks + +DESCRIPTION: + The function sends 'NAS/Set Forbidden Networks Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetForbiddenNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetTechnologyPreference + +DESCRIPTION: + The function sends 'NAS/Set Technology Preference Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetTechnologyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetTechnologyPreference + +DESCRIPTION: + The function sends 'NAS/Get Technology Preference Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetTechnologyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetACCOLC + +DESCRIPTION: + The function sends 'NAS/Get ACCOLC Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetACCOLC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetACCOLC + +DESCRIPTION: + The function sends 'NAS/Set ACCOLC Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetACCOLC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetSystemPreference + +DESCRIPTION: + The function sends 'NAS/Get System Preference' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetNetworkParameters + +DESCRIPTION: + The function sends 'NAS/Get Network Parameters Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetNetworkParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetNetworkParameters + +DESCRIPTION: + The function sends 'NAS/Set Network Parameters Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetNetworkParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetRFInfo + +DESCRIPTION: + The function sends 'NAS/Get RF Info Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRFInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetANAAAAuthenticationStatus + +DESCRIPTION: + The function sends 'NAS/Get AN-AAA Authentication Status Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetANAAAAuthenticationStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetSystemSelectionPref + +DESCRIPTION: + The function sends 'NAS/Set System Selection Pref Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetSystemSelectionPref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetSystemSelectionPref + +DESCRIPTION: + The function sends 'NAS/Get System Selection Pref Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemSelectionPref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetDDTMPreference + +DESCRIPTION: + The function sends 'NAS/Set DDTM Preference Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetDDTMPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetDDTMPreference + +DESCRIPTION: + The function sends 'NAS/Get DDTM Preference Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetDDTMPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetOperatorNameData + +DESCRIPTION: + The function sends 'NAS/Get Operator Name Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetOperatorNameData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetCSPPLMNMode + +DESCRIPTION: + The function sends 'NAS/Get CSP PLMN Mode Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCSPPLMNMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASUpdateAKEY + +DESCRIPTION: + The function sends 'NAS/Update AKEY Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASUpdateAKEY( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGet3GPP2SubscriptionInfo + +DESCRIPTION: + The function sends 'NAS/Get 3GPP2 Subscription Info Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGet3GPP2SubscriptionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSet3GPP2SubscriptionInfo + +DESCRIPTION: + The function sends 'NAS/Set 3GPP2 Subscription Info Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSet3GPP2SubscriptionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetMobileCAIRevision + +DESCRIPTION: + The function sends 'NAS/Get Mobile CAI Revision Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetMobileCAIRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetRTREConfig + +DESCRIPTION: + The function sends 'NAS/Get RTRE Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRTREConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetRTREConfig + +DESCRIPTION: + The function sends 'NAS/Set RTRE Config Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRTREConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetCellLocationInfo + +DESCRIPTION: + The function sends 'NAS/Get Cell Location Info Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCellLocationInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetPLMNName + +DESCRIPTION: + The function sends 'NAS/Get PLMN Name Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetPLMNName( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASBindSubscription + +DESCRIPTION: + The function sends 'NAS/Bind Subscription Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetModePref + +DESCRIPTION: + The function sends 'NAS/Get Mode Pref Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetModePref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetDualStandbyPreference + +DESCRIPTION: + The function sends 'NAS/Set Dual Standby Preference Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetDualStandbyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetSystemInfo + +DESCRIPTION: + The function sends 'NAS/Get System Info Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetSignalInfo + +DESCRIPTION: + The function sends 'NAS/Get Signal Info Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSignalInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASConfigureSignalInfo + +DESCRIPTION: + The function sends 'NAS/Configure Signal Info Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASConfigureSignalInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetErrorRate + +DESCRIPTION: + The function sends 'NAS/Get Error Rate Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetErrorRate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetEVDOProtocolSubtype + +DESCRIPTION: + The function sends 'NAS/Get EV-DO Protocol Subtype Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetEVDOProtocolSubtype( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetEVDOColorCode + +DESCRIPTION: + The function sends 'NAS/Get EV-DO Color Code Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetEVDOColorCode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetAcquisitionSystemMode + +DESCRIPTION: + The function sends 'NAS/Get Acquisition System Mode Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetAcquisitionSystemMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetRXDiversity + +DESCRIPTION: + The function sends 'NAS/Set RX Diversity Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRXDiversity( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetRXTXInfo + +DESCRIPTION: + The function sends 'NAS/Get RX/TX Info Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRXTXInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASUpdateAKEYExtended + +DESCRIPTION: + The function sends 'NAS/Update A-KEY Extended Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASUpdateAKEYExtended( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetDualStandbyPreference + +DESCRIPTION: + The function sends 'NAS/Get Dual Standby Preference Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetDualStandbyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSReset + +DESCRIPTION: + The function sends 'WMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetEventReport + +DESCRIPTION: + The function sends 'WMS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSRawSend + +DESCRIPTION: + The function sends 'WMS/Raw Send Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawSend( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSRawWrite + +DESCRIPTION: + The function sends 'WMS/Raw Write Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawWrite( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSRawRead + +DESCRIPTION: + The function sends 'WMS/Raw Read Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawRead( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSModifyTag + +DESCRIPTION: + The function sends 'WMS/Modify Tag Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSModifyTag( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSDelete + +DESCRIPTION: + The function sends 'WMS/Delete Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSDelete( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetMessageProtocol + +DESCRIPTION: + The function sends 'WMS/Get Message Protocol Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetMessageProtocol( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSListMessages + +DESCRIPTION: + The function sends 'WMS/List Messages Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSListMessages( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetRoutes + +DESCRIPTION: + The function sends 'WMS/Set Routes Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRoutes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetRoutes + +DESCRIPTION: + The function sends 'WMS/Get Routes Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetRoutes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetSMSCAddress + +DESCRIPTION: + The function sends 'WMS/Get SMSC Address Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetSMSCAddress( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetSMSCAddress + +DESCRIPTION: + The function sends 'WMS/Set SMSC Address Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetSMSCAddress( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetStorageMaxSize + +DESCRIPTION: + The function sends 'WMS/Get Storage Max Size Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetStorageMaxSize( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSendACK + +DESCRIPTION: + The function sends 'WMS/Send ACK Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSendACK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetRetryPeriod + +DESCRIPTION: + The function sends 'WMS/Set Retry Period Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRetryPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetRetryInterval + +DESCRIPTION: + The function sends 'WMS/Set Retry Interval Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRetryInterval( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetDCDisconnectTimer + +DESCRIPTION: + The function sends 'WMS/Set DC Disconnect Timer Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetDCDisconnectTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetMemoryStatus + +DESCRIPTION: + The function sends 'WMS/Set Memory Status Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetMemoryStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetBroadcastActivation + +DESCRIPTION: + The function sends 'WMS/Set Broadcast Activation Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetBroadcastActivation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetBroadcastConfig + +DESCRIPTION: + The function sends 'WMS/Set Broadcast Config Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetBroadcastConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetBroadcastConfig + +DESCRIPTION: + The function sends 'WMS/Get Broadcast Config Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetBroadcastConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetDomainPreference + +DESCRIPTION: + The function sends 'WMS/Get Domain Preference Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetDomainPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetDomainPreference + +DESCRIPTION: + The function sends 'WMS/Set Domain Preference Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetDomainPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSendFromMemoryStore + +DESCRIPTION: + The function sends 'WMS/Send From Memory Store Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSendFromMemoryStore( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetWaitingMessage + +DESCRIPTION: + The function sends 'WMS/Get Waiting Message Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetWaitingMessage( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetPrimaryClient + +DESCRIPTION: + The function sends 'WMS/Set Primary Client Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetPrimaryClient( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSIndicatorRegistration + +DESCRIPTION: + The function sends 'WMS/Indicator Registration Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSIndicatorRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetTransportLayerInfo + +DESCRIPTION: + The function sends 'WMS/Get Transport Layer Info Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetTransportLayerInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetNetworkRegistrationInfo + +DESCRIPTION: + The function sends 'WMS/Get Network Registration Info Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetNetworkRegistrationInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSBindSubscription + +DESCRIPTION: + The function sends 'WMS/Bind Subscription Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetIndicatorRegistration + +DESCRIPTION: + The function sends 'WMS/Get Indicator Registration Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetIndicatorRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetSMSParameters + +DESCRIPTION: + The function sends 'WMS/Get SMS Parameters Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetSMSParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetSMSParameters + +DESCRIPTION: + The function sends 'WMS/Set SMS Parameters Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetSMSParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSReset + +DESCRIPTION: + The function sends 'PDS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetEventReport + +DESCRIPTION: + The function sends 'PDS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetServiceState + +DESCRIPTION: + The function sends 'PDS/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetServiceState + +DESCRIPTION: + The function sends 'PDS/Set Service State Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSStartTrackingSession + +DESCRIPTION: + The function sends 'PDS/Start Tracking Session Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSStartTrackingSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetTrackingSessionInfo + +DESCRIPTION: + The function sends 'PDS/Get Tracking Session Info Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetTrackingSessionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSFixPosition + +DESCRIPTION: + The function sends 'PDS/Fix Position Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSFixPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSEndTrackingSession + +DESCRIPTION: + The function sends 'PDS/End Tracking Session Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSEndTrackingSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetNMEAConfig + +DESCRIPTION: + The function sends 'PDS/Get NMEA Config Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetNMEAConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetNMEAConfig + +DESCRIPTION: + The function sends 'PDS/Set NMEA Config Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetNMEAConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectTimeReference + +DESCRIPTION: + The function sends 'PDS/Inject Time Reference Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeReference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetDefaults + +DESCRIPTION: + The function sends 'PDS/Get Defaults Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetDefaults + +DESCRIPTION: + The function sends 'PDS/Set Defaults Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetXTRAParameters + +DESCRIPTION: + The function sends 'PDS/Get XTRA Parameters Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetXTRAParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetXTRAParameters + +DESCRIPTION: + The function sends 'PDS/Set XTRA Parameters Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetXTRAParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSForceXTRADownload + +DESCRIPTION: + The function sends 'PDS/Force XTRA Download Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSForceXTRADownload( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetAGPSConfig + +DESCRIPTION: + The function sends 'PDS/Get AGPS Config Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetAGPSConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetAGPSConfig + +DESCRIPTION: + The function sends 'PDS/Set AGPS Config Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetAGPSConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetServiceAutoTrackingState + +DESCRIPTION: + The function sends 'PDS/Get Service Auto-Tracking State Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceAutoTrackingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetServiceAutoTrackingState + +DESCRIPTION: + The function sends 'PDS/Set Service Auto-Tracking State Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetServiceAutoTrackingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetCOMPortAutoTrackingConfig + +DESCRIPTION: + The function sends 'PDS/Get COM Port Auto-Tracking Config Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetCOMPortAutoTrackingConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetCOMPortAutoTrackingConfig + +DESCRIPTION: + The function sends 'PDS/Set COM Port Auto-Tracking Config Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetCOMPortAutoTrackingConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSResetPDSData + +DESCRIPTION: + The function sends 'PDS/Reset PDS Data Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSResetPDSData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSinglePositionFix + +DESCRIPTION: + The function sends 'PDS/Single Position Fix Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSinglePositionFix( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetServiceVersion + +DESCRIPTION: + The function sends 'PDS/Get Service Version Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectXTRAData + +DESCRIPTION: + The function sends 'PDS/Inject XTRA Data Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectXTRAData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectPositionData + +DESCRIPTION: + The function sends 'PDS/Inject Position Data Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectPositionData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectWiFiPositionData + +DESCRIPTION: + The function sends 'PDS/Inject Wi-Fi Position Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectWiFiPositionData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetSBASConfig + +DESCRIPTION: + The function sends 'PDS/Get SBAS Config Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSBASConfig + +DESCRIPTION: + The function sends 'PDS/Set SBAS Config Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSendNetworkInitiatedResponse + +DESCRIPTION: + The function sends 'PDS/Send Network Initiated Response Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSendNetworkInitiatedResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectAbsoluteTime + +DESCRIPTION: + The function sends 'PDS/Inject Absolute Time Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectAbsoluteTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectEFSData + +DESCRIPTION: + The function sends 'PDS/Inject EFS Data Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectEFSData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetDPOConfig + +DESCRIPTION: + The function sends 'PDS/Get DPO Config Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetDPOConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetDPOConfig + +DESCRIPTION: + The function sends 'PDS/Set DPO Config Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetDPOConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetODPConfig + +DESCRIPTION: + The function sends 'PDS/Get ODP Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetODPConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetODPConfig + +DESCRIPTION: + The function sends 'PDS/Set ODP Config Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetODPConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSCancelSinglePositionFix + +DESCRIPTION: + The function sends 'PDS/Cancel Single Position Fix Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSCancelSinglePositionFix( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetGPSState + +DESCRIPTION: + The function sends 'PDS/Get GPS State Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetGPSState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetPPMEventReport + +DESCRIPTION: + The function sends 'PDS/Set PPM Event Report Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPPMEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSPIStreamingReport + +DESCRIPTION: + The function sends 'PDS/Set SPI Streaming Report Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSPIStreamingReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSPIStatus + +DESCRIPTION: + The function sends 'PDS/Set SPI Status Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSPIStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetPPMReportingState + +DESCRIPTION: + The function sends 'PDS/Set PPM Reporting State Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPPMReportingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSForceReceiverOff + +DESCRIPTION: + The function sends 'PDS/Force Receiver Off Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSForceReceiverOff( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetPositionMethodsState + +DESCRIPTION: + The function sends 'PDS/Get Position Methods State Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetPositionMethodsState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetPositionMethodsState + +DESCRIPTION: + The function sends 'PDS/Set Position Methods State Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPositionMethodsState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectSensorData + +DESCRIPTION: + The function sends 'PDS/Inject Sensor Data Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectSensorData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectTimeSyncData + +DESCRIPTION: + The function sends 'PDS/Inject Time Sync Data Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeSyncData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetSensorConfig + +DESCRIPTION: + The function sends 'PDS/Get Sensor Config Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSensorConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSensorConfig + +DESCRIPTION: + The function sends 'PDS/Set Sensor Config Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSensorConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetSensorNavigation + +DESCRIPTION: + The function sends 'PDS/Get Sensor Navigation Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSensorNavigation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetNavigationConfig + +DESCRIPTION: + The function sends 'PDS/Set Navigation Config Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetNavigationConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetWLANBlanking + +DESCRIPTION: + The function sends 'PDS/Set WLAN Blanking Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetWLANBlanking( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSecurityChallengeReport + +DESCRIPTION: + The function sends 'PDS/Set Security Challenge Report Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityChallengeReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSecurityChallenge + +DESCRIPTION: + The function sends 'PDS/Set Security Challenge Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityChallenge( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetSecurityEncryptionConfig + +DESCRIPTION: + The function sends 'PDS/Get Security Encryption Config Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSecurityEncryptionConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSecurityUpdateRate + +DESCRIPTION: + The function sends 'PDS/Set Security Update Rate Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityUpdateRate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetCellDatabaseControl + +DESCRIPTION: + The function sends 'PDS/Set Cell Database Control Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetCellDatabaseControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + AUTHStartEAPSession + +DESCRIPTION: + The function sends 'AUTH/Start EAP Session Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHStartEAPSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + AUTHSendEAPPacket + +DESCRIPTION: + The function sends 'AUTH/Send EAP Packet Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHSendEAPPacket( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + AUTHGetEAPSessionKeys + +DESCRIPTION: + The function sends 'AUTH/Get EAP Session Keys Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHGetEAPSessionKeys( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + AUTHEndEAPSession + +DESCRIPTION: + The function sends 'AUTH/End EAP Session Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHEndEAPSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + AUTHRunAKA + +DESCRIPTION: + The function sends 'AUTH/Run AKA Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHRunAKA( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceIndicationRegistration + +DESCRIPTION: + The function sends 'Voice/Indication Registration Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceIndicationRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceCallOriginate + +DESCRIPTION: + The function sends 'Voice/Call Originate Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallOriginate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceCallEnd + +DESCRIPTION: + The function sends 'Voice/Call End Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallEnd( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceCallAnswer + +DESCRIPTION: + The function sends 'Voice/Call Answer Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallAnswer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCallInfo + +DESCRIPTION: + The function sends 'Voice/Get Call Info Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceSendFlash + +DESCRIPTION: + The function sends 'Voice/Send Flash Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSendFlash( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceBurstDTMF + +DESCRIPTION: + The function sends 'Voice/Burst DTMF Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceBurstDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceStartContinuousDTMF + +DESCRIPTION: + The function sends 'Voice/Start Continuous DTMF Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceStartContinuousDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceStopContinuousDTMF + +DESCRIPTION: + The function sends 'Voice/Stop Continuous DTMF Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceStopContinuousDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceSetPreferredPrivacy + +DESCRIPTION: + The function sends 'Voice/Set Preferred Privacy Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetPreferredPrivacy( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetAllCallInfo + +DESCRIPTION: + The function sends 'Voice/Get All Call Info Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetAllCallInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceManageCalls + +DESCRIPTION: + The function sends 'Voice/Manage Calls Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceManageCalls( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceSetSupplementaryService + +DESCRIPTION: + The function sends 'Voice/Set Supplementary Service Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetSupplementaryService( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCallWaiting + +DESCRIPTION: + The function sends 'Voice/Get Call Waiting Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallWaiting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCallBarring + +DESCRIPTION: + The function sends 'Voice/Get Call Barring Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallBarring( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCLIP + +DESCRIPTION: + The function sends 'Voice/Get CLIP Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCLIP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCLIR + +DESCRIPTION: + The function sends 'Voice/Get CLIR Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCLIR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCallForwarding + +DESCRIPTION: + The function sends 'Voice/Get Call Forwarding Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallForwarding( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceSetCallBarringPassword + +DESCRIPTION: + The function sends 'Voice/Set Call Barring Password Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetCallBarringPassword( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceInitiateUSSD + +DESCRIPTION: + The function sends 'Voice/Initiate USSD Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceInitiateUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceAnswerUSSD + +DESCRIPTION: + The function sends 'Voice/Answer USSD Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAnswerUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceCancelUSSD + +DESCRIPTION: + The function sends 'Voice/Cancel USSD Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCancelUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceSetConfig + +DESCRIPTION: + The function sends 'Voice/Set Config Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetConfig + +DESCRIPTION: + The function sends 'Voice/Get Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceAsyncInitiateUSSD + +DESCRIPTION: + The function sends 'Voice/Async Initiate USSD Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAsyncInitiateUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceBindSubscription + +DESCRIPTION: + The function sends 'Voice/Bind Subscription Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceALSSetLineSwitching + +DESCRIPTION: + The function sends 'Voice/ALS Set Line Switching Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceALSSetLineSwitching( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceALSSelectLine + +DESCRIPTION: + The function sends 'Voice/ALS Select Line Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceALSSelectLine( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceAOCResetACM + +DESCRIPTION: + The function sends 'Voice/AOC Reset ACM Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCResetACM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceAOCSetACMMaximum + +DESCRIPTION: + The function sends 'Voice/AOC Set ACM Maximum Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCSetACMMaximum( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceAOCGetCallMeterInfo + +DESCRIPTION: + The function sends 'Voice/AOC Get Call Meter Info Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCGetCallMeterInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCOLP + +DESCRIPTION: + The function sends 'Voice/Get COLP Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCOLP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCOLR + +DESCRIPTION: + The function sends 'Voice/Get COLR Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCOLR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCNAP + +DESCRIPTION: + The function sends 'Voice/Get CNAP Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCNAP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceManageIPCalls + +DESCRIPTION: + The function sends 'Voice/Manage IP Calls Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceManageIPCalls( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2Reset + +DESCRIPTION: + The function sends 'CAT2/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2Reset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SetEventReport + +DESCRIPTION: + The function sends 'CAT2/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2GetServiceState + +DESCRIPTION: + The function sends 'CAT2/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SendTerminalResponse + +DESCRIPTION: + The function sends 'CAT2/Send Terminal Response Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2EnvelopeCommand + +DESCRIPTION: + The function sends 'CAT2/Envelope Command Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2EnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2GetEventReport + +DESCRIPTION: + The function sends 'CAT2/Get Event Report Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SendDecodedTerminalResponse + +DESCRIPTION: + The function sends 'CAT2/Send Decoded Terminal Response Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendDecodedTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SendDecodedEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT2/Send Decoded Envelope Command Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendDecodedEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2EventConfirmation + +DESCRIPTION: + The function sends 'CAT2/Event Confirmation Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2EventConfirmation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SCWSOpenChannel + +DESCRIPTION: + The function sends 'CAT2/SCWS Open Channel Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSOpenChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SCWSCloseChannel + +DESCRIPTION: + The function sends 'CAT2/SCWS Close Channel Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSCloseChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SCWSSendData + +DESCRIPTION: + The function sends 'CAT2/SCWS Send Data Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSSendData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SCWSDataAvailable + +DESCRIPTION: + The function sends 'CAT2/SCWS Data Available Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSDataAvailable( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SCWSChannelStatus + +DESCRIPTION: + The function sends 'CAT2/SCWS Channel Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSChannelStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMReset + +DESCRIPTION: + The function sends 'UIM/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMReadTransparent + +DESCRIPTION: + The function sends 'UIM/Read Transparent Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReadTransparent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMReadRecord + +DESCRIPTION: + The function sends 'UIM/Read Record Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReadRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMWriteTransparent + +DESCRIPTION: + The function sends 'UIM/Write Transparent Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMWriteTransparent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMWriteRecord + +DESCRIPTION: + The function sends 'UIM/Write Record Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMWriteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetFileAttributes + +DESCRIPTION: + The function sends 'UIM/Get File Attributes Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetFileAttributes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSetPINProtection + +DESCRIPTION: + The function sends 'UIM/Set PIN Protection Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetPINProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMVerifyPIN + +DESCRIPTION: + The function sends 'UIM/Verify PIN Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMVerifyPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMUnblockPIN + +DESCRIPTION: + The function sends 'UIM/Unblock PIN Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMChangePIN + +DESCRIPTION: + The function sends 'UIM/Change PIN Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangePIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMDepersonalization + +DESCRIPTION: + The function sends 'UIM/Depersonalization Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMDepersonalization( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMRefreshRegister + +DESCRIPTION: + The function sends 'UIM/Refresh Register Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshRegister( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMRefreshOK + +DESCRIPTION: + The function sends 'UIM/Refresh OK Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshOK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMRefreshComplete + +DESCRIPTION: + The function sends 'UIM/Refresh Complete Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshComplete( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetLastRefreshEvent + +DESCRIPTION: + The function sends 'UIM/Get Last Refresh Event Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetLastRefreshEvent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMEventRegistration + +DESCRIPTION: + The function sends 'UIM/Event Registration Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMEventRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetCardStatus + +DESCRIPTION: + The function sends 'UIM/Get Card Status Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetCardStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMPowerDown + +DESCRIPTION: + The function sends 'UIM/Power Down Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMPowerDown( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMPowerUp + +DESCRIPTION: + The function sends 'UIM/Power Up Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMPowerUp( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMAuthenticate + +DESCRIPTION: + The function sends 'UIM/Authenticate Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMAuthenticate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMCloseSession + +DESCRIPTION: + The function sends 'UIM/Close Session Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMCloseSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetServiceStatus + +DESCRIPTION: + The function sends 'UIM/Get Service Status Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSetServiceStatus + +DESCRIPTION: + The function sends 'UIM/Set Service Status Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMChangeProvisioningSession + +DESCRIPTION: + The function sends 'UIM/Change Provisioning Session Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangeProvisioningSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetLabel + +DESCRIPTION: + The function sends 'UIM/Get Label Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetLabel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetConfiguration + +DESCRIPTION: + The function sends 'UIM/Get Configuration Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSendADPU + +DESCRIPTION: + The function sends 'UIM/Send ADPU Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSendADPU( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSAPConnection + +DESCRIPTION: + The function sends 'UIM/SAP Connection Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSAPConnection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSAPRequest + +DESCRIPTION: + The function sends 'UIM/SAP Request Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSAPRequest( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMLogicalChannel + +DESCRIPTION: + The function sends 'UIM/Logical Channel Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMLogicalChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSubscriptionOK + +DESCRIPTION: + The function sends 'UIM/Subscription OK Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSubscriptionOK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetATR + +DESCRIPTION: + The function sends 'UIM/Get ATR Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetATR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMSetIndicationRegistrationState + +DESCRIPTION: + The function sends 'PBM/Set Indication Registration State Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetIndicationRegistrationState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetCapabilities + +DESCRIPTION: + The function sends 'PBM/Get Capabilities Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetAllCapabilities + +DESCRIPTION: + The function sends 'PBM/Get All Capabilities Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAllCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMReadRecords + +DESCRIPTION: + The function sends 'PBM/Read Records Request' (0x0004) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMReadRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMWriteRecord + +DESCRIPTION: + The function sends 'PBM/Write Record Request' (0x0005) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMWriteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMDeleteRecord + +DESCRIPTION: + The function sends 'PBM/Delete Record Request' (0x0006) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMDeleteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMDeleteAllRecords + +DESCRIPTION: + The function sends 'PBM/Delete All Records Request' (0x0007) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMDeleteAllRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMSearchRecords + +DESCRIPTION: + The function sends 'PBM/Search Records Request' (0x0008) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSearchRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetEmergencyList + +DESCRIPTION: + The function sends 'PBM/Get Emergency List Request' (0x000E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetEmergencyList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetAllGroups + +DESCRIPTION: + The function sends 'PBM/Get All Groups Request' (0x000F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAllGroups( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMSetGroupInfo + +DESCRIPTION: + The function sends 'PBM/Set Group Info Request' (0x0010) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetGroupInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetState + +DESCRIPTION: + The function sends 'PBM/Get State Request' (0x0011) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMReadAllHiddenRecords + +DESCRIPTION: + The function sends 'PBM/Read All Hidden Records Request' (0x0012) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMReadAllHiddenRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetNextEmptyRecordID + +DESCRIPTION: + The function sends 'PBM/Get Next Empty Record ID Request' (0x0014) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetNextEmptyRecordID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetNextRecordID + +DESCRIPTION: + The function sends 'PBM/Get Next Record ID Request' (0x0015) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetNextRecordID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetAASList + +DESCRIPTION: + The function sends 'PBM/Get AAS List Request' (0x0016) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAASList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMSetAAS + +DESCRIPTION: + The function sends 'PBM/Set AAS Request' (0x0017) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetAAS( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMBindSubscription + +DESCRIPTION: + The function sends 'PBM/Bind Subscription Request' (0x001A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCClientRevision + +DESCRIPTION: + The function sends 'LOC/Client Revision Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCClientRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCRegisterEvents + +DESCRIPTION: + The function sends 'LOC/Register Events Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCRegisterEvents( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCStart + +DESCRIPTION: + The function sends 'LOC/Start Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCStart( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCStop + +DESCRIPTION: + The function sends 'LOC/Stop Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCStop( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetServiceRevision + +DESCRIPTION: + The function sends 'LOC/Get Service Revision Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetServiceRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetFixCriteria + +DESCRIPTION: + The function sends 'LOC/Get Fix Criteria Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetFixCriteria( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCProvideNIUserResponse + +DESCRIPTION: + The function sends 'LOC/Provide NI User Response Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideNIUserResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectPredictedOrbitsData + +DESCRIPTION: + The function sends 'LOC/Inject Predicted Orbits Data Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectPredictedOrbitsData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetPredictedOrbitsDataSource + +DESCRIPTION: + The function sends 'LOC/Get Predicted Orbits Data Source Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetPredictedOrbitsDataSource( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetPredictedOrbitsDataValidity + +DESCRIPTION: + The function sends 'LOC/Get Predicted Orbits Data Validity Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetPredictedOrbitsDataValidity( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectUTCTime + +DESCRIPTION: + The function sends 'LOC/Inject UTC Time Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectUTCTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectPosition + +DESCRIPTION: + The function sends 'LOC/Inject Position Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetEngineLock + +DESCRIPTION: + The function sends 'LOC/Set Engine Lock Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetEngineLock( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetEngineLock + +DESCRIPTION: + The function sends 'LOC/Get Engine Lock Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetEngineLock( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetSBASConfig + +DESCRIPTION: + The function sends 'LOC/Set SBAS Config Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetSBASConfig + +DESCRIPTION: + The function sends 'LOC/Get SBAS Config Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetNMEATypes + +DESCRIPTION: + The function sends 'LOC/Set NMEA Types Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetNMEATypes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetNMEATypes + +DESCRIPTION: + The function sends 'LOC/Get NMEA Types Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetNMEATypes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetLowPowerMode + +DESCRIPTION: + The function sends 'LOC/Set Low Power Mode Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetLowPowerMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetLowPowerMode + +DESCRIPTION: + The function sends 'LOC/Get Low Power Mode Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetLowPowerMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetLocationServer + +DESCRIPTION: + The function sends 'LOC/Set Location Server Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetLocationServer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetLocationServer + +DESCRIPTION: + The function sends 'LOC/Get Location Server Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetLocationServer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCDeleteAssistData + +DESCRIPTION: + The function sends 'LOC/Delete Assist Data Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCDeleteAssistData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetXTRATSessionControl + +DESCRIPTION: + The function sends 'LOC/Set XTRA-T Session Control Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetXTRATSessionControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOC + +DESCRIPTION: + The function sends 'LOC' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectWiFiPosition + +DESCRIPTION: + The function sends 'LOC/Inject Wi-Fi Position Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectWiFiPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCProvideWiFiStatus + +DESCRIPTION: + The function sends 'LOC/Provide Wi-Fi Status Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideWiFiStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetRegisteredEvents + +DESCRIPTION: + The function sends 'LOC/Get Registered Events Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetRegisteredEvents( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetOperationMode + +DESCRIPTION: + The function sends 'LOC/Set Operation Mode Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetOperationMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetOperationMode + +DESCRIPTION: + The function sends 'LOC/Get Operation Mode Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetOperationMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetSPIStatus + +DESCRIPTION: + The function sends 'LOC/Set SPI Status Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSPIStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectSensorData + +DESCRIPTION: + The function sends 'LOC/Inject Sensor Data Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectSensorData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectTimeSyncData + +DESCRIPTION: + The function sends 'LOC/Inject Time Sync Data Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectTimeSyncData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetCradleMountConfig + +DESCRIPTION: + The function sends 'LOC/Set Cradle Mount Config Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetCradleMountConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetCradleMountConfig + +DESCRIPTION: + The function sends 'LOC/Get Cradle Mount Config Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetCradleMountConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetExternalPowerConfig + +DESCRIPTION: + The function sends 'LOC/Set External Power Config Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetExternalPowerConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetExternalPowerConfig + +DESCRIPTION: + The function sends 'LOC/Get External Power Config Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetExternalPowerConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCProvideConnectionStatus + +DESCRIPTION: + The function sends 'LOC/Provide Connection Status Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideConnectionStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetProtocolConfigParameters + +DESCRIPTION: + The function sends 'LOC/Set Protocol Config Parameters Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetProtocolConfigParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetProtocolConfigParameters + +DESCRIPTION: + The function sends 'LOC/Get Protocol Config Parameters Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetProtocolConfigParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetSensorControlConfig + +DESCRIPTION: + The function sends 'LOC/Set Sensor Control Config Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorControlConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetSensorControlConfig + +DESCRIPTION: + The function sends 'LOC/Get Sensor Control Config Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorControlConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetSensorProperties + +DESCRIPTION: + The function sends 'LOC/Set Sensor Properties Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorProperties( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetSensorProperties + +DESCRIPTION: + The function sends 'LOC/Get Sensor Properties Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorProperties( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetSensorPerformanceConfig + +DESCRIPTION: + The function sends 'LOC/Set Sensor Performance Config Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorPerformanceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetSensorPerformanceConfig + +DESCRIPTION: + The function sends 'LOC/Get Sensor Performance Config Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorPerformanceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATReset + +DESCRIPTION: + The function sends 'CAT/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSetEventReport + +DESCRIPTION: + The function sends 'CAT/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATGetServiceState + +DESCRIPTION: + The function sends 'CAT/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSendTerminalResponse + +DESCRIPTION: + The function sends 'CAT/Send Terminal Response Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT/Envelope Command Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATGetEventReport + +DESCRIPTION: + The function sends 'CAT/Get Event Report Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSendDecodedTerminalResponse + +DESCRIPTION: + The function sends 'CAT/Send Decoded Terminal Response Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendDecodedTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSendDecodedEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT/Send Decoded Envelope Command Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendDecodedEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATEventConfirmation + +DESCRIPTION: + The function sends 'CAT/Event Confirmation Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATEventConfirmation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSCWSOpenChannel + +DESCRIPTION: + The function sends 'CAT/SCWS Open Channel Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSOpenChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSCWSCloseChannel + +DESCRIPTION: + The function sends 'CAT/SCWS Close Channel Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSCloseChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSCWSSendData + +DESCRIPTION: + The function sends 'CAT/SCWS Send Data Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSSendData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSCWSDataAvailable + +DESCRIPTION: + The function sends 'CAT/SCWS Data Available Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSDataAvailable( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSCWSChannelStatus + +DESCRIPTION: + The function sends 'CAT/SCWS Channel Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSChannelStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + RMSReset + +DESCRIPTION: + The function sends 'RMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + RMSGetSMSWake + +DESCRIPTION: + The function sends 'RMS/Get SMS Wake Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSGetSMSWake( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + RMSSetSMSWake + +DESCRIPTION: + The function sends 'RMS/Set SMS Wake Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSSetSMSWake( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMAReset + +DESCRIPTION: + The function sends 'OMA/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMASetEventReport + +DESCRIPTION: + The function sends 'OMA/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMAStartSession + +DESCRIPTION: + The function sends 'OMA/Start Session Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAStartSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMACancelSession + +DESCRIPTION: + The function sends 'OMA/Cancel Session Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMACancelSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMAGetSessionInfo + +DESCRIPTION: + The function sends 'OMA/Get Session Info Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAGetSessionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMASendSelection + +DESCRIPTION: + The function sends 'OMA/Send Selection Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASendSelection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMAGetFeatures + +DESCRIPTION: + The function sends 'OMA/Get Features Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAGetFeatures( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMASetFeatures + +DESCRIPTION: + The function sends 'OMA/Set Features Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASetFeatures( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + diff --git a/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPIEnums.h b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPIEnums.h new file mode 100755 index 0000000..f99d085 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPIEnums.h @@ -0,0 +1,4259 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtAPIEnums.h + +DESCRIPTION: + Declaration of the Gobi API enumerations + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +#pragma once + +// Gobi API error code +enum eGobiError +{ + eGOBI_ERR_ENUM_BEGIN = -1, + + eGOBI_ERR_NONE, // 00 Success + eGOBI_ERR_GENERAL, // 01 General error + eGOBI_ERR_INTERNAL, // 02 Internal error + eGOBI_ERR_MEMORY, // 03 Memory error + eGOBI_ERR_INVALID_ARG, // 04 Invalid argument + eGOBI_ERR_BUFFER_SZ, // 05 Buffer too small + eGOBI_ERR_NO_DEVICE, // 06 Unable to detect device + eGOBI_ERR_INVALID_DEVID, // 07 Invalid device ID + eGOBI_ERR_NO_CONNECTION, // 08 No connection to device + eGOBI_ERR_IFACE, // 09 Unable to obtain required interace + eGOBI_ERR_CONNECT, // 10 Unable to connect to interface + eGOBI_ERR_REQ_SCHEDULE, // 11 Unable to schedule request + eGOBI_ERR_REQUEST, // 12 Error sending request + eGOBI_ERR_RESPONSE, // 13 Error receiving response + eGOBI_ERR_REQUEST_TO, // 14 Timeout while sending request + eGOBI_ERR_RESPONSE_TO, // 15 Timeout while receiving response + eGOBI_ERR_MALFORMED_RSP, // 16 Malformed response received + eGOBI_ERR_INVALID_RSP, // 17 Invalid/error response received + eGOBI_ERR_INVALID_FILE, // 18 Invalid file path + eGOBI_ERR_FILE_OPEN, // 19 Unable to open file + eGOBI_ERR_FILE_COPY, // 20 Unable to copy file + eGOBI_ERR_QDL_SCM, // 21 Unable to open service control mgr + eGOBI_ERR_NO_QDL_SVC, // 22 Unable to detect QDL service + eGOBI_ERR_NO_QDL_SVC_INFO, // 23 Unable to obtain QDL service info + eGOBI_ERR_NO_QDL_SVC_PATH, // 24 Unable to locate QSL service + eGOBI_ERR_QDL_SVC_CFG, // 25 Unable to reconfigure QDL service + eGOBI_ERR_QDL_SVC_IFACE, // 26 Unable to interface to QDL service + eGOBI_ERR_OFFLINE, // 27 Unable to set device offline + eGOBI_ERR_RESET, // 28 Unable to reset device + eGOBI_ERR_NO_SIGNAL, // 29 No available signal + eGOBI_ERR_MULTIPLE_DEVICES, // 30 Multiple devices detected + eGOBI_ERR_DRIVER, // 31 Error interfacing to driver + eGOBI_ERR_NO_CANCELABLE_OP, // 32 No cancelable operation is pending + eGOBI_ERR_CANCEL_OP, // 33 Error canceling outstanding operation + eGOBI_ERR_QDL_CRC, // 34 QDL image data CRC error + eGOBI_ERR_QDL_PARSING, // 35 QDL image data parsing error + eGOBI_ERR_QDL_AUTH, // 36 QDL image authentication error + eGOBI_ERR_QDL_WRITE, // 37 QDL image write error + eGOBI_ERR_QDL_OPEN_SIZE, // 38 QDL image size error + eGOBI_ERR_QDL_OPEN_TYPE, // 39 QDL image type error + eGOBI_ERR_QDL_OPEN_PROT, // 40 QDL memory protection error + eGOBI_ERR_QDL_OPEN_SKIP, // 41 QDL image not required + eGOBI_ERR_QDL_ERR_GENERAL, // 42 QDL general error + eGOBI_ERR_QDL_BAR_MODE, // 43 QDL BAR mode error + + eGOBI_ERR_ENUM_END, + + // Offset from which mapped QMI error codes start from (see eQMIErrors) + eGOBI_ERR_QMI_OFFSET = 1000, +}; + +// Enum to describe QMI AUTH AKA Result +enum eQMIAUTHAKAResult:UINT8 +{ + eQMIAUTHAKAResult_Success = 0, + eQMIAUTHAKAResult_SyncFailure = 1, + eQMIAUTHAKAResult_Failure = 2, +}; + +// Enum to describe QMI AUTH AKA Version +enum eQMIAUTHAKAVersion:UINT8 +{ + eQMIAUTHAKAVersion_Version1 = 0, + eQMIAUTHAKAVersion_Version2 = 1, +}; + +// Enum to describe QMI AUTH EAP Result +enum eQMIAUTHEAPResult:UINT8 +{ + eQMIAUTHEAPResult_Success = 0, + eQMIAUTHEAPResult_Failure = 1, +}; + +// Enum to describe QMI CAT Address NPI +enum eQMICATAddressNPI:UINT8 +{ + eQMICATAddressNPI_Unknown = 0, + eQMICATAddressNPI_ISDNTelephony = 1, + eQMICATAddressNPI_DataNPI = 2, + eQMICATAddressNPI_TelexNPI = 3, + eQMICATAddressNPI_PrivateNPI = 4, + eQMICATAddressNPI_ExtensionIsReserved = 15, +}; + +// Enum to describe QMI CAT Address TON +enum eQMICATAddressTON:UINT8 +{ + eQMICATAddressTON_Unknown = 0, + eQMICATAddressTON_InternationalNumber = 1, + eQMICATAddressTON_NationalNumber = 2, + eQMICATAddressTON_NetworkSpecificNumber = 3, +}; + +// Enum to describe QMI CAT Address Type +enum eQMICATAddressType:UINT8 +{ + eQMICATAddressType_NoAddressGiven = 1, + eQMICATAddressType_Dynamic = 2, + eQMICATAddressType_IPv4 = 3, + eQMICATAddressType_IPv6 = 4, +}; + +// Enum to describe QMI CAT Alpha ID Command Type +enum eQMICATAlphaIDCommandType:UINT8 +{ + eQMICATAlphaIDCommandType_SendSMSProactiveCommand = 1, +}; + +// Enum to describe QMI CAT Bearer +enum eQMICATBearer:UINT8 +{ + eQMICATBearer_SMS = 0, + eQMICATBearer_CSD = 1, + eQMICATBearer_USSD = 2, + eQMICATBearer_GPRS = 3, + eQMICATBearer_Default = 4, +}; + +// Enum to describe QMI CAT Bearer Capability Repeat Indicator +enum eQMICATBearerCapabilityRepeatIndicator:UINT8 +{ + eQMICATBearerCapabilityRepeatIndicator_AlternateMode = 0, + eQMICATBearerCapabilityRepeatIndicator_SequentialMode = 1, +}; + +// Enum to describe QMI CAT CSD Bearer Name +enum eQMICATCSDBearerName:UINT8 +{ + eQMICATCSDBearerName_DataCircuitAsyncUDIOr31kHzModem = 0, + eQMICATCSDBearerName_DataCircuitSyncUDIOr31kHzModem = 1, + eQMICATCSDBearerName_PADAccessAsyncUDI = 2, + eQMICATCSDBearerName_PacketAccessSyncUDI = 3, + eQMICATCSDBearerName_DataCircuitAsyncRDI = 4, + eQMICATCSDBearerName_DataCircuitSyncRDI = 5, + eQMICATCSDBearerName_PADAccessAsyncRDI = 6, + eQMICATCSDBearerName_PacketAccessSyncRDI = 7, +}; + +// Enum to describe QMI CAT Call Control Result +enum eQMICATCallControlResult:UINT8 +{ + eQMICATCallControlResult_AllowedWithNoModification = 0, + eQMICATCallControlResult_NotAllowed = 1, + eQMICATCallControlResult_AllowedWithModification = 2, +}; + +// Enum to describe QMI CAT Call Setup Requirement +enum eQMICATCallSetupRequirement:UINT8 +{ + eQMICATCallSetupRequirement_NoOtherCalls = 0, + eQMICATCallSetupRequirement_HoldActiveCalls = 1, + eQMICATCallSetupRequirement_DisconnectActiveCalls = 2, +}; + +// Enum to describe QMI CAT Channel State +enum eQMICATChannelState:UINT8 +{ + eQMICATChannelState_ClosedState = 0, + eQMICATChannelState_ListenState = 1, + eQMICATChannelState_EstablishedState = 2, +}; + +// Enum to describe QMI CAT Command Format +enum eQMICATCommandFormat:UINT8 +{ + eQMICATCommandFormat_Raw = 1, + eQMICATCommandFormat_Decoded = 2, +}; + +// Enum to describe QMI CAT Command ID +enum eQMICATCommandID:UINT8 +{ + eQMICATCommandID_DisplayText = 1, + eQMICATCommandID_GetInkey = 2, + eQMICATCommandID_GetInput = 3, + eQMICATCommandID_LaunchBrowser = 4, + eQMICATCommandID_PlayTone = 5, + eQMICATCommandID_SelectItem = 6, + eQMICATCommandID_SendSMS = 7, + eQMICATCommandID_SendSS = 8, + eQMICATCommandID_SendUSSD = 9, + eQMICATCommandID_SetupCallUserConfiguration = 10, + eQMICATCommandID_SetupCallAlphaDisplay = 11, + eQMICATCommandID_SetupMenu = 12, + eQMICATCommandID_SetupIdleText = 13, + eQMICATCommandID_ProvideLocalInformationLanguage = 14, + eQMICATCommandID_SendDTMF = 15, + eQMICATCommandID_LanguageNotification = 16, + eQMICATCommandID_SetupEventUserActivity = 17, + eQMICATCommandID_SetupEventIdleScreenNotify = 18, + eQMICATCommandID_SetupEventLanguageSelectionNotify = 19, + eQMICATCommandID_OpenChannel = 20, + eQMICATCommandID_CloseChannel = 21, + eQMICATCommandID_ReceiveData = 22, + eQMICATCommandID_SendData = 23, +}; + +// Enum to describe QMI CAT Connection Element +enum eQMICATConnectionElement:UINT8 +{ + eQMICATConnectionElement_Transparent = 0, + eQMICATConnectionElement_Nontransparent = 1, + eQMICATConnectionElement_BothTransparentPreferred = 2, + eQMICATConnectionElement_BothNontransparentPreferred = 3, +}; + +// Enum to describe QMI CAT Data Coding Scheme +enum eQMICATDataCodingScheme:UINT8 +{ + eQMICATDataCodingScheme_7BitGSM = 0, + eQMICATDataCodingScheme_8BitGSM = 1, + eQMICATDataCodingScheme_UCS2 = 2, +}; + +// Enum to describe QMI CAT Decoded Envelope Command +enum eQMICATDecodedEnvelopeCommand:UINT16 +{ + eQMICATDecodedEnvelopeCommand_MenuSelection = 1, + eQMICATDecodedEnvelopeCommand_EventDownloadLanguageSelection = 2, + eQMICATDecodedEnvelopeCommand_EventDownloadUserActivity = 3, + eQMICATDecodedEnvelopeCommand_EventDownloadIdleScreenAvailable = 4, + eQMICATDecodedEnvelopeCommand_SendCallControl = 5, +}; + +// Enum to describe QMI CAT Deliver Error SDU +enum eQMICATDeliverErrorSDU:UINT8 +{ + eQMICATDeliverErrorSDU_No = 0, + eQMICATDeliverErrorSDU_Yes = 1, + eQMICATDeliverErrorSDU_NoDetect = 2, + eQMICATDeliverErrorSDU_SubscribedValue = 3, +}; + +// Enum to describe QMI CAT Delivery Order +enum eQMICATDeliveryOrder:UINT8 +{ + eQMICATDeliveryOrder_No = 0, + eQMICATDeliveryOrder_Yes = 1, + eQMICATDeliveryOrder_SubscribedValue = 2, +}; + +// Enum to describe QMI CAT Display Icon Only +enum eQMICATDisplayIconOnly:UINT8 +{ + eQMICATDisplayIconOnly_DoNotDisplayTheIcon = 0, + eQMICATDisplayIconOnly_DisplayOnlyTheIcon = 1, +}; + +// Enum to describe QMI CAT Envelope Command Type +enum eQMICATEnvelopeCommandType:UINT16 +{ + eQMICATEnvelopeCommandType_MenuSelection = 1, + eQMICATEnvelopeCommandType_EventDownloadUserActivity = 2, + eQMICATEnvelopeCommandType_EventDownloadIdleScreenAvailable = 3, + eQMICATEnvelopeCommandType_EventDownloadLanguageSelection = 4, + eQMICATEnvelopeCommandType_UnknownType = 5, + eQMICATEnvelopeCommandType_EventDownloadBrowserTermination = 6, +}; + +// Enum to describe QMI CAT Help Available +enum eQMICATHelpAvailable:UINT8 +{ + eQMICATHelpAvailable_NoHelpIsAvailable = 0, + eQMICATHelpAvailable_HelpIsAvailable = 1, +}; + +// Enum to describe QMI CAT Help Request +enum eQMICATHelpRequest:UINT8 +{ + eQMICATHelpRequest_NoHelpIsRequested = 0, + eQMICATHelpRequest_HelpIsRequested = 1, +}; + +// Enum to describe QMI CAT High Priority +enum eQMICATHighPriority:UINT8 +{ + eQMICATHighPriority_DoNotClearTheScreen = 0, + eQMICATHighPriority_ClearAnythingThatIsOnTheScreen = 1, +}; + +// Enum to describe QMI CAT Icon Is Displayed +enum eQMICATIconIsDisplayed:UINT8 +{ + eQMICATIconIsDisplayed_No = 0, + eQMICATIconIsDisplayed_Yes = 1, +}; + +// Enum to describe QMI CAT Icon Qualifier +enum eQMICATIconQualifier:UINT8 +{ + eQMICATIconQualifier_IconIsSelfExplanatory = 0, + eQMICATIconQualifier_IconIsNotSelfExplanatory = 1, +}; + +// Enum to describe QMI CAT Image Coding Scheme +enum eQMICATImageCodingScheme:UINT8 +{ + eQMICATImageCodingScheme_Unknown = 0, + eQMICATImageCodingScheme_Basic = 1, + eQMICATImageCodingScheme_Color = 2, +}; + +// Enum to describe QMI CAT Immediate Response +enum eQMICATImmediateResponse:UINT8 +{ + eQMICATImmediateResponse_No = 0, + eQMICATImmediateResponse_Yes = 1, +}; + +// Enum to describe QMI CAT Is CDMA SMS +enum eQMICATIsCDMASMS:UINT8 +{ + eQMICATIsCDMASMS_NotCDMASMS = 0, + eQMICATIsCDMASMS_CDMASMS = 1, +}; + +// Enum to describe QMI CAT Launch Mode +enum eQMICATLaunchMode:UINT8 +{ + eQMICATLaunchMode_LaunchIfNotAlreadyLaunched = 0, + eQMICATLaunchMode_UseTheExistingBrowser = 1, + eQMICATLaunchMode_CloseTheExistingBroswer = 2, +}; + +// Enum to describe QMI CAT Next Action +enum eQMICATNextAction:UINT8 +{ + eQMICATNextAction_SetupCall = 0, + eQMICATNextAction_SendSS = 1, + eQMICATNextAction_SendUSSD = 2, + eQMICATNextAction_SendShortMessage = 3, + eQMICATNextAction_LaunchBrowser = 4, + eQMICATNextAction_PlayTone = 5, + eQMICATNextAction_DisplayText = 6, + eQMICATNextAction_GetInkey = 7, + eQMICATNextAction_GetInput = 8, + eQMICATNextAction_SelectItem = 9, + eQMICATNextAction_SetupMenu = 10, + eQMICATNextAction_SetupIdleModeText = 11, + eQMICATNextAction_EndOfTheProactiveSession = 12, + eQMICATNextAction_ProvideLocalInformation = 13, +}; + +// Enum to describe QMI CAT Notification Required +enum eQMICATNotificationRequired:UINT8 +{ + eQMICATNotificationRequired_NotificationIsNotRequired = 0, + eQMICATNotificationRequired_NotificationIsRequired = 1, +}; + +// Enum to describe QMI CAT On Demand Link Establish +enum eQMICATOnDemandLinkEstablish:UINT8 +{ + eQMICATOnDemandLinkEstablish_LinkIsNotRequired = 0, + eQMICATOnDemandLinkEstablish_LinkIsRequired = 1, +}; + +// Enum to describe QMI CAT PDP Type +enum eQMICATPDPType:UINT8 +{ + eQMICATPDPType_IP = 2, +}; + +// Enum to describe QMI CAT Packet Data Protocol +enum eQMICATPacketDataProtocol:UINT8 +{ + eQMICATPacketDataProtocol_IP = 2, +}; + +// Enum to describe QMI CAT Packing Required +enum eQMICATPackingRequired:UINT8 +{ + eQMICATPackingRequired_PackingIsNotRequired = 0, + eQMICATPackingRequired_PackingIsRequired = 1, +}; + +// Enum to describe QMI CAT Presentation +enum eQMICATPresentation:UINT8 +{ + eQMICATPresentation_NotSpecified = 0, + eQMICATPresentation_DataValuePresentation = 1, + eQMICATPresentation_NavigationPresentation = 2, +}; + +// Enum to describe QMI CAT Proactive Session End Type +enum eQMICATProactiveSessionEndType:UINT8 +{ + eQMICATProactiveSessionEndType_EndProactiveSessionCommandReceivedFromTheCard = 1, + eQMICATProactiveSessionEndType_EndProactiveSessionInternalToME = 2, +}; + +// Enum to describe QMI CAT Redial Necessary +enum eQMICATRedialNecessary:UINT8 +{ + eQMICATRedialNecessary_RedialIsNotNecessary = 0, + eQMICATRedialNecessary_RedialIsNecessary = 1, +}; + +// Enum to describe QMI CAT Refresh Stage +enum eQMICATRefreshStage:UINT16 +{ + eQMICATRefreshStage_RefreshStart = 1, + eQMICATRefreshStage_RefreshSuccess = 2, + eQMICATRefreshStage_RefreshFailed = 3, +}; + +// Enum to describe QMI CAT Response Command +enum eQMICATResponseCommand:UINT8 +{ + eQMICATResponseCommand_DisplayText = 1, + eQMICATResponseCommand_GetInkey = 2, + eQMICATResponseCommand_GetInput = 3, + eQMICATResponseCommand_LaunchBrowser = 4, + eQMICATResponseCommand_PlayTone = 5, + eQMICATResponseCommand_SelectItemRequest = 6, + eQMICATResponseCommand_SetupMenu = 7, + eQMICATResponseCommand_SetupIdleText = 8, + eQMICATResponseCommand_ProvideLocalInformationLanguage = 9, + eQMICATResponseCommand_SetupEventUserActivity = 10, + eQMICATResponseCommand_SetupEventIdleScreenActivity = 11, + eQMICATResponseCommand_SetupEventLanguageSelectNotify = 12, + eQMICATResponseCommand_LanguageNotification = 13, +}; + +// Enum to describe QMI CAT Response Format +enum eQMICATResponseFormat:UINT8 +{ + eQMICATResponseFormat_SMSDefaultAlphabet = 0, + eQMICATResponseFormat_YesOrNo = 1, + eQMICATResponseFormat_NumericalOnly = 2, + eQMICATResponseFormat_UCS2 = 3, + eQMICATResponseFormat_ImmediateDigitResponse = 4, + eQMICATResponseFormat_YesOrNoOrImmediateDigitalResponse = 5, +}; + +// Enum to describe QMI CAT Response Packing Format +enum eQMICATResponsePackingFormat:UINT8 +{ + eQMICATResponsePackingFormat_UnpacketFormat = 0, + eQMICATResponsePackingFormat_PacketFormat = 1, +}; + +// Enum to describe QMI CAT Send Data Immediately +enum eQMICATSendDataImmediately:UINT8 +{ + eQMICATSendDataImmediately_NoStoreInTXBuffer = 0, + eQMICATSendDataImmediately_Yes = 1, +}; + +// Enum to describe QMI CAT Send Data Result +enum eQMICATSendDataResult:UINT8 +{ + eQMICATSendDataResult_Failed = 0, + eQMICATSendDataResult_Success = 1, +}; + +// Enum to describe QMI CAT Show User Input +enum eQMICATShowUserInput:UINT8 +{ + eQMICATShowUserInput_DeviceCanShowAllCharacters = 0, + eQMICATShowUserInput_DeviceCanShowUserInput = 1, +}; + +// Enum to describe QMI CAT Slot +enum eQMICATSlot:UINT8 +{ + eQMICATSlot_Slot1 = 1, + eQMICATSlot_Slot2 = 2, +}; + +// Enum to describe QMI CAT Softkey Selection +enum eQMICATSoftkeySelection:UINT8 +{ + eQMICATSoftkeySelection_SoftkeyIsNotSelected = 0, + eQMICATSoftkeySelection_SoftkeyIsSelected = 1, +}; + +// Enum to describe QMI CAT Specific Language Notfication +enum eQMICATSpecificLanguageNotfication:UINT8 +{ + eQMICATSpecificLanguageNotfication_No = 0, + eQMICATSpecificLanguageNotfication_Yes = 1, +}; + +// Enum to describe QMI CAT Time Units +enum eQMICATTimeUnits:UINT8 +{ + eQMICATTimeUnits_Minutes = 0, + eQMICATTimeUnits_Seconds = 1, + eQMICATTimeUnits_TenthsOfSeconds = 2, +}; + +// Enum to describe QMI CAT Tone +enum eQMICATTone:UINT8 +{ + eQMICATTone_DialTone = 1, + eQMICATTone_CalledSubscriberBusy = 2, + eQMICATTone_Congestion = 3, + eQMICATTone_RadioPathAck = 4, + eQMICATTone_RadioPathNotAvailableCallDrop = 5, + eQMICATTone_ErrorTone = 6, + eQMICATTone_CallWaitingTone = 7, + eQMICATTone_RingingTone = 8, + eQMICATTone_GeneralBeep = 9, + eQMICATTone_PositiveAckTone = 10, + eQMICATTone_NegativeAckTone = 11, + eQMICATTone_RingingToneSelectedByUser = 12, + eQMICATTone_SMSAlertToneSelectedByUser = 13, +}; + +// Enum to describe QMI CAT Traffic Class +enum eQMICATTrafficClass:UINT8 +{ + eQMICATTrafficClass_Conversational = 0, + eQMICATTrafficClass_Streaming = 1, + eQMICATTrafficClass_Interactive = 2, + eQMICATTrafficClass_Background = 3, + eQMICATTrafficClass_SubscribedValue = 4, +}; + +// Enum to describe QMI CAT Transport Protocol +enum eQMICATTransportProtocol:UINT8 +{ + eQMICATTransportProtocol_NotPresent = 0, + eQMICATTransportProtocol_UDP = 1, + eQMICATTransportProtocol_TCP = 2, +}; + +// Enum to describe QMI CAT USSD Data Coding Scheme +enum eQMICATUSSDDataCodingScheme:UINT8 +{ + eQMICATUSSDDataCodingScheme_7BitGSM = 0, + eQMICATUSSDDataCodingScheme_8BitGSM = 1, + eQMICATUSSDDataCodingScheme_8BitUCS2 = 2, + eQMICATUSSDDataCodingScheme_7BitUCS2 = 3, +}; + +// Enum to describe QMI CAT User Confirmed +enum eQMICATUserConfirmed:UINT8 +{ + eQMICATUserConfirmed_No = 0, + eQMICATUserConfirmed_Yes = 1, +}; + +// Enum to describe QMI CAT User Control +enum eQMICATUserControl:UINT8 +{ + eQMICATUserControl_DoNotAllowUserToClearTheScreen = 0, + eQMICATUserControl_AllowUserToClearTheScreen = 1, +}; + +// Enum to describe QMI CTL Driver Data Formats +enum eQMICTLDriverDataFormats +{ + eQMICTLDriverDataFormats_QoSFlowHeaderAbsent = 0, + eQMICTLDriverDataFormats_QoSFlowHeaderPresent = 1, +}; + +// Enum to describe QMI CTL Power Save States +enum eQMICTLPowerSaveStates +{ + eQMICTLPowerSaveStates_Normal = 0, + eQMICTLPowerSaveStates_Suspend = 1, + eQMICTLPowerSaveStates_Powerdown = 2, +}; + +// Enum to describe QMI CTL Service Types +enum eQMICTLServiceTypes +{ + eQMICTLServiceTypes_Control = 0, + eQMICTLServiceTypes_WDS = 1, + eQMICTLServiceTypes_DMS = 2, + eQMICTLServiceTypes_NAS = 3, + eQMICTLServiceTypes_QOS = 4, + eQMICTLServiceTypes_WMS = 5, + eQMICTLServiceTypes_PDS = 6, + eQMICTLServiceTypes_AUTH = 7, + eQMICTLServiceTypes_CAT = 224, + eQMICTLServiceTypes_RMS = 225, + eQMICTLServiceTypes_OMA = 226, +}; + +// Enum to describe QMI Call End Reasons +enum eQMICallEndReasons:UINT16 +{ + eQMICallEndReasons_Unknown = 0, + eQMICallEndReasons_Unspecified = 1, + eQMICallEndReasons_ClientEnd = 2, + eQMICallEndReasons_NoService = 3, + eQMICallEndReasons_Fade = 4, + eQMICallEndReasons_ReleaseNormal = 5, + eQMICallEndReasons_AccInProgress = 6, + eQMICallEndReasons_AccFailed = 7, + eQMICallEndReasons_RedirectOrHandoff = 8, + eQMICallEndReasons_CloseInProgress = 9, + eQMICallEndReasons_AuthenticationFailed = 10, + eQMICallEndReasons_InternalError = 11, + eQMICallEndReasons_CDMALock = 500, + eQMICallEndReasons_Intercept = 501, + eQMICallEndReasons_Reorder = 502, + eQMICallEndReasons_ReleaseServiceOptionRejected = 503, + eQMICallEndReasons_IncomingCall = 504, + eQMICallEndReasons_AlertStop = 505, + eQMICallEndReasons_Activation = 506, + eQMICallEndReasons_MaxAccessProbe = 507, + eQMICallEndReasons_CCSNotSupportedByBS = 508, + eQMICallEndReasons_NoResponseFromBS = 509, + eQMICallEndReasons_RejectedByBS = 510, + eQMICallEndReasons_Incompatible = 511, + eQMICallEndReasons_AlreadyInTC = 512, + eQMICallEndReasons_UserCallOrigDuringGPS = 513, + eQMICallEndReasons_UserCallOrigDuringSMS = 514, + eQMICallEndReasons_NoCDMAService = 515, + eQMICallEndReasons_ConfFailed = 1000, + eQMICallEndReasons_IncomingRejected = 1001, + eQMICallEndReasons_NoGWService = 1002, + eQMICallEndReasons_NetworkEnd = 1003, + eQMICallEndReasons_LLCOrSNDCPFailure = 1004, + eQMICallEndReasons_InsufficientResources = 1005, + eQMICallEndReasons_ServiceOptionOutOfOrder = 1006, + eQMICallEndReasons_NSAPIAlreadyUsed = 1007, + eQMICallEndReasons_RegularPDPContextDeactivation = 1008, + eQMICallEndReasons_NetworkFailure = 1009, + eQMICallEndReasons_ReactivationRequested = 1010, + eQMICallEndReasons_ProtocolError = 1011, + eQMICallEndReasons_OperatorDeterminedBarring = 1012, + eQMICallEndReasons_UnknownOrMissingAPN = 1013, + eQMICallEndReasons_UnknownPDPAddressOrPDPType = 1014, + eQMICallEndReasons_ActivationRejectedByGGSN = 1015, + eQMICallEndReasons_ActivationRejectedUnspecified = 1016, + eQMICallEndReasons_ServiceOptionNotSupported = 1017, + eQMICallEndReasons_RequestedServiceOptionNotSubscribed = 1018, + eQMICallEndReasons_QoSNotAccepted = 1019, + eQMICallEndReasons_SemanticErrorInTheTFTOperation = 1020, + eQMICallEndReasons_SyntacticalErrorInTheTFTOperation = 1021, + eQMICallEndReasons_UnknownPDPContext = 1022, + eQMICallEndReasons_SemanticErrorsInPacketFilters = 1023, + eQMICallEndReasons_SyntacticalErrorsInPacketFilters = 1024, + eQMICallEndReasons_PDPContextWithoutTFTAlreadyActivated = 1025, + eQMICallEndReasons_InvalidTransactionIdentifierValue = 1026, + eQMICallEndReasons_SemanticallyIncorrectMessage = 1027, + eQMICallEndReasons_InvalidMandatoryInformation = 1028, + eQMICallEndReasons_MessageTypeNonExistent = 1029, + eQMICallEndReasons_MessageNotCompatibleWithState = 1030, + eQMICallEndReasons_InformationElementNonexistent = 1031, + eQMICallEndReasons_ConditionalInformationElementError = 1032, + eQMICallEndReasons_MessageNotCompatibleWithProtocolState = 1033, + eQMICallEndReasons_APNRestrictionValueIncompatibleWithActivePDPContext = 1034, + eQMICallEndReasons_NoGPRSContextPresent = 1035, + eQMICallEndReasons_RequestedFeatureNotSupported = 1036, + eQMICallEndReasons_CDGenOrBusy = 1500, + eQMICallEndReasons_CDBillOrAuth = 1501, + eQMICallEndReasons_ChangeHDR = 1502, + eQMICallEndReasons_ExitHDR = 1503, + eQMICallEndReasons_HDRNoSession = 1504, + eQMICallEndReasons_HDROrigDuringGPSFix = 1505, + eQMICallEndReasons_HDRCSTimeout = 1506, + eQMICallEndReasons_HDRReleasedByCM = 1507, +}; + +// Enum to describe QMI Call History Types +enum eQMICallHistoryTypes:UINT8 +{ + eQMICallHistoryTypes_Full = 0, + eQMICallHistoryTypes_IDsOnly = 1, +}; + +// Enum to describe QMI Call Types +enum eQMICallTypes:UINT8 +{ + eQMICallTypes_NDIS = 0, + eQMICallTypes_DUN = 1, +}; + +// Enum to describe QMI Connection Status +enum eQMIConnectionStatus:UINT8 +{ + eQMIConnectionStatus_Disconnected = 1, + eQMIConnectionStatus_Connected = 2, + eQMIConnectionStatus_Suspended = 3, + eQMIConnectionStatus_Authenticating = 4, +}; + +// Enum to describe QMI DMS Activation States +enum eQMIDMSActivationStates:UINT16 +{ + eQMIDMSActivationStates_ServiceNotActivated = 0, + eQMIDMSActivationStates_SerivceActivated = 1, + eQMIDMSActivationStates_ActivationConnecting = 2, + eQMIDMSActivationStates_ActivationInProgress = 3, + eQMIDMSActivationStates_OTASPSecurityAuthenticated = 4, + eQMIDMSActivationStates_OTASPNAMDownloaded = 5, + eQMIDMSActivationStates_OTASPMDNDownloaded = 6, + eQMIDMSActivationStates_OTASPIMSIDownloaded = 7, + eQMIDMSActivationStates_OTASPPRLDownloaded = 8, + eQMIDMSActivationStates_OTASPSPCDownloaded = 9, + eQMIDMSActivationStates_OTASPSettingsCommitted = 10, +}; + +// Enum to describe QMI DMS Activation Types +enum eQMIDMSActivationTypes +{ + eQMIDMSActivationTypes_OTASP = 0, +}; + +// Enum to describe QMI DMS Data Service Capabilities 1 +enum eQMIDMSDataServiceCapabilities1:UINT8 +{ + eQMIDMSDataServiceCapabilities1_NoDataServicesSupported = 0, + eQMIDMSDataServiceCapabilities1_OnlyCircuitSwitched = 1, + eQMIDMSDataServiceCapabilities1_OnlyPacketSwitched = 2, + eQMIDMSDataServiceCapabilities1_SimultaneousCircuitPacketSwitched = 3, + eQMIDMSDataServiceCapabilities1_NonsimultaneousCircuitPacketSwitched = 4, +}; + +// Enum to describe QMI DMS Image Types +enum eQMIDMSImageTypes +{ + eQMIDMSImageTypes_Modem = 0, + eQMIDMSImageTypes_PRI = 1, +}; + +// Enum to describe QMI DMS Lock States +enum eQMIDMSLockStates:UINT8 +{ + eQMIDMSLockStates_LockDisabled = 0, + eQMIDMSLockStates_LockEnabled = 1, +}; + +// Enum to describe QMI DMS Operating Modes +enum eQMIDMSOperatingModes:UINT8 +{ + eQMIDMSOperatingModes_Online = 0, + eQMIDMSOperatingModes_LowPower = 1, + eQMIDMSOperatingModes_FactoryTestMode = 2, + eQMIDMSOperatingModes_Offline = 3, + eQMIDMSOperatingModes_Reset = 4, + eQMIDMSOperatingModes_Shutdown = 5, + eQMIDMSOperatingModes_PersistentLowPower = 6, + eQMIDMSOperatingModes_ModeOnlyLowPower = 7, +}; + +// Enum to describe QMI DMS PIN Status +enum eQMIDMSPINStatus:UINT8 +{ + eQMIDMSPINStatus_PINUninitialized = 0, + eQMIDMSPINStatus_PINEnabledUnverified = 1, + eQMIDMSPINStatus_PINEnabledVerified = 2, + eQMIDMSPINStatus_PINDisabled = 3, + eQMIDMSPINStatus_PINBlocked = 4, + eQMIDMSPINStatus_PINBlockedPermanently = 5, + eQMIDMSPINStatus_PINUnblocked = 6, + eQMIDMSPINStatus_PINChanged = 7, +}; + +// Enum to describe QMI DMS Power Sources +enum eQMIDMSPowerSources:UINT8 +{ + eQMIDMSPowerSources_Battery = 0, + eQMIDMSPowerSources_External = 1, +}; + +// Enum to describe QMI DMS Radio Interfaces +enum eQMIDMSRadioInterfaces:UINT8 +{ + eQMIDMSRadioInterfaces_CDMA20001x = 1, + eQMIDMSRadioInterfaces_CDMA2000HRPD = 2, + eQMIDMSRadioInterfaces_GSM = 4, + eQMIDMSRadioInterfaces_UMTS = 5, + eQMIDMSRadioInterfaces_LTE = 8, +}; + +// Enum to describe QMI DMS Time References +enum eQMIDMSTimeReferences:UINT32 +{ + eQMIDMSTimeReferences_User = 0, +}; + +// Enum to describe QMI DMS Timestamp Sources +enum eQMIDMSTimestampSources:UINT16 +{ + eQMIDMSTimestampSources_Device = 0, + eQMIDMSTimestampSources_CDMANetwork = 1, + eQMIDMSTimestampSources_CDMA1xEVDONetwork = 2, + eQMIDMSTimestampSources_GSMNetwork = 3, + eQMIDMSTimestampSources_WCDMANetwork = 4, + eQMIDMSTimestampSources_GPSNetwork = 5, + eQMIDMSTimestampSources_MFLONetwork = 6, +}; + +// Enum to describe QMI DMS UIM Facility +enum eQMIDMSUIMFacility:UINT8 +{ + eQMIDMSUIMFacility_PNNetworkPersonalization = 0, + eQMIDMSUIMFacility_PUNetworkSubsetPersonalization = 1, + eQMIDMSUIMFacility_PPServiceProviderPersonalization = 2, + eQMIDMSUIMFacility_PCCorporatePersonalization = 3, + eQMIDMSUIMFacility_PFUIMPersonalization = 4, +}; + +// Enum to describe QMI DMS UIM Facility States +enum eQMIDMSUIMFacilityStates:UINT8 +{ + eQMIDMSUIMFacilityStates_Deactivated = 0, + eQMIDMSUIMFacilityStates_Activated = 1, + eQMIDMSUIMFacilityStates_Block = 2, +}; + +// Enum to describe QMI DMS UIM States +enum eQMIDMSUIMStates:UINT8 +{ + eQMIDMSUIMStates_InitializationCompleted = 0, + eQMIDMSUIMStates_InitializationFailed = 1, + eQMIDMSUIMStates_NotPresent = 2, + eQMIDMSUIMStates_StateUnavailable = 255, +}; + +// Enum to describe QMI Data Bearer Technologies +enum eQMIDataBearerTechnologies:UINT8 +{ + eQMIDataBearerTechnologies_CDMA20001x = 1, + eQMIDataBearerTechnologies_CDMA20001xEVDORev0 = 2, + eQMIDataBearerTechnologies_GPRS = 3, + eQMIDataBearerTechnologies_WCDMA = 4, + eQMIDataBearerTechnologies_CDMA20001xEVDORevA = 5, + eQMIDataBearerTechnologies_EGPRS = 6, + eQMIDataBearerTechnologies_HSDPAWCDMA = 7, + eQMIDataBearerTechnologies_WCDMAHSUPA = 8, + eQMIDataBearerTechnologies_HSDPAHSUPA = 9, + eQMIDataBearerTechnologies_LTE = 10, + eQMIDataBearerTechnologies_CDMA2000EHRPD = 11, + eQMIDataBearerTechnologies_HSDPAPlusWCDMA = 12, + eQMIDataBearerTechnologies_HSDPAPlusHSUPA = 13, + eQMIDataBearerTechnologies_DualCellHSDPAPlusWCDMA = 14, + eQMIDataBearerTechnologies_DualCellHSDPAPlusHSUPA = 15, + eQMIDataBearerTechnologies_Unknown = 255, +}; + +// Enum to describe QMI Dormancy Status +enum eQMIDormancyStatus:UINT8 +{ + eQMIDormancyStatus_TrafficChannelDormant = 1, + eQMIDormancyStatus_TrafficChannelActive = 2, +}; + +// Enum to describe QMI Erroneous SDU Deliveries +enum eQMIErroneousSDUDeliveries:UINT8 +{ + eQMIErroneousSDUDeliveries_Subscribe = 0, + eQMIErroneousSDUDeliveries_NoDetection = 1, + eQMIErroneousSDUDeliveries_ErroneousSDUIsDelivered = 2, + eQMIErroneousSDUDeliveries_ErroneousSDUIsNotDelivered = 3, +}; + +// Enum to describe QMI Errors +enum eQMIErrors:UINT16 +{ + eQMIErrors_None = 0, + eQMIErrors_MalformedMessage = 1, + eQMIErrors_NoMemory = 2, + eQMIErrors_Internal = 3, + eQMIErrors_Aborted = 4, + eQMIErrors_ClientIDsExhausted = 5, + eQMIErrors_UnabortableTransaction = 6, + eQMIErrors_InvalidClientID = 7, + eQMIErrors_NoThresholdsProvided = 8, + eQMIErrors_InvalidHandle = 9, + eQMIErrors_InvalidProfile = 10, + eQMIErrors_InvalidPINID = 11, + eQMIErrors_IncorrectPIN = 12, + eQMIErrors_NoNetworkFound = 13, + eQMIErrors_CallFailed = 14, + eQMIErrors_OutOfCall = 15, + eQMIErrors_NotProvisioned = 16, + eQMIErrors_MissingArgument = 17, + eQMIErrors_ArgumentTooLong = 19, + eQMIErrors_InvalidTransactionID = 22, + eQMIErrors_DeviceInUse = 23, + eQMIErrors_NetworkUnsupported = 24, + eQMIErrors_DeviceUnsupported = 25, + eQMIErrors_NoEffect = 26, + eQMIErrors_NoFreeProfile = 27, + eQMIErrors_InvalidPDPType = 28, + eQMIErrors_InvalidTechnologyPreference = 29, + eQMIErrors_InvalidProfileType = 30, + eQMIErrors_InvalidServiceType = 31, + eQMIErrors_InvalidRegisterAction = 32, + eQMIErrors_InvalidPSAttachAction = 33, + eQMIErrors_AuthenticationFailed = 34, + eQMIErrors_PINBlocked = 35, + eQMIErrors_PINAlwaysBlocked = 36, + eQMIErrors_UIMUninitialized = 37, + eQMIErrors_MaximumQoSRequestsInUse = 38, + eQMIErrors_IncorrectFlowFilter = 39, + eQMIErrors_NetworkQoSUnaware = 40, + eQMIErrors_InvalidQoSID = 41, + eQMIErrors_QoSUnavailable = 42, + eQMIErrors_FlowSuspended = 43, + eQMIErrors_GeneralError = 46, + eQMIErrors_UnknownError = 47, + eQMIErrors_InvalidArgument = 48, + eQMIErrors_InvalidIndex = 49, + eQMIErrors_NoEntry = 50, + eQMIErrors_DeviceStorageFull = 51, + eQMIErrors_DeviceNotReady = 52, + eQMIErrors_NetworkNotReady = 53, + eQMIErrors_WMSCauseCode = 54, + eQMIErrors_WMSMessageNotSent = 55, + eQMIErrors_WMSMessageDeliveryFailure = 56, + eQMIErrors_WMSInvalidMessageID = 57, + eQMIErrors_WMSEncoding = 58, + eQMIErrors_AuthenticationLock = 59, + eQMIErrors_InvalidTransition = 60, + eQMIErrors_SessionInactive = 65, + eQMIErrors_SessionInvalid = 66, + eQMIErrors_SessionOwnership = 67, + eQMIErrors_InsufficientResources = 68, + eQMIErrors_Disabled = 69, + eQMIErrors_InvalidOperation = 70, + eQMIErrors_InvalidQMICommand = 71, + eQMIErrors_WMSTPDUType = 72, + eQMIErrors_WMSSMSCAddress = 73, + eQMIErrors_InformationUnavailable = 74, + eQMIErrors_SegmentTooLong = 75, + eQMIErrors_SegmentOrder = 76, + eQMIErrors_BundlingNotSupported = 77, + eQMIErrors_SIMFileNotFound = 80, + eQMIErrors_AccessDenied = 82, + eQMIErrors_HardwareRestricted = 83, + eQMIErrors_CATEventRegistrationFailed = 61441, + eQMIErrors_CATInvalidTerminalResponse = 61442, + eQMIErrors_CATInvalidEnvelopeCommand = 61443, + eQMIErrors_CATEnvelopeCommandBusy = 61444, + eQMIErrors_CATEnvelopeCommandFailed = 61445, +}; + +// Enum to describe QMI HA/AAA Key States +enum eQMIHAAAAKeyStates:UINT8 +{ + eQMIHAAAAKeyStates_Unset = 0, + eQMIHAAAAKeyStates_SetDefault = 1, + eQMIHAAAAKeyStates_SetModified = 2, +}; + +// Enum to describe QMI LOC Altitude Assumed +enum eQMILOCAltitudeAssumed:UINT32 +{ + eQMILOCAltitudeAssumed_AltitudeIsCalculated = 0, + eQMILOCAltitudeAssumed_AltitudeIsAssumed = 1, +}; + +// Enum to describe QMI LOC Altitude Source +enum eQMILOCAltitudeSource:UINT32 +{ + eQMILOCAltitudeSource_Unknown = 0, + eQMILOCAltitudeSource_GPS = 1, + eQMILOCAltitudeSource_CellID = 2, + eQMILOCAltitudeSource_EnhancedCellID = 3, + eQMILOCAltitudeSource_WiFi = 4, + eQMILOCAltitudeSource_Terrestrial = 5, + eQMILOCAltitudeSource_TirrestrialHybrid = 6, + eQMILOCAltitudeSource_AltitudeDatabase = 7, + eQMILOCAltitudeSource_BarometricAltimeter = 8, + eQMILOCAltitudeSource_Other = 9, +}; + +// Enum to describe QMI LOC Connection Request Type +enum eQMILOCConnectionRequestType +{ + eQMILOCConnectionRequestType_Open = 1, + eQMILOCConnectionRequestType_Close = 2, +}; + +// Enum to describe QMI LOC Connection Status +enum eQMILOCConnectionStatus:UINT32 +{ + eQMILOCConnectionStatus_Success = 1, + eQMILOCConnectionStatus_Failure = 2, +}; + +// Enum to describe QMI LOC Control Mode +enum eQMILOCControlMode:UINT32 +{ + eQMILOCControlMode_Automatic = 0, + eQMILOCControlMode_Forced = 1, +}; + +// Enum to describe QMI LOC Coverage +enum eQMILOCCoverage:UINT32 +{ + eQMILOCCoverage_NotSpecified = 0, + eQMILOCCoverage_Point = 1, + eQMILOCCoverage_Full = 2, +}; + +// Enum to describe QMI LOC Cradle Mount State +enum eQMILOCCradleMountState:UINT32 +{ + eQMILOCCradleMountState_NotMounted = 0, + eQMILOCCradleMountState_Mounted = 1, + eQMILOCCradleMountState_Unknown = 2, +}; + +// Enum to describe QMI LOC Data Coding Scheme +enum eQMILOCDataCodingScheme:UINT32 +{ + eQMILOCDataCodingScheme_German = 12, + eQMILOCDataCodingScheme_English = 13, + eQMILOCDataCodingScheme_Italian = 14, + eQMILOCDataCodingScheme_French = 15, + eQMILOCDataCodingScheme_Spanish = 16, + eQMILOCDataCodingScheme_Dutch = 17, + eQMILOCDataCodingScheme_Swedish = 18, + eQMILOCDataCodingScheme_Danish = 19, + eQMILOCDataCodingScheme_Portuguese = 20, + eQMILOCDataCodingScheme_Finnish = 21, + eQMILOCDataCodingScheme_Norwegian = 22, + eQMILOCDataCodingScheme_Greek = 23, + eQMILOCDataCodingScheme_Turkish = 24, + eQMILOCDataCodingScheme_Hungarian = 25, + eQMILOCDataCodingScheme_Polish = 26, + eQMILOCDataCodingScheme_Unspecified = 27, + eQMILOCDataCodingScheme_UTF8 = 28, + eQMILOCDataCodingScheme_UCS2 = 29, + eQMILOCDataCodingScheme_GSMDefault = 30, +}; + +// Enum to describe QMI LOC Encoding Scheme +enum eQMILOCEncodingScheme:UINT32 +{ + eQMILOCEncodingScheme_Octet = 0, + eQMILOCEncodingScheme_EXNProtocolMessage = 1, + eQMILOCEncodingScheme_ASCII = 2, + eQMILOCEncodingScheme_IA5 = 3, + eQMILOCEncodingScheme_Unicode = 4, + eQMILOCEncodingScheme_ShiftJIS = 5, + eQMILOCEncodingScheme_Korean = 6, + eQMILOCEncodingScheme_LatinHebrew = 7, + eQMILOCEncodingScheme_Latin = 8, + eQMILOCEncodingScheme_GSM = 9, +}; + +// Enum to describe QMI LOC Engine State +enum eQMILOCEngineState +{ + eQMILOCEngineState_On = 1, + eQMILOCEngineState_Off = 2, +}; + +// Enum to describe QMI LOC Fix Recurrence Type +enum eQMILOCFixRecurrenceType:UINT32 +{ + eQMILOCFixRecurrenceType_RequestPeriodicFixes = 1, + eQMILOCFixRecurrenceType_RequestSingleFix = 2, +}; + +// Enum to describe QMI LOC Format Type +enum eQMILOCFormatType:UINT32 +{ + eQMILOCFormatType_LogicalName = 0, + eQMILOCFormatType_EmailAddress = 1, + eQMILOCFormatType_MSISDN = 2, + eQMILOCFormatType_URL = 3, + eQMILOCFormatType_SIPURL = 4, + eQMILOCFormatType_MIN = 5, + eQMILOCFormatType_MDN = 6, + eQMILOCFormatType_IMSPublicIdentity = 7, + eQMILOCFormatType_OSSUnknown = 2147483647, +}; + +// Enum to describe QMI LOC Health Status +enum eQMILOCHealthStatus:UINT8 +{ + eQMILOCHealthStatus_Unhealthy = 0, + eQMILOCHealthStatus_Healthy = 1, +}; + +// Enum to describe QMI LOC Horizontal Accuracy +enum eQMILOCHorizontalAccuracy:UINT32 +{ + eQMILOCHorizontalAccuracy_Low = 1, + eQMILOCHorizontalAccuracy_Medium = 2, + eQMILOCHorizontalAccuracy_High = 3, +}; + +// Enum to describe QMI LOC Intermediate Report State +enum eQMILOCIntermediateReportState:UINT32 +{ + eQMILOCIntermediateReportState_Enable = 1, + eQMILOCIntermediateReportState_Disable = 2, +}; + +// Enum to describe QMI LOC Linkage +enum eQMILOCLinkage:UINT32 +{ + eQMILOCLinkage_NotSpecified = 0, + eQMILOCLinkage_FullyInterdependent = 1, + eQMILOCLinkage_DependsOnLatLong = 2, + eQMILOCLinkage_FullyIndependent = 3, +}; + +// Enum to describe QMI LOC Location Server Type +enum eQMILOCLocationServerType:UINT32 +{ + eQMILOCLocationServerType_CDMAPDE = 1, + eQMILOCLocationServerType_CDMAMPC = 2, + eQMILOCLocationServerType_UMTSSLP = 3, + eQMILOCLocationServerType_CustomPDE = 4, +}; + +// Enum to describe QMI LOC Location Type +enum eQMILOCLocationType:UINT32 +{ + eQMILOCLocationType_CurrentLocation = 1, + eQMILOCLocationType_CurrentOrLastKnownLocation = 2, + eQMILOCLocationType_InitialLocation = 4, +}; + +// Enum to describe QMI LOC Lock Type +enum eQMILOCLockType:UINT32 +{ + eQMILOCLockType_LockNone = 1, + eQMILOCLockType_LockMI = 2, + eQMILOCLockType_LockMT = 3, + eQMILOCLockType_LockAll = 4, +}; + +// Enum to describe QMI LOC Notification Type +enum eQMILOCNotificationType:UINT32 +{ + eQMILOCNotificationType_NoNotifyOrVerify = 1, + eQMILOCNotificationType_NotifyOnly = 2, + eQMILOCNotificationType_AllowNoResponse = 3, + eQMILOCNotificationType_ResponseRequired = 4, + eQMILOCNotificationType_PrivacyOverride = 5, +}; + +// Enum to describe QMI LOC Operation Mode +enum eQMILOCOperationMode:UINT32 +{ + eQMILOCOperationMode_Default = 1, + eQMILOCOperationMode_MSB = 2, + eQMILOCOperationMode_MSA = 3, + eQMILOCOperationMode_StandAlone = 4, + eQMILOCOperationMode_CellID = 5, +}; + +// Enum to describe QMI LOC Orbits Format Type +enum eQMILOCOrbitsFormatType:UINT32 +{ + eQMILOCOrbitsFormatType_PredictedOrbitsXTRA = 0, +}; + +// Enum to describe QMI LOC PDN Type +enum eQMILOCPDNType:UINT32 +{ + eQMILOCPDNType_IPv4 = 1, + eQMILOCPDNType_IPv6 = 2, + eQMILOCPDNType_IPv4OrIPv6 = 3, + eQMILOCPDNType_PPP = 4, +}; + +// Enum to describe QMI LOC Position +enum eQMILOCPosition:UINT32 +{ + eQMILOCPosition_AGPSSetAssisted = 1, + eQMILOCPosition_AGPSSetBased = 2, + eQMILOCPosition_AGPSSetAssistedPreference = 3, + eQMILOCPosition_AGPSSetBasedPreference = 4, + eQMILOCPosition_AutonomousGPS = 5, + eQMILOCPosition_AFLT = 6, + eQMILOCPosition_ECID = 7, + eQMILOCPosition_EOTD = 8, + eQMILOCPosition_OTDOA = 9, + eQMILOCPosition_NoPosition = 10, +}; + +// Enum to describe QMI LOC Position Mode +enum eQMILOCPositionMode:UINT32 +{ + eQMILOCPositionMode_AssistedOnly = 1, + eQMILOCPositionMode_BasedOnly = 2, + eQMILOCPositionMode_AssistedPreferredBasedAllowed = 3, + eQMILOCPositionMode_BasedPreferredAssistedAllowed = 4, +}; + +// Enum to describe QMI LOC Power State +enum eQMILOCPowerState:UINT32 +{ + eQMILOCPowerState_NotConnected = 0, + eQMILOCPowerState_Connected = 1, + eQMILOCPowerState_Unknown = 2, +}; + +// Enum to describe QMI LOC Reliability +enum eQMILOCReliability:UINT32 +{ + eQMILOCReliability_NotSet = 0, + eQMILOCReliability_VeryLow = 1, + eQMILOCReliability_Low = 2, + eQMILOCReliability_Medium = 3, + eQMILOCReliability_High = 4, +}; + +// Enum to describe QMI LOC Request Type +enum eQMILOCRequestType:UINT32 +{ + eQMILOCRequestType_StartPeriodicHighFrequencyFixes = 0, + eQMILOCRequestType_StartPeriodicKeepWarmFixes = 1, + eQMILOCRequestType_StopPeriodicFixes = 2, +}; + +// Enum to describe QMI LOC SUPL Version +enum eQMILOCSUPLVersion:UINT32 +{ + eQMILOCSUPLVersion_10 = 1, + eQMILOCSUPLVersion_20 = 2, +}; + +// Enum to describe QMI LOC Satellite Status +enum eQMILOCSatelliteStatus:UINT32 +{ + eQMILOCSatelliteStatus_Idle = 1, + eQMILOCSatelliteStatus_Searching = 2, + eQMILOCSatelliteStatus_Tracking = 3, +}; + +// Enum to describe QMI LOC Sensor Usage +enum eQMILOCSensorUsage:UINT32 +{ + eQMILOCSensorUsage_SensorUseEnabled = 0, + eQMILOCSensorUsage_SensorUseDisabled = 1, +}; + +// Enum to describe QMI LOC Service Interaction Type +enum eQMILOCServiceInteractionType:UINT32 +{ + eQMILOCServiceInteractionType_OngoingNIIncomingMO = 1, +}; + +// Enum to describe QMI LOC Session State +enum eQMILOCSessionState:UINT32 +{ + eQMILOCSessionState_Started = 1, + eQMILOCSessionState_Finished = 2, +}; + +// Enum to describe QMI LOC Session Status +enum eQMILOCSessionStatus:UINT32 +{ + eQMILOCSessionStatus_Success = 0, + eQMILOCSessionStatus_InProgress = 1, + eQMILOCSessionStatus_GeneralFailure = 2, + eQMILOCSessionStatus_Timeout = 3, + eQMILOCSessionStatus_UserEnded = 4, + eQMILOCSessionStatus_BadParameter = 5, + eQMILOCSessionStatus_PhoneOffline = 6, + eQMILOCSessionStatus_EngineLocked = 7, +}; + +// Enum to describe QMI LOC Stationary Status +enum eQMILOCStationaryStatus +{ + eQMILOCStationaryStatus_DeviceIsNotStationary = 0, + eQMILOCStationaryStatus_DeviceIsStationary = 1, +}; + +// Enum to describe QMI LOC Status +enum eQMILOCStatus +{ + eQMILOCStatus_Success = 0, + eQMILOCStatus_GeneralFailure = 1, + eQMILOCStatus_Unsupported = 2, + eQMILOCStatus_InvalidParameter = 3, + eQMILOCStatus_EngineBusy = 4, + eQMILOCStatus_PhoneOffline = 5, + eQMILOCStatus_Timeout = 6, +}; + +// Enum to describe QMI LOC System +enum eQMILOCSystem:UINT32 +{ + eQMILOCSystem_GlobalPositioningSystem = 1, + eQMILOCSystem_Galileo = 2, + eQMILOCSystem_SatelliteBasedAugmentationSystem = 3, + eQMILOCSystem_COMPASS = 4, + eQMILOCSystem_GLONASS = 5, +}; + +// Enum to describe QMI LOC Time Source +enum eQMILOCTimeSource:UINT32 +{ + eQMILOCTimeSource_Invalid = 0, + eQMILOCTimeSource_NetworkTimeTransfer = 1, + eQMILOCTimeSource_NetworkTimeTagging = 2, + eQMILOCTimeSource_ExternalInput = 3, + eQMILOCTimeSource_TOWDecode = 4, + eQMILOCTimeSource_TOWConfirmed = 5, + eQMILOCTimeSource_TOWAndWeekConfirmed = 6, + eQMILOCTimeSource_NavigationSolution = 7, + eQMILOCTimeSource_SolveForTime = 8, +}; + +// Enum to describe QMI LOC User Response +enum eQMILOCUserResponse:UINT32 +{ + eQMILOCUserResponse_Accept = 1, + eQMILOCUserResponse_Deny = 2, + eQMILOCUserResponse_NoResponse = 3, +}; + +// Enum to describe QMI LOC VX Version +enum eQMILOCVXVersion:UINT32 +{ + eQMILOCVXVersion_V1Only = 1, + eQMILOCVXVersion_V2Only = 2, +}; + +// Enum to describe QMI LOC WWAN Type +enum eQMILOCWWANType:UINT32 +{ + eQMILOCWWANType_Internet = 0, + eQMILOCWWANType_AGNSS = 1, +}; + +// Enum to describe QMI LOC Wi-Fi Fix Error Code +enum eQMILOCWiFiFixErrorCode:UINT32 +{ + eQMILOCWiFiFixErrorCode_Success = 0, + eQMILOCWiFiFixErrorCode_WiFiNotAvailable = 1, + eQMILOCWiFiFixErrorCode_NoAccessPointsFound = 2, + eQMILOCWiFiFixErrorCode_Unauthorized = 3, + eQMILOCWiFiFixErrorCode_ServerUnavailable = 4, + eQMILOCWiFiFixErrorCode_LocationCannotBeDetermined = 5, + eQMILOCWiFiFixErrorCode_Unknown = 6, +}; + +// Enum to describe QMI LOC Wi-Fi Status +enum eQMILOCWiFiStatus:UINT32 +{ + eQMILOCWiFiStatus_Available = 1, + eQMILOCWiFiStatus_Unavailable = 2, +}; + +// Enum to describe QMI Mobile IP Modes +enum eQMIMobileIPModes:UINT8 +{ + eQMIMobileIPModes_MIPOffSimpleIPOnly = 0, + eQMIMobileIPModes_MIPPreferred = 1, + eQMIMobileIPModes_MIPOnly = 2, +}; + +// Enum to describe QMI NAS AN-AAA Authentication Status +enum eQMINASANAAAAuthenticationStatus:UINT8 +{ + eQMINASANAAAAuthenticationStatus_AuthenticationFailed = 0, + eQMINASANAAAAuthenticationStatus_AuthenticationSuccess = 1, + eQMINASANAAAAuthenticationStatus_NoAuthenticationRequested = 2, +}; + +// Enum to describe QMI NAS Acquisition Order +enum eQMINASAcquisitionOrder:UINT32 +{ + eQMINASAcquisitionOrder_Automatic = 0, + eQMINASAcquisitionOrder_GSMThenWCDMA = 1, + eQMINASAcquisitionOrder_WCDMAThenGSM = 2, +}; + +// Enum to describe QMI NAS Active Subscription +enum eQMINASActiveSubscription:UINT8 +{ + eQMINASActiveSubscription_NotActive = 0, + eQMINASActiveSubscription_Active = 1, +}; + +// Enum to describe QMI NAS Band Classes +enum eQMINASBandClasses:UINT16 +{ + eQMINASBandClasses_CDMABandClass0 = 0, + eQMINASBandClasses_CDMABandClass1 = 1, + eQMINASBandClasses_CDMABandClass3 = 3, + eQMINASBandClasses_CDMABandClass4 = 4, + eQMINASBandClasses_CDMABandClass5 = 5, + eQMINASBandClasses_CDMABandClass6 = 6, + eQMINASBandClasses_CDMABandClass7 = 7, + eQMINASBandClasses_CDMABandClass8 = 8, + eQMINASBandClasses_CDMABandClass9 = 9, + eQMINASBandClasses_CDMABandClass10 = 10, + eQMINASBandClasses_CDMABandClass11 = 11, + eQMINASBandClasses_CDMABandClass12 = 12, + eQMINASBandClasses_CDMABandClass13 = 13, + eQMINASBandClasses_CDMABandClass14 = 14, + eQMINASBandClasses_CDMABandClass15 = 15, + eQMINASBandClasses_CDMABandClass16 = 16, + eQMINASBandClasses_CDMABandClass17 = 17, + eQMINASBandClasses_CDMABandClass18 = 18, + eQMINASBandClasses_CDMABandClass19 = 19, + eQMINASBandClasses_GSM450 = 40, + eQMINASBandClasses_GSM480 = 41, + eQMINASBandClasses_GSM750 = 42, + eQMINASBandClasses_GSM850 = 43, + eQMINASBandClasses_GSM900Extended = 44, + eQMINASBandClasses_GSM900Primary = 45, + eQMINASBandClasses_GSM900Railways = 46, + eQMINASBandClasses_GSM1800 = 47, + eQMINASBandClasses_GSM1900 = 48, + eQMINASBandClasses_WCDMA2100 = 80, + eQMINASBandClasses_WCDMAPCS1900 = 81, + eQMINASBandClasses_WCDMADCS1800 = 82, + eQMINASBandClasses_WCDMA1700US = 83, + eQMINASBandClasses_WCDMA850 = 84, + eQMINASBandClasses_WCDMA800 = 85, + eQMINASBandClasses_WCDMA2600 = 86, + eQMINASBandClasses_WCDMA900 = 87, + eQMINASBandClasses_WCDMA1700Japan = 88, + eQMINASBandClasses_WCDMA1500Japan = 90, + eQMINASBandClasses_WCDMA850Japan = 91, + eQMINASBandClasses_EUTRABand1 = 120, + eQMINASBandClasses_EUTRABand2 = 121, + eQMINASBandClasses_EUTRABand3 = 122, + eQMINASBandClasses_EUTRABand4 = 123, + eQMINASBandClasses_EUTRABand5 = 124, + eQMINASBandClasses_EUTRABand6 = 125, + eQMINASBandClasses_EUTRABand7 = 126, + eQMINASBandClasses_EUTRABand8 = 127, + eQMINASBandClasses_EUTRABand9 = 128, + eQMINASBandClasses_EUTRABand10 = 129, + eQMINASBandClasses_EUTRABand11 = 130, + eQMINASBandClasses_EUTRABand12 = 131, + eQMINASBandClasses_EUTRABand13 = 132, + eQMINASBandClasses_EUTRABand14 = 133, + eQMINASBandClasses_EUTRABand17 = 134, + eQMINASBandClasses_EUTRABand33 = 135, + eQMINASBandClasses_EUTRABand34 = 136, + eQMINASBandClasses_EUTRABand35 = 137, + eQMINASBandClasses_EUTRABand36 = 138, + eQMINASBandClasses_EUTRABand37 = 139, + eQMINASBandClasses_EUTRABand38 = 140, + eQMINASBandClasses_EUTRABand39 = 141, + eQMINASBandClasses_EUTRABand40 = 142, + eQMINASBandClasses_EUTRABand18 = 143, + eQMINASBandClasses_EUTRABand19 = 144, + eQMINASBandClasses_EUTRABand20 = 145, + eQMINASBandClasses_EUTRABand21 = 146, +}; + +// Enum to describe QMI NAS CDMA 1xEV-DO Active Protocol +enum eQMINASCDMA1xEVDOActiveProtocol:UINT8 +{ + eQMINASCDMA1xEVDOActiveProtocol_None = 0, + eQMINASCDMA1xEVDOActiveProtocol_CDMA1xEVDORel0 = 2, + eQMINASCDMA1xEVDOActiveProtocol_CDMA1xEVDORelA = 3, + eQMINASCDMA1xEVDOActiveProtocol_CDMA1xEVDORelB = 4, +}; + +// Enum to describe QMI NAS CDMA 1xEV-DO Hybrid Information +enum eQMINASCDMA1xEVDOHybridInformation:UINT8 +{ + eQMINASCDMA1xEVDOHybridInformation_SystemIsNotHybrid = 0, + eQMINASCDMA1xEVDOHybridInformation_SystemIsHybrid = 1, +}; + +// Enum to describe QMI NAS CDMA 1xEV-DO Personality +enum eQMINASCDMA1xEVDOPersonality:UINT8 +{ + eQMINASCDMA1xEVDOPersonality_Unknown = 0, + eQMINASCDMA1xEVDOPersonality_HRPD = 1, + eQMINASCDMA1xEVDOPersonality_EHRPD = 2, +}; + +// Enum to describe QMI NAS CS/PS Attach States +enum eQMINASCSPSAttachStates:UINT8 +{ + eQMINASCSPSAttachStates_UnknownNotApplicable = 0, + eQMINASCSPSAttachStates_Attached = 1, + eQMINASCSPSAttachStates_Detached = 2, +}; + +// Enum to describe QMI NAS Call Barring Status +enum eQMINASCallBarringStatus:UINT32 +{ + eQMINASCallBarringStatus_Unknown = 4294967295u, + eQMINASCallBarringStatus_NormalCallsOnly = 0, + eQMINASCallBarringStatus_EmergencyCallsOnly = 1, + eQMINASCallBarringStatus_NoCalls = 2, + eQMINASCallBarringStatus_AllCalls = 3, +}; + +// Enum to describe QMI NAS Cell Broadcast Caps +enum eQMINASCellBroadcastCaps:UINT32 +{ + eQMINASCellBroadcastCaps_Unknown = 0, + eQMINASCellBroadcastCaps_NotSupported = 1, + eQMINASCellBroadcastCaps_Supported = 2, +}; + +// Enum to describe QMI NAS Change Duration +enum eQMINASChangeDuration:UINT8 +{ + eQMINASChangeDuration_PowerCycle = 0, + eQMINASChangeDuration_Permanent = 1, +}; + +// Enum to describe QMI NAS Concurrent Service +enum eQMINASConcurrentService:UINT8 +{ + eQMINASConcurrentService_NotAvailable = 0, + eQMINASConcurrentService_Available = 1, +}; + +// Enum to describe QMI NAS Concurrent Service Supported +enum eQMINASConcurrentServiceSupported:UINT8 +{ + eQMINASConcurrentServiceSupported_NotSupported = 0, + eQMINASConcurrentServiceSupported_Supported = 1, +}; + +// Enum to describe QMI NAS DDTM Preferences +enum eQMINASDDTMPreferences:UINT8 +{ + eQMINASDDTMPreferences_Off = 0, + eQMINASDDTMPreferences_On = 1, + eQMINASDDTMPreferences_NoChange = 2, +}; + +// Enum to describe QMI NAS DTM Support +enum eQMINASDTMSupport:UINT8 +{ + eQMINASDTMSupport_NotAvailable = 0, + eQMINASDTMSupport_Available = 1, +}; + +// Enum to describe QMI NAS Data Service Capabilities 2 +enum eQMINASDataServiceCapabilities2:UINT8 +{ + eQMINASDataServiceCapabilities2_GPRS = 1, + eQMINASDataServiceCapabilities2_EGPRS = 2, + eQMINASDataServiceCapabilities2_HSDPA = 3, + eQMINASDataServiceCapabilities2_HSUPA = 4, + eQMINASDataServiceCapabilities2_WCDMA = 5, + eQMINASDataServiceCapabilities2_CDMA = 6, + eQMINASDataServiceCapabilities2_CDMA1xEVDORev0 = 7, + eQMINASDataServiceCapabilities2_CDMA1xEVDORevA = 8, + eQMINASDataServiceCapabilities2_GSM = 9, + eQMINASDataServiceCapabilities2_CDMA1xEVDORevB = 10, + eQMINASDataServiceCapabilities2_LTE = 11, + eQMINASDataServiceCapabilities2_HSDPAPlus = 12, + eQMINASDataServiceCapabilities2_DCHSDPAPlus = 13, +}; + +// Enum to describe QMI NAS Day Of Week +enum eQMINASDayOfWeek:UINT8 +{ + eQMINASDayOfWeek_Monday = 0, + eQMINASDayOfWeek_Tuesday = 1, + eQMINASDayOfWeek_Wednesday = 2, + eQMINASDayOfWeek_Thursday = 3, + eQMINASDayOfWeek_Friday = 4, + eQMINASDayOfWeek_Saturday = 5, + eQMINASDayOfWeek_Sunday = 6, +}; + +// Enum to describe QMI NAS Daylight Savings Adjustment +enum eQMINASDaylightSavingsAdjustment:UINT8 +{ + eQMINASDaylightSavingsAdjustment_NoAdjustment = 0, + eQMINASDaylightSavingsAdjustment_1HourAdjustment = 1, + eQMINASDaylightSavingsAdjustment_2HourAdjustment = 2, +}; + +// Enum to describe QMI NAS Dual Transfer Mode +enum eQMINASDualTransferMode:UINT8 +{ + eQMINASDualTransferMode_DTMNotSupported = 0, + eQMINASDualTransferMode_DTMSupported = 1, +}; + +// Enum to describe QMI NAS EGPRS Support +enum eQMINASEGPRSSupport:UINT8 +{ + eQMINASEGPRSSupport_NotAvailable = 0, + eQMINASEGPRSSupport_Available = 1, +}; + +// Enum to describe QMI NAS EV-DO Session Close Reasons +enum eQMINASEVDOSessionCloseReasons:UINT32 +{ + eQMINASEVDOSessionCloseReasons_ReacquiredNewNetwork = 0, + eQMINASEVDOSessionCloseReasons_UATIResponseTimeout = 1, + eQMINASEVDOSessionCloseReasons_KeepAliveTimerExpired = 2, + eQMINASEVDOSessionCloseReasons_InternalDeactivation = 3, + eQMINASEVDOSessionCloseReasons_ReceivedSessionCloseFromAN = 4, + eQMINASEVDOSessionCloseReasons_ConnectionOpenFailure = 5, + eQMINASEVDOSessionCloseReasons_ConfigurationRequestFailure = 6, + eQMINASEVDOSessionCloseReasons_ConfigurationResponseFailure = 7, + eQMINASEVDOSessionCloseReasons_ProtocolNegotiationFailure = 8, + eQMINASEVDOSessionCloseReasons_ANInitSetupTimerExpired = 9, + eQMINASEVDOSessionCloseReasons_ANInitConnectionClosed = 10, + eQMINASEVDOSessionCloseReasons_ConnectionDenyReceived = 11, + eQMINASEVDOSessionCloseReasons_SilentDeactivation = 12, + eQMINASEVDOSessionCloseReasons_NewESN = 13, + eQMINASEVDOSessionCloseReasons_ANGUAP = 14, + eQMINASEVDOSessionCloseReasons_InvalidPersonalityIndex = 15, + eQMINASEVDOSessionCloseReasons_UATINotMaintained = 16, + eQMINASEVDOSessionCloseReasons_NewNAI = 17, + eQMINASEVDOSessionCloseReasons_EHRPDCredentialsChanged = 18, +}; + +// Enum to describe QMI NAS Forbidden States +enum eQMINASForbiddenStates:UINT8 +{ + eQMINASForbiddenStates_Unknown = 0, + eQMINASForbiddenStates_Forbidden = 1, + eQMINASForbiddenStates_NotForbidden = 2, +}; + +// Enum to describe QMI NAS Force CDMA 1xEV-DO SCP +enum eQMINASForceCDMA1xEVDOSCP:UINT8 +{ + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORev0Only = 0, + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORevAWithMFPA = 1, + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORevAWithMFPAAndEMPA = 2, + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORevBWithMMPA = 3, + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORevAWithEHRPD = 4, + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORevBWithEHRPD = 5, +}; + +// Enum to describe QMI NAS High Speed Call Status +enum eQMINASHighSpeedCallStatus:UINT8 +{ + eQMINASHighSpeedCallStatus_HSDPAAndHSUPANotSupported = 0, + eQMINASHighSpeedCallStatus_HSDPASupported = 1, + eQMINASHighSpeedCallStatus_HSUPASupported = 2, + eQMINASHighSpeedCallStatus_HSDPAAndHSUPASupported = 3, + eQMINASHighSpeedCallStatus_HSDPAPlusSupported = 4, + eQMINASHighSpeedCallStatus_HSDPAPlusAndHSUPASupported = 5, + eQMINASHighSpeedCallStatus_DualCellHSDPAPlusSupported = 6, + eQMINASHighSpeedCallStatus_DualCellHSDPAPlusAndHSUPASupported = 7, +}; + +// Enum to describe QMI NAS In Use States +enum eQMINASInUseStates:UINT8 +{ + eQMINASInUseStates_Unknown = 0, + eQMINASInUseStates_CurrentServing = 1, + eQMINASInUseStates_Available = 2, +}; + +// Enum to describe QMI NAS LTE Signal Rates +enum eQMINASLTESignalRates:UINT8 +{ + eQMINASLTESignalRates_Default = 0, + eQMINASLTESignalRates_EverySecond = 1, + eQMINASLTESignalRates_Every2Seconds = 2, + eQMINASLTESignalRates_Every3Seconds = 3, + eQMINASLTESignalRates_Every4Seconds = 4, + eQMINASLTESignalRates_Every5Seconds = 5, +}; + +// Enum to describe QMI NAS Network Description Displays +enum eQMINASNetworkDescriptionDisplays:UINT8 +{ + eQMINASNetworkDescriptionDisplays_DoNotDisplay = 0, + eQMINASNetworkDescriptionDisplays_Display = 1, + eQMINASNetworkDescriptionDisplays_Unknown = 255, +}; + +// Enum to describe QMI NAS Network Description Encodings +enum eQMINASNetworkDescriptionEncodings:UINT8 +{ + eQMINASNetworkDescriptionEncodings_UnspecifiedOctet = 0, + eQMINASNetworkDescriptionEncodings_ExtendedProtocolMessage = 1, + eQMINASNetworkDescriptionEncodings_7BitASCII = 2, + eQMINASNetworkDescriptionEncodings_IA5 = 3, + eQMINASNetworkDescriptionEncodings_UNICODE = 4, + eQMINASNetworkDescriptionEncodings_ShiftJIS = 5, + eQMINASNetworkDescriptionEncodings_Korean = 6, + eQMINASNetworkDescriptionEncodings_LatinHebrew = 7, + eQMINASNetworkDescriptionEncodings_Latin = 8, + eQMINASNetworkDescriptionEncodings_GSM7Bit = 9, + eQMINASNetworkDescriptionEncodings_GSMDCS = 10, +}; + +// Enum to describe QMI NAS Network Selection +enum eQMINASNetworkSelection:INT8 +{ + eQMINASNetworkSelection_AutomaticRegistration = 0, + eQMINASNetworkSelection_ManualRegistration = 1, +}; + +// Enum to describe QMI NAS PLMN Name Country Initials +enum eQMINASPLMNNameCountryInitials:UINT8 +{ + eQMINASPLMNNameCountryInitials_DoNotAddCountryInitials = 0, + eQMINASPLMNNameCountryInitials_AddCountryInitials = 1, + eQMINASPLMNNameCountryInitials_Unspecified = 255, +}; + +// Enum to describe QMI NAS PLMN Name Encoding Schemes +enum eQMINASPLMNNameEncodingSchemes:UINT8 +{ + eQMINASPLMNNameEncodingSchemes_ASCII = 0, + eQMINASPLMNNameEncodingSchemes_UCS2LE = 1, +}; + +// Enum to describe QMI NAS PLMN Name Spare Bits +enum eQMINASPLMNNameSpareBits:UINT8 +{ + eQMINASPLMNNameSpareBits_Unknown = 0, + eQMINASPLMNNameSpareBits_Bit8 = 1, + eQMINASPLMNNameSpareBits_Bits78 = 2, + eQMINASPLMNNameSpareBits_Bits68 = 3, + eQMINASPLMNNameSpareBits_Bits58 = 4, + eQMINASPLMNNameSpareBits_Bits48 = 5, + eQMINASPLMNNameSpareBits_Bits38 = 6, + eQMINASPLMNNameSpareBits_Bits28 = 7, +}; + +// Enum to describe QMI NAS PRL Indicator +enum eQMINASPRLIndicator:UINT8 +{ + eQMINASPRLIndicator_SystemNotInPRL = 0, + eQMINASPRLIndicator_SystemIsInPRL = 1, +}; + +// Enum to describe QMI NAS PRL Preferences +enum eQMINASPRLPreferences:UINT16 +{ + eQMINASPRLPreferences_AcquireASideOnly = 1, + eQMINASPRLPreferences_AcquireBSideOnly = 2, + eQMINASPRLPreferences_AcquireAny = 16383, +}; + +// Enum to describe QMI NAS PS Attach Actions +enum eQMINASPSAttachActions:UINT8 +{ + eQMINASPSAttachActions_Attach = 1, + eQMINASPSAttachActions_Detach = 2, +}; + +// Enum to describe QMI NAS Preferred Data Bath +enum eQMINASPreferredDataBath:UINT8 +{ + eQMINASPreferredDataBath_NotPreferred = 0, + eQMINASPreferredDataBath_Preferred = 1, +}; + +// Enum to describe QMI NAS Preferred States +enum eQMINASPreferredStates:UINT8 +{ + eQMINASPreferredStates_Unknown = 0, + eQMINASPreferredStates_Preferred = 1, + eQMINASPreferredStates_NotPreferred = 2, +}; + +// Enum to describe QMI NAS RTRE Configuration +enum eQMINASRTREConfiguration:UINT8 +{ + eQMINASRTREConfiguration_RUIMOnly = 1, + eQMINASRTREConfiguration_InternalSettingsOnly = 2, + eQMINASRTREConfiguration_UseRUIMIfAvailable = 3, + eQMINASRTREConfiguration_GSMOn1X = 4, +}; + +// Enum to describe QMI NAS RX Level +enum eQMINASRXLevel:UINT16 +{ + eQMINASRXLevel_LessThan110dBm = 0, + eQMINASRXLevel_110dBmto109dBm = 1, + eQMINASRXLevel_109dBmto108dBm = 2, + eQMINASRXLevel_108dBmto107dBm = 3, + eQMINASRXLevel_107dBmto106dBm = 4, + eQMINASRXLevel_106dBmto105dBm = 5, + eQMINASRXLevel_105dBmto104dBm = 6, + eQMINASRXLevel_104dBmto103dBm = 7, + eQMINASRXLevel_103dBmto102dBm = 8, + eQMINASRXLevel_102dBmto101dBm = 9, + eQMINASRXLevel_101dBmto100dBm = 10, + eQMINASRXLevel_100dBmto99dBm = 11, + eQMINASRXLevel_99dBmto98dBm = 12, + eQMINASRXLevel_98dBmto97dBm = 13, + eQMINASRXLevel_97dBmto96dBm = 14, + eQMINASRXLevel_96dBmto95dBm = 15, + eQMINASRXLevel_95dBmto94dBm = 16, + eQMINASRXLevel_94dBmto93dBm = 17, + eQMINASRXLevel_93dBmto92dBm = 18, + eQMINASRXLevel_92dBmto91dBm = 19, + eQMINASRXLevel_91dBmto90dBm = 20, + eQMINASRXLevel_90dBmto89dBm = 21, + eQMINASRXLevel_89dBmto88dBm = 22, + eQMINASRXLevel_88dBmto87dBm = 23, + eQMINASRXLevel_87dBmto86dBm = 24, + eQMINASRXLevel_86dBmto85dBm = 25, + eQMINASRXLevel_85dBmto84dBm = 26, + eQMINASRXLevel_84dBmto83dBm = 27, + eQMINASRXLevel_83dBmto82dBm = 28, + eQMINASRXLevel_82dBmto81dBm = 29, + eQMINASRXLevel_81dBmto80dBm = 30, + eQMINASRXLevel_80dBmto79dBm = 31, + eQMINASRXLevel_79dBmto78dBm = 32, + eQMINASRXLevel_78dBmto77dBm = 33, + eQMINASRXLevel_77dBmto76dBm = 34, + eQMINASRXLevel_76dBmto75dBm = 35, + eQMINASRXLevel_75dBmto74dBm = 36, + eQMINASRXLevel_74dBmto73dBm = 37, + eQMINASRXLevel_73dBmto72dBm = 38, + eQMINASRXLevel_72dBmto71dBm = 39, + eQMINASRXLevel_71dBmto70dBm = 40, + eQMINASRXLevel_70dBmto69dBm = 41, + eQMINASRXLevel_69dBmto68dBm = 42, + eQMINASRXLevel_68dBmto67dBm = 43, + eQMINASRXLevel_67dBmto66dBm = 44, + eQMINASRXLevel_66dBmto65dBm = 45, + eQMINASRXLevel_65dBmto64dBm = 46, + eQMINASRXLevel_64dBmto63dBm = 47, + eQMINASRXLevel_63dBmto62dBm = 48, + eQMINASRXLevel_62dBmto61dBm = 49, + eQMINASRXLevel_61dBmto60dBm = 50, + eQMINASRXLevel_60dBmto59dBm = 51, + eQMINASRXLevel_59dBmto58dBm = 52, + eQMINASRXLevel_58dBmto57dBm = 53, + eQMINASRXLevel_57dBmto56dBm = 54, + eQMINASRXLevel_56dBmto55dBm = 55, + eQMINASRXLevel_55dBmto54dBm = 56, + eQMINASRXLevel_54dBmto53dBm = 57, + eQMINASRXLevel_53dBmto52dBm = 58, + eQMINASRXLevel_52dBmto51dBm = 59, + eQMINASRXLevel_51dBmto50dBm = 60, + eQMINASRXLevel_50dBmto49dBm = 61, + eQMINASRXLevel_49dBmto48dBm = 62, + eQMINASRXLevel_GreaterThan48dBm = 63, +}; + +// Enum to describe QMI NAS Radio Access Technologies +enum eQMINASRadioAccessTechnologies:UINT8 +{ + eQMINASRadioAccessTechnologies_GSM = 4, + eQMINASRadioAccessTechnologies_UMTS = 5, + eQMINASRadioAccessTechnologies_LTE = 8, +}; + +// Enum to describe QMI NAS Radio Interfaces +enum eQMINASRadioInterfaces:UINT8 +{ + eQMINASRadioInterfaces_NoneNoService = 0, + eQMINASRadioInterfaces_CDMA20001x = 1, + eQMINASRadioInterfaces_CDMA2000HRPD = 2, + eQMINASRadioInterfaces_AMPS = 3, + eQMINASRadioInterfaces_GSM = 4, + eQMINASRadioInterfaces_UMTS = 5, + eQMINASRadioInterfaces_LTE = 8, +}; + +// Enum to describe QMI NAS Radio System Modes +enum eQMINASRadioSystemModes:UINT32 +{ + eQMINASRadioSystemModes_NoService = 0, + eQMINASRadioSystemModes_Acquiring = 1, + eQMINASRadioSystemModes_InService = 2, +}; + +// Enum to describe QMI NAS Register Actions +enum eQMINASRegisterActions:UINT8 +{ + eQMINASRegisterActions_Automatic = 1, + eQMINASRegisterActions_Manual = 2, +}; + +// Enum to describe QMI NAS Registered Networks +enum eQMINASRegisteredNetworks:UINT8 +{ + eQMINASRegisteredNetworks_Unknown = 0, + eQMINASRegisteredNetworks_3GPP2 = 1, + eQMINASRegisteredNetworks_3GPP = 2, +}; + +// Enum to describe QMI NAS Registration States +enum eQMINASRegistrationStates:UINT8 +{ + eQMINASRegistrationStates_NASNotRegistered = 0, + eQMINASRegistrationStates_NASRegistered = 1, + eQMINASRegistrationStates_NASNotRegisteredSearching = 2, + eQMINASRegistrationStates_NASRegistrationDenied = 3, + eQMINASRegistrationStates_RegistrationStateUnknown = 4, +}; + +// Enum to describe QMI NAS Revision +enum eQMINASRevision:UINT8 +{ + eQMINASRevision_JSTD088 = 1, + eQMINASRevision_IS95RevA = 3, + eQMINASRevision_IS95RevB = 4, + eQMINASRevision_IS2000 = 6, + eQMINASRevision_IS2000RelA = 7, + eQMINASRevision_IS2000RelB = 8, + eQMINASRevision_IS2000RelC = 9, + eQMINASRevision_IS2000RelCMI = 10, + eQMINASRevision_IS2000RelD = 11, +}; + +// Enum to describe QMI NAS Roam Status +enum eQMINASRoamStatus:UINT8 +{ + eQMINASRoamStatus_Off = 0, + eQMINASRoamStatus_On = 1, + eQMINASRoamStatus_Blinking = 2, + eQMINASRoamStatus_OutOfNeighborhood = 3, + eQMINASRoamStatus_OutOfBuilding = 4, + eQMINASRoamStatus_PreferredSystem = 5, + eQMINASRoamStatus_AvailableSystem = 6, + eQMINASRoamStatus_AlliancePartner = 7, + eQMINASRoamStatus_PremiumPartner = 8, + eQMINASRoamStatus_FullService = 9, + eQMINASRoamStatus_PartialService = 10, + eQMINASRoamStatus_BannerIsOn = 11, + eQMINASRoamStatus_BannerIsOff = 12, +}; + +// Enum to describe QMI NAS Roaming Indicators +enum eQMINASRoamingIndicators:UINT8 +{ + eQMINASRoamingIndicators_Roaming = 0, + eQMINASRoamingIndicators_Home = 1, + eQMINASRoamingIndicators_RoamingPartner = 2, +}; + +// Enum to describe QMI NAS Roaming Preferences +enum eQMINASRoamingPreferences:UINT8 +{ + eQMINASRoamingPreferences_Automatic = 0, + eQMINASRoamingPreferences_HomeOnly = 1, + eQMINASRoamingPreferences_RoamingOnly = 2, + eQMINASRoamingPreferences_HomeRoaming = 3, +}; + +// Enum to describe QMI NAS Roaming Preferences 2 +enum eQMINASRoamingPreferences2:UINT16 +{ + eQMINASRoamingPreferences2_AcquireWhenRoamingIndicatorOff = 1, + eQMINASRoamingPreferences2_AcquireWhenRoamingIndicatorNotOff = 2, + eQMINASRoamingPreferences2_AcquireWhenRoamingIndicatorNotFlashing = 3, + eQMINASRoamingPreferences2_AcquireAny = 255, +}; + +// Enum to describe QMI NAS Roaming States +enum eQMINASRoamingStates:UINT8 +{ + eQMINASRoamingStates_Unknown = 0, + eQMINASRoamingStates_Home = 1, + eQMINASRoamingStates_Roam = 2, +}; + +// Enum to describe QMI NAS SINR Levels +enum eQMINASSINRLevels:UINT8 +{ + eQMINASSINRLevels_Negative9dB = 0, + eQMINASSINRLevels_Negative6dB = 1, + eQMINASSINRLevels_Negative45dB = 2, + eQMINASSINRLevels_Negative3dB = 3, + eQMINASSINRLevels_Negative2dB = 4, + eQMINASSINRLevels_1dB = 5, + eQMINASSINRLevels_3dB = 6, + eQMINASSINRLevels_6dB = 7, + eQMINASSINRLevels_9dB = 8, +}; + +// Enum to describe QMI NAS Service Domain Prefs +enum eQMINASServiceDomainPrefs:UINT32 +{ + eQMINASServiceDomainPrefs_CircuitSwitched = 0, + eQMINASServiceDomainPrefs_PacketSwitched = 1, + eQMINASServiceDomainPrefs_CircuitPacketSwitched = 2, + eQMINASServiceDomainPrefs_PacketSwitchedAttach = 3, + eQMINASServiceDomainPrefs_PacketSwitchedDetach = 4, +}; + +// Enum to describe QMI NAS Service Domains +enum eQMINASServiceDomains:UINT8 +{ + eQMINASServiceDomains_NoService = 0, + eQMINASServiceDomains_CircuitSwitched = 1, +}; + +// Enum to describe QMI NAS Service Option Actions +enum eQMINASServiceOptionActions:UINT8 +{ + eQMINASServiceOptionActions_Add = 0, + eQMINASServiceOptionActions_Replace = 1, + eQMINASServiceOptionActions_Delete = 2, + eQMINASServiceOptionActions_NoChange = 3, +}; + +// Enum to describe QMI NAS Service Status +enum eQMINASServiceStatus:UINT8 +{ + eQMINASServiceStatus_NoService = 0, + eQMINASServiceStatus_LimitedService = 1, + eQMINASServiceStatus_ServiceAvailable = 2, + eQMINASServiceStatus_LimitedRegionalService = 3, + eQMINASServiceStatus_PowerSaveOrDeepSleep = 4, +}; + +// Enum to describe QMI NAS Standby Preference +enum eQMINASStandbyPreference:UINT8 +{ + eQMINASStandbyPreference_SingleStandby = 1, + eQMINASStandbyPreference_DualStandbyWithTuneAway = 2, + eQMINASStandbyPreference_DualStandbyWithoutTuneAway = 4, + eQMINASStandbyPreference_AutomaticModeWithTuneAway = 5, + eQMINASStandbyPreference_AutomaticModeWithoutTuneAway = 6, +}; + +// Enum to describe QMI NAS Subscription Type +enum eQMINASSubscriptionType:UINT8 +{ + eQMINASSubscriptionType_PrimarySubscription = 0, + eQMINASSubscriptionType_SecondarySubscription = 1, +}; + +// Enum to describe QMI NAS System Forbidden +enum eQMINASSystemForbidden:UINT8 +{ + eQMINASSystemForbidden_SystemIsNotForbidden = 0, + eQMINASSystemForbidden_SystemIsForbidden = 1, +}; + +// Enum to describe QMI NAS System Preferences +enum eQMINASSystemPreferences:UINT8 +{ + eQMINASSystemPreferences_Automatic = 0, + eQMINASSystemPreferences_AutomaticA = 1, + eQMINASSystemPreferences_AutomaticB = 2, +}; + +// Enum to describe QMI NAS System Service Capabilities +enum eQMINASSystemServiceCapabilities:UINT8 +{ + eQMINASSystemServiceCapabilities_NoService = 0, + eQMINASSystemServiceCapabilities_CircuitSwitchedOnly = 1, + eQMINASSystemServiceCapabilities_PacketSwitchedOnly = 2, + eQMINASSystemServiceCapabilities_CircuitSwitchedAndPacketSwitched = 3, + eQMINASSystemServiceCapabilities_ServiceFoundButNotRegisteredOrAttached = 4, +}; + +// Enum to describe QMI NAS Tech Pref Durations +enum eQMINASTechPrefDurations:UINT8 +{ + eQMINASTechPrefDurations_Permanent = 0, + eQMINASTechPrefDurations_PowerCycle = 1, +}; + +// Enum to describe QMI NAS Tech Prefs +enum eQMINASTechPrefs:UINT8 +{ + eQMINASTechPrefs_Automatic = 0, + eQMINASTechPrefs_3GPP2 = 1, + eQMINASTechPrefs_3GPP = 2, + eQMINASTechPrefs_Invalid = 3, +}; + +// Enum to describe QMI OMA HFA Done States +enum eQMIOMAHFADoneStates:UINT8 +{ + eQMIOMAHFADoneStates_None = 0, + eQMIOMAHFADoneStates_Succeeded = 1, + eQMIOMAHFADoneStates_Failed = 2, +}; + +// Enum to describe QMI OMA Selections +enum eQMIOMASelections:UINT8 +{ + eQMIOMASelections_Reject = 0, + eQMIOMASelections_Accept = 1, +}; + +// Enum to describe QMI OMA Session Failure Reasons +enum eQMIOMASessionFailureReasons:UINT8 +{ + eQMIOMASessionFailureReasons_Unknown = 0, + eQMIOMASessionFailureReasons_NetworkUnavailable = 1, + eQMIOMASessionFailureReasons_ServerUnavailable = 2, + eQMIOMASessionFailureReasons_AuthenticationFailed = 3, + eQMIOMASessionFailureReasons_MaxRetryExceeded = 4, + eQMIOMASessionFailureReasons_SessionCancelled = 5, +}; + +// Enum to describe QMI OMA Session States +enum eQMIOMASessionStates:UINT8 +{ + eQMIOMASessionStates_CompleteInfoUpdated = 0, + eQMIOMASessionStates_CompleteInfoUnavailable = 1, + eQMIOMASessionStates_Failed = 2, + eQMIOMASessionStates_Retrying = 3, + eQMIOMASessionStates_Connecting = 4, + eQMIOMASessionStates_Connected = 5, + eQMIOMASessionStates_Authenticated = 6, + eQMIOMASessionStates_MDNDownloaded = 7, + eQMIOMASessionStates_MSIDDownloaded = 8, + eQMIOMASessionStates_PRLDownloaded = 9, + eQMIOMASessionStates_MIPProfileDownloaded = 10, +}; + +// Enum to describe QMI OMA Session Types +enum eQMIOMASessionTypes:UINT8 +{ + eQMIOMASessionTypes_ClientInitiatedDeviceConfigure = 0, + eQMIOMASessionTypes_ClientInitiatedPRLUpdate = 1, + eQMIOMASessionTypes_ClientInitiatedHandsFreeActivation = 2, + eQMIOMASessionTypes_DeviceInitiatedHandsFreeActivation = 3, + eQMIOMASessionTypes_NetworkInitiatedPRLUpdate = 4, + eQMIOMASessionTypes_NetworkInitiatedDeviceConfigure = 5, +}; + +// Enum to describe QMI PBM AAS Operations +enum eQMIPBMAASOperations:UINT8 +{ + eQMIPBMAASOperations_Add = 0, + eQMIPBMAASOperations_Modify = 1, + eQMIPBMAASOperations_Delete = 2, +}; + +// Enum to describe QMI PBM Emergency Categories +enum eQMIPBMEmergencyCategories +{ + eQMIPBMEmergencyCategories_Police = 1, + eQMIPBMEmergencyCategories_Ambulance = 2, + eQMIPBMEmergencyCategories_FireBrigade = 4, + eQMIPBMEmergencyCategories_MarineGuard = 8, + eQMIPBMEmergencyCategories_MountainRescue = 16, + eQMIPBMEmergencyCategories_ManualECall = 32, + eQMIPBMEmergencyCategories_AutomaticECall = 64, + eQMIPBMEmergencyCategories_Spare = 128, +}; + +// Enum to describe QMI PBM Number Plans +enum eQMIPBMNumberPlans:UINT8 +{ + eQMIPBMNumberPlans_Unknown = 0, + eQMIPBMNumberPlans_ISDN = 1, + eQMIPBMNumberPlans_Data = 2, + eQMIPBMNumberPlans_Telex = 3, + eQMIPBMNumberPlans_National = 4, + eQMIPBMNumberPlans_Private = 5, +}; + +// Enum to describe QMI PBM Number Types +enum eQMIPBMNumberTypes:UINT8 +{ + eQMIPBMNumberTypes_Unknown = 0, + eQMIPBMNumberTypes_International = 1, + eQMIPBMNumberTypes_National = 2, + eQMIPBMNumberTypes_NetworkSpecific = 3, + eQMIPBMNumberTypes_DedicatedAccess = 4, +}; + +// Enum to describe QMI PBM Operations +enum eQMIPBMOperations:UINT8 +{ + eQMIPBMOperations_Add = 1, + eQMIPBMOperations_Modify = 2, + eQMIPBMOperations_Delete = 3, +}; + +// Enum to describe QMI PBM Phonebook Types +enum eQMIPBMPhonebookTypes:UINT16 +{ + eQMIPBMPhonebookTypes_AbbreviatedDialingNumber = 1, + eQMIPBMPhonebookTypes_FixedDialingNumber = 2, + eQMIPBMPhonebookTypes_MobileSubscriberIntegratedServicesDigitalNetwork = 4, + eQMIPBMPhonebookTypes_MailBoxDialingNumber = 8, + eQMIPBMPhonebookTypes_ServiceDialingNumber = 16, + eQMIPBMPhonebookTypes_BarredDialingNumber = 32, + eQMIPBMPhonebookTypes_LastNumberDialed = 64, + eQMIPBMPhonebookTypes_MailBoxNumber = 128, +}; + +// Enum to describe QMI PBM Refresh Status +enum eQMIPBMRefreshStatus:UINT8 +{ + eQMIPBMRefreshStatus_RefreshStart = 1, + eQMIPBMRefreshStatus_RefreshEnd = 2, +}; + +// Enum to describe QMI PBM Session Types +enum eQMIPBMSessionTypes:UINT8 +{ + eQMIPBMSessionTypes_GWPrimary = 0, + eQMIPBMSessionTypes_1xPrimary = 1, + eQMIPBMSessionTypes_GWSecondary = 2, + eQMIPBMSessionTypes_1xSecondary = 3, + eQMIPBMSessionTypes_NonProvisioningOnSlot1 = 4, + eQMIPBMSessionTypes_NonProvisioningOnSlot2 = 5, + eQMIPBMSessionTypes_GlobalPhonebookOnSlot1 = 6, + eQMIPBMSessionTypes_GlobalPhonebookOnSlot2 = 7, +}; + +// Enum to describe QMI PBM States +enum eQMIPBMStates:UINT8 +{ + eQMIPBMStates_Ready = 0, + eQMIPBMStates_NotReady = 1, + eQMIPBMStates_NotAvailable = 2, + eQMIPBMStates_PINRestriction = 3, + eQMIPBMStates_PUKRestriction = 4, + eQMIPBMStates_Invalidated = 5, + eQMIPBMStates_Sync = 6, +}; + +// Enum to describe QMI PBM Subscription Types +enum eQMIPBMSubscriptionTypes:UINT8 +{ + eQMIPBMSubscriptionTypes_Primary = 0, + eQMIPBMSubscriptionTypes_Secondary = 1, +}; + +// Enum to describe QMI PDP Types +enum eQMIPDPTypes:UINT8 +{ + eQMIPDPTypes_PDPIPv4 = 0, + eQMIPDPTypes_PDPPPP = 1, + eQMIPDPTypes_PDPIPv6 = 2, + eQMIPDPTypes_PDPIPv4OrIPv6 = 3, +}; + +// Enum to describe QMI PDS Altitude Source +enum eQMIPDSAltitudeSource:UINT8 +{ + eQMIPDSAltitudeSource_Unknown = 0, + eQMIPDSAltitudeSource_GPS = 1, + eQMIPDSAltitudeSource_CellID = 2, + eQMIPDSAltitudeSource_EnhancedCellID = 3, + eQMIPDSAltitudeSource_WiFi = 4, + eQMIPDSAltitudeSource_Terrestrial = 5, + eQMIPDSAltitudeSource_TerrestrialHybrid = 6, + eQMIPDSAltitudeSource_AltitudeDatabase = 7, + eQMIPDSAltitudeSource_BarometricAltimeter = 8, + eQMIPDSAltitudeSource_Other = 9, +}; + +// Enum to describe QMI PDS Blanking Enable +enum eQMIPDSBlankingEnable:UINT8 +{ + eQMIPDSBlankingEnable_DisableBlanking = 0, + eQMIPDSBlankingEnable_EnableBlankingUnconditionally = 1, + eQMIPDSBlankingEnable_EnableBlankingConditionally = 2, +}; + +// Enum to describe QMI PDS Calendar Days +enum eQMIPDSCalendarDays:UINT8 +{ + eQMIPDSCalendarDays_Sunday = 0, + eQMIPDSCalendarDays_Monday = 1, + eQMIPDSCalendarDays_Tuesday = 2, + eQMIPDSCalendarDays_Wednesday = 3, + eQMIPDSCalendarDays_Thursday = 4, + eQMIPDSCalendarDays_Friday = 5, + eQMIPDSCalendarDays_Saturday = 6, +}; + +// Enum to describe QMI PDS Calendar Months +enum eQMIPDSCalendarMonths:UINT8 +{ + eQMIPDSCalendarMonths_January = 0, + eQMIPDSCalendarMonths_February = 1, + eQMIPDSCalendarMonths_March = 2, + eQMIPDSCalendarMonths_April = 3, + eQMIPDSCalendarMonths_May = 4, + eQMIPDSCalendarMonths_June = 5, + eQMIPDSCalendarMonths_July = 6, + eQMIPDSCalendarMonths_August = 7, + eQMIPDSCalendarMonths_September = 8, + eQMIPDSCalendarMonths_October = 9, + eQMIPDSCalendarMonths_November = 10, + eQMIPDSCalendarMonths_December = 11, +}; + +// Enum to describe QMI PDS Comm Event Protocols +enum eQMIPDSCommEventProtocols:UINT8 +{ + eQMIPDSCommEventProtocols_UMTSUserPlaneSUPL = 0, + eQMIPDSCommEventProtocols_1X = 1, + eQMIPDSCommEventProtocols_UMTSControlPlaneWCDMA = 2, + eQMIPDSCommEventProtocols_UMTSControlPlaneGSM = 3, + eQMIPDSCommEventProtocols_V1V2 = 4, + eQMIPDSCommEventProtocols_KDDI = 5, + eQMIPDSCommEventProtocols_XTRADataDownload = 6, + eQMIPDSCommEventProtocols_SNTPTimeDownload = 7, + eQMIPDSCommEventProtocols_1XControlPlane = 8, + eQMIPDSCommEventProtocols_Unknown = 255, +}; + +// Enum to describe QMI PDS Comm Event Types +enum eQMIPDSCommEventTypes:UINT8 +{ + eQMIPDSCommEventTypes_Begin = 0, + eQMIPDSCommEventTypes_Connected = 1, + eQMIPDSCommEventTypes_Failure = 2, + eQMIPDSCommEventTypes_Done = 3, + eQMIPDSCommEventTypes_OtherFailure = 4, +}; + +// Enum to describe QMI PDS Config +enum eQMIPDSConfig:UINT8 +{ + eQMIPDSConfig_PersistentDisabled = 0, + eQMIPDSConfig_PersistentEnabled = 1, + eQMIPDSConfig_NotPersistentDisabled = 240, + eQMIPDSConfig_NotPersistentEnabled = 241, +}; + +// Enum to describe QMI PDS Cradle Mount State +enum eQMIPDSCradleMountState:UINT8 +{ + eQMIPDSCradleMountState_NotMounted = 0, + eQMIPDSCradleMountState_Mounted = 1, + eQMIPDSCradleMountState_Unknown = 2, +}; + +// Enum to describe QMI PDS EFS File Operations +enum eQMIPDSEFSFileOperations:UINT8 +{ + eQMIPDSEFSFileOperations_Write = 0, + eQMIPDSEFSFileOperations_Delete = 1, +}; + +// Enum to describe QMI PDS Encryption Algorithm +enum eQMIPDSEncryptionAlgorithm:UINT8 +{ + eQMIPDSEncryptionAlgorithm_PDSMPDHashAlgorithmSHA1 = 0, + eQMIPDSEncryptionAlgorithm_PDSMPDHashAlgorithmMax = 1, + eQMIPDSEncryptionAlgorithm_PDSMPDHashAlgorithmNone = 255, +}; + +// Enum to describe QMI PDS External Power State +enum eQMIPDSExternalPowerState:UINT8 +{ + eQMIPDSExternalPowerState_NotConnected = 0, + eQMIPDSExternalPowerState_Connected = 1, + eQMIPDSExternalPowerState_Unknown = 2, +}; + +// Enum to describe QMI PDS Force Receiver Off +enum eQMIPDSForceReceiverOff:UINT8 +{ + eQMIPDSForceReceiverOff_Disable = 0, + eQMIPDSForceReceiverOff_Enable = 1, +}; + +// Enum to describe QMI PDS Injected Position Sources +enum eQMIPDSInjectedPositionSources:UINT8 +{ + eQMIPDSInjectedPositionSources_Unknown = 0, + eQMIPDSInjectedPositionSources_GPS = 1, + eQMIPDSInjectedPositionSources_CellID = 2, + eQMIPDSInjectedPositionSources_EnhancedCellID = 3, + eQMIPDSInjectedPositionSources_WiFi = 4, + eQMIPDSInjectedPositionSources_Terrestial = 5, + eQMIPDSInjectedPositionSources_TerrestialHybrid = 6, + eQMIPDSInjectedPositionSources_Other = 7, +}; + +// Enum to describe QMI PDS Mediums +enum eQMIPDSMediums:UINT8 +{ + eQMIPDSMediums_WWAN = 0, +}; + +// Enum to describe QMI PDS Method States +enum eQMIPDSMethodStates:UINT8 +{ + eQMIPDSMethodStates_Disabled = 0, + eQMIPDSMethodStates_Enabled = 1, + eQMIPDSMethodStates_NotSupported = 255, +}; + +// Enum to describe QMI PDS NMEA Reporting Options +enum eQMIPDSNMEAReportingOptions:UINT8 +{ + eQMIPDSNMEAReportingOptions_1HzFromTimeRequestedUntilFinalPositionDetermination = 0, + eQMIPDSNMEAReportingOptions_FinalPositionDeterminationOnly = 1, +}; + +// Enum to describe QMI PDS NMEA Sentence Operating Modes +enum eQMIPDSNMEASentenceOperatingModes:UINT8 +{ + eQMIPDSNMEASentenceOperatingModes_Standalone = 0, + eQMIPDSNMEASentenceOperatingModes_MSBased = 1, + eQMIPDSNMEASentenceOperatingModes_MSAssisted = 2, + eQMIPDSNMEASentenceOperatingModes_Unknown = 255, +}; + +// Enum to describe QMI PDS Network Mode +enum eQMIPDSNetworkMode:UINT8 +{ + eQMIPDSNetworkMode_UMTS = 0, + eQMIPDSNetworkMode_CDMA = 1, +}; + +// Enum to describe QMI PDS ODP States +enum eQMIPDSODPStates:UINT8 +{ + eQMIPDSODPStates_Disables = 0, + eQMIPDSODPStates_EnabledLowPowerMode = 1, + eQMIPDSODPStates_EnabledReadyMode = 2, +}; + +// Enum to describe QMI PDS Operation Types +enum eQMIPDSOperationTypes:UINT8 +{ + eQMIPDSOperationTypes_Standalone = 0, + eQMIPDSOperationTypes_MSBased = 1, + eQMIPDSOperationTypes_MSAssisted = 2, +}; + +// Enum to describe QMI PDS Output Devices +enum eQMIPDSOutputDevices:UINT8 +{ + eQMIPDSOutputDevices_NoneDisabled = 0, + eQMIPDSOutputDevices_USB = 1, + eQMIPDSOutputDevices_UART1 = 2, + eQMIPDSOutputDevices_UART2 = 3, + eQMIPDSOutputDevices_SharedMemory = 4, +}; + +// Enum to describe QMI PDS Privacy Modes +enum eQMIPDSPrivacyModes:UINT8 +{ + eQMIPDSPrivacyModes_NoNotifyVerify = 0, + eQMIPDSPrivacyModes_Notify = 1, + eQMIPDSPrivacyModes_NotifyVerifyAllowNoResponse = 2, + eQMIPDSPrivacyModes_NotifyVerifyRequireResponse = 3, + eQMIPDSPrivacyModes_PrivacyOverride = 4, +}; + +// Enum to describe QMI PDS Reliability Indicator +enum eQMIPDSReliabilityIndicator:UINT8 +{ + eQMIPDSReliabilityIndicator_NotSet = 0, + eQMIPDSReliabilityIndicator_VeryLow = 1, + eQMIPDSReliabilityIndicator_Low = 2, + eQMIPDSReliabilityIndicator_Medium = 3, + eQMIPDSReliabilityIndicator_High = 4, +}; + +// Enum to describe QMI PDS Report Security Challenge +enum eQMIPDSReportSecurityChallenge:UINT8 +{ + eQMIPDSReportSecurityChallenge_Disable = 0, + eQMIPDSReportSecurityChallenge_Enable = 1, +}; + +// Enum to describe QMI PDS Reporting State +enum eQMIPDSReportingState:UINT8 +{ + eQMIPDSReportingState_StopReporting = 0, + eQMIPDSReportingState_StartReporting = 1, +}; + +// Enum to describe QMI PDS SBAS States +enum eQMIPDSSBASStates:UINT8 +{ + eQMIPDSSBASStates_Disabled = 0, + eQMIPDSSBASStates_Enabled = 1, + eQMIPDSSBASStates_Unknown = 255, +}; + +// Enum to describe QMI PDS SPI State +enum eQMIPDSSPIState:UINT8 +{ + eQMIPDSSPIState_DeviceIsNonstationary = 0, + eQMIPDSSPIState_DeviceIsStationary = 1, +}; + +// Enum to describe QMI PDS SUPL Data Coding Schemes +enum eQMIPDSSUPLDataCodingSchemes:UINT8 +{ + eQMIPDSSUPLDataCodingSchemes_UTF8 = 0, + eQMIPDSSUPLDataCodingSchemes_UCS2 = 1, + eQMIPDSSUPLDataCodingSchemes_GSM = 2, + eQMIPDSSUPLDataCodingSchemes_Unknown = 255, +}; + +// Enum to describe QMI PDS SUPL ID/Name Data Coding Schemes +enum eQMIPDSSUPLIDNameDataCodingSchemes:UINT8 +{ + eQMIPDSSUPLIDNameDataCodingSchemes_LogicalName = 0, + eQMIPDSSUPLIDNameDataCodingSchemes_EmailAddress = 1, + eQMIPDSSUPLIDNameDataCodingSchemes_MSISDN = 2, + eQMIPDSSUPLIDNameDataCodingSchemes_URL = 3, + eQMIPDSSUPLIDNameDataCodingSchemes_SIPURL = 4, + eQMIPDSSUPLIDNameDataCodingSchemes_MIN = 5, + eQMIPDSSUPLIDNameDataCodingSchemes_MDN = 6, + eQMIPDSSUPLIDNameDataCodingSchemes_Unknown = 255, +}; + +// Enum to describe QMI PDS SUPL Modes +enum eQMIPDSSUPLModes:UINT8 +{ + eQMIPDSSUPLModes_MSAssisted = 0, + eQMIPDSSUPLModes_MSBased = 1, + eQMIPDSSUPLModes_MSAssistedPreferred = 2, + eQMIPDSSUPLModes_MSBasedPreferred = 3, + eQMIPDSSUPLModes_Standalone = 4, + eQMIPDSSUPLModes_AFLT = 5, + eQMIPDSSUPLModes_ECID = 6, + eQMIPDSSUPLModes_EOTD = 7, + eQMIPDSSUPLModes_OTDOA = 8, + eQMIPDSSUPLModes_NoPosition = 9, +}; + +// Enum to describe QMI PDS SV Almanac Status +enum eQMIPDSSVAlmanacStatus:UINT8 +{ + eQMIPDSSVAlmanacStatus_Unavailable = 0, + eQMIPDSSVAlmanacStatus_Available = 1, +}; + +// Enum to describe QMI PDS SV Ephemeris Status +enum eQMIPDSSVEphemerisStatus:UINT8 +{ + eQMIPDSSVEphemerisStatus_Unavailable = 0, + eQMIPDSSVEphemerisStatus_Available = 1, +}; + +// Enum to describe QMI PDS SV Health Status +enum eQMIPDSSVHealthStatus:UINT8 +{ + eQMIPDSSVHealthStatus_Unhealthy = 0, + eQMIPDSSVHealthStatus_Healthy = 1, +}; + +// Enum to describe QMI PDS SV Processing Status +enum eQMIPDSSVProcessingStatus:UINT8 +{ + eQMIPDSSVProcessingStatus_Idle = 1, + eQMIPDSSVProcessingStatus_Search = 2, + eQMIPDSSVProcessingStatus_SearchVerify = 3, + eQMIPDSSVProcessingStatus_BitEdge = 4, + eQMIPDSSVProcessingStatus_Track = 5, +}; + +// Enum to describe QMI PDS SV Systems +enum eQMIPDSSVSystems:UINT8 +{ + eQMIPDSSVSystems_GPS = 1, + eQMIPDSSVSystems_Galileo = 2, + eQMIPDSSVSystems_SBAS = 3, + eQMIPDSSVSystems_Compass = 4, + eQMIPDSSVSystems_Glonass = 5, +}; + +// Enum to describe QMI PDS Server Options +enum eQMIPDSServerOptions:UINT8 +{ + eQMIPDSServerOptions_Default = 0, +}; + +// Enum to describe QMI PDS Session Control Types +enum eQMIPDSSessionControlTypes:UINT8 +{ + eQMIPDSSessionControlTypes_Automatic = 0, +}; + +// Enum to describe QMI PDS Session Status +enum eQMIPDSSessionStatus:UINT8 +{ + eQMIPDSSessionStatus_Success = 0, + eQMIPDSSessionStatus_InProgress = 1, + eQMIPDSSessionStatus_GeneralFailure = 2, + eQMIPDSSessionStatus_Timeout = 3, + eQMIPDSSessionStatus_UserEnded = 4, + eQMIPDSSessionStatus_BadParameter = 5, + eQMIPDSSessionStatus_PhoneOffline = 6, + eQMIPDSSessionStatus_EngineLocked = 7, + eQMIPDSSessionStatus_E911SessionInProgress = 8, +}; + +// Enum to describe QMI PDS Session Types +enum eQMIPDSSessionTypes:UINT8 +{ + eQMIPDSSessionTypes_New = 0, +}; + +// Enum to describe QMI PDS Source Linkage +enum eQMIPDSSourceLinkage:UINT8 +{ + eQMIPDSSourceLinkage_NotSpecified = 0, + eQMIPDSSourceLinkage_FullyInterDependent = 1, + eQMIPDSSourceLinkage_AltitudeDependsOnLatitudeAndLongitude = 2, + eQMIPDSSourceLinkage_FullyIndependent = 3, +}; + +// Enum to describe QMI PDS Stop Reason +enum eQMIPDSStopReason:UINT8 +{ + eQMIPDSStopReason_UserTerminated = 0, + eQMIPDSStopReason_Other = 1, +}; + +// Enum to describe QMI PDS Streaming Status +enum eQMIPDSStreamingStatus:UINT8 +{ + eQMIPDSStreamingStatus_NotReadyForStreaming = 0, + eQMIPDSStreamingStatus_ReadyForStreaming = 1, +}; + +// Enum to describe QMI PDS Suspend Reason +enum eQMIPDSSuspendReason:UINT8 +{ + eQMIPDSSuspendReason_OoS = 0, + eQMIPDSSuspendReason_LPM = 1, + eQMIPDSSuspendReason_Other = 2, +}; + +// Enum to describe QMI PDS Time Bases +enum eQMIPDSTimeBases:UINT8 +{ + eQMIPDSTimeBases_GPS = 0, + eQMIPDSTimeBases_UTC = 1, +}; + +// Enum to describe QMI PDS Time Source +enum eQMIPDSTimeSource:UINT8 +{ + eQMIPDSTimeSource_Invalid = 0, + eQMIPDSTimeSource_NetworkTimeTransfer = 1, + eQMIPDSTimeSource_NetworkTimeTagging = 2, + eQMIPDSTimeSource_ExternalInput = 3, + eQMIPDSTimeSource_TOWDecode = 4, + eQMIPDSTimeSource_TOWConfirmed = 5, + eQMIPDSTimeSource_TOWAndWeekConfirmed = 6, + eQMIPDSTimeSource_TimeAlignment = 7, + eQMIPDSTimeSource_NavSolution = 8, + eQMIPDSTimeSource_SolveForTime = 9, +}; + +// Enum to describe QMI PDS Time Type +enum eQMIPDSTimeType:UINT8 +{ + eQMIPDSTimeType_UTCTime = 0, + eQMIPDSTimeType_GPSTime = 1, + eQMIPDSTimeType_Age = 2, +}; + +// Enum to describe QMI PDS Tracking Session States +enum eQMIPDSTrackingSessionStates:UINT8 +{ + eQMIPDSTrackingSessionStates_Unknown = 0, + eQMIPDSTrackingSessionStates_Inactive = 1, + eQMIPDSTrackingSessionStates_Active = 2, +}; + +// Enum to describe QMI PDS UMTS CP Data Coding Schemes +enum eQMIPDSUMTSCPDataCodingSchemes:UINT8 +{ + eQMIPDSUMTSCPDataCodingSchemes_German = 0, + eQMIPDSUMTSCPDataCodingSchemes_English = 1, + eQMIPDSUMTSCPDataCodingSchemes_Italian = 2, + eQMIPDSUMTSCPDataCodingSchemes_French = 3, + eQMIPDSUMTSCPDataCodingSchemes_Spanish = 4, + eQMIPDSUMTSCPDataCodingSchemes_Dutch = 5, + eQMIPDSUMTSCPDataCodingSchemes_Swedish = 6, + eQMIPDSUMTSCPDataCodingSchemes_Danish = 7, + eQMIPDSUMTSCPDataCodingSchemes_Portuguese = 8, + eQMIPDSUMTSCPDataCodingSchemes_Finnish = 9, + eQMIPDSUMTSCPDataCodingSchemes_Norwegian = 10, + eQMIPDSUMTSCPDataCodingSchemes_Greek = 11, + eQMIPDSUMTSCPDataCodingSchemes_Turkish = 12, + eQMIPDSUMTSCPDataCodingSchemes_Hungarian = 13, + eQMIPDSUMTSCPDataCodingSchemes_Polish = 14, + eQMIPDSUMTSCPDataCodingSchemes_Unknown = 255, +}; + +// Enum to describe QMI PDS UMTS CP Location Types +enum eQMIPDSUMTSCPLocationTypes:UINT8 +{ + eQMIPDSUMTSCPLocationTypes_Current = 0, + eQMIPDSUMTSCPLocationTypes_CurrentOrLastKnown = 1, + eQMIPDSUMTSCPLocationTypes_Initial = 2, +}; + +// Enum to describe QMI PDS Uncertainty Coverage +enum eQMIPDSUncertaintyCoverage:UINT8 +{ + eQMIPDSUncertaintyCoverage_NotSpecified = 0, + eQMIPDSUncertaintyCoverage_PointUncertainty = 1, + eQMIPDSUncertaintyCoverage_FullyUncertainty = 2, +}; + +// Enum to describe QMI PDS VX Data Coding Schemes +enum eQMIPDSVXDataCodingSchemes:UINT8 +{ + eQMIPDSVXDataCodingSchemes_Octet = 0, + eQMIPDSVXDataCodingSchemes_EXNProtocolMessage = 1, + eQMIPDSVXDataCodingSchemes_ASCII = 2, + eQMIPDSVXDataCodingSchemes_IA5 = 3, + eQMIPDSVXDataCodingSchemes_Unicode = 4, + eQMIPDSVXDataCodingSchemes_ShiftJIS = 5, + eQMIPDSVXDataCodingSchemes_Korean = 6, + eQMIPDSVXDataCodingSchemes_LatinHebrew = 7, + eQMIPDSVXDataCodingSchemes_Latin = 8, + eQMIPDSVXDataCodingSchemes_GSM = 9, +}; + +// Enum to describe QMI PDS VX Modes +enum eQMIPDSVXModes:UINT8 +{ + eQMIPDSVXModes_MSAssisted = 0, + eQMIPDSVXModes_MSBased = 1, + eQMIPDSVXModes_MSAssistedPreferred = 2, + eQMIPDSVXModes_MSBasedPreferred = 3, +}; + +// Enum to describe QMI PDS WWAN Network Preferences +enum eQMIPDSWWANNetworkPreferences:UINT8 +{ + eQMIPDSWWANNetworkPreferences_AnyAvailable = 0, + eQMIPDSWWANNetworkPreferences_HomeOnly = 1, + eQMIPDSWWANNetworkPreferences_RoamOnly = 2, +}; + +// Enum to describe QMI PDS Wi-Fi Request Types +enum eQMIPDSWiFiRequestTypes:UINT8 +{ + eQMIPDSWiFiRequestTypes_StartPeriodicFixesHighFrequency = 0, + eQMIPDSWiFiRequestTypes_StartPeriodicFixesKeepWarm = 1, + eQMIPDSWiFiRequestTypes_StopPeriodicFixes = 2, + eQMIPDSWiFiRequestTypes_Suspend = 4, +}; + +// Enum to describe QMI Profile Types +enum eQMIProfileTypes:UINT8 +{ + eQMIProfileTypes_3GPP = 0, + eQMIProfileTypes_3GPP2 = 1, +}; + +// Enum to describe QMI QoS Delivery Orders +enum eQMIQoSDeliveryOrders:UINT8 +{ + eQMIQoSDeliveryOrders_Subscribe = 0, + eQMIQoSDeliveryOrders_DeliveryOrderOn = 1, + eQMIQoSDeliveryOrders_DeliveryOrderOff = 2, +}; + +// Enum to describe QMI Results +enum eQMIResults:UINT16 +{ + eQMIResults_Success = 0, + eQMIResults_Failure = 1, +}; + +// Enum to describe QMI SAR RF States +enum eQMISARRFStates +{ + eQMISARRFStates_DefaultState = 0, + eQMISARRFStates_State1 = 1, + eQMISARRFStates_State2 = 2, + eQMISARRFStates_State3 = 3, + eQMISARRFStates_State4 = 4, + eQMISARRFStates_State5 = 5, + eQMISARRFStates_State6 = 6, + eQMISARRFStates_State7 = 7, + eQMISARRFStates_State8 = 8, +}; + +// Enum to describe QMI SDU Error Ratios +enum eQMISDUErrorRatios:UINT8 +{ + eQMISDUErrorRatios_Subscribe = 0, + eQMISDUErrorRatios_1X102 = 1, + eQMISDUErrorRatios_7X103 = 2, + eQMISDUErrorRatios_1X103 = 3, + eQMISDUErrorRatios_1X104 = 4, + eQMISDUErrorRatios_1X105 = 5, + eQMISDUErrorRatios_1X106 = 6, + eQMISDUErrorRatios_1X101 = 7, +}; + +// Enum to describe QMI SDU Residual Bit Error Ratios +enum eQMISDUResidualBitErrorRatios:UINT8 +{ + eQMISDUResidualBitErrorRatios_Subscribe = 0, + eQMISDUResidualBitErrorRatios_5X102 = 1, + eQMISDUResidualBitErrorRatios_1X102 = 2, + eQMISDUResidualBitErrorRatios_5X103 = 3, + eQMISDUResidualBitErrorRatios_4X103 = 4, + eQMISDUResidualBitErrorRatios_1X103 = 5, + eQMISDUResidualBitErrorRatios_1X104 = 6, + eQMISDUResidualBitErrorRatios_1X105 = 7, + eQMISDUResidualBitErrorRatios_1X106 = 8, + eQMISDUResidualBitErrorRatios_6X108 = 9, +}; + +// Enum to describe QMI Traffic Classes +enum eQMITrafficClasses:UINT8 +{ + eQMITrafficClasses_Subscribed = 0, + eQMITrafficClasses_Conversational = 1, + eQMITrafficClasses_Streaming = 2, + eQMITrafficClasses_Interactive = 3, + eQMITrafficClasses_Background = 4, +}; + +// Enum to describe QMI UIM Application States +enum eQMIUIMApplicationStates:UINT8 +{ + eQMIUIMApplicationStates_Unknown = 0, + eQMIUIMApplicationStates_Detected = 1, + eQMIUIMApplicationStates_PIN1OrUPINIsRequired = 2, + eQMIUIMApplicationStates_PUK1OrPUKForUPINIsRequired = 3, + eQMIUIMApplicationStates_PersonalizationStateMustBeChecked = 4, + eQMIUIMApplicationStates_PIN1IsBlocked = 5, + eQMIUIMApplicationStates_Illegal = 6, + eQMIUIMApplicationStates_Ready = 7, +}; + +// Enum to describe QMI UIM Application Types +enum eQMIUIMApplicationTypes:UINT8 +{ + eQMIUIMApplicationTypes_Unknown = 0, + eQMIUIMApplicationTypes_SIMCard = 1, + eQMIUIMApplicationTypes_USIMApplication = 2, + eQMIUIMApplicationTypes_RUIMCard = 3, + eQMIUIMApplicationTypes_CSIMApplication = 4, + eQMIUIMApplicationTypes_ISIMApplication = 5, +}; + +// Enum to describe QMI UIM Authentication Contexts +enum eQMIUIMAuthenticationContexts +{ + eQMIUIMAuthenticationContexts_GSMAlgorithm = 0, + eQMIUIMAuthenticationContexts_CAVEAlgorithm = 1, + eQMIUIMAuthenticationContexts_GSMSecurity = 2, + eQMIUIMAuthenticationContexts_3GSecurity = 3, + eQMIUIMAuthenticationContexts_VGCSVBSSecurity = 4, + eQMIUIMAuthenticationContexts_GBASecurityBootstrappingMode = 5, + eQMIUIMAuthenticationContexts_GBASecurityNAFDerivationMode = 6, + eQMIUIMAuthenticationContexts_MBMSSecurityMSKUpdateMode = 7, + eQMIUIMAuthenticationContexts_MBMSSecurityMTKGenerationMode = 8, + eQMIUIMAuthenticationContexts_MBMSSecurityMSKDeletionMode = 9, + eQMIUIMAuthenticationContexts_MBMSSecurityMUKDeletionMode = 10, + eQMIUIMAuthenticationContexts_IMSAKASecurity = 11, + eQMIUIMAuthenticationContexts_HTTPDigestSecurity = 12, + eQMIUIMAuthenticationContexts_ComputeIPCHAP = 13, + eQMIUIMAuthenticationContexts_ComputeIPMNHA = 14, + eQMIUIMAuthenticationContexts_ComputeIPMIPRRQ = 15, + eQMIUIMAuthenticationContexts_ComputeIPMNAAA = 16, + eQMIUIMAuthenticationContexts_ComputeIPHRPD = 17, +}; + +// Enum to describe QMI UIM CK/Session Operations +enum eQMIUIMCKSessionOperations:UINT8 +{ + eQMIUIMCKSessionOperations_Deactivate = 0, + eQMIUIMCKSessionOperations_Activate = 1, +}; + +// Enum to describe QMI UIM Card Error Codes +enum eQMIUIMCardErrorCodes:UINT8 +{ + eQMIUIMCardErrorCodes_Unknown = 0, + eQMIUIMCardErrorCodes_PowerDown = 1, + eQMIUIMCardErrorCodes_PollError = 2, + eQMIUIMCardErrorCodes_NoATRReceived = 3, + eQMIUIMCardErrorCodes_VoltMismatch = 4, + eQMIUIMCardErrorCodes_ParityError = 5, + eQMIUIMCardErrorCodes_UnknownPossiblyRemoved = 6, +}; + +// Enum to describe QMI UIM Card States +enum eQMIUIMCardStates:UINT8 +{ + eQMIUIMCardStates_Absent = 0, + eQMIUIMCardStates_Present = 1, + eQMIUIMCardStates_Error = 2, +}; + +// Enum to describe QMI UIM Connect Operations +enum eQMIUIMConnectOperations:UINT8 +{ + eQMIUIMConnectOperations_Disconnect = 0, + eQMIUIMConnectOperations_Connect = 1, + eQMIUIMConnectOperations_CheckStatus = 2, +}; + +// Enum to describe QMI UIM Disonnect Modes +enum eQMIUIMDisonnectModes:UINT8 +{ + eQMIUIMDisonnectModes_ImmediateDisconnect = 0, + eQMIUIMDisonnectModes_GracefulShutdown = 1, +}; + +// Enum to describe QMI UIM FDN Status Values +enum eQMIUIMFDNStatusValues:UINT8 +{ + eQMIUIMFDNStatusValues_NotAvailable = 0, + eQMIUIMFDNStatusValues_AvailableButDisabled = 1, + eQMIUIMFDNStatusValues_AvailableAndEnabled = 2, +}; + +// Enum to describe QMI UIM File Control Information +enum eQMIUIMFileControlInformation:UINT8 +{ + eQMIUIMFileControlInformation_NoData = 0, + eQMIUIMFileControlInformation_FCP = 1, + eQMIUIMFileControlInformation_FCI = 2, + eQMIUIMFileControlInformation_FCIWithInterfaces = 3, + eQMIUIMFileControlInformation_FMD = 4, +}; + +// Enum to describe QMI UIM File Types +enum eQMIUIMFileTypes:UINT8 +{ + eQMIUIMFileTypes_Transparent = 0, + eQMIUIMFileTypes_Cyclic = 1, + eQMIUIMFileTypes_LinearFixed = 2, + eQMIUIMFileTypes_DedicatedFile = 3, + eQMIUIMFileTypes_MasterFile = 4, +}; + +// Enum to describe QMI UIM Hidden Key Status Values +enum eQMIUIMHiddenKeyStatusValues:UINT8 +{ + eQMIUIMHiddenKeyStatusValues_NotSupported = 0, + eQMIUIMHiddenKeyStatusValues_EnabledAndNotVerified = 1, + eQMIUIMHiddenKeyStatusValues_EnabledAndVerified = 2, + eQMIUIMHiddenKeyStatusValues_Disabled = 3, +}; + +// Enum to describe QMI UIM Hot-Swap +enum eQMIUIMHotSwap:UINT8 +{ + eQMIUIMHotSwap_HotSwapNotSupported = 0, + eQMIUIMHotSwap_HotSwapIsSupportedButStatusOfSwitchNotSupported = 1, + eQMIUIMHotSwap_SwitchIndicatesThatCardIsPresent = 2, + eQMIUIMHotSwap_SwichIndicatesThatCardIsNotPresent = 3, +}; + +// Enum to describe QMI UIM Key Reference ID +enum eQMIUIMKeyReferenceID:UINT8 +{ + eQMIUIMKeyReferenceID_PINApplication1 = 1, + eQMIUIMKeyReferenceID_PINApplication2 = 2, + eQMIUIMKeyReferenceID_PINApplication3 = 3, + eQMIUIMKeyReferenceID_PINApplication4 = 4, + eQMIUIMKeyReferenceID_PINApplication5 = 5, + eQMIUIMKeyReferenceID_PINApplication6 = 6, + eQMIUIMKeyReferenceID_PINApplication7 = 7, + eQMIUIMKeyReferenceID_PINApplication8 = 8, +}; + +// Enum to describe QMI UIM PIN IDs +enum eQMIUIMPINIDs +{ + eQMIUIMPINIDs_PIN1 = 1, + eQMIUIMPINIDs_PIN2 = 2, + eQMIUIMPINIDs_UniversalPIN = 3, + eQMIUIMPINIDs_HiddenKey = 4, +}; + +// Enum to describe QMI UIM PIN Operations +enum eQMIUIMPINOperations +{ + eQMIUIMPINOperations_Disable = 0, + eQMIUIMPINOperations_Enable = 1, +}; + +// Enum to describe QMI UIM PIN States +enum eQMIUIMPINStates:UINT8 +{ + eQMIUIMPINStates_Unknown = 0, + eQMIUIMPINStates_EnabledAndNotVerified = 1, + eQMIUIMPINStates_EnabledAndVerified = 2, + eQMIUIMPINStates_Disabled = 3, + eQMIUIMPINStates_Blocked = 4, + eQMIUIMPINStates_PermanentlyBlocked = 5, +}; + +// Enum to describe QMI UIM Personalization Features +enum eQMIUIMPersonalizationFeatures:UINT8 +{ + eQMIUIMPersonalizationFeatures_GWNetwork = 0, + eQMIUIMPersonalizationFeatures_GWNetworkSubset = 1, + eQMIUIMPersonalizationFeatures_GWServiceProvider = 2, + eQMIUIMPersonalizationFeatures_GWCorporate = 3, + eQMIUIMPersonalizationFeatures_GWUIM = 4, + eQMIUIMPersonalizationFeatures_1XNetworkType1 = 5, + eQMIUIMPersonalizationFeatures_1XNetworkType2 = 6, + eQMIUIMPersonalizationFeatures_1XHRPD = 7, + eQMIUIMPersonalizationFeatures_1XServiceProvider = 8, + eQMIUIMPersonalizationFeatures_1XCorporate = 9, + eQMIUIMPersonalizationFeatures_1XRUIM = 10, + eQMIUIMPersonalizationFeatures_Unknown = 11, +}; + +// Enum to describe QMI UIM Personalization States +enum eQMIUIMPersonalizationStates:UINT8 +{ + eQMIUIMPersonalizationStates_Unknown = 0, + eQMIUIMPersonalizationStates_PersonalizationOperationIsInProgress = 1, + eQMIUIMPersonalizationStates_Ready = 2, + eQMIUIMPersonalizationStates_PersonalizationCodeIsRequired = 3, + eQMIUIMPersonalizationStates_PUKForPersonalizationCodeIsRequired = 4, + eQMIUIMPersonalizationStates_PermanentlyBlocked = 5, +}; + +// Enum to describe QMI UIM Refresh Modes +enum eQMIUIMRefreshModes:UINT8 +{ + eQMIUIMRefreshModes_Reset = 0, + eQMIUIMRefreshModes_Init = 1, + eQMIUIMRefreshModes_InitAndFCN = 2, + eQMIUIMRefreshModes_FCN = 3, + eQMIUIMRefreshModes_InitAndFullFCN = 4, + eQMIUIMRefreshModes_ApplicationReset = 5, + eQMIUIMRefreshModes_3GSessionReset = 6, +}; + +// Enum to describe QMI UIM Refresh Stages +enum eQMIUIMRefreshStages:UINT8 +{ + eQMIUIMRefreshStages_WaitingForOK = 0, + eQMIUIMRefreshStages_Start = 1, + eQMIUIMRefreshStages_EndWithSuccess = 2, + eQMIUIMRefreshStages_EndWithFailure = 3, +}; + +// Enum to describe QMI UIM Register Flags +enum eQMIUIMRegisterFlags +{ + eQMIUIMRegisterFlags_Deregister = 0, + eQMIUIMRegisterFlags_Register = 1, +}; + +// Enum to describe QMI UIM SAP Requests +enum eQMIUIMSAPRequests:UINT8 +{ + eQMIUIMSAPRequests_RetrieveATR = 0, + eQMIUIMSAPRequests_SendAPDU = 1, + eQMIUIMSAPRequests_PowerOffSIM = 2, + eQMIUIMSAPRequests_PowerOnSIM = 3, + eQMIUIMSAPRequests_ResetSIM = 4, + eQMIUIMSAPRequests_RetrieveCardReaderStatus = 5, +}; + +// Enum to describe QMI UIM SAP States +enum eQMIUIMSAPStates:UINT8 +{ + eQMIUIMSAPStates_NotEnabled = 0, + eQMIUIMSAPStates_Connecting = 1, + eQMIUIMSAPStates_ConnectedSuccessfully = 2, + eQMIUIMSAPStates_ConnectionError = 3, + eQMIUIMSAPStates_Disconnecting = 4, + eQMIUIMSAPStates_DisconnectedSuccessfully = 5, +}; + +// Enum to describe QMI UIM Security Attributes +enum eQMIUIMSecurityAttributes:UINT8 +{ + eQMIUIMSecurityAttributes_Always = 0, + eQMIUIMSecurityAttributes_Never = 1, + eQMIUIMSecurityAttributes_ANDCondition = 2, + eQMIUIMSecurityAttributes_ORCondition = 3, + eQMIUIMSecurityAttributes_SingleCondition = 4, +}; + +// Enum to describe QMI UIM Session Types +enum eQMIUIMSessionTypes:UINT8 +{ + eQMIUIMSessionTypes_PrimaryGWProvisioning = 0, + eQMIUIMSessionTypes_Primary1XProvisioning = 1, + eQMIUIMSessionTypes_SecondaryGWProvisioning = 2, + eQMIUIMSessionTypes_Secondary1XProvisioning = 3, + eQMIUIMSessionTypes_NonprovisioningOnSlot1 = 4, + eQMIUIMSessionTypes_NonprovisioningOnSlot2 = 5, + eQMIUIMSessionTypes_CardOnSlot1 = 6, + eQMIUIMSessionTypes_CardOnSlot2 = 7, + eQMIUIMSessionTypes_LogicalChannelOnSlot1 = 8, + eQMIUIMSessionTypes_LogicalChannelOnSlot2 = 9, +}; + +// Enum to describe QMI UIM Slots +enum eQMIUIMSlots:UINT8 +{ + eQMIUIMSlots_Slot1 = 1, + eQMIUIMSlots_Slot2 = 2, +}; + +// Enum to describe QMI Voice ALS Line Indicators +enum eQMIVoiceALSLineIndicators:UINT8 +{ + eQMIVoiceALSLineIndicators_Line1 = 0, + eQMIVoiceALSLineIndicators_Line2 = 1, +}; + +// Enum to describe QMI Voice ALS Lines +enum eQMIVoiceALSLines:UINT8 +{ + eQMIVoiceALSLines_Line1 = 0, + eQMIVoiceALSLines_Line2 = 1, +}; + +// Enum to describe QMI Voice Alerting Types +enum eQMIVoiceAlertingTypes:UINT8 +{ + eQMIVoiceAlertingTypes_Local = 0, + eQMIVoiceAlertingTypes_Remote = 1, +}; + +// Enum to describe QMI Voice CLIR Causes +enum eQMIVoiceCLIRCauses:UINT8 +{ + eQMIVoiceCLIRCauses_None = 0, + eQMIVoiceCLIRCauses_RejectedByUser = 1, + eQMIVoiceCLIRCauses_InteractionWithOtherServices = 2, + eQMIVoiceCLIRCauses_CoinLine = 3, + eQMIVoiceCLIRCauses_ServiceUnavailable = 4, + eQMIVoiceCLIRCauses_Reserved = 5, +}; + +// Enum to describe QMI Voice CLIR Types +enum eQMIVoiceCLIRTypes:UINT8 +{ + eQMIVoiceCLIRTypes_Supression = 1, + eQMIVoiceCLIRTypes_Invocation = 2, +}; + +// Enum to describe QMI Voice Call Control Result Types +enum eQMIVoiceCallControlResultTypes:UINT8 +{ + eQMIVoiceCallControlResultTypes_Voice = 0, + eQMIVoiceCallControlResultTypes_SupplementaryService = 1, + eQMIVoiceCallControlResultTypes_USSD = 2, +}; + +// Enum to describe QMI Voice Call Directions +enum eQMIVoiceCallDirections:UINT8 +{ + eQMIVoiceCallDirections_MobileOriginated = 1, + eQMIVoiceCallDirections_MobileTerminated = 2, +}; + +// Enum to describe QMI Voice Call Modes +enum eQMIVoiceCallModes:UINT8 +{ + eQMIVoiceCallModes_CDMA = 1, + eQMIVoiceCallModes_GSM = 2, + eQMIVoiceCallModes_UMTS = 3, + eQMIVoiceCallModes_LTE = 4, +}; + +// Enum to describe QMI Voice Call States +enum eQMIVoiceCallStates:UINT8 +{ + eQMIVoiceCallStates_Origination = 1, + eQMIVoiceCallStates_Incoming = 2, + eQMIVoiceCallStates_Conversation = 3, + eQMIVoiceCallStates_InProgress = 4, + eQMIVoiceCallStates_Alerting = 5, + eQMIVoiceCallStates_Hold = 6, + eQMIVoiceCallStates_Waiting = 7, + eQMIVoiceCallStates_Disconnecting = 8, + eQMIVoiceCallStates_End = 9, + eQMIVoiceCallStates_Setup = 10, +}; + +// Enum to describe QMI Voice Call Types +enum eQMIVoiceCallTypes:UINT8 +{ + eQMIVoiceCallTypes_VoiceAutomaticSelection = 0, + eQMIVoiceCallTypes_Forced = 1, + eQMIVoiceCallTypes_VoiceOverIP = 2, + eQMIVoiceCallTypes_OTAPA = 6, + eQMIVoiceCallTypes_StandardOTASP = 7, + eQMIVoiceCallTypes_NonStandardOTASP = 8, + eQMIVoiceCallTypes_Emergency = 9, + eQMIVoiceCallTypes_SupplementaryService = 10, +}; + +// Enum to describe QMI Voice DTMF Events +enum eQMIVoiceDTMFEvents:UINT8 +{ + eQMIVoiceDTMFEvents_SendDTMFBurst = 0, + eQMIVoiceDTMFEvents_StartSendingContinuousDTMFTone = 1, + eQMIVoiceDTMFEvents_StopSendingContinuousDTMFTone = 3, + eQMIVoiceDTMFEvents_ReceiveDTMFBurst = 4, + eQMIVoiceDTMFEvents_StartReceivingContinuousDTMFTone = 6, + eQMIVoiceDTMFEvents_StopReceivingContinuousDTMFTone = 7, +}; + +// Enum to describe QMI Voice DTMF Privacy Levels +enum eQMIVoiceDTMFPrivacyLevels:UINT8 +{ + eQMIVoiceDTMFPrivacyLevels_Standard = 0, + eQMIVoiceDTMFPrivacyLevels_Enhanced = 1, +}; + +// Enum to describe QMI Voice Domains +enum eQMIVoiceDomains:UINT8 +{ + eQMIVoiceDomains_CSOnly = 0, + eQMIVoiceDomains_PSOnly = 1, + eQMIVoiceDomains_CSThenPS = 2, + eQMIVoiceDomains_PSThenCS = 3, +}; + +// Enum to describe QMI Voice ECT Call States +enum eQMIVoiceECTCallStates:UINT8 +{ + eQMIVoiceECTCallStates_None = 0, + eQMIVoiceECTCallStates_Alerting = 1, + eQMIVoiceECTCallStates_Active = 2, +}; + +// Enum to describe QMI Voice Flash Types +enum eQMIVoiceFlashTypes:UINT8 +{ + eQMIVoiceFlashTypes_Simple = 0, + eQMIVoiceFlashTypes_ActivateAnswerHold = 1, + eQMIVoiceFlashTypes_DeactivateAnswerHold = 2, +}; + +// Enum to describe QMI Voice Interdigit Intervals +enum eQMIVoiceInterdigitIntervals:UINT8 +{ + eQMIVoiceInterdigitIntervals_60ms = 0, + eQMIVoiceInterdigitIntervals_100ms = 1, + eQMIVoiceInterdigitIntervals_150ms = 2, + eQMIVoiceInterdigitIntervals_200ms = 3, +}; + +// Enum to describe QMI Voice NSS Releases +enum eQMIVoiceNSSReleases:UINT8 +{ + eQMIVoiceNSSReleases_Finished = 1, +}; + +// Enum to describe QMI Voice Number Plans +enum eQMIVoiceNumberPlans:UINT8 +{ + eQMIVoiceNumberPlans_Unknown = 0, + eQMIVoiceNumberPlans_ISDN = 1, + eQMIVoiceNumberPlans_Data = 3, + eQMIVoiceNumberPlans_Telex = 4, + eQMIVoiceNumberPlans_National = 8, + eQMIVoiceNumberPlans_Private = 9, + eQMIVoiceNumberPlans_ReservedCTS = 11, + eQMIVoiceNumberPlans_ReservedExtension = 15, +}; + +// Enum to describe QMI Voice Number Types +enum eQMIVoiceNumberTypes:UINT8 +{ + eQMIVoiceNumberTypes_Unknown = 0, + eQMIVoiceNumberTypes_International = 1, + eQMIVoiceNumberTypes_National = 2, + eQMIVoiceNumberTypes_NetworkSpecific = 3, + eQMIVoiceNumberTypes_Subscriber = 4, + eQMIVoiceNumberTypes_Reserved = 5, + eQMIVoiceNumberTypes_Abbreviated = 6, + eQMIVoiceNumberTypes_ReservedExtension = 7, +}; + +// Enum to describe QMI Voice OTASP Stati +enum eQMIVoiceOTASPStati:UINT8 +{ + eQMIVoiceOTASPStati_Unlocked = 0, + eQMIVoiceOTASPStati_RetriesExceeded = 1, + eQMIVoiceOTASPStati_AKeyExchanged = 2, + eQMIVoiceOTASPStati_SSDUpdated = 3, + eQMIVoiceOTASPStati_NAMDownloaded = 4, + eQMIVoiceOTASPStati_MDNDownloaded = 5, + eQMIVoiceOTASPStati_IMSIDownloaded = 6, + eQMIVoiceOTASPStati_PRLDownloaded = 7, + eQMIVoiceOTASPStati_Committed = 8, + eQMIVoiceOTASPStati_OTAPAStarted = 9, + eQMIVoiceOTASPStati_OTAPAStopped = 10, + eQMIVoiceOTASPStati_OTAPAAborted = 11, + eQMIVoiceOTASPStati_OTAPACommitted = 12, +}; + +// Enum to describe QMI Voice Presentation Indicators +enum eQMIVoicePresentationIndicators:UINT8 +{ + eQMIVoicePresentationIndicators_Allowed = 0, + eQMIVoicePresentationIndicators_Restricted = 1, + eQMIVoicePresentationIndicators_Unavailable = 2, + eQMIVoicePresentationIndicators_NameRestricted = 3, + eQMIVoicePresentationIndicators_PayPhone = 4, +}; + +// Enum to describe QMI Voice Privacy Levels +enum eQMIVoicePrivacyLevels:UINT8 +{ + eQMIVoicePrivacyLevels_Standard = 0, + eQMIVoicePrivacyLevels_Enhanced = 1, +}; + +// Enum to describe QMI Voice Provisioning States +enum eQMIVoiceProvisioningStates:UINT8 +{ + eQMIVoiceProvisioningStates_NotProvisioned = 0, + eQMIVoiceProvisioningStates_ProvisionedPermanent = 1, + eQMIVoiceProvisioningStates_PresentationRestricted = 2, + eQMIVoiceProvisioningStates_PresentationAllowed = 3, +}; + +// Enum to describe QMI Voice Pulse Widths +enum eQMIVoicePulseWidths:UINT8 +{ + eQMIVoicePulseWidths_95ms = 0, + eQMIVoicePulseWidths_150ms = 1, + eQMIVoicePulseWidths_200ms = 2, + eQMIVoicePulseWidths_250ms = 3, + eQMIVoicePulseWidths_300ms = 4, + eQMIVoicePulseWidths_350ms = 5, + eQMIVoicePulseWidths_SMSTXSpecial = 6, +}; + +// Enum to describe QMI Voice Screening Indicators +enum eQMIVoiceScreeningIndicators:UINT8 +{ + eQMIVoiceScreeningIndicators_UserNotScreened = 0, + eQMIVoiceScreeningIndicators_UserPassedVerification = 1, + eQMIVoiceScreeningIndicators_UserFailedVerification = 2, + eQMIVoiceScreeningIndicators_ProvidedNetwork = 3, +}; + +// Enum to describe QMI Voice Service Options +enum eQMIVoiceServiceOptions:UINT16 +{ + eQMIVoiceServiceOptions_Any = 0, + eQMIVoiceServiceOptions_IS96A = 1, + eQMIVoiceServiceOptions_EVRC = 3, + eQMIVoiceServiceOptions_IS73313K = 17, + eQMIVoiceServiceOptions_SelectableModeVocoder = 56, + eQMIVoiceServiceOptions_4GVNarrowBand = 68, + eQMIVoiceServiceOptions_4GVWideBand = 70, + eQMIVoiceServiceOptions_13K = 32768, + eQMIVoiceServiceOptions_IS96 = 32769, + eQMIVoiceServiceOptions_WVRC = 32803, +}; + +// Enum to describe QMI Voice Subscription Types +enum eQMIVoiceSubscriptionTypes:UINT8 +{ + eQMIVoiceSubscriptionTypes_Primary = 0, + eQMIVoiceSubscriptionTypes_Secondary = 1, +}; + +// Enum to describe QMI Voice Supplementary Notification Types +enum eQMIVoiceSupplementaryNotificationTypes:UINT8 +{ + eQMIVoiceSupplementaryNotificationTypes_OutgoingCallIsForwarded = 1, + eQMIVoiceSupplementaryNotificationTypes_OutgoingCallIsWaiting = 2, + eQMIVoiceSupplementaryNotificationTypes_OutgoingCUGCall = 3, + eQMIVoiceSupplementaryNotificationTypes_OutgoingCallsBarred = 4, + eQMIVoiceSupplementaryNotificationTypes_OutgoingCallIsDeflected = 5, + eQMIVoiceSupplementaryNotificationTypes_IncomingCUGCall = 6, + eQMIVoiceSupplementaryNotificationTypes_IncomingCallsBarred = 7, + eQMIVoiceSupplementaryNotificationTypes_IncomingForwardedCall = 8, + eQMIVoiceSupplementaryNotificationTypes_IncomingDeflectedCall = 9, + eQMIVoiceSupplementaryNotificationTypes_IncomingCallIsForwarded = 10, + eQMIVoiceSupplementaryNotificationTypes_UnconditionalCallForwardingActive = 11, + eQMIVoiceSupplementaryNotificationTypes_ConditionalCallForwardingActive = 12, + eQMIVoiceSupplementaryNotificationTypes_CLIRSuppressionRejected = 13, + eQMIVoiceSupplementaryNotificationTypes_CallIsOnHold = 14, + eQMIVoiceSupplementaryNotificationTypes_CallIsRetrieved = 15, + eQMIVoiceSupplementaryNotificationTypes_CallIsInConference = 16, + eQMIVoiceSupplementaryNotificationTypes_CallIsECTWhileAnotherCallIsAlerting = 17, + eQMIVoiceSupplementaryNotificationTypes_CallIsECTWhileAnotherCallIsActive = 18, +}; + +// Enum to describe QMI Voice Supplementary Service Call Types +enum eQMIVoiceSupplementaryServiceCallTypes:UINT8 +{ + eQMIVoiceSupplementaryServiceCallTypes_ReleaseHeldOrWaiting = 1, + eQMIVoiceSupplementaryServiceCallTypes_ReleaseActiveAcceptHeldOrWaiting = 2, + eQMIVoiceSupplementaryServiceCallTypes_HoldActiveAcceptHeldOrWaiting = 3, + eQMIVoiceSupplementaryServiceCallTypes_HoldAllExceptSpecifiedCall = 4, + eQMIVoiceSupplementaryServiceCallTypes_MakeConferenceCall = 5, + eQMIVoiceSupplementaryServiceCallTypes_ExplicitCallTransfer = 6, + eQMIVoiceSupplementaryServiceCallTypes_CCBSActivation = 7, + eQMIVoiceSupplementaryServiceCallTypes_EndAllCalls = 8, + eQMIVoiceSupplementaryServiceCallTypes_ReleaseSpecifiedCall = 9, +}; + +// Enum to describe QMI Voice Supplementary Service Reasons +enum eQMIVoiceSupplementaryServiceReasons:UINT8 +{ + eQMIVoiceSupplementaryServiceReasons_ForwardUnconditional = 1, + eQMIVoiceSupplementaryServiceReasons_ForwardMobileBusy = 2, + eQMIVoiceSupplementaryServiceReasons_ForwardNoReply = 3, + eQMIVoiceSupplementaryServiceReasons_ForwardUnreachable = 4, + eQMIVoiceSupplementaryServiceReasons_ForwardAllForwarding = 5, + eQMIVoiceSupplementaryServiceReasons_ForwardAllConditional = 6, + eQMIVoiceSupplementaryServiceReasons_BarrAllOutgoing = 7, + eQMIVoiceSupplementaryServiceReasons_BarrOutgoingInt = 8, + eQMIVoiceSupplementaryServiceReasons_BarrOutgoingIntExtToHome = 9, + eQMIVoiceSupplementaryServiceReasons_BarrAllIncoming = 10, + eQMIVoiceSupplementaryServiceReasons_BarrIncomingRoaming = 11, + eQMIVoiceSupplementaryServiceReasons_BarrAllBarring = 12, + eQMIVoiceSupplementaryServiceReasons_BarrAllOutgoingBarring = 13, + eQMIVoiceSupplementaryServiceReasons_BarrAllIncomingBarring = 14, + eQMIVoiceSupplementaryServiceReasons_CallWaiting = 15, + eQMIVoiceSupplementaryServiceReasons_CLIR = 16, + eQMIVoiceSupplementaryServiceReasons_CLIP = 17, +}; + +// Enum to describe QMI Voice Supplementary Service Requests +enum eQMIVoiceSupplementaryServiceRequests:UINT8 +{ + eQMIVoiceSupplementaryServiceRequests_Activate = 1, + eQMIVoiceSupplementaryServiceRequests_Deactivate = 2, + eQMIVoiceSupplementaryServiceRequests_Register = 3, + eQMIVoiceSupplementaryServiceRequests_Erase = 4, + eQMIVoiceSupplementaryServiceRequests_Interrogate = 5, + eQMIVoiceSupplementaryServiceRequests_RegisterPassword = 6, + eQMIVoiceSupplementaryServiceRequests_USSD = 7, +}; + +// Enum to describe QMI Voice Supplementary Service Types +enum eQMIVoiceSupplementaryServiceTypes:UINT8 +{ + eQMIVoiceSupplementaryServiceTypes_Activate = 0, + eQMIVoiceSupplementaryServiceTypes_Deactivate = 1, + eQMIVoiceSupplementaryServiceTypes_Register = 2, + eQMIVoiceSupplementaryServiceTypes_Erase = 3, +}; + +// Enum to describe QMI Voice TTY Modes +enum eQMIVoiceTTYModes:UINT8 +{ + eQMIVoiceTTYModes_Full = 0, + eQMIVoiceTTYModes_VoiceCarryOver = 1, + eQMIVoiceTTYModes_HearingCarryOver = 2, + eQMIVoiceTTYModes_Off = 3, +}; + +// Enum to describe QMI Voice USSD Alpha Coding Schemes +enum eQMIVoiceUSSDAlphaCodingSchemes:UINT8 +{ + eQMIVoiceUSSDAlphaCodingSchemes_GSM = 1, + eQMIVoiceUSSDAlphaCodingSchemes_UCS2 = 2, +}; + +// Enum to describe QMI Voice USSD Data Coding Schemes +enum eQMIVoiceUSSDDataCodingSchemes:UINT8 +{ + eQMIVoiceUSSDDataCodingSchemes_ASCII = 1, + eQMIVoiceUSSDDataCodingSchemes_8Bit = 2, + eQMIVoiceUSSDDataCodingSchemes_UCS2 = 3, +}; + +// Enum to describe QMI Voice USSD Notifcation Types +enum eQMIVoiceUSSDNotifcationTypes:UINT8 +{ + eQMIVoiceUSSDNotifcationTypes_NoActionRequired = 1, + eQMIVoiceUSSDNotifcationTypes_ActionIsRequired = 2, +}; + +// Enum to describe QMI Voice UUS Data Coding Schemes +enum eQMIVoiceUUSDataCodingSchemes:UINT8 +{ + eQMIVoiceUUSDataCodingSchemes_USP = 1, + eQMIVoiceUUSDataCodingSchemes_OHLP = 2, + eQMIVoiceUUSDataCodingSchemes_X244 = 3, + eQMIVoiceUUSDataCodingSchemes_SMCF = 4, + eQMIVoiceUUSDataCodingSchemes_IA5 = 5, + eQMIVoiceUUSDataCodingSchemes_RV12RD = 6, + eQMIVoiceUUSDataCodingSchemes_Q931UNCCM = 7, +}; + +// Enum to describe QMI Voice UUS Types +enum eQMIVoiceUUSTypes:UINT8 +{ + eQMIVoiceUUSTypes_Data = 0, + eQMIVoiceUUSTypes_Type1Implicit = 1, + eQMIVoiceUUSTypes_Type1Required = 2, + eQMIVoiceUUSTypes_Type1NotRequired = 3, + eQMIVoiceUUSTypes_Type2Required = 4, + eQMIVoiceUUSTypes_Type2NotRequired = 5, + eQMIVoiceUUSTypes_Type3Required = 6, + eQMIVoiceUUSTypes_Type3NotRequired = 7, +}; + +// Enum to describe QMI Voice VoIP SUPS Call Types +enum eQMIVoiceVoIPSUPSCallTypes:UINT8 +{ + eQMIVoiceVoIPSUPSCallTypes_ReleaseHeldOrWaiting = 1, + eQMIVoiceVoIPSUPSCallTypes_ReleaseActiveAcceptHeldOrWaiting = 2, + eQMIVoiceVoIPSUPSCallTypes_HoldActiveAcceptHeldOrWaiting = 3, + eQMIVoiceVoIPSUPSCallTypes_MakeConferenceCall = 4, + eQMIVoiceVoIPSUPSCallTypes_EndAllExistingCalls = 5, +}; + +// Enum to describe QMI WDS 3GPP Call End Reasons +enum eQMIWDS3GPPCallEndReasons:UINT16 +{ + eQMIWDS3GPPCallEndReasons_OperatorDeterminedBarring = 8, + eQMIWDS3GPPCallEndReasons_LLCSNDCPFailure = 25, + eQMIWDS3GPPCallEndReasons_InsufficientResources = 26, + eQMIWDS3GPPCallEndReasons_UnknownAPN = 27, + eQMIWDS3GPPCallEndReasons_UnknownPDP = 28, + eQMIWDS3GPPCallEndReasons_AuthenticationFailed = 29, + eQMIWDS3GPPCallEndReasons_GGSNReject = 30, + eQMIWDS3GPPCallEndReasons_ActivationReject = 31, + eQMIWDS3GPPCallEndReasons_OptionNotSupported = 32, + eQMIWDS3GPPCallEndReasons_OptionUnsubscribed = 33, + eQMIWDS3GPPCallEndReasons_OptionTemporarilyOOO = 34, + eQMIWDS3GPPCallEndReasons_NSAPIAlreadyUsed = 35, + eQMIWDS3GPPCallEndReasons_RegularDeactivation = 36, + eQMIWDS3GPPCallEndReasons_QoSNotAccepted = 37, + eQMIWDS3GPPCallEndReasons_NetworkFailure = 38, + eQMIWDS3GPPCallEndReasons_UMTSReactivationRequest = 39, + eQMIWDS3GPPCallEndReasons_FeatureNotSupported = 40, + eQMIWDS3GPPCallEndReasons_TFTSemanticError = 41, + eQMIWDS3GPPCallEndReasons_TFTSyntaxError = 42, + eQMIWDS3GPPCallEndReasons_UnknownPDPContext = 43, + eQMIWDS3GPPCallEndReasons_FilterSemanticError = 44, + eQMIWDS3GPPCallEndReasons_FilterSyntaxError = 45, + eQMIWDS3GPPCallEndReasons_PDPWithoutActiveTFT = 46, + eQMIWDS3GPPCallEndReasons_IPv4OnlyAllowed = 50, + eQMIWDS3GPPCallEndReasons_IPv6OnlyAllowed = 51, + eQMIWDS3GPPCallEndReasons_SingleAddressBearerOnly = 52, + eQMIWDS3GPPCallEndReasons_ESMInfoNotReceived = 53, + eQMIWDS3GPPCallEndReasons_NoPDNConnection = 54, + eQMIWDS3GPPCallEndReasons_MultipleConnectionsNotAllowed = 55, + eQMIWDS3GPPCallEndReasons_InvalidTransactionID = 81, + eQMIWDS3GPPCallEndReasons_MessageIncorrectSemantic = 95, + eQMIWDS3GPPCallEndReasons_InvalidMandatoryID = 96, + eQMIWDS3GPPCallEndReasons_MessageTypeUnsupported = 97, + eQMIWDS3GPPCallEndReasons_MessageTypeNoncompatibleState = 98, + eQMIWDS3GPPCallEndReasons_UnknownInfoElement = 99, + eQMIWDS3GPPCallEndReasons_ConditionalInfoElementError = 100, + eQMIWDS3GPPCallEndReasons_MessageAndProtocolStateUncompatible = 101, + eQMIWDS3GPPCallEndReasons_ProtocolError = 111, + eQMIWDS3GPPCallEndReasons_APNTypeConflict = 112, +}; + +// Enum to describe QMI WDS 3GPP2 RAT Types +enum eQMIWDS3GPP2RATTypes:UINT8 +{ + eQMIWDS3GPP2RATTypes_HRPD = 1, + eQMIWDS3GPP2RATTypes_EHRPD = 2, + eQMIWDS3GPP2RATTypes_HRPDEHRPD = 3, +}; + +// Enum to describe QMI WDS Address Allocation Preference +enum eQMIWDSAddressAllocationPreference:UINT8 +{ + eQMIWDSAddressAllocationPreference_NASSignaling = 0, + eQMIWDSAddressAllocationPreference_DHCP = 1, +}; + +// Enum to describe QMI WDS Application Type +enum eQMIWDSApplicationType:UINT32 +{ + eQMIWDSApplicationType_DefaultApplicationType = 0, + eQMIWDSApplicationType_LBSApplicationType = 32, + eQMIWDSApplicationType_TetheredApplicationType = 64, +}; + +// Enum to describe QMI WDS Authentication Protocol +enum eQMIWDSAuthenticationProtocol:UINT8 +{ + eQMIWDSAuthenticationProtocol_PAP = 1, + eQMIWDSAuthenticationProtocol_CHAP = 2, + eQMIWDSAuthenticationProtocol_PAPOrCHAP = 3, +}; + +// Enum to describe QMI WDS Autoconnect Roam Settings +enum eQMIWDSAutoconnectRoamSettings:UINT8 +{ + eQMIWDSAutoconnectRoamSettings_Always = 0, + eQMIWDSAutoconnectRoamSettings_HomeOnly = 1, +}; + +// Enum to describe QMI WDS Autoconnect Settings +enum eQMIWDSAutoconnectSettings:UINT8 +{ + eQMIWDSAutoconnectSettings_Disabled = 0, + eQMIWDSAutoconnectSettings_Enabled = 1, + eQMIWDSAutoconnectSettings_Paused = 2, +}; + +// Enum to describe QMI WDS CDMA Networks +enum eQMIWDSCDMANetworks:UINT8 +{ + eQMIWDSCDMANetworks_NoService = 0, + eQMIWDSCDMANetworks_CDMA = 2, + eQMIWDSCDMANetworks_CDMA1xEVDO = 4, +}; + +// Enum to describe QMI WDS CDMA Service Options +enum eQMIWDSCDMAServiceOptions:UINT16 +{ + eQMIWDSCDMAServiceOptions_IS657 = 7, + eQMIWDSCDMAServiceOptions_IS657OverRateSet2 = 15, + eQMIWDSCDMAServiceOptions_IS707AWithRateSet1 = 22, + eQMIWDSCDMAServiceOptions_IS707AWithRateSet2 = 25, + eQMIWDSCDMAServiceOptions_CDMA2000PacketService = 33, + eQMIWDSCDMAServiceOptions_IS707 = 4103, + eQMIWDSCDMAServiceOptions_QCProprietaryRateSet2 = 32800, + eQMIWDSCDMAServiceOptions_NullServiceOption = 65535, +}; + +// Enum to describe QMI WDS Call End Reason Types +enum eQMIWDSCallEndReasonTypes:UINT16 +{ + eQMIWDSCallEndReasonTypes_Unspecified = 0, + eQMIWDSCallEndReasonTypes_MobileIP = 1, + eQMIWDSCallEndReasonTypes_Internal = 2, + eQMIWDSCallEndReasonTypes_CallManagerDefined = 3, + eQMIWDSCallEndReasonTypes_3GPPSpecificationDefined = 6, + eQMIWDSCallEndReasonTypes_PPP = 7, + eQMIWDSCallEndReasonTypes_EHRPD = 8, + eQMIWDSCallEndReasonTypes_IPv6 = 9, +}; + +// Enum to describe QMI WDS Call Manager Call End Reasons +enum eQMIWDSCallManagerCallEndReasons:UINT16 +{ + eQMIWDSCallManagerCallEndReasons_CDMALock = 500, + eQMIWDSCallManagerCallEndReasons_Intercept = 501, + eQMIWDSCallManagerCallEndReasons_Reorder = 502, + eQMIWDSCallManagerCallEndReasons_ReleaseServiceOptionReject = 503, + eQMIWDSCallManagerCallEndReasons_IncomingCall = 504, + eQMIWDSCallManagerCallEndReasons_AlertStop = 505, + eQMIWDSCallManagerCallEndReasons_Activation = 506, + eQMIWDSCallManagerCallEndReasons_MaxAccessProbe = 507, + eQMIWDSCallManagerCallEndReasons_CCSNotSupportedByBS = 508, + eQMIWDSCallManagerCallEndReasons_NoResponseFromBS = 509, + eQMIWDSCallManagerCallEndReasons_RejectedByBS = 510, + eQMIWDSCallManagerCallEndReasons_Incompatible = 511, + eQMIWDSCallManagerCallEndReasons_AlreadyInTC = 512, + eQMIWDSCallManagerCallEndReasons_UserCallOrigDuringGPS = 513, + eQMIWDSCallManagerCallEndReasons_UserCallOrigDuringSMS = 514, + eQMIWDSCallManagerCallEndReasons_NoCDMAService = 515, + eQMIWDSCallManagerCallEndReasons_RetryOrder = 519, + eQMIWDSCallManagerCallEndReasons_ConfFailed = 1000, + eQMIWDSCallManagerCallEndReasons_IncomingRejected = 1001, + eQMIWDSCallManagerCallEndReasons_NoGWService = 1002, + eQMIWDSCallManagerCallEndReasons_NoGPRSContext = 1003, + eQMIWDSCallManagerCallEndReasons_IllegalMS = 1004, + eQMIWDSCallManagerCallEndReasons_IllegalME = 1005, + eQMIWDSCallManagerCallEndReasons_GPRSServicesAndNonGPRSServiceNotAllowed = 1006, + eQMIWDSCallManagerCallEndReasons_GPRSServicesNotAllowed = 1007, + eQMIWDSCallManagerCallEndReasons_MSIdentityCannotBeDerivedByTheNetwork = 1008, + eQMIWDSCallManagerCallEndReasons_ImplicitlyDetached = 1009, + eQMIWDSCallManagerCallEndReasons_PLMNNotAllowed = 1010, + eQMIWDSCallManagerCallEndReasons_LANotAllowed = 1011, + eQMIWDSCallManagerCallEndReasons_GPRSServicesNotAllowedInThisPLMN = 1012, + eQMIWDSCallManagerCallEndReasons_PDPDuplicate = 1013, + eQMIWDSCallManagerCallEndReasons_UERATChange = 1014, + eQMIWDSCallManagerCallEndReasons_Congestion = 1015, + eQMIWDSCallManagerCallEndReasons_NoPDPContextActivated = 1016, + eQMIWDSCallManagerCallEndReasons_AccessClassDSACRejection = 1017, + eQMIWDSCallManagerCallEndReasons_CDGenOrBusy = 1500, + eQMIWDSCallManagerCallEndReasons_CDBillOrAuth = 1501, + eQMIWDSCallManagerCallEndReasons_ChangeHDR = 1502, + eQMIWDSCallManagerCallEndReasons_ExitHDR = 1503, + eQMIWDSCallManagerCallEndReasons_HDRNoSession = 1504, + eQMIWDSCallManagerCallEndReasons_HDROrigDuringGPSFix = 1505, + eQMIWDSCallManagerCallEndReasons_HDRCSTimeout = 1506, + eQMIWDSCallManagerCallEndReasons_HDRReleasedByCM = 1507, + eQMIWDSCallManagerCallEndReasons_NoHybridHDRService = 1510, + eQMIWDSCallManagerCallEndReasons_ClientEnd = 2000, + eQMIWDSCallManagerCallEndReasons_NoService = 2001, + eQMIWDSCallManagerCallEndReasons_Fade = 2002, + eQMIWDSCallManagerCallEndReasons_NormalRelease = 2003, + eQMIWDSCallManagerCallEndReasons_AccessInProgress = 2004, + eQMIWDSCallManagerCallEndReasons_AccessFail = 2005, + eQMIWDSCallManagerCallEndReasons_RedirectOrHandoff = 2006, +}; + +// Enum to describe QMI WDS Call Types +enum eQMIWDSCallTypes:UINT8 +{ + eQMIWDSCallTypes_Laptop = 0, + eQMIWDSCallTypes_Embedded = 1, +}; + +// Enum to describe QMI WDS DUN Control Events +enum eQMIWDSDUNControlEvents:UINT8 +{ + eQMIWDSDUNControlEvents_DUNCall = 1, + eQMIWDSDUNControlEvents_Entitlement = 2, + eQMIWDSDUNControlEvents_SilentRedial = 3, +}; + +// Enum to describe QMI WDS DUN Control Preferences +enum eQMIWDSDUNControlPreferences:UINT8 +{ + eQMIWDSDUNControlPreferences_RelinquishDUNControl = 0, + eQMIWDSDUNControlPreferences_ExerciseDUNConrol = 1, +}; + +// Enum to describe QMI WDS Data Call Status +enum eQMIWDSDataCallStatus:UINT8 +{ + eQMIWDSDataCallStatus_Unknown = 0, + eQMIWDSDataCallStatus_Activated = 1, + eQMIWDSDataCallStatus_Terminated = 2, +}; + +// Enum to describe QMI WDS Data Call Types +enum eQMIWDSDataCallTypes:UINT8 +{ + eQMIWDSDataCallTypes_Unknown = 0, + eQMIWDSDataCallTypes_Embedded = 1, + eQMIWDSDataCallTypes_Tethered = 2, +}; + +// Enum to describe QMI WDS Data Mode +enum eQMIWDSDataMode:UINT8 +{ + eQMIWDSDataMode_CDMAOrHDR = 0, + eQMIWDSDataMode_CDMAOnly = 1, + eQMIWDSDataMode_HDROnly = 2, +}; + +// Enum to describe QMI WDS Data Rate +enum eQMIWDSDataRate:UINT8 +{ + eQMIWDSDataRate_LowSO15Only = 0, + eQMIWDSDataRate_MediumSO33PlusLowRSCH = 1, + eQMIWDSDataRate_HighSO33PlusHighRSCH = 2, +}; + +// Enum to describe QMI WDS Data Systems +enum eQMIWDSDataSystems:UINT32 +{ + eQMIWDSDataSystems_Unknown = 0, + eQMIWDSDataSystems_CDMA1x = 1, + eQMIWDSDataSystems_CDMA1xEVDO = 2, + eQMIWDSDataSystems_GPRS = 3, + eQMIWDSDataSystems_WCDMA = 4, + eQMIWDSDataSystems_LTE = 5, +}; + +// Enum to describe QMI WDS EHRPD Call End Reason +enum eQMIWDSEHRPDCallEndReason:UINT16 +{ + eQMIWDSEHRPDCallEndReason_SubsLimitedToV4 = 1, + eQMIWDSEHRPDCallEndReason_SubsLimitedToV6 = 2, + eQMIWDSEHRPDCallEndReason_VSNCPTimeout = 4, + eQMIWDSEHRPDCallEndReason_VSNCPFailure = 5, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IGeneralError = 6, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IUnauthAPN = 7, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IPDNLimit = 8, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2INoPDNGW = 9, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IPDNGWUnreach = 10, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IPDNGWRejected = 11, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IInsufficientParam = 12, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IResourceUnavailable = 13, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IAdminProhibited = 14, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IPDNIDInUse = 15, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2ISubscriberLimitation = 16, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IPDNExistsForAPN = 17, +}; + +// Enum to describe QMI WDS Extended Error Code +enum eQMIWDSExtendedErrorCode:UINT16 +{ + eQMIWDSExtendedErrorCode_Failure = 1, + eQMIWDSExtendedErrorCode_InvalidHandle = 2, + eQMIWDSExtendedErrorCode_InvalidOperation = 3, + eQMIWDSExtendedErrorCode_InvalidProfileType = 4, + eQMIWDSExtendedErrorCode_InvalidProfileNumber = 5, + eQMIWDSExtendedErrorCode_InvalidIdentifier = 6, + eQMIWDSExtendedErrorCode_InvalidArgument = 7, + eQMIWDSExtendedErrorCode_NotInitialized = 8, + eQMIWDSExtendedErrorCode_InvalidLength = 9, + eQMIWDSExtendedErrorCode_ListEnd = 10, + eQMIWDSExtendedErrorCode_InvalidSubscriptionID = 11, + eQMIWDSExtendedErrorCode_InvalidProfileFamily = 12, + eQMIWDSExtendedErrorCode_3GPPInvalidProfileFamily = 1001, + eQMIWDSExtendedErrorCode_3GPPAccessError = 1002, + eQMIWDSExtendedErrorCode_3GPPContextNotDefined = 1003, + eQMIWDSExtendedErrorCode_3GPPValidFlagNotSet = 1004, + eQMIWDSExtendedErrorCode_3GPPReadOnlyFlagSet = 1005, + eQMIWDSExtendedErrorCode_3GPPErrorMaxProfileNumber = 1006, + eQMIWDSExtendedErrorCode_3GPP2ErrorInvalidIdentifierForProfile = 1101, +}; + +// Enum to describe QMI WDS Extended Tech Prefs +enum eQMIWDSExtendedTechPrefs:UINT16 +{ + eQMIWDSExtendedTechPrefs_CDMA = 32769, + eQMIWDSExtendedTechPrefs_UMTS = 32772, +}; + +// Enum to describe QMI WDS IP Families +enum eQMIWDSIPFamilies:UINT8 +{ + eQMIWDSIPFamilies_IPv4 = 4, + eQMIWDSIPFamilies_IPv6 = 6, + eQMIWDSIPFamilies_Unspecified = 8, +}; + +// Enum to describe QMI WDS IP Version +enum eQMIWDSIPVersion:UINT8 +{ + eQMIWDSIPVersion_IPv4 = 4, + eQMIWDSIPVersion_IPv6 = 6, +}; + +// Enum to describe QMI WDS IPv6 Call End Reason +enum eQMIWDSIPv6CallEndReason:UINT16 +{ + eQMIWDSIPv6CallEndReason_PrefixUnavailable = 1, +}; + +// Enum to describe QMI WDS Internal Call End Reasons +enum eQMIWDSInternalCallEndReasons:UINT16 +{ + eQMIWDSInternalCallEndReasons_Internal = 201, + eQMIWDSInternalCallEndReasons_CallEnded = 202, + eQMIWDSInternalCallEndReasons_InternalUnknownCauseCode = 203, + eQMIWDSInternalCallEndReasons_UnknownCauseCode = 204, + eQMIWDSInternalCallEndReasons_CloseInProgress = 205, + eQMIWDSInternalCallEndReasons_NWInitiatedTermination = 206, + eQMIWDSInternalCallEndReasons_AppPreempted = 207, +}; + +// Enum to describe QMI WDS Mobile IP Call End Reasons +enum eQMIWDSMobileIPCallEndReasons:UINT16 +{ + eQMIWDSMobileIPCallEndReasons_FAUnspecified = 64, + eQMIWDSMobileIPCallEndReasons_FAAdministrativelyProhibited = 65, + eQMIWDSMobileIPCallEndReasons_FAInsufficientResources = 66, + eQMIWDSMobileIPCallEndReasons_FAMobileNodeAuthenticationFailure = 67, + eQMIWDSMobileIPCallEndReasons_FAHAAuthenticationFailure = 68, + eQMIWDSMobileIPCallEndReasons_FARequestedLifetimeTooLong = 69, + eQMIWDSMobileIPCallEndReasons_FAMalformedRequest = 70, + eQMIWDSMobileIPCallEndReasons_FAMalformedReply = 71, + eQMIWDSMobileIPCallEndReasons_FAEncapsulationUnavailable = 72, + eQMIWDSMobileIPCallEndReasons_FAVJHCUnavailable = 73, + eQMIWDSMobileIPCallEndReasons_FAReverseTunnelUnavailable = 74, + eQMIWDSMobileIPCallEndReasons_FAReverseTunnelIsMandatoryAndTBitIsNotSet = 75, + eQMIWDSMobileIPCallEndReasons_FADeliveryStyleNotSupported = 79, + eQMIWDSMobileIPCallEndReasons_FAMissingNAI = 97, + eQMIWDSMobileIPCallEndReasons_FAMissingHA = 98, + eQMIWDSMobileIPCallEndReasons_FAMissingHomeAddress = 99, + eQMIWDSMobileIPCallEndReasons_FAUnknownChallenge = 104, + eQMIWDSMobileIPCallEndReasons_FAMissingChallenge = 105, + eQMIWDSMobileIPCallEndReasons_FAStaleChallenge = 106, + eQMIWDSMobileIPCallEndReasons_HAReasonUnspecified = 128, + eQMIWDSMobileIPCallEndReasons_HAAdministrativelyProhibited = 129, + eQMIWDSMobileIPCallEndReasons_HAInsufficientResources = 130, + eQMIWDSMobileIPCallEndReasons_HAMobileNodeAuthenticationFailure = 131, + eQMIWDSMobileIPCallEndReasons_HAFAAuthenticationFailure = 132, + eQMIWDSMobileIPCallEndReasons_HARegistrationIDMismatch = 133, + eQMIWDSMobileIPCallEndReasons_HAMalformedRequest = 134, + eQMIWDSMobileIPCallEndReasons_HAUnknownHAAddress = 136, + eQMIWDSMobileIPCallEndReasons_HAReverseTunnelUnavailable = 137, + eQMIWDSMobileIPCallEndReasons_HAReverseTunnelIsMandatoryAndTBitIsNotSet = 138, + eQMIWDSMobileIPCallEndReasons_HAEncapsulationUnavailable = 139, + eQMIWDSMobileIPCallEndReasons_Unknown = 65535, +}; + +// Enum to describe QMI WDS Network Types +enum eQMIWDSNetworkTypes:UINT8 +{ + eQMIWDSNetworkTypes_Unknown = 0, + eQMIWDSNetworkTypes_CDMA = 1, + eQMIWDSNetworkTypes_UMTS = 2, +}; + +// Enum to describe QMI WDS PDN Type +enum eQMIWDSPDNType:UINT8 +{ + eQMIWDSPDNType_IPv4PDNType = 0, + eQMIWDSPDNType_IPv6PDNType = 1, + eQMIWDSPDNType_IPv4orIPv6PDNType = 2, + eQMIWDSPDNType_UnspecifiedPDNType = 3, +}; + +// Enum to describe QMI WDS PDP Access Control Flag +enum eQMIWDSPDPAccessControlFlag:UINT8 +{ + eQMIWDSPDPAccessControlFlag_PDPAccessControlNone = 0, + eQMIWDSPDPAccessControlFlag_PDPAccessControlReject = 1, + eQMIWDSPDPAccessControlFlag_PDPAccessControlPermission = 2, +}; + +// Enum to describe QMI WDS PDP Data Compression Type +enum eQMIWDSPDPDataCompressionType:UINT8 +{ + eQMIWDSPDPDataCompressionType_Off = 0, + eQMIWDSPDPDataCompressionType_ManufacturerPreferred = 1, + eQMIWDSPDPDataCompressionType_V42BIS = 2, + eQMIWDSPDPDataCompressionType_V44 = 3, +}; + +// Enum to describe QMI WDS PDP Header Compression Type +enum eQMIWDSPDPHeaderCompressionType:UINT8 +{ + eQMIWDSPDPHeaderCompressionType_Off = 0, + eQMIWDSPDPHeaderCompressionType_ManufacturerPreferred = 1, + eQMIWDSPDPHeaderCompressionType_RFC1144 = 2, + eQMIWDSPDPHeaderCompressionType_RFC2507 = 3, + eQMIWDSPDPHeaderCompressionType_RFC3095 = 4, +}; + +// Enum to describe QMI WDS PPP Call End Reason +enum eQMIWDSPPPCallEndReason:UINT16 +{ + eQMIWDSPPPCallEndReason_Timeout = 1, + eQMIWDSPPPCallEndReason_AuthenticationFailed = 2, + eQMIWDSPPPCallEndReason_OptionMismatch = 3, + eQMIWDSPPPCallEndReason_PAPFailure = 31, + eQMIWDSPPPCallEndReason_CHAPFailure = 32, + eQMIWDSPPPCallEndReason_Unknown = 65535, +}; + +// Enum to describe QMI WDS Profile Family +enum eQMIWDSProfileFamily:UINT8 +{ + eQMIWDSProfileFamily_SocketsFamily = 1, +}; + +// Enum to describe QMI WDS Profile Param ID +enum eQMIWDSProfileParamID:UINT32 +{ + eQMIWDSProfileParamID_UMTSRequestedQoS = 23, + eQMIWDSProfileParamID_UMTSMinimumQoS = 24, + eQMIWDSProfileParamID_GPRSRequestedQoS = 25, + eQMIWDSProfileParamID_GPRSMinimumQoS = 26, + eQMIWDSProfileParamID_TFTFilterID1 = 50, + eQMIWDSProfileParamID_TFTFilterID2 = 51, +}; + +// Enum to describe QMI WDS QoS Class Identifier +enum eQMIWDSQoSClassIdentifier:UINT8 +{ + eQMIWDSQoSClassIdentifier_NetworkAssignQCI = 0, + eQMIWDSQoSClassIdentifier_GuaranteedBitrate1 = 1, + eQMIWDSQoSClassIdentifier_GuaranteedBitrate2 = 2, + eQMIWDSQoSClassIdentifier_GuaranteedBitrate3 = 3, + eQMIWDSQoSClassIdentifier_GuaranteedBitrate4 = 4, + eQMIWDSQoSClassIdentifier_NonGuaranteedBitrate5 = 5, + eQMIWDSQoSClassIdentifier_NonGuaranteedBitrate6 = 6, + eQMIWDSQoSClassIdentifier_NonGuaranteedBitrate7 = 7, + eQMIWDSQoSClassIdentifier_NonGuaranteedBitrate8 = 8, +}; + +// Enum to describe QMI WDS SIP/MIP Call Types +enum eQMIWDSSIPMIPCallTypes:UINT8 +{ + eQMIWDSSIPMIPCallTypes_NotUp = 0, + eQMIWDSSIPMIPCallTypes_SIPUp = 1, + eQMIWDSSIPMIPCallTypes_MIPUp = 2, +}; + +// Enum to describe QMI WDS Slot Cycle Set Results +enum eQMIWDSSlotCycleSetResults:UINT8 +{ + eQMIWDSSlotCycleSetResults_Succcess = 0, + eQMIWDSSlotCycleSetResults_FailureRequestRejected = 1, + eQMIWDSSlotCycleSetResults_FailureRequestFailedTX = 2, + eQMIWDSSlotCycleSetResults_FailureNotSupported = 3, + eQMIWDSSlotCycleSetResults_FailureNoNetwork = 4, +}; + +// Enum to describe QMI WDS Tethered Call Types +enum eQMIWDSTetheredCallTypes:UINT8 +{ + eQMIWDSTetheredCallTypes_NonTethered = 0, + eQMIWDSTetheredCallTypes_RmNet = 1, + eQMIWDSTetheredCallTypes_DUN = 2, +}; + +// Enum to describe QMI WMS ACK Failure Cause +enum eQMIWMSACKFailureCause:UINT8 +{ + eQMIWMSACKFailureCause_NoNetworkResponse = 0, + eQMIWMSACKFailureCause_NetworkReleasedLink = 1, + eQMIWMSACKFailureCause_NotSent = 2, +}; + +// Enum to describe QMI WMS CDMA Service Options +enum eQMIWMSCDMAServiceOptions:UINT8 +{ + eQMIWMSCDMAServiceOptions_Automatic = 0, + eQMIWMSCDMAServiceOptions_SO6 = 6, + eQMIWMSCDMAServiceOptions_SO14 = 14, +}; + +// Enum to describe QMI WMS Error Classes +enum eQMIWMSErrorClasses:UINT8 +{ + eQMIWMSErrorClasses_Temporary = 0, + eQMIWMSErrorClasses_Permanent = 1, +}; + +// Enum to describe QMI WMS Error Classes 2 +enum eQMIWMSErrorClasses2:UINT8 +{ + eQMIWMSErrorClasses2_Temporary = 2, + eQMIWMSErrorClasses2_Permanent = 3, +}; + +// Enum to describe QMI WMS GSM/WCDMA Domains +enum eQMIWMSGSMWCDMADomains:UINT8 +{ + eQMIWMSGSMWCDMADomains_CSPreferred = 0, + eQMIWMSGSMWCDMADomains_PSPreferred = 1, + eQMIWMSGSMWCDMADomains_CSOnly = 2, + eQMIWMSGSMWCDMADomains_PSOnly = 3, +}; + +// Enum to describe QMI WMS Language +enum eQMIWMSLanguage:UINT16 +{ + eQMIWMSLanguage_Unknown = 0, + eQMIWMSLanguage_English = 1, + eQMIWMSLanguage_French = 2, + eQMIWMSLanguage_Spanish = 3, + eQMIWMSLanguage_Japanese = 4, + eQMIWMSLanguage_Korean = 5, + eQMIWMSLanguage_Chinese = 6, + eQMIWMSLanguage_Hebrew = 7, +}; + +// Enum to describe QMI WMS Message Classes +enum eQMIWMSMessageClasses:UINT8 +{ + eQMIWMSMessageClasses_Class0 = 0, + eQMIWMSMessageClasses_Class1 = 1, + eQMIWMSMessageClasses_Class2 = 2, + eQMIWMSMessageClasses_Class3 = 3, + eQMIWMSMessageClasses_ClassNone = 4, + eQMIWMSMessageClasses_ClassCDMA = 5, +}; + +// Enum to describe QMI WMS Message Delivery Failure Type +enum eQMIWMSMessageDeliveryFailureType:UINT8 +{ + eQMIWMSMessageDeliveryFailureType_Temporary = 0, + eQMIWMSMessageDeliveryFailureType_Permanent = 1, +}; + +// Enum to describe QMI WMS Message Formats +enum eQMIWMSMessageFormats:UINT8 +{ + eQMIWMSMessageFormats_CDMA = 0, + eQMIWMSMessageFormats_AnalogCLIUnsupported = 1, + eQMIWMSMessageFormats_AnalogVoiceMailUnsupported = 2, + eQMIWMSMessageFormats_AnalogWMSUnsupported = 3, + eQMIWMSMessageFormats_AnalogAWIWMSUnsupported = 4, + eQMIWMSMessageFormats_MWIUnsupported = 5, + eQMIWMSMessageFormats_GSMWCDMAPP = 6, + eQMIWMSMessageFormats_GSMWCDMABC = 7, + eQMIWMSMessageFormats_MWI = 8, +}; + +// Enum to describe QMI WMS Message Protocols +enum eQMIWMSMessageProtocols:UINT8 +{ + eQMIWMSMessageProtocols_CDMA = 0, + eQMIWMSMessageProtocols_GSMWCDMAUnsupported = 1, +}; + +// Enum to describe QMI WMS Message Tags +enum eQMIWMSMessageTags:UINT8 +{ + eQMIWMSMessageTags_MTRead = 0, + eQMIWMSMessageTags_MTNotRead = 1, + eQMIWMSMessageTags_MOSend = 2, + eQMIWMSMessageTags_MONotSent = 3, +}; + +// Enum to describe QMI WMS Message Types +enum eQMIWMSMessageTypes:UINT8 +{ + eQMIWMSMessageTypes_PointToPoint = 0, + eQMIWMSMessageTypes_Broadcast = 1, +}; + +// Enum to describe QMI WMS Network Registration Status +enum eQMIWMSNetworkRegistrationStatus:UINT8 +{ + eQMIWMSNetworkRegistrationStatus_NoService = 0, + eQMIWMSNetworkRegistrationStatus_InProgress = 1, + eQMIWMSNetworkRegistrationStatus_Failed = 2, + eQMIWMSNetworkRegistrationStatus_LimitedService = 3, + eQMIWMSNetworkRegistrationStatus_FullService = 4, +}; + +// Enum to describe QMI WMS Notification Type +enum eQMIWMSNotificationType:UINT8 +{ + eQMIWMSNotificationType_Primary = 0, + eQMIWMSNotificationType_SecondaryGSM = 1, + eQMIWMSNotificationType_SecondaryUMTS = 2, +}; + +// Enum to describe QMI WMS Protocol Identifier Data +enum eQMIWMSProtocolIdentifierData:UINT8 +{ + eQMIWMSProtocolIdentifierData_Default = 0, + eQMIWMSProtocolIdentifierData_Implicit = 32, + eQMIWMSProtocolIdentifierData_Telex = 33, + eQMIWMSProtocolIdentifierData_G3Fax = 34, + eQMIWMSProtocolIdentifierData_G4Fax = 35, + eQMIWMSProtocolIdentifierData_VoicePhone = 36, + eQMIWMSProtocolIdentifierData_Ermes = 37, + eQMIWMSProtocolIdentifierData_NATPaging = 38, + eQMIWMSProtocolIdentifierData_Videotex = 39, + eQMIWMSProtocolIdentifierData_TeltexUnspecified = 40, + eQMIWMSProtocolIdentifierData_TeltexPSPDN = 41, + eQMIWMSProtocolIdentifierData_TeltexCSPDN = 42, + eQMIWMSProtocolIdentifierData_TeltexPSTN = 43, + eQMIWMSProtocolIdentifierData_TeltexISDN = 44, + eQMIWMSProtocolIdentifierData_UCI = 45, + eQMIWMSProtocolIdentifierData_MessageHandling = 48, + eQMIWMSProtocolIdentifierData_X400 = 49, + eQMIWMSProtocolIdentifierData_InternetEMail = 50, + eQMIWMSProtocolIdentifierData_SCSpecific1 = 56, + eQMIWMSProtocolIdentifierData_SCSpecific2 = 57, + eQMIWMSProtocolIdentifierData_SCSpecific3 = 58, + eQMIWMSProtocolIdentifierData_SCSpecific4 = 59, + eQMIWMSProtocolIdentifierData_SCSpecific5 = 60, + eQMIWMSProtocolIdentifierData_SCSpecific6 = 61, + eQMIWMSProtocolIdentifierData_SCSpecific7 = 62, + eQMIWMSProtocolIdentifierData_GSMUMTS = 63, + eQMIWMSProtocolIdentifierData_SMType0 = 64, + eQMIWMSProtocolIdentifierData_ReplaceSM1 = 65, + eQMIWMSProtocolIdentifierData_ReplaceSM2 = 66, + eQMIWMSProtocolIdentifierData_ReplaceSM3 = 67, + eQMIWMSProtocolIdentifierData_ReplaceSM4 = 68, + eQMIWMSProtocolIdentifierData_ReplaceSM5 = 69, + eQMIWMSProtocolIdentifierData_ReplaceSM6 = 70, + eQMIWMSProtocolIdentifierData_ReplaceSM7 = 71, + eQMIWMSProtocolIdentifierData_ReturnCall = 95, + eQMIWMSProtocolIdentifierData_ANSI136RData = 124, + eQMIWMSProtocolIdentifierData_MEDataDownload = 125, + eQMIWMSProtocolIdentifierData_MEDepersonalizationShortMessage = 126, + eQMIWMSProtocolIdentifierData_SIMDataDownload = 127, +}; + +// Enum to describe QMI WMS Receipt Actions +enum eQMIWMSReceiptActions:UINT8 +{ + eQMIWMSReceiptActions_Discard = 0, + eQMIWMSReceiptActions_StoreAndNotify = 1, + eQMIWMSReceiptActions_TransferOnly = 2, + eQMIWMSReceiptActions_TransfterAndAcknowledge = 3, +}; + +// Enum to describe QMI WMS Route Values +enum eQMIWMSRouteValues:UINT8 +{ + eQMIWMSRouteValues_Discard = 0, + eQMIWMSRouteValues_StoreAndNotify = 1, + eQMIWMSRouteValues_TransferOnly = 2, + eQMIWMSRouteValues_TransferAndAcknowledge = 3, + eQMIWMSRouteValues_Unknown = 255, +}; + +// Enum to describe QMI WMS SMS Call Status +enum eQMIWMSSMSCallStatus:UINT8 +{ + eQMIWMSSMSCallStatus_Incoming = 0, + eQMIWMSSMSCallStatus_Connected = 1, + eQMIWMSSMSCallStatus_Aborted = 2, + eQMIWMSSMSCallStatus_Disconnected = 3, + eQMIWMSSMSCallStatus_Connecting = 4, +}; + +// Enum to describe QMI WMS SMS Message Mode +enum eQMIWMSSMSMessageMode:UINT8 +{ + eQMIWMSSMSMessageMode_GSMWCDMA = 1, +}; + +// Enum to describe QMI WMS Storage Types +enum eQMIWMSStorageTypes:UINT8 +{ + eQMIWMSStorageTypes_UIM = 0, + eQMIWMSStorageTypes_NV = 1, + eQMIWMSStorageTypes_Unknown = 2, +}; + +// Enum to describe QMI WMS Subscription Type +enum eQMIWMSSubscriptionType:UINT8 +{ + eQMIWMSSubscriptionType_PrimarySubscription = 0, + eQMIWMSSubscriptionType_SecondarySubscription = 1, +}; + +// Enum to describe QMI WMS Transport Capability +enum eQMIWMSTransportCapability:UINT8 +{ + eQMIWMSTransportCapability_CDMA = 0, + eQMIWMSTransportCapability_GW = 1, +}; + +// Enum to describe QMI WMS Transport Type +enum eQMIWMSTransportType:UINT8 +{ + eQMIWMSTransportType_IMS = 0, +}; + +// Enum to describe QMI WMS Waiting Message Type +enum eQMIWMSWaitingMessageType:UINT8 +{ + eQMIWMSWaitingMessageType_Voicemail = 0, + eQMIWMSWaitingMessageType_Fax = 1, + eQMIWMSWaitingMessageType_Email = 2, + eQMIWMSWaitingMessageType_Other = 3, + eQMIWMSWaitingMessageType_Videomail = 4, +}; + diff --git a/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPIStructs.h b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPIStructs.h new file mode 100755 index 0000000..82af88d --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtAPIStructs.h @@ -0,0 +1,22117 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtAPIStructs.h + +DESCRIPTION: + Declaration of the Gobi API structures + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +#pragma once + +// Include the enumerations +#include "GobiConnectionMgmtAPIEnums.h" + +#pragma pack( push, 1 ) + +// Struct to represent a QMI (control/service) content +struct sQMIRawContentHeader +{ + BYTE mTypeID; + WORD mLength; + + // This array must be the size specified by mLength + // BYTE mValue[1]; +}; + +// Structure to describe TLV 0x02, the Result Code +// It is common for all Responses +struct sResultCode +{ + eQMIResults mQMIResult; + eQMIErrors mQMIError; +}; + +// Structure to describe TLV 0x01 for QMI LOC, the status +// It is common for QMI LOC indications above 0x0032 +struct sLOCIndication_Status +{ + eQMILOCStatus mStatus; +}; + +// Structure to describe request TLV 0x10 for WDSSetEventReport() +struct sWDSSetEventReportRequest_ChannelRateIndicator +{ + INT8 mReportChannelRate; +}; + +// Structure to describe request TLV 0x11 for WDSSetEventReport() +struct sWDSSetEventReportRequest_TransferStatisticsIndicator +{ + UINT8 mTransferStatisticsIntervalSeconds; + bool mReportTXPacketSuccesses:1; + bool mReportRXPacketSuccesses:1; + bool mReportTXPacketErrors:1; + bool mReportRXPacketErrors:1; + bool mReportTXOverflows:1; + bool mReportRXOverflows:1; + bool mTXByteTotal:1; + bool mRXByteTotal:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; +}; + +// Structure to describe request TLV 0x12 for WDSSetEventReport() +struct sWDSSetEventReportRequest_DataBearerTechnologyIndicator +{ + INT8 mReportDataBearerTechnology; +}; + +// Structure to describe request TLV 0x13 for WDSSetEventReport() +struct sWDSSetEventReportRequest_DormancyStatusIndicator +{ + INT8 mReportDormancyStatus; +}; + +// Structure to describe request TLV 0x14 for WDSSetEventReport() +struct sWDSSetEventReportRequest_MIPStatusIndicator +{ + INT8 mReportMIPStatus; +}; + +// Structure to describe request TLV 0x15 for WDSSetEventReport() +struct sWDSSetEventReportRequest_CurrentDataBearerTechnologyIndicator +{ + INT8 mReportDataBearerTechnology; +}; + +// Structure to describe request TLV 0x17 for WDSSetEventReport() +struct sWDSSetEventReportRequest_DataCallStatusIndicator +{ + INT8 mReportDataCallStatus; +}; + +// Structure to describe request TLV 0x18 for WDSSetEventReport() +struct sWDSSetEventReportRequest_PreferredDataSystemIndicator +{ + INT8 mReportPreferredDataSystem; +}; + +// Structure to describe request TLV 0x19 for WDSSetEventReport() +struct sWDSSetEventReportRequest_EVDOPMChangeIndicator +{ + INT8 mReportEVDOPageMonitorPeriodChange; +}; + +// Structure to describe indication TLV 0x10 for WDS EventReport +struct sWDSEventReportIndication_TXPacketSuccesses +{ + UINT32 mTXPacketSuccesses; +}; + +// Structure to describe indication TLV 0x11 for WDS EventReport +struct sWDSEventReportIndication_RXPacketSuccesses +{ + UINT32 mRXPacketSuccesses; +}; + +// Structure to describe indication TLV 0x12 for WDS EventReport +struct sWDSEventReportIndication_TXPacketErrors +{ + UINT32 mTXPacketErrors; +}; + +// Structure to describe indication TLV 0x13 for WDS EventReport +struct sWDSEventReportIndication_RXPacketErrors +{ + UINT32 mRXPacketErrors; +}; + +// Structure to describe indication TLV 0x14 for WDS EventReport +struct sWDSEventReportIndication_TXOverflows +{ + UINT32 mTXOverflows; +}; + +// Structure to describe indication TLV 0x15 for WDS EventReport +struct sWDSEventReportIndication_RXOverflows +{ + UINT32 mRXOverflows; +}; + +// Structure to describe indication TLV 0x16 for WDS EventReport +struct sWDSEventReportIndication_ChannelRates +{ + UINT32 mChannelTXRatebps; + UINT32 mChannelRXRatebps; +}; + +// Structure to describe indication TLV 0x17 for WDS EventReport +struct sWDSEventReportIndication_DataBearerTechnology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe indication TLV 0x18 for WDS EventReport +struct sWDSEventReportIndication_DormancyStatus +{ + eQMIDormancyStatus mDormancyStatus; +}; + +// Structure to describe indication TLV 0x19 for WDS EventReport +struct sWDSEventReportIndication_TXBytes +{ + UINT64 mTXByteTotal; +}; + +// Structure to describe indication TLV 0x1A for WDS EventReport +struct sWDSEventReportIndication_RXBytes +{ + UINT64 mRXByteTotal; +}; + +// Structure to describe indication TLV 0x1B for WDS EventReport +struct sWDSEventReportIndication_MIPStatus +{ + UINT8 mMIPStatus; +}; + +// Structure to describe indication TLV 0x1D for WDS EventReport +struct sWDSEventReportIndication_CurrentDataBearerTechnology +{ + eQMIWDSNetworkTypes mNetworkType; + + // The following union is based on the value of mNetworkType + union uValOfNetworkType + { + // If the value of mNetworkType == 1 + struct sNetworkTypeIs1 + { + bool mCDMA1x:1; + bool mCDMA1xEvDORev0:1; + bool mCDMA1xEvDORevA:1; + + // Padding out 28 bits + UINT8 mReserved1:5; + UINT8 mReserved2[2]; + UINT8 mReserved3:7; + + bool mNullBearer:1; + + // The following union is for handing both mCDMA1x and mCDMA1xEvDORevA + union uValOfCDMA1x_or_CDMA1xEvDORevA + { + // If the value of mCDMA1x == 1 + struct sCDMA1xIs1 + { + bool mCDMA1xIS95:1; + bool mCDMA1xIS2000:1; + bool mCDMA1xIS2000RelA:1; + + // Padding out 29 bits + UINT8 mReserved4:5; + UINT8 mReserved5[3]; + }; + + sCDMA1xIs1 mCDMA1xIs1; + + // If the value of mCDMA1xEvDORevA == 1 + struct sCDMA1xEvDORevAIs1 + { + bool mCDMA1xEvDORevADPA:1; + bool mCDMA1xEvDORevAMFPA:1; + bool mCDMA1xEvDORevAEMPA:1; + bool mCDMA1xEvDORevAEMPAEHRPD:1; + + // Padding out 28 bits + UINT8 mReserved6:4; + UINT8 mReserved7[3]; + }; + + sCDMA1xEvDORevAIs1 mCDMA1xEvDORevAIs1; + + // Padding out 32 bits + UINT8 mReserved8[4]; + }; + + uValOfCDMA1x_or_CDMA1xEvDORevA mValOfCDMA1x_or_CDMA1xEvDORevA; + }; + + sNetworkTypeIs1 mNetworkTypeIs1; + + // If the value of mNetworkType == 2 + struct sNetworkTypeIs2 + { + bool mWCDMA:1; + bool mGPRS:1; + bool mHSDPA:1; + bool mHSUPA:1; + bool mEDGE:1; + bool mLTE:1; + bool mHSDPAPlus:1; + bool mDualCellHSDPAPlus:1; + + // Padding out 23 bits + UINT8 mReserved9[2]; + UINT8 mReserved10:7; + + bool mNullBearer:1; + }; + + sNetworkTypeIs2 mNetworkTypeIs2; + + // Padding out 64 bits + UINT8 mReserved11[8]; + }; + + uValOfNetworkType mValOfNetworkType; +}; + +// Structure to describe indication TLV 0x1F for WDS EventReport +struct sWDSEventReportIndication_DataCallStatus +{ + eQMIWDSDataCallStatus mDataCallStatus; +}; + +// Structure to describe indication TLV 0x20 for WDS EventReport +struct sWDSEventReportIndication_PreferredDataSystem +{ + eQMIWDSDataSystems mPreferredDataSystem; +}; + +// Structure to describe indication TLV 0x22 for WDS EventReport +struct sWDSEventReportIndication_DataCallType +{ + eQMIWDSDataCallTypes mDataCallType; + eQMIWDSTetheredCallTypes mTetheredCallType; +}; + +// Structure to describe indication TLV 0x23 for WDS EventReport +struct sWDSEventReportIndication_EVDOPageMonitorPeriodChange +{ + UINT8 mEVDOPageMonitorPeriodChange; + INT8 mEVDOForceLongSleep; +}; + +// Structure to describe request TLV 0x01 for WDSAbort() +struct sWDSAbortRequest_TransactionID +{ + UINT16 mTransactionID; +}; + +// Structure to describe request TLV 0x10 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x11 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x12 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_PrimaryNBNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x13 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_SecondaryNBNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x14 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_ContextAPNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0x15 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x16 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe request TLV 0x17 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x18 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_Password +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x19 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_IPFamily +{ + eQMIWDSIPFamilies mIPFamily; +}; + +// Structure to describe request TLV 0x30 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_TechnologyPreference +{ + bool mEnable3GPP:1; + bool mEnable3GPP2:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe request TLV 0x31 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_3GPPProfileIdentifier +{ + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x32 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_3GPP2ProfileIdentifier +{ + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x33 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_Autoconnect +{ + eQMIWDSAutoconnectSettings mAutoconnectSetting; +}; + +// Structure to describe request TLV 0x34 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_ExtendedTechnologyPreference +{ + eQMIWDSExtendedTechPrefs mExtendedTechnologyPreference; +}; + +// Structure to describe request TLV 0x35 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_CallType +{ + eQMIWDSCallTypes mCallType; +}; + +// Structure to describe response TLV 0x01 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceResponse_PacketDataHandle +{ + UINT32 mPacketDataHandle; +}; + +// Structure to describe response TLV 0x10 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceResponse_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe response TLV 0x11 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceResponse_VerboseCallEndReason +{ + eQMIWDSCallEndReasonTypes mCallEndReasonType; + + // The following union is based on the value of mCallEndReasonType + union uValOfCallEndReasonType + { + // Always present + UINT16 mCallEndReasonValue; + + // If the value of mCallEndReasonType == 1 + struct sCallEndReasonTypeIs1 + { + eQMIWDSMobileIPCallEndReasons mMobileIPCallEndReason; + }; + + sCallEndReasonTypeIs1 mCallEndReasonTypeIs1; + + // If the value of mCallEndReasonType == 2 + struct sCallEndReasonTypeIs2 + { + eQMIWDSInternalCallEndReasons mInternalCallEndReason; + }; + + sCallEndReasonTypeIs2 mCallEndReasonTypeIs2; + + // If the value of mCallEndReasonType == 3 + struct sCallEndReasonTypeIs3 + { + eQMIWDSCallManagerCallEndReasons mCallManagerCallEndReason; + }; + + sCallEndReasonTypeIs3 mCallEndReasonTypeIs3; + + // If the value of mCallEndReasonType == 6 + struct sCallEndReasonTypeIs6 + { + eQMIWDS3GPPCallEndReasons m3GPPCallEndReason; + }; + + sCallEndReasonTypeIs6 mCallEndReasonTypeIs6; + + // If the value of mCallEndReasonType == 7 + struct sCallEndReasonTypeIs7 + { + eQMIWDSPPPCallEndReason mPPPCallEndReason; + }; + + sCallEndReasonTypeIs7 mCallEndReasonTypeIs7; + + // If the value of mCallEndReasonType == 8 + struct sCallEndReasonTypeIs8 + { + eQMIWDSEHRPDCallEndReason mEHRPDCallEndReason; + }; + + sCallEndReasonTypeIs8 mCallEndReasonTypeIs8; + + // If the value of mCallEndReasonType == 9 + struct sCallEndReasonTypeIs9 + { + eQMIWDSIPv6CallEndReason mIPv6CallEndReason; + }; + + sCallEndReasonTypeIs9 mCallEndReasonTypeIs9; + + // Padding out 16 bits + UINT8 mReserved1[2]; + }; + + uValOfCallEndReasonType mValOfCallEndReasonType; +}; + +// Structure to describe request TLV 0x01 for WDSStopNetworkInterface() +struct sWDSStopNetworkInterfaceRequest_PacketDataHandle +{ + UINT32 mPacketDataHandle; +}; + +// Structure to describe request TLV 0x10 for WDSStopNetworkInterface() +struct sWDSStopNetworkInterfaceRequest_Autoconnect +{ + INT8 mAutoconnectOff; +}; + +// Structure to describe response TLV 0x01 for WDSGetPacketServiceStatus() +struct sWDSGetPacketServiceStatusResponse_Status +{ + eQMIConnectionStatus mConnectionStatus; +}; + +// Structure to describe indication TLV 0x01 for WDS PacketServiceStatusReport +struct sWDSPacketServiceStatusReportIndication_Status +{ + eQMIConnectionStatus mConnectionStatus; + INT8 mReconfigureRequired; +}; + +// Structure to describe indication TLV 0x10 for WDS PacketServiceStatusReport +struct sWDSPacketServiceStatusReportIndication_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe indication TLV 0x11 for WDS PacketServiceStatusReport +struct sWDSPacketServiceStatusReportIndication_VerboseCallEndReason +{ + eQMIWDSCallEndReasonTypes mCallEndReasonType; + + // The following union is based on the value of mCallEndReasonType + union uValOfCallEndReasonType + { + // Always present + UINT16 mCallEndReasonValue; + + // If the value of mCallEndReasonType == 1 + struct sCallEndReasonTypeIs1 + { + eQMIWDSMobileIPCallEndReasons mMobileIPCallEndReason; + }; + + sCallEndReasonTypeIs1 mCallEndReasonTypeIs1; + + // If the value of mCallEndReasonType == 2 + struct sCallEndReasonTypeIs2 + { + eQMIWDSInternalCallEndReasons mInternalCallEndReason; + }; + + sCallEndReasonTypeIs2 mCallEndReasonTypeIs2; + + // If the value of mCallEndReasonType == 3 + struct sCallEndReasonTypeIs3 + { + eQMIWDSCallManagerCallEndReasons mCallManagerCallEndReason; + }; + + sCallEndReasonTypeIs3 mCallEndReasonTypeIs3; + + // If the value of mCallEndReasonType == 6 + struct sCallEndReasonTypeIs6 + { + eQMIWDS3GPPCallEndReasons m3GPPCallEndReason; + }; + + sCallEndReasonTypeIs6 mCallEndReasonTypeIs6; + + // If the value of mCallEndReasonType == 7 + struct sCallEndReasonTypeIs7 + { + eQMIWDSPPPCallEndReason mPPPCallEndReason; + }; + + sCallEndReasonTypeIs7 mCallEndReasonTypeIs7; + + // If the value of mCallEndReasonType == 8 + struct sCallEndReasonTypeIs8 + { + eQMIWDSEHRPDCallEndReason mEHRPDCallEndReason; + }; + + sCallEndReasonTypeIs8 mCallEndReasonTypeIs8; + + // If the value of mCallEndReasonType == 9 + struct sCallEndReasonTypeIs9 + { + eQMIWDSIPv6CallEndReason mIPv6CallEndReason; + }; + + sCallEndReasonTypeIs9 mCallEndReasonTypeIs9; + + // Padding out 16 bits + UINT8 mReserved1[2]; + }; + + uValOfCallEndReasonType mValOfCallEndReasonType; +}; + +// Structure to describe indication TLV 0x12 for WDS PacketServiceStatusReport +struct sWDSPacketServiceStatusReportIndication_IPFamily +{ + eQMIWDSIPFamilies mIPFamily; +}; + +// Structure to describe response TLV 0x01 for WDSGetChannelRates() +struct sWDSGetChannelRatesResponse_ChannelRates +{ + UINT32 mChannelTXRatebps; + UINT32 mChannelRXRatebps; + UINT32 mMaxChannelTXRatebps; + UINT32 mMaxChannelRXRatebps; +}; + +// Structure to describe request TLV 0x01 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsRequest_PacketStatsMask +{ + bool mReportTXPacketSuccesses:1; + bool mReportRXPacketSuccesses:1; + bool mReportTXPacketErrors:1; + bool mReportRXPacketErrors:1; + bool mReportTXOverflows:1; + bool mReportRXOverflows:1; + bool mTXByteTotal:1; + bool mRXByteTotal:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; +}; + +// Structure to describe response TLV 0x10 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_TXPacketSuccesses +{ + UINT32 mTXPacketSuccesses; +}; + +// Structure to describe response TLV 0x11 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_RXPacketSuccesses +{ + UINT32 mRXPacketSuccesses; +}; + +// Structure to describe response TLV 0x12 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_TXPacketErrors +{ + UINT32 mTXPacketErrors; +}; + +// Structure to describe response TLV 0x13 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_RXPacketErrors +{ + UINT32 mRXPacketErrors; +}; + +// Structure to describe response TLV 0x14 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_TXOverflows +{ + UINT32 mTXOverflows; +}; + +// Structure to describe response TLV 0x15 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_RXOverflows +{ + UINT32 mRXOverflows; +}; + +// Structure to describe response TLV 0x19 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_TXBytes +{ + UINT64 mTXByteTotal; +}; + +// Structure to describe response TLV 0x1A for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_RXBytes +{ + UINT64 mRXByteTotal; +}; + +// Structure to describe response TLV 0x1B for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_PreviousTXBytes +{ + UINT64 mPreviousCallTXByteTotal; +}; + +// Structure to describe response TLV 0x1C for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_PreviousRXBytes +{ + UINT64 mPreviousCallRXByteTotal; +}; + +// Structure to describe request TLV 0x01 for WDSCreateProfile() +struct sWDSCreateProfileRequest_ProfileType +{ + eQMIProfileTypes mProfileType; +}; + +// Structure to describe request TLV 0x10 for WDSCreateProfile() +struct sWDSCreateProfileRequest_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe request TLV 0x11 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe request TLV 0x12 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPHeaderCompressionType +{ + eQMIWDSPDPHeaderCompressionType mPDPHeaderCompressionType; +}; + +// Structure to describe request TLV 0x13 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPDataCompressionType +{ + eQMIWDSPDPDataCompressionType mPDPDataCompressionType; +}; + +// Structure to describe request TLV 0x14 for WDSCreateProfile() +struct sWDSCreateProfileRequest_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0x15 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x16 for WDSCreateProfile() +struct sWDSCreateProfileRequest_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x17 for WDSCreateProfile() +struct sWDSCreateProfileRequest_UMTSRequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x18 for WDSCreateProfile() +struct sWDSCreateProfileRequest_UMTSMinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x19 for WDSCreateProfile() +struct sWDSCreateProfileRequest_GPRSRequestedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1A for WDSCreateProfile() +struct sWDSCreateProfileRequest_GPRSMinimumQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1B for WDSCreateProfile() +struct sWDSCreateProfileRequest_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x1C for WDSCreateProfile() +struct sWDSCreateProfileRequest_Password +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x1D for WDSCreateProfile() +struct sWDSCreateProfileRequest_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe request TLV 0x1E for WDSCreateProfile() +struct sWDSCreateProfileRequest_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x1F for WDSCreateProfile() +struct sWDSCreateProfileRequest_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe request TLV 0x20 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPAccessControlFlag +{ + eQMIWDSPDPAccessControlFlag mPDPAccessControlFlag; +}; + +// Structure to describe request TLV 0x21 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PCSCFAddressUsingDHCP +{ + INT8 mPCSCFAddressUsingDHCP; +}; + +// Structure to describe request TLV 0x22 for WDSCreateProfile() +struct sWDSCreateProfileRequest_IMCNFlag +{ + INT8 mIMCN; +}; + +// Structure to describe request TLV 0x23 for WDSCreateProfile() +struct sWDSCreateProfileRequest_TrafficFlowTemplateID1Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x24 for WDSCreateProfile() +struct sWDSCreateProfileRequest_TrafficFlowTemplateID2Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x25 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPContextNumber +{ + UINT8 mPDPContextNumber; +}; + +// Structure to describe request TLV 0x26 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPContextSecondaryFlag +{ + INT8 mPDPContextSecondaryFlag; +}; + +// Structure to describe request TLV 0x27 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPContextPrimaryID +{ + UINT8 mPDPPrimaryID; +}; + +// Structure to describe request TLV 0x28 for WDSCreateProfile() +struct sWDSCreateProfileRequest_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x29 for WDSCreateProfile() +struct sWDSCreateProfileRequest_RequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2A for WDSCreateProfile() +struct sWDSCreateProfileRequest_MinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2B for WDSCreateProfile() +struct sWDSCreateProfileRequest_PrimaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2C for WDSCreateProfile() +struct sWDSCreateProfileRequest_SecondaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2D for WDSCreateProfile() +struct sWDSCreateProfileRequest_AddressPreference +{ + eQMIWDSAddressAllocationPreference mAddressAllocationPreference; +}; + +// Structure to describe request TLV 0x2E for WDSCreateProfile() +struct sWDSCreateProfileRequest_LTEQoSParameters +{ + eQMIWDSQoSClassIdentifier mQoSClassIdentifier; + UINT32 mGuaranteedDownlinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mMaxUplinkBitrate; +}; + +// Structure to describe request TLV 0x2F for WDSCreateProfile() +struct sWDSCreateProfileRequest_APNDisabled +{ + INT8 mAPNDisabled; +}; + +// Structure to describe request TLV 0x30 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerSeconds; +}; + +// Structure to describe request TLV 0x31 for WDSCreateProfile() +struct sWDSCreateProfileRequest_APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe request TLV 0x8F for WDSCreateProfile() +struct sWDSCreateProfileRequest_ProfilePersistent +{ + INT8 mProfilePersistent; +}; + +// Structure to describe request TLV 0x90 for WDSCreateProfile() +struct sWDSCreateProfileRequest_NegotiateDNSServerPreference +{ + INT8 mNegotiateDNSServerPreference; +}; + +// Structure to describe request TLV 0x91 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PPPSessionCloseTimerDO +{ + UINT32 mPPPSessionCloseTimerDOSeconds; +}; + +// Structure to describe request TLV 0x92 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PPPSessionCloseTimer1X +{ + UINT32 mPPPSessionCloseTimer1XSeconds; +}; + +// Structure to describe request TLV 0x93 for WDSCreateProfile() +struct sWDSCreateProfileRequest_AllowLinger +{ + INT8 mAllowLinger; +}; + +// Structure to describe request TLV 0x94 for WDSCreateProfile() +struct sWDSCreateProfileRequest_LCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x95 for WDSCreateProfile() +struct sWDSCreateProfileRequest_IPCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x96 for WDSCreateProfile() +struct sWDSCreateProfileRequest_AuthenticationTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x97 for WDSCreateProfile() +struct sWDSCreateProfileRequest_LCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x98 for WDSCreateProfile() +struct sWDSCreateProfileRequest_IPCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x99 for WDSCreateProfile() +struct sWDSCreateProfileRequest_AuthenticationRetry +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x9A for WDSCreateProfile() +struct sWDSCreateProfileRequest_AuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe request TLV 0x9B for WDSCreateProfile() +struct sWDSCreateProfileRequest_UserID +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x9C for WDSCreateProfile() +struct sWDSCreateProfileRequest_AuthenticationPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x9D for WDSCreateProfile() +struct sWDSCreateProfileRequest_DataRate +{ + eQMIWDSDataRate mDataRate; +}; + +// Structure to describe request TLV 0x9E for WDSCreateProfile() +struct sWDSCreateProfileRequest_ApplicationType +{ + eQMIWDSApplicationType mApplicationType; +}; + +// Structure to describe request TLV 0x9F for WDSCreateProfile() +struct sWDSCreateProfileRequest_DataMode +{ + eQMIWDSDataMode mDataMode; +}; + +// Structure to describe request TLV 0xA0 for WDSCreateProfile() +struct sWDSCreateProfileRequest_ApplicationPriority +{ + UINT8 mApplicationPriority; +}; + +// Structure to describe request TLV 0xA1 for WDSCreateProfile() +struct sWDSCreateProfileRequest_APNString +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0xA2 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDNType +{ + eQMIWDSPDNType mPDNType; +}; + +// Structure to describe request TLV 0xA3 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PCSCFAddressNeeded +{ + INT8 mPCSCFAddressNeeded; +}; + +// Structure to describe request TLV 0xA4 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PrimaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA5 for WDSCreateProfile() +struct sWDSCreateProfileRequest_SecondaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA6 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PrimaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0xA7 for WDSCreateProfile() +struct sWDSCreateProfileRequest_SecondaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0xA8 for WDSCreateProfile() +struct sWDSCreateProfileRequest_RATType +{ + eQMIWDS3GPP2RATTypes mRATType; +}; + +// Structure to describe request TLV 0xA9 for WDSCreateProfile() +struct sWDSCreateProfileRequest_3GPP2APNEnabled +{ + INT8 mAPNEnabled; +}; + +// Structure to describe request TLV 0xAA for WDSCreateProfile() +struct sWDSCreateProfileRequest_3GPP2PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerMinutes; +}; + +// Structure to describe request TLV 0xAB for WDSCreateProfile() +struct sWDSCreateProfileRequest_3GPP2APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe response TLV 0x01 for WDSCreateProfile() +struct sWDSCreateProfileResponse_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0xE0 for WDSCreateProfile() +struct sWDSCreateProfileResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSModifyProfile() +struct sWDSModifyProfileRequest_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x10 for WDSModifyProfile() +struct sWDSModifyProfileRequest_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe request TLV 0x11 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe request TLV 0x12 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPHeaderCompressionType +{ + eQMIWDSPDPHeaderCompressionType mPDPHeaderCompressionType; +}; + +// Structure to describe request TLV 0x13 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPDataCompressionType +{ + eQMIWDSPDPDataCompressionType mPDPDataCompressionType; +}; + +// Structure to describe request TLV 0x14 for WDSModifyProfile() +struct sWDSModifyProfileRequest_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0x15 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x16 for WDSModifyProfile() +struct sWDSModifyProfileRequest_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x17 for WDSModifyProfile() +struct sWDSModifyProfileRequest_UMTSRequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x18 for WDSModifyProfile() +struct sWDSModifyProfileRequest_UMTSMinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x19 for WDSModifyProfile() +struct sWDSModifyProfileRequest_GPRSRequestedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1A for WDSModifyProfile() +struct sWDSModifyProfileRequest_GPRSMinimumQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1B for WDSModifyProfile() +struct sWDSModifyProfileRequest_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x1C for WDSModifyProfile() +struct sWDSModifyProfileRequest_Password +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x1D for WDSModifyProfile() +struct sWDSModifyProfileRequest_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe request TLV 0x1E for WDSModifyProfile() +struct sWDSModifyProfileRequest_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x1F for WDSModifyProfile() +struct sWDSModifyProfileRequest_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe request TLV 0x20 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPAccessControlFlag +{ + eQMIWDSPDPAccessControlFlag mPDPAccessControlFlag; +}; + +// Structure to describe request TLV 0x21 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PCSCFAddressUsingDHCP +{ + INT8 mPCSCFAddressUsingDHCP; +}; + +// Structure to describe request TLV 0x22 for WDSModifyProfile() +struct sWDSModifyProfileRequest_IMCNFlag +{ + INT8 mIMCN; +}; + +// Structure to describe request TLV 0x23 for WDSModifyProfile() +struct sWDSModifyProfileRequest_TrafficFlowTemplateID1Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x24 for WDSModifyProfile() +struct sWDSModifyProfileRequest_TrafficFlowTemplateID2Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x25 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPContextNumber +{ + UINT8 mPDPContextNumber; +}; + +// Structure to describe request TLV 0x26 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPContextSecondaryFlag +{ + INT8 mPDPContextSecondaryFlag; +}; + +// Structure to describe request TLV 0x27 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPContextPrimaryID +{ + UINT8 mPDPPrimaryID; +}; + +// Structure to describe request TLV 0x28 for WDSModifyProfile() +struct sWDSModifyProfileRequest_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x29 for WDSModifyProfile() +struct sWDSModifyProfileRequest_RequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2A for WDSModifyProfile() +struct sWDSModifyProfileRequest_MinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2B for WDSModifyProfile() +struct sWDSModifyProfileRequest_PrimaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2C for WDSModifyProfile() +struct sWDSModifyProfileRequest_SecondaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2D for WDSModifyProfile() +struct sWDSModifyProfileRequest_AddressPreference +{ + eQMIWDSAddressAllocationPreference mAddressAllocationPreference; +}; + +// Structure to describe request TLV 0x2E for WDSModifyProfile() +struct sWDSModifyProfileRequest_LTEQoSParameters +{ + eQMIWDSQoSClassIdentifier mQoSClassIdentifier; + UINT32 mGuaranteedDownlinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mMaxUplinkBitrate; +}; + +// Structure to describe request TLV 0x2F for WDSModifyProfile() +struct sWDSModifyProfileRequest_APNDisabled +{ + INT8 mAPNDisabled; +}; + +// Structure to describe request TLV 0x30 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerSeconds; +}; + +// Structure to describe request TLV 0x31 for WDSModifyProfile() +struct sWDSModifyProfileRequest_APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe request TLV 0x90 for WDSModifyProfile() +struct sWDSModifyProfileRequest_NegotiateDNSServerPrefrence +{ + INT8 mNegotiateDNSServerPreference; +}; + +// Structure to describe request TLV 0x91 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PPPSessionCloseTimerDO +{ + UINT32 mPPPSessionCloseTimerDOSeconds; +}; + +// Structure to describe request TLV 0x92 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PPPSessionCloseTimer1X +{ + UINT32 mPPPSessionCloseTimer1XSeconds; +}; + +// Structure to describe request TLV 0x93 for WDSModifyProfile() +struct sWDSModifyProfileRequest_AllowLinger +{ + INT8 mAllowLinger; +}; + +// Structure to describe request TLV 0x94 for WDSModifyProfile() +struct sWDSModifyProfileRequest_LCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x95 for WDSModifyProfile() +struct sWDSModifyProfileRequest_IPCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x96 for WDSModifyProfile() +struct sWDSModifyProfileRequest_AuthenticationTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x97 for WDSModifyProfile() +struct sWDSModifyProfileRequest_LCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x98 for WDSModifyProfile() +struct sWDSModifyProfileRequest_IPCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x99 for WDSModifyProfile() +struct sWDSModifyProfileRequest_AuthenticationRetry +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x9A for WDSModifyProfile() +struct sWDSModifyProfileRequest_AuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe request TLV 0x9B for WDSModifyProfile() +struct sWDSModifyProfileRequest_UserID +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x9C for WDSModifyProfile() +struct sWDSModifyProfileRequest_AuthenticationPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x9D for WDSModifyProfile() +struct sWDSModifyProfileRequest_DataRate +{ + eQMIWDSDataRate mDataRate; +}; + +// Structure to describe request TLV 0x9E for WDSModifyProfile() +struct sWDSModifyProfileRequest_ApplicationType +{ + eQMIWDSApplicationType mApplicationType; +}; + +// Structure to describe request TLV 0x9F for WDSModifyProfile() +struct sWDSModifyProfileRequest_DataMode +{ + eQMIWDSDataMode mDataMode; +}; + +// Structure to describe request TLV 0xA0 for WDSModifyProfile() +struct sWDSModifyProfileRequest_ApplicationPriority +{ + UINT8 mApplicationPriority; +}; + +// Structure to describe request TLV 0xA1 for WDSModifyProfile() +struct sWDSModifyProfileRequest_APNString +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0xA2 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDNType +{ + eQMIWDSPDNType mPDNType; +}; + +// Structure to describe request TLV 0xA3 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PCSCFAddressNeeded +{ + INT8 mPCSCFAddressNeeded; +}; + +// Structure to describe request TLV 0xA4 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PrimaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA5 for WDSModifyProfile() +struct sWDSModifyProfileRequest_SecondaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA6 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PrimaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0xA7 for WDSModifyProfile() +struct sWDSModifyProfileRequest_SecondaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0xA8 for WDSModifyProfile() +struct sWDSModifyProfileRequest_RATType +{ + eQMIWDS3GPP2RATTypes mRATType; +}; + +// Structure to describe request TLV 0xA9 for WDSModifyProfile() +struct sWDSModifyProfileRequest_3GPP2APNEnabled +{ + INT8 mAPNEnabled; +}; + +// Structure to describe request TLV 0xAA for WDSModifyProfile() +struct sWDSModifyProfileRequest_3GPP2PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerMinutes; +}; + +// Structure to describe request TLV 0xAB for WDSModifyProfile() +struct sWDSModifyProfileRequest_3GPP2APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe response TLV 0xE0 for WDSModifyProfile() +struct sWDSModifyProfileResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSDeleteProfile() +struct sWDSDeleteProfileRequest_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0xE0 for WDSDeleteProfile() +struct sWDSDeleteProfileResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x10 for WDSGetProfileList() +struct sWDSGetProfileListRequest_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe request TLV 0x11 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe request TLV 0x12 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPHeaderCompressionType +{ + eQMIWDSPDPHeaderCompressionType mPDPHeaderCompressionType; +}; + +// Structure to describe request TLV 0x13 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPDataCompressionType +{ + eQMIWDSPDPDataCompressionType mPDPDataCompressionType; +}; + +// Structure to describe request TLV 0x14 for WDSGetProfileList() +struct sWDSGetProfileListRequest_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0x15 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x16 for WDSGetProfileList() +struct sWDSGetProfileListRequest_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x17 for WDSGetProfileList() +struct sWDSGetProfileListRequest_UMTSRequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x18 for WDSGetProfileList() +struct sWDSGetProfileListRequest_UMTSMinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x19 for WDSGetProfileList() +struct sWDSGetProfileListRequest_GPRSRequestedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1A for WDSGetProfileList() +struct sWDSGetProfileListRequest_GPRSMinimumQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1B for WDSGetProfileList() +struct sWDSGetProfileListRequest_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x1C for WDSGetProfileList() +struct sWDSGetProfileListRequest_Password +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x1D for WDSGetProfileList() +struct sWDSGetProfileListRequest_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe request TLV 0x1E for WDSGetProfileList() +struct sWDSGetProfileListRequest_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x1F for WDSGetProfileList() +struct sWDSGetProfileListRequest_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe request TLV 0x20 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPAccessControlFlag +{ + eQMIWDSPDPAccessControlFlag mPDPAccessControlFlag; +}; + +// Structure to describe request TLV 0x21 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PCSCFAddressUsingDHCP +{ + INT8 mPCSCFAddressUsingDHCP; +}; + +// Structure to describe request TLV 0x22 for WDSGetProfileList() +struct sWDSGetProfileListRequest_IMCNFlag +{ + INT8 mIMCN; +}; + +// Structure to describe request TLV 0x23 for WDSGetProfileList() +struct sWDSGetProfileListRequest_TrafficFlowTemplateID1Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x24 for WDSGetProfileList() +struct sWDSGetProfileListRequest_TrafficFlowTemplateID2Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x25 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPContextNumber +{ + UINT8 mPDPContextNumber; +}; + +// Structure to describe request TLV 0x26 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPContextSecondaryFlag +{ + INT8 mPDPContextSecondaryFlag; +}; + +// Structure to describe request TLV 0x27 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPContextPrimaryID +{ + UINT8 mPDPPrimaryID; +}; + +// Structure to describe request TLV 0x28 for WDSGetProfileList() +struct sWDSGetProfileListRequest_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x29 for WDSGetProfileList() +struct sWDSGetProfileListRequest_RequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2A for WDSGetProfileList() +struct sWDSGetProfileListRequest_MinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2B for WDSGetProfileList() +struct sWDSGetProfileListRequest_PrimaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2C for WDSGetProfileList() +struct sWDSGetProfileListRequest_SecondaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2D for WDSGetProfileList() +struct sWDSGetProfileListRequest_AddressPreference +{ + eQMIWDSAddressAllocationPreference mAddressAllocationPreference; +}; + +// Structure to describe request TLV 0x2E for WDSGetProfileList() +struct sWDSGetProfileListRequest_LTEQoSParameters +{ + eQMIWDSQoSClassIdentifier mQoSClassIdentifier; + UINT32 mGuaranteedDownlinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mMaxUplinkBitrate; +}; + +// Structure to describe request TLV 0x90 for WDSGetProfileList() +struct sWDSGetProfileListRequest_NegotiateDNSServerPreferences +{ + INT8 mNegotiateDNSServerPreference; +}; + +// Structure to describe request TLV 0x91 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PPPSessionCloseTimerDO +{ + UINT32 mPPPSessionCloseTimerDOSeconds; +}; + +// Structure to describe request TLV 0x92 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PPPSessionCloseTimer1X +{ + UINT32 mPPPSessionCloseTimer1XSeconds; +}; + +// Structure to describe request TLV 0x93 for WDSGetProfileList() +struct sWDSGetProfileListRequest_AllowLinger +{ + INT8 mAllowLinger; +}; + +// Structure to describe request TLV 0x94 for WDSGetProfileList() +struct sWDSGetProfileListRequest_LCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x95 for WDSGetProfileList() +struct sWDSGetProfileListRequest_IPCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x96 for WDSGetProfileList() +struct sWDSGetProfileListRequest_AuthenticationTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x97 for WDSGetProfileList() +struct sWDSGetProfileListRequest_LCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x98 for WDSGetProfileList() +struct sWDSGetProfileListRequest_IPCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x99 for WDSGetProfileList() +struct sWDSGetProfileListRequest_AuthenticationRetry +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x9A for WDSGetProfileList() +struct sWDSGetProfileListRequest_AuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe request TLV 0x9B for WDSGetProfileList() +struct sWDSGetProfileListRequest_UserID +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x9C for WDSGetProfileList() +struct sWDSGetProfileListRequest_AuthenticationPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x9D for WDSGetProfileList() +struct sWDSGetProfileListRequest_DataRate +{ + eQMIWDSDataRate mDataRate; +}; + +// Structure to describe request TLV 0x9E for WDSGetProfileList() +struct sWDSGetProfileListRequest_ApplicationType +{ + eQMIWDSApplicationType mApplicationType; +}; + +// Structure to describe request TLV 0x9F for WDSGetProfileList() +struct sWDSGetProfileListRequest_DataMode +{ + eQMIWDSDataMode mDataMode; +}; + +// Structure to describe request TLV 0xA0 for WDSGetProfileList() +struct sWDSGetProfileListRequest_ApplicationPriority +{ + UINT8 mApplicationPriority; +}; + +// Structure to describe request TLV 0xA1 for WDSGetProfileList() +struct sWDSGetProfileListRequest_APNString +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0xA2 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDNType +{ + eQMIWDSPDNType mPDNType; +}; + +// Structure to describe request TLV 0xA3 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PCSCFAddressNeeded +{ + INT8 mPCSCFAddressNeeded; +}; + +// Structure to describe request TLV 0xA4 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PrimaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA5 for WDSGetProfileList() +struct sWDSGetProfileListRequest_SecondaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA6 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PrimaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0xA7 for WDSGetProfileList() +struct sWDSGetProfileListRequest_SecondaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x01 for WDSGetProfileList() +struct sWDSGetProfileListResponse_ProfileList +{ + UINT8 mNumberOfProfiles; + + struct sProfile + { + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; + UINT8 mProfileNameLength; + + // This array must be the size specified by mProfileNameLength + // char mProfileName[1]; + }; + + // This array must be the size specified by mNumberOfProfiles + // sProfile mProfiles[1]; +}; + +// Structure to describe response TLV 0xE0 for WDSGetProfileList() +struct sWDSGetProfileListResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsRequest_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0x10 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe response TLV 0x11 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe response TLV 0x12 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPHeaderCompressionType +{ + eQMIWDSPDPHeaderCompressionType mPDPHeaderCompressionType; +}; + +// Structure to describe response TLV 0x13 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPDataCompressionType +{ + eQMIWDSPDPDataCompressionType mPDPDataCompressionType; +}; + +// Structure to describe response TLV 0x14 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0x15 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x16 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x17 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_UMTSRequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe response TLV 0x18 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_UMTSMinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe response TLV 0x19 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_GPRSRequestedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe response TLV 0x1A for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_GPRSMinimumQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe response TLV 0x1B for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe response TLV 0x1D for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x1E for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x1F for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe response TLV 0x20 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPAccessControlFlag +{ + eQMIWDSPDPAccessControlFlag mPDPAccessControlFlag; +}; + +// Structure to describe response TLV 0x21 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PCSCFAddressUsingDHCP +{ + INT8 mPCSCFAddressUsingDHCP; +}; + +// Structure to describe response TLV 0x22 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_IMCMFlag +{ + INT8 mIMCN; +}; + +// Structure to describe response TLV 0x23 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_TrafficFlowTemplateID1Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe response TLV 0x24 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_TrafficFlowTemplateID2Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe response TLV 0x25 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPContextNumber +{ + UINT8 mPDPContextNumber; +}; + +// Structure to describe response TLV 0x26 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPContextSecondaryFlag +{ + INT8 mPDPContextSecondaryFlag; +}; + +// Structure to describe response TLV 0x27 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPContextPrimaryID +{ + UINT8 mPDPPrimaryID; +}; + +// Structure to describe response TLV 0x28 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x29 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_RequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe response TLV 0x2A for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_MinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe response TLV 0x2B for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PrimaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x2C for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_SecondaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x2D for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AddressPreference +{ + eQMIWDSAddressAllocationPreference mAddressAllocationPreference; +}; + +// Structure to describe response TLV 0x2E for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_LTEQoSParameters +{ + eQMIWDSQoSClassIdentifier mQoSClassIdentifier; + UINT32 mGuaranteedDownlinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mMaxUplinkBitrate; +}; + +// Structure to describe response TLV 0x2F for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_APNDisabled +{ + INT8 mAPNDisabled; +}; + +// Structure to describe response TLV 0x30 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerSeconds; +}; + +// Structure to describe response TLV 0x31 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe response TLV 0x90 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_NegotiateDNSServerPreference +{ + INT8 mNegotiateDNSServerPreference; +}; + +// Structure to describe response TLV 0x91 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PPPSessionCloseTimerDO +{ + UINT32 mPPPSessionCloseTimerDOSeconds; +}; + +// Structure to describe response TLV 0x92 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PPPSessionCloseTimer1X +{ + UINT32 mPPPSessionCloseTimer1XSeconds; +}; + +// Structure to describe response TLV 0x93 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AllowLinger +{ + INT8 mAllowLinger; +}; + +// Structure to describe response TLV 0x94 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_LCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x95 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_IPCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x96 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AuthenticationTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x97 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_LCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x98 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_IPCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x99 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AuthenticationRetry +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x9A for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe response TLV 0x9B for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_UserID +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe response TLV 0x9C for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AuthenticationPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe response TLV 0x9D for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_DataRate +{ + eQMIWDSDataRate mDataRate; +}; + +// Structure to describe response TLV 0x9E for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_ApplicationType +{ + eQMIWDSApplicationType mApplicationType; +}; + +// Structure to describe response TLV 0x9F for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_DataMode +{ + eQMIWDSDataMode mDataMode; +}; + +// Structure to describe response TLV 0xA0 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_ApplicationPriority +{ + UINT8 mApplicationPriority; +}; + +// Structure to describe response TLV 0xA1 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_APNString +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0xA2 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDNType +{ + eQMIWDSPDNType mPDNType; +}; + +// Structure to describe response TLV 0xA3 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PCSCFAddressNeeded +{ + INT8 mPCSCFAddressNeeded; +}; + +// Structure to describe response TLV 0xA4 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PrimaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0xA5 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_SecondaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0xA6 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PrimaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0xA7 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_SecondaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0xA8 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_RATType +{ + eQMIWDS3GPP2RATTypes mRATType; +}; + +// Structure to describe response TLV 0xA9 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_3GPP2APNEnabled +{ + INT8 mAPNEnabled; +}; + +// Structure to describe response TLV 0xAA for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_3GPP2PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerMinutes; +}; + +// Structure to describe response TLV 0xAB for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_3GPP2APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe response TLV 0xE0 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsRequest_ProfileType +{ + eQMIProfileTypes mProfileType; +}; + +// Structure to describe response TLV 0x10 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe response TLV 0x11 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe response TLV 0x12 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPHeaderCompressionType +{ + eQMIWDSPDPHeaderCompressionType mPDPHeaderCompressionType; +}; + +// Structure to describe response TLV 0x13 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPDataCompressionType +{ + eQMIWDSPDPDataCompressionType mPDPDataCompressionType; +}; + +// Structure to describe response TLV 0x14 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0x15 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x16 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x17 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_UMTSRequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe response TLV 0x18 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_UMTSMinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe response TLV 0x19 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_GPRSRequestedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe response TLV 0x1A for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_GPRSMinimumQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe response TLV 0x1B for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe response TLV 0x1C for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_Password +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe response TLV 0x1D for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x1E for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x1F for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe response TLV 0x20 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPAccessControlFlag +{ + eQMIWDSPDPAccessControlFlag mPDPAccessControlFlag; +}; + +// Structure to describe response TLV 0x21 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PCSCFAddressUsingDHCP +{ + INT8 mPCSCFAddressUsingDHCP; +}; + +// Structure to describe response TLV 0x22 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_IMCNFlag +{ + INT8 mIMCN; +}; + +// Structure to describe response TLV 0x23 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_TrafficFlowTemplateID1Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe response TLV 0x24 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_TrafficFlowTemplateID2Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe response TLV 0x25 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPContextNumber +{ + UINT8 mPDPContextNumber; +}; + +// Structure to describe response TLV 0x26 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPContextSecondaryFlag +{ + INT8 mPDPContextSecondaryFlag; +}; + +// Structure to describe response TLV 0x27 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPContextPrimaryID +{ + UINT8 mPDPPrimaryID; +}; + +// Structure to describe response TLV 0x28 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x29 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_RequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe response TLV 0x2A for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_MinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe response TLV 0x2B for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PrimaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x2C for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_SecondaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x2D for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AddressPreference +{ + eQMIWDSAddressAllocationPreference mAddressAllocationPreference; +}; + +// Structure to describe response TLV 0x2E for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_LTEQoSParameters +{ + eQMIWDSQoSClassIdentifier mQoSClassIdentifier; + UINT32 mGuaranteedDownlinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mMaxUplinkBitrate; +}; + +// Structure to describe response TLV 0x2F for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_APNDisabled +{ + INT8 mAPNDisabled; +}; + +// Structure to describe response TLV 0x30 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerSeconds; +}; + +// Structure to describe response TLV 0x31 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe response TLV 0x90 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_NegotiateDNSServerPreferences +{ + INT8 mNegotiateDNSServerPreference; +}; + +// Structure to describe response TLV 0x91 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PPPSessionCloseTimerDO +{ + UINT32 mPPPSessionCloseTimerDOSeconds; +}; + +// Structure to describe response TLV 0x92 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PPPSessionCloseTimer1X +{ + UINT32 mPPPSessionCloseTimer1XSeconds; +}; + +// Structure to describe response TLV 0x93 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AllowLinger +{ + INT8 mAllowLinger; +}; + +// Structure to describe response TLV 0x94 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_LCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x95 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_IPCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x96 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AuthenticationTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x97 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_LCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x98 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_IPCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x99 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AuthenticationRetry +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x9A for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe response TLV 0x9B for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_UserID +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe response TLV 0x9C for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AuthenticationPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe response TLV 0x9D for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_DataRate +{ + eQMIWDSDataRate mDataRate; +}; + +// Structure to describe response TLV 0x9E for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_ApplicationType +{ + eQMIWDSApplicationType mApplicationType; +}; + +// Structure to describe response TLV 0x9F for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_DataMode +{ + eQMIWDSDataMode mDataMode; +}; + +// Structure to describe response TLV 0xA0 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_ApplicationPriority +{ + UINT8 mApplicationPriority; +}; + +// Structure to describe response TLV 0xA1 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_APNString +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0xA2 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDNType +{ + eQMIWDSPDNType mPDNType; +}; + +// Structure to describe response TLV 0xA3 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PCSCFAddressNeeded +{ + INT8 mPCSCFAddressNeeded; +}; + +// Structure to describe response TLV 0xA4 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PrimaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0xA5 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_SecondaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0xA6 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PrimaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0xA7 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_SecondaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0xA8 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_RATType +{ + eQMIWDS3GPP2RATTypes mRATType; +}; + +// Structure to describe response TLV 0xA9 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_3GPP2APNEnabled +{ + INT8 mAPNEnabled; +}; + +// Structure to describe response TLV 0xAA for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_3GPP2PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerMinutes; +}; + +// Structure to describe response TLV 0xAB for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_3GPP2APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe response TLV 0xE0 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x10 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsRequest_RequestedSettings +{ + bool mProfileID:1; + bool mProfileName:1; + bool mPDPType:1; + bool mAPNName:1; + bool mDNSAddress:1; + bool mGrantedQoS:1; + bool mUsername:1; + bool mAuthenticationProtocol:1; + bool mIPAddress:1; + bool mGatewayInfo:1; + bool mPCSCFAddress:1; + bool mPCSCFServerAddressList:1; + bool mPCSCFDomainNameList:1; + bool mMTU:1; + bool mDomainNameList:1; + bool mIPFamily:1; + bool mIMCNFlag:1; + bool mExtendedTechnology:1; + + // Padding out 14 bits + UINT8 mReserved1:6; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x10 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe response TLV 0x11 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe response TLV 0x14 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0x15 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x16 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x17 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_UMTSGrantedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe response TLV 0x19 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_GPRSGrantedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe response TLV 0x1B for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe response TLV 0x1D for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x1E for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x1F for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_ProfileID +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0x20 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_GatewayAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x21 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_GatewaySubnetMask +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x22 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe response TLV 0x23 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PCSCFServerAddressList +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + UINT8 mIPV4Address[4]; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x24 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PCSCFDomainNameList +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + UINT16 mFQDNLength; + + // This array must be the size specified by mFQDNLength + // char mFQDN[1]; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x25 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_IPv6Address +{ + UINT16 mIPv6Address[8]; + UINT8 mIPPrefixLength; +}; + +// Structure to describe response TLV 0x26 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_IPv6GatewayAddress +{ + UINT16 mIPv6Address[8]; + UINT8 mIPPrefixLength; +}; + +// Structure to describe response TLV 0x27 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PrimaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x28 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_SecondaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x29 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_MTU +{ + UINT32 mMTU; +}; + +// Structure to describe response TLV 0x2A for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_DomainNameList +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + UINT16 mDomainNameLength; + + // This array must be the size specified by mDomainNameLength + // char mDomainName[1]; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x2B for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_IPFamily +{ + eQMIWDSIPFamilies mIPFamily; +}; + +// Structure to describe response TLV 0x2C for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_IMCNFlag +{ + INT8 mIMCN; +}; + +// Structure to describe response TLV 0x2D for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_ExtendedTechnology +{ + eQMIWDSExtendedTechPrefs mExtendedTechnologyPreference; +}; + +// Structure to describe response TLV 0x2E for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PCSCFIPv6AddressList +{ + UINT8 mNumberOfAddresses; + + struct sAddress + { + UINT16 mIPv6Address[8]; + }; + + // This array must be the size specified by mNumberOfAddresses + // sAddress mAddresses[1]; +}; + +// Structure to describe request TLV 0x01 for WDSSetMIPMode() +struct sWDSSetMIPModeRequest_MobileIPMode +{ + eQMIMobileIPModes mMIPMode; +}; + +// Structure to describe response TLV 0x01 for WDSGetMIPMode() +struct sWDSGetMIPModeResponse_MobileIPMode +{ + eQMIMobileIPModes mMIPMode; +}; + +// Structure to describe response TLV 0x01 for WDSGetDormancy() +struct sWDSGetDormancyResponse_DormancyStatus +{ + eQMIDormancyStatus mDormancyStatus; +}; + +// Structure to describe response TLV 0x01 for WDSGetAutoconnectSetting() +struct sWDSGetAutoconnectSettingResponse_Autoconnect +{ + eQMIWDSAutoconnectSettings mAutoconnectSetting; +}; + +// Structure to describe response TLV 0x10 for WDSGetAutoconnectSetting() +struct sWDSGetAutoconnectSettingResponse_Roam +{ + eQMIWDSAutoconnectRoamSettings mAutoconnectRoamSetting; +}; + +// Structure to describe response TLV 0x01 for WDSGetDataSessionDuration() +struct sWDSGetDataSessionDurationResponse_Duration +{ + UINT64 mDataSessionDuration; +}; + +// Structure to describe response TLV 0x10 for WDSGetDataSessionDuration() +struct sWDSGetDataSessionDurationResponse_PreviousDuration +{ + UINT64 mPreviousDataSessionDuration; +}; + +// Structure to describe response TLV 0x11 for WDSGetDataSessionDuration() +struct sWDSGetDataSessionDurationResponse_ActiveDuration +{ + UINT64 mDataSessionActiveDuration; +}; + +// Structure to describe response TLV 0x12 for WDSGetDataSessionDuration() +struct sWDSGetDataSessionDurationResponse_PreviousActiveDuration +{ + UINT64 mPreviousDataSessionActiveDuration; +}; + +// Structure to describe response TLV 0x01 for WDSGetModemStatus() +struct sWDSGetModemStatusResponse_Status +{ + eQMIConnectionStatus mConnectionStatus; + UINT64 mDataSessionDuration; +}; + +// Structure to describe response TLV 0x10 for WDSGetModemStatus() +struct sWDSGetModemStatusResponse_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe indication TLV 0x01 for WDS ModemStatusReport +struct sWDSModemStatusReportIndication_Status +{ + eQMIConnectionStatus mConnectionStatus; +}; + +// Structure to describe indication TLV 0x10 for WDS ModemStatusReport +struct sWDSModemStatusReportIndication_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe response TLV 0x01 for WDSGetDataBearerTechnology() +struct sWDSGetDataBearerTechnologyResponse_Technology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe response TLV 0x10 for WDSGetDataBearerTechnology() +struct sWDSGetDataBearerTechnologyResponse_LastCallTechnology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe request TLV 0x01 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_RequestedStatus +{ + bool mConnectionStatus:1; + bool mLastCallEndReason:1; + bool mRXTXByteTotals:1; + bool mDormancyStatus:1; + bool mDataBearerTechnology:1; + bool mChannelRates:1; + bool mDuration:1; + + // Padding out 25 bits + UINT8 mReserved1:1; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x10 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_ConnectionStatusIndicator +{ + INT8 mReportConnectionStatus; +}; + +// Structure to describe request TLV 0x11 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_TransferStatisticsIndicator +{ + UINT8 mTransferStatisticsIntervalSeconds; + + // Padding out 6 bits + UINT8 mReserved1:6; + + bool mTXByteTotal:1; + bool mRXByteTotal:1; + + // Padding out 24 bits + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x12 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_DormancyStatusIndicator +{ + INT8 mReportDormancyStatus; +}; + +// Structure to describe request TLV 0x13 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_DataBearerTechnologyIndicator +{ + INT8 mReportDataBearerTechnology; +}; + +// Structure to describe request TLV 0x14 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_ChannelRateIndicator +{ + INT8 mReportChannelRate; +}; + +// Structure to describe response TLV 0x10 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_Status +{ + eQMIConnectionStatus mConnectionStatus; + UINT64 mDataSessionDuration; +}; + +// Structure to describe response TLV 0x11 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe response TLV 0x12 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_TXBytes +{ + UINT64 mTXByteTotal; +}; + +// Structure to describe response TLV 0x13 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_RXBytes +{ + UINT64 mRXByteTotal; +}; + +// Structure to describe response TLV 0x14 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_DormancyStatus +{ + eQMIDormancyStatus mDormancyStatus; +}; + +// Structure to describe response TLV 0x15 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_Technology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe response TLV 0x16 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_Rates +{ + UINT32 mChannelTXRatebps; + UINT32 mChannelRXRatebps; + UINT32 mMaxChannelTXRatebps; + UINT32 mMaxChannelRXRatebps; +}; + +// Structure to describe response TLV 0x17 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_PreviousTXBytes +{ + UINT64 mPreviousCallTXByteTotal; +}; + +// Structure to describe response TLV 0x18 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_PreviousRXBytes +{ + UINT64 mPreviousCallRXByteTotal; +}; + +// Structure to describe response TLV 0x19 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_ActiveDuration +{ + UINT64 mDataSessionActiveDuration; +}; + +// Structure to describe response TLV 0x20 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_LastCallTechnology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe indication TLV 0x10 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_Status +{ + eQMIConnectionStatus mConnectionStatus; +}; + +// Structure to describe indication TLV 0x11 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe indication TLV 0x12 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_TXBytes +{ + UINT64 mTXByteTotal; +}; + +// Structure to describe indication TLV 0x13 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_RXBytes +{ + UINT64 mRXByteTotal; +}; + +// Structure to describe indication TLV 0x14 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_DormancyStatus +{ + eQMIDormancyStatus mDormancyStatus; +}; + +// Structure to describe indication TLV 0x15 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_Technology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe indication TLV 0x16 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_Rates +{ + UINT32 mChannelTXRatebps; + UINT32 mChannelRXRatebps; +}; + +// Structure to describe response TLV 0x01 for WDSGetActiveMIPProfile() +struct sWDSGetActiveMIPProfileResponse_Index +{ + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x01 for WDSSetActiveMIPProfile() +struct sWDSSetActiveMIPProfileRequest_Index +{ + char mSPC[6]; + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x01 for WDSGetMIPProfile() +struct sWDSGetMIPProfileRequest_Index +{ + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0x10 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_State +{ + INT8 mEnabled; +}; + +// Structure to describe response TLV 0x11 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_HomeAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x12 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_PrimaryHomeAgentAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x13 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_SecondaryHomeAgentAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x14 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_ReverseTunneling +{ + INT8 mReverseTunneling; +}; + +// Structure to describe response TLV 0x15 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_NAI +{ + // String is variable length, but must be size of the container + // char mNAI[1]; +}; + +// Structure to describe response TLV 0x16 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_HASPI +{ + UINT32 mHASPI; +}; + +// Structure to describe response TLV 0x17 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_AAASPI +{ + UINT32 mAAASPI; +}; + +// Structure to describe response TLV 0x1A for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_HAState +{ + eQMIHAAAAKeyStates mKeyState; +}; + +// Structure to describe response TLV 0x1B for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_AAAState +{ + eQMIHAAAAKeyStates mKeyState; +}; + +// Structure to describe request TLV 0x01 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_Index +{ + char mSPC[6]; + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x10 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_State +{ + INT8 mEnabled; +}; + +// Structure to describe request TLV 0x11 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_HomeAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x12 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_PrimaryHomeAgentAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x13 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_SecondaryHomeAgentAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x14 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_ReverseTunneling +{ + INT8 mReverseTunneling; +}; + +// Structure to describe request TLV 0x15 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_NAI +{ + // String is variable length, but must be size of the container + // char mNAI[1]; +}; + +// Structure to describe request TLV 0x16 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_HASPI +{ + UINT32 mHASPI; +}; + +// Structure to describe request TLV 0x17 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequeste_AAASPI +{ + UINT32 mAAASPI; +}; + +// Structure to describe request TLV 0x18 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_MNHA +{ + // String is variable length, but must be size of the container + // char mMNHAKey[1]; +}; + +// Structure to describe request TLV 0x19 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_MNAAA +{ + // String is variable length, but must be size of the container + // char mMNAAAKey[1]; +}; + +// Structure to describe response TLV 0x10 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_MobileIPMode +{ + eQMIMobileIPModes mMIPMode; +}; + +// Structure to describe response TLV 0x11 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_RetryAttemptLimit +{ + UINT8 mRetryAttemptLimit; +}; + +// Structure to describe response TLV 0x12 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_RetryAttemptInterval +{ + UINT8 mRetryAttemptInterval; +}; + +// Structure to describe response TLV 0x13 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_ReRegistrationPeriod +{ + UINT8 mReRegistrationPeriod; +}; + +// Structure to describe response TLV 0x14 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_ReRegistrationOnlyWithTraffic +{ + INT8 mReRegistrationOnlyWithTraffic; +}; + +// Structure to describe response TLV 0x15 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_MNHAAuthenticatorCalculator +{ + INT8 mMNHAAuthenticatorCalculator; +}; + +// Structure to describe response TLV 0x16 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_MNHARFC2002BISAuthentication +{ + INT8 mMNHARFC2002BISAuthentication; +}; + +// Structure to describe request TLV 0x01 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_SPC +{ + char mSPC[6]; +}; + +// Structure to describe request TLV 0x10 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_MobileIPMode +{ + eQMIMobileIPModes mMIPMode; +}; + +// Structure to describe request TLV 0x11 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_RetryAttemptLimit +{ + UINT8 mRetryAttemptLimit; +}; + +// Structure to describe request TLV 0x12 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_RetryAttemptInterval +{ + UINT8 mRetryAttemptInterval; +}; + +// Structure to describe request TLV 0x13 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_ReRegistrationPeriod +{ + UINT8 mReRegistrationPeriod; +}; + +// Structure to describe request TLV 0x14 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_ReRegistrationOnlyWithTraffic +{ + INT8 mReRegistrationOnlyWithTraffic; +}; + +// Structure to describe request TLV 0x15 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_MNHAAuthenticatorCalculator +{ + INT8 mMNHAAuthenticatorCalculator; +}; + +// Structure to describe request TLV 0x16 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_MNHARFC2002BISAuthentication +{ + INT8 mMNHARFC2002BISAuthentication; +}; + +// Structure to describe response TLV 0x01 for WDSGetLastMIPStatus() +struct sWDSGetLastMIPStatusResponse_Status +{ + UINT8 mLastMIPStatus; +}; + +// Structure to describe response TLV 0x01 for WDSGetANAAAAuthenticationStatus() +struct sWDSGetANAAAAuthenticationStatusResponse_Status +{ + INT8 mANAAAAuthenticated; +}; + +// Structure to describe response TLV 0x01 for WDSGetCurrentDataBearerTechnology() +struct sWDSGetCurrentDataBearerTechnologyResponse_Technology +{ + eQMIWDSNetworkTypes mNetworkType; + + // The following union is based on the value of mNetworkType + union uValOfNetworkType + { + // If the value of mNetworkType == 1 + struct sNetworkTypeIs1 + { + bool mCDMA1x:1; + bool mCDMA1xEvDORev0:1; + bool mCDMA1xEvDORevA:1; + + // Padding out 28 bits + UINT8 mReserved1:5; + UINT8 mReserved2[2]; + UINT8 mReserved3:7; + + bool mNullBearer:1; + + // The following union is for handing both mCDMA1x and mCDMA1xEvDORevA + union uValOfCDMA1x_or_CDMA1xEvDORevA + { + // If the value of mCDMA1x == 1 + struct sCDMA1xIs1 + { + bool mCDMA1xIS95:1; + bool mCDMA1xIS2000:1; + bool mCDMA1xIS2000RelA:1; + + // Padding out 29 bits + UINT8 mReserved4:5; + UINT8 mReserved5[3]; + }; + + sCDMA1xIs1 mCDMA1xIs1; + + // If the value of mCDMA1xEvDORevA == 1 + struct sCDMA1xEvDORevAIs1 + { + bool mCDMA1xEvDORevADPA:1; + bool mCDMA1xEvDORevAMFPA:1; + bool mCDMA1xEvDORevAEMPA:1; + bool mCDMA1xEvDORevAEMPAEHRPD:1; + + // Padding out 28 bits + UINT8 mReserved6:4; + UINT8 mReserved7[3]; + }; + + sCDMA1xEvDORevAIs1 mCDMA1xEvDORevAIs1; + + // Padding out 32 bits + UINT8 mReserved8[4]; + }; + + uValOfCDMA1x_or_CDMA1xEvDORevA mValOfCDMA1x_or_CDMA1xEvDORevA; + }; + + sNetworkTypeIs1 mNetworkTypeIs1; + + // If the value of mNetworkType == 2 + struct sNetworkTypeIs2 + { + bool mWCDMA:1; + bool mGPRS:1; + bool mHSDPA:1; + bool mHSUPA:1; + bool mEDGE:1; + bool mLTE:1; + bool mHSDPAPlus:1; + bool mDualCellHSDPAPlus:1; + + // Padding out 23 bits + UINT8 mReserved9[2]; + UINT8 mReserved10:7; + + bool mNullBearer:1; + }; + + sNetworkTypeIs2 mNetworkTypeIs2; + + // Padding out 64 bits + UINT8 mReserved11[8]; + }; + + uValOfNetworkType mValOfNetworkType; +}; + +// Structure to describe response TLV 0x10 for WDSGetCurrentDataBearerTechnology() +struct sWDSGetCurrentDataBearerTechnologyResponse_LastCallTechnology +{ + eQMIWDSNetworkTypes mNetworkType; + + // The following union is based on the value of mNetworkType + union uValOfNetworkType + { + // If the value of mNetworkType == 1 + struct sNetworkTypeIs1 + { + bool mCDMA1x:1; + bool mCDMA1xEvDORev0:1; + bool mCDMA1xEvDORevA:1; + + // Padding out 28 bits + UINT8 mReserved1:5; + UINT8 mReserved2[2]; + UINT8 mReserved3:7; + + bool mNullBearer:1; + + // The following union is for handing both mCDMA1x and mCDMA1xEvDORevA + union uValOfCDMA1x_or_CDMA1xEvDORevA + { + // If the value of mCDMA1x == 1 + struct sCDMA1xIs1 + { + bool mCDMA1xIS95:1; + bool mCDMA1xIS2000:1; + bool mCDMA1xIS2000RelA:1; + + // Padding out 29 bits + UINT8 mReserved4:5; + UINT8 mReserved5[3]; + }; + + sCDMA1xIs1 mCDMA1xIs1; + + // If the value of mCDMA1xEvDORevA == 1 + struct sCDMA1xEvDORevAIs1 + { + bool mCDMA1xEvDORevADPA:1; + bool mCDMA1xEvDORevAMFPA:1; + bool mCDMA1xEvDORevAEMPA:1; + bool mCDMA1xEvDORevAEMPAEHRPD:1; + + // Padding out 28 bits + UINT8 mReserved6:4; + UINT8 mReserved7[3]; + }; + + sCDMA1xEvDORevAIs1 mCDMA1xEvDORevAIs1; + + // Padding out 32 bits + UINT8 mReserved8[4]; + }; + + uValOfCDMA1x_or_CDMA1xEvDORevA mValOfCDMA1x_or_CDMA1xEvDORevA; + }; + + sNetworkTypeIs1 mNetworkTypeIs1; + + // If the value of mNetworkType == 2 + struct sNetworkTypeIs2 + { + bool mWCDMA:1; + bool mGPRS:1; + bool mHSDPA:1; + bool mHSUPA:1; + bool mEDGE:1; + bool mLTE:1; + bool mHSDPAPlus:1; + bool mDualCellHSDPAPlus:1; + + // Padding out 23 bits + UINT8 mReserved9[2]; + UINT8 mReserved10:7; + + bool mNullBearer:1; + }; + + sNetworkTypeIs2 mNetworkTypeIs2; + + // Padding out 64 bits + UINT8 mReserved11[8]; + }; + + uValOfNetworkType mValOfNetworkType; +}; + +// Structure to describe request TLV 0x10 for WDSGetCallList() +struct sWDSGetCallListRequest_ListType +{ + eQMICallHistoryTypes mCallListType; +}; + +// Structure to describe response TLV 0x10 for WDSGetCallList() +struct sWDSGetCallListResponse_FullList +{ + UINT16 mCallRecords; + + struct sRecord + { + UINT16 mID; + eQMICallTypes mType; + eQMIDataBearerTechnologies mDataBearer; + UINT64 mTimestamp; + UINT8 mIPV4Address[4]; + UINT64 mTotalDuration; + UINT64 mActiveDuration; + UINT64 mRXByteTotal; + UINT64 mTXByteTotal; + eQMICallEndReasons mCallEnd; + UINT8 mPhoneNumberLength; + + // This array must be the size specified by mPhoneNumberLength + // char mPhoneNumber[1]; + }; + + // This array must be the size specified by mCallRecords + // sRecord mRecords[1]; +}; + +// Structure to describe response TLV 0x11 for WDSGetCallList() +struct sWDSGetCallListResponse_IDList +{ + UINT16 mCallRecords; + + struct sRecord + { + UINT16 mID; + }; + + // This array must be the size specified by mCallRecords + // sRecord mRecords[1]; +}; + +// Structure to describe request TLV 0x01 for WDSGetCallRecord() +struct sWDSGetCallRecordRequest_RecordID +{ + UINT16 mID; +}; + +// Structure to describe response TLV 0x01 for WDSGetCallRecord() +struct sWDSGetCallRecordResponse_Record +{ + UINT16 mID; + eQMICallTypes mType; + eQMIDataBearerTechnologies mDataBearer; + UINT64 mTimestamp; + UINT8 mIPV4Address[4]; + UINT64 mTotalDuration; + UINT64 mActiveDuration; + UINT64 mRXByteTotal; + UINT64 mTXByteTotal; + eQMICallEndReasons mCallEnd; + UINT8 mPhoneNumberLength; + + // This array must be the size specified by mPhoneNumberLength + // char mPhoneNumber[1]; +}; + +// Structure to describe response TLV 0x01 for WDSGetCallListMaxSize() +struct sWDSGetCallListMaxSizeResponse_Maximum +{ + UINT16 mCallListMaxSize; +}; + +// Structure to describe request TLV 0x01 for WDSGetDefaultProfileNumber() +struct sWDSGetDefaultProfileNumberRequest_ProfileType +{ + eQMIProfileTypes mProfileType; + eQMIWDSProfileFamily mProfileFamily; +}; + +// Structure to describe response TLV 0x01 for WDSGetDefaultProfileNumber() +struct sWDSGetDefaultProfileNumberResponse_ProfileNumber +{ + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0xE0 for WDSGetDefaultProfileNumber() +struct sWDSGetDefaultProfileNumberResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSSetDefaultProfileNumber() +struct sWDSSetDefaultProfileNumberRequest_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + eQMIWDSProfileFamily mProfileFamily; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0xE0 for WDSSetDefaultProfileNumber() +struct sWDSSetDefaultProfileNumberResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSResetProfile() +struct sWDSResetProfileRequest_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0xE0 for WDSResetProfile() +struct sWDSResetProfileResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSResetProfileParamToInvalid() +struct sWDSResetProfileParamToInvalidRequest_ProfileParam +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; + eQMIWDSProfileParamID mProfileParamID; +}; + +// Structure to describe response TLV 0xE0 for WDSResetProfileParamToInvalid() +struct sWDSResetProfileParamToInvalidResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSSetIPFamilyPreference() +struct sWDSSetIPFamilyPreferenceRequest_IPFamilyPreference +{ + eQMIWDSIPFamilies mIPFamily; +}; + +// Structure to describe request TLV 0x01 for WDSSetAutoconnectSetting() +struct sWDSSetAutoconnectSettingRequest_Autoconnect +{ + eQMIWDSAutoconnectSettings mAutoconnectSetting; +}; + +// Structure to describe request TLV 0x10 for WDSSetAutoconnectSetting() +struct sWDSSetAutoconnectSettingRequest_Roam +{ + eQMIWDSAutoconnectRoamSettings mAutoconnectRoamSetting; +}; + +// Structure to describe response TLV 0x10 for WDSGetDNSSetting() +struct sWDSGetDNSSettingResponse_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x11 for WDSGetDNSSetting() +struct sWDSGetDNSSettingResponse_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x12 for WDSGetDNSSetting() +struct sWDSGetDNSSettingResponse_PrimaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x13 for WDSGetDNSSetting() +struct sWDSGetDNSSettingResponse_SecondaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x10 for WDSSetDNSSetting() +struct sWDSSetDNSSettingRequest_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x11 for WDSSetDNSSetting() +struct sWDSSetDNSSettingRequest_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x12 for WDSSetDNSSetting() +struct sWDSSetDNSSettingRequest_PrimaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x13 for WDSSetDNSSetting() +struct sWDSSetDNSSettingRequest_SecondaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x01 for WDSGetCDMAPreDormancySettings() +struct sWDSGetCDMAPreDormancySettingsResponse_Settings +{ + eQMIWDSCDMAServiceOptions mServiceOption; + eQMIWDSCDMANetworks mDataSessionNetwork; +}; + +// Structure to describe request TLV 0x01 for WDSSetCAMTimer() +struct sWDSSetCAMTimerRequest_Timer +{ + UINT32 mCAMTimerSeconds; +}; + +// Structure to describe response TLV 0x01 for WDSGetCAMTimer() +struct sWDSGetCAMTimerResponse_Timer +{ + UINT32 mCAMTimerSeconds; +}; + +// Structure to describe request TLV 0x01 for WDSSetSCRM() +struct sWDSSetSCRMRequest_SCRM +{ + INT8 mSCRMEnabled; +}; + +// Structure to describe response TLV 0x01 for WDSGetSCRM() +struct sWDSGetSCRMResponse_SCRM +{ + INT8 mSCRMEnabled; +}; + +// Structure to describe request TLV 0x01 for WDSSetRDUD() +struct sWDSSetRDUDRequest_RDUD +{ + INT8 mRDUDEnabled; +}; + +// Structure to describe response TLV 0x01 for WDSGetRDUD() +struct sWDSGetRDUDResponse_RDUD +{ + INT8 mRDUDEnabled; +}; + +// Structure to describe response TLV 0x01 for WDSGetSIPMIPCallType() +struct sWDSGetSIPMIPCallTypeResponse_CallType +{ + eQMIWDSSIPMIPCallTypes mCallType; +}; + +// Structure to describe request TLV 0x01 for WDSSetEVDOPageMonitorPeriod() +struct sWDSSetEVDOPageMonitorPeriodRequest_Period +{ + UINT8 mPageMonitorPeriod; +}; + +// Structure to describe indication TLV 0x01 for WDS EVDOPageMonitorPeriodIndication +struct sWDSEVDOPageMonitorPeriodIndication_Result +{ + eQMIWDSSlotCycleSetResults mSlotCycleSetResult; +}; + +// Structure to describe request TLV 0x01 for WDSSetEVDOLongSleep() +struct sWDSSetEVDOLongSleepRequest_Setting +{ + INT8 mForceLongSleep; +}; + +// Structure to describe response TLV 0x01 for WDSGetEVDOPageMonitorPeriod() +struct sWDSGetEVDOPageMonitorPeriodResponse_Details +{ + UINT8 mPageMonitorPeriod; + INT8 mForceLongSleep; +}; + +// Structure to describe response TLV 0x01 for WDSGetCallThrottleInfo() +struct sWDSGetCallThrottleInfoResponse_Details +{ + UINT32 mEVDOThrottledDelaySeconds; + UINT32 mCDMAThrottledDelaySeconds; +}; + +// Structure to describe request TLV 0x01 for WDSGetNSAPI() +struct sWDSGetNSAPIRequest_APN +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0x01 for WDSGetNSAPI() +struct sWDSGetNSAPIResponse_NSAPI +{ + UINT8 mNSAPICount; + + // This array must be the size specified by mNSAPICount + // UINT8 mNSAPI[1]; +}; + +// Structure to describe request TLV 0x01 for WDSSetDUNCallControlPreference() +struct sWDSSetDUNCallControlPreferenceRequest_Preference +{ + eQMIWDSDUNControlPreferences mDUNControl; +}; + +// Structure to describe request TLV 0x10 for WDSSetDUNCallControlPreference() +struct sWDSSetDUNCallControlPreferenceRequest_AllowDUN +{ + INT8 mAllowDUNCalls; +}; + +// Structure to describe response TLV 0x01 for WDSGetDUNCallControlInfo() +struct sWDSGetDUNCallControlInfoResponse_Status +{ + INT8 mDUNControlEnabled; +}; + +// Structure to describe response TLV 0x10 for WDSGetDUNCallControlInfo() +struct sWDSGetDUNCallControlInfoResponse_AllowDUN +{ + INT8 mAllowDUNCalls; +}; + +// Structure to describe response TLV 0x11 for WDSGetDUNCallControlInfo() +struct sWDSGetDUNCallControlInfoResponse_CurrentClient +{ + INT8 mSetByCurrentClient; +}; + +// Structure to describe request TLV 0x01 for WDSSetDUNCallControlEventReport() +struct sWDSSetDUNCallControlEventReportRequest_CallNotifications +{ + INT8 mEnableDUNCallNotifications; +}; + +// Structure to describe request TLV 0x10 for WDSSetDUNCallControlEventReport() +struct sWDSSetDUNCallControlEventReportRequest_EntitlementNotifications +{ + INT8 mEnableEntitlementNotifications; +}; + +// Structure to describe request TLV 0x11 for WDSSetDUNCallControlEventReport() +struct sWDSSetDUNCallControlEventReportRequest_RedialNotifications +{ + INT8 mEnableSilentRedailNotifications; +}; + +// Structure to describe response TLV 0x01 for WDSSetDUNCallControlEventReport() +struct sWDSSetDUNCallControlEventReportResponse_ReportMask +{ + bool mSendDUNCallNotifications:1; + bool mSendEntitlementNotifications:1; + bool mSendSilentRedailNotifications:1; + + // Padding out 5 bits + UINT8 mReserved1:5; +}; + +// Structure to describe indication TLV 0x01 for WDS DUNCallControlEventReport +struct sWDSDUNCallControlEventReportIndication_Event +{ + eQMIWDSDUNControlEvents mDUNControlEvent; +}; + +// Structure to describe indication TLV 0x10 for WDS DUNCallControlEventReport +struct sWDSDUNCallControlEventReportIndication_CallNotification +{ + INT8 mDUNCallAllowed; +}; + +// Structure to describe indication TLV 0x11 for WDS DUNCallControlEventReport +struct sWDSDUNCallControlEventReportIndication_CallID +{ + UINT8 mDUNCallID; +}; + +// Structure to describe indication TLV 0x12 for WDS DUNCallControlEventReport +struct sWDSDUNCallControlEventReportIndication_PreviousFailureReason +{ + eQMIWDSCallEndReasonTypes mCallEndReasonType; + + // The following union is based on the value of mCallEndReasonType + union uValOfCallEndReasonType + { + // Always present + UINT16 mCallEndReasonValue; + + // If the value of mCallEndReasonType == 1 + struct sCallEndReasonTypeIs1 + { + eQMIWDSMobileIPCallEndReasons mMobileIPCallEndReason; + }; + + sCallEndReasonTypeIs1 mCallEndReasonTypeIs1; + + // If the value of mCallEndReasonType == 2 + struct sCallEndReasonTypeIs2 + { + eQMIWDSInternalCallEndReasons mInternalCallEndReason; + }; + + sCallEndReasonTypeIs2 mCallEndReasonTypeIs2; + + // If the value of mCallEndReasonType == 3 + struct sCallEndReasonTypeIs3 + { + eQMIWDSCallManagerCallEndReasons mCallManagerCallEndReason; + }; + + sCallEndReasonTypeIs3 mCallEndReasonTypeIs3; + + // If the value of mCallEndReasonType == 6 + struct sCallEndReasonTypeIs6 + { + eQMIWDS3GPPCallEndReasons m3GPPCallEndReason; + }; + + sCallEndReasonTypeIs6 mCallEndReasonTypeIs6; + + // If the value of mCallEndReasonType == 7 + struct sCallEndReasonTypeIs7 + { + eQMIWDSPPPCallEndReason mPPPCallEndReason; + }; + + sCallEndReasonTypeIs7 mCallEndReasonTypeIs7; + + // If the value of mCallEndReasonType == 8 + struct sCallEndReasonTypeIs8 + { + eQMIWDSEHRPDCallEndReason mEHRPDCallEndReason; + }; + + sCallEndReasonTypeIs8 mCallEndReasonTypeIs8; + + // If the value of mCallEndReasonType == 9 + struct sCallEndReasonTypeIs9 + { + eQMIWDSIPv6CallEndReason mIPv6CallEndReason; + }; + + sCallEndReasonTypeIs9 mCallEndReasonTypeIs9; + + // Padding out 16 bits + UINT8 mReserved1[2]; + }; + + uValOfCallEndReasonType mValOfCallEndReasonType; +}; + +// Structure to describe request TLV 0x01 for WDSPendingDUNCallControl() +struct sWDSPendingDUNCallControlRequest_Action +{ + INT8 mDUNCallAllowed; +}; + +// Structure to describe response TLV 0x10 for WDSGetPreferredDataSystem() +struct sWDSGetPreferredDataSystemResponse_PreferredDataSystem +{ + eQMIWDSDataSystems mPreferredDataSystem; +}; + +// Structure to describe response TLV 0x10 for WDSGetLastDataCallStatus() +struct sWDSGetLastDataCallStatusResponse_DataCallStatus +{ + eQMIWDSDataCallStatus mDataCallStatus; +}; + +// Structure to describe response TLV 0x11 for WDSGetLastDataCallStatus() +struct sWDSGetLastDataCallStatusResponse_DataCallType +{ + eQMIWDSDataCallTypes mDataCallType; + eQMIWDSTetheredCallTypes mTetheredCallType; +}; + +// Structure to describe request TLV 0x10 for DMSSetEventReport() +struct sDMSSetEventReportRequest_PowerState +{ + INT8 mReportPowerState; +}; + +// Structure to describe request TLV 0x11 for DMSSetEventReport() +struct sDMSSetEventReportRequest_BatteryLevel +{ + UINT8 mBatteryLevelLowerLimit; + UINT8 mBatteryLevelUpperLimit; +}; + +// Structure to describe request TLV 0x12 for DMSSetEventReport() +struct sDMSSetEventReportRequest_PINStatus +{ + INT8 mReportPINStatus; +}; + +// Structure to describe request TLV 0x13 for DMSSetEventReport() +struct sDMSSetEventReportRequest_ActivationState +{ + INT8 mReportActivationState; +}; + +// Structure to describe request TLV 0x14 for DMSSetEventReport() +struct sDMSSetEventReportRequest_OperatingMode +{ + INT8 mReportOperatingMode; +}; + +// Structure to describe request TLV 0x15 for DMSSetEventReport() +struct sDMSSetEventReportRequest_UIMState +{ + INT8 mReportUIMState; +}; + +// Structure to describe request TLV 0x16 for DMSSetEventReport() +struct sDMSSetEventReportRequest_WirelessDisableState +{ + INT8 mReportWirelessDisableState; +}; + +// Structure to describe request TLV 0x17 for DMSSetEventReport() +struct sDMSSetEventReportRequest_PRLInit +{ + INT8 mReportPRLInitialization; +}; + +// Structure to describe indication TLV 0x10 for DMS EventReport +struct sDMSEventReportIndication_PowerState +{ + eQMIDMSPowerSources mPowerSource:1; + bool mBatteryConnected:1; + bool mBatteryCharging:1; + bool mPowerFault:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + + UINT8 mBatteryLevel; +}; + +// Structure to describe indication TLV 0x11 for DMS EventReport +struct sDMSEventReportIndication_PIN1State +{ + eQMIDMSPINStatus mPINStatus; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x12 for DMS EventReport +struct sDMSEventReportIndication_PIN2State +{ + eQMIDMSPINStatus mPINStatus; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x13 for DMS EventReport +struct sDMSEventReportIndication_ActivationState +{ + eQMIDMSActivationStates mActivationState; +}; + +// Structure to describe indication TLV 0x14 for DMS EventReport +struct sDMSEventReportIndication_OperatingMode +{ + eQMIDMSOperatingModes mOperatingMode; +}; + +// Structure to describe indication TLV 0x15 for DMS EventReport +struct sDMSEventReportIndication_UIMState +{ + eQMIDMSUIMStates mUIMState; +}; + +// Structure to describe indication TLV 0x16 for DMS EventReport +struct sDMSEventReportIndication_WirelessDisableState +{ + INT8 mWirelessDisableOn; +}; + +// Structure to describe indication TLV 0x17 for DMS EventReport +struct sDMSEventReportIndication_PRLInit +{ + INT8 mPRLLoaded; +}; + +// Structure to describe response TLV 0x01 for DMSGetDeviceCapabilities() +struct sDMSGetDeviceCapabilitiesResponse_Capabilities +{ + UINT32 mMaxTXRatebps; + UINT32 mMaxRXRatebps; + eQMIDMSDataServiceCapabilities1 mDataServiceCapability; + INT8 mSIMSupported; + UINT8 mRadioInterfaceCount; + + // This array must be the size specified by mRadioInterfaceCount + // eQMIDMSRadioInterfaces mRadioInterface[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetDeviceManfacturer() +struct sDMSGetDeviceManfacturerResponse_Manfacturer +{ + // String is variable length, but must be size of the container + // char mDeviceManfacturer[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetDeviceModel() +struct sDMSGetDeviceModelResponse_Model +{ + // String is variable length, but must be size of the container + // char mDeviceModelID[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetDeviceRevision() +struct sDMSGetDeviceRevisionResponse_Revision +{ + // String is variable length, but must be size of the container + // char mDeviceRevisionID[1]; +}; + +// Structure to describe response TLV 0x10 for DMSGetDeviceRevision() +struct sDMSGetDeviceRevisionResponse_BootCodeRevision +{ + // String is variable length, but must be size of the container + // char mBootCodeRevisionID[1]; +}; + +// Structure to describe response TLV 0x11 for DMSGetDeviceRevision() +struct sDMSGetDeviceRevisionResponse_UQCNRevision +{ + // String is variable length, but must be size of the container + // char mBootCodeRevisionID[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetDeviceVoiceNumber() +struct sDMSGetDeviceVoiceNumberResponse_VoiceNumber +{ + // String is variable length, but must be size of the container + // char mDeviceVoiceNumber[1]; +}; + +// Structure to describe response TLV 0x10 for DMSGetDeviceVoiceNumber() +struct sDMSGetDeviceVoiceNumberResponse_MobileIDNumber +{ + // String is variable length, but must be size of the container + // char mDeviceMobileIDNumber[1]; +}; + +// Structure to describe response TLV 0x11 for DMSGetDeviceVoiceNumber() +struct sDMSGetDeviceVoiceNumberResponse_IMSI +{ + // String is variable length, but must be size of the container + // char mIMSI[1]; +}; + +// Structure to describe response TLV 0x10 for DMSGetDeviceSerialNumbers() +struct sDMSGetDeviceSerialNumbersResponse_ESN +{ + // String is variable length, but must be size of the container + // char mESN[1]; +}; + +// Structure to describe response TLV 0x11 for DMSGetDeviceSerialNumbers() +struct sDMSGetDeviceSerialNumbersResponse_IMEI +{ + // String is variable length, but must be size of the container + // char mIMEI[1]; +}; + +// Structure to describe response TLV 0x12 for DMSGetDeviceSerialNumbers() +struct sDMSGetDeviceSerialNumbersResponse_MEID +{ + // String is variable length, but must be size of the container + // char mMEID[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetPowerState() +struct sDMSGetPowerStateResponse_PowerState +{ + eQMIDMSPowerSources mPowerSource:1; + bool mBatteryConnected:1; + bool mBatteryCharging:1; + bool mPowerFault:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + + UINT8 mBatteryLevel; +}; + +// Structure to describe request TLV 0x01 for DMSUIMSetPINProtection() +struct sDMSUIMSetPINProtectionRequest_Info +{ + UINT8 mPINID; + UINT8 mPINEnabled; + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // char mPINValue[1]; +}; + +// Structure to describe response TLV 0x10 for DMSUIMSetPINProtection() +struct sDMSUIMSetPINProtectionResponse_RetryInfo +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe request TLV 0x01 for DMSUIMVerifyPIN() +struct sDMSUIMVerifyPINRequest_Info +{ + UINT8 mPINID; + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // char mPINValue[1]; +}; + +// Structure to describe response TLV 0x10 for DMSUIMVerifyPIN() +struct sDMSUIMVerifyPINResponse_RetryInfo +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe request TLV 0x01 for DMSUIMUnblockPIN() +struct sDMSUIMUnblockPINRequest_Info1 +{ + UINT8 mPINID; + UINT8 mPUKLength; + + // This array must be the size specified by mPUKLength + // char mPUKValue[1]; +}; + +struct sDMSUIMUnblockPINRequest_Info2 +{ + UINT8 mNewPINLength; + + // This array must be the size specified by mNewPINLength + // char mNewPINValue[1]; +}; + +struct sDMSUIMUnblockPINRequest_Info +{ + sDMSUIMUnblockPINRequest_Info1 mDMSUIMUnblockPINRequest_Info1; + sDMSUIMUnblockPINRequest_Info2 mDMSUIMUnblockPINRequest_Info2; +}; + +// Structure to describe response TLV 0x10 for DMSUIMUnblockPIN() +struct sDMSUIMUnblockPINResponse_RetryInfo +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe request TLV 0x01 for DMSUIMChangePIN() +struct sDMSUIMChangePINRequest_Info1 +{ + UINT8 mPINID; + UINT8 mOldPINLength; + + // This array must be the size specified by mOldPINLength + // char mOldPINValue[1]; +}; + +struct sDMSUIMChangePINRequest_Info2 +{ + UINT8 mNewPINLength; + + // This array must be the size specified by mNewPINLength + // char mNewPINValue[1]; +}; + +struct sDMSUIMChangePINRequest_Info +{ + sDMSUIMChangePINRequest_Info1 mDMSUIMChangePINRequest_Info1; + sDMSUIMChangePINRequest_Info2 mDMSUIMChangePINRequest_Info2; +}; + +// Structure to describe response TLV 0x10 for DMSUIMChangePIN() +struct sDMSUIMChangePINResponse_RetryInfo +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x11 for DMSUIMGetPINStatus() +struct sDMSUIMGetPINStatusResponse_PIN1Status +{ + eQMIDMSPINStatus mPINStatus; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x12 for DMSUIMGetPINStatus() +struct sDMSUIMGetPINStatusResponse_PIN2Status +{ + eQMIDMSPINStatus mPINStatus; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x01 for DMSGetHardwareRevision() +struct sDMSGetHardwareRevisionResponse_HardwareRevision +{ + // String is variable length, but must be size of the container + // char mDeviceHardwareRevision[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetOperatingMode() +struct sDMSGetOperatingModeResponse_OperatingMode +{ + eQMIDMSOperatingModes mOperatingMode; +}; + +// Structure to describe response TLV 0x10 for DMSGetOperatingMode() +struct sDMSGetOperatingModeResponse_OfflineReason +{ + UINT8 mHostImageMismatch:1; + UINT8 mUQCNImageMismatch:1; + UINT8 mIncompatibleUQCN:1; + UINT8 mUQCNCopyIssue:1; + + // Padding out 12 bits + UINT8 mReserved1:4; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x11 for DMSGetOperatingMode() +struct sDMSGetOperatingModeResponse_PlatformRestricted +{ + INT8 mPlatformRestricted; +}; + +// Structure to describe request TLV 0x01 for DMSSetOperatingMode() +struct sDMSSetOperatingModeRequest_OperatingMode +{ + eQMIDMSOperatingModes mOperatingMode; +}; + +// Structure to describe response TLV 0x01 for DMSGetTimestamp() +struct sDMSGetTimestampResponse_Timestamp +{ + UINT64 mTimestamp:48; + + // mSource is of type eQMIDMSTimestampSources + UINT64 mSource:16; +}; + +// Structure to describe response TLV 0x01 for DMSGetPRLVersion() +struct sDMSGetPRLVersionResponse_PRLVersion +{ + UINT16 mPRLVersion; +}; + +// Structure to describe response TLV 0x01 for DMSGetActivationState() +struct sDMSGetActivationStateResponse_ActivationState +{ + eQMIDMSActivationStates mActivationState; +}; + +// Structure to describe request TLV 0x01 for DMSActivateAutomatic() +struct sDMSActivateAutomaticRequest_ActivationCode +{ + UINT8 mCodeLength; + + // This array must be the size specified by mCodeLength + // char mCode[1]; +}; + +// Structure to describe request TLV 0x01 for DMSActivateManual() +struct sDMSActivateManualRequest_ActivationData1 +{ + char mSPC[6]; + UINT16 mSID; + UINT8 mMDNLength; + + // This array must be the size specified by mMDNLength + // char mMDN[1]; +}; + +struct sDMSActivateManualRequest_ActivationData2 +{ + UINT8 mMINLength; + + // This array must be the size specified by mMINLength + // char mMIN[1]; +}; + +struct sDMSActivateManualRequest_ActivationData +{ + sDMSActivateManualRequest_ActivationData1 mDMSActivateManualRequest_ActivationData1; + sDMSActivateManualRequest_ActivationData2 mDMSActivateManualRequest_ActivationData2; +}; + +// Structure to describe request TLV 0x10 for DMSActivateManual() +struct sDMSActivateManualRequest_PRLObsolete +{ + UINT16 mPRLLength; + + // This array must be the size specified by mPRLLength + // UINT8 mPRL[1]; +}; + +// Structure to describe request TLV 0x11 for DMSActivateManual() +struct sDMSActivateManualRequest_MNHAKey +{ + UINT8 mMNHALength; + + // This array must be the size specified by mMNHALength + // char mMNHA[1]; +}; + +// Structure to describe request TLV 0x12 for DMSActivateManual() +struct sDMSActivateManualRequest_MNAAAKey +{ + UINT8 mMNAAALength; + + // This array must be the size specified by mMNAAALength + // char mMNAAA[1]; +}; + +// Structure to describe request TLV 0x13 for DMSActivateManual() +struct sDMSActivateManualRequest_PRL +{ + UINT16 mPRLTotalLength; + UINT16 mPRLSegmentLength; + UINT8 mPRLSegmentID; + + // This array must be the size specified by mPRLSegmentLength + // UINT8 mPRL[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetLockState() +struct sDMSGetLockStateResponse_LockState +{ + eQMIDMSLockStates mLockState; +}; + +// Structure to describe request TLV 0x01 for DMSSetLockState() +struct sDMSSetLockStateRequest_LockState +{ + eQMIDMSLockStates mLockState; + char mLockCode[4]; +}; + +// Structure to describe request TLV 0x01 for DMSSetLockCode() +struct sDMSSetLockCodeRequest_LockCode +{ + char mCurrentLockCode[4]; + char mNewLockCode[4]; +}; + +// Structure to describe response TLV 0x01 for DMSReadUserData() +struct sDMSReadUserDataResponse_UserData +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x01 for DMSWriteUserData() +struct sDMSWriteUserDataRequest_UserData +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe response TLV 0x01 for DMSReadERIData() +struct sDMSReadERIDataResponse_UserData +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x01 for DMSResetFactoryDefaults() +struct sDMSResetFactoryDefaultsRequest_SPC +{ + char mSPC[6]; +}; + +// Structure to describe request TLV 0x01 for DMSValidateSPC() +struct sDMSValidateSPCRequest_SPC +{ + char mSPC[6]; +}; + +// Structure to describe response TLV 0x01 for DMSUIMGetICCID() +struct sDMSUIMGetICCIDResponse_ICCID +{ + // String is variable length, but must be size of the container + // char mICCID[1]; +}; + +// Structure to describe response TLV 0x01 for DMSUIMGetHostLockID() +struct sDMSUIMGetHostLockIDResponse_ID +{ + UINT32 mHostLockCode; +}; + +// Structure to describe request TLV 0x01 for DMSUIMGetControlKeyStatus() +struct sDMSUIMGetControlKeyStatusRequest_Facility +{ + eQMIDMSUIMFacility mFacility; +}; + +// Structure to describe response TLV 0x01 for DMSUIMGetControlKeyStatus() +struct sDMSUIMGetControlKeyStatusResponse_Status +{ + eQMIDMSUIMFacilityStates mFacilityState; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x10 for DMSUIMGetControlKeyStatus() +struct sDMSUIMGetControlKeyStatusResponse_Blocking +{ + INT8 mOperationBlocking; +}; + +// Structure to describe request TLV 0x01 for DMSUIMSetControlKeyProtection() +struct sDMSUIMSetControlKeyProtectionRequest_Facility +{ + eQMIDMSUIMFacility mFacility; + eQMIDMSUIMFacilityStates mFacilityState; + UINT8 mControlKeyLength; + + // This array must be the size specified by mControlKeyLength + // char mControlKey[1]; +}; + +// Structure to describe response TLV 0x10 for DMSUIMSetControlKeyProtection() +struct sDMSUIMSetControlKeyProtectionResponse_Status +{ + UINT8 mRemainingVerifyRetries; +}; + +// Structure to describe request TLV 0x01 for DMSUIMUnblockControlKey() +struct sDMSUIMUnblockControlKeyRequest_Facility +{ + eQMIDMSUIMFacility mFacility; + UINT8 mControlKeyLength; + + // This array must be the size specified by mControlKeyLength + // char mControlKey[1]; +}; + +// Structure to describe response TLV 0x10 for DMSUIMUnblockControlKey() +struct sDMSUIMUnblockControlKeyResponse_Status +{ + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x01 for DMSGetIMSI() +struct sDMSGetIMSIResponse_IMSI +{ + // String is variable length, but must be size of the container + // char mIMSI[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetUIMState() +struct sDMSGetUIMStateResponse_State +{ + eQMIDMSUIMStates mUIMState; +}; + +// Structure to describe response TLV 0x01 for DMSGetBandCapabilities() +struct sDMSGetBandCapabilitiesResponse_Bands +{ + bool mBandClass0ASystem:1; + bool mBandClass0BSystem:1; + bool mBandClass1:1; + bool mBandClass2:1; + bool mBandClass3ASystem:1; + bool mBandClass4:1; + bool mBandClass5:1; + bool mGSMDCS:1; + bool mGSMPrimary:1; + bool mGSMExtended:1; + bool mBandClass6:1; + bool mBandClass7:1; + bool mBandClass8:1; + bool mBandClass9:1; + bool mBandClass10:1; + bool mBandClass11:1; + bool mGSM450:1; + bool mGSM480:1; + bool mGSM750:1; + bool mGSM850:1; + bool mGSMRailways:1; + bool mGSMPCS:1; + bool mWCDMA2100I:1; + bool mWCDMAPCS1900:1; + bool mWCDMADCS1800:1; + bool mWCDMA1700US:1; + bool mWCDMA850:1; + bool mWCDMA800:1; + bool mBandClass12:1; + bool mBandClass14:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mBandClass15:1; + + // Padding out 16 bits + UINT8 mReserved2[2]; + + bool mWCDMA2600:1; + bool mWCDMA900:1; + bool mWCDMA1700Japan:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + bool mBandClass16:1; + bool mBandClass17:1; + bool mBandClass18:1; + bool mBandClass19:1; + + // Padding out 4 bits + UINT8 mReserved4:4; +}; + +// Structure to describe response TLV 0x10 for DMSGetBandCapabilities() +struct sDMSGetBandCapabilitiesResponse_LTEBands +{ + bool mEUTRANBand1:1; + bool mEUTRANBand2:1; + bool mEUTRANBand3:1; + bool mEUTRANBand4:1; + bool mEUTRANBand5:1; + bool mEUTRANBand6:1; + bool mEUTRANBand7:1; + bool mEUTRANBand8:1; + bool mEUTRANBand9:1; + bool mEUTRANBand10:1; + bool mEUTRANBand11:1; + bool mEUTRANBand12:1; + bool mEUTRANBand13:1; + bool mEUTRANBand14:1; + + // Padding out 2 bits + UINT8 mReserved1:2; + + bool mEUTRANBand17:1; + bool mEUTRANBand18:1; + bool mEUTRANBand19:1; + bool mEUTRANBand20:1; + bool mEUTRANBand21:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mEUTRANBand24:1; + bool mEUTRANBand25:1; + + // Padding out 7 bits + UINT8 mReserved3:7; + + bool mEUTRANBand33:1; + bool mEUTRANBand34:1; + bool mEUTRANBand35:1; + bool mEUTRANBand36:1; + bool mEUTRANBand37:1; + bool mEUTRANBand38:1; + bool mEUTRANBand39:1; + bool mEUTRANBand40:1; + bool mEUTRANBand41:1; + + // Padding out 23 bits + UINT8 mReserved4:7; + UINT8 mReserved5[2]; +}; + +// Structure to describe response TLV 0x01 for DMSGetFactorySerialNumber() +struct sDMSGetFactorySerialNumberResponse_ID +{ + // String is variable length, but must be size of the container + // char mFactorySerialNumber[1]; +}; + +// Structure to describe request TLV 0x01 for DMSSetDeviceTime() +struct sDMSSetDeviceTimeRequest_Time +{ + UINT64 mTimeInMilliseconds; +}; + +// Structure to describe request TLV 0x10 for DMSSetDeviceTime() +struct sDMSSetDeviceTimeRequest_Type +{ + eQMIDMSTimeReferences mTimeReference; +}; + +// Structure to describe response TLV 0x01 for DMSGetSoftwareVersion() +struct sDMSGetSoftwareVersionResponse_Version +{ + // String is variable length, but must be size of the container + // char mSoftwareVersion[1]; +}; + +// Structure to describe request TLV 0x01 for DMSSetSPC() +struct sDMSSetSPCRequest_CurrentSPC +{ + char mCurrentSPC[6]; +}; + +// Structure to describe request TLV 0x01 for NASAbort() +struct sNASAbortRequest_TransactionID +{ + UINT16 mTransactionID; +}; + +// Structure to describe request TLV 0x10 for NASSetEventReport() +struct sNASSetEventReportRequest_SignalIndicator +{ + INT8 mReportSignalStrength; + UINT8 mNumberOfThresholds; + + // This array must be the size specified by mNumberOfThresholds + // INT8 mSignalStrengthThresholddBm[1]; +}; + +// Structure to describe request TLV 0x11 for NASSetEventReport() +struct sNASSetEventReportRequest_RFIndicator +{ + INT8 mReportRFInfo; +}; + +// Structure to describe request TLV 0x12 for NASSetEventReport() +struct sNASSetEventReportRequest_RegistrationRejectIndicator +{ + INT8 mReportLUReject; +}; + +// Structure to describe request TLV 0x13 for NASSetEventReport() +struct sNASSetEventReportRequest_RSSIIndicator +{ + INT8 mReportRSSI; + UINT8 mRSSIDelta; +}; + +// Structure to describe request TLV 0x14 for NASSetEventReport() +struct sNASSetEventReportRequest_ECIOIndicator +{ + INT8 mReportECIO; + UINT8 mECIODelta; +}; + +// Structure to describe request TLV 0x15 for NASSetEventReport() +struct sNASSetEventReportRequest_IOIndicator +{ + INT8 mReportIO; + UINT8 mIODelta; +}; + +// Structure to describe request TLV 0x16 for NASSetEventReport() +struct sNASSetEventReportRequest_SINRIndicator +{ + INT8 mReportSINR; + UINT8 mSINRDelta; +}; + +// Structure to describe request TLV 0x17 for NASSetEventReport() +struct sNASSetEventReportRequest_ErrorRateIndicator +{ + INT8 mReportErrorRate; +}; + +// Structure to describe request TLV 0x18 for NASSetEventReport() +struct sNASSetEventReportRequest_RSRQIndicator +{ + INT8 mReportRSRQ; + UINT8 mRSRQDelta; +}; + +// Structure to describe request TLV 0x19 for NASSetEventReport() +struct sNASSetEventReportRequest_ECIOThreshold +{ + INT8 mReportECIO; + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT16 mThreshold[1]; +}; + +// Structure to describe request TLV 0x1A for NASSetEventReport() +struct sNASSetEventReportRequest_SINRThreshold +{ + INT8 mReportSINR; + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // UINT8 mThreshold[1]; +}; + +// Structure to describe indication TLV 0x10 for NAS EventReport +struct sNASEventReportIndication_SignalStrength +{ + INT8 mSignalStrengthdBm; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe indication TLV 0x11 for NAS EventReport +struct sNASEventReportIndication_RFInfo +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + eQMINASRadioInterfaces mRadioInterface; + eQMINASBandClasses mActiveBandClass; + UINT16 mActiveChannel; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x12 for NAS EventReport +struct sNASEventReportIndication_RegistrationReject +{ + eQMINASServiceDomains mServiceDomain; + UINT16 mRejectCause; +}; + +// Structure to describe indication TLV 0x13 for NAS EventReport +struct sNASEventReportIndication_RSSI +{ + UINT8 mRSSIDelta; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe indication TLV 0x14 for NAS EventReport +struct sNASEventReportIndication_ECIO +{ + UINT8 mECIO; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe indication TLV 0x15 for NAS EventReport +struct sNASEventReportIndication_IO +{ + UINT32 mIO; +}; + +// Structure to describe indication TLV 0x16 for NAS EventReport +struct sNASEventReportIndication_SINR +{ + eQMINASSINRLevels mSINR; +}; + +// Structure to describe indication TLV 0x17 for NAS EventReport +struct sNASEventReportIndication_ErrorRate +{ + UINT16 mErrorRate; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe indication TLV 0x18 for NAS EventReport +struct sNASEventReportIndication_RSRQ +{ + INT8 mRSRQ; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe request TLV 0x10 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_SystemSelectIndicator +{ + INT8 mReportSystemSelect; +}; + +// Structure to describe request TLV 0x12 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_DDTMIndicator +{ + INT8 mReportDDTM; +}; + +// Structure to describe request TLV 0x13 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_ServingSystemIndicator +{ + INT8 mReportServingSystem; +}; + +// Structure to describe request TLV 0x14 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_DualStandbyIndicator +{ + INT8 mReportDualStandby; +}; + +// Structure to describe request TLV 0x15 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_SubscriptionInformationIndicator +{ + INT8 mReportSubscriptionInformation; +}; + +// Structure to describe request TLV 0x17 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_NetworkTimeIndicator +{ + INT8 mReportNetworkTime; +}; + +// Structure to describe request TLV 0x18 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_SystemInformationIndicator +{ + INT8 mReportSystemInformation; +}; + +// Structure to describe request TLV 0x19 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_SignalStrengthIndicator +{ + INT8 mReportSignalStrength; +}; + +// Structure to describe request TLV 0x1A for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_ErrorRateIndicator +{ + INT8 mReportErrorRate; +}; + +// Structure to describe request TLV 0x1B for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_NewEVDOUATIIndicator +{ + INT8 mReportNewEVDOUATI; +}; + +// Structure to describe request TLV 0x1C for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_EVDOSessionIndicator +{ + INT8 mReportEVDOSessionClose; +}; + +// Structure to describe request TLV 0x1D for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_ManagedRoamingIndicator +{ + INT8 mReportManagedRoaming; +}; + +// Structure to describe request TLV 0x10 for NASGetSignalStrength() +struct sNASGetSignalStrengthRequest_RequestMask +{ + bool mQueryRSSI:1; + bool mQueryECIO:1; + bool mQueryIO:1; + bool mQuerySINR:1; + bool mQueryErrorRate:1; + + // Padding out 11 bits + UINT8 mReserved1:3; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x01 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_SignalStrength +{ + INT8 mSignalStrengthdBm; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe response TLV 0x10 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_SignalStrengthList +{ + UINT16 mNumberOfInfoInstances; + + struct sInfo + { + INT8 mSignalStrengthdBm; + eQMINASRadioInterfaces mRadioInterface; + }; + + // This array must be the size specified by mNumberOfInfoInstances + // sInfo mInfos[1]; +}; + +// Structure to describe response TLV 0x11 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_RSSIList +{ + UINT16 mNumberOfMeasurements; + + struct sMeasurement + { + UINT8 mRSSIDelta; + eQMINASRadioInterfaces mRadioInterface; + }; + + // This array must be the size specified by mNumberOfMeasurements + // sMeasurement mMeasurements[1]; +}; + +// Structure to describe response TLV 0x12 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_ECIOList +{ + UINT16 mNumberOfMeasurements; + + struct sMeasurement + { + UINT8 mECIO; + eQMINASRadioInterfaces mRadioInterface; + }; + + // This array must be the size specified by mNumberOfMeasurements + // sMeasurement mMeasurements[1]; +}; + +// Structure to describe response TLV 0x13 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_IO +{ + UINT32 mIO; +}; + +// Structure to describe response TLV 0x14 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_SINR +{ + eQMINASSINRLevels mSINR; +}; + +// Structure to describe response TLV 0x15 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_ErrorRateList +{ + UINT16 mNumberOfMeasurements; + + struct sMeasurement + { + UINT16 mErrorRate; + eQMINASRadioInterfaces mRadioInterface; + }; + + // This array must be the size specified by mNumberOfMeasurements + // sMeasurement mMeasurements[1]; +}; + +// Structure to describe response TLV 0x16 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_RSRQ +{ + INT8 mRSRQ; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe request TLV 0x10 for NASPerformNetworkScan() +struct sNASPerformNetworkScanRequest_NetworkMask +{ + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + + // Padding out 5 bits + UINT8 mReserved1:5; +}; + +// Structure to describe response TLV 0x10 for NASPerformNetworkScan() +struct sNASPerformNetworkScanResponse_NetworkInfo +{ + UINT16 mNumberOfInfoInstances; + + struct sNetworkInfo + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + eQMINASInUseStates mInUseStatus:2; + eQMINASRoamingStates mRoamingStatus:2; + eQMINASForbiddenStates mForbiddenStatus:2; + eQMINASPreferredStates mPreferredStatus:2; + UINT8 mDescriptionLength; + + // This array must be the size specified by mDescriptionLength + // char mDescription[1]; + }; + + // This array must be the size specified by mNumberOfInfoInstances + // sNetworkInfo mNetworkInfos[1]; +}; + +// Structure to describe response TLV 0x11 for NASPerformNetworkScan() +struct sNASPerformNetworkScanResponse_NetworkRAT +{ + UINT16 mNumberOfInfoInstances; + + struct sInfo + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + eQMINASRadioAccessTechnologies mRadioAccessTechnology; + }; + + // This array must be the size specified by mNumberOfInfoInstances + // sInfo mInfos[1]; +}; + +// Structure to describe response TLV 0x12 for NASPerformNetworkScan() +struct sNASPerformNetworkScanResponse_PCSInfo +{ + UINT16 mPCSInfoCount; + + struct sPCSInfo + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + INT8 mMNCIncludesPCSDigit; + }; + + // This array must be the size specified by mPCSInfoCount + // sPCSInfo mPCSInfos[1]; +}; + +// Structure to describe request TLV 0x01 for NASInitiateNetworkRegister() +struct sNASInitiateNetworkRegisterRequest_Action +{ + eQMINASRegisterActions mRegisterAction; +}; + +// Structure to describe request TLV 0x10 for NASInitiateNetworkRegister() +struct sNASInitiateNetworkRegisterRequest_ManualInfo +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + eQMINASRadioAccessTechnologies mRadioAccessTechnology; +}; + +// Structure to describe request TLV 0x11 for NASInitiateNetworkRegister() +struct sNASInitiateNetworkRegisterRequest_ChangeDuration +{ + eQMINASChangeDuration mChangeDuration; +}; + +// Structure to describe request TLV 0x12 for NASInitiateNetworkRegister() +struct sNASInitiateNetworkRegisterRequest_PCSInfo +{ + INT8 mMNCIncludesPCSDigit; +}; + +// Structure to describe request TLV 0x10 for NASInitiateAttach() +struct sNASInitiateAttachRequest_Action +{ + eQMINASPSAttachActions mPSAttachAction; +}; + +// Structure to describe response TLV 0x01 for NASGetServingSystem() +struct sNASGetServingSystemResponse_ServingSystem +{ + eQMINASRegistrationStates mRegistrationState; + eQMINASCSPSAttachStates mCSAttachState; + eQMINASCSPSAttachStates mPSAttachState; + eQMINASRegisteredNetworks mRegisteredNetwork; + UINT8 mNumberOfRadioInterfacesInUse; + + // This array must be the size specified by mNumberOfRadioInterfacesInUse + // eQMINASRadioInterfaces mRadioInterface[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetServingSystem() +struct sNASGetServingSystemResponse_RoamingIndicator +{ + eQMINASRoamingIndicators mRoamingIndicator; +}; + +// Structure to describe response TLV 0x11 for NASGetServingSystem() +struct sNASGetServingSystemResponse_DataServices +{ + UINT8 mNumberOfDataCapabilities; + + // This array must be the size specified by mNumberOfDataCapabilities + // eQMINASDataServiceCapabilities2 mDataCapability[1]; +}; + +// Structure to describe response TLV 0x12 for NASGetServingSystem() +struct sNASGetServingSystemResponse_CurrentPLMN +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + UINT8 mDescriptionLength; + + // This array must be the size specified by mDescriptionLength + // char mDescription[1]; +}; + +// Structure to describe response TLV 0x13 for NASGetServingSystem() +struct sNASGetServingSystemResponse_SystemID +{ + UINT16 mSystemID; + UINT16 mNetworkID; +}; + +// Structure to describe response TLV 0x14 for NASGetServingSystem() +struct sNASGetServingSystemResponse_BaseStation +{ + UINT16 mBaseStationID; + UINT32 mLatitude; + UINT32 mLongitude; +}; + +// Structure to describe response TLV 0x15 for NASGetServingSystem() +struct sNASGetServingSystemResponse_RoamingList +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + eQMINASRadioInterfaces mRadioInterface; + eQMINASRoamingIndicators mRoamingIndicator; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x16 for NASGetServingSystem() +struct sNASGetServingSystemResponse_DefaultRoaming +{ + eQMINASRoamingIndicators mRoamingIndicator; +}; + +// Structure to describe response TLV 0x17 for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPP2TimeZone +{ + UINT8 mLeapSeconds; + INT8 mLocalTimeOffset; + INT8 mDaylightSavingsInEffect; +}; + +// Structure to describe response TLV 0x18 for NASGetServingSystem() +struct sNASGetServingSystemResponse_ProtocolRevision +{ + eQMINASRevision mProtocolRevision; +}; + +// Structure to describe response TLV 0x1A for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPPTimeZone +{ + INT8 m3GPPTimeZone; +}; + +// Structure to describe response TLV 0x1B for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPPDaylightSavingsAdjustment +{ + eQMINASDaylightSavingsAdjustment mDaylightSavingsAdjustment; +}; + +// Structure to describe response TLV 0x1C for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPPLocationAreaCode +{ + UINT16 mLocationAreaCode; +}; + +// Structure to describe response TLV 0x1D for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPPCellID +{ + UINT32 mCellID; +}; + +// Structure to describe response TLV 0x1E for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPP2ConcurrentService +{ + eQMINASConcurrentService mConcurrentService; +}; + +// Structure to describe response TLV 0x1F for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPP2PRLIndicator +{ + eQMINASPRLIndicator mPRLIndicator; +}; + +// Structure to describe response TLV 0x20 for NASGetServingSystem() +struct sNASGetServingSystemResponse_DualTransferModeIndication +{ + eQMINASDualTransferMode mDualTransferMode; +}; + +// Structure to describe response TLV 0x21 for NASGetServingSystem() +struct sNASGetServingSystemResponse_DetailedServiceInformation +{ + eQMINASServiceStatus mServiceStatus; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + eQMINASServiceStatus mCDMA1xEVDOServiceStatus; + eQMINASCDMA1xEVDOHybridInformation mCDMA1xEVDOHybridInformation; + eQMINASSystemForbidden mSystemForbidden; +}; + +// Structure to describe response TLV 0x22 for NASGetServingSystem() +struct sNASGetServingSystemResponse_CDMASystemInformation +{ + UINT16 mMobileCountryCode; + UINT8 mIMSI_11_12; +}; + +// Structure to describe response TLV 0x23 for NASGetServingSystem() +struct sNASGetServingSystemResponse_CDMA1xEVDOPersonality +{ + eQMINASCDMA1xEVDOPersonality mCDMA1xEVDOPersonality; +}; + +// Structure to describe response TLV 0x24 for NASGetServingSystem() +struct sNASGetServingSystemResponse_TrackingAreaCode +{ + UINT16 mTrackingAreaCode; +}; + +// Structure to describe response TLV 0x25 for NASGetServingSystem() +struct sNASGetServingSystemResponse_CallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe indication TLV 0x01 for NAS ServingSystemIndication +struct sNASServingSystemIndication_ServingSystem +{ + eQMINASRegistrationStates mRegistrationState; + eQMINASCSPSAttachStates mCSAttachState; + eQMINASCSPSAttachStates mPSAttachState; + eQMINASRegisteredNetworks mRegisteredNetwork; + UINT8 mNumberOfRadioInterfacesInUse; + + // This array must be the size specified by mNumberOfRadioInterfacesInUse + // eQMINASRadioInterfaces mRadioInterface[1]; +}; + +// Structure to describe indication TLV 0x10 for NAS ServingSystemIndication +struct sNASServingSystemIndication_RoamingIndicator +{ + eQMINASRoamingIndicators mRoamingIndicator; +}; + +// Structure to describe indication TLV 0x11 for NAS ServingSystemIndication +struct sNASServingSystemIndication_DataServices +{ + UINT8 mNumberOfDataCapabilities; + + // This array must be the size specified by mNumberOfDataCapabilities + // eQMINASDataServiceCapabilities2 mDataCapability[1]; +}; + +// Structure to describe indication TLV 0x12 for NAS ServingSystemIndication +struct sNASServingSystemIndication_CurrentPLMN +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + UINT8 mDescriptionLength; + + // This array must be the size specified by mDescriptionLength + // char mDescription[1]; +}; + +// Structure to describe indication TLV 0x13 for NAS ServingSystemIndication +struct sNASServingSystemIndication_SystemID +{ + UINT16 mSystemID; + UINT16 mNetworkID; +}; + +// Structure to describe indication TLV 0x14 for NAS ServingSystemIndication +struct sNASServingSystemIndication_BaseStation +{ + UINT16 mBaseStationID; + UINT32 mLatitude; + UINT32 mLongitude; +}; + +// Structure to describe indication TLV 0x15 for NAS ServingSystemIndication +struct sNASServingSystemIndication_RoamingList +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + eQMINASRadioInterfaces mRadioInterface; + eQMINASRoamingIndicators mRoamingIndicator; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x16 for NAS ServingSystemIndication +struct sNASServingSystemIndication_DefaultRoaming +{ + eQMINASRoamingIndicators mRoamingIndicator; +}; + +// Structure to describe indication TLV 0x17 for NAS ServingSystemIndication +struct sNASServingSystemIndication_TimeZone +{ + UINT8 mLeapSeconds; + INT8 mLocalTimeOffset; + INT8 mDaylightSavingsInEffect; +}; + +// Structure to describe indication TLV 0x18 for NAS ServingSystemIndication +struct sNASServingSystemIndication_ProtocolRevision +{ + eQMINASRevision mProtocolRevision; +}; + +// Structure to describe indication TLV 0x19 for NAS ServingSystemIndication +struct sNASServingSystemIndication_PLMNChange +{ + INT8 mPLMNChanged; +}; + +// Structure to describe indication TLV 0x1A for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPPTimeZone +{ + INT8 m3GPPTimeZone; +}; + +// Structure to describe indication TLV 0x1B for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPPDaylightSavingAdjustment +{ + eQMINASDaylightSavingsAdjustment mDaylightSavingsAdjustment; +}; + +// Structure to describe indication TLV 0x1C for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPPUniversalTimeAndZone +{ + UINT16 mYear; + UINT8 mMonth; + UINT8 mDay; + UINT8 mHour; + UINT8 mMinute; + UINT8 mSecond; + INT8 mTimeZoneOffset; +}; + +// Structure to describe indication TLV 0x1D for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPPLocationAreaCode +{ + UINT16 mLocationAreaCode; +}; + +// Structure to describe indication TLV 0x1E for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPPCellID +{ + UINT32 mCellID; +}; + +// Structure to describe indication TLV 0x1F for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPP2ConcurrentService +{ + eQMINASConcurrentService mConcurrentService; +}; + +// Structure to describe indication TLV 0x20 for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPP2PRLIndicator +{ + eQMINASPRLIndicator mPRLIndicator; +}; + +// Structure to describe indication TLV 0x21 for NAS ServingSystemIndication +struct sNASServingSystemIndication_DualTransferModeIndication +{ + eQMINASDualTransferMode mDualTransferMode; +}; + +// Structure to describe indication TLV 0x22 for NAS ServingSystemIndication +struct sNASServingSystemIndication_DetailedServiceInformation +{ + eQMINASServiceStatus mServiceStatus; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + eQMINASServiceStatus mCDMA1xEVDOServiceStatus; + eQMINASCDMA1xEVDOHybridInformation mCDMA1xEVDOHybridInformation; + eQMINASSystemForbidden mSystemForbidden; +}; + +// Structure to describe indication TLV 0x23 for NAS ServingSystemIndication +struct sNASServingSystemIndication_CDMASystemInformation +{ + UINT16 mMobileCountryCode; + UINT8 mIMSI_11_12; +}; + +// Structure to describe indication TLV 0x24 for NAS ServingSystemIndication +struct sNASServingSystemIndication_CDMA1xEVDOPersonality +{ + eQMINASCDMA1xEVDOPersonality mCDMA1xEVDOPersonality; +}; + +// Structure to describe indication TLV 0x25 for NAS ServingSystemIndication +struct sNASServingSystemIndication_TrackingAreaCode +{ + UINT16 mTrackingAreaCode; +}; + +// Structure to describe indication TLV 0x26 for NAS ServingSystemIndication +struct sNASServingSystemIndication_CallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe response TLV 0x01 for NASGetHomeNetwork() +struct sNASGetHomeNetworkResponse_HomeNetwork +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + UINT8 mDescriptionLength; + + // This array must be the size specified by mDescriptionLength + // char mDescription[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetHomeNetwork() +struct sNASGetHomeNetworkResponse_HomeIDs +{ + UINT16 mSystemID; + UINT16 mNetworkID; +}; + +// Structure to describe response TLV 0x11 for NASGetHomeNetwork() +struct sNASGetHomeNetworkResponse_ExtendedHomeNetwork +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + eQMINASNetworkDescriptionDisplays mDisplayNetworkDescription; + eQMINASNetworkDescriptionEncodings mNetworkDescriptionEncoding; + UINT8 mNetworkDescriptionLength; + + // This array must be the size specified by mNetworkDescriptionLength + // UINT8 mNetworkDescription[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetPreferredNetworks() +struct sNASGetPreferredNetworksResponse_Networks +{ + UINT16 mNumberOfPreferredNetworks; + + struct sNetwork + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + + // Padding out 6 bits + UINT8 mReserved1:6; + + bool mGSMCompact:1; + bool mGSM:1; + + // Padding out 6 bits + UINT8 mReserved2:6; + + bool mLTE:1; + bool mUMTS:1; + }; + + // This array must be the size specified by mNumberOfPreferredNetworks + // sNetwork mNetworks[1]; +}; + +// Structure to describe response TLV 0x11 for NASGetPreferredNetworks() +struct sNASGetPreferredNetworksResponse_StaticNetworks +{ + UINT16 mNumberOfPreferredNetworks; + + struct sNetwork + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + + // Padding out 6 bits + UINT8 mReserved1:6; + + bool mGSMCompact:1; + bool mGSM:1; + + // Padding out 6 bits + UINT8 mReserved2:6; + + bool mLTE:1; + bool mUMTS:1; + }; + + // This array must be the size specified by mNumberOfPreferredNetworks + // sNetwork mNetworks[1]; +}; + +// Structure to describe request TLV 0x10 for NASSetPreferredNetworks() +struct sNASSetPreferredNetworksRequest_Networks +{ + UINT16 mNumberOfPreferredNetworks; + + struct sNetwork + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + + // Padding out 6 bits + UINT8 mReserved1:6; + + bool mGSMCompact:1; + bool mGSM:1; + + // Padding out 6 bits + UINT8 mReserved2:6; + + bool mLTE:1; + bool mUMTS:1; + }; + + // This array must be the size specified by mNumberOfPreferredNetworks + // sNetwork mNetworks[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetForbiddenNetworks() +struct sNASGetForbiddenNetworksResponse_Networks +{ + UINT16 mNumberOfForbiddenNetworks; + + struct sNetwork + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + }; + + // This array must be the size specified by mNumberOfForbiddenNetworks + // sNetwork mNetworks[1]; +}; + +// Structure to describe request TLV 0x10 for NASSetForbiddenNetworks() +struct sNASSetForbiddenNetworksRequest_Networks +{ + UINT16 mNumberOfForbiddenNetworks; + + struct sNetwork + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + }; + + // This array must be the size specified by mNumberOfForbiddenNetworks + // sNetwork mNetworks[1]; +}; + +// Structure to describe request TLV 0x01 for NASSetTechnologyPreference() +struct sNASSetTechnologyPreferenceRequest_Preference +{ + // mTechnology must be the first two bits of a UINT8 + // whose remaining bits are described in the optional + // structs following. + + // The following union is based on the value of mTechnology + union uValOfTechnology + { + // Always present + eQMINASTechPrefs mTechnology:2; + + // If the value of mTechnology == 1 + struct sTechnologyIs1 + { + // Padding out 2 bits + UINT8 mReserved1:2; + + UINT8 mAnalog:1; + UINT8 mDigital:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + }; + + sTechnologyIs1 mTechnologyIs1; + + // If the value of mTechnology == 2 + struct sTechnologyIs2 + { + // Padding out 2 bits + UINT8 mReserved3:2; + + UINT8 mGSM:1; + UINT8 mWCDMA:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved4:2; + }; + + sTechnologyIs2 mTechnologyIs2; + + // Padding out 8 bits + UINT8 mReserved5; + }; + + uValOfTechnology mValOfTechnology; + + // Padding out 8 bits + UINT8 mReserved6; + + eQMINASTechPrefDurations mDuration; +}; + +// Structure to describe response TLV 0x01 for NASGetTechnologyPreference() +struct sNASGetTechnologyPreferenceResponse_ActivePreference +{ + // mTechnology must be the first two bits of a UINT8 + // whose remaining bits are described in the optional + // structs following. + + // The following union is based on the value of mTechnology + union uValOfTechnology + { + // Always present + eQMINASTechPrefs mTechnology:2; + + // If the value of mTechnology == 1 + struct sTechnologyIs1 + { + // Padding out 2 bits + UINT8 mReserved1:2; + + UINT8 mAnalog:1; + UINT8 mDigital:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + }; + + sTechnologyIs1 mTechnologyIs1; + + // If the value of mTechnology == 2 + struct sTechnologyIs2 + { + // Padding out 2 bits + UINT8 mReserved3:2; + + UINT8 mGSM:1; + UINT8 mWCDMA:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved4:2; + }; + + sTechnologyIs2 mTechnologyIs2; + + // Padding out 8 bits + UINT8 mReserved5; + }; + + uValOfTechnology mValOfTechnology; + + // Padding out 8 bits + UINT8 mReserved6; + + eQMINASTechPrefDurations mDuration; +}; + +// Structure to describe response TLV 0x10 for NASGetTechnologyPreference() +struct sNASGetTechnologyPreferenceResponse_PersistentPreference +{ + // mTechnology must be the first two bits of a UINT8 + // whose remaining bits are described in the optional + // structs following. + + // The following union is based on the value of mTechnology + union uValOfTechnology + { + // Always present + eQMINASTechPrefs mTechnology:2; + + // If the value of mTechnology == 1 + struct sTechnologyIs1 + { + // Padding out 2 bits + UINT8 mReserved1:2; + + UINT8 mAnalog:1; + UINT8 mDigital:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + }; + + sTechnologyIs1 mTechnologyIs1; + + // If the value of mTechnology == 2 + struct sTechnologyIs2 + { + // Padding out 2 bits + UINT8 mReserved3:2; + + UINT8 mGSM:1; + UINT8 mWCDMA:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved4:2; + }; + + sTechnologyIs2 mTechnologyIs2; + + // Padding out 8 bits + UINT8 mReserved5; + }; + + uValOfTechnology mValOfTechnology; + + // Padding out 8 bits + UINT8 mReserved6; +}; + +// Structure to describe response TLV 0x01 for NASGetACCOLC() +struct sNASGetACCOLCResponse_ACCOLC +{ + UINT8 mACCOLC; +}; + +// Structure to describe request TLV 0x01 for NASSetACCOLC() +struct sNASSetACCOLCRequest_ACCOLC +{ + char mSPC[6]; + UINT8 mACCOLC; +}; + +// Structure to describe indication TLV 0x01 for NAS GetSystemPreference +struct sNASGetSystemPreferenceIndication_Pref +{ + eQMINASSystemPreferences mSystemPreference; +}; + +// Structure to describe response TLV 0x11 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_SCI +{ + UINT8 mSlotCycleIndex; +}; + +// Structure to describe response TLV 0x12 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_SCM +{ + UINT8 mStationClassMark; +}; + +// Structure to describe response TLV 0x13 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_Registration +{ + INT8 mRegisterOnHomeSystem; + INT8 mRegisterOnForeignSystem; + INT8 mRegisterOnForeignNetwork; +}; + +// Structure to describe response TLV 0x14 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_CDMA1xEVDORevision +{ + INT8 mForceCDMA1xEVDORev0; +}; + +// Structure to describe response TLV 0x15 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_CDMA1xEVDOSCPCustom +{ + INT8 mCDMA1xEVDOSCPCustomConfig; + bool mSubtype2PhysicalLayer:1; + bool mEnhancedCCMAC:1; + bool mEnhancedACMAC:1; + bool mEnhancedFTCMAC:1; + bool mSubtype3RTCMAC:1; + bool mSubtype1RTCMAC:1; + bool mEnhancedIdle:1; + bool mGenericMultimodeCapableDiscPort:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; + + bool mGenericBroadcast:1; + + // Padding out 31 bits + UINT8 mReserved2:7; + UINT8 mReserved3[3]; + + bool mSNMultiflowPacketApplication:1; + bool mSNEnhancedMultiflowPacketApplication:1; + + // Padding out 30 bits + UINT8 mReserved4:6; + UINT8 mReserved5[3]; +}; + +// Structure to describe response TLV 0x16 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_Roaming +{ + eQMINASRoamingPreferences mRoamPreference; +}; + +// Structure to describe response TLV 0x17 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_ForceCDMA1xEVDOSCP +{ + eQMINASForceCDMA1xEVDOSCP mForceCDMA1xEVDOSCP; +}; + +// Structure to describe request TLV 0x10 for NASSetNetworkParameters() +struct sNASSetNetworkParametersRequest_SPC +{ + char mSPC[6]; +}; + +// Structure to describe request TLV 0x14 for NASSetNetworkParameters() +struct sNASSetNetworkParametersRequest_CDMA1xEVDORevision +{ + INT8 mForceCDMA1xEVDORev0; +}; + +// Structure to describe request TLV 0x15 for NASSetNetworkParameters() +struct sNASSetNetworkParametersRequest_CDMA1xEVDOSCPCustom +{ + INT8 mCDMA1xEVDOSCPCustomConfig; + bool mSubtype2PhysicalLayer:1; + bool mEnhancedCCMAC:1; + bool mEnhancedACMAC:1; + bool mEnhancedFTCMAC:1; + bool mSubtype3RTCMAC:1; + bool mSubtype1RTCMAC:1; + bool mEnhancedIdle:1; + bool mGenericMultimodeCapableDiscPort:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; + + bool mGenericBroadcast:1; + + // Padding out 31 bits + UINT8 mReserved2:7; + UINT8 mReserved3[3]; + + bool mSNMultiflowPacketApplication:1; + bool mSNEnhancedMultiflowPacketApplication:1; + + // Padding out 30 bits + UINT8 mReserved4:6; + UINT8 mReserved5[3]; +}; + +// Structure to describe request TLV 0x16 for NASSetNetworkParameters() +struct sNASSetNetworkParametersRequest_Roaming +{ + eQMINASRoamingPreferences mRoamPreference; +}; + +// Structure to describe response TLV 0x01 for NASGetRFInfo() +struct sNASGetRFInfoResponse_RFInfo +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + eQMINASRadioInterfaces mRadioInterface; + eQMINASBandClasses mActiveBandClass; + UINT16 mActiveChannel; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x01 for NASGetANAAAAuthenticationStatus() +struct sNASGetANAAAAuthenticationStatusResponse_Status +{ + eQMINASANAAAAuthenticationStatus mANAAAAuthenticationStatus; +}; + +// Structure to describe request TLV 0x10 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_EmergencyMode +{ + INT8 mEmergencyModeOn; +}; + +// Structure to describe request TLV 0x11 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_Mode +{ + bool mCDMA1x:1; + bool mCDMA1xEVDO:1; + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + + // Padding out 11 bits + UINT8 mReserved1:3; + UINT8 mReserved2; +}; + +// Structure to describe request TLV 0x12 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_Band +{ + bool mBandClass0ASystem:1; + bool mBandClass0BSystem:1; + bool mBandClass1:1; + bool mBandClass2:1; + bool mBandClass3ASystem:1; + bool mBandClass4:1; + bool mBandClass5:1; + bool mGSMDCS:1; + bool mGSMPrimary:1; + bool mGSMExtended:1; + bool mBandClass6:1; + bool mBandClass7:1; + bool mBandClass8:1; + bool mBandClass9:1; + bool mBandClass10:1; + bool mBandClass11:1; + bool mGSM450:1; + bool mGSM480:1; + bool mGSM750:1; + bool mGSM850:1; + bool mGSMRailways:1; + bool mGSMPCS:1; + bool mWCDMA2100I:1; + bool mWCDMAPCS1900:1; + bool mWCDMADCS1800:1; + bool mWCDMA1700US:1; + bool mWCDMA850:1; + bool mWCDMA800:1; + bool mBandClass12:1; + bool mBandClass14:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mBandClass15:1; + + // Padding out 16 bits + UINT8 mReserved2[2]; + + bool mWCDMA2600:1; + bool mWCDMA900:1; + bool mWCDMA1700Japan:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + bool mBandClass16:1; + bool mBandClass17:1; + bool mBandClass18:1; + bool mBandClass19:1; + + // Padding out 4 bits + UINT8 mReserved4:4; +}; + +// Structure to describe request TLV 0x13 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_PRL +{ + eQMINASPRLPreferences mPRLPreference; +}; + +// Structure to describe request TLV 0x14 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_Roaming +{ + eQMINASRoamingPreferences2 mRoamingPreference; +}; + +// Structure to describe request TLV 0x15 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_LTEBand +{ + bool mEUTRABand1:1; + bool mEUTRABand2:1; + bool mEUTRABand3:1; + bool mEUTRABand4:1; + bool mEUTRABand5:1; + bool mEUTRABand6:1; + bool mEUTRABand7:1; + bool mEUTRABand8:1; + bool mEUTRABand9:1; + bool mEUTRABand10:1; + bool mEUTRABand11:1; + bool mEUTRABand12:1; + bool mEUTRABand13:1; + bool mEUTRABand14:1; + + // Padding out 2 bits + UINT8 mReserved1:2; + + bool mEUTRABand17:1; + bool mEUTRABand18:1; + bool mEUTRABand19:1; + bool mEUTRABand20:1; + bool mEUTRABand21:1; + + // Padding out 11 bits + UINT8 mReserved2:3; + UINT8 mReserved3; + + bool mEUTRABand33:1; + bool mEUTRABand34:1; + bool mEUTRABand35:1; + bool mEUTRABand36:1; + bool mEUTRABand37:1; + bool mEUTRABand38:1; + bool mEUTRABand39:1; + bool mEUTRABand40:1; +}; + +// Structure to describe request TLV 0x16 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_NetworkSelection +{ + eQMINASNetworkSelection mNetworkSelection; + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; +}; + +// Structure to describe request TLV 0x17 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_ChangeDuration +{ + eQMINASChangeDuration mChangeDuration; +}; + +// Structure to describe request TLV 0x1A for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_PCSInfo +{ + INT8 mMNCIncludesPCSDigit; +}; + +// Structure to describe request TLV 0x1B for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_Domain +{ + eQMINASServiceDomainPrefs mServiceDomainPreference; +}; + +// Structure to describe request TLV 0x1C for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_Acquisition +{ + eQMINASAcquisitionOrder mAcquisitionOrderPreference; +}; + +// Structure to describe response TLV 0x10 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_EmergencyMode +{ + INT8 mEmergencyModeOn; +}; + +// Structure to describe response TLV 0x11 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_Mode +{ + bool mCDMA1x:1; + bool mCDMA1xEVDO:1; + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + + // Padding out 11 bits + UINT8 mReserved1:3; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x12 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_Band +{ + bool mBandClass0ASystem:1; + bool mBandClass0BSystem:1; + bool mBandClass1:1; + bool mBandClass2:1; + bool mBandClass3ASystem:1; + bool mBandClass4:1; + bool mBandClass5:1; + bool mGSMDCS:1; + bool mGSMPrimary:1; + bool mGSMExtended:1; + bool mBandClass6:1; + bool mBandClass7:1; + bool mBandClass8:1; + bool mBandClass9:1; + bool mBandClass10:1; + bool mBandClass11:1; + bool mGSM450:1; + bool mGSM480:1; + bool mGSM750:1; + bool mGSM850:1; + bool mGSMRailways:1; + bool mGSMPCS:1; + bool mWCDMA2100I:1; + bool mWCDMAPCS1900:1; + bool mWCDMADCS1800:1; + bool mWCDMA1700US:1; + bool mWCDMA850:1; + bool mWCDMA800:1; + bool mBandClass12:1; + bool mBandClass14:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mBandClass15:1; + + // Padding out 16 bits + UINT8 mReserved2[2]; + + bool mWCDMA2600:1; + bool mWCDMA900:1; + bool mWCDMA1700Japan:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + bool mBandClass16:1; + bool mBandClass17:1; + bool mBandClass18:1; + bool mBandClass19:1; + + // Padding out 4 bits + UINT8 mReserved4:4; +}; + +// Structure to describe response TLV 0x13 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_PRL +{ + eQMINASPRLPreferences mPRLPreference; +}; + +// Structure to describe response TLV 0x14 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_Roaming +{ + eQMINASRoamingPreferences2 mRoamingPreference; +}; + +// Structure to describe response TLV 0x15 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_LTEBand +{ + bool mEUTRABand1:1; + bool mEUTRABand2:1; + bool mEUTRABand3:1; + bool mEUTRABand4:1; + bool mEUTRABand5:1; + bool mEUTRABand6:1; + bool mEUTRABand7:1; + bool mEUTRABand8:1; + bool mEUTRABand9:1; + bool mEUTRABand10:1; + bool mEUTRABand11:1; + bool mEUTRABand12:1; + bool mEUTRABand13:1; + bool mEUTRABand14:1; + + // Padding out 2 bits + UINT8 mReserved1:2; + + bool mEUTRABand17:1; + bool mEUTRABand18:1; + bool mEUTRABand19:1; + bool mEUTRABand20:1; + bool mEUTRABand21:1; + + // Padding out 11 bits + UINT8 mReserved2:3; + UINT8 mReserved3; + + bool mEUTRABand33:1; + bool mEUTRABand34:1; + bool mEUTRABand35:1; + bool mEUTRABand36:1; + bool mEUTRABand37:1; + bool mEUTRABand38:1; + bool mEUTRABand39:1; + bool mEUTRABand40:1; +}; + +// Structure to describe response TLV 0x16 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_NetworkSelection +{ + eQMINASNetworkSelection mNetworkSelection; +}; + +// Structure to describe response TLV 0x18 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_Domain +{ + eQMINASServiceDomainPrefs mServiceDomainPreference; +}; + +// Structure to describe response TLV 0x19 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_Acquisition +{ + eQMINASAcquisitionOrder mAcquisitionOrderPreference; +}; + +// Structure to describe indication TLV 0x10 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_EmergencyMode +{ + INT8 mEmergencyModeOn; +}; + +// Structure to describe indication TLV 0x11 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_Mode +{ + bool mCDMA1x:1; + bool mCDMA1xEVDO:1; + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + + // Padding out 11 bits + UINT8 mReserved1:3; + UINT8 mReserved2; +}; + +// Structure to describe indication TLV 0x12 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_Band +{ + bool mBandClass0ASystem:1; + bool mBandClass0BSystem:1; + bool mBandClass1:1; + bool mBandClass2:1; + bool mBandClass3ASystem:1; + bool mBandClass4:1; + bool mBandClass5:1; + bool mGSMDCS:1; + bool mGSMPrimary:1; + bool mGSMExtended:1; + bool mBandClass6:1; + bool mBandClass7:1; + bool mBandClass8:1; + bool mBandClass9:1; + bool mBandClass10:1; + bool mBandClass11:1; + bool mGSM450:1; + bool mGSM480:1; + bool mGSM750:1; + bool mGSM850:1; + bool mGSMRailways:1; + bool mGSMPCS:1; + bool mWCDMA2100I:1; + bool mWCDMAPCS1900:1; + bool mWCDMADCS1800:1; + bool mWCDMA1700US:1; + bool mWCDMA850:1; + bool mWCDMA800:1; + bool mBandClass12:1; + bool mBandClass14:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mBandClass15:1; + + // Padding out 16 bits + UINT8 mReserved2[2]; + + bool mWCDMA2600:1; + bool mWCDMA900:1; + bool mWCDMA1700Japan:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + bool mBandClass16:1; + bool mBandClass17:1; + bool mBandClass18:1; + bool mBandClass19:1; + + // Padding out 4 bits + UINT8 mReserved4:4; +}; + +// Structure to describe indication TLV 0x13 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_PRL +{ + eQMINASPRLPreferences mPRLPreference; +}; + +// Structure to describe indication TLV 0x14 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_Roaming +{ + eQMINASRoamingPreferences2 mRoamingPreference; +}; + +// Structure to describe indication TLV 0x15 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_LTEBand +{ + bool mEUTRABand1:1; + bool mEUTRABand2:1; + bool mEUTRABand3:1; + bool mEUTRABand4:1; + bool mEUTRABand5:1; + bool mEUTRABand6:1; + bool mEUTRABand7:1; + bool mEUTRABand8:1; + bool mEUTRABand9:1; + bool mEUTRABand10:1; + bool mEUTRABand11:1; + bool mEUTRABand12:1; + bool mEUTRABand13:1; + bool mEUTRABand14:1; + + // Padding out 2 bits + UINT8 mReserved1:2; + + bool mEUTRABand17:1; + bool mEUTRABand18:1; + bool mEUTRABand19:1; + bool mEUTRABand20:1; + bool mEUTRABand21:1; + + // Padding out 11 bits + UINT8 mReserved2:3; + UINT8 mReserved3; + + bool mEUTRABand33:1; + bool mEUTRABand34:1; + bool mEUTRABand35:1; + bool mEUTRABand36:1; + bool mEUTRABand37:1; + bool mEUTRABand38:1; + bool mEUTRABand39:1; + bool mEUTRABand40:1; +}; + +// Structure to describe indication TLV 0x16 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_NetworkSelection +{ + eQMINASNetworkSelection mNetworkSelection; +}; + +// Structure to describe indication TLV 0x18 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_Domain +{ + eQMINASServiceDomainPrefs mServiceDomainPreference; +}; + +// Structure to describe indication TLV 0x19 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_Acquisition +{ + eQMINASAcquisitionOrder mAcquisitionOrderPreference; +}; + +// Structure to describe request TLV 0x01 for NASSetDDTMPreference() +struct sNASSetDDTMPreferenceRequest_DDTM +{ + eQMINASDDTMPreferences mDDTMPreference; + bool mSuppressL2ACK:1; + bool mSuppress1xRegistrations:1; + bool mIgnoreServiceOptionPages:1; + bool mBlockMobileOriginatedSMSAndDBM:1; + + // Padding out 12 bits + UINT8 mReserved1:4; + UINT8 mReserved2; + + eQMINASServiceOptionActions mServiceOptionAction; + UINT8 mNumberOfInstances; + + // This array must be the size specified by mNumberOfInstances + // UINT16 mServiceOption[1]; +}; + +// Structure to describe response TLV 0x01 for NASGetDDTMPreference() +struct sNASGetDDTMPreferenceResponse_DDTM +{ + eQMINASDDTMPreferences mDDTMPreference; + bool mSuppressL2ACK:1; + bool mSuppress1xRegistrations:1; + bool mIgnoreServiceOptionPages:1; + bool mBlockMobileOriginatedSMSAndDBM:1; + + // Padding out 12 bits + UINT8 mReserved1:4; + UINT8 mReserved2; + + eQMINASServiceOptionActions mServiceOptionAction; + UINT8 mNumberOfInstances; + + // This array must be the size specified by mNumberOfInstances + // UINT16 mServiceOption[1]; +}; + +// Structure to describe indication TLV 0x01 for NAS DDTMPreferenceIndication +struct sNASDDTMPreferenceIndication_DDTM +{ + eQMINASDDTMPreferences mDDTMPreference; + bool mSuppressL2ACK:1; + bool mSuppress1xRegistrations:1; + bool mIgnoreServiceOptionPages:1; + bool mBlockMobileOriginatedSMSAndDBM:1; + + // Padding out 12 bits + UINT8 mReserved1:4; + UINT8 mReserved2; + + eQMINASServiceOptionActions mServiceOptionAction; + UINT8 mNumberOfInstances; + + // This array must be the size specified by mNumberOfInstances + // UINT16 mServiceOption[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetOperatorNameData() +struct sNASGetOperatorNameDataResponse_ServiceProviderName +{ + UINT8 mDisplayCondition; + UINT8 mSPNLength; + + // This array must be the size specified by mSPNLength + // UINT8 mSPN[1]; +}; + +// Structure to describe response TLV 0x11 for NASGetOperatorNameData() +struct sNASGetOperatorNameDataResponse_OperatorPLMNList +{ + UINT16 mPLMNListLength; + + struct sPLNM + { + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + UINT16 mLocationAreaCode1; + UINT16 mLocationAreaCode2; + UINT8 mPLMNNameRecordIdentifier; + }; + + // This array must be the size specified by mPLMNListLength + // sPLNM mPLNMs[1]; +}; + +// Structure to describe response TLV 0x12 for NASGetOperatorNameData() +struct sNASGetOperatorNameDataResponse_PLMNName +{ + UINT8 mPLMNCount; + + struct sPLMNName1 + { + eQMINASPLMNNameEncodingSchemes mPLMNShortEncoding; + eQMINASPLMNNameCountryInitials mPLMNShortCountryInitials; + eQMINASPLMNNameSpareBits mPLMNLongBits; + eQMINASPLMNNameSpareBits mPLMNSpareBits; + UINT8 mPLMNLongLength; + + // This array must be the size specified by mPLMNLongLength + // UINT8 mPLMNLong[1]; + }; + + struct sPLMNName2 + { + UINT8 mPLMNShortLength; + + // This array must be the size specified by mPLMNShortLength + // UINT8 mPLMNShort[1]; + }; + + struct sPLMNName + { + sPLMNName1 mPLMNName1; + sPLMNName2 mPLMNName2; + }; + + // This array must be the size specified by mPLMNCount + // sPLMNName mPLMNNames[1]; +}; + +// Structure to describe response TLV 0x13 for NASGetOperatorNameData() +struct sNASGetOperatorNameDataResponse_OperatorStringName +{ + // String is variable length, but must be size of the container + // char mPLMNOperatorName[1]; +}; + +// Structure to describe response TLV 0x14 for NASGetOperatorNameData() +struct sNASGetOperatorNameDataResponse_NITZInformation1 +{ + eQMINASPLMNNameEncodingSchemes mPLMNShortEncoding; + eQMINASPLMNNameCountryInitials mPLMNShortCountryInitials; + eQMINASPLMNNameSpareBits mPLMNLongBits; + eQMINASPLMNNameSpareBits mPLMNSpareBits; + UINT8 mPLMNLongLength; + + // This array must be the size specified by mPLMNLongLength + // UINT8 mPLMNLong[1]; +}; + +struct sNASGetOperatorNameDataResponse_NITZInformation2 +{ + UINT8 mPLMNShortLength; + + // This array must be the size specified by mPLMNShortLength + // UINT8 mPLMNShort[1]; +}; + +struct sNASGetOperatorNameDataResponse_NITZInformation +{ + sNASGetOperatorNameDataResponse_NITZInformation1 mNASGetOperatorNameDataResponse_NITZInformation1; + sNASGetOperatorNameDataResponse_NITZInformation2 mNASGetOperatorNameDataResponse_NITZInformation2; +}; + +// Structure to describe indication TLV 0x10 for NAS OperatorNameDataIndication +struct sNASOperatorNameDataIndication_ServiceProviderName +{ + UINT8 mDisplayCondition; + UINT8 mSPNLength; + + // This array must be the size specified by mSPNLength + // UINT8 mSPN[1]; +}; + +// Structure to describe indication TLV 0x11 for NAS OperatorNameDataIndication +struct sNASOperatorNameDataIndication_OperatorPLMNList +{ + UINT16 mPLMNListLength; + + struct sPLNM + { + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + UINT16 mLocationAreaCode1; + UINT16 mLocationAreaCode2; + UINT8 mPLMNNameRecordIdentifier; + }; + + // This array must be the size specified by mPLMNListLength + // sPLNM mPLNMs[1]; +}; + +// Structure to describe indication TLV 0x12 for NAS OperatorNameDataIndication +struct sNASOperatorNameDataIndication_PLMNName +{ + UINT8 mPLMNCount; + + struct sPLMNName1 + { + eQMINASPLMNNameEncodingSchemes mPLMNShortEncoding; + eQMINASPLMNNameCountryInitials mPLMNShortCountryInitials; + eQMINASPLMNNameSpareBits mPLMNLongBits; + eQMINASPLMNNameSpareBits mPLMNSpareBits; + UINT8 mPLMNLongLength; + + // This array must be the size specified by mPLMNLongLength + // UINT8 mPLMNLong[1]; + }; + + struct sPLMNName2 + { + UINT8 mPLMNShortLength; + + // This array must be the size specified by mPLMNShortLength + // UINT8 mPLMNShort[1]; + }; + + struct sPLMNName + { + sPLMNName1 mPLMNName1; + sPLMNName2 mPLMNName2; + }; + + // This array must be the size specified by mPLMNCount + // sPLMNName mPLMNNames[1]; +}; + +// Structure to describe indication TLV 0x13 for NAS OperatorNameDataIndication +struct sNASOperatorNameDataIndication_OperatorStringName +{ + // String is variable length, but must be size of the container + // char mPLMNOperatorName[1]; +}; + +// Structure to describe indication TLV 0x14 for NAS OperatorNameDataIndication +struct sNASOperatorNameDataIndication_NITZInformation1 +{ + eQMINASPLMNNameEncodingSchemes mPLMNShortEncoding; + eQMINASPLMNNameCountryInitials mPLMNShortCountryInitials; + eQMINASPLMNNameSpareBits mPLMNLongBits; + eQMINASPLMNNameSpareBits mPLMNSpareBits; + UINT8 mPLMNLongLength; + + // This array must be the size specified by mPLMNLongLength + // UINT8 mPLMNLong[1]; +}; + +struct sNASOperatorNameDataIndication_NITZInformation2 +{ + UINT8 mPLMNShortLength; + + // This array must be the size specified by mPLMNShortLength + // UINT8 mPLMNShort[1]; +}; + +struct sNASOperatorNameDataIndication_NITZInformation +{ + sNASOperatorNameDataIndication_NITZInformation1 mNASOperatorNameDataIndication_NITZInformation1; + sNASOperatorNameDataIndication_NITZInformation2 mNASOperatorNameDataIndication_NITZInformation2; +}; + +// Structure to describe response TLV 0x10 for NASGetCSPPLMNMode() +struct sNASGetCSPPLMNModeResponse_Mode +{ + INT8 mRestrictManualPLMNSelection; +}; + +// Structure to describe indication TLV 0x10 for NAS CSPPLMNModeIndication +struct sNASCSPPLMNModeIndication_Mode +{ + INT8 mRestrictManualPLMNSelection; +}; + +// Structure to describe request TLV 0x01 for NASUpdateAKEY() +struct sNASUpdateAKEYRequest_AKEY +{ + char mAKEY[26]; +}; + +// Structure to describe request TLV 0x01 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoRequest_NAMID +{ + UINT8 mNAMID; +}; + +// Structure to describe response TLV 0x10 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_NAMName +{ + UINT8 mNAMNameLength; + + // This array must be the size specified by mNAMNameLength + // char mNAMName[1]; +}; + +// Structure to describe response TLV 0x11 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_DirectoryNumber +{ + UINT8 mDirectoryNumberLength; + + // This array must be the size specified by mDirectoryNumberLength + // char mDirectoryNumber[1]; +}; + +// Structure to describe response TLV 0x12 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_HomeID +{ + UINT8 mHomeIDCount; + + struct sHomeID + { + UINT16 mSystemID; + UINT16 mNetworkID; + }; + + // This array must be the size specified by mHomeIDCount + // sHomeID mHomeIDs[1]; +}; + +// Structure to describe response TLV 0x13 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_MINBasedIMSI +{ + char mMobileCountryCode[3]; + char mIMSI11_12[2]; + char mIMSIS1[7]; + char mIMSIS2[3]; + UINT8 mIMSIAddressNumber; +}; + +// Structure to describe response TLV 0x14 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_TrueIMSI +{ + char mMobileCountryCode[3]; + char mIMSI11_12[2]; + char mIMSIS1[7]; + char mIMSIS2[3]; + UINT8 mIMSIAddressNumber; +}; + +// Structure to describe response TLV 0x15 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_CDMAChannel +{ + UINT16 mAChannelForPrimaryCarrier; + UINT16 mBChannelForPrimaryCarrier; + UINT16 mAChannelForSecondaryCarrier; + UINT16 mBChannelForSecondaryCarrier; +}; + +// Structure to describe request TLV 0x01 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_NAMID +{ + UINT8 mNAMID; +}; + +// Structure to describe request TLV 0x10 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_DirectoryNumber +{ + UINT8 mDirectoryNumberLength; + + // This array must be the size specified by mDirectoryNumberLength + // char mDirectoryNumber[1]; +}; + +// Structure to describe request TLV 0x11 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_HomeID +{ + UINT8 mHomeIDCount; + + struct sHomeID + { + UINT16 mSystemID; + UINT16 mNetworkID; + }; + + // This array must be the size specified by mHomeIDCount + // sHomeID mHomeIDs[1]; +}; + +// Structure to describe request TLV 0x12 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_MINBasedIMSI +{ + char mMobileCountryCode[3]; + char mIMSI11_12[2]; + char mIMSIS1[7]; + char mIMSIS2[3]; + UINT8 mIMSIAddressNumber; +}; + +// Structure to describe request TLV 0x13 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_TrueIMSI +{ + char mMobileCountryCode[3]; + char mIMSI11_12[2]; + char mIMSIS1[7]; + char mIMSIS2[3]; + UINT8 mIMSIAddressNumber; +}; + +// Structure to describe request TLV 0x14 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_CDMAChannel +{ + UINT16 mAChannelForPrimaryCarrier; + UINT16 mBChannelForPrimaryCarrier; + UINT16 mAChannelForSecondaryCarrier; + UINT16 mBChannelForSecondaryCarrier; +}; + +// Structure to describe request TLV 0x15 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_NAMName +{ + UINT8 mNAMNameLength; + + // This array must be the size specified by mNAMNameLength + // char mNAMName[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetMobileCAIRevision() +struct sNASGetMobileCAIRevisionResponse_CAIRevision +{ + eQMINASRevision mCAIRevision; +}; + +// Structure to describe response TLV 0x10 for NASGetRTREConfig() +struct sNASGetRTREConfigResponse_CurrentRTREConfig +{ + eQMINASRTREConfiguration mRTREConfiguration; +}; + +// Structure to describe response TLV 0x11 for NASGetRTREConfig() +struct sNASGetRTREConfigResponse_RTREConfigPreference +{ + eQMINASRTREConfiguration mRTREConfiguration; +}; + +// Structure to describe request TLV 0x01 for NASSetRTREConfig() +struct sNASSetRTREConfigRequest_RTREConfig +{ + eQMINASRTREConfiguration mRTREConfiguration; +}; + +// Structure to describe response TLV 0x10 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_GERANInfo +{ + UINT32 mCellID; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileCountryCode0:4; + UINT8 mMobileCountryCode1:4; + UINT8 mMobileCountryCode2:4; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileNetworkCode0:4; + UINT8 mMobileNetworkCode1:4; + UINT8 mMobileNetworkCode2:4; + + UINT16 mLocationAreaCode; + UINT16 mUTRAAbsoluteRFChannelNumber; + UINT8 mBCC:3; + UINT8 mNCC:3; + + // Padding out 2 bits + UINT8 mReserved1:2; + + UINT32 mTimingAdvance; + eQMINASRXLevel mRXLevel; + UINT8 mNMRCellCount; + + struct sNMRCell + { + UINT32 mCellID; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mPLMNMobileCountryCode0:4; + UINT8 mPLMNMobileCountryCode1:4; + UINT8 mPLMNMobileCountryCode2:4; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mPLMNMobileNetworkCode0:4; + UINT8 mPLMNMobileNetworkCode1:4; + UINT8 mPLMNMobileNetworkCode2:4; + + UINT16 mLocationAreaCode; + UINT16 mUTRAAbsoluteRFChannelNumber; + UINT8 mBaseStationIdentityCodeBCC:3; + UINT8 mBaseStationIdentityCodeNCC:3; + + // Padding out 2 bits + UINT8 mReserved2:2; + + eQMINASRXLevel mRXLevel; + }; + + // This array must be the size specified by mNMRCellCount + // sNMRCell mNMRCells[1]; +}; + +// Structure to describe response TLV 0x11 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_UMTSInfo1 +{ + UINT32 mCellID; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileCountryCode0:4; + UINT8 mMobileCountryCode1:4; + UINT8 mMobileCountryCode2:4; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileNetworkCode0:4; + UINT8 mMobileNetworkCode1:4; + UINT8 mMobileNetworkCode2:4; + + UINT16 mLocationAreaCode; + UINT16 mUTRAAbsoluteRFChannelNumber; + UINT16 mPrimaryScramblingCode; + INT16 mReceivedSignalCodePower; + INT16 mECIO; + UINT8 mUTRAUMTSMonitoredCellCount; + + struct sUMTSMonitoredCell + { + UINT16 mUTRAAbsoluteRFChannelNumber; + UINT16 mPrimaryScramblingCode; + INT16 mReceivedSignalCodePower; + INT16 mECIO; + }; + + // This array must be the size specified by mUTRAUMTSMonitoredCellCount + // sUMTSMonitoredCell mUMTSMonitoredCells[1]; +}; + +struct sNASGetCellLocationInfoResponse_UMTSInfo2 +{ + UINT8 mGERANNBRCellCount; + + struct sGERANNBRCell + { + UINT16 mAbsoluteRFChannelNumber; + UINT8 mNetworkColorCode; + UINT8 mBaseStationColorCode; + INT16 mRSSI; + }; + + // This array must be the size specified by mGERANNBRCellCount + // sGERANNBRCell mGERANNBRCells[1]; +}; + +struct sNASGetCellLocationInfoResponse_UMTSInfo +{ + sNASGetCellLocationInfoResponse_UMTSInfo1 mNASGetCellLocationInfoResponse_UMTSInfo1; + sNASGetCellLocationInfoResponse_UMTSInfo2 mNASGetCellLocationInfoResponse_UMTSInfo2; +}; + +// Structure to describe response TLV 0x12 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_CDMAInfo +{ + UINT16 mSystemID; + UINT16 mNetworkID; + UINT16 mBaseStationID; + UINT16 mReferencePN; + UINT32 mLatitude; + UINT32 mLongitude; +}; + +// Structure to describe response TLV 0x13 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_IntrafrequencyLTEInfo +{ + INT8 mUEInIdleMode; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileCountryCode0:4; + UINT8 mMobileCountryCode1:4; + UINT8 mMobileCountryCode2:4; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileNetworkCode0:4; + UINT8 mMobileNetworkCode1:4; + UINT8 mMobileNetworkCode2:4; + + UINT16 mTrackingAreaCode; + UINT32 mGlobalCellID; + UINT16 mEUTRAAbsoluteRFChannelNumber; + UINT16 mServingCellID; + UINT8 mCellReselectionPriority; + UINT8 mSNonIntraSearchThreshold; + UINT8 mServingCellLowThreshold; + UINT8 mSIntraSearchThreshold; + UINT8 mCellCount; + + struct sCell + { + UINT16 mPhysicalCellID; + INT16 mRSRQ; + INT16 mRSRP; + INT16 mRSSI; + INT16 mCellSelectionRXLevel; + }; + + // This array must be the size specified by mCellCount + // sCell mCells[1]; +}; + +// Structure to describe response TLV 0x14 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_InterfrequencyLTEInfo +{ + INT8 mUEInIdleMode; + UINT8 mFrequencyCount; + + struct sFrequency + { + UINT16 mEUTRAAbsoluteRFChannelNumber; + UINT8 mCellSelectionRXLevelLowThreshold; + UINT8 mCellSelectionRXLevelHighThreshold; + UINT8 mCellReselectionPriority; + UINT8 mCellCount; + + struct sCell + { + UINT16 mPhysicalCellID; + INT16 mRSRQ; + INT16 mRSRP; + INT16 mRSSI; + INT16 mCellSelectionRXLevel; + }; + + // This array must be the size specified by mCellCount + // sCell mCells[1]; + }; + + // This array must be the size specified by mFrequencyCount + // sFrequency mFrequencys[1]; +}; + +// Structure to describe response TLV 0x15 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_LTEInfoNeighboringGSM +{ + INT8 mUEInIdleMode; + UINT8 mFrequencyCount; + + struct sFrequency + { + UINT8 mCellReselectionPriority; + UINT8 mCellReselectionHighThreshold; + UINT8 mCellReselectionLowThreshold; + + // Bitfield arrays are not possible in c, unrolling the array + bool mNCCPermitted0:1; + bool mNCCPermitted1:1; + bool mNCCPermitted2:1; + bool mNCCPermitted3:1; + bool mNCCPermitted4:1; + bool mNCCPermitted5:1; + bool mNCCPermitted6:1; + bool mNCCPermitted7:1; + + UINT8 mCellCount; + + struct sCell + { + UINT16 mAbsoluteRFChannelNumber; + INT8 mBandIs1900; + INT8 mCellIDValid; + UINT8 mBCC:3; + UINT8 mNCC:3; + + // Padding out 2 bits + UINT8 mReserved1:2; + + INT16 mRSSI; + INT16 mCellSelectionRXLevel; + }; + + // This array must be the size specified by mCellCount + // sCell mCells[1]; + }; + + // This array must be the size specified by mFrequencyCount + // sFrequency mFrequencys[1]; +}; + +// Structure to describe response TLV 0x16 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_LTEInfoNeighboringWCDMA +{ + INT8 mUEInIdleMode; + UINT8 mFrequencyCount; + + struct sFrequency + { + UINT16 mUTRAAbsoluteRFChannelNumber; + UINT8 mCellReselectionPriority; + UINT8 mCellReselectionHighThreshold; + UINT8 mCellReselectionLowThreshold; + UINT8 mCellCount; + + struct sCell + { + UINT16 mPrimaryScramblingCode; + INT16 mCPICHRSCP; + INT16 mCPICHEcNo; + INT16 mCellSelectionRXLevel; + }; + + // This array must be the size specified by mCellCount + // sCell mCells[1]; + }; + + // This array must be the size specified by mFrequencyCount + // sFrequency mFrequencys[1]; +}; + +// Structure to describe request TLV 0x01 for NASGetPLMNName() +struct sNASGetPLMNNameRequest_PLMN +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; +}; + +// Structure to describe response TLV 0x10 for NASGetPLMNName() +struct sNASGetPLMNNameResponse_Name1 +{ + eQMINASPLMNNameEncodingSchemes mSPNEncoding; + UINT8 mSPNLength; + + // This array must be the size specified by mSPNLength + // UINT8 mSPN[1]; +}; + +struct sNASGetPLMNNameResponse_Name2 +{ + eQMINASPLMNNameEncodingSchemes mPLMNShortEncoding; + eQMINASPLMNNameCountryInitials mPLMNShortCountryInitials; + eQMINASPLMNNameSpareBits mPLMNSpareBits; + UINT8 mPLMNShortLength; + + // This array must be the size specified by mPLMNShortLength + // UINT8 mPLMNShort[1]; +}; + +struct sNASGetPLMNNameResponse_Name3 +{ + eQMINASPLMNNameEncodingSchemes mPLMNLongEncoding; + eQMINASPLMNNameCountryInitials mPLMNLongCountryInitials; + eQMINASPLMNNameSpareBits mPLMNLongBits; + UINT8 mPLMNLongLength; + + // This array must be the size specified by mPLMNLongLength + // UINT8 mPLMNLong[1]; +}; + +struct sNASGetPLMNNameResponse_Name +{ + sNASGetPLMNNameResponse_Name1 mNASGetPLMNNameResponse_Name1; + sNASGetPLMNNameResponse_Name2 mNASGetPLMNNameResponse_Name2; + sNASGetPLMNNameResponse_Name3 mNASGetPLMNNameResponse_Name3; +}; + +// Structure to describe request TLV 0x01 for NASBindSubscription() +struct sNASBindSubscriptionRequest_SubscriptionType +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe indication TLV 0x10 for NAS DualStandbyPrefIndication +struct sNASDualStandbyPrefIndication_StandbyPreference +{ + eQMINASStandbyPreference mStandbyPreference; + eQMINASSubscriptionType mPrioritySubscription; + eQMINASSubscriptionType mActiveSubscription; + eQMINASSubscriptionType mDefaultDataSubscription; +}; + +// Structure to describe indication TLV 0x10 for NAS SubscriptionInfoIndication +struct sNASSubscriptionInfoIndication_PrioritySubscriptionInfo +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe indication TLV 0x11 for NAS SubscriptionInfoIndication +struct sNASSubscriptionInfoIndication_ActiveSubscriptionInfo +{ + eQMINASActiveSubscription mActiveSubscription; +}; + +// Structure to describe indication TLV 0x12 for NAS SubscriptionInfoIndication +struct sNASSubscriptionInfoIndication_DefaultDataSubscriptionInfo +{ + INT8 mDefaultDataSubscription; +}; + +// Structure to describe response TLV 0x10 for NASGetModePref() +struct sNASGetModePrefResponse_ModePreferenceForIDX0 +{ + bool mCDMA1x:1; + bool mCDMA1xEVDO:1; + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + + // Padding out 11 bits + UINT8 mReserved1:3; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x11 for NASGetModePref() +struct sNASGetModePrefResponse_ModePreferenceForIDX1 +{ + bool mCDMA1x:1; + bool mCDMA1xEVDO:1; + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + + // Padding out 11 bits + UINT8 mReserved1:3; + UINT8 mReserved2; +}; + +// Structure to describe request TLV 0x10 for NASSetDualStandbyPreference() +struct sNASSetDualStandbyPreferenceRequest_StandbyPreference +{ + eQMINASStandbyPreference mStandbyPreference; +}; + +// Structure to describe request TLV 0x11 for NASSetDualStandbyPreference() +struct sNASSetDualStandbyPreferenceRequest_PrioritySubs +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe request TLV 0x12 for NASSetDualStandbyPreference() +struct sNASSetDualStandbyPreferenceRequest_DefaultDataSubs +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe indication TLV 0x01 for NAS NetworkTimeIndication +struct sNASNetworkTimeIndication_UniversalTime +{ + UINT16 mYear; + UINT8 mMonth; + UINT8 mDay; + UINT8 mHour; + UINT8 mMinute; + UINT8 mSecond; + eQMINASDayOfWeek mDayOfWeek; +}; + +// Structure to describe indication TLV 0x10 for NAS NetworkTimeIndication +struct sNASNetworkTimeIndication_TimeZone +{ + INT8 mTimeZoneOffset; +}; + +// Structure to describe indication TLV 0x11 for NAS NetworkTimeIndication +struct sNASNetworkTimeIndication_DaylightSavingAdjustment +{ + eQMINASDaylightSavingsAdjustment mDaylightSavingsAdjustment; +}; + +// Structure to describe response TLV 0x10 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_CDMAServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe response TLV 0x11 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_CDMA1xEVDOServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe response TLV 0x12 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_GSMServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe response TLV 0x13 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_WCDMAServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe response TLV 0x14 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_LTEServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe response TLV 0x15 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_CDMASystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mSystemPRLMatchValid; + eQMINASPRLIndicator mSystemPRLMatch; + INT8 mPRevInUseValid; + eQMINASRevision mProtocolRevisionInUse; + INT8 mBaseStationPRevValid; + eQMINASRevision mBaseStationProtocolRevision; + INT8 mConcurrentServiceSupportedValid; + eQMINASConcurrentServiceSupported mConcurrentServiceSupported; + INT8 mCDMASystemIDValid; + UINT16 mSystemID; + UINT16 mNetworkID; + INT8 mBaseStationInfoValid; + UINT16 mBaseStationID; + UINT32 mLatitude; + UINT32 mLongitude; + INT8 mPacketZoneValid; + UINT16 mPacketZone; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; +}; + +// Structure to describe response TLV 0x16 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_CDMA1xEVDOSystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mSystemPRLMatchValid; + eQMINASPRLIndicator mSystemPRLMatch; + INT8 mCDMA1xEVDOPersonalityValid; + eQMINASCDMA1xEVDOPersonality mCDMA1xEVDOPersonality; + INT8 mCDMA1xEVDOActiveProtocolValid; + eQMINASCDMA1xEVDOActiveProtocol mCDMA1xEVDOActiveProtocol; + INT8 mSectorIDValid; + UINT8 mSectorID[16]; +}; + +// Structure to describe response TLV 0x17 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_GSMSystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mEGPRSSupportValid; + eQMINASEGPRSSupport mEGPRSSupport; + INT8 mDTMSupportValid; + eQMINASDTMSupport mDTMSupport; +}; + +// Structure to describe response TLV 0x18 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_WCDMASystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mHighSpeedCallStatusValid; + eQMINASHighSpeedCallStatus mHighSpeedCallStatus; + INT8 mHighSpeedServiceIndicationValid; + eQMINASHighSpeedCallStatus mHighSpeedServiceIndication; + INT8 mPrimaryScramblingCodeValue; + UINT16 mPrimaryScramblingCode; +}; + +// Structure to describe response TLV 0x19 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_LTESystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mTrackingAreaCodeValid; + UINT16 mTrackingAreaCode; +}; + +// Structure to describe response TLV 0x1A for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_MoreCDMASystemInfo +{ + UINT16 mGeoSystemIndex; + UINT16 mRegistrationPeriod; +}; + +// Structure to describe response TLV 0x1B for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_MoreCDMA1xEVDOSystemInfo +{ + UINT16 mGeoSystemIndex; +}; + +// Structure to describe response TLV 0x1C for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_MoreGSMSystemInfo +{ + UINT16 mGeoSystemIndex; + eQMINASCellBroadcastCaps mCellBroadcastCapability; +}; + +// Structure to describe response TLV 0x1D for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_MoreWCDMASystemInfo +{ + UINT16 mGeoSystemIndex; + eQMINASCellBroadcastCaps mCellBroadcastCapability; +}; + +// Structure to describe response TLV 0x1E for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_MoreLTESystemInfo +{ + UINT16 mGeoSystemIndex; +}; + +// Structure to describe response TLV 0x1F for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_GSMCallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe response TLV 0x20 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_WCDMACallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe response TLV 0x21 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_LTEVoice +{ + INT8 mLTEVoiceSupported; +}; + +// Structure to describe response TLV 0x22 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_GSMCipher +{ + eQMINASServiceDomains mCipheringOnServiceDomain; +}; + +// Structure to describe response TLV 0x23 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_WCDMACipher +{ + eQMINASServiceDomains mCipheringOnServiceDomain; +}; + +// Structure to describe indication TLV 0x10 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_CDMAServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe indication TLV 0x11 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_CDMA1xEVDOServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe indication TLV 0x12 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_GSMServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe indication TLV 0x13 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_WCDMAServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe indication TLV 0x14 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_LTEServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe indication TLV 0x15 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_CDMASystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mSystemPRLMatchValid; + eQMINASPRLIndicator mSystemPRLMatch; + INT8 mPRevInUseValid; + eQMINASRevision mProtocolRevisionInUse; + INT8 mBaseStationPRevValid; + eQMINASRevision mBaseStationProtocolRevision; + INT8 mConcurrentServiceSupportedValid; + eQMINASConcurrentServiceSupported mConcurrentServiceSupported; + INT8 mCDMASystemIDValid; + UINT16 mSystemID; + UINT16 mNetworkID; + INT8 mBaseStationInfoValid; + UINT16 mBaseStationID; + UINT32 mLatitude; + UINT32 mLongitude; + INT8 mPacketZoneValid; + UINT16 mPacketZone; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; +}; + +// Structure to describe indication TLV 0x16 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_CDMA1xEVDOSystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mSystemPRLMatchValid; + eQMINASPRLIndicator mSystemPRLMatch; + INT8 mCDMA1xEVDOPersonalityValid; + eQMINASCDMA1xEVDOPersonality mCDMA1xEVDOPersonality; + INT8 mCDMA1xEVDOActiveProtocolValid; + eQMINASCDMA1xEVDOActiveProtocol mCDMA1xEVDOActiveProtocol; + INT8 mSectorIDValid; + UINT8 mSectorID[16]; +}; + +// Structure to describe indication TLV 0x17 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_GSMSystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mEGPRSSupportValid; + eQMINASEGPRSSupport mEGPRSSupport; + INT8 mDTMSupportValid; + eQMINASDTMSupport mDTMSupport; +}; + +// Structure to describe indication TLV 0x18 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_WCDMASystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mHighSpeedCallStatusValid; + eQMINASHighSpeedCallStatus mHighSpeedCallStatus; + INT8 mHighSpeedServiceIndicationValid; + eQMINASHighSpeedCallStatus mHighSpeedServiceIndication; + INT8 mPrimaryScramblingCodeValue; + UINT16 mPrimaryScramblingCode; +}; + +// Structure to describe indication TLV 0x19 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_LTESystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mTrackingAreaCodeValid; + UINT16 mTrackingAreaCode; +}; + +// Structure to describe indication TLV 0x1A for NAS SystemInfoIndication +struct sNASSystemInfoIndication_MoreCDMASystemInfo +{ + UINT16 mGeoSystemIndex; + UINT16 mRegistrationPeriod; +}; + +// Structure to describe indication TLV 0x1B for NAS SystemInfoIndication +struct sNASSystemInfoIndication_MoreCDMA1xEVDOSystemInfo +{ + UINT16 mGeoSystemIndex; +}; + +// Structure to describe indication TLV 0x1C for NAS SystemInfoIndication +struct sNASSystemInfoIndication_MoreGSMSystemInfo +{ + UINT16 mGeoSystemIndex; + eQMINASCellBroadcastCaps mCellBroadcastCapability; +}; + +// Structure to describe indication TLV 0x1D for NAS SystemInfoIndication +struct sNASSystemInfoIndication_MoreWCDMASystemInfo +{ + UINT16 mGeoSystemIndex; + eQMINASCellBroadcastCaps mCellBroadcastCapability; +}; + +// Structure to describe indication TLV 0x1E for NAS SystemInfoIndication +struct sNASSystemInfoIndication_MoreLTESystemInfo +{ + UINT16 mGeoSystemIndex; +}; + +// Structure to describe indication TLV 0x1F for NAS SystemInfoIndication +struct sNASSystemInfoIndication_GSMCallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe indication TLV 0x20 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_WCDMACallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe indication TLV 0x21 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_LTEVoice +{ + INT8 mLTEVoiceSupported; +}; + +// Structure to describe indication TLV 0x22 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_GSMCipher +{ + eQMINASServiceDomains mCipheringOnServiceDomain; +}; + +// Structure to describe indication TLV 0x23 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_WCDMACipher +{ + eQMINASServiceDomains mCipheringOnServiceDomain; +}; + +// Structure to describe indication TLV 0x24 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_NoPLMNChange +{ + INT8 mNoPLMNChange; +}; + +// Structure to describe response TLV 0x10 for NASGetSignalInfo() +struct sNASGetSignalInfoResponse_CDMASignalInfo +{ + INT8 mRSSI; + INT16 mECIO; +}; + +// Structure to describe response TLV 0x11 for NASGetSignalInfo() +struct sNASGetSignalInfoResponse_CDMA1xEVDOSignalInfo +{ + INT8 mRSSI; + INT16 mECIO; + eQMINASSINRLevels mSINR; + UINT32 mIO; +}; + +// Structure to describe response TLV 0x12 for NASGetSignalInfo() +struct sNASGetSignalInfoResponse_GSMSignalInfo +{ + INT8 mRSSI; +}; + +// Structure to describe response TLV 0x13 for NASGetSignalInfo() +struct sNASGetSignalInfoResponse_WCDMASignalInfo +{ + INT8 mRSSI; + INT16 mECIO; +}; + +// Structure to describe response TLV 0x14 for NASGetSignalInfo() +struct sNASGetSignalInfoResponse_LTESignalInfo +{ + INT8 mRSSI; + INT8 mRSRQ; + INT16 mRSRP; + INT16 mSNR; +}; + +// Structure to describe request TLV 0x10 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_RSSIThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT8 mThreshold[1]; +}; + +// Structure to describe request TLV 0x11 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_ECIOThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT16 mThreshold[1]; +}; + +// Structure to describe request TLV 0x12 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_CDMA1xEVDOSINRThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // UINT8 mThreshold[1]; +}; + +// Structure to describe request TLV 0x13 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_LTESINRThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT8 mThreshold[1]; +}; + +// Structure to describe request TLV 0x14 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_IOThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT32 mThreshold[1]; +}; + +// Structure to describe request TLV 0x15 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_RSRQThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT8 mThreshold[1]; +}; + +// Structure to describe request TLV 0x16 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_RSRPThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT16 mThreshold[1]; +}; + +// Structure to describe request TLV 0x17 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_LTEConfig +{ + eQMINASLTESignalRates mLTESignalCheckRate; + eQMINASLTESignalRates mLTESignalAveragingRate; +}; + +// Structure to describe indication TLV 0x10 for NAS SignalInfoIndication +struct sNASSignalInfoIndication_CDMASignalInfo +{ + INT8 mRSSI; + INT16 mECIO; +}; + +// Structure to describe indication TLV 0x11 for NAS SignalInfoIndication +struct sNASSignalInfoIndication_CDMA1xEVDOSignalInfo +{ + INT8 mRSSI; + INT16 mECIO; + eQMINASSINRLevels mSINR; + UINT32 mIO; +}; + +// Structure to describe indication TLV 0x12 for NAS SignalInfoIndication +struct sNASSignalInfoIndication_GSMSignalInfo +{ + INT8 mRSSI; +}; + +// Structure to describe indication TLV 0x13 for NAS SignalInfoIndication +struct sNASSignalInfoIndication_WCDMASignalInfo +{ + INT8 mRSSI; + INT16 mECIO; +}; + +// Structure to describe indication TLV 0x14 for NAS SignalInfoIndication +struct sNASSignalInfoIndication_LTESignalInfo +{ + INT8 mRSSI; + INT8 mRSRQ; + INT16 mRSRP; + INT16 mSNR; +}; + +// Structure to describe response TLV 0x10 for NASGetErrorRate() +struct sNASGetErrorRateResponse_CDMAFrameErrorRate +{ + UINT16 mErrorRate; +}; + +// Structure to describe response TLV 0x11 for NASGetErrorRate() +struct sNASGetErrorRateResponse_CDMA1xEVDOPacketErrorRate +{ + UINT16 mErrorRate; +}; + +// Structure to describe response TLV 0x12 for NASGetErrorRate() +struct sNASGetErrorRateResponse_GSMBitErrorRate +{ + UINT8 mErrorRate; +}; + +// Structure to describe response TLV 0x13 for NASGetErrorRate() +struct sNASGetErrorRateResponse_WCDMABlockErrorRate +{ + UINT8 mErrorRate; +}; + +// Structure to describe indication TLV 0x10 for NAS ErrorRateIndication +struct sNASErrorRateIndication_CDMAFrameErrorRate +{ + UINT16 mErrorRate; +}; + +// Structure to describe indication TLV 0x11 for NAS ErrorRateIndication +struct sNASErrorRateIndication_CDMA1xEVDOPacketErrorRate +{ + UINT16 mErrorRate; +}; + +// Structure to describe indication TLV 0x12 for NAS ErrorRateIndication +struct sNASErrorRateIndication_GSMBitErrorRate +{ + UINT8 mErrorRate; +}; + +// Structure to describe indication TLV 0x13 for NAS ErrorRateIndication +struct sNASErrorRateIndication_WCDMAFrameErrorRate +{ + UINT8 mErrorRate; +}; + +// Structure to describe indication TLV 0x01 for NAS EVDOSessionCloseIndication +struct sNASEVDOSessionCloseIndication_Reason +{ + eQMINASEVDOSessionCloseReasons mSessionCloseReason; +}; + +// Structure to describe indication TLV 0x01 for NAS EVDOUATIUpdateIndication +struct sNASEVDOUATIUpdateIndication_UATI +{ + UINT8 mUATI[16]; +}; + +// Structure to describe request TLV 0x01 for NASGetEVDOProtocolSubtype() +struct sNASGetEVDOProtocolSubtypeRequest_Protocol +{ + UINT32 mEVDOProtocol; +}; + +// Structure to describe response TLV 0x10 for NASGetEVDOProtocolSubtype() +struct sNASGetEVDOProtocolSubtypeResponse_Subtype +{ + UINT16 mEVDOProtocolSubtype; +}; + +// Structure to describe response TLV 0x10 for NASGetEVDOColorCode() +struct sNASGetEVDOColorCodeResponse_Value +{ + UINT8 mEVDOColorCode; +}; + +// Structure to describe response TLV 0x10 for NASGetAcquisitionSystemMode() +struct sNASGetAcquisitionSystemModeResponse_CDMA +{ + eQMINASRadioSystemModes mRadioSystemMode; +}; + +// Structure to describe response TLV 0x11 for NASGetAcquisitionSystemMode() +struct sNASGetAcquisitionSystemModeResponse_CDMA1xEVDO +{ + eQMINASRadioSystemModes mRadioSystemMode; +}; + +// Structure to describe response TLV 0x12 for NASGetAcquisitionSystemMode() +struct sNASGetAcquisitionSystemModeResponse_GSM +{ + eQMINASRadioSystemModes mRadioSystemMode; +}; + +// Structure to describe response TLV 0x13 for NASGetAcquisitionSystemMode() +struct sNASGetAcquisitionSystemModeResponse_UMTS +{ + eQMINASRadioSystemModes mRadioSystemMode; +}; + +// Structure to describe response TLV 0x14 for NASGetAcquisitionSystemMode() +struct sNASGetAcquisitionSystemModeResponse_LTE +{ + eQMINASRadioSystemModes mRadioSystemMode; +}; + +// Structure to describe request TLV 0x01 for NASSetRXDiversity() +struct sNASSetRXDiversityRequest_Diversity +{ + eQMINASRadioInterfaces mRadioInterface; + bool mEnableRXChain0:1; + bool mEnableRXChain1:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x10 for NASGetRXTXInfo() +struct sNASGetRXTXInfoResponse_RX0Info +{ + INT8 mRadioTuned; + INT32 mRXPower; + INT32 mEcIo; + INT32 mRSCP; + INT32 mRSRP; + INT32 mPhase; +}; + +// Structure to describe response TLV 0x11 for NASGetRXTXInfo() +struct sNASGetRXTXInfoResponse_RX1Info +{ + INT8 mRadioTuned; + INT32 mRXPower; + INT32 mEcIo; + INT32 mRSCP; + INT32 mRSRP; + INT32 mPhase; +}; + +// Structure to describe response TLV 0x12 for NASGetRXTXInfo() +struct sNASGetRXTXInfoResponse_TXInfo +{ + INT8 mInTraffic; + INT32 mTXPower; +}; + +// Structure to describe request TLV 0x01 for NASUpdateAKEYExtended() +struct sNASUpdateAKEYExtendedRequest_AKEY +{ + char mSPC[6]; + char mAKEY[26]; +}; + +// Structure to describe response TLV 0x10 for NASGetDualStandbyPreference() +struct sNASGetDualStandbyPreferenceResponse_StandbyPreference +{ + eQMINASStandbyPreference mStandbyPreference; +}; + +// Structure to describe response TLV 0x11 for NASGetDualStandbyPreference() +struct sNASGetDualStandbyPreferenceResponse_PrioritySubs +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe response TLV 0x12 for NASGetDualStandbyPreference() +struct sNASGetDualStandbyPreferenceResponse_ActiveSubs +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe response TLV 0x13 for NASGetDualStandbyPreference() +struct sNASGetDualStandbyPreferenceResponse_DefaultDataSubs +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe request TLV 0x10 for WMSSetEventReport() +struct sWMSSetEventReportRequest_NewMTMessageIndicator +{ + INT8 mReportNewMTMessages; +}; + +// Structure to describe indication TLV 0x10 for WMS EventReport +struct sWMSEventReportIndication_ReceivedMTMessage +{ + eQMIWMSStorageTypes mStorageType; + UINT32 mStorageIndex; +}; + +// Structure to describe indication TLV 0x11 for WMS EventReport +struct sWMSEventReportIndication_TransferRouteMTMessage +{ + INT8 mACKRequired; + UINT32 mTransactionID; + eQMIWMSMessageFormats mMessageFormat; + UINT16 mRawMessageLength; + + // This array must be the size specified by mRawMessageLength + // UINT8 mRawMessage[1]; +}; + +// Structure to describe indication TLV 0x12 for WMS EventReport +struct sWMSEventReportIndication_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe indication TLV 0x13 for WMS EventReport +struct sWMSEventReportIndication_ReceivedETWSMessage +{ + eQMIWMSNotificationType mNotificationType; + UINT16 mRawMessageLength; + + // This array must be the size specified by mRawMessageLength + // UINT8 mRawMessage[1]; +}; + +// Structure to describe indication TLV 0x14 for WMS EventReport +struct sWMSEventReportIndication_ReceivedETWSPLMNInfo +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; +}; + +// Structure to describe indication TLV 0x15 for WMS EventReport +struct sWMSEventReportIndication_ReceivedSMSCAddress +{ + UINT8 mSMSCAddressLength; + + // This array must be the size specified by mSMSCAddressLength + // char mSMSCAddress[1]; +}; + +// Structure to describe indication TLV 0x16 for WMS EventReport +struct sWMSEventReportIndication_SMSOnIMS +{ + INT8 mMessageReceivedFromIMS; +}; + +// Structure to describe request TLV 0x01 for WMSRawSend() +struct sWMSRawSendRequest_MessageData +{ + eQMIWMSMessageFormats mMessageFormat; + UINT16 mRawMessageLength; + + // This array must be the size specified by mRawMessageLength + // UINT8 mRawMessage[1]; +}; + +// Structure to describe request TLV 0x10 for WMSRawSend() +struct sWMSRawSendRequest_ForceOnDC +{ + INT8 mForceSendOnDC; + eQMIWMSCDMAServiceOptions mServiceOption; +}; + +// Structure to describe request TLV 0x11 for WMSRawSend() +struct sWMSRawSendRequest_FollowOnDC +{ + INT8 mDoNotDisconnectDC; +}; + +// Structure to describe request TLV 0x12 for WMSRawSend() +struct sWMSRawSendRequest_LinkControl +{ + UINT8 mLinkTimerInSeconds; +}; + +// Structure to describe request TLV 0x13 for WMSRawSend() +struct sWMSRawSendRequest_SMSOnIMS +{ + INT8 mMessageToBeSentOnIMS; +}; + +// Structure to describe response TLV 0x01 for WMSRawSend() +struct sWMSRawSendResponse_MessageID +{ + UINT16 mMessageID; +}; + +// Structure to describe response TLV 0x10 for WMSRawSend() +struct sWMSRawSendResponse_CauseCode +{ + UINT16 mCauseCode; +}; + +// Structure to describe response TLV 0x11 for WMSRawSend() +struct sWMSRawSendResponse_ErrorClass +{ + eQMIWMSErrorClasses mErrorClass; +}; + +// Structure to describe response TLV 0x12 for WMSRawSend() +struct sWMSRawSendResponse_CauseInfo +{ + UINT16 mGSMWCDMARPCause; + UINT8 mGSMWCDMATPCause; +}; + +// Structure to describe response TLV 0x13 for WMSRawSend() +struct sWMSRawSendResponse_MessageDeliveryFailureType +{ + eQMIWMSMessageDeliveryFailureType mMessageDeliveryFailureType; +}; + +// Structure to describe request TLV 0x01 for WMSRawWrite() +struct sWMSRawWriteRequest_MessageData +{ + eQMIWMSStorageTypes mStorageType; + eQMIWMSMessageFormats mMessageFormat; + UINT16 mRawMessageLength; + + // This array must be the size specified by mRawMessageLength + // UINT8 mRawMessage[1]; +}; + +// Structure to describe response TLV 0x01 for WMSRawWrite() +struct sWMSRawWriteResponse_MessageIndex +{ + UINT32 mStorageIndex; +}; + +// Structure to describe request TLV 0x01 for WMSRawRead() +struct sWMSRawReadRequest_MessageIndex +{ + eQMIWMSStorageTypes mStorageType; + UINT32 mStorageIndex; +}; + +// Structure to describe request TLV 0x10 for WMSRawRead() +struct sWMSRawReadRequest_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe request TLV 0x11 for WMSRawRead() +struct sWMSRawReadRequest_SMSOnIMS +{ + INT8 mMessageToBeReadFromIMS; +}; + +// Structure to describe response TLV 0x01 for WMSRawRead() +struct sWMSRawReadResponse_MessageData +{ + eQMIWMSMessageTags mMessageTag; + eQMIWMSMessageFormats mMessageFormat; + UINT16 mRawMessageLength; + + // This array must be the size specified by mRawMessageLength + // UINT8 mRawMessage[1]; +}; + +// Structure to describe request TLV 0x01 for WMSModifyTag() +struct sWMSModifyTagRequest_MessageTag +{ + eQMIWMSStorageTypes mStorageType; + UINT32 mStorageIndex; + eQMIWMSMessageTags mMessageTag; +}; + +// Structure to describe request TLV 0x10 for WMSModifyTag() +struct sWMSModifyTagRequest_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe request TLV 0x01 for WMSDelete() +struct sWMSDeleteRequest_MemoryStorage +{ + eQMIWMSStorageTypes mStorageType; +}; + +// Structure to describe request TLV 0x10 for WMSDelete() +struct sWMSDeleteRequest_MessageIndex +{ + UINT32 mStorageIndex; +}; + +// Structure to describe request TLV 0x11 for WMSDelete() +struct sWMSDeleteRequest_MessageTag +{ + eQMIWMSMessageTags mMessageTag; +}; + +// Structure to describe request TLV 0x12 for WMSDelete() +struct sWMSDeleteRequest_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe response TLV 0x01 for WMSGetMessageProtocol() +struct sWMSGetMessageProtocolResponse_MessageProtocol +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe request TLV 0x01 for WMSListMessages() +struct sWMSListMessagesRequest_MemoryStorage +{ + eQMIWMSStorageTypes mStorageType; +}; + +// Structure to describe request TLV 0x10 for WMSListMessages() +struct sWMSListMessagesRequest_MessageTag +{ + eQMIWMSMessageTags mMessageTag; +}; + +// Structure to describe request TLV 0x11 for WMSListMessages() +struct sWMSListMessagesRequest_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe response TLV 0x01 for WMSListMessages() +struct sWMSListMessagesResponse_MessageList +{ + UINT32 mNumberOfMessages; + + struct sMessage + { + UINT32 mStorageIndex; + eQMIWMSMessageTags mMessageTag; + }; + + // This array must be the size specified by mNumberOfMessages + // sMessage mMessages[1]; +}; + +// Structure to describe request TLV 0x01 for WMSSetRoutes() +struct sWMSSetRoutesRequest_RouteList +{ + UINT16 mNumberOfRoutes; + + struct sRoute + { + eQMIWMSMessageTypes mMessageType; + eQMIWMSMessageClasses mMessageClass; + eQMIWMSStorageTypes mStorageType; + eQMIWMSReceiptActions mReceiptAction; + }; + + // This array must be the size specified by mNumberOfRoutes + // sRoute mRoutes[1]; +}; + +// Structure to describe request TLV 0x10 for WMSSetRoutes() +struct sWMSSetRoutesRequest_TransferStatusReport +{ + INT8 mTransferStatusReports; +}; + +// Structure to describe response TLV 0x01 for WMSGetRoutes() +struct sWMSGetRoutesResponse_RouteList +{ + UINT16 mNumberOfRoutes; + + struct sRoute + { + eQMIWMSMessageTypes mMessageType; + eQMIWMSMessageClasses mMessageClass; + eQMIWMSStorageTypes mStorageType; + eQMIWMSRouteValues mRouteValue; + }; + + // This array must be the size specified by mNumberOfRoutes + // sRoute mRoutes[1]; +}; + +// Structure to describe response TLV 0x10 for WMSGetRoutes() +struct sWMSGetRoutesResponse_TransferStatusReport +{ + INT8 mTransferStatusReports; +}; + +// Structure to describe response TLV 0x01 for WMSGetSMSCAddress() +struct sWMSGetSMSCAddressResponse_Address +{ + char mSMSCAddressType[3]; + UINT8 mSMSCAddressLength; + + // This array must be the size specified by mSMSCAddressLength + // char mSMSCAddress[1]; +}; + +// Structure to describe request TLV 0x01 for WMSSetSMSCAddress() +struct sWMSSetSMSCAddressRequest_Address +{ + // String is variable length, but must be size of the container + // char mSMSCAddress[1]; +}; + +// Structure to describe request TLV 0x10 for WMSSetSMSCAddress() +struct sWMSSetSMSCAddressRequest_AddressType +{ + // String is variable length, but must be size of the container + // char mSMSCAddressType[1]; +}; + +// Structure to describe request TLV 0x01 for WMSGetStorageMaxSize() +struct sWMSGetStorageMaxSizeRequest_MemoryStorage +{ + eQMIWMSStorageTypes mStorageType; +}; + +// Structure to describe request TLV 0x10 for WMSGetStorageMaxSize() +struct sWMSGetStorageMaxSizeRequest_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe response TLV 0x01 for WMSGetStorageMaxSize() +struct sWMSGetStorageMaxSizeResponse_MaxSize +{ + UINT32 mMaxStorageSizeInMessages; +}; + +// Structure to describe response TLV 0x10 for WMSGetStorageMaxSize() +struct sWMSGetStorageMaxSizeResponse_AvailableSize +{ + UINT32 mFreeStorageSizeInMessages; +}; + +// Structure to describe request TLV 0x01 for WMSSendACK() +struct sWMSSendACKRequest_ACK +{ + UINT32 mTransactionID; + eQMIWMSMessageProtocols mMode; + INT8 mProcessedSuccessfully; +}; + +// Structure to describe request TLV 0x10 for WMSSendACK() +struct sWMSSendACKRequest_3GPP2FailureInfo +{ + eQMIWMSErrorClasses2 mErrorClass; + UINT8 mTransportLayerStatus; +}; + +// Structure to describe request TLV 0x11 for WMSSendACK() +struct sWMSSendACKRequest_3GPPFailureInfo +{ + UINT8 mGSMWCDMARPCause; + UINT8 mGSMWCDMATPCause; +}; + +// Structure to describe request TLV 0x12 for WMSSendACK() +struct sWMSSendACKRequest_SMSOnIMS +{ + INT8 mACKToBeSentOnIMS; +}; + +// Structure to describe response TLV 0x10 for WMSSendACK() +struct sWMSSendACKResponse_ACKFailureCause +{ + eQMIWMSACKFailureCause mACKFailureCause; +}; + +// Structure to describe request TLV 0x01 for WMSSetRetryPeriod() +struct sWMSSetRetryPeriodRequest_Period +{ + UINT32 mRetryPeriodInSeconds; +}; + +// Structure to describe request TLV 0x01 for WMSSetRetryInterval() +struct sWMSSetRetryIntervalRequest_Interval +{ + UINT32 mRetryIntervalInSeconds; +}; + +// Structure to describe request TLV 0x01 for WMSSetDCDisconnectTimer() +struct sWMSSetDCDisconnectTimerRequest_Timer +{ + UINT32 mDCDisconnectTimerInSeconds; +}; + +// Structure to describe request TLV 0x01 for WMSSetMemoryStatus() +struct sWMSSetMemoryStatusRequest_Status +{ + INT8 mMemoryIsAvailable; +}; + +// Structure to describe request TLV 0x01 for WMSSetBroadcastActivation() +struct sWMSSetBroadcastActivationRequest_BCInfo +{ + eQMIWMSMessageProtocols mMode; + INT8 mActivateBroadcast; +}; + +// Structure to describe request TLV 0x01 for WMSSetBroadcastConfig() +struct sWMSSetBroadcastConfigRequest_Mode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe request TLV 0x10 for WMSSetBroadcastConfig() +struct sWMSSetBroadcastConfigRequest_3GPPInfo +{ + UINT16 mNumberOfInstances; + + struct sInstance + { + UINT16 mMessageIDStart; + UINT16 mMessageIDEnd; + INT8 mSelected; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe request TLV 0x11 for WMSSetBroadcastConfig() +struct sWMSSetBroadcastConfigRequest_3GPP2Info +{ + UINT16 mNumberOfInstances; + + struct sInstance + { + UINT16 mServiceCategory; + eQMIWMSLanguage mLanguage; + INT8 mSelected; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe request TLV 0x01 for WMSGetBroadcastConfig() +struct sWMSGetBroadcastConfigRequest_Mode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe response TLV 0x10 for WMSGetBroadcastConfig() +struct sWMSGetBroadcastConfigResponse_3GPPInfo +{ + INT8 mActivated; + UINT16 mNumberOfInstances; + + struct sInstance + { + UINT16 mMessageIDStart; + UINT16 mMessageIDEnd; + INT8 mSelected; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x11 for WMSGetBroadcastConfig() +struct sWMSGetBroadcastConfigResponse_3GPP2Info +{ + INT8 mActivated; + UINT16 mNumberOfInstances; + + struct sInstance + { + UINT16 mServiceCategory; + eQMIWMSLanguage mLanguage; + INT8 mSelected; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x01 for WMS MemoryFullIndication +struct sWMSMemoryFullIndication_Info +{ + eQMIWMSStorageTypes mStorageType; + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe response TLV 0x01 for WMSGetDomainPreference() +struct sWMSGetDomainPreferenceResponse_Pref +{ + eQMIWMSGSMWCDMADomains mDomainPreference; +}; + +// Structure to describe request TLV 0x01 for WMSSetDomainPreference() +struct sWMSSetDomainPreferenceRequest_Pref +{ + eQMIWMSGSMWCDMADomains mDomainPreference; +}; + +// Structure to describe request TLV 0x01 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreRequest_Info +{ + eQMIWMSStorageTypes mStorageType; + UINT32 mStorageIndex; + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe request TLV 0x10 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreRequest_SMSOnIMS +{ + INT8 mMessageToBeSentOnIMS; +}; + +// Structure to describe response TLV 0x10 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreResponse_MessageID +{ + UINT16 mMessageID; +}; + +// Structure to describe response TLV 0x11 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreResponse_CauseCode +{ + UINT16 mCauseCode; +}; + +// Structure to describe response TLV 0x12 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreResponse_ErrorClass +{ + eQMIWMSErrorClasses mErrorClass; +}; + +// Structure to describe response TLV 0x13 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreResponse_CauseInfo +{ + UINT16 mGSMWCDMARPCause; + UINT8 mGSMWCDMATPCause; +}; + +// Structure to describe response TLV 0x14 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreResponse_MessageDeliveryFailureType +{ + eQMIWMSMessageDeliveryFailureType mMessageDeliveryFailureType; +}; + +// Structure to describe response TLV 0x01 for WMSGetWaitingMessage() +struct sWMSGetWaitingMessageResponse_WaitingMessageInfo +{ + UINT8 mNumberOfWaitingMessages; + eQMIWMSWaitingMessageType mWaitingMessageType; + INT8 mActiveIndication; + UINT8 mMessageCount; +}; + +// Structure to describe indication TLV 0x01 for WMS WaitingMessageIndication +struct sWMSWaitingMessageIndication_WaitingMessageInfo +{ + UINT8 mNumberOfWaitingMessages; + eQMIWMSWaitingMessageType mWaitingMessageType; + INT8 mActiveIndication; + UINT8 mMessageCount; +}; + +// Structure to describe request TLV 0x01 for WMSSetPrimaryClient() +struct sWMSSetPrimaryClientRequest_PrimaryClientInfo +{ + INT8 mPrimaryClient; +}; + +// Structure to describe indication TLV 0x01 for WMS SMSCAddressIndication +struct sWMSSMSCAddressIndication_Address +{ + char mSMSCAddressType[3]; + UINT8 mSMSCAddressLength; + + // This array must be the size specified by mSMSCAddressLength + // char mSMSCAddress[1]; +}; + +// Structure to describe request TLV 0x10 for WMSIndicatorRegistration() +struct sWMSIndicatorRegistrationRequest_TransportLayerInfoEvents +{ + INT8 mTransportLayerInfoEvents; +}; + +// Structure to describe request TLV 0x11 for WMSIndicatorRegistration() +struct sWMSIndicatorRegistrationRequest_NetworkRegistrationInfoEvents +{ + INT8 mNetworkRegistrationInfoEvents; +}; + +// Structure to describe request TLV 0x12 for WMSIndicatorRegistration() +struct sWMSIndicatorRegistrationRequest_CallStatusInfoEvents +{ + INT8 mCallStatusInfoEvents; +}; + +// Structure to describe response TLV 0x10 for WMSGetTransportInfoLayer() +struct sWMSGetTransportInfoLayerResponse_TransportLayerRegistrationInfo +{ + INT8 mRegistered; +}; + +// Structure to describe response TLV 0x11 for WMSGetTransportLayerInfo() +struct sWMSGetTransportLayerInfoResponse_TransportLayerInfo +{ + eQMIWMSTransportType mTransportType; + eQMIWMSTransportCapability mTransportCapability; +}; + +// Structure to describe indication TLV 0x01 for WMS TransportLayerInfoIndication +struct sWMSTransportLayerInfoIndication_TransportLayerRegInfo +{ + INT8 mRegistered; +}; + +// Structure to describe indication TLV 0x10 for WMS TransportLayerInfoIndication +struct sWMSTransportLayerInfoIndication_TransportLayerInfo +{ + eQMIWMSTransportType mTransportType; + eQMIWMSTransportCapability mTransportCapability; +}; + +// Structure to describe response TLV 0x10 for WMSGetNetworkRegistrationInfo() +struct sWMSGetNetworkRegistrationInfoResponse_NetworkRegistrationInfo +{ + eQMIWMSNetworkRegistrationStatus mNetworkRegistrationStatus; +}; + +// Structure to describe indication TLV 0x01 for WMS NetworkRegistrationInfoIndication +struct sWMSNetworkRegistrationInfoIndication_NetworkRegistrationInfo +{ + eQMIWMSNetworkRegistrationStatus mNetworkRegistrationStatus; +}; + +// Structure to describe request TLV 0x01 for WMSBindSubscription() +struct sWMSBindSubscriptionRequest_SubscriptionType +{ + eQMIWMSSubscriptionType mSubscriptionType; +}; + +// Structure to describe response TLV 0x10 for WMSGetIndicatorRegistration() +struct sWMSGetIndicatorRegistrationResponse_TransportLayerInfoEvents +{ + INT8 mTransportLayerInfoEvents; +}; + +// Structure to describe response TLV 0x11 for WMSGetIndicatorRegistration() +struct sWMSGetIndicatorRegistrationResponse_NetworkRegistrationInfoEvents +{ + INT8 mNetworkRegistrationInfoEvents; +}; + +// Structure to describe response TLV 0x12 for WMSGetIndicatorRegistration() +struct sWMSGetIndicatorRegistrationResponse_CallStatusInfoEvents +{ + INT8 mCallStatusInfoEvents; +}; + +// Structure to describe request TLV 0x01 for WMSGetSMSParameters() +struct sWMSGetSMSParametersRequest_MessageMode +{ + eQMIWMSSMSMessageMode mSMSMessageMode; +}; + +// Structure to describe response TLV 0x10 for WMSGetSMSParameters() +struct sWMSGetSMSParametersResponse_DestinationAddress +{ + UINT8 mDestinationAddressLength; + + // This array must be the size specified by mDestinationAddressLength + // UINT8 mDestinationAddress[1]; +}; + +// Structure to describe response TLV 0x11 for WMSGetSMSParameters() +struct sWMSGetSMSParametersResponse_ProtocolIdentifierData +{ + eQMIWMSProtocolIdentifierData mProtocolIdentifierData; +}; + +// Structure to describe response TLV 0x12 for WMSGetSMSParameters() +struct sWMSGetSMSParametersResponse_DataCodingScheme +{ + UINT8 mDataCodingScheme; +}; + +// Structure to describe response TLV 0x13 for WMSGetSMSParameters() +struct sWMSGetSMSParametersResponse_ValidityPeriod +{ + UINT8 mValidityPeriod; +}; + +// Structure to describe request TLV 0x01 for WMSSetSMSParameters() +struct sWMSSetSMSParametersRequest_MessageMode +{ + eQMIWMSSMSMessageMode mSMSMessageMode; +}; + +// Structure to describe request TLV 0x10 for WMSSetSMSParameters() +struct sWMSSetSMSParametersRequest_DestinationAddress +{ + UINT8 mDestinationAddressLength; + + // This array must be the size specified by mDestinationAddressLength + // UINT8 mDestinationAddress[1]; +}; + +// Structure to describe request TLV 0x11 for WMSSetSMSParameters() +struct sWMSSetSMSParametersRequest_ProtocolIdentifierData +{ + eQMIWMSProtocolIdentifierData mProtocolIdentifierData; +}; + +// Structure to describe request TLV 0x12 for WMSSetSMSParameters() +struct sWMSSetSMSParametersRequest_DataCodingScheme +{ + UINT8 mDataCodingScheme; +}; + +// Structure to describe request TLV 0x13 for WMSSetSMSParameters() +struct sWMSSetSMSParametersRequest_ValidityPeriod +{ + UINT8 mValidityPeriod; +}; + +// Structure to describe indication TLV 0x01 for WMS CallStatusIndication +struct sWMSCallStatusIndication_SMSCallStatusInfo +{ + eQMIWMSSMSCallStatus mSMSCallStatus; +}; + +// Structure to describe request TLV 0x10 for PDSSetEventReport() +struct sPDSSetEventReportRequest_NMEAIndicator +{ + INT8 mReportNMEASentences; +}; + +// Structure to describe request TLV 0x11 for PDSSetEventReport() +struct sPDSSetEventReportRequest_ModeIndicator +{ + INT8 mReportNMEASentencesPlusMode; +}; + +// Structure to describe request TLV 0x12 for PDSSetEventReport() +struct sPDSSetEventReportRequest_RawIndicator +{ + INT8 mReportRawPositionData; +}; + +// Structure to describe request TLV 0x13 for PDSSetEventReport() +struct sPDSSetEventReportRequest_XTRARequestIndicator +{ + INT8 mReportExternalXTRADataRequests; +}; + +// Structure to describe request TLV 0x14 for PDSSetEventReport() +struct sPDSSetEventReportRequest_TimeInjectionIndicator +{ + INT8 mReportExternalTimeInjections; +}; + +// Structure to describe request TLV 0x15 for PDSSetEventReport() +struct sPDSSetEventReportRequest_WiFiIndicator +{ + INT8 mReportExternalWiFiRequests; +}; + +// Structure to describe request TLV 0x16 for PDSSetEventReport() +struct sPDSSetEventReportRequest_SatelliteIndicator +{ + INT8 mReportSatelliteInfo; +}; + +// Structure to describe request TLV 0x17 for PDSSetEventReport() +struct sPDSSetEventReportRequest_VXNetworkIndicator +{ + INT8 mReportVXNetworkInitiatedPrompts; +}; + +// Structure to describe request TLV 0x18 for PDSSetEventReport() +struct sPDSSetEventReportRequest_SUPLNetworkIndicator +{ + INT8 mReportSUPLNetworkInitiatedPrompts; +}; + +// Structure to describe request TLV 0x19 for PDSSetEventReport() +struct sPDSSetEventReportRequest_UMTSCPNetworkIndicator +{ + INT8 mReportUMTSCPNetworkInitiatedPrompts; +}; + +// Structure to describe request TLV 0x1A for PDSSetEventReport() +struct sPDSSetEventReportRequest_PDSCommIndicator +{ + INT8 mReportPDSCommEvents; +}; + +// Structure to describe request TLV 0x1B for PDSSetEventReport() +struct sPDSSetEventReportRequest_AccelerometerDataIndicator +{ + INT8 mReportAccelerometerDataStatus; +}; + +// Structure to describe request TLV 0x1C for PDSSetEventReport() +struct sPDSSetEventReportRequest_GyroDataIndicator +{ + INT8 mReportGyroDataStatus; +}; + +// Structure to describe request TLV 0x1D for PDSSetEventReport() +struct sPDSSetEventReportRequest_TimeSyncIndication +{ + INT8 mReportTimeSyncRequest; +}; + +// Structure to describe request TLV 0x1E for PDSSetEventReport() +struct sPDSSetEventReportRequest_PositionReliablilityIndicator +{ + INT8 mReportPositionReliability; +}; + +// Structure to describe request TLV 0x1F for PDSSetEventReport() +struct sPDSSetEventReportRequest_SensorDataUsageIndicator +{ + INT8 mReportSensorDataUsage; +}; + +// Structure to describe request TLV 0x20 for PDSSetEventReport() +struct sPDSSetEventReportRequest_TimeSourceInformationIndicator +{ + INT8 mReportTimeSourceInformation; +}; + +// Structure to describe request TLV 0x21 for PDSSetEventReport() +struct sPDSSetEventReportRequest_HeadingUncertaintyIndicator +{ + INT8 mReportHeadingUncertaintyInformation; +}; + +// Structure to describe request TLV 0x22 for PDSSetEventReport() +struct sPDSSetEventReportRequest_NMEADebugStringIndicator +{ + INT8 mReportNMEADebugStrings; +}; + +// Structure to describe request TLV 0x23 for PDSSetEventReport() +struct sPDSSetEventReportRequest_ExternalXTRADataIndicator +{ + INT8 mReportExtendedXTRAData; +}; + +// Structure to describe indication TLV 0x10 for PDS EventReport +struct sPDSEventReportIndication_NMEASentence +{ + // String is variable length, but must be size of the container + // char mNMEASentence[1]; +}; + +// Structure to describe indication TLV 0x11 for PDS EventReport +struct sPDSEventReportIndication_NMEASentencePlusMode +{ + eQMIPDSNMEASentenceOperatingModes mNMEASentenceOperatingMode; + UINT16 mNMEASentenceLength; + + // This array must be the size specified by mNMEASentenceLength + // char mNMEASentence[1]; +}; + +// Structure to describe indication TLV 0x12 for PDS EventReport +struct sPDSEventReportIndication_PositionSessionStatus +{ + eQMIPDSSessionStatus mSessionStatus; +}; + +// Structure to describe indication TLV 0x13 for PDS EventReport +struct sPDSEventReportIndication_ParsedPositionData +{ + bool mTimestampCalendarValid:1; + bool mTimestampUTCValid:1; + bool mLeapSecondsValid:1; + bool mTimeUncertaintyValid:1; + bool mLatitudeValid:1; + bool mLongitudeValid:1; + bool mEllipsoidAltitudeValid:1; + bool mMeanSeaLevelAltitudeValid:1; + bool mHorizontalSpeedValid:1; + bool mVerticalSpeedValid:1; + bool mHeadingValid:1; + bool mHorizontalUncertaintyCircularValid:1; + bool mHorizontalUncertaintyEllipseSemiMajorValid:1; + bool mHorizontalUncertaintyEllipseSemiMinorValid:1; + bool mHorizontalUncertaintyEllipseOrientAzimuthValid:1; + bool mVerticalUncertaintyValid:1; + bool mHorizontalVelocityUncertaintyValid:1; + bool mVerticalVelocityUncertaintyValid:1; + bool mHorizontalConfidenceValid:1; + bool mPositionDOPValid:1; + bool mHorizontalDOPValid:1; + bool mVerticalDOPValid:1; + bool mOperatingModeUsedValid:1; + + // Padding out 9 bits + UINT8 mReserved1:1; + UINT8 mReserved2; + + UINT16 mCalendarYear; + eQMIPDSCalendarMonths mCalendarMonth; + eQMIPDSCalendarDays mCalendarDay; + UINT8 mCalendarDayOfMonth; + UINT8 mCalendarHour; + UINT8 mCalendarMinute; + UINT8 mCalendarSecond; + UINT16 mCalendarMillisecond; + UINT8 mCalendarLeapSeconds; + UINT64 mUTCTimestamp; + UINT32 mUTCTimestampUncertainty; + double mLatitude; + double mLongitude; + float mEllipsoidAltitude; + float mMeanSeaLevelAltitude; + float mHorizontalSpeed; + float mVerticalSpeed; + float mHeading; + float mHorizontalUncertaintyCircular; + float mHorizontalUncertaintyEllipseSemiMajor; + float mHorizontalUncertaintyEllipseSemiMinor; + float mHorizontalUncertaintyEllipseOrientAzimuth; + float mVerticalUncertainty; + float mHorizontalVelocityUncertainty; + float mVerticalVelocityUncertainty; + UINT8 mHorizontalConfidence; + float mPositionDOP; + float mHorizontalDOP; + float mVerticalDOP; + eQMIPDSNMEASentenceOperatingModes mOperatingMode; +}; + +// Structure to describe indication TLV 0x14 for PDS EventReport +struct sPDSEventReportIndication_ExternalXTRARequest +{ + UINT16 mMaximumFileSize; + UINT8 mURLRecordCount; + + struct sURL + { + UINT8 mURLLength; + + // This array must be the size specified by mURLLength + // char mURL[1]; + }; + + // This array must be the size specified by mURLRecordCount + // sURL mURLs[1]; +}; + +// Structure to describe indication TLV 0x15 for PDS EventReport +struct sPDSEventReportIndication_ExternalTimeInjectionRequest +{ + UINT32 mDelayThresholdMilliseconds; + UINT8 mURLRecordCount; + + struct sURL + { + UINT8 mURLLength; + + // This array must be the size specified by mURLLength + // char mURL[1]; + }; + + // This array must be the size specified by mURLRecordCount + // sURL mURLs[1]; +}; + +// Structure to describe indication TLV 0x16 for PDS EventReport +struct sPDSEventReportIndication_ExternalWiFiPositionRequest +{ + eQMIPDSWiFiRequestTypes mWiFiRequestType; + UINT16 mWiFiRequestTimeBetweenFixesMilliseconds; +}; + +// Structure to describe indication TLV 0x17 for PDS EventReport +struct sPDSEventReportIndication_SatelliteInfo +{ + bool mIonoValid:1; + bool mSatelliteCountValid:1; + bool mSatelliteListValid:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; + + INT8 mIonosphericCorrections; + UINT8 mSVRecordCount; + + struct sSV + { + bool mSystemValid:1; + bool mPRNValid:1; + bool mHealthStatusValid:1; + bool mProcessStatusValid:1; + bool mEphemerisStateValid:1; + bool mAlmanacStateValid:1; + bool mElevationValid:1; + bool mAzimuthValid:1; + bool mCN0Valid:1; + + // Padding out 23 bits + UINT8 mReserved3:7; + UINT8 mReserved4[2]; + + eQMIPDSSVSystems mSystem; + UINT8 mPRN; + eQMIPDSSVHealthStatus mHealthLevel; + eQMIPDSSVProcessingStatus mProcessingStatus; + eQMIPDSSVEphemerisStatus mEphemerisState; + eQMIPDSSVAlmanacStatus mAlmanacState; + INT32 mElevation; + UINT16 mAzimuth; + UINT16 mCN0; + }; + + // This array must be the size specified by mSVRecordCount + // sSV mSVs[1]; +}; + +// Structure to describe indication TLV 0x18 for PDS EventReport +struct sPDSEventReportIndication_VXNetworkInitiatedPrompt +{ + bool mPrivacyValid:1; + bool mQoSValid:1; + bool mCountValid:1; + bool mIntervalValid:1; + bool mModeValid:1; + bool mRequestorIDValid:1; + + // Padding out 26 bits + UINT8 mReserved1:2; + UINT8 mReserved2[3]; + + eQMIPDSPrivacyModes mPrivacy; + UINT8 mQoS; + UINT32 mPositionCount; + UINT32 mIntervalBetweenFixesSeconds; + eQMIPDSVXModes mMode; + eQMIPDSVXDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +// Structure to describe indication TLV 0x19 for PDS EventReport +struct sPDSEventReportIndication_SUPLNetworkInitiatedPrompt1 +{ + bool mPrivacyValid:1; + bool mINITHashValid:1; + bool mModeValid:1; + bool mSLPSessionIDValid:1; + bool mSLPServerIPv4AddressValid:1; + bool mSLPServerIPv6AddressValid:1; + bool mSLPServerURLAddressValid:1; + bool mDCSValid:1; + bool mRequestorIDValid:1; + bool mClientNameValid:1; + bool mQoPHorizontalAccuracyValid:1; + bool mQoPVerticalAccuracyValid:1; + bool mQoPMaxLocationAgeValid:1; + bool mQoPDelayValid:1; + + // Padding out 18 bits + UINT8 mReserved1:2; + UINT8 mReserved2[2]; + + eQMIPDSPrivacyModes mPrivacy; + UINT64 mINITHash; + eQMIPDSSUPLModes mMode; + UINT32 mSLPSessionID; + UINT32 mSLPServerIPv4Port; + UINT8 mSLPServerIPv4Address[4]; + UINT32 mSLPServerIPv6Port; + UINT8 mSLPServerIPv6Address[16]; + UINT8 mSLPServerURLLength; + + // This array must be the size specified by mSLPServerURLLength + // char mSLPServerURLAddress[1]; +}; + +struct sPDSEventReportIndication_SUPLNetworkInitiatedPrompt2 +{ + eQMIPDSSUPLDataCodingSchemes mRequestDCS; + eQMIPDSSUPLIDNameDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sPDSEventReportIndication_SUPLNetworkInitiatedPrompt3 +{ + eQMIPDSSUPLIDNameDataCodingSchemes mClientNameDCS; + UINT8 mClientNameLength; + + // This array must be the size specified by mClientNameLength + // UINT8 mClientName[1]; +}; + +struct sPDSEventReportIndication_SUPLNetworkInitiatedPrompt4 +{ + UINT8 mQoPHorizontalAccuracy; + UINT8 mQoPVerticalAccuracy; + UINT8 mQoPMaxLocationAge; + UINT8 mQoPDelay; +}; + +struct sPDSEventReportIndication_SUPLNetworkInitiatedPrompt +{ + sPDSEventReportIndication_SUPLNetworkInitiatedPrompt1 mPDSEventReportIndication_SUPLNetworkInitiatedPrompt1; + sPDSEventReportIndication_SUPLNetworkInitiatedPrompt2 mPDSEventReportIndication_SUPLNetworkInitiatedPrompt2; + sPDSEventReportIndication_SUPLNetworkInitiatedPrompt3 mPDSEventReportIndication_SUPLNetworkInitiatedPrompt3; + sPDSEventReportIndication_SUPLNetworkInitiatedPrompt4 mPDSEventReportIndication_SUPLNetworkInitiatedPrompt4; +}; + +// Structure to describe indication TLV 0x1A for PDS EventReport +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt1 +{ + bool mPrivacyValid:1; + bool mInvokeIDValid:1; + bool mNotificationTextValid:1; + bool mClientAddressValid:1; + bool mLocationTypeValid:1; + bool mRequestorIDValid:1; + bool mCodewordStringValid:1; + bool mServiceTypeIDValid:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; + + eQMIPDSPrivacyModes mPrivacy; + UINT8 mInvokeID; + eQMIPDSUMTSCPDataCodingSchemes mNotificationTextDCS; + UINT8 mNotificationTextLength; + + // This array must be the size specified by mNotificationTextLength + // UINT8 mNotificationText[1]; +}; + +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt2 +{ + UINT8 mClientAddressLength; + + // This array must be the size specified by mClientAddressLength + // char mClientAddress[1]; +}; + +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt3 +{ + eQMIPDSUMTSCPLocationTypes mLocationType; + eQMIPDSUMTSCPDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt4 +{ + eQMIPDSUMTSCPDataCodingSchemes mCodewordDCS; + UINT8 mCodewordLength; + + // This array must be the size specified by mCodewordLength + // UINT8 mCodeword[1]; +}; + +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt5 +{ + UINT8 mServiceTypeID; +}; + +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt +{ + sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt1 mPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt1; + sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt2 mPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt2; + sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt3 mPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt3; + sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt4 mPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt4; + sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt5 mPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt5; +}; + +// Structure to describe indication TLV 0x1B for PDS EventReport +struct sPDSEventReportIndication_CommEvents +{ + eQMIPDSCommEventTypes mType; + eQMIPDSCommEventProtocols mProtocolDataType; +}; + +// Structure to describe indication TLV 0x1C for PDS EventReport +struct sPDSEventReportIndication_PositionSource +{ + bool mGPS:1; + bool mCellID:1; + bool mGlonass:1; + bool mNetwork:1; + bool mEPI:1; + + // Padding out 27 bits + UINT8 mReserved1:3; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x1D for PDS EventReport +struct sPDSEventReportIndication_AccelerometerStreamingStatus +{ + eQMIPDSStreamingStatus mAccelerometerStreamingStatus; +}; + +// Structure to describe indication TLV 0x1E for PDS EventReport +struct sPDSEventReportIndication_GyroStreamingStatus +{ + eQMIPDSStreamingStatus mGyroStreamingStatus; +}; + +// Structure to describe indication TLV 0x1F for PDS EventReport +struct sPDSEventReportIndication_TimeSyncRequest +{ + UINT32 mReferenceCounter; +}; + +// Structure to describe indication TLV 0x20 for PDS EventReport +struct sPDSEventReportIndication_PositionReliabilityCounter +{ + eQMIPDSReliabilityIndicator mReliabilityIndicatorHorizontal; + eQMIPDSReliabilityIndicator mReliabilityIndicatorVertical; +}; + +// Structure to describe indication TLV 0x21 for PDS EventReport +struct sPDSEventReportIndication_SensorDataUsage +{ + bool mAccelerometer:1; + bool mGyro:1; + + // Padding out 14 bits + UINT8 mReserved1:6; + UINT8 mReserved2; + + bool mHeadingAidedWithSensorData:1; + bool mSpeedAidedWithSensorData:1; + bool mPositionAidedWithSensorData:1; + bool mVelocityAidedWithSensorData:1; + + // Padding out 12 bits + UINT8 mReserved3:4; + UINT8 mReserved4; +}; + +// Structure to describe indication TLV 0x22 for PDS EventReport +struct sPDSEventReportIndication_TimeSourceInformation +{ + INT8 mTimeValid; + eQMIPDSTimeSource mTimeSource; + UINT32 mTimeUncertaintyMilliseconds; + UINT16 mGPSWeekNumber; + UINT32 mGPSTimeOfWeekMilliseconds; + UINT32 mReserved1; + UINT32 mReserved2; + UINT32 mReserved3; + UINT32 mReserved4; + UINT32 mReserved5; +}; + +// Structure to describe indication TLV 0x23 for PDS EventReport +struct sPDSEventReportIndication_EncryptedPositionInformation +{ + eQMIPDSEncryptionAlgorithm mEncryptionAlgorithm; + UINT8 mEncryptionDataLength; + + // This array must be the size specified by mEncryptionDataLength + // UINT8 mEncryptionData[1]; +}; + +// Structure to describe indication TLV 0x24 for PDS EventReport +struct sPDSEventReportIndication_HeadingUncertaintyInformation +{ + float mHeadingUncertainty; + float mGNSSHeadingUncertainty; + UINT32 mReserved1; + UINT32 mReserved2; +}; + +// Structure to describe indication TLV 0x25 for PDS EventReport +struct sPDSEventReportIndication_ProprietaryNMEADebugSentences +{ + // String is variable length, but must be size of the container + // char mNMEADebug[1]; +}; + +// Structure to describe indication TLV 0x26 for PDS EventReport +struct sPDSEventReportIndication_ExtendedExternalXTRADatabaseRequest +{ + UINT32 mMaximumFileSize; + UINT8 mURLCount; + UINT8 mURLLength; + + // This array must be the size specified by mURLLength + // char mURL[1]; +}; + +// Structure to describe response TLV 0x01 for PDSGetServiceState() +struct sPDSGetServiceStateResponse_State +{ + INT8 mServiceEnabled; + eQMIPDSTrackingSessionStates mTrackingSessionState; +}; + +// Structure to describe indication TLV 0x01 for PDS ServiceStateIndication +struct sPDSServiceStateIndication_State +{ + INT8 mServiceEnabled; + eQMIPDSTrackingSessionStates mTrackingSessionState; +}; + +// Structure to describe request TLV 0x01 for PDSSetServiceState() +struct sPDSSetServiceStateRequest_State +{ + INT8 mServiceEnabled; +}; + +// Structure to describe request TLV 0x01 for PDSStartTrackingSession() +struct sPDSStartTrackingSessionRequest_Session +{ + eQMIPDSSessionControlTypes mSessionControl; + eQMIPDSSessionTypes mSessionType; + eQMIPDSOperationTypes mSessionOperation; + eQMIPDSServerOptions mServerOption; + UINT8 mTimeoutSeconds; + UINT32 mSessionFixRequests; + UINT32 mFixRequestIntervalSeconds; + UINT32 mDesiredAccuracyMeters; +}; + +// Structure to describe response TLV 0x01 for PDSGetTrackingSessionInfo() +struct sPDSGetTrackingSessionInfoResponse_Info +{ + eQMIPDSSessionControlTypes mSessionControl; + eQMIPDSSessionTypes mSessionType; + eQMIPDSOperationTypes mSessionOperation; + eQMIPDSServerOptions mServerOption; + UINT8 mTimeoutSeconds; + UINT32 mSessionFixRequests; + UINT32 mFixRequestIntervalSeconds; + UINT32 mDesiredAccuracyMeters; +}; + +// Structure to describe response TLV 0x01 for PDSGetNMEAConfig() +struct sPDSGetNMEAConfigResponse_Config +{ + bool mGPGGANMEASentences:1; + bool mGPRMCNMEASentences:1; + bool mGPGSVNMEASentences:1; + bool mGPGSANMEASentences:1; + bool mGPVTGNMEASentences:1; + bool mGLGSVNMEASentences:1; + bool mGNGSANMEASentences:1; + bool mGNGNSNMEASentences:1; + eQMIPDSOutputDevices mOutputDevice; + eQMIPDSNMEAReportingOptions mNMEAReporting; +}; + +// Structure to describe response TLV 0x10 for PDSGetNMEAConfig() +struct sPDSGetNMEAConfigResponse_AdditionalConfig +{ + bool mPQXFI:1; + bool mPSTIS:1; + + // Padding out 14 bits + UINT8 mReserved1:6; + UINT8 mReserved2; +}; + +// Structure to describe request TLV 0x01 for PDSSetNMEAConfig() +struct sPDSSetNMEAConfigRequest_Config +{ + bool mGPGGANMEASentences:1; + bool mGPRMCNMEASentences:1; + bool mGPGSVNMEASentences:1; + bool mGPGSANMEASentences:1; + bool mGPVTGNMEASentences:1; + bool mGLGSVNMEASentences:1; + bool mGNGSANMEASentences:1; + bool mGNGNSNMEASentences:1; + eQMIPDSOutputDevices mOutputDevice; + eQMIPDSNMEAReportingOptions mNMEAReporting; +}; + +// Structure to describe request TLV 0x10 for PDSSetNMEAConfig() +struct sPDSSetNMEAConfigRequest_AdditionalConfig +{ + bool mPQXFI:1; + bool mPSTIS:1; + + // Padding out 14 bits + UINT8 mReserved1:6; + UINT8 mReserved2; +}; + +// Structure to describe request TLV 0x01 for PDSInjectTimeReference() +struct sPDSInjectTimeReferenceRequest_Time +{ + UINT64 mSystemTimeMilliseconds; + UINT16 mSystemDiscontinuties; +}; + +// Structure to describe response TLV 0x01 for PDSGetDefaults() +struct sPDSGetDefaultsResponse_Defaults +{ + eQMIPDSOperationTypes mSessionOperation; + UINT8 mTimeoutSeconds; + UINT32 mFixRequestIntervalSeconds; + UINT32 mDesiredAccuracyMeters; +}; + +// Structure to describe request TLV 0x01 for PDSSetDefaults() +struct sPDSSetDefaultsRequest_Defaults +{ + eQMIPDSOperationTypes mSessionOperation; + UINT8 mTimeoutSeconds; + UINT32 mFixRequestIntervalSeconds; + UINT32 mDesiredAccuracyMeters; +}; + +// Structure to describe response TLV 0x10 for PDSGetXTRAParameters() +struct sPDSGetXTRAParametersResponse_Automatic +{ + INT8 mAutomaticDownloadEnabled; + UINT16 mDownloadIntervalInHours; +}; + +// Structure to describe response TLV 0x11 for PDSGetXTRAParameters() +struct sPDSGetXTRAParametersResponse_Medium +{ + UINT8 mMediumPreferences; + + // This array must be the size specified by mMediumPreferences + // eQMIPDSMediums mMediumPreference[1]; +}; + +// Structure to describe response TLV 0x12 for PDSGetXTRAParameters() +struct sPDSGetXTRAParametersResponse_Network +{ + eQMIPDSWWANNetworkPreferences mWWANNetworkPreference; +}; + +// Structure to describe response TLV 0x13 for PDSGetXTRAParameters() +struct sPDSGetXTRAParametersResponse_Validity +{ + UINT16 mValidPeriodGPSStartWeek; + UINT16 mValidPeriodGPSStartWeekOffsetInMinutes; + UINT16 mValidPeriodDurationInHours; +}; + +// Structure to describe response TLV 0x14 for PDSGetXTRAParameters() +struct sPDSGetXTRAParametersResponse_Embedded +{ + INT8 mEmbeddedXTRADataClientEnabled; + INT8 mEmbeddedXTRATimeClientEnabled; +}; + +// Structure to describe request TLV 0x10 for PDSSetXTRAParameters() +struct sPDSSetXTRAParametersRequest_Automatic +{ + INT8 mAutomaticDownloadEnabled; + UINT16 mDownloadIntervalInHours; +}; + +// Structure to describe request TLV 0x11 for PDSSetXTRAParameters() +struct sPDSSetXTRAParametersRequest_Medium +{ + UINT8 mMediumPreferences; + + // This array must be the size specified by mMediumPreferences + // eQMIPDSMediums mMediumPreference[1]; +}; + +// Structure to describe request TLV 0x12 for PDSSetXTRAParameters() +struct sPDSSetXTRAParametersRequest_Network +{ + eQMIPDSWWANNetworkPreferences mWWANNetworkPreference; +}; + +// Structure to describe request TLV 0x14 for PDSSetXTRAParameters() +struct sPDSSetXTRAParametersRequest_Embedded +{ + INT8 mEmbeddedXTRADataClientEnabled; + INT8 mEmbeddedXTRATimeClientEnabled; +}; + +// Structure to describe request TLV 0x12 for PDSGetAGPSConfig() +struct sPDSGetAGPSConfigRequest_NetworkMode +{ + eQMIPDSNetworkMode mNetworkMode; +}; + +// Structure to describe response TLV 0x10 for PDSGetAGPSConfig() +struct sPDSGetAGPSConfigResponse_ServerAddress +{ + UINT8 mServerAddress[4]; + UINT32 mServerPort; +}; + +// Structure to describe response TLV 0x11 for PDSGetAGPSConfig() +struct sPDSGetAGPSConfigResponse_ServerURL +{ + UINT8 mURLLength; + + // This array must be the size specified by mURLLength + // char mURL[1]; +}; + +// Structure to describe request TLV 0x10 for PDSSetAGPSConfig() +struct sPDSSetAGPSConfigRequest_Server +{ + UINT8 mServerAddress[4]; + UINT32 mServerPort; +}; + +// Structure to describe request TLV 0x11 for PDSSetAGPSConfig() +struct sPDSSetAGPSConfigRequest_ServerURL +{ + UINT8 mURLLength; + + // This array must be the size specified by mURLLength + // char mURL[1]; +}; + +// Structure to describe request TLV 0x12 for PDSSetAGPSConfig() +struct sPDSSetAGPSConfigRequest_NetworkMode +{ + eQMIPDSNetworkMode mNetworkMode; +}; + +// Structure to describe response TLV 0x01 for PDSGetServiceAutoTrackingState() +struct sPDSGetServiceAutoTrackingStateResponse_State +{ + INT8 mAutoTrackingEnabled; +}; + +// Structure to describe request TLV 0x01 for PDSSetServiceAutoTrackingState() +struct sPDSSetServiceAutoTrackingStateRequest_State +{ + INT8 mAutoTrackingEnabled; +}; + +// Structure to describe response TLV 0x01 for PDSGetCOMPortAutoTrackingConfig() +struct sPDSGetCOMPortAutoTrackingConfigResponse_Config +{ + INT8 mAutoTrackingEnabled; +}; + +// Structure to describe request TLV 0x01 for PDSSetCOMPortAutoTrackingConfig() +struct sPDSSetCOMPortAutoTrackingConfigRequest_Config +{ + INT8 mAutoTrackingEnabled; +}; + +// Structure to describe request TLV 0x10 for PDSResetPDSData() +struct sPDSResetPDSDataRequest_GPSData +{ + bool mResetEPH:1; + bool mResetALM:1; + bool mResetPOS:1; + bool mResetTIME:1; + bool mResetIONO:1; + bool mResetUTC:1; + bool mResetHEALTH:1; + bool mResetSVDIR:1; + bool mResetSVSTEER:1; + bool mResetSADATA:1; + bool mResetRTI:1; + bool mResetALMCORR:1; + bool mResetFREQBIASEST:1; + + // Padding out 19 bits + UINT8 mReserved1:3; + UINT8 mReserved2[2]; +}; + +// Structure to describe request TLV 0x11 for PDSResetPDSData() +struct sPDSResetPDSDataRequest_CellData +{ + bool mResetPOS:1; + bool mResetLATESTGPSPOS:1; + bool mResetOTAPOS:1; + bool mResetEXTREFPOS:1; + bool mResetTIMETAG:1; + bool mResetCELLID:1; + bool mResetCACHEDCELLID:1; + bool mResetLASTSRVCELL:1; + bool mResetCURSRVCELL:1; + bool mResetNEIGHBORINFO:1; + + // Padding out 22 bits + UINT8 mReserved1:6; + UINT8 mReserved2[2]; +}; + +// Structure to describe request TLV 0x10 for PDSSinglePositionFix() +struct sPDSSinglePositionFixRequest_Mode +{ + eQMIPDSOperationTypes mSessionOperation; +}; + +// Structure to describe request TLV 0x11 for PDSSinglePositionFix() +struct sPDSSinglePositionFixRequest_Timeout +{ + UINT8 mTimeoutSeconds; +}; + +// Structure to describe request TLV 0x12 for PDSSinglePositionFix() +struct sPDSSinglePositionFixRequest_Accuracy +{ + UINT32 mDesiredAccuracyMeters; +}; + +// Structure to describe response TLV 0x01 for PDSGetServiceVersion() +struct sPDSGetServiceVersionResponse_Version +{ + UINT8 mServiceMajorVersion; + UINT8 mServiceMinorVersion; +}; + +// Structure to describe request TLV 0x01 for PDSInjectXTRAData() +struct sPDSInjectXTRADataRequest_Data +{ + UINT8 mSequenceNumber; + UINT16 mTotalLength; + UINT16 mSequenceLength; + + // This array must be the size specified by mSequenceLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x10 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_Timestamp +{ + UINT64 mUTCTimestamp; +}; + +// Structure to describe request TLV 0x11 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_Latitude +{ + double mLatitude; +}; + +// Structure to describe request TLV 0x12 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_Longitude +{ + double mLongitude; +}; + +// Structure to describe request TLV 0x13 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_AltitudeEllipsoid +{ + float mEllipsoidAltitude; +}; + +// Structure to describe request TLV 0x14 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_AltitudeSeaLevel +{ + float mMeanSeaLevelAltitude; +}; + +// Structure to describe request TLV 0x15 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_HorizontalUncertainty +{ + float mHorizontalUncertaintyCircular; +}; + +// Structure to describe request TLV 0x16 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_VerticalUncertainty +{ + float mVerticalUncertainty; +}; + +// Structure to describe request TLV 0x17 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_HorizontalConfidence +{ + UINT8 mHorizontalConfidence; +}; + +// Structure to describe request TLV 0x18 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_VerticalConfidence +{ + UINT8 mVerticalConfidence; +}; + +// Structure to describe request TLV 0x19 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_Source +{ + eQMIPDSInjectedPositionSources mSource; +}; + +// Structure to describe request TLV 0x1A for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_TimeType +{ + eQMIPDSTimeType mTimeType; +}; + +// Structure to describe request TLV 0x1B for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_PositionReliability +{ + eQMIPDSReliabilityIndicator mReliabilityIndicatorHorizontal; + eQMIPDSReliabilityIndicator mReliabilityIndicatorVertical; +}; + +// Structure to describe request TLV 0x1C for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_AltitudeInformation +{ + eQMIPDSAltitudeSource mAltitudeSource; + eQMIPDSSourceLinkage mSourceLinkage; + eQMIPDSUncertaintyCoverage mUncertaintyCoverage; +}; + +// Structure to describe request TLV 0x10 for PDSInjectWiFiPositionData() +struct sPDSInjectWiFiPositionDataRequest_Time +{ + UINT32 mWiFiTimeCounterMilliseconds; +}; + +// Structure to describe request TLV 0x11 for PDSInjectWiFiPositionData() +struct sPDSInjectWiFiPositionDataRequest_Position +{ + INT32 mWiFiLatitude; + INT32 mWiFiLongitude; + UINT16 mHEPEInMeters; + UINT8 mAPCount; + UINT8 mErrorCode; +}; + +// Structure to describe request TLV 0x12 for PDSInjectWiFiPositionData() +struct sPDSInjectWiFiPositionDataRequest_APInfo +{ + UINT8 mAPCount; + + struct sAP + { + UINT8 mMACAddress[6]; + UINT32 mRSSI; + UINT16 mBeaconChannel; + bool mUsedForPosition:1; + bool mHiddenSSID:1; + bool mEncryptionOn:1; + bool mInfrastructureMode:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + }; + + // This array must be the size specified by mAPCount + // sAP mAPs[1]; +}; + +// Structure to describe request TLV 0x13 for PDSInjectWiFiPositionData() +struct sPDSInjectWiFiPositionDataRequest_PositionReliability +{ + eQMIPDSReliabilityIndicator mReliabilityIndicatorHorizontal; +}; + +// Structure to describe response TLV 0x10 for PDSGetSBASConfig() +struct sPDSGetSBASConfigResponse_Config +{ + eQMIPDSSBASStates mState; +}; + +// Structure to describe request TLV 0x10 for PDSSetSBASConfig() +struct sPDSSetSBASConfigRequest_Config +{ + INT8 mEnableSBAS; +}; + +// Structure to describe request TLV 0x01 for PDSSendNetworkInitiatedResponse() +struct sPDSSendNetworkInitiatedResponseRequest_Action +{ + INT8 mAllowRequest; +}; + +// Structure to describe request TLV 0x10 for PDSSendNetworkInitiatedResponse() +struct sPDSSendNetworkInitiatedResponseRequest_VX +{ + bool mPrivacyValid:1; + bool mQoSValid:1; + bool mCountValid:1; + bool mIntervalValid:1; + bool mModeValid:1; + bool mRequestorIDValid:1; + + // Padding out 26 bits + UINT8 mReserved1:2; + UINT8 mReserved2[3]; + + eQMIPDSPrivacyModes mPrivacy; + UINT8 mQoS; + UINT32 mPositionCount; + UINT32 mIntervalBetweenFixesSeconds; + eQMIPDSVXModes mMode; + eQMIPDSVXDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +// Structure to describe request TLV 0x11 for PDSSendNetworkInitiatedResponse() +struct sPDSSendNetworkInitiatedResponseRequest_SUPL1 +{ + bool mPrivacyValid:1; + bool mINITHashValid:1; + bool mModeValid:1; + bool mSLPSessionIDValid:1; + bool mSLPServerIPv4AddressValid:1; + bool mSLPServerIPv6AddressValid:1; + bool mSLPServerURLAddressValid:1; + bool mDCSValid:1; + bool mRequestorIDValid:1; + bool mClientNameValid:1; + bool mQoPHorizontalAccuracyValid:1; + bool mQoPVerticalAccuracyValid:1; + bool mQoPMaxLocationAgeValid:1; + bool mQoPDelayValid:1; + + // Padding out 18 bits + UINT8 mReserved1:2; + UINT8 mReserved2[2]; + + eQMIPDSPrivacyModes mPrivacy; + UINT64 mINITHash; + eQMIPDSSUPLModes mMode; + UINT32 mSLPSessionID; + UINT32 mSLPServerIPv4Port; + UINT8 mSLPServerIPv4Address[4]; + UINT32 mSLPServerIPv6Port; + UINT8 mSLPServerIPv6Address[16]; + UINT8 mSLPServerURLLength; + + // This array must be the size specified by mSLPServerURLLength + // char mSLPServerURLAddress[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_SUPL2 +{ + eQMIPDSSUPLDataCodingSchemes mRequestDCS; + eQMIPDSSUPLIDNameDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_SUPL3 +{ + eQMIPDSSUPLIDNameDataCodingSchemes mClientNameDCS; + UINT8 mClientNameLength; + + // This array must be the size specified by mClientNameLength + // UINT8 mClientName[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_SUPL4 +{ + UINT8 mQoPHorizontalAccuracy; + UINT8 mQoPVerticalAccuracy; + UINT8 mQoPMaxLocationAge; + UINT8 mQoPDelay; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_SUPL +{ + sPDSSendNetworkInitiatedResponseRequest_SUPL1 mPDSSendNetworkInitiatedResponseRequest_SUPL1; + sPDSSendNetworkInitiatedResponseRequest_SUPL2 mPDSSendNetworkInitiatedResponseRequest_SUPL2; + sPDSSendNetworkInitiatedResponseRequest_SUPL3 mPDSSendNetworkInitiatedResponseRequest_SUPL3; + sPDSSendNetworkInitiatedResponseRequest_SUPL4 mPDSSendNetworkInitiatedResponseRequest_SUPL4; +}; + +// Structure to describe request TLV 0x12 for PDSSendNetworkInitiatedResponse() +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP1 +{ + bool mPrivacyValid:1; + bool mInvokeIDValid:1; + bool mNotificationTextValid:1; + bool mClientAddressValid:1; + bool mLocationTypeValid:1; + bool mRequestorIDValid:1; + bool mCodewordStringValid:1; + bool mServiceTypeIDValid:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; + + eQMIPDSPrivacyModes mPrivacy; + UINT8 mInvokeID; + eQMIPDSUMTSCPDataCodingSchemes mNotificationTextDCS; + UINT8 mNotificationTextLength; + + // This array must be the size specified by mNotificationTextLength + // UINT8 mNotificationText[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP2 +{ + UINT8 mClientAddressLength; + + // This array must be the size specified by mClientAddressLength + // char mClientAddress[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP3 +{ + eQMIPDSUMTSCPLocationTypes mLocationType; + eQMIPDSUMTSCPDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP4 +{ + eQMIPDSUMTSCPDataCodingSchemes mCodewordDCS; + UINT8 mCodewordLength; + + // This array must be the size specified by mCodewordLength + // UINT8 mCodeword[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP5 +{ + UINT8 mServiceTypeID; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP +{ + sPDSSendNetworkInitiatedResponseRequest_UMTSCP1 mPDSSendNetworkInitiatedResponseRequest_UMTSCP1; + sPDSSendNetworkInitiatedResponseRequest_UMTSCP2 mPDSSendNetworkInitiatedResponseRequest_UMTSCP2; + sPDSSendNetworkInitiatedResponseRequest_UMTSCP3 mPDSSendNetworkInitiatedResponseRequest_UMTSCP3; + sPDSSendNetworkInitiatedResponseRequest_UMTSCP4 mPDSSendNetworkInitiatedResponseRequest_UMTSCP4; + sPDSSendNetworkInitiatedResponseRequest_UMTSCP5 mPDSSendNetworkInitiatedResponseRequest_UMTSCP5; +}; + +// Structure to describe request TLV 0x01 for PDSInjectAbsoluteTime() +struct sPDSInjectAbsoluteTimeRequest_Time +{ + UINT64 mTimestampMilliseconds; + UINT32 mTimeUncertaintyMilliseconds; + eQMIPDSTimeBases mTimeBase; + INT8 mForceAcceptance; +}; + +// Structure to describe request TLV 0x01 for PDSInjectEFSData() +struct sPDSInjectEFSDataRequest_DateFile1 +{ + UINT8 mFilenameLength; + + // This array must be the size specified by mFilenameLength + // char mFilename[1]; +}; + +struct sPDSInjectEFSDataRequest_DateFile2 +{ + eQMIPDSEFSFileOperations mFileOperation; + UINT32 mDataLength; + UINT8 mPartNumber; + UINT8 mTotalParts; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +struct sPDSInjectEFSDataRequest_DateFile +{ + sPDSInjectEFSDataRequest_DateFile1 mPDSInjectEFSDataRequest_DateFile1; + sPDSInjectEFSDataRequest_DateFile2 mPDSInjectEFSDataRequest_DateFile2; +}; + +// Structure to describe response TLV 0x10 for PDSGetDPOConfig() +struct sPDSGetDPOConfigResponse_Config +{ + INT8 mDataPowerOptimizationEnabled; +}; + +// Structure to describe request TLV 0x10 for PDSSetDPOConfig() +struct sPDSSetDPOConfigRequest_Config +{ + eQMIPDSConfig mConfiguration; +}; + +// Structure to describe response TLV 0x10 for PDSGetODPConfig() +struct sPDSGetODPConfigResponse_Config +{ + eQMIPDSODPStates mOnDemandPositioning; +}; + +// Structure to describe request TLV 0x10 for PDSSetODPConfig() +struct sPDSSetODPConfigRequest_Config +{ + eQMIPDSODPStates mOnDemandPositioning; +}; + +// Structure to describe response TLV 0x10 for PDSGetGPSState() +struct sPDSGetGPSStateResponse_State +{ + INT8 mEngineEnabled; + bool mPositionValid:1; + bool mAltitudeVerticalUncertaintyValid:1; + bool mTimeMillisecondsValid:1; + bool mTimeWeekNumberValid:1; + bool mTimeUncertaintyValid:1; + bool mIonoValid:1; + bool mGPSEphemerisValid:1; + bool mGPSAlmanacValid:1; + bool mGPSHealthValid:1; + bool mGPSVisibleSVsValid:1; + bool mGlonassEphemerisValid:1; + bool mGlonassAlmanacValid:1; + bool mGlonassHealthValid:1; + bool mGlonassVisibleSVsValid:1; + bool mSBASEphemerisValid:1; + bool mSBASAlmanacValid:1; + bool mSBASHealthValid:1; + bool mSBASVisibleSVsValid:1; + bool mXTRAInformationValid:1; + + // Padding out 5 bits + UINT8 mReserved1:5; + + double mLatitude; + double mLongitude; + float mHorizontalUncertaintyCircular; + float mEllipsoidAltitude; + float mVerticalUncertainty; + UINT32 mTimestampInTOWMilliseconds; + UINT16 mGPSWeekNumber; + UINT32 mTimeUncertaintyMilliseconds; + INT8 mIonoIsValid; + UINT32 mGPSEphemerisSVMask; + UINT32 mGPSAlmanacSVMask; + UINT32 mGPSHealthSVMask; + UINT32 mGPSVisibleSVMask; + UINT32 mGlonassEphemerisSVMask; + UINT32 mGlonassAlmanacSVMask; + UINT32 mGlonassHealthSVMask; + UINT32 mGlonassVisibleSVMask; + UINT32 mSBASEphemerisSVMask; + UINT32 mSBASAlmanacSVMask; + UINT32 mSBASHealthSVMask; + UINT32 mSBASVisibleSVMask; + UINT16 mXTRAGPSStartWeek; + UINT16 mXTRAGPSStartMinutes; + INT32 mElevation; +}; + +// Structure to describe request TLV 0x01 for PDSSetPPMEventReport() +struct sPDSSetPPMEventReportRequest_ReportPPMEvents +{ + INT8 mReportPPMEvents; +}; + +// Structure to describe request TLV 0x01 for PDSSetSPIStreamingReport() +struct sPDSSetSPIStreamingReportRequest_ReportEvents +{ + INT8 mReportSPIEvents; +}; + +// Structure to describe indication TLV 0x10 for PDS SetSPIStreamingReportIndication +struct sPDSSetSPIStreamingReportIndication_SPIStreamingRequest +{ + INT8 mStreamSPIStatus; +}; + +// Structure to describe request TLV 0x01 for PDSSetSPIStatus() +struct sPDSSetSPIStatusRequest_Status +{ + eQMIPDSSPIState mSPIState; + UINT8 mSPIConfidence; +}; + +// Structure to describe request TLV 0x01 for PDSSetPPMReportingState() +struct sPDSSetPPMReportingStateRequest_PPMReportingState +{ + eQMIPDSReportingState mReportingState; + UINT16 mReportingPeriodSeconds; +}; + +// Structure to describe indication TLV 0x10 for PDS SetPPMReportingStateIndication +struct sPDSSetPPMReportingStateIndication_PPMPageReport +{ + UINT32 mPageTimeMilliseconds; + UINT16 mPagePNOffset; + UINT8 mPageBandClass; + UINT16 mPageCDMAFrequency; + UINT16 mPageBaseID; + UINT16 mPageSystemID; + UINT16 mPageNetworkID; +}; + +// Structure to describe indication TLV 0x11 for PDS SetPPMReportingStateIndication +struct sPDSSetPPMReportingStateIndication_PPMMeasurementReport +{ + UINT32 mReferenceTimeMilliseconds; + UINT8 mReferenceBandClass; + UINT16 mReferenceCDMAFrequency; + UINT8 mReferenceTotalRXPower; + UINT16 mReferencePNOffset; + UINT8 mReferenceStrength; + UINT8 mReferenceRMSErrorPhase; + UINT8 mNumberOfPilots; + + struct sPilot + { + UINT16 mPilotPNOffset; + UINT8 mPilotStrength; + UINT8 mPilotRMSErrorPhase; + INT16 mPilotPhase; + }; + + // This array must be the size specified by mNumberOfPilots + // sPilot mPilots[1]; +}; + +// Structure to describe indication TLV 0x12 for PDS SetPPMReportingStateIndication +struct sPDSSetPPMReportingStateIndication_PPMSuspendReason +{ + eQMIPDSSuspendReason mSuspendReason; +}; + +// Structure to describe indication TLV 0x13 for PDS SetPPMReportingStateIndication +struct sPDSSetPPMReportingStateIndication_PPMStopReason +{ + eQMIPDSStopReason mStopReason; +}; + +// Structure to describe request TLV 0x01 for PDSForceReceiverOff() +struct sPDSForceReceiverOffRequest_ForceReceiverOff +{ + eQMIPDSForceReceiverOff mForceReceiverOff; +}; + +// Structure to describe response TLV 0x10 for PDSGetPositionMethodsState() +struct sPDSGetPositionMethodsStateResponse_XTRATime +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe response TLV 0x11 for PDSGetPositionMethodsState() +struct sPDSGetPositionMethodsStateResponse_XTRAData +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe response TLV 0x12 for PDSGetPositionMethodsState() +struct sPDSGetPositionMethodsStateResponse_WiFi +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe request TLV 0x10 for PDSSetPositionMethodsState() +struct sPDSSetPositionMethodsStateRequest_XTRATime +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe request TLV 0x11 for PDSSetPositionMethodsState() +struct sPDSSetPositionMethodsStateRequest_XTRAData +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe request TLV 0x12 for PDSSetPositionMethodsState() +struct sPDSSetPositionMethodsStateRequest_WiFi +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe request TLV 0x10 for PDSInjectSensorData() +struct sPDSInjectSensorDataRequest_3AxisAccelerometerData +{ + UINT32 mSensorTimeOfFirstSampleMilliseconds; + bool mSignReversalRequired:1; + + // Padding out 7 bits + UINT8 mReserved1:7; + + UINT8 mNumberOfSamples; + + struct sSample + { + UINT16 mSampleTimeOffsetMilliseconds; + float mXAxisSample; + float mYAxisSample; + float mZAxisSample; + }; + + // This array must be the size specified by mNumberOfSamples + // sSample mSamples[1]; +}; + +// Structure to describe request TLV 0x11 for PDSInjectSensorData() +struct sPDSInjectSensorDataRequest_3AxisGyroData +{ + UINT32 mSensorTimeOfFirstSampleMilliseconds; + bool mSignReversalRequired:1; + + // Padding out 7 bits + UINT8 mReserved1:7; + + UINT8 mNumberOfSamples; + + struct sSample + { + UINT16 mSampleTimeOffsetMilliseconds; + float mXAxisSample; + float mYAxisSample; + float mZAxisSample; + }; + + // This array must be the size specified by mNumberOfSamples + // sSample mSamples[1]; +}; + +// Structure to describe response TLV 0x10 for PDSInjectSensorData() +struct sPDSInjectSensorDataResponse_AccelerometerSampleSetCount +{ + UINT8 mAccelerometerSampleSetCount; +}; + +// Structure to describe response TLV 0x11 for PDSInjectSensorData() +struct sPDSInjectSensorDataResponse_GyroSampleSetCount +{ + UINT8 mGyroSampleSetCount; +}; + +// Structure to describe request TLV 0x01 for PDSInjectTimeSyncData() +struct sPDSInjectTimeSyncDataRequest_TimeTag +{ + UINT32 mReferenceCounter; + UINT32 mSensorProcessorRXTimeMilliseconds; + UINT32 mSensorProcessorTXTimeMilliseconds; +}; + +// Structure to describe response TLV 0x10 for PDSGetSensorConfig() +struct sPDSGetSensorConfigResponse_CradleMountState +{ + eQMIPDSCradleMountState mCradleMountState; + UINT8 mCradleMountStateConfidence; +}; + +// Structure to describe response TLV 0x11 for PDSGetSensorConfig() +struct sPDSGetSensorConfigResponse_ExternalPowerSupplyState +{ + eQMIPDSExternalPowerState mExternalPowerSupplyState; +}; + +// Structure to describe request TLV 0x10 for PDSSetSensorConfig() +struct sPDSSetSensorConfigRequest_CradleMountState +{ + eQMIPDSCradleMountState mCradleMountState; + UINT8 mCradleMountStateConfidence; +}; + +// Structure to describe request TLV 0x11 for PDSSetSensorConfig() +struct sPDSSetSensorConfigRequest_ExternalPowerState +{ + eQMIPDSExternalPowerState mExternalPowerSupplyState; +}; + +// Structure to describe response TLV 0x10 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_GyroDataVariance +{ + float mGyroDataVariance; +}; + +// Structure to describe response TLV 0x11 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_GyroBiasRandomWalk +{ + float mGyroBiasRandomWalk; +}; + +// Structure to describe response TLV 0x12 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_VirtualGyroGravityAveragingLength +{ + UINT32 mVirtualGyroGravityAveragingLengthMilliseconds; +}; + +// Structure to describe response TLV 0x13 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_HeadingFilterMode +{ + INT8 mHeadingFilterMode; +}; + +// Structure to describe response TLV 0x14 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_VelocityConstraintVariance +{ + float mVelocityConstraintVariance; +}; + +// Structure to describe response TLV 0x15 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_PositioningMethod +{ + bool mSuppressInjectedPosition:1; + bool mReportUsingInstantaneousInformation:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x10 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_GyroDataVariance +{ + float mGyroDataVariance; +}; + +// Structure to describe request TLV 0x11 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_GyroBiasRandomWalk +{ + float mGyroBiasRandomWalk; +}; + +// Structure to describe request TLV 0x12 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_VirtualGyroCravityAveragingLength +{ + UINT32 mVirtualGyroGravityAveragingLengthMilliseconds; +}; + +// Structure to describe request TLV 0x13 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_HeadingFilterMode +{ + INT8 mHeadingFilterMode; +}; + +// Structure to describe request TLV 0x14 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_VelocityConstraintVariance +{ + float mVelocityConstraintVariance; +}; + +// Structure to describe request TLV 0x15 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_PositioningMethod +{ + bool mSuppressInjectedPosition:1; + bool mReportUsingInstantaneousInformation:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x10 for PDSSetWLANBlanking() +struct sPDSSetWLANBlankingRequest_BlankingEnable +{ + eQMIPDSBlankingEnable mBlankingEnable; +}; + +// Structure to describe request TLV 0x11 for PDSSetWLANBlanking() +struct sPDSSetWLANBlankingRequest_ActiveChannels +{ + bool mChannel1:1; + bool mChannel2:1; + bool mChannel3:1; + bool mChannel4:1; + bool mChannel5:1; + bool mChannel6:1; + bool mChannel7:1; + bool mChannel8:1; + bool mChannel9:1; + bool mChannel10:1; + bool mChannel11:1; + bool mChannel12:1; + bool mChannel13:1; + bool mChannel14:1; + + // Padding out 18 bits + UINT8 mReserved1:2; + UINT8 mReserved2[2]; +}; + +// Structure to describe request TLV 0x10 for PDSSetSecurityChallengeReport() +struct sPDSSetSecurityChallengeReportRequest_EnableSecurity +{ + eQMIPDSReportSecurityChallenge mReportSecurityChallenge; +}; + +// Structure to describe indication TLV 0x10 for PDS SetSecurityChallengeReportIndication +struct sPDSSetSecurityChallengeReportIndication_EnableSecurity +{ + eQMIPDSEncryptionAlgorithm mEncryptionAlgorithm; + UINT8 mEncryptionDataID; + UINT8 mEncryptionDataLength; + + // This array must be the size specified by mEncryptionDataLength + // UINT8 mEncryptionData[1]; +}; + +// Structure to describe request TLV 0x10 for PDSSetSecurityChallenge() +struct sPDSSetSecurityChallengeRequest_SecureHashAlgorithm +{ + UINT8 mEncryptionDataID; + UINT8 mEncryptionDataLength; + + // This array must be the size specified by mEncryptionDataLength + // UINT8 mEncryptionData[1]; +}; + +// Structure to describe response TLV 0x10 for PDSGetSecurityEncryptionConfig() +struct sPDSGetSecurityEncryptionConfigResponse_SecureClientTimestamp +{ + eQMIPDSEncryptionAlgorithm mEncryptionAlgorithm; + UINT64 mEncryptionTimestampMilliseconds; + UINT8 mEncryptionDataLength; + + // This array must be the size specified by mEncryptionDataLength + // UINT8 mEncryptionData[1]; +}; + +// Structure to describe request TLV 0x10 for PDSSetSecurityUpdateRate() +struct sPDSSetSecurityUpdateRateRequest_EnableSecurity +{ + UINT8 mUpdateRate; +}; + +// Structure to describe request TLV 0x10 for PDSSetCellDatabaseControl() +struct sPDSSetCellDatabaseControlRequest_Control +{ + bool mPositionInfoStorage:1; + bool mTimeInfoStorage:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x10 for AUTHStartEAPSession() +struct sAUTHStartEAPSessionRequest_MethodMask +{ + bool mEAPSIM:1; + bool mEAPAKA:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x01 for AUTHSendEAPPacket() +struct sAUTHSendEAPPacketRequest_RequestPacket +{ + UINT8 mEAPRequestPacket[9999]; +}; + +// Structure to describe response TLV 0x01 for AUTHSendEAPPacket() +struct sAUTHSendEAPPacketResponse_ResponsePacket +{ + UINT8 mResponsePacket[9999]; +}; + +// Structure to describe indication TLV 0x01 for AUTH EAPSessionResultIndication +struct sAUTHEAPSessionResultIndication_Result +{ + eQMIAUTHEAPResult mResult; +}; + +// Structure to describe response TLV 0x01 for AUTHGetEAPSessionKeys() +struct sAUTHGetEAPSessionKeysResponse_SessionKeys +{ + UINT8 mSessionKeys[9999]; +}; + +// Structure to describe request TLV 0x01 for AUTHRunAKA() +struct sAUTHRunAKARequest_Version +{ + eQMIAUTHAKAVersion mAKAVersion; +}; + +// Structure to describe request TLV 0x10 for AUTHRunAKA() +struct sAUTHRunAKARequest_Parameters1 +{ + UINT8 mRandomChallengeLength; + + // This array must be the size specified by mRandomChallengeLength + // UINT8 mRandomChallenge[1]; +}; + +struct sAUTHRunAKARequest_Parameters2 +{ + UINT8 mAuthenticationTokenLength; + + // This array must be the size specified by mAuthenticationTokenLength + // UINT8 mAuthenticationToken[1]; +}; + +struct sAUTHRunAKARequest_Parameters +{ + sAUTHRunAKARequest_Parameters1 mAUTHRunAKARequest_Parameters1; + sAUTHRunAKARequest_Parameters2 mAUTHRunAKARequest_Parameters2; +}; + +// Structure to describe response TLV 0x01 for AUTHRunAKA() +struct sAUTHRunAKAResponse_Handle +{ + UINT32 mHandle; +}; + +// Structure to describe indication TLV 0x01 for AUTH AKAResultIndication +struct sAUTHAKAResultIndication_Result +{ + UINT32 mHandle; + eQMIAUTHAKAResult mResult; +}; + +// Structure to describe request TLV 0x10 for VoiceIndicationRegistration() +struct sVoiceIndicationRegistrationRequest_DTMF +{ + INT8 mEnableEvents; +}; + +// Structure to describe request TLV 0x11 for VoiceIndicationRegistration() +struct sVoiceIndicationRegistrationRequest_VoicePrivacy +{ + INT8 mEnableEvents; +}; + +// Structure to describe request TLV 0x12 for VoiceIndicationRegistration() +struct sVoiceIndicationRegistrationRequest_SupplementaryService +{ + INT8 mEnableEvents; +}; + +// Structure to describe request TLV 0x01 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_CallingNumber +{ + // String is variable length, but must be size of the container + // char mCallingNumber[1]; +}; + +// Structure to describe request TLV 0x10 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_CallType +{ + eQMIVoiceCallTypes mCallType; +}; + +// Structure to describe request TLV 0x11 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_CLIR +{ + eQMIVoiceCLIRTypes mCLIRType; +}; + +// Structure to describe request TLV 0x12 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_UUS +{ + eQMIVoiceUUSTypes mUUSType; + eQMIVoiceUUSDataCodingSchemes mUUSDCS; + UINT8 mUUSLength; + + // This array must be the size specified by mUUSLength + // UINT8 mUUSData[1]; +}; + +// Structure to describe request TLV 0x13 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_CUG +{ + UINT16 mCUGIndex; + INT8 mSuppressPreferentialCUG; + INT8 mSuppressOASubscription; +}; + +// Structure to describe request TLV 0x14 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_EmergencyCategory +{ + bool mPolice:1; + bool mAmbulance:1; + bool mFireBrigade:1; + bool mMarineGuard:1; + bool mMountainRescue:1; + bool mManualCall:1; + bool mAutomaticCall:1; + bool mReserved:1; +}; + +// Structure to describe response TLV 0x10 for VoiceCallOriginate() +struct sVoiceCallOriginateResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x11 for VoiceCallOriginate() +struct sVoiceCallOriginateResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceCallOriginate() +struct sVoiceCallOriginateResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x13 for VoiceCallOriginate() +struct sVoiceCallOriginateResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceCallEnd() +struct sVoiceCallEndRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x10 for VoiceCallEnd() +struct sVoiceCallEndResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x01 for VoiceCallAnswer() +struct sVoiceCallAnswerRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x10 for VoiceCallAnswer() +struct sVoiceCallAnswerResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x01 for VoiceGetCallInfo() +struct sVoiceGetCallInfoRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_CallInfo +{ + UINT8 mCallID; + eQMIVoiceCallStates mCallState; + eQMIVoiceCallTypes mCallType; + eQMIVoiceCallDirections mDirection; + eQMIVoiceCallModes mMode; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_RemotePartyNumber +{ + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_ServiceOption +{ + UINT16 mServiceOption; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_VoicePrivacy +{ + eQMIVoicePrivacyLevels mVoicePrivacy; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_OTASPStatus +{ + eQMIVoiceOTASPStati mOTASPStatus; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_RemotePartyName +{ + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mCodingScheme; + UINT8 mCallerNameLength; + + // This array must be the size specified by mCallerNameLength + // UINT8 mCallerName[1]; +}; + +// Structure to describe response TLV 0x16 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_UUS +{ + eQMIVoiceUUSTypes mUUSType; + eQMIVoiceUUSDataCodingSchemes mUUSDCS; + UINT8 mUUSLength; + + // This array must be the size specified by mUUSLength + // UINT8 mUUSData[1]; +}; + +// Structure to describe response TLV 0x17 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_AlertingType +{ + eQMIVoiceAlertingTypes mAlertingType; +}; + +// Structure to describe response TLV 0x18 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x19 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_ConnectedNumberInfo +{ + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe response TLV 0x1A for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_DiagnosticInfo +{ + UINT8 mDiagnosticInfoLength; + + // This array must be the size specified by mDiagnosticInfoLength + // UINT8 mDiagnosticInfo[1]; +}; + +// Structure to describe indication TLV 0x10 for Voice OTASPIndication +struct sVoiceOTASPIndication_OTASPStatus +{ + UINT8 mCallID; + eQMIVoiceOTASPStati mOTASPStatus; +}; + +// Structure to describe indication TLV 0x01 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe indication TLV 0x10 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_Signal +{ + UINT8 mSignalType; + UINT8 mAlertPitch; + UINT8 mSignal; +}; + +// Structure to describe indication TLV 0x11 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CallerID +{ + UINT8 mPresentationIndicator; + UINT8 mCallerIDLength; + + // This array must be the size specified by mCallerIDLength + // char mCallerID[1]; +}; + +// Structure to describe indication TLV 0x12 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_Display +{ + // String is variable length, but must be size of the container + // char mDisplayBuffer[1]; +}; + +// Structure to describe indication TLV 0x13 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_ExtendedDisplay +{ + UINT8 mExtendedDisplayBuffer[182]; +}; + +// Structure to describe indication TLV 0x14 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CallerName +{ + // String is variable length, but must be size of the container + // char mCallerName[1]; +}; + +// Structure to describe indication TLV 0x15 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CallWaiting +{ + INT8 mNewCallWaiting; +}; + +// Structure to describe indication TLV 0x16 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_ConnectedNumberInfo +{ + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe indication TLV 0x17 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CallingPartyNumberInfo +{ + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe indication TLV 0x18 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CalledPartyNumberInfo +{ + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe indication TLV 0x19 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_RedirectingNumberInfo +{ + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mRedirectReason; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe indication TLV 0x1A for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CLIRCause +{ + eQMIVoiceCLIRCauses mCLIRCause; +}; + +// Structure to describe indication TLV 0x1B for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_NSSAudio +{ + UINT8 mUpLink; + UINT8 mDownLink; +}; + +// Structure to describe indication TLV 0x1C for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_NSSRelease +{ + eQMIVoiceNSSReleases mNSSRelease; +}; + +// Structure to describe indication TLV 0x1D for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_LineControlInfo +{ + INT8 mPolarityIncluded; + INT8 mToggleMode; + INT8 mReversePolarity; + UINT8 mPowerDenialTime; +}; + +// Structure to describe request TLV 0x01 for VoiceSendFlash() +struct sVoiceSendFlashRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x10 for VoiceSendFlash() +struct sVoiceSendFlashRequest_Payload +{ + // String is variable length, but must be size of the container + // char mFlashPayload[1]; +}; + +// Structure to describe request TLV 0x11 for VoiceSendFlash() +struct sVoiceSendFlashRequest_Type +{ + eQMIVoiceFlashTypes mFlashType; +}; + +// Structure to describe response TLV 0x10 for VoiceSendFlash() +struct sVoiceSendFlashResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x01 for VoiceBurstDTMF() +struct sVoiceBurstDTMFRequest_Info +{ + UINT8 mCallID; + UINT8 mDTMFBufferLength; + + // This array must be the size specified by mDTMFBufferLength + // char mDTMFBuffer[1]; +}; + +// Structure to describe request TLV 0x10 for VoiceBurstDTMF() +struct sVoiceBurstDTMFRequest_Lengths +{ + eQMIVoicePulseWidths mDTMFPulseWidth; + eQMIVoiceInterdigitIntervals mDTMFInterdigitInterval; +}; + +// Structure to describe request TLV 0x01 for VoiceStartContinuousDTMF() +struct sVoiceStartContinuousDTMFRequest_Info +{ + UINT8 mCallID; + char mDTMFDigit; +}; + +// Structure to describe response TLV 0x10 for VoiceStartContinuous() +struct sVoiceStartContinuousResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x01 for VoiceStopContinuousDTMF() +struct sVoiceStopContinuousDTMFRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x10 for VoiceStopContinuous() +struct sVoiceStopContinuousResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe indication TLV 0x01 for Voice DTMFIndication +struct sVoiceDTMFIndication_DTMFInfo +{ + UINT8 mCallID; + eQMIVoiceDTMFEvents mDTMFEvent; + UINT8 mDTMFBufferLength; + + // This array must be the size specified by mDTMFBufferLength + // char mDTMFBuffer[1]; +}; + +// Structure to describe indication TLV 0x10 for Voice DTMFIndication +struct sVoiceDTMFIndication_Lengths +{ + eQMIVoicePulseWidths mDTMFPulseWidth; + eQMIVoiceInterdigitIntervals mDTMFInterdigitInterval; +}; + +// Structure to describe request TLV 0x01 for VoiceSetPreferredPrivacy() +struct sVoiceSetPreferredPrivacyRequest_Preference +{ + eQMIVoiceDTMFPrivacyLevels mPrivacyLevel; +}; + +// Structure to describe indication TLV 0x01 for Voice PrivacyIndication +struct sVoicePrivacyIndication_DTMFInfo +{ + UINT8 mCallID; + eQMIVoiceDTMFPrivacyLevels mPrivacyLevel; +}; + +// Structure to describe indication TLV 0x01 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_CallInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceCallStates mCallState; + eQMIVoiceCallTypes mCallType; + eQMIVoiceCallDirections mDirection; + eQMIVoiceCallModes mMode; + INT8 mMultiparty; + eQMIVoiceALSLineIndicators mALSLineIndicator; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x10 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_RemotePartyNumber +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x11 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_RemotePartyName +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mCodingScheme; + UINT8 mCallerNameLength; + + // This array must be the size specified by mCallerNameLength + // UINT8 mCallerName[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x12 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_AlertingType +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceAlertingTypes mAlertingType; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x13 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_ServiceOption +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT16 mServiceOption; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x14 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_CallEndReason +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mCallEndReason; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x15 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_AlphaID +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x16 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_ConnectedNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x17 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_DiagnosticInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mDiagnosticInfoLength; + + // This array must be the size specified by mDiagnosticInfoLength + // UINT8 mDiagnosticInfo[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x18 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_CalledPartyNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x19 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_RedirectingNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x10 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_CallInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceCallStates mCallState; + eQMIVoiceCallTypes mCallType; + eQMIVoiceCallDirections mDirection; + eQMIVoiceCallModes mMode; + INT8 mMultiparty; + eQMIVoiceALSLineIndicators mALSLineIndicator; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x11 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_RemotePartyNumber +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_RemotePartyName +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mCodingScheme; + UINT8 mCallerNameLength; + + // This array must be the size specified by mCallerNameLength + // UINT8 mCallerName[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_AlertingType +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceAlertingTypes mAlertingType; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x14 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_UUS +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceUUSTypes mUUSType; + eQMIVoiceUUSDataCodingSchemes mUUSDCS; + UINT8 mUUSLength; + + // This array must be the size specified by mUUSLength + // UINT8 mUUSData[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x15 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_ServiceOption +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT16 mServiceOption; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x16 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_OTASPStatus +{ + eQMIVoiceOTASPStati mOTASPStatus; +}; + +// Structure to describe response TLV 0x17 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_VoicePrivacy +{ + eQMIVoicePrivacyLevels mVoicePrivacy; +}; + +// Structure to describe response TLV 0x18 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_CallEndReason +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mCallEndReason; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x19 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_AlphaID +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x1A for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_ConnectedNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x1B for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_DiagnosticInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mDiagnosticInfoLength; + + // This array must be the size specified by mDiagnosticInfoLength + // UINT8 mDiagnosticInfo[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x1C for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_CalledPartyNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x1D for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_RedirectingNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe request TLV 0x01 for VoiceManageCalls() +struct sVoiceManageCallsRequest_Info +{ + eQMIVoiceSupplementaryServiceCallTypes mSupplementaryServiceType; +}; + +// Structure to describe request TLV 0x10 for VoiceManageCalls() +struct sVoiceManageCallsRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x10 for VoiceManageCalls() +struct sVoiceManageCallsResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe indication TLV 0x01 for Voice SupplementaryServiceIndication +struct sVoiceSupplementaryServiceIndication_Info +{ + UINT8 mCallID; + eQMIVoiceSupplementaryNotificationTypes mNotificationType; +}; + +// Structure to describe indication TLV 0x10 for Voice SupplementaryServiceIndication +struct sVoiceSupplementaryServiceIndication_CUG +{ + UINT16 mCUGIndex; +}; + +// Structure to describe indication TLV 0x11 for Voice SupplementaryServiceIndication +struct sVoiceSupplementaryServiceIndication_ECT +{ + eQMIVoiceECTCallStates mECTCallState; + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe request TLV 0x01 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_Info +{ + eQMIVoiceSupplementaryServiceTypes mService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x10 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe request TLV 0x11 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_Password +{ + char mCallBarringPassword[4]; +}; + +// Structure to describe request TLV 0x12 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_Number +{ + // String is variable length, but must be size of the container + // char mCallForwardingNumber[1]; +}; + +// Structure to describe request TLV 0x13 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_Timer +{ + UINT8 mNoReplyTimerSeconds; +}; + +// Structure to describe request TLV 0x14 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_CallForwarding +{ + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; +}; + +// Structure to describe response TLV 0x10 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x11 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x13 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x14 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x10 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingRequest_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingResponse_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCallWaitinge() +struct sVoiceGetCallWaitingeResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceGetCallBarring() +struct sVoiceGetCallBarringRequest_Reason +{ + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x10 for VoiceGetCallBarring() +struct sVoiceGetCallBarringRequest_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_Status +{ + INT8 mCLIPActive; + INT8 mCLIPProvisioned; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_Status +{ + INT8 mCLIRActive; + eQMIVoiceProvisioningStates mCLIRProvisionStatus; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingRequest_Reason +{ + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x10 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingRequest_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_Info +{ + UINT8 mInstanceCount; + + struct sInstance1 + { + INT8 mServiceActive; + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + struct sInstance2 + { + UINT8 mNoReplyTimerSeconds; + }; + + struct sInstance + { + sInstance1 mInstance1; + sInstance2 mInstance2; + }; + + // This array must be the size specified by mInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe response TLV 0x16 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_ExtendedInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + INT8 mServiceActive; + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; + UINT8 mNoReplyTimerSeconds; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe request TLV 0x01 for VoiceSetCallBarringPassword() +struct sVoiceSetCallBarringPasswordRequest_Info +{ + eQMIVoiceSupplementaryServiceReasons mReason; + char mOldCallBarringPassword[4]; + char mNewCallBarringPassword[4]; + char mNewCallBarringPasswordRepeat[4]; +}; + +// Structure to describe response TLV 0x10 for VoiceSetCallBarring() +struct sVoiceSetCallBarringResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x11 for VoiceSetCallBarring() +struct sVoiceSetCallBarringResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceSetCallBarring() +struct sVoiceSetCallBarringResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x13 for VoiceSetCallBarring() +struct sVoiceSetCallBarringResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x14 for VoiceSetCallBarring() +struct sVoiceSetCallBarringResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDRequest_Info +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe response TLV 0x10 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x11 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_Data +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceAnswerUSSD() +struct sVoiceAnswerUSSDRequest_Info +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe indication TLV 0x01 for Voice USSDIndication +struct sVoiceUSSDIndication_Type +{ + eQMIVoiceUSSDNotifcationTypes mNotificationType; +}; + +// Structure to describe indication TLV 0x10 for Voice USSDIndication +struct sVoiceUSSDIndication_Data +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe indication TLV 0x01 for Voice USSIndication +struct sVoiceUSSIndication_Info +{ + UINT8 mCallID; + eQMIVoiceUUSTypes mUUSType; + eQMIVoiceUUSDataCodingSchemes mUUSDCS; + UINT8 mUUSLength; + + // This array must be the size specified by mUUSLength + // UINT8 mUUSData[1]; +}; + +// Structure to describe request TLV 0x10 for VoiceSetConfig() +struct sVoiceSetConfigRequest_AutoAnswer +{ + INT8 mAutoAnswer; +}; + +// Structure to describe request TLV 0x11 for VoiceSetConfig() +struct sVoiceSetConfigRequest_AirTimer +{ + UINT8 mNAMID; + UINT32 mAirTimerMinutes; +}; + +// Structure to describe request TLV 0x12 for VoiceSetConfig() +struct sVoiceSetConfigRequest_RoamTimer +{ + UINT8 mNAMID; + UINT32 mRoamTimerMinutes; +}; + +// Structure to describe request TLV 0x13 for VoiceSetConfig() +struct sVoiceSetConfigRequest_TTYMode +{ + eQMIVoiceTTYModes mTTYMode; +}; + +// Structure to describe request TLV 0x14 for VoiceSetConfig() +struct sVoiceSetConfigRequest_PreferredVoiceSO +{ + UINT8 mNAMID; + INT8 mEVRCCapability; + eQMIVoiceServiceOptions mHomePageVoiceServiceOption; + eQMIVoiceServiceOptions mHomeOriginationVoiceServiceOption; + eQMIVoiceServiceOptions mRoamOriginationVoiceServiceOption; +}; + +// Structure to describe request TLV 0x15 for VoiceSetConfig() +struct sVoiceSetConfigRequest_PreferredVoiceDomain +{ + eQMIVoiceDomains mPreferredDomain; +}; + +// Structure to describe response TLV 0x10 for VoiceSetConfig() +struct sVoiceSetConfigResponse_AutoAnswer +{ + INT8 mWriteFailed; +}; + +// Structure to describe response TLV 0x11 for VoiceSetConfig() +struct sVoiceSetConfigResponse_AirTimer +{ + INT8 mWriteFailed; +}; + +// Structure to describe response TLV 0x12 for VoiceSetConfig() +struct sVoiceSetConfigResponse_RoamTimer +{ + INT8 mWriteFailed; +}; + +// Structure to describe response TLV 0x13 for VoiceSetConfig() +struct sVoiceSetConfigResponse_TTYMode +{ + INT8 mWriteFailed; +}; + +// Structure to describe response TLV 0x14 for VoiceSetConfig() +struct sVoiceSetConfigResponse_PreferredVoiceSO +{ + INT8 mWriteFailed; +}; + +// Structure to describe response TLV 0x15 for VoiceSetConfig() +struct sVoiceSetConfigResponse_PreferredVoiceDomain +{ + INT8 mWriteFailed; +}; + +// Structure to describe request TLV 0x10 for VoiceGetConfig() +struct sVoiceGetConfigRequest_AutoAnswer +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x11 for VoiceGetConfig() +struct sVoiceGetConfigRequest_AirTimer +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x12 for VoiceGetConfig() +struct sVoiceGetConfigRequest_RoamTimer +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x13 for VoiceGetConfig() +struct sVoiceGetConfigRequest_TTYMode +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x14 for VoiceGetConfig() +struct sVoiceGetConfigRequest_PreferredVoiceSO +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x15 for VoiceGetConfig() +struct sVoiceGetConfigRequest_AMRStatus +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x16 for VoiceGetConfig() +struct sVoiceGetConfigRequest_PreferredVoicePrivacy +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x17 for VoiceGetConfig() +struct sVoiceGetConfigRequest_NAM +{ + UINT8 mNAMID; +}; + +// Structure to describe request TLV 0x18 for VoiceGetConfig() +struct sVoiceGetConfigRequest_VoiceDomain +{ + INT8 mInclude; +}; + +// Structure to describe response TLV 0x10 for VoiceGetConfig() +struct sVoiceGetConfigResponse_AutoAnswer +{ + INT8 mAutoAnswer; +}; + +// Structure to describe response TLV 0x11 for VoiceGetConfig() +struct sVoiceGetConfigResponse_AirTimer +{ + UINT8 mNAMID; + UINT32 mAirTimerMinutes; +}; + +// Structure to describe response TLV 0x12 for VoiceGetConfig() +struct sVoiceGetConfigResponse_RoamTimer +{ + UINT8 mNAMID; + UINT32 mRoamTimerMinutes; +}; + +// Structure to describe response TLV 0x13 for VoiceGetConfig() +struct sVoiceGetConfigResponse_TTYMode +{ + eQMIVoiceTTYModes mTTYMode; +}; + +// Structure to describe response TLV 0x14 for VoiceGetConfig() +struct sVoiceGetConfigResponse_PreferredVoiceSO +{ + UINT8 mNAMID; + INT8 mEVRCCapability; + eQMIVoiceServiceOptions mHomePageVoiceServiceOption; + eQMIVoiceServiceOptions mHomeOriginationVoiceServiceOption; + eQMIVoiceServiceOptions mRoamOriginationVoiceServiceOption; +}; + +// Structure to describe response TLV 0x15 for VoiceGetConfig() +struct sVoiceGetConfigResponse_AMRConfig +{ + INT8 mGSMAMR; + bool mWCDMAAMRWB:1; + bool mGSMHRAMR:1; + bool mGSMAMRWB:1; + bool mGSMAMRNB:1; + + // Padding out 4 bits + UINT8 mReserved1:4; +}; + +// Structure to describe response TLV 0x16 for VoiceGetConfig() +struct sVoiceGetConfigResponse_Privacy +{ + eQMIVoicePrivacyLevels mVoicePrivacy; +}; + +// Structure to describe response TLV 0x17 for VoiceGetConfig() +struct sVoiceGetConfigResponse_PreferredVoiceDomain +{ + eQMIVoiceDomains mPreferredDomain; +}; + +// Structure to describe request TLV 0x01 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Info +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryServiceRequest; + INT8 mModifiedByCallControl; +}; + +// Structure to describe request TLV 0x10 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Class +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe request TLV 0x11 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Reason +{ + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x12 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Number +{ + // String is variable length, but must be size of the container + // char mCallForwardingNumber[1]; +}; + +// Structure to describe request TLV 0x13 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Timer +{ + UINT8 mNoReplyTimerSeconds; +}; + +// Structure to describe request TLV 0x14 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_USSData +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe request TLV 0x15 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x16 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe request TLV 0x17 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Password +{ + char mCallBarringPassword[4]; +}; + +// Structure to describe request TLV 0x18 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_NewPassword +{ + char mNewCallBarringPassword[4]; + char mNewCallBarringPasswordRepeat[4]; +}; + +// Structure to describe request TLV 0x19 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_DataSource +{ + INT8 mResponseData; +}; + +// Structure to describe request TLV 0x1A for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe request TLV 0x1B for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_CallForwarding +{ + UINT8 mInstanceCount; + + struct sInstance1 + { + INT8 mServiceActive; + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + struct sInstance2 + { + UINT8 mNoReplyTimerSeconds; + }; + + struct sInstance + { + sInstance1 mInstance1; + sInstance2 mInstance2; + }; + + // This array must be the size specified by mInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe request TLV 0x1C for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_CLIR +{ + INT8 mCLIRActive; + eQMIVoiceProvisioningStates mCLIRProvisionStatus; +}; + +// Structure to describe request TLV 0x1D for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_CLIP +{ + INT8 mCLIPActive; + INT8 mCLIPProvisioned; +}; + +// Structure to describe request TLV 0x1E for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_COLP +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe request TLV 0x1F for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_COLR +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe request TLV 0x20 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_CNAP +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe request TLV 0x01 for VoiceAsyncInitiateUSSD() +struct sVoiceAsyncInitiateUSSDRequest_Info +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe indication TLV 0x10 for Voice USSDAsyncIndication +struct sVoiceUSSDAsyncIndication_Error +{ + eQMIErrors mQMIError; +}; + +// Structure to describe indication TLV 0x11 for Voice USSDAsyncIndication +struct sVoiceUSSDAsyncIndication_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe indication TLV 0x12 for Voice USSDAsyncIndication +struct sVoiceUSSDAsyncIndication_Info +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe indication TLV 0x13 for Voice USSDAsyncIndication +struct sVoiceUSSDAsyncIndication_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe request TLV 0x01 for VoiceBindSubscription() +struct sVoiceBindSubscriptionRequest_Type +{ + eQMIVoiceSubscriptionTypes mSubscriptionType; +}; + +// Structure to describe request TLV 0x01 for VoiceALSSetLineSwitching() +struct sVoiceALSSetLineSwitchingRequest_Switching +{ + INT8 mLineSwitchingAllowed; +}; + +// Structure to describe request TLV 0x01 for VoiceALSSelectLine() +struct sVoiceALSSelectLineRequest_Line +{ + eQMIVoiceALSLines mLineValue; +}; + +// Structure to describe request TLV 0x01 for VoiceAOCSetACMMaximum() +struct sVoiceAOCSetACMMaximumRequest_ACMMax +{ + UINT32 mACMMaximum; +}; + +// Structure to describe request TLV 0x01 for VoiceAOCGetCallMeterInfo() +struct sVoiceAOCGetCallMeterInfoRequest_Mask +{ + bool mACM:1; + bool mACMMaximum:1; + bool mCCM:1; + + // Padding out 13 bits + UINT8 mReserved1:5; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x10 for VoiceAOCGetCallMeterInfo() +struct sVoiceAOCGetCallMeterInfoResponse_ACM +{ + UINT32 mACM; +}; + +// Structure to describe response TLV 0x11 for VoiceAOCGetCallMeterInfo() +struct sVoiceAOCGetCallMeterInfoResponse_ACMMax +{ + UINT32 mACMMaximum; +}; + +// Structure to describe response TLV 0x12 for VoiceAOCGetCallMeterInfo() +struct sVoiceAOCGetCallMeterInfoResponse_CCM +{ + UINT32 mCCM; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_COLP +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_COLR +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_CNAP +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceManageIPCalls() +struct sVoiceManageIPCallsRequest_Info +{ + eQMIVoiceVoIPSUPSCallTypes mSupplementaryServiceType; +}; + +// Structure to describe response TLV 0x10 for VoiceManageIPCalls() +struct sVoiceManageIPCallsResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x10 for CAT2SetEventReport() +struct sCAT2SetEventReportRequest_ReportMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + bool mRefresh:1; + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + bool mSetupEventBrowserTermination:1; + bool mProvideLocalInformationTime:1; + + // Padding out 9 bits + UINT8 mReserved1:1; + UINT8 mReserved2; +}; + +// Structure to describe request TLV 0x11 for CAT2SetEventReport() +struct sCAT2SetEventReportRequest_DecodeReportMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mSCWSEvent:1; + + // Padding out 8 bits + UINT8 mReserved3; +}; + +// Structure to describe request TLV 0x12 for CAT2SetEventReport() +struct sCAT2SetEventReportRequest_Slot +{ + bool mSlot1:1; + bool mSlot2:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x10 for CAT2SetEventReport() +struct sCAT2SetEventReportResponse_RegStatusMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + bool mRefresh:1; + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + bool mSetupEventBrowserTermination:1; + bool mProvideLocalInformationTime:1; + + // Padding out 9 bits + UINT8 mReserved1:1; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x11 for CAT2SetEventReport() +struct sCAT2SetEventReportResponse_DecodedRegStatusMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mSCWSEvent:1; + + // Padding out 8 bits + UINT8 mReserved3; +}; + +// Structure to describe indication TLV 0x10 for CAT2 EventReport +struct sCAT2EventReportIndication_DisplayTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mDisplayTextCommand[1]; +}; + +// Structure to describe indication TLV 0x11 for CAT2 EventReport +struct sCAT2EventReportIndication_GetInkeyEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInkeyCommand[1]; +}; + +// Structure to describe indication TLV 0x12 for CAT2 EventReport +struct sCAT2EventReportIndication_GetInputEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInputCommand[1]; +}; + +// Structure to describe indication TLV 0x13 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupMenuEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupMenuCommand[1]; +}; + +// Structure to describe indication TLV 0x14 for CAT2 EventReport +struct sCAT2EventReportIndication_SelectItemEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSelectItemCommand[1]; +}; + +// Structure to describe indication TLV 0x15 for CAT2 EventReport +struct sCAT2EventReportIndication_AlphaIDAvailable +{ + eQMICATAlphaIDCommandType mAlphaIDCommandType; + UINT16 mAlphaIDLength; + + // This array must be the size specified by mAlphaIDLength + // UINT8 mAlphaID[1]; +}; + +// Structure to describe indication TLV 0x16 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupEventList +{ + bool mUserActivityNotify:1; + bool mIdleScreenAvailable:1; + bool mLanguageSelectionNotify:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x17 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupIdleModeTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupIdleModeTextCommand[1]; +}; + +// Structure to describe indication TLV 0x18 for CAT2 EventReport +struct sCAT2EventReportIndication_LanguageNotificationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLanguageNotificationCommand[1]; +}; + +// Structure to describe indication TLV 0x19 for CAT2 EventReport +struct sCAT2EventReportIndication_RefreshEvent +{ + UINT16 mRefreshMode; + eQMICATRefreshStage mRefreshStage; +}; + +// Structure to describe indication TLV 0x1A for CAT2 EventReport +struct sCAT2EventReportIndication_EndProactiveSession +{ + eQMICATProactiveSessionEndType mProactiveSessionEndType; +}; + +// Structure to describe indication TLV 0x1B for CAT2 EventReport +struct sCAT2EventReportIndication_DecodedHeaderID +{ + eQMICATCommandID mCommandID; + UINT32 mReferenceID; + UINT8 mCommandNumber; +}; + +// Structure to describe indication TLV 0x1C for CAT2 EventReport +struct sCAT2EventReportIndication_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x1D for CAT2 EventReport +struct sCAT2EventReportIndication_HighPriority +{ + eQMICATHighPriority mHighPriority; +}; + +// Structure to describe indication TLV 0x1E for CAT2 EventReport +struct sCAT2EventReportIndication_UserControl +{ + eQMICATUserControl mUserControl; +}; + +// Structure to describe indication TLV 0x1F for CAT2 EventReport +struct sCAT2EventReportIndication_Icon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x20 for CAT2 EventReport +struct sCAT2EventReportIndication_Duration +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe indication TLV 0x21 for CAT2 EventReport +struct sCAT2EventReportIndication_ResponseFormat +{ + eQMICATResponseFormat mResponseFormat; +}; + +// Structure to describe indication TLV 0x22 for CAT2 EventReport +struct sCAT2EventReportIndication_HelpAvailable +{ + eQMICATHelpAvailable mHelpAvailable; +}; + +// Structure to describe indication TLV 0x23 for CAT2 EventReport +struct sCAT2EventReportIndication_ResponsePackingFormat +{ + eQMICATResponsePackingFormat mResponsePackingFormat; +}; + +// Structure to describe indication TLV 0x24 for CAT2 EventReport +struct sCAT2EventReportIndication_ResponseLength +{ + UINT8 mMaximumUserInput; + UINT8 mMinimumUserInput; +}; + +// Structure to describe indication TLV 0x25 for CAT2 EventReport +struct sCAT2EventReportIndication_ShowUserInput +{ + eQMICATShowUserInput mShowUserInput; +}; + +// Structure to describe indication TLV 0x26 for CAT2 EventReport +struct sCAT2EventReportIndication_Tone +{ + eQMICATTone mTone; +}; + +// Structure to describe indication TLV 0x27 for CAT2 EventReport +struct sCAT2EventReportIndication_SoftkeySelection +{ + eQMICATSoftkeySelection mSoftkeySelection; +}; + +// Structure to describe indication TLV 0x28 for CAT2 EventReport +struct sCAT2EventReportIndication_Items +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe indication TLV 0x29 for CAT2 EventReport +struct sCAT2EventReportIndication_DefaultItem +{ + UINT8 mDefaultItem; +}; + +// Structure to describe indication TLV 0x2A for CAT2 EventReport +struct sCAT2EventReportIndication_NextActionIdentifier +{ + UINT8 mActionsLength; + + // This array must be the size specified by mActionsLength + // eQMICATNextAction mNextAction[1]; +}; + +// Structure to describe indication TLV 0x2B for CAT2 EventReport +struct sCAT2EventReportIndication_IconIDList +{ + eQMICATDisplayIconOnly mDisplayIconOnly; + UINT8 mItemsLength; + + struct sItem + { + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe indication TLV 0x2C for CAT2 EventReport +struct sCAT2EventReportIndication_Presentation +{ + eQMICATPresentation mPresentation; +}; + +// Structure to describe indication TLV 0x2D for CAT2 EventReport +struct sCAT2EventReportIndication_PackingRequired +{ + eQMICATPackingRequired mPackingRequired; +}; + +// Structure to describe indication TLV 0x2E for CAT2 EventReport +struct sCAT2EventReportIndication_SMSTPDU +{ + UINT8 mSMSTPDUDataLength; + + // This array must be the size specified by mSMSTPDUDataLength + // UINT8 mSMSTPDUData[1]; +}; + +// Structure to describe indication TLV 0x2F for CAT2 EventReport +struct sCAT2EventReportIndication_IsCDMASMS +{ + eQMICATIsCDMASMS mIsCDMASMS; +}; + +// Structure to describe indication TLV 0x30 for CAT2 EventReport +struct sCAT2EventReportIndication_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x31 for CAT2 EventReport +struct sCAT2EventReportIndication_CallSetupRequirement +{ + eQMICATCallSetupRequirement mCallSetupRequirement; +}; + +// Structure to describe indication TLV 0x32 for CAT2 EventReport +struct sCAT2EventReportIndication_Redial +{ + eQMICATRedialNecessary mRedialNecessary; + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe indication TLV 0x33 for CAT2 EventReport +struct sCAT2EventReportIndication_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe indication TLV 0x34 for CAT2 EventReport +struct sCAT2EventReportIndication_CapabilitiesConfiguration +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe indication TLV 0x35 for CAT2 EventReport +struct sCAT2EventReportIndication_DTMF +{ + UINT8 mDTMFDataLength; + + struct sDTMFData + { + UINT8 mDTMFData1:4; + UINT8 mDTMFData2:4; + }; + + // This array must be the size specified by mDTMFDataLength + // sDTMFData mDTMFDatas[1]; +}; + +// Structure to describe indication TLV 0x36 for CAT2 EventReport +struct sCAT2EventReportIndication_SpecificLanguageNotification +{ + eQMICATSpecificLanguageNotfication mSpecificLanguageNotification; +}; + +// Structure to describe indication TLV 0x37 for CAT2 EventReport +struct sCAT2EventReportIndication_Language +{ + char mLanguage[2]; +}; + +// Structure to describe indication TLV 0x38 for CAT2 EventReport +struct sCAT2EventReportIndication_LaunchMode +{ + eQMICATLaunchMode mLaunchMode; +}; + +// Structure to describe indication TLV 0x39 for CAT2 EventReport +struct sCAT2EventReportIndication_URL +{ + UINT8 mURLDataLength; + + // This array must be the size specified by mURLDataLength + // char mURLData[1]; +}; + +// Structure to describe indication TLV 0x3A for CAT2 EventReport +struct sCAT2EventReportIndication_BrowserID +{ + UINT8 mBrowserID; +}; + +// Structure to describe indication TLV 0x3B for CAT2 EventReport +struct sCAT2EventReportIndication_BearerList +{ + UINT8 mBearerListLength; + + // This array must be the size specified by mBearerListLength + // eQMICATBearer mBearerList[1]; +}; + +// Structure to describe indication TLV 0x3C for CAT2 EventReport +struct sCAT2EventReportIndication_ProvisioningFile +{ + UINT32 mNumberOfProvisioningFiles; + + struct sFile + { + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // char mPath[1]; + }; + + // This array must be the size specified by mNumberOfProvisioningFiles + // sFile mFiles[1]; +}; + +// Structure to describe indication TLV 0x3D for CAT2 EventReport +struct sCAT2EventReportIndication_USSDString +{ + eQMICATUSSDDataCodingScheme mOriginalDataCodingScheme; + eQMICATUSSDDataCodingScheme mDataCodingScheme; + UINT8 mUSSDTextLength; + + // This array must be the size specified by mUSSDTextLength + // UINT8 mUSSDText[1]; +}; + +// Structure to describe indication TLV 0x3E for CAT2 EventReport +struct sCAT2EventReportIndication_DefaultText +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x3F for CAT2 EventReport +struct sCAT2EventReportIndication_ImmediateResponseRequired +{ + eQMICATImmediateResponse mImmediateResponse; +}; + +// Structure to describe indication TLV 0x40 for CAT2 EventReport +struct sCAT2EventReportIndication_UserConfirmationAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x41 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupCallDisplayAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x42 for CAT2 EventReport +struct sCAT2EventReportIndication_UserConfirmationIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x43 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupCallDisplayIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x44 for CAT2 EventReport +struct sCAT2EventReportIndication_GatewayProxy +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x45 for CAT2 EventReport +struct sCAT2EventReportIndication_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x46 for CAT2 EventReport +struct sCAT2EventReportIndication_NotificationRequired +{ + eQMICATNotificationRequired mNotificationRequired; +}; + +// Structure to describe indication TLV 0x47 for CAT2 EventReport +struct sCAT2EventReportIndication_PlayToneEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mPlayToneCommand[1]; +}; + +// Structure to describe indication TLV 0x48 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupCallEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupCallCommand[1]; +}; + +// Structure to describe indication TLV 0x49 for CAT2 EventReport +struct sCAT2EventReportIndication_SendDTMFEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDTMFCommand[1]; +}; + +// Structure to describe indication TLV 0x4A for CAT2 EventReport +struct sCAT2EventReportIndication_LaunchBrowserEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLaunchBrowserCommand[1]; +}; + +// Structure to describe indication TLV 0x4B for CAT2 EventReport +struct sCAT2EventReportIndication_SendSMSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSMSCommand[1]; +}; + +// Structure to describe indication TLV 0x4C for CAT2 EventReport +struct sCAT2EventReportIndication_SendSSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSSCommand[1]; +}; + +// Structure to describe indication TLV 0x4D for CAT2 EventReport +struct sCAT2EventReportIndication_SendUSSDEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendUSSDCommand[1]; +}; + +// Structure to describe indication TLV 0x4E for CAT2 EventReport +struct sCAT2EventReportIndication_ProvideLocalInformationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mProvideLocalInformationCommand[1]; +}; + +// Structure to describe indication TLV 0x4F for CAT2 EventReport +struct sCAT2EventReportIndication_SetupRawEventList +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupEventListCommand[1]; +}; + +// Structure to describe indication TLV 0x50 for CAT2 EventReport +struct sCAT2EventReportIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x51 for CAT2 EventReport +struct sCAT2EventReportIndication_OpenChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mOpenChannelCommand[1]; +}; + +// Structure to describe indication TLV 0x52 for CAT2 EventReport +struct sCAT2EventReportIndication_CloseChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mCloseChannelCommand[1]; +}; + +// Structure to describe indication TLV 0x53 for CAT2 EventReport +struct sCAT2EventReportIndication_SendDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDataCommand[1]; +}; + +// Structure to describe indication TLV 0x54 for CAT2 EventReport +struct sCAT2EventReportIndication_ReceiveDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mReceiveDataCommand[1]; +}; + +// Structure to describe indication TLV 0x55 for CAT2 EventReport +struct sCAT2EventReportIndication_OnDemmandLinkEstablish +{ + eQMICATOnDemandLinkEstablish mOnDemandLinkEstablish; +}; + +// Structure to describe indication TLV 0x56 for CAT2 EventReport +struct sCAT2EventReportIndication_CSDBearerDescription +{ + UINT8 mSpeed; + eQMICATCSDBearerName mCSDBearerName; + eQMICATConnectionElement mConnectionElement; +}; + +// Structure to describe indication TLV 0x57 for CAT2 EventReport +struct sCAT2EventReportIndication_GPRSBearerDescription +{ + UINT8 mPrecedenceClass; + UINT8 mDelayClass; + UINT8 mReliabilityClass; + UINT8 mPeakThroughput; + UINT8 mMeanThroughput; + eQMICATPacketDataProtocol mPacketDataProtocol; +}; + +// Structure to describe indication TLV 0x58 for CAT2 EventReport +struct sCAT2EventReportIndication_EUTRANExternalParameterBearerDescription +{ + eQMICATTrafficClass mTrafficClass; + UINT16 mMaxUploadBitrate; + UINT16 mMaxDownloadBitrate; + UINT16 mGuaranteedUploadBitrate; + UINT16 mGuaranteedDownloadBitrate; + eQMICATDeliveryOrder mDeliveryOrder; + UINT8 mMaxSDUSize; + UINT8 mMaxSDUErrorRatio; + UINT8 mResidualBitErrorRatio; + eQMICATDeliverErrorSDU mDeliverErrorSDU; + UINT8 mTransferDelay; + UINT8 mTrafficHandlingPRI; + eQMICATPDPType mPDPType; +}; + +// Structure to describe indication TLV 0x59 for CAT2 EventReport +struct sCAT2EventReportIndication_EUTRANExternalMappedUTRANBearerDescription +{ + UINT8 mQCI; + UINT8 mMaxUploadBitrate; + UINT8 mMaxDownloadBitrate; + UINT8 mGuaranteedUploadBitrate; + UINT8 mGuaranteedDownloadBitrate; + UINT8 mMaximumUploadBitrateExt; + UINT8 mMaximumDownloadBitrateExt; + UINT8 mGuaranteedUploadBitrateExt; + UINT8 mGuaranteedDownloadBitrateExt; + eQMICATPDPType mPDPType; +}; + +// Structure to describe indication TLV 0x5A for CAT2 EventReport +struct sCAT2EventReportIndication_BufferSize +{ + UINT16 mBufferSize; +}; + +// Structure to describe indication TLV 0x5B for CAT2 EventReport +struct sCAT2EventReportIndication_NetworkAccessName +{ + UINT8 mNetworkAccessNameLength; + + // This array must be the size specified by mNetworkAccessNameLength + // UINT8 mNetworkAccessName[1]; +}; + +// Structure to describe indication TLV 0x5C for CAT2 EventReport +struct sCAT2EventReportIndication_OtherAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x5D for CAT2 EventReport +struct sCAT2EventReportIndication_UserLogin +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x5E for CAT2 EventReport +struct sCAT2EventReportIndication_UserPassword +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x5F for CAT2 EventReport +struct sCAT2EventReportIndication_TransportLevel +{ + eQMICATTransportProtocol mTransportProtocol; + UINT16 mPortNumber; +}; + +// Structure to describe indication TLV 0x60 for CAT2 EventReport +struct sCAT2EventReportIndication_DataDestinationAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x61 for CAT2 EventReport +struct sCAT2EventReportIndication_ChannelDataLength +{ + UINT8 mChannelDataLength; +}; + +// Structure to describe indication TLV 0x62 for CAT2 EventReport +struct sCAT2EventReportIndication_SendDataImmediately +{ + eQMICATSendDataImmediately mSendDataImmediately; +}; + +// Structure to describe indication TLV 0x63 for CAT2 EventReport +struct sCAT2EventReportIndication_ChannelData +{ + UINT16 mChannelDataLength; + + // This array must be the size specified by mChannelDataLength + // UINT8 mChannelData[1]; +}; + +// Structure to describe indication TLV 0x64 for CAT2 EventReport +struct sCAT2EventReportIndication_ChannelID +{ + UINT8 mChannelID; +}; + +// Structure to describe response TLV 0x01 for CAT2GetServiceState() +struct sCAT2GetServiceStateResponse_CATServiceState +{ + bool mCommonDisplayText:1; + bool mCommonGetInkey:1; + bool mCommonGetInput:1; + bool mCommonSetupMenu:1; + bool mCommonSelectItem:1; + bool mCommonSendSMSAlphaIdentifier:1; + bool mCommonSetupEventUserActivity:1; + bool mCommonSetupEventIdleScreenNotify:1; + bool mCommonSetupEventLanguageSelNotify:1; + bool mCommonSetupIdleModeText:1; + bool mCommonLanguageNotification:1; + bool mCommonRefresh:1; + bool mCommonEndProactiveSession:1; + bool mCommonPlayTone:1; + bool mCommonSetupCall:1; + bool mCommonSendDTMF:1; + bool mCommonLaunchBrowser:1; + bool mCommonSendSS:1; + bool mCommonSendUSSD:1; + bool mCommonProvideLocalInformationLanguage:1; + bool mCommonBearerIndependentProtocol:1; + bool mCommonSetupEventBrowserTermination:1; + bool mCommonProvideLocalInformationTime:1; + + // Padding out 9 bits + UINT8 mReserved1:1; + UINT8 mReserved2; + + bool mControlDisplayText:1; + bool mControlGetInkey:1; + bool mControlGetInput:1; + bool mControlSetupMenu:1; + bool mControlSelectItem:1; + bool mControlSendSMSAlphaIdentifier:1; + bool mControlSetupEventUserActivity:1; + bool mControlSetupEventIdleScreenNotify:1; + bool mControlSetupEventLanguageSelNotify:1; + bool mControlSetupIdleModeText:1; + bool mControlLanguageNotification:1; + bool mControlRefresh:1; + bool mControlEndProactiveSession:1; + bool mControlPlayTone:1; + bool mControlSetupCall:1; + bool mControlSendDTMF:1; + bool mControlLaunchBrowser:1; + bool mControlSendSS:1; + bool mControlSendUSSD:1; + bool mControlProvideLocalInformationLanguage:1; + bool mControlBearerIndependentProtocol:1; + bool mControlSetupEventBrowserTermination:1; + bool mControlProvideLocalInformationTime:1; + + // Padding out 9 bits + UINT8 mReserved3:1; + UINT8 mReserved4; +}; + +// Structure to describe response TLV 0x10 for CAT2GetServiceState() +struct sCAT2GetServiceStateResponse_DecodedCATServiceState +{ + bool mCommonDisplayText:1; + bool mCommonGetInkey:1; + bool mCommonGetInput:1; + bool mCommonSetupMenu:1; + bool mCommonSelectItem:1; + bool mCommonSendSMSAlphaIdentifier:1; + bool mCommonSetupEventUserActivity:1; + bool mCommonSetupEventIdleScreenNotify:1; + bool mCommonSetupEventLanguageSelNotify:1; + bool mCommonSetupIdleModeText:1; + bool mCommonLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mCommonEndProactiveSession:1; + bool mCommonPlayTone:1; + bool mCommonSetupCall:1; + bool mCommonSendDTMF:1; + bool mCommonLaunchBrowser:1; + bool mCommonSendSS:1; + bool mCommonSendUSSD:1; + bool mCommonProvideLocalInformationLanguage:1; + bool mCommonBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mCommonSCWSEvent:1; + + // Padding out 8 bits + UINT8 mReserved3; + + bool mControlDisplayText:1; + bool mControlGetInkey:1; + bool mControlGetInput:1; + bool mControlSetupMenu:1; + bool mControlSelectItem:1; + bool mControlSendSMSAlphaIdentifier:1; + bool mControlSetupEventUserActivity:1; + bool mControlSetupEventIdleScreenNotify:1; + bool mControlSetupEventLanguageSelNotify:1; + bool mControlSetupIdleModeText:1; + bool mControlLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved4:1; + + bool mControlEndProactiveSession:1; + bool mControlPlayTone:1; + bool mControlSetupCall:1; + bool mControlSendDTMF:1; + bool mControlLaunchBrowser:1; + bool mControlSendSS:1; + bool mControlSendUSSD:1; + bool mControlProvideLocalInformationLanguage:1; + bool mControlBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved5:2; + + bool mControlSCWSEvent:1; + + // Padding out 8 bits + UINT8 mReserved6; +}; + +// Structure to describe request TLV 0x01 for CAT2SendTerminalResponse() +struct sCAT2SendTerminalResponseRequest_TerminalResponseType +{ + UINT32 mReferenceID; + UINT16 mTerminalResponseLength; + + // This array must be the size specified by mTerminalResponseLength + // UINT8 mTerminalResponse[1]; +}; + +// Structure to describe request TLV 0x10 for CAT2SendTerminalResponse() +struct sCAT2SendTerminalResponseRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2EnvelopeCommand() +struct sCAT2EnvelopeCommandRequest_EnvelopeCommand +{ + eQMICATEnvelopeCommandType mEnvelopeCommandType; + UINT16 mEnvelopeLength; + + // This array must be the size specified by mEnvelopeLength + // UINT8 mEnvelopeData[1]; +}; + +// Structure to describe request TLV 0x10 for CAT2EnvelopeCommand() +struct sCAT2EnvelopeCommandRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2GetEventReport() +struct sCAT2GetEventReportRequest_CommandInput +{ + UINT32 mCommandID; + eQMICATCommandFormat mCommandFormat; +}; + +// Structure to describe response TLV 0x10 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DisplayTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mDisplayTextCommand[1]; +}; + +// Structure to describe response TLV 0x11 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_GetInkeyEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInkeyCommand[1]; +}; + +// Structure to describe response TLV 0x12 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_GetInputEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInputCommand[1]; +}; + +// Structure to describe response TLV 0x13 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupMenuEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupMenuCommand[1]; +}; + +// Structure to describe response TLV 0x14 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SelectItemEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSelectItemCommand[1]; +}; + +// Structure to describe response TLV 0x15 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_AlphaIDAvailable +{ + eQMICATAlphaIDCommandType mAlphaIDCommandType; + UINT16 mAlphaIDLength; + + // This array must be the size specified by mAlphaIDLength + // UINT8 mAlphaID[1]; +}; + +// Structure to describe response TLV 0x16 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupEventList +{ + bool mUserActivityNotify:1; + bool mIdleScreenAvailable:1; + bool mLanguageSelectionNotify:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x17 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupIdleModeTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupIdleModeTextCommand[1]; +}; + +// Structure to describe response TLV 0x18 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_LanguageNotificationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLanguageNotificationCommand[1]; +}; + +// Structure to describe response TLV 0x19 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_RefreshEvent +{ + UINT16 mRefreshMode; + eQMICATRefreshStage mRefreshStage; +}; + +// Structure to describe response TLV 0x1A for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_EndProactiveSession +{ + eQMICATProactiveSessionEndType mProactiveSessionEndType; +}; + +// Structure to describe response TLV 0x1B for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DecodedHeaderID +{ + eQMICATCommandID mCommandID; + UINT32 mReferenceID; + UINT8 mCommandNumber; +}; + +// Structure to describe response TLV 0x1C for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x1D for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_HighPriority +{ + eQMICATHighPriority mHighPriority; +}; + +// Structure to describe response TLV 0x1E for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_UserControl +{ + eQMICATUserControl mUserControl; +}; + +// Structure to describe response TLV 0x1F for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Icon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x20 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Duration +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe response TLV 0x21 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ResponseFormat +{ + eQMICATResponseFormat mResponseFormat; +}; + +// Structure to describe response TLV 0x22 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_HelpAvailable +{ + eQMICATHelpAvailable mHelpAvailable; +}; + +// Structure to describe response TLV 0x23 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ResponsePackingFormat +{ + eQMICATResponsePackingFormat mResponsePackingFormat; +}; + +// Structure to describe response TLV 0x24 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ResponseLength +{ + UINT8 mMaximumUserInput; + UINT8 mMinimumUserInput; +}; + +// Structure to describe response TLV 0x25 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ShowUserInput +{ + eQMICATShowUserInput mShowUserInput; +}; + +// Structure to describe response TLV 0x26 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Tone +{ + eQMICATTone mTone; +}; + +// Structure to describe response TLV 0x27 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SoftkeySelection +{ + eQMICATSoftkeySelection mSoftkeySelection; +}; + +// Structure to describe response TLV 0x28 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Items +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe response TLV 0x29 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DefaultItems +{ + UINT8 mDefaultItem; +}; + +// Structure to describe response TLV 0x2A for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_NextActionIdentifier +{ + UINT8 mActionsLength; + + // This array must be the size specified by mActionsLength + // eQMICATNextAction mNextAction[1]; +}; + +// Structure to describe response TLV 0x2B for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_IconIDList +{ + eQMICATDisplayIconOnly mDisplayIconOnly; + UINT8 mItemsLength; + + struct sItem + { + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe response TLV 0x2C for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Presentation +{ + eQMICATPresentation mPresentation; +}; + +// Structure to describe response TLV 0x2D for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_PackingRequired +{ + eQMICATPackingRequired mPackingRequired; +}; + +// Structure to describe response TLV 0x2E for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SMSTPDU +{ + UINT8 mSMSTPDUDataLength; + + // This array must be the size specified by mSMSTPDUDataLength + // UINT8 mSMSTPDUData[1]; +}; + +// Structure to describe response TLV 0x2F for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_IsCDMASMS +{ + eQMICATIsCDMASMS mIsCDMASMS; +}; + +// Structure to describe response TLV 0x30 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x31 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_CallSetupRequirement +{ + eQMICATCallSetupRequirement mCallSetupRequirement; +}; + +// Structure to describe response TLV 0x32 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Redial +{ + eQMICATRedialNecessary mRedialNecessary; + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe response TLV 0x33 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe response TLV 0x34 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_CapabilityConfiguration +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x35 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DTMF +{ + UINT8 mDTMFDataLength; + + struct sDTMFData + { + UINT8 mDTMFData1:4; + UINT8 mDTMFData2:4; + }; + + // This array must be the size specified by mDTMFDataLength + // sDTMFData mDTMFDatas[1]; +}; + +// Structure to describe response TLV 0x36 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SpecificLanguageNotification +{ + eQMICATSpecificLanguageNotfication mSpecificLanguageNotification; +}; + +// Structure to describe response TLV 0x37 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Language +{ + char mLanguage[2]; +}; + +// Structure to describe response TLV 0x38 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_LaunchMode +{ + eQMICATLaunchMode mLaunchMode; +}; + +// Structure to describe response TLV 0x39 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_URL +{ + UINT8 mURLDataLength; + + // This array must be the size specified by mURLDataLength + // char mURLData[1]; +}; + +// Structure to describe response TLV 0x3A for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_BrowserID +{ + UINT8 mBrowserID; +}; + +// Structure to describe response TLV 0x3B for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_BearerList +{ + UINT8 mBearerListLength; + + // This array must be the size specified by mBearerListLength + // eQMICATBearer mBearerList[1]; +}; + +// Structure to describe response TLV 0x3C for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ProvisioningFiles +{ + UINT32 mNumberOfProvisioningFiles; + + struct sFile + { + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // char mPath[1]; + }; + + // This array must be the size specified by mNumberOfProvisioningFiles + // sFile mFiles[1]; +}; + +// Structure to describe response TLV 0x3D for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_USSDString +{ + eQMICATUSSDDataCodingScheme mOriginalDataCodingScheme; + eQMICATUSSDDataCodingScheme mDataCodingScheme; + UINT8 mUSSDTextLength; + + // This array must be the size specified by mUSSDTextLength + // UINT8 mUSSDText[1]; +}; + +// Structure to describe response TLV 0x3E for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DefaultText +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x3F for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ImmediateResponseRequest +{ + eQMICATImmediateResponse mImmediateResponse; +}; + +// Structure to describe response TLV 0x40 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_UserConfirmationAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x41 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupCallDisplayAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x42 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_UserConfirmationIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x43 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupCallDisplayIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x44 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_GatewayProxy +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x45 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x46 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_NotificationRequired +{ + eQMICATNotificationRequired mNotificationRequired; +}; + +// Structure to describe response TLV 0x47 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_PlayToneEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mPlayToneCommand[1]; +}; + +// Structure to describe response TLV 0x48 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupCallEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupCallCommand[1]; +}; + +// Structure to describe response TLV 0x49 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendDTMFEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDTMFCommand[1]; +}; + +// Structure to describe response TLV 0x4A for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_LaunchBrowserEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLaunchBrowserCommand[1]; +}; + +// Structure to describe response TLV 0x4B for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendSMSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSMSCommand[1]; +}; + +// Structure to describe response TLV 0x4C for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendSSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSSCommand[1]; +}; + +// Structure to describe response TLV 0x4D for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendUSSDEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendUSSDCommand[1]; +}; + +// Structure to describe response TLV 0x4E for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ProvideLocalInformationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mProvideLocalInformationCommand[1]; +}; + +// Structure to describe response TLV 0x4F for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupEventListRawEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupEventListCommand[1]; +}; + +// Structure to describe response TLV 0x50 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe response TLV 0x51 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_OpenChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mOpenChannelCommand[1]; +}; + +// Structure to describe response TLV 0x52 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_CloseChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mCloseChannelCommand[1]; +}; + +// Structure to describe response TLV 0x53 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDataCommand[1]; +}; + +// Structure to describe response TLV 0x54 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ReceiveDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mReceiveDataCommand[1]; +}; + +// Structure to describe response TLV 0x55 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_OnDemandLinkEstablish +{ + eQMICATOnDemandLinkEstablish mOnDemandLinkEstablish; +}; + +// Structure to describe response TLV 0x56 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_CSDBearerDescription +{ + UINT8 mSpeed; + eQMICATCSDBearerName mCSDBearerName; + eQMICATConnectionElement mConnectionElement; +}; + +// Structure to describe response TLV 0x57 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_GPRSBearerDescription +{ + UINT8 mPrecedenceClass; + UINT8 mDelayClass; + UINT8 mReliabilityClass; + UINT8 mPeakThroughput; + UINT8 mMeanThroughput; + eQMICATPacketDataProtocol mPacketDataProtocol; +}; + +// Structure to describe response TLV 0x58 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_EUTRANExternalParameterBearerDescription +{ + eQMICATTrafficClass mTrafficClass; + UINT16 mMaxUploadBitrate; + UINT16 mMaxDownloadBitrate; + UINT16 mGuaranteedUploadBitrate; + UINT16 mGuaranteedDownloadBitrate; + eQMICATDeliveryOrder mDeliveryOrder; + UINT8 mMaxSDUSize; + UINT8 mMaxSDUErrorRatio; + UINT8 mResidualBitErrorRatio; + eQMICATDeliverErrorSDU mDeliverErrorSDU; + UINT8 mTransferDelay; + UINT8 mTrafficHandlingPRI; + eQMICATPDPType mPDPType; +}; + +// Structure to describe response TLV 0x59 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_EUTRANExternalMappedUTRANBearerDescription +{ + UINT8 mQCI; + UINT8 mMaxUploadBitrate; + UINT8 mMaxDownloadBitrate; + UINT8 mGuaranteedUploadBitrate; + UINT8 mGuaranteedDownloadBitrate; + UINT8 mMaximumUploadBitrateExt; + UINT8 mMaximumDownloadBitrateExt; + UINT8 mGuaranteedUploadBitrateExt; + UINT8 mGuaranteedDownloadBitrateExt; + eQMICATPDPType mPDPType; +}; + +// Structure to describe response TLV 0x5A for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_BufferSize +{ + UINT16 mBufferSize; +}; + +// Structure to describe response TLV 0x5B for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_NetworkAccessName +{ + UINT8 mNetworkAccessNameLength; + + // This array must be the size specified by mNetworkAccessNameLength + // UINT8 mNetworkAccessName[1]; +}; + +// Structure to describe response TLV 0x5C for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_OtherAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x5D for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_UserLogin +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x5E for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_UserPassword +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x5F for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_TransportLevel +{ + eQMICATTransportProtocol mTransportProtocol; + UINT16 mPortNumber; +}; + +// Structure to describe response TLV 0x60 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DataDestinationAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x61 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ChannelDataLength +{ + UINT8 mChannelDataLength; +}; + +// Structure to describe response TLV 0x62 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendDataImmediately +{ + eQMICATSendDataImmediately mSendDataImmediately; +}; + +// Structure to describe response TLV 0x63 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ChannelData +{ + UINT16 mChannelDataLength; + + // This array must be the size specified by mChannelDataLength + // UINT8 mChannelData[1]; +}; + +// Structure to describe response TLV 0x64 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ChannelID +{ + UINT8 mChannelID; +}; + +// Structure to describe request TLV 0x01 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_TerminalResponse +{ + UINT32 mReferenceID; + UINT8 mCommandNumber; + eQMICATResponseCommand mResponseCommand; + UINT8 mGeneralResult; + UINT8 mAdditionalInformationLength; + + // This array must be the size specified by mAdditionalInformationLength + // UINT8 mTerminalResponseAdditionalInformation[1]; +}; + +// Structure to describe request TLV 0x10 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x11 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_ItemIdentifier +{ + UINT8 mItemIdentifier; +}; + +// Structure to describe request TLV 0x12 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_GetInkeyExtraInfo +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x13 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_LanguageInfo +{ + char mLanguage[2]; +}; + +// Structure to describe request TLV 0x14 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_EnvelopeCommand +{ + eQMICATDecodedEnvelopeCommand mEnvelopeCommand; +}; + +// Structure to describe request TLV 0x10 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_ItemIdentifier +{ + UINT8 mItemIdentifier; +}; + +// Structure to describe request TLV 0x11 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_HelpRequest +{ + eQMICATHelpRequest mHelpRequest; +}; + +// Structure to describe request TLV 0x12 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_Language +{ + char mLanguage[2]; +}; + +// Structure to describe request TLV 0x13 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x14 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe request TLV 0x15 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe request TLV 0x16 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_CapabilityConfigParam1 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe request TLV 0x17 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_CapabilityConfigParam2 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe request TLV 0x18 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_USSDString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x19 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_PDPContextActivation +{ + UINT8 mPDPContextActivationDataLength; + + // This array must be the size specified by mPDPContextActivationDataLength + // UINT8 mPDPContextActivationData[1]; +}; + +// Structure to describe request TLV 0x1A for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_EPSPDNConnectActivation +{ + UINT8 mEPSPDNConnectActivationDataLength; + + // This array must be the size specified by mEPSPDNConnectActivationDataLength + // UINT8 mEPSPDNConnectActivationData[1]; +}; + +// Structure to describe response TLV 0x10 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_CallControlResult +{ + eQMICATCallControlResult mCallControlResult; +}; + +// Structure to describe response TLV 0x11 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x12 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe response TLV 0x13 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_CapabilityConfigParam1 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x14 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_CapabilityConfigParam2 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x15 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_USSDString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x16 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_PDPContextActivation +{ + UINT8 mPDPContextActivationDataLength; + + // This array must be the size specified by mPDPContextActivationDataLength + // UINT8 mPDPContextActivationData[1]; +}; + +// Structure to describe response TLV 0x17 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_EPSPDNConnectActivation +{ + UINT8 mEPSPDNConnectActivationDataLength; + + // This array must be the size specified by mEPSPDNConnectActivationDataLength + // UINT8 mEPSPDNConnectActivationData[1]; +}; + +// Structure to describe response TLV 0x18 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x19 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_BCRepeatIndicator +{ + eQMICATBearerCapabilityRepeatIndicator mBearerCapabilityRepeatIndicator; +}; + +// Structure to describe request TLV 0x10 for CAT2EventConfirmation() +struct sCAT2EventConfirmationRequest_UserConfirmed +{ + eQMICATUserConfirmed mUserConfirmed; +}; + +// Structure to describe request TLV 0x11 for CAT2EventConfirmation() +struct sCAT2EventConfirmationRequest_IconIsDisplayed +{ + eQMICATIconIsDisplayed mIconIsDisplayed; +}; + +// Structure to describe request TLV 0x12 for CAT2EventConfirmation() +struct sCAT2EventConfirmationRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2SCWSOpenChannel() +struct sCAT2SCWSOpenChannelRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CAT2SCWSOpenChannel() +struct sCAT2SCWSOpenChannelRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT2 SCWSOpenChannelIndication +struct sCAT2SCWSOpenChannelIndication_OpenChannelInformation +{ + UINT32 mChannelID; + UINT16 mPortNumber; + UINT16 mBufferSize; +}; + +// Structure to describe indication TLV 0x11 for CAT2 SCWSOpenChannelIndication +struct sCAT2SCWSOpenChannelIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2SCWSCloseChannel() +struct sCAT2SCWSCloseChannelRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CAT2SCWSCloseChannel() +struct sCAT2SCWSCloseChannelRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT2 SCWSCloseChannelIndication +struct sCAT2SCWSCloseChannelIndication_CloseChannelInfo +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe response TLV 0x11 for CAT2SCWSCloseChannel() +struct sCAT2SCWSCloseChannelResponse_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2SCWSSendData() +struct sCAT2SCWSSendDataRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATSendDataResult mDataSendResult; +}; + +// Structure to describe request TLV 0x10 for CAT2SCWSSendData() +struct sCAT2SCWSSendDataRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT2 SCWSSendDataIndication +struct sCAT2SCWSSendDataIndication_SendDataInfo +{ + UINT32 mChannelID; + UINT8 mTotalPackets; + UINT8 mCurrentPacket; + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe indication TLV 0x11 for CAT2 SCWSSendDataIndication +struct sCAT2SCWSSendDataIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2SCWSDataAvailable() +struct sCAT2SCWSDataAvailableRequest_RemainingData +{ + UINT32 mChannelID; + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x10 for CAT2SCWSDataAvailable() +struct sCAT2SCWSDataAvailableRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2SCWSChannelStatus() +struct sCAT2SCWSChannelStatusRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CAT2SCWSChannelStatus() +struct sCAT2SCWSChannelStatusRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for UIMReadTransparent() +struct sUIMReadTransparentRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x03 for UIMReadTransparent() +struct sUIMReadTransparentRequest_Buffer +{ + UINT16 mOffset; + UINT16 mLength; +}; + +// Structure to describe request TLV 0x10 for UIMReadTransparent() +struct sUIMReadTransparentRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMReadTransparent() +struct sUIMReadTransparentResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMReadTransparent() +struct sUIMReadTransparentResponse_ReadResult +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe response TLV 0x12 for UIMReadTransparent() +struct sUIMReadTransparentResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM ReadTransparentIndication +struct sUIMReadTransparentIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM ReadTransparentIndication +struct sUIMReadTransparentIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe indication TLV 0x11 for UIM ReadTransparentIndication +struct sUIMReadTransparentIndication_ReadResult +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe request TLV 0x01 for UIMReadRecord() +struct sUIMReadRecordRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x03 for UIMReadRecord() +struct sUIMReadRecordRequest_Record +{ + UINT16 mRecordNumber; + UINT16 mContentLength; +}; + +// Structure to describe request TLV 0x10 for UIMReadRecord() +struct sUIMReadRecordRequest_LastRecord +{ + UINT16 mRecordNumber; +}; + +// Structure to describe request TLV 0x11 for UIMReadRecord() +struct sUIMReadRecordRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMReadRecord() +struct sUIMReadRecordResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMReadRecord() +struct sUIMReadRecordResponse_ReadResult +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe response TLV 0x12 for UIMReadRecord() +struct sUIMReadRecordResponse_AdditionalReadResult +{ + UINT16 mContentLength; + + struct sRecord + { + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; + }; + + // This array is variable length based on the size of the container + // sRecord mRecords[1]; +}; + +// Structure to describe response TLV 0x13 for UIMReadRecord() +struct sUIMReadRecordResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM ReadRecordIndication +struct sUIMReadRecordIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM ReadRecordIndication +struct sUIMReadRecordIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe indication TLV 0x11 for UIM ReadRecordIndication +struct sUIMReadRecordIndication_ReadResult +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe indication TLV 0x12 for UIM ReadRecordIndication +struct sUIMReadRecordIndication_AdditionalReadResult +{ + UINT16 mContentLength; + + struct sRecord + { + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; + }; + + // This array is variable length based on the size of the container + // sRecord mRecords[1]; +}; + +// Structure to describe request TLV 0x01 for UIMWriteTransparent() +struct sUIMWriteTransparentRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x03 for UIMWriteTransparent() +struct sUIMWriteTransparentRequest_Buffer +{ + UINT16 mOffset; + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe request TLV 0x10 for UIMWriteTransparent() +struct sUIMWriteTransparentRequest_ResponseInIndicaiton +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMWriteTransparent() +struct sUIMWriteTransparentResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMWriteTransparent() +struct sUIMWriteTransparentResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM WriteTransparentIndication +struct sUIMWriteTransparentIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM WriteTransparentIndication +struct sUIMWriteTransparentIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe request TLV 0x01 for UIMWriteRecord() +struct sUIMWriteRecordRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x03 for UIMWriteRecord() +struct sUIMWriteRecordRequest_Record +{ + UINT16 mRecordNumber; + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe request TLV 0x10 for UIMWriteRecord() +struct sUIMWriteRecordRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMWriteRecord() +struct sUIMWriteRecordResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMWriteRecord() +struct sUIMWriteRecordResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM WriteRecordIndication +struct sUIMWriteRecordIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM WriteRecordIndication +struct sUIMWriteRecordIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe request TLV 0x01 for UIMGetFileAttributes() +struct sUIMGetFileAttributesRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMGetFileAttributes() +struct sUIMGetFileAttributesRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMGetFileAttributes() +struct sUIMGetFileAttributesResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMGetFileAttributes() +struct sUIMGetFileAttributesResponse_Attributes +{ + UINT16 mFileSize; + UINT16 mFileID; + eQMIUIMFileTypes mFileType; + UINT16 mRecordSize; + UINT16 mRecordCount; + eQMIUIMSecurityAttributes mReadSecurityAttributes; + bool mReadPIN1:1; + bool mReadPIN2:1; + bool mReadUPIN:1; + bool mReadADM:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + + eQMIUIMSecurityAttributes mWriteSecurityAttributes; + bool mWritePIN1:1; + bool mWritePIN2:1; + bool mWriteUPIN:1; + bool mWriteADM:1; + + // Padding out 4 bits + UINT8 mReserved2:4; + + eQMIUIMSecurityAttributes mIncreaseSecurityAttributes; + bool mIncreasePIN1:1; + bool mIncreasePIN2:1; + bool mIncreaseUPIN:1; + bool mIncreaseADM:1; + + // Padding out 4 bits + UINT8 mReserved3:4; + + eQMIUIMSecurityAttributes mDeactivateSecurityAttributes; + bool mDeactivatePIN1:1; + bool mDeactivatePIN2:1; + bool mDeactivateUPIN:1; + bool mDeactivateADM:1; + + // Padding out 4 bits + UINT8 mReserved4:4; + + eQMIUIMSecurityAttributes mActivateSecurityAttributes; + bool mActivatePIN1:1; + bool mActivatePIN2:1; + bool mActivateUPIN:1; + bool mActivateADM:1; + + // Padding out 4 bits + UINT8 mReserved5:4; + + UINT16 mValueLength; + + // This array must be the size specified by mValueLength + // UINT8 mValue[1]; +}; + +// Structure to describe response TLV 0x12 for UIMGetFileAttributes() +struct sUIMGetFileAttributesResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM GetFileAttributesIndication +struct sUIMGetFileAttributesIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM GetFileAttributesIndication +struct sUIMGetFileAttributesIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe indication TLV 0x11 for UIM GetFileAttributesIndication +struct sUIMGetFileAttributesIndication_FileAttributes +{ + UINT16 mFileSize; + UINT16 mFileID; + eQMIUIMFileTypes mFileType; + UINT16 mRecordSize; + UINT16 mRecordCount; + eQMIUIMSecurityAttributes mReadSecurityAttributes; + bool mReadPIN1:1; + bool mReadPIN2:1; + bool mReadUPIN:1; + bool mReadADM:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + + eQMIUIMSecurityAttributes mWriteSecurityAttributes; + bool mWritePIN1:1; + bool mWritePIN2:1; + bool mWriteUPIN:1; + bool mWriteADM:1; + + // Padding out 4 bits + UINT8 mReserved2:4; + + eQMIUIMSecurityAttributes mIncreaseSecurityAttributes; + bool mIncreasePIN1:1; + bool mIncreasePIN2:1; + bool mIncreaseUPIN:1; + bool mIncreaseADM:1; + + // Padding out 4 bits + UINT8 mReserved3:4; + + eQMIUIMSecurityAttributes mDeactivateSecurityAttributes; + bool mDeactivatePIN1:1; + bool mDeactivatePIN2:1; + bool mDeactivateUPIN:1; + bool mDeactivateADM:1; + + // Padding out 4 bits + UINT8 mReserved4:4; + + eQMIUIMSecurityAttributes mActivateSecurityAttributes; + bool mActivatePIN1:1; + bool mActivatePIN2:1; + bool mActivateUPIN:1; + bool mActivateADM:1; + + // Padding out 4 bits + UINT8 mReserved5:4; + + UINT16 mValueLength; + + // This array must be the size specified by mValueLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x01 for UIMSetPINProtection() +struct sUIMSetPINProtectionRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMSetPINProtection() +struct sUIMSetPINProtectionRequest_KeyReferenceID +{ + eQMIUIMKeyReferenceID mKeyReferenceID; +}; + +// Structure to describe request TLV 0x11 for UIMSetPINProtection() +struct sUIMSetPINProtectionRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMSetPINProtection() +struct sUIMSetPINProtectionResponse_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x11 for UIMSetPINProtection() +struct sUIMSetPINProtectionResponse_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe response TLV 0x12 for UIMSetPINProtection() +struct sUIMSetPINProtectionResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM SetPINProtectionIndication +struct sUIMSetPINProtectionIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM SetPINProtectionIndication +struct sUIMSetPINProtectionIndication_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x11 for UIM SetPINProtectionIndication +struct sUIMSetPINProtectionIndication_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x01 for UIMVerifyPIN() +struct sUIMVerifyPINRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMVerifyPIN() +struct sUIMVerifyPINRequest_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x11 for UIMVerifyPIN() +struct sUIMVerifyPINRequest_KeyReferenceID +{ + eQMIUIMKeyReferenceID mKeyReferenceID; +}; + +// Structure to describe request TLV 0x12 for UIMVerifyPIN() +struct sUIMVerifyPINRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMVerifyPIN() +struct sUIMVerifyPINResponse_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x11 for UIMVerifyPIN() +struct sUIMVerifyPINResponse_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe response TLV 0x12 for UIMVerifyPIN() +struct sUIMVerifyPINResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM VerifyPINIndication +struct sUIMVerifyPINIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM VerifyPINIndication +struct sUIMVerifyPINIndication_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x11 for UIM VerifyPINIndication +struct sUIMVerifyPINIndication_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x01 for UIMUnblockPIN() +struct sUIMUnblockPINRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMUnblockPIN() +struct sUIMUnblockPINRequest_KeyReferenceID +{ + eQMIUIMKeyReferenceID mKeyReferenceID; +}; + +// Structure to describe request TLV 0x11 for UIMUnblockPIN() +struct sUIMUnblockPINRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMUnblockPIN() +struct sUIMUnblockPINResponse_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x11 for UIMUnblockPIN() +struct sUIMUnblockPINResponse_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe response TLV 0x12 for UIMUnblockPIN() +struct sUIMUnblockPINResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM UnblockPINIndication +struct sUIMUnblockPINIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM UnblockPINIndication +struct sUIMUnblockPINIndication_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x11 for UIM UnblockPINIndication +struct sUIMUnblockPINIndication_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x01 for UIMChangePIN() +struct sUIMChangePINRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMChangePIN() +struct sUIMChangePINRequest_KeyReferenceID +{ + eQMIUIMKeyReferenceID mKeyReferenceID; +}; + +// Structure to describe request TLV 0x11 for UIMChangePIN() +struct sUIMChangePINRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMChangePIN() +struct sUIMChangePINResponse_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x11 for UIMChangePIN() +struct sUIMChangePINResponse_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe response TLV 0x12 for UIMChangePIN() +struct sUIMChangePINResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM ChangePINIndication +struct sUIMChangePINIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM ChangePINIndication +struct sUIMChangePINIndication_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x11 for UIM ChangePINIndication +struct sUIMChangePINIndication_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x01 for UIMDepersonalization() +struct sUIMDepersonalizationRequest_Info +{ + eQMIUIMPersonalizationFeatures mFeature; + eQMIUIMCKSessionOperations mOperation; + UINT8 mCKLength; + + // This array must be the size specified by mCKLength + // char mCKValue[1]; +}; + +// Structure to describe response TLV 0x10 for UIMDepersonalization() +struct sUIMDepersonalizationResponse_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe request TLV 0x01 for UIMRefreshRegister() +struct sUIMRefreshRegisterRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x01 for UIMRefreshOK() +struct sUIMRefreshOKRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x01 for UIMRefreshComplete() +struct sUIMRefreshCompleteRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x01 for UIMGetLastRefreshEvent() +struct sUIMGetLastRefreshEventRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe response TLV 0x10 for UIMGetLastRefreshEvent() +struct sUIMGetLastRefreshEventResponse_RefreshEvent1 +{ + eQMIUIMRefreshStages mStage; + eQMIUIMRefreshModes mMode; + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +struct sUIMGetLastRefreshEventResponse_RefreshEvent2 +{ + UINT16 mFileCount; + + struct sFile + { + UINT16 mFileID; + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // UINT16 mPath[1]; + }; + + // This array must be the size specified by mFileCount + // sFile mFiles[1]; +}; + +struct sUIMGetLastRefreshEventResponse_RefreshEvent +{ + sUIMGetLastRefreshEventResponse_RefreshEvent1 mUIMGetLastRefreshEventResponse_RefreshEvent1; + sUIMGetLastRefreshEventResponse_RefreshEvent2 mUIMGetLastRefreshEventResponse_RefreshEvent2; +}; + +// Structure to describe request TLV 0x01 for UIMEventRegistration() +struct sUIMEventRegistrationRequest_Mask +{ + bool mCardStatus:1; + bool mSAPConnection:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x10 for UIMEventRegistration() +struct sUIMEventRegistrationResponse_Mask +{ + bool mCardStatus:1; + bool mSAPConnection:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x10 for UIMGetCardStatus() +struct sUIMGetCardStatusResponse_Status1 +{ + UINT8 mPrimaryGWSlot; + UINT8 mPrimaryGWApplication; + UINT8 mPrimary1XSlot; + UINT8 mPrimary1XApplication; + UINT8 mSecondaryGWSlot; + UINT8 mSecondaryGWApplication; + UINT8 mSecondary1XSlot; + UINT8 mSecondary1XApplication; + UINT8 mSlotsAvailable; + eQMIUIMCardStates mCardState; + eQMIUIMPINStates mUPINState; + UINT8 mRemainingUPINVerifyRetries; + UINT8 mRemainingUPINUnblockRetries; + eQMIUIMCardErrorCodes mCardErrorCode; + UINT8 mApplicationsAvailable; + eQMIUIMApplicationTypes mApplicationType; + eQMIUIMApplicationStates mApplicationState; + eQMIUIMPersonalizationStates mPersonalizationState; + eQMIUIMPersonalizationFeatures mPersonalizationFeature; + UINT8 mRemainingPersonalizationVerifyRetries; + UINT8 mRemainingPersonalizationUnblockRetries; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +struct sUIMGetCardStatusResponse_Status2 +{ + INT8 mUPINReplacesPIN1; + eQMIUIMPINStates mPIN1State; + UINT8 mRemainingPIN1VerifyRetries; + UINT8 mRemainingPIN1UnblockRetries; + eQMIUIMPINStates mPIN2State; + UINT8 mRemainingPIN2VerifyRetries; + UINT8 mRemainingPIN2UnblockRetries; +}; + +struct sUIMGetCardStatusResponse_Status +{ + sUIMGetCardStatusResponse_Status1 mUIMGetCardStatusResponse_Status1; + sUIMGetCardStatusResponse_Status2 mUIMGetCardStatusResponse_Status2; +}; + +// Structure to describe response TLV 0x11 for UIMGetCardStatus() +struct sUIMGetCardStatusResponse_HotSwapStatus +{ + UINT8 mHotSwapLength; + + // This array must be the size specified by mHotSwapLength + // eQMIUIMHotSwap mHotSwap[1]; +}; + +// Structure to describe request TLV 0x01 for UIMPowerDown() +struct sUIMPowerDownRequest_Slot +{ + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x01 for UIMPowerUp() +struct sUIMPowerUpRequest_Slot +{ + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x10 for UIMPowerUp() +struct sUIMPowerUpRequest_IgnoreHotSwapSwitch +{ + INT8 mIgnoreHotSwapSwitch; +}; + +// Structure to describe indication TLV 0x10 for UIM CardStatusIndication +struct sUIMCardStatusIndication_Status1 +{ + UINT8 mPrimaryGWSlot; + UINT8 mPrimaryGWApplication; + UINT8 mPrimary1XSlot; + UINT8 mPrimary1XApplication; + UINT8 mSecondaryGWSlot; + UINT8 mSecondaryGWApplication; + UINT8 mSecondary1XSlot; + UINT8 mSecondary1XApplication; + UINT8 mSlotsAvailable; + eQMIUIMCardStates mCardState; + eQMIUIMPINStates mUPINState; + UINT8 mRemainingUPINVerifyRetries; + UINT8 mRemainingUPINUnblockRetries; + eQMIUIMCardErrorCodes mCardErrorCode; + UINT8 mApplicationsAvailable; + eQMIUIMApplicationTypes mApplicationType; + eQMIUIMApplicationStates mApplicationState; + eQMIUIMPersonalizationStates mPersonalizationState; + eQMIUIMPersonalizationFeatures mPersonalizationFeature; + UINT8 mRemainingPersonalizationVerifyRetries; + UINT8 mRemainingPersonalizationUnblockRetries; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +struct sUIMCardStatusIndication_Status2 +{ + INT8 mUPINReplacesPIN1; + eQMIUIMPINStates mPIN1State; + UINT8 mRemainingPIN1VerifyRetries; + UINT8 mRemainingPIN1UnblockRetries; + eQMIUIMPINStates mPIN2State; + UINT8 mRemainingPIN2VerifyRetries; + UINT8 mRemainingPIN2UnblockRetries; +}; + +struct sUIMCardStatusIndication_Status +{ + sUIMCardStatusIndication_Status1 mUIMCardStatusIndication_Status1; + sUIMCardStatusIndication_Status2 mUIMCardStatusIndication_Status2; +}; + +// Structure to describe indication TLV 0x10 for UIM RefreshIndication +struct sUIMRefreshIndication_RefreshEvent1 +{ + eQMIUIMRefreshStages mStage; + eQMIUIMRefreshModes mMode; + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +struct sUIMRefreshIndication_RefreshEvent2 +{ + UINT16 mFileCount; + + struct sFile + { + UINT16 mFileID; + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // UINT16 mPath[1]; + }; + + // This array must be the size specified by mFileCount + // sFile mFiles[1]; +}; + +struct sUIMRefreshIndication_RefreshEvent +{ + sUIMRefreshIndication_RefreshEvent1 mUIMRefreshIndication_RefreshEvent1; + sUIMRefreshIndication_RefreshEvent2 mUIMRefreshIndication_RefreshEvent2; +}; + +// Structure to describe request TLV 0x01 for UIMAuthenticate() +struct sUIMAuthenticateRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMAuthenticate() +struct sUIMAuthenticateRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMAuthenticate() +struct sUIMAuthenticateResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMAuthenticate() +struct sUIMAuthenticateResponse_Data +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe response TLV 0x12 for UIMAuthenticate() +struct sUIMAuthenticateResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM AuthenticateIndication +struct sUIMAuthenticateIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM AuthenticateIndication +struct sUIMAuthenticateIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe indication TLV 0x11 for UIM AuthenticateIndication +struct sUIMAuthenticateIndication_Data +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe request TLV 0x01 for UIMCloseSession() +struct sUIMCloseSessionRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x01 for UIMGetServiceStatus() +struct sUIMGetServiceStatusRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe response TLV 0x10 for UIMGetServiceStatus() +struct sUIMGetServiceStatusResponse_FDNStatus +{ + eQMIUIMFDNStatusValues mFDNStatus; +}; + +// Structure to describe response TLV 0x11 for UIMGetServiceStatus() +struct sUIMGetServiceStatusResponse_HiddenKeyStatus +{ + eQMIUIMHiddenKeyStatusValues mHiddenKeyStatus; +}; + +// Structure to describe response TLV 0x12 for UIMGetServiceStatus() +struct sUIMGetServiceStatusResponse_Index +{ + UINT8 mEFDIRIndex; +}; + +// Structure to describe request TLV 0x01 for UIMSetServiceStatus() +struct sUIMSetServiceStatusRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMSetServiceStatus() +struct sUIMSetServiceStatusRequest_FDNStatus +{ + INT8 mEnableFDN; +}; + +// Structure to describe request TLV 0x01 for UIMChangeProvisioningSession() +struct sUIMChangeProvisioningSessionRequest_SessionChange +{ + eQMIUIMSessionTypes mSessionType; + eQMIUIMCKSessionOperations mOperation; +}; + +// Structure to describe request TLV 0x10 for UIMChangeProvisioningSession() +struct sUIMChangeProvisioningSessionRequest_AppInfo +{ + eQMIUIMSlots mSlot; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x01 for UIMGetLabel() +struct sUIMGetLabelRequest_AppInfo +{ + eQMIUIMSlots mSlot; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe response TLV 0x10 for UIMGetLabel() +struct sUIMGetLabelResponse_AppLabel +{ + UINT8 mLabelLength; + + // This array must be the size specified by mLabelLength + // char mLabelValue[1]; +}; + +// Structure to describe request TLV 0x10 for UIMGetConfiguration() +struct sUIMGetConfigurationRequest_Mask +{ + bool mAutomaticSelection:1; + bool mPersonalizationStatus:1; + bool mHaltSubscription:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x10 for UIMGetConfiguration() +struct sUIMGetConfigurationResponse_AutoSelection +{ + INT8 mAutomaticProvisioningOn; +}; + +// Structure to describe response TLV 0x11 for UIMGetConfiguration() +struct sUIMGetConfigurationResponse_Personalization +{ + UINT8 mFeatureCount; + + struct sFeature + { + eQMIUIMPersonalizationFeatures mPersonalizationFeature; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; + }; + + // This array must be the size specified by mFeatureCount + // sFeature mFeatures[1]; +}; + +// Structure to describe response TLV 0x12 for UIMGetConfiguration() +struct sUIMGetConfigurationResponse_Subscription +{ + INT8 mPublishSubscription; +}; + +// Structure to describe request TLV 0x01 for UIMSendADPU() +struct sUIMSendADPURequest_Slot +{ + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x10 for UIMSendADPU() +struct sUIMSendADPURequest_LogicalChannel +{ + UINT8 mChannelID; +}; + +// Structure to describe response TLV 0x10 for UIMSendADPU() +struct sUIMSendADPUResponse_APDUResponse +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x01 for UIMSAPConnection() +struct sUIMSAPConnectionRequest_Slot +{ + eQMIUIMConnectOperations mOperation; + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x10 for UIMSAPConnection() +struct sUIMSAPConnectionRequest_DisconnectMode +{ + eQMIUIMDisonnectModes mDisconnectMode; +}; + +// Structure to describe request TLV 0x11 for UIMSAPConnection() +struct sUIMSAPConnectionRequest_IntermediateGetResponse +{ + INT8 mReturnIntermediateGetResponse; +}; + +// Structure to describe response TLV 0x10 for UIMSAPConnection() +struct sUIMSAPConnectionResponse_State +{ + eQMIUIMSAPStates mSAPState; +}; + +// Structure to describe request TLV 0x01 for UIMSAP() +struct sUIMSAPRequestRequest_Request +{ + eQMIUIMSAPRequests mSAPRequest; + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x10 for UIMSAP() +struct sUIMSAPRequestRequest_APDU +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe response TLV 0x10 for UIMSAPRequest() +struct sUIMSAPRequestResponse_ATR +{ + UINT8 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe response TLV 0x11 for UIMSAPRequest() +struct sUIMSAPRequestResponse_APDU +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe response TLV 0x12 for UIMSAPRequest() +struct sUIMSAPRequestResponse_CardReaderStatus +{ + UINT8 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe indication TLV 0x10 for UIM SAPConnectionIndication +struct sUIMSAPConnectionIndication_CardStatus +{ + eQMIUIMSAPStates mSAPState; + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x01 for UIMLogicalChannel() +struct sUIMLogicalChannelRequest_Slot +{ + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x10 for UIMLogicalChannel() +struct sUIMLogicalChannelRequest_AID +{ + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x11 for UIMLogicalChannel() +struct sUIMLogicalChannelRequest_LogicalChannel +{ + UINT8 mChannelID; +}; + +// Structure to describe request TLV 0x12 for UIMLogicalChannel() +struct sUIMLogicalChannelRequest_FileControlInformation +{ + eQMIUIMFileControlInformation mFileControlInformation; +}; + +// Structure to describe response TLV 0x10 for UIMLogicalChannel() +struct sUIMLogicalChannelResponse_LogicalChannel +{ + UINT8 mChannelID; +}; + +// Structure to describe response TLV 0x11 for UIMLogicalChannel() +struct sUIMLogicalChannelResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x12 for UIMLogicalChannel() +struct sUIMLogicalChannelResponse_ResponseToSelectCommand +{ + UINT8 mResponseLength; + + // This array must be the size specified by mResponseLength + // UINT8 mResponse[1]; +}; + +// Structure to describe request TLV 0x01 for UIMSubscriptionOK() +struct sUIMSubscriptionOKRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x01 for UIMGetATR() +struct sUIMGetATRRequest_Slot +{ + eQMIUIMSlots mSlot; +}; + +// Structure to describe response TLV 0x10 for UIMGetATR() +struct sUIMGetATRResponse_ATRValue +{ + UINT8 mATRValueLength; + + // This array must be the size specified by mATRValueLength + // UINT8 mATRValue[1]; +}; + +// Structure to describe request TLV 0x01 for PBMSetIndicationRegistrationState() +struct sPBMSetIndicationRegistrationStateRequest_Mask +{ + bool mRecordUpdate:1; + bool mPhonebookReady:1; + bool mEmergencyNumberList:1; + bool mHiddenRecordStatus:1; + bool mAASUpdate:1; + bool mGASUpdate:1; + + // Padding out 26 bits + UINT8 mReserved1:2; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x10 for PBMSetIndicationRegistrationState() +struct sPBMSetIndicationRegistrationStateResponse_Mask +{ + bool mRecordUpdate:1; + bool mPhonebookReady:1; + bool mEmergencyNumberList:1; + bool mHiddenRecordStatus:1; + bool mAASUpdate:1; + bool mGASUpdate:1; + + // Padding out 26 bits + UINT8 mReserved1:2; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x01 for PBMGetCapabilities() +struct sPBMGetCapabilitiesRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; +}; + +// Structure to describe response TLV 0x10 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_Basic +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordsUsed; + UINT16 mMaximumRecords; + UINT8 mMaximumNumberLength; + UINT8 mMaximumNameLength; +}; + +// Structure to describe response TLV 0x11 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_Group +{ + UINT8 mMaximumGroupsPossible; + UINT8 mMaximumGroupTagLength; +}; + +// Structure to describe response TLV 0x12 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_AdditionalNumber +{ + UINT8 mMaximumAdditionalNumbersPossible; + UINT8 mMaximumAdditionalNumberLength; + UINT8 mMaximumAdditionalNumberTagLength; +}; + +// Structure to describe response TLV 0x13 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_Email +{ + UINT8 mMaximumEmailsPossible; + UINT8 mMaximumEmailAddressLength; +}; + +// Structure to describe response TLV 0x14 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_SecondName +{ + UINT8 mMaximumSecondNameLength; +}; + +// Structure to describe response TLV 0x15 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_HiddenRecords +{ + INT8 mHiddenEntrySupported; +}; + +// Structure to describe response TLV 0x16 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_GAS +{ + UINT8 mMaximumGASStringLength; +}; + +// Structure to describe response TLV 0x17 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_AAS +{ + UINT8 mMaximumAASStringLength; +}; + +// Structure to describe response TLV 0x10 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_Basic +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mNumberOfPhonebooks; + + struct sPhonebook + { + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordsUsed; + UINT16 mMaximumRecords; + UINT8 mMaximumNumberLength; + UINT8 mMaximumNameLength; + }; + + // This array must be the size specified by mNumberOfPhonebooks + // sPhonebook mPhonebooks[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x11 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_Group +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumGroupsPossible; + UINT8 mMaximumGroupTagLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x12 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_AdditionalNumber +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumAdditionalNumbersPossible; + UINT8 mMaximumAdditionalNumberLength; + UINT8 mMaximumAdditionalNumberTagLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x13 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_Email +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumEmailsPossible; + UINT8 mMaximumEmailAddressLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x14 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_SecondName +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumSecondNameLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x15 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_HiddenRecords +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + INT8 mHiddenEntrySupported; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x16 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_GAS +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumRecords; + UINT8 mRecordsUsed; + UINT8 mMaximumGASStringLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x17 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_AAS +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumRecords; + UINT8 mRecordsUsed; + UINT8 mMaximumAASStringLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe request TLV 0x01 for PBMReadRecords() +struct sPBMReadRecordsRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mStartingRecordID; + UINT16 mEndingRecordID; +}; + +// Structure to describe response TLV 0x10 for PBMReadRecords() +struct sPBMReadRecordsResponse_RecordsRead +{ + UINT16 mNumberOfRecords; +}; + +// Structure to describe indication TLV 0x01 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_Basic +{ + UINT16 mSequenceNumber; + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT8 mNumberOfRecords; + + struct sRecord1 + { + UINT16 mRecordID; + eQMIPBMNumberTypes mNumberType; + eQMIPBMNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + struct sRecord2 + { + UINT8 mNameLength; + + // This array must be the size (in BYTEs) specified by mNameLength + // wchar_t mName[1]; + }; + + struct sRecord + { + sRecord1 mRecord1; + sRecord2 mRecord2; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe indication TLV 0x10 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_SecondName +{ + UINT8 mNumberOfRecords; + + struct sRecord + { + UINT16 mRecordID; + UINT8 mSecondNameLength; + + // This array must be the size (in BYTEs) specified by mSecondNameLength + // wchar_t mSecondName[1]; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe indication TLV 0x11 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_AdditionalNumber +{ + UINT8 mNumberOfRecords; + + struct sRecord + { + UINT16 mRecordID; + UINT8 mAdditionalNumberCount; + + struct sAdditionalNumber1 + { + eQMIPBMNumberTypes mNumberType; + eQMIPBMNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + struct sAdditionalNumber2 + { + UINT8 mTagID; + }; + + struct sAdditionalNumber + { + sAdditionalNumber1 mAdditionalNumber1; + sAdditionalNumber2 mAdditionalNumber2; + }; + + // This array must be the size specified by mAdditionalNumberCount + // sAdditionalNumber mAdditionalNumbers[1]; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe indication TLV 0x12 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_Group +{ + UINT8 mNumberOfRecords; + + struct sRecord + { + UINT16 mRecordID; + UINT8 mGroupCount; + + // This array must be the size specified by mGroupCount + // UINT8 mGroupID[1]; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe indication TLV 0x13 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_Email +{ + UINT8 mNumberOfRecords; + + struct sRecord + { + UINT16 mRecordID; + UINT8 mEmailCount; + + struct sEmail + { + UINT8 mAddressLength; + + // This array must be the size (in BYTEs) specified by mAddressLength + // wchar_t mAddress[1]; + }; + + // This array must be the size specified by mEmailCount + // sEmail mEmails[1]; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe indication TLV 0x14 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_Hidden +{ + UINT8 mNumberOfRecords; + + struct sRecord + { + UINT16 mRecordID; + INT8 mHidden; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe request TLV 0x01 for PBMWriteRecord() +struct sPBMWriteRecordRequest_Info1 +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordID; + eQMIPBMNumberTypes mNumberType; + eQMIPBMNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +struct sPBMWriteRecordRequest_Info2 +{ + UINT8 mNameLength; + + // This array must be the size (in BYTEs) specified by mNameLength + // wchar_t mName[1]; +}; + +struct sPBMWriteRecordRequest_Info +{ + sPBMWriteRecordRequest_Info1 mPBMWriteRecordRequest_Info1; + sPBMWriteRecordRequest_Info2 mPBMWriteRecordRequest_Info2; +}; + +// Structure to describe request TLV 0x10 for PBMWriteRecord() +struct sPBMWriteRecordRequest_SecondName +{ + UINT8 mNameLength; + + // This array must be the size (in BYTEs) specified by mNameLength + // wchar_t mName[1]; +}; + +// Structure to describe request TLV 0x11 for PBMWriteRecord() +struct sPBMWriteRecordRequest_AdditionalNumber +{ + UINT8 mAdditionalNumberCount; + + struct sAdditionalNumber1 + { + eQMIPBMNumberTypes mNumberType; + eQMIPBMNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + struct sAdditionalNumber2 + { + UINT8 mTagID; + }; + + struct sAdditionalNumber + { + sAdditionalNumber1 mAdditionalNumber1; + sAdditionalNumber2 mAdditionalNumber2; + }; + + // This array must be the size specified by mAdditionalNumberCount + // sAdditionalNumber mAdditionalNumbers[1]; +}; + +// Structure to describe request TLV 0x12 for PBMWriteRecord() +struct sPBMWriteRecordRequest_Group +{ + UINT8 mGroupCount; + + // This array must be the size specified by mGroupCount + // UINT8 mGroupID[1]; +}; + +// Structure to describe request TLV 0x13 for PBMWriteRecord() +struct sPBMWriteRecordRequest_Email +{ + UINT8 mEmailCount; + + struct sEmail + { + UINT8 mAddressLength; + + // This array must be the size (in BYTEs) specified by mAddressLength + // wchar_t mAddress[1]; + }; + + // This array must be the size specified by mEmailCount + // sEmail mEmails[1]; +}; + +// Structure to describe request TLV 0x14 for PBMWriteRecord() +struct sPBMWriteRecordRequest_Hidden +{ + INT8 mHidden; +}; + +// Structure to describe response TLV 0x10 for PBMWriteRecord() +struct sPBMWriteRecordResponse_Info +{ + UINT16 mRecordID; +}; + +// Structure to describe request TLV 0x01 for PBMDeleteRecord() +struct sPBMDeleteRecordRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordID; +}; + +// Structure to describe response TLV 0x10 for PBMDeleteRecord() +struct sPBMDeleteRecordResponse_Info +{ + UINT16 mRecordID; +}; + +// Structure to describe request TLV 0x01 for PBMDeleteAllRecords() +struct sPBMDeleteAllRecordsRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; +}; + +// Structure to describe request TLV 0x01 for PBMSearchRecords() +struct sPBMSearchRecordsRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; +}; + +// Structure to describe request TLV 0x10 for PBMSearchRecords() +struct sPBMSearchRecordsRequest_Number +{ + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe request TLV 0x11 for PBMSearchRecords() +struct sPBMSearchRecordsRequest_Name +{ + UINT8 mNameLength; + + // This array must be the size (in BYTEs) specified by mNameLength + // wchar_t mName[1]; +}; + +// Structure to describe response TLV 0x10 for PBMSearchRecords() +struct sPBMSearchRecordsResponse_List +{ + UINT16 mNumberOfRecordIDs; + + // This array must be the size specified by mNumberOfRecordIDs + // UINT16 mRecordID[1]; +}; + +// Structure to describe indication TLV 0x01 for PBM RecordUpdateIndication +struct sPBMRecordUpdateIndication_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + eQMIPBMOperations mOperation; + UINT16 mRecordID; +}; + +// Structure to describe indication TLV 0x01 for PBM RefreshIndication +struct sPBMRefreshIndication_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + eQMIPBMRefreshStatus mStatus; +}; + +// Structure to describe indication TLV 0x01 for PBM ReadyIndication +struct sPBMReadyIndication_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; +}; + +// Structure to describe indication TLV 0x01 for PBM EmergencyListIndication +struct sPBMEmergencyListIndication_HardCodedNumbers +{ + UINT8 mNumberCount; + + struct sNumber + { + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; +}; + +// Structure to describe indication TLV 0x10 for PBM EmergencyListIndication +struct sPBMEmergencyListIndication_NVNumbers +{ + UINT8 mNumberCount; + + struct sNumber + { + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; +}; + +// Structure to describe indication TLV 0x11 for PBM EmergencyListIndication +struct sPBMEmergencyListIndication_CardNumbers +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mNumberCount; + + struct sNumber + { + bool mPolice:1; + bool mAmbulance:1; + bool mFireBrigade:1; + bool mMarineGuard:1; + bool mMountainRescue:1; + bool mManualECall:1; + bool mAutomaticECall:1; + bool mSpare:1; + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe indication TLV 0x12 for PBM EmergencyListIndication +struct sPBMEmergencyListIndication_NetworkNumbers +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mNumberCount; + + struct sNumber + { + bool mPolice:1; + bool mAmbulance:1; + bool mFireBrigade:1; + bool mMarineGuard:1; + bool mMountainRescue:1; + bool mManualECall:1; + bool mAutomaticECall:1; + bool mSpare:1; + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe indication TLV 0x01 for PBM AllReadyIndication +struct sPBMAllReadyIndication_Info +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + bool mAbbreviatedDialingNumber:1; + bool mFixedDialingNumber:1; + bool mMobileSubscriberIntegratedServicesDigitalNetwork:1; + bool mMailBoxDialingNumber:1; + bool mServiceDialingNumber:1; + bool mBarredDialingNumber:1; + bool mLastNumberDialed:1; + bool mMailBoxNumber:1; + + // Padding out 8 bits + UINT8 mReserved1; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x10 for PBMGetEmergencyList() +struct sPBMGetEmergencyListResponse_HardCodedNumbers +{ + UINT8 mNumberCount; + + struct sNumber + { + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; +}; + +// Structure to describe response TLV 0x11 for PBMGetEmergencyList() +struct sPBMGetEmergencyListResponse_NVNumbers +{ + UINT8 mNumberCount; + + struct sNumber + { + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; +}; + +// Structure to describe response TLV 0x12 for PBMGetEmergencyList() +struct sPBMGetEmergencyListResponse_CardNumbers +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mNumberCount; + + struct sNumber + { + bool mPolice:1; + bool mAmbulance:1; + bool mFireBrigade:1; + bool mMarineGuard:1; + bool mMountainRescue:1; + bool mManualECall:1; + bool mAutomaticECall:1; + bool mSpare:1; + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x13 for PBMGetEmergencyList() +struct sPBMGetEmergencyListResponse_NetworkNumbers +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mNumberCount; + + struct sNumber + { + bool mPolice:1; + bool mAmbulance:1; + bool mFireBrigade:1; + bool mMarineGuard:1; + bool mMountainRescue:1; + bool mManualECall:1; + bool mAutomaticECall:1; + bool mSpare:1; + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x10 for PBMGetAllGroups() +struct sPBMGetAllGroupsResponse_Groups +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mGroupCount; + + struct sGroup + { + UINT8 mGroupID; + UINT8 mGroupNameLength; + + // This array must be the size (in BYTEs) specified by mGroupNameLength + // wchar_t mGroupName[1]; + }; + + // This array must be the size specified by mGroupCount + // sGroup mGroups[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe request TLV 0x01 for PBMSetGroupInfo() +struct sPBMSetGroupInfoRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMOperations mOperation; + UINT8 mGroupID; + UINT8 mGroupNameLength; + + // This array must be the size (in BYTEs) specified by mGroupNameLength + // wchar_t mGroupName[1]; +}; + +// Structure to describe response TLV 0x10 for PBMSetGroupInfo() +struct sPBMSetGroupInfoResponse_ID +{ + eQMIPBMSessionTypes mSessionType; + UINT8 mGroupID; +}; + +// Structure to describe request TLV 0x01 for PBMGetState() +struct sPBMGetStateRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; +}; + +// Structure to describe response TLV 0x10 for PBMGetStateInfo() +struct sPBMGetStateInfoResponse_State +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + eQMIPBMStates mState; +}; + +// Structure to describe request TLV 0x01 for PBMReadAllHiddenRecords() +struct sPBMReadAllHiddenRecordsRequest_Info +{ + eQMIPBMSessionTypes mSessionType; +}; + +// Structure to describe response TLV 0x10 for PBMReadAllHiddenRecords() +struct sPBMReadAllHiddenRecordsResponse_Records +{ + UINT16 mNumberOfRecords; +}; + +// Structure to describe indication TLV 0x01 for PBM HiddenRecordStatusIndication +struct sPBMHiddenRecordStatusIndication_Status +{ + eQMIPBMSessionTypes mSessionType; + INT8 mHiddenRecordsValid; +}; + +// Structure to describe request TLV 0x01 for PBMGetNextEmptyRecordID() +struct sPBMGetNextEmptyRecordIDRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordID; +}; + +// Structure to describe response TLV 0x10 for PBMGetNextEmptyRecordID() +struct sPBMGetNextEmptyRecordIDResponse_Info +{ + UINT16 mRecordID; +}; + +// Structure to describe request TLV 0x01 for PBMGetNextRecordID() +struct sPBMGetNextRecordIDRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordID; +}; + +// Structure to describe response TLV 0x10 for PBMGetNextRecordID() +struct sPBMGetNextRecordIDResponse_Info +{ + UINT16 mRecordID; +}; + +// Structure to describe response TLV 0x10 for PBMGetAASList() +struct sPBMGetAASListResponse_List +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mAASCount; + + struct sAAS + { + UINT8 mAASID; + UINT8 mAlphaStringLength; + + // This array must be the size (in BYTEs) specified by mAlphaStringLength + // wchar_t mAlphaString[1]; + }; + + // This array must be the size specified by mAASCount + // sAAS mAASs[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe request TLV 0x10 for PBMSetAAS() +struct sPBMSetAASRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMAASOperations mOperation; + UINT8 mAASID; + UINT8 mAlphaStringLength; + + // This array must be the size (in BYTEs) specified by mAlphaStringLength + // wchar_t mAlphaString[1]; +}; + +// Structure to describe response TLV 0x10 for PBMSetAAS() +struct sPBMSetAASResponse_Info +{ + eQMIPBMSessionTypes mSessionType; + UINT8 mAASID; +}; + +// Structure to describe indication TLV 0x01 for PBM AASChangeIndication +struct sPBMAASChangeIndication_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMOperations mOperation; + UINT8 mAASID; + UINT8 mAlphaStringLength; + + // This array must be the size (in BYTEs) specified by mAlphaStringLength + // wchar_t mAlphaString[1]; +}; + +// Structure to describe indication TLV 0x01 for PBM GASChangeIndication +struct sPBMGASChangeIndication_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMOperations mOperation; + UINT8 mGASID; + UINT8 mGroupNameLength; + + // This array must be the size (in BYTEs) specified by mGroupNameLength + // wchar_t mGroupName[1]; +}; + +// Structure to describe request TLV 0x10 for PBMBindSubscription() +struct sPBMBindSubscriptionRequest_Type +{ + eQMIPBMSubscriptionTypes mSubscriptionType; +}; + +// Structure to describe response TLV 0x10 for PBMBindSubscription() +struct sPBMBindSubscriptionResponse_ResultCode +{ + eQMIResults mQMIResult; + eQMIErrors mQMIError; +}; + +// Structure to describe request TLV 0x01 for LOCClientRevision() +struct sLOCClientRevisionRequest_Revision +{ + UINT32 mRevision; +}; + +// Structure to describe request TLV 0x01 for LOCRegisterEvents() +struct sLOCRegisterEventsRequest_EventRegistrationMask +{ + bool mPositionReport:1; + bool mGNSSSatelliteInfo:1; + bool mNMEA:1; + bool mNINotifyVerifyRequest:1; + bool mInjectTimeRequest:1; + bool mInjectPredictedOrbitsRequest:1; + bool mInjectPositionRequest:1; + bool mEngineState:1; + bool mFixSessionState:1; + bool mWiFiRequest:1; + bool mSensorStreamingReadyStatus:1; + bool mTimeSyncRequest:1; + bool mSetSPIStreamingReport:1; + bool mLocationServerConnectionRequest:1; + + // Padding out 50 bits + UINT8 mReserved1:2; + UINT8 mReserved2[6]; +}; + +// Structure to describe request TLV 0x01 for LOCStart() +struct sLOCStartRequest_SessionID +{ + UINT8 mSessionID; +}; + +// Structure to describe request TLV 0x10 for LOCStart() +struct sLOCStartRequest_FixRecurrenceType +{ + eQMILOCFixRecurrenceType mFixRecurrenceType; +}; + +// Structure to describe request TLV 0x11 for LOCStart() +struct sLOCStartRequest_HorizontalAccuracy +{ + eQMILOCHorizontalAccuracy mHorizontalAccuracy; +}; + +// Structure to describe request TLV 0x12 for LOCStart() +struct sLOCStartRequest_EnableIntermediateReports +{ + eQMILOCIntermediateReportState mEnableIntermediateReports; +}; + +// Structure to describe request TLV 0x13 for LOCStart() +struct sLOCStartRequest_MinimumIntervalBetweenPositionReports +{ + UINT32 mMinimumTimeIntervalMilliseconds; +}; + +// Structure to describe request TLV 0x01 for LOCStop() +struct sLOCStopRequest_SessionID +{ + UINT8 mSessionID; +}; + +// Structure to describe indication TLV 0x01 for LOC PositionReportIndication +struct sLOCPositionReportIndication_SessionStatus +{ + eQMILOCSessionStatus mSessionStatus; +}; + +// Structure to describe indication TLV 0x10 for LOC PositionReportIndication +struct sLOCPositionReportIndication_Latitude +{ + double mLatitudeDegrees; +}; + +// Structure to describe indication TLV 0x11 for LOC PositionReportIndication +struct sLOCPositionReportIndication_Longitude +{ + double mLongitudeDegrees; +}; + +// Structure to describe indication TLV 0x12 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalUncertaintyCircular +{ + float mHorizontalUncertaintyCircularMeters; +}; + +// Structure to describe indication TLV 0x13 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalUncertaintyEllipticalMinor +{ + float mHorizontalUncertaintyEllipticalMinorMeters; +}; + +// Structure to describe indication TLV 0x14 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalUncertaintyEllipticalMajor +{ + float mHorizontalUncertaintyEllipticalMajorMeters; +}; + +// Structure to describe indication TLV 0x15 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalUncertaintyEllipticalAzimuth +{ + float mHorizontalUncertaintyEllipticalAzimuthDecimalDegrees; +}; + +// Structure to describe indication TLV 0x16 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalConfidence +{ + UINT8 mHorizontalConfidencePercent; +}; + +// Structure to describe indication TLV 0x17 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalReliability +{ + eQMILOCReliability mHorizontalReliability; +}; + +// Structure to describe indication TLV 0x18 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalSpeed +{ + float mHorizontalSpeedMetersSecond; +}; + +// Structure to describe indication TLV 0x19 for LOC PositionReportIndication +struct sLOCPositionReportIndication_SpeedUncertainty +{ + float mSpeedUncertaintyMetersSecond; +}; + +// Structure to describe indication TLV 0x1A for LOC PositionReportIndication +struct sLOCPositionReportIndication_AltitudeFromEllipsoid +{ + float mAltitudeFromEllipsoidMeters; +}; + +// Structure to describe indication TLV 0x1B for LOC PositionReportIndication +struct sLOCPositionReportIndication_AltitudeFromSeaLevel +{ + float mAltitudeFromSeaLevelMeters; +}; + +// Structure to describe indication TLV 0x1C for LOC PositionReportIndication +struct sLOCPositionReportIndication_VerticalUncertainty +{ + float mVerticalUncertaintyMeters; +}; + +// Structure to describe indication TLV 0x1D for LOC PositionReportIndication +struct sLOCPositionReportIndication_VerticalConfidence +{ + UINT8 mVerticalConfidencePercent; +}; + +// Structure to describe indication TLV 0x1E for LOC PositionReportIndication +struct sLOCPositionReportIndication_VerticalReliability +{ + eQMILOCReliability mVerticalReliability; +}; + +// Structure to describe indication TLV 0x1F for LOC PositionReportIndication +struct sLOCPositionReportIndication_VerticalSpeed +{ + float mVerticalSpeedMetersSecond; +}; + +// Structure to describe indication TLV 0x20 for LOC PositionReportIndication +struct sLOCPositionReportIndication_Heading +{ + float mHeadingDegrees; +}; + +// Structure to describe indication TLV 0x21 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HeadingUncertainty +{ + float mHeadingUncertaintyDegrees; +}; + +// Structure to describe indication TLV 0x22 for LOC PositionReportIndication +struct sLOCPositionReportIndication_MagneticDeviation +{ + float mMagneticDeviation; +}; + +// Structure to describe indication TLV 0x23 for LOC PositionReportIndication +struct sLOCPositionReportIndication_TechnologyUsed +{ + bool mSatellite:1; + bool mCellular:1; + bool mWiFi:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x24 for LOC PositionReportIndication +struct sLOCPositionReportIndication_DilutionOfPrecision +{ + float mPositionDilutionOfPrecision; + float mHorizontalDilutionOfPrecision; + float mVerticalDilutionOfPrecision; +}; + +// Structure to describe indication TLV 0x25 for LOC PositionReportIndication +struct sLOCPositionReportIndication_UTCTimestamp +{ + UINT64 mUTCTimestampMilliseconds; +}; + +// Structure to describe indication TLV 0x26 for LOC PositionReportIndication +struct sLOCPositionReportIndication_LeapSeconds +{ + UINT8 mLeapSeconds; +}; + +// Structure to describe indication TLV 0x27 for LOC PositionReportIndication +struct sLOCPositionReportIndication_GPSTime +{ + UINT16 mGPSWeeks; + UINT32 mGPSTimeOfWeekMilliseconds; +}; + +// Structure to describe indication TLV 0x28 for LOC PositionReportIndication +struct sLOCPositionReportIndication_TimeUncertainty +{ + float mTimeUncertaintyMilliseconds; +}; + +// Structure to describe indication TLV 0x29 for LOC PositionReportIndication +struct sLOCPositionReportIndication_TimeSource +{ + eQMILOCTimeSource mTimeSource; +}; + +// Structure to describe indication TLV 0x2A for LOC PositionReportIndication +struct sLOCPositionReportIndication_SensorDataUsage +{ + bool mAccelerometerUsed:1; + bool mGyroUsed:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; + + bool mAidedHeading:1; + bool mAidedSpeed:1; + bool mAidedPosition:1; + bool mAidedVelocity:1; + + // Padding out 28 bits + UINT8 mReserved3:4; + UINT8 mReserved4[3]; +}; + +// Structure to describe indication TLV 0x2B for LOC PositionReportIndication +struct sLOCPositionReportIndication_SessionFixCount +{ + UINT32 mSessionFixCount; +}; + +// Structure to describe indication TLV 0x01 for LOC GNSSSatelliteInfoIndication +struct sLOCGNSSSatelliteInfoIndication_AltitudeSource +{ + eQMILOCAltitudeAssumed mAltitudeAssumed; +}; + +// Structure to describe indication TLV 0x10 for LOC GNSSSatelliteInfoIndication +struct sLOCGNSSSatelliteInfoIndication_SatelliteInfo +{ + UINT8 mSatelliteInfoCount; + bool mValidSystem:1; + bool mValidGNSSSatelliteID:1; + bool mValidHealthStatus:1; + bool mValidProcessStatus:1; + bool mValidSatelliteInfoMask:1; + bool mValidElevation:1; + bool mValidAzimuth:1; + bool mValidSignalToNoiseRatio:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; + + eQMILOCSystem mSystem; + UINT16 mGNSSSatelliteID; + eQMILOCHealthStatus mHealthStatus; + eQMILOCSatelliteStatus mSatelliteStatus; + bool mHasEphemeris:1; + bool mHasAlmanac:1; + + // Padding out 6 bits + UINT8 mReserved2:6; + + float mElevationDegrees; + float mAzimuthDegrees; + float mSignalToNoiseRatiodBHz; +}; + +// Structure to describe indication TLV 0x01 for LOC NMEAIndication +struct sLOCNMEAIndication_NMEAString +{ + // String is variable length, but must be size of the container + // char mNMEAString[1]; +}; + +// Structure to describe request TLV 0x01 for LOCNetworkInitiated() +struct sLOCNetworkInitiatedRequestIndication_NotificationType +{ + eQMILOCNotificationType mNotificationType; +}; + +// Structure to describe request TLV 0x10 for LOCNetworkInitiated() +struct sLOCNetworkInitiatedRequestIndication_VxRequest1 +{ + INT8 mPositionQoSIncluded; + UINT8 mPositionQoSTimeoutSeconds; + UINT32 mMaxNumberOfFixes; + UINT32 mTimeBetweenFixesSeconds; + eQMILOCPositionMode mPosistionMode; + eQMILOCEncodingScheme mEncodingScheme; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_VxRequest2 +{ + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCNetworkInitiatedRequestIndication_VxRequest +{ + sLOCNetworkInitiatedRequestIndication_VxRequest1 mLOCNetworkInitiatedRequestIndication_VxRequest1; + sLOCNetworkInitiatedRequestIndication_VxRequest2 mLOCNetworkInitiatedRequestIndication_VxRequest2; +}; + +// Structure to describe request TLV 0x11 for LOCNetworkInitiated() +struct sLOCNetworkInitiatedRequestIndication_SUPLRequest1 +{ + bool mValidServerInfo:1; + bool mValidSessionID:1; + bool mValidHash:1; + bool mValidPositionMethod:1; + bool mValidDataCodingScheme:1; + bool mValidRequestorID:1; + bool mValidClientName:1; + bool mValidQualityOfPosition:1; + bool mValidUserResponseTimer:1; + + // Padding out 23 bits + UINT8 mReserved1:7; + UINT8 mReserved2[2]; + + bool mIPv4:1; + bool mIPv6:1; + bool mURL:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + UINT32 mIPv4Address; + UINT16 mIPv4Port; + UINT8 mIPv6Address[16]; + UINT32 mIPv6Port; + UINT8 mURLAddressLength; + + // This array must be the size specified by mURLAddressLength + // char mURLAddress[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_SUPLRequest2 +{ + UINT8 mSUPLSessionID[4]; + UINT8 mSUPLHash[8]; + eQMILOCPosition mPositionMethod; + eQMILOCDataCodingScheme mDataCodingScheme; + eQMILOCFormatType mRequestorIDFormatType; + UINT8 mRequestorIDFormattedStringLength; + + // This array must be the size specified by mRequestorIDFormattedStringLength + // UINT8 mRequestorIDFormattedString[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_SUPLRequest3 +{ + eQMILOCFormatType mClientNameFormatType; + UINT8 mClientNameFormattedStringLength; + + // This array must be the size specified by mClientNameFormattedStringLength + // UINT8 mClientNameFormattedString[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_SUPLRequest4 +{ + bool mQoPHorizontalAccelerationValid:1; + bool mQoPVerticalAccelerationValid:1; + bool mQoPMaximumAge:1; + bool mQoPDelayValid:1; + + // Padding out 4 bits + UINT8 mReserved4:4; + + UINT8 mHorizontalAccuracyMeters; + UINT8 mVerticalAccuracyMeters; + UINT16 mMaximumLocationAgeSeconds; + UINT8 mDelaySeconds; + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCNetworkInitiatedRequestIndication_SUPLRequest +{ + sLOCNetworkInitiatedRequestIndication_SUPLRequest1 mLOCNetworkInitiatedRequestIndication_SUPLRequest1; + sLOCNetworkInitiatedRequestIndication_SUPLRequest2 mLOCNetworkInitiatedRequestIndication_SUPLRequest2; + sLOCNetworkInitiatedRequestIndication_SUPLRequest3 mLOCNetworkInitiatedRequestIndication_SUPLRequest3; + sLOCNetworkInitiatedRequestIndication_SUPLRequest4 mLOCNetworkInitiatedRequestIndication_SUPLRequest4; +}; + +// Structure to describe request TLV 0x12 for LOCNetworkInitiated() +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest1 +{ + bool mValidInvokeID:1; + bool mValidDataCodingScheme:1; + bool mValidNotificationText:1; + bool mValidClientAddress:1; + bool mValidLocationType:1; + bool mValidRequestorID:1; + bool mValidCodewordString:1; + bool mValidServiceTypeMask:1; + bool mValidUserResponseTImer:1; + + // Padding out 7 bits + UINT8 mReserved1:7; + + UINT8 mInvokeID; + eQMILOCDataCodingScheme mDataCodingScheme; + UINT8 mNotificationTextLength; + + // This array must be the size specified by mNotificationTextLength + // UINT8 mNotificationText[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest2 +{ + UINT8 mClientAddressLength; + + // This array must be the size specified by mClientAddressLength + // UINT8 mClientAddress[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest3 +{ + eQMILOCLocationType mLocationType; + eQMILOCDataCodingScheme mRequestorIDDataCodingScheme; + UINT8 mRequestorIDCodedStingLength; + + // This array must be the size specified by mRequestorIDCodedStingLength + // UINT8 mRequestorIDCodedString[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest4 +{ + eQMILOCDataCodingScheme mCodewordStringDataCodingScheme; + UINT8 mCodewordStringCodedStringLength; + + // This array must be the size specified by mCodewordStringCodedStringLength + // UINT8 mCodewordStringCodedString[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest5 +{ + UINT8 mServiceTypeID; + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest +{ + sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest1 mLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest1; + sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest2 mLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest2; + sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest3 mLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest3; + sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest4 mLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest4; + sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest5 mLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest5; +}; + +// Structure to describe request TLV 0x13 for LOCNetworkInitiated() +struct sLOCNetworkInitiatedRequestIndication_ServiceInteractionRequest +{ + INT8 mPositionQoSIncluded; + UINT8 mPositionQoSTimeoutSeconds; + UINT32 mMaxNumberOfFixes; + UINT32 mTimeBetweenFixesSeconds; + eQMILOCPositionMode mPosistionMode; + eQMILOCEncodingScheme mEncodingScheme; + UINT8 mRequestorIDLength; + UINT8 mRequestorID; + UINT16 mUserResponseTimerSeconds; + eQMILOCServiceInteractionType mServiceInteractionType; +}; + +// Structure to describe indication TLV 0x10 for LOC InjectTimeIndication +struct sLOCInjectTimeIndication_TimeServerInfo +{ + UINT32 mDelayThresholdMilliseconds; + UINT8 mServerListLength; + + struct sServer + { + UINT8 mServerURLLength; + + // This array must be the size specified by mServerURLLength + // char mServerURL[1]; + }; + + // This array must be the size specified by mServerListLength + // sServer mServers[1]; +}; + +// Structure to describe indication TLV 0x01 for LOC InjectPredictedOrbitsIndication +struct sLOCInjectPredictedOrbitsIndication_AllowedSize +{ + UINT32 mMaximumFileSizeBytes; + UINT32 mMaximumPartSizeBytes; +}; + +// Structure to describe indication TLV 0x10 for LOC InjectPredictedOrbitsIndication +struct sLOCInjectPredictedOrbitsIndication_ServerList +{ + UINT8 mServerListLength; + + struct sServer + { + UINT8 mServerURLLength; + + // This array must be the size specified by mServerURLLength + // char mServerURL[1]; + }; + + // This array must be the size specified by mServerListLength + // sServer mServers[1]; +}; + +// Structure to describe indication TLV 0x01 for LOC InjectPositionIndication +struct sLOCInjectPositionIndication_Latitude +{ + double mLatitudeDegrees; +}; + +// Structure to describe indication TLV 0x03 for LOC InjectPositionIndication +struct sLOCInjectPositionIndication_HorizontalUncertaintyCircular +{ + float mHorizontalUncertaintyCircularMeters; +}; + +// Structure to describe indication TLV 0x04 for LOC InjectPositionIndication +struct sLOCInjectPositionIndication_UTCTimestamp +{ + UINT64 mUTCTimestampMilliseconds; +}; + +// Structure to describe indication TLV 0x01 for LOC EngineStateIndication +struct sLOCEngineStateIndication_EngineState +{ + eQMILOCEngineState mEngineState; +}; + +// Structure to describe indication TLV 0x01 for LOC FixSessionStateIndication +struct sLOCFixSessionStateIndication_SessionState +{ + eQMILOCSessionState mSessionState; +}; + +// Structure to describe indication TLV 0x10 for LOC FixSessionStateIndication +struct sLOCFixSessionStateIndication_SessionID +{ + UINT8 mSessionID; +}; + +// Structure to describe request TLV 0x01 for LOCWiFi() +struct sLOCWiFiRequestIndication_RequestType +{ + eQMILOCRequestType mRequestType; +}; + +// Structure to describe request TLV 0x10 for LOCWiFi() +struct sLOCWiFiRequestIndication_TimeBetweenFixes +{ + UINT16 mTimeBetweenFixesMilliseconds; +}; + +// Structure to describe indication TLV 0x10 for LOC SensorStreamingReadyStatusIndication +struct sLOCSensorStreamingReadyStatusIndication_AccelerometerReady +{ + INT8 mReadyForInjection; + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe indication TLV 0x11 for LOC SensorStreamingReadyStatusIndication +struct sLOCSensorStreamingReadyStatusIndication_GyrometerReady +{ + INT8 mReadyForInjection; + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe request TLV 0x01 for LOCTimeSync() +struct sLOCTimeSyncRequestIndication_ReferenceCounter +{ + UINT32 mReferenceCounter; +}; + +// Structure to describe indication TLV 0x01 for LOC SetSPIStreamingReportIndication +struct sLOCSetSPIStreamingReportIndication_SPIRequests +{ + INT8 mEnableSPIRequests; +}; + +// Structure to describe request TLV 0x01 for LOCLocationServerConnection() +struct sLOCLocationServerConnectionRequestIndication_ConnectionHandle +{ + UINT32 mConnectionHandle; +}; + +// Structure to describe request TLV 0x03 for LOCLocationServerConnection() +struct sLOCLocationServerConnectionRequestIndication_WWANType +{ + eQMILOCWWANType mWWANType; +}; + +// Structure to describe indication TLV 0x10 for LOC GetFixCriteriaIndication +struct sLOCGetFixCriteriaIndication_HorizontalAccuracy +{ + eQMILOCHorizontalAccuracy mHorizontalAccuracy; +}; + +// Structure to describe indication TLV 0x11 for LOC GetFixCriteriaIndication +struct sLOCGetFixCriteriaIndication_IntermediateFixes +{ + eQMILOCIntermediateReportState mEnableIntermediateReports; +}; + +// Structure to describe indication TLV 0x12 for LOC GetFixCriteriaIndication +struct sLOCGetFixCriteriaIndication_MinimumIntervalBetweenFixes +{ + UINT32 mMinimumTimeIntervalMilliseconds; +}; + +// Structure to describe request TLV 0x01 for LOCProvideNIUserResponse() +struct sLOCProvideNIUserResponseRequest_UserResponse +{ + eQMILOCUserResponse mUserResponse; +}; + +// Structure to describe request TLV 0x10 for LOCProvideNIUserResponse() +struct sLOCProvideNIUserResponseRequest_VxRequest1 +{ + INT8 mPositionQoSIncluded; + UINT8 mPositionQoSTimeoutSeconds; + UINT32 mMaxNumberOfFixes; + UINT32 mTimeBetweenFixesSeconds; + eQMILOCPositionMode mPosistionMode; + eQMILOCEncodingScheme mEncodingScheme; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sLOCProvideNIUserResponseRequest_VxRequest2 +{ + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCProvideNIUserResponseRequest_VxRequest +{ + sLOCProvideNIUserResponseRequest_VxRequest1 mLOCProvideNIUserResponseRequest_VxRequest1; + sLOCProvideNIUserResponseRequest_VxRequest2 mLOCProvideNIUserResponseRequest_VxRequest2; +}; + +// Structure to describe request TLV 0x11 for LOCProvideNIUserResponse() +struct sLOCProvideNIUserResponseRequest_SUPLRequest1 +{ + bool mValidServerInfo:1; + bool mValidSessionID:1; + bool mValidHash:1; + bool mValidPositionMethod:1; + bool mValidDataCodingScheme:1; + bool mValidRequestorID:1; + bool mValidClientName:1; + bool mValidQualityOfPosition:1; + bool mValidUserResponseTimer:1; + + // Padding out 23 bits + UINT8 mReserved1:7; + UINT8 mReserved2[2]; + + bool mIPv4:1; + bool mIPv6:1; + bool mURL:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + UINT32 mIPv4Address; + UINT16 mIPv4Port; + UINT8 mIPv6Address[16]; + UINT32 mIPv6Port; + UINT8 mURLAddressLength; + + // This array must be the size specified by mURLAddressLength + // char mURLAddress[1]; +}; + +struct sLOCProvideNIUserResponseRequest_SUPLRequest2 +{ + UINT8 mSUPLSessionID[4]; + UINT8 mSUPLHash[8]; + eQMILOCPosition mPositionMethod; + eQMILOCDataCodingScheme mDataCodingScheme; + eQMILOCFormatType mRequestorIDFormatType; + UINT8 mRequestorIDFormattedStringLength; + + // This array must be the size specified by mRequestorIDFormattedStringLength + // UINT8 mRequestorIDFormattedString[1]; +}; + +struct sLOCProvideNIUserResponseRequest_SUPLRequest3 +{ + eQMILOCFormatType mClientNameFormatType; + UINT8 mClientNameFormattedStringLength; + + // This array must be the size specified by mClientNameFormattedStringLength + // UINT8 mClientNameFormattedString[1]; +}; + +struct sLOCProvideNIUserResponseRequest_SUPLRequest4 +{ + bool mQoPHorizontalAccelerationValid:1; + bool mQoPVerticalAccelerationValid:1; + bool mQoPMaximumAge:1; + bool mQoPDelayValid:1; + + // Padding out 4 bits + UINT8 mReserved4:4; + + UINT8 mHorizontalAccuracyMeters; + UINT8 mVerticalAccuracyMeters; + UINT16 mMaximumLocationAgeSeconds; + UINT8 mDelaySeconds; + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCProvideNIUserResponseRequest_SUPLRequest +{ + sLOCProvideNIUserResponseRequest_SUPLRequest1 mLOCProvideNIUserResponseRequest_SUPLRequest1; + sLOCProvideNIUserResponseRequest_SUPLRequest2 mLOCProvideNIUserResponseRequest_SUPLRequest2; + sLOCProvideNIUserResponseRequest_SUPLRequest3 mLOCProvideNIUserResponseRequest_SUPLRequest3; + sLOCProvideNIUserResponseRequest_SUPLRequest4 mLOCProvideNIUserResponseRequest_SUPLRequest4; +}; + +// Structure to describe request TLV 0x12 for LOCProvideNIUserResponse() +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest1 +{ + bool mValidInvokeID:1; + bool mValidDataCodingScheme:1; + bool mValidNotificationText:1; + bool mValidClientAddress:1; + bool mValidLocationType:1; + bool mValidRequestorID:1; + bool mValidCodewordString:1; + bool mValidServiceTypeMask:1; + bool mValidUserResponseTImer:1; + + // Padding out 7 bits + UINT8 mReserved1:7; + + UINT8 mInvokeID; + eQMILOCDataCodingScheme mDataCodingScheme; + UINT8 mNotificationTextLength; + + // This array must be the size specified by mNotificationTextLength + // UINT8 mNotificationText[1]; +}; + +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest2 +{ + UINT8 mClientAddressLength; + + // This array must be the size specified by mClientAddressLength + // UINT8 mClientAddress[1]; +}; + +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest3 +{ + eQMILOCLocationType mLocationType; + eQMILOCDataCodingScheme mRequestorIDDataCodingScheme; + UINT8 mRequestorIDCodedStingLength; + + // This array must be the size specified by mRequestorIDCodedStingLength + // UINT8 mRequestorIDCodedString[1]; +}; + +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest4 +{ + eQMILOCDataCodingScheme mCodewordStringDataCodingScheme; + UINT8 mCodewordStringCodedStringLength; + + // This array must be the size specified by mCodewordStringCodedStringLength + // UINT8 mCodewordStringCodedString[1]; +}; + +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest5 +{ + UINT8 mServiceTypeID; + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest +{ + sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest1 mLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest1; + sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest2 mLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest2; + sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest3 mLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest3; + sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest4 mLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest4; + sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest5 mLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest5; +}; + +// Structure to describe request TLV 0x13 for LOCProvideNIUserResponse() +struct sLOCProvideNIUserResponseRequest_ServiceInteractionRequest +{ + INT8 mPositionQoSIncluded; + UINT8 mPositionQoSTimeoutSeconds; + UINT32 mMaxNumberOfFixes; + UINT32 mTimeBetweenFixesSeconds; + eQMILOCPositionMode mPosistionMode; + eQMILOCEncodingScheme mEncodingScheme; + UINT8 mRequestorIDLength; + UINT8 mRequestorID; + UINT16 mUserResponseTimerSeconds; + eQMILOCServiceInteractionType mServiceInteractionType; +}; + +// Structure to describe request TLV 0x01 for LOCInjectPredictedOrbitsData() +struct sLOCInjectPredictedOrbitsDataRequest_TotalSize +{ + UINT32 mTotalSize; +}; + +// Structure to describe request TLV 0x03 for LOCInjectPredictedOrbitsData() +struct sLOCInjectPredictedOrbitsDataRequest_PartNumber +{ + UINT16 mPartNumber; +}; + +// Structure to describe request TLV 0x04 for LOCInjectPredictedOrbitsData() +struct sLOCInjectPredictedOrbitsDataRequest_PartData +{ + UINT16 mPartDataLength; + + // This array must be the size specified by mPartDataLength + // UINT8 mPartData[1]; +}; + +// Structure to describe request TLV 0x10 for LOCInjectPredictedOrbitsData() +struct sLOCInjectPredictedOrbitsDataRequest_FormatType +{ + eQMILOCOrbitsFormatType mOrbitsFormatType; +}; + +// Structure to describe indication TLV 0x10 for LOC InjectPredictedOrbitsDataIndication +struct sLOCInjectPredictedOrbitsDataIndication_PartNumber +{ + UINT16 mPartNumber; +}; + +// Structure to describe indication TLV 0x10 for LOC GetPredictedOrbitsDataSourceIndication +struct sLOCGetPredictedOrbitsDataSourceIndication_AllowedSizes +{ + UINT32 mMaximumFileSizeBytes; + UINT32 mMaximumPartSizeBytes; +}; + +// Structure to describe indication TLV 0x11 for LOC GetPredictedOrbitsDataSourceIndication +struct sLOCGetPredictedOrbitsDataSourceIndication_ServerList +{ + UINT8 mServerListLength; + + struct sServer + { + UINT8 mServerURLLength; + + // This array must be the size specified by mServerURLLength + // char mServerURL[1]; + }; + + // This array must be the size specified by mServerListLength + // sServer mServers[1]; +}; + +// Structure to describe indication TLV 0x10 for LOC GetPredictedOrbitsDataValidityIndication +struct sLOCGetPredictedOrbitsDataValidityIndication_ValidityInfo +{ + UINT64 mStartTimeInUTC; + UINT16 mDurationHours; +}; + +// Structure to describe request TLV 0x01 for LOCInjectUTCTime() +struct sLOCInjectUTCTimeRequest_UTCTime +{ + UINT64 mUTCTimestampMilliseconds; +}; + +// Structure to describe request TLV 0x10 for LOCInjectPosition() +struct sLOCInjectPositionRequest_Latitude +{ + double mLatitudeDegrees; +}; + +// Structure to describe request TLV 0x11 for LOCInjectPosition() +struct sLOCInjectPositionRequest_Longitude +{ + double mLongitudeDegrees; +}; + +// Structure to describe request TLV 0x12 for LOCInjectPosition() +struct sLOCInjectPositionRequest_HorizontalUncertaintyCircular +{ + float mHorizontalUncertaintyCircularMeters; +}; + +// Structure to describe request TLV 0x13 for LOCInjectPosition() +struct sLOCInjectPositionRequest_HorizontalConfidence +{ + UINT8 mHorizontalConfidencePercent; +}; + +// Structure to describe request TLV 0x14 for LOCInjectPosition() +struct sLOCInjectPositionRequest_HorizontalReliability +{ + eQMILOCReliability mHorizontalReliability; +}; + +// Structure to describe request TLV 0x15 for LOCInjectPosition() +struct sLOCInjectPositionRequest_AltitudeFromEllipsoid +{ + float mAltitudeFromEllipsoidMeters; +}; + +// Structure to describe request TLV 0x16 for LOCInjectPosition() +struct sLOCInjectPositionRequest_AltitudeFromSeaLevel +{ + float mAltitudeFromSeaLevelMeters; +}; + +// Structure to describe request TLV 0x17 for LOCInjectPosition() +struct sLOCInjectPositionRequest_VerticalUncertainty +{ + float mVerticalUncertaintyMeters; +}; + +// Structure to describe request TLV 0x18 for LOCInjectPosition() +struct sLOCInjectPositionRequest_VerticalConfidence +{ + UINT8 mVerticalConfidencePercent; +}; + +// Structure to describe request TLV 0x19 for LOCInjectPosition() +struct sLOCInjectPositionRequest_VerticalReliability +{ + eQMILOCReliability mVerticalReliability; +}; + +// Structure to describe request TLV 0x1A for LOCInjectPosition() +struct sLOCInjectPositionRequest_AltitudeSource +{ + eQMILOCAltitudeSource mAltitudeSource; + eQMILOCLinkage mLinkage; + eQMILOCCoverage mCoverage; +}; + +// Structure to describe request TLV 0x1B for LOCInjectPosition() +struct sLOCInjectPositionRequest_UTCTimestamp +{ + UINT64 mUTCTimestampMilliseconds; +}; + +// Structure to describe request TLV 0x1C for LOCInjectPosition() +struct sLOCInjectPositionRequest_PositionAge +{ + UINT32 mAgeTimestampMilliseconds; +}; + +// Structure to describe request TLV 0x01 for LOCSetEngineLock() +struct sLOCSetEngineLockRequest_LockType +{ + eQMILOCLockType mLockType; +}; + +// Structure to describe indication TLV 0x10 for LOC GetEngineLockIndication +struct sLOCGetEngineLockIndication_LockType +{ + eQMILOCLockType mLockType; +}; + +// Structure to describe request TLV 0x01 for LOCSetSBASConfig() +struct sLOCSetSBASConfigRequest_SBASConfig +{ + INT8 mSBASEnabled; +}; + +// Structure to describe response TLV 0x10 for LOCGetSBASConfig() +struct sLOCGetSBASConfigResponse_SBASConfig +{ + INT8 mSBASEnabled; +}; + +// Structure to describe request TLV 0x01 for LOCSetNMEATypes() +struct sLOCSetNMEATypesRequest_SentenceTypes +{ + bool mGGASentence:1; + bool mRMCSentence:1; + bool mGSVSentence:1; + bool mGSASentence:1; + bool mVTGSentence:1; + + // Padding out 27 bits + UINT8 mReserved1:3; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x10 for LOC GetNMEATypesIndication +struct sLOCGetNMEATypesIndication_SentenceType +{ + bool mGGASentence:1; + bool mRMCSentence:1; + bool mGSVSentence:1; + bool mGSASentence:1; + bool mVTGSentence:1; + + // Padding out 27 bits + UINT8 mReserved1:3; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x01 for LOCSetLowPowerMode() +struct sLOCSetLowPowerModeRequest_EnableLPM +{ + INT8 mEnableLowPowerMode; +}; + +// Structure to describe indication TLV 0x10 for LOC GetLowPowerModeIndication +struct sLOCGetLowPowerModeIndication_EnableLPM +{ + INT8 mEnableLowPowerMode; +}; + +// Structure to describe request TLV 0x01 for LOCSetLocationServer() +struct sLOCSetLocationServerRequest_ServerType +{ + eQMILOCLocationServerType mServerType; +}; + +// Structure to describe request TLV 0x10 for LOCSetLocationServer() +struct sLOCSetLocationServerRequest_IPv4Address +{ + UINT32 mIPv4Address; + UINT16 mIPv4Port; +}; + +// Structure to describe request TLV 0x11 for LOCSetLocationServer() +struct sLOCSetLocationServerRequest_IPv6Address +{ + UINT8 mIPv6Address[16]; + UINT32 mIPv6Port; +}; + +// Structure to describe request TLV 0x12 for LOCSetLocationServer() +struct sLOCSetLocationServerRequest_URLAddress +{ + // String is variable length, but must be size of the container + // char mURLAddress[1]; +}; + +// Structure to describe request TLV 0x01 for LOCGetLocationServer() +struct sLOCGetLocationServerRequest_ServerType +{ + eQMILOCLocationServerType mServerType; +}; + +// Structure to describe request TLV 0x10 for LOCGetLocationServer() +struct sLOCGetLocationServerRequest_AddressType +{ + bool mIPv4:1; + bool mIPv6:1; + bool mURL:1; + + // Padding out 5 bits + UINT8 mReserved1:5; +}; + +// Structure to describe indication TLV 0x10 for LOC GetLocationServerIndication +struct sLOCGetLocationServerIndication_IPv4Address +{ + UINT32 mIPv4Address; + UINT16 mIPv4Port; +}; + +// Structure to describe indication TLV 0x11 for LOC GetLocationServerIndication +struct sLOCGetLocationServerIndication_IPv6Address +{ + UINT8 mIPv6Address[16]; + UINT32 mIPv6Port; +}; + +// Structure to describe indication TLV 0x12 for LOC GetLocationServerIndication +struct sLOCGetLocationServerIndication_URLAddress +{ + // String is variable length, but must be size of the container + // char mURLAddress[1]; +}; + +// Structure to describe request TLV 0x01 for LOCDeleteAssistData() +struct sLOCDeleteAssistDataRequest_DeleteAll +{ + INT8 mDeleteAll; +}; + +// Structure to describe request TLV 0x10 for LOCDeleteAssistData() +struct sLOCDeleteAssistDataRequest_DeleteSatelliteInfo +{ + UINT8 mSatelliteInfoCount; + + struct sSatelliteInfo + { + UINT16 mGNSSSatelliteID; + eQMILOCSystem mSystem; + bool mDeleteEphemeris:1; + bool mDeleteAlmanac:1; + + // Padding out 6 bits + UINT8 mReserved1:6; + }; + + // This array must be the size specified by mSatelliteInfoCount + // sSatelliteInfo mSatelliteInfos[1]; +}; + +// Structure to describe request TLV 0x11 for LOCDeleteAssistData() +struct sLOCDeleteAssistDataRequest_DeleteGNSData +{ + bool mDeleteGPSSatelliteDirectory:1; + bool mDeleteGPSSatelliteSteering:1; + bool mDeleteGPSTime:1; + bool mDeleteGPSAlmanacCorrection:1; + bool mDeleteGLOSatelliteDirectory:1; + bool mDeleteGLOSatelliteSteering:1; + bool mDeleteGLOTime:1; + bool mDeleteGLOAlmanacCorrection:1; + bool mDeleteSBASSatelliteDirectory:1; + bool mDeleteSBASSatelliteSteering:1; + bool mDeletePosition:1; + bool mDeleteTime:1; + bool mDeleteIONO:1; + bool mDeleteUTCTimestamp:1; + bool mDeleteHealth:1; + bool mDeleteSAData:1; + bool mDeleteRTI:1; + bool mDeleteSatelliteNoExist:1; + bool mDeleteFrequencyBiasEstimate:1; + + // Padding out 45 bits + UINT8 mReserved1:5; + UINT8 mReserved2[5]; +}; + +// Structure to describe request TLV 0x12 for LOCDeleteAssistData() +struct sLOCDeleteAssistDataRequest_DeleteCellDatabase +{ + bool mDeletePosition:1; + bool mDeleteLatestGPSPosition:1; + bool mDeleteOTAPosition:1; + bool mDeleteEXTReferencePosition:1; + bool mDeleteTimeTag:1; + bool mDeleteCellID:1; + bool mDeleteCachedCellID:1; + bool mDeleteLastServerCell:1; + bool mDeleteCurrentServerCell:1; + bool mDeleteNeighborInfo:1; + + // Padding out 22 bits + UINT8 mReserved1:6; + UINT8 mReserved2[2]; +}; + +// Structure to describe request TLV 0x13 for LOCDeleteAssistData() +struct sLOCDeleteAssistDataRequest_DeleteClockInfo +{ + bool mDeleteTimeEstimate:1; + bool mDeleteFrequencyEstimate:1; + bool mDeleteWeekNumber:1; + bool mDeleteRTCTime:1; + bool mDeleteTimeTransfer:1; + bool mDeleteGPSTimeEstimate:1; + bool mDeleteGLOTimeEstimate:1; + bool mDeleteGLODayNumber:1; + bool mDeleteGLOYearNumber:1; + bool mDeleteGLORFGroupDelay:1; + bool mDeleteDisableTT:1; + + // Padding out 21 bits + UINT8 mReserved1:5; + UINT8 mReserved2[2]; +}; + +// Structure to describe request TLV 0x01 for LOCSetXTRATSessionControl() +struct sLOCSetXTRATSessionControlRequest_EnableXTRAT +{ + INT8 mEnableXTRAT; +}; + +// Structure to describe indication TLV 0x10 for LOC GetXTRATSessionControlIndication +struct sLOCGetXTRATSessionControlIndication_EnableXTRAT +{ + INT8 mEnableXTRAT; +}; + +// Structure to describe request TLV 0x10 for LOCInjectWiFiPosition() +struct sLOCInjectWiFiPositionRequest_Time +{ + UINT32 mWiFiPositionTime; +}; + +// Structure to describe request TLV 0x11 for LOCInjectWiFiPosition() +struct sLOCInjectWiFiPositionRequest_WiFiPosition +{ + double mLatitudeDegrees; + double mLongitudeDegrees; + UINT16 mHEPEMeters; + UINT8 mNumberOfAccessPointsUsed; + eQMILOCWiFiFixErrorCode mFixErrorCode; +}; + +// Structure to describe request TLV 0x12 for LOCInjectWiFiPosition() +struct sLOCInjectWiFiPositionRequest_AccessPointInformation +{ + UINT8 mNumberOfAccessPoints; + + struct sAccessPointInfo + { + UINT8 mMACAddress[6]; + INT32 mRSSIdBm; + UINT16 mChannel; + bool mBeingUsed:1; + bool mHiddenSSID:1; + bool mPrivate:1; + bool mInfrastructureMode:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + }; + + // This array must be the size specified by mNumberOfAccessPoints + // sAccessPointInfo mAccessPointInfos[1]; +}; + +// Structure to describe request TLV 0x13 for LOCInjectWiFiPosition() +struct sLOCInjectWiFiPositionRequest_HorizontalReliability +{ + eQMILOCReliability mHorizontalReliability; +}; + +// Structure to describe request TLV 0x01 for LOCProvideWiFiStatus() +struct sLOCProvideWiFiStatusRequest_WiFiStatus +{ + eQMILOCWiFiStatus mWiFiStatus; +}; + +// Structure to describe indication TLV 0x10 for LOC GetRegisteredEventsIndication +struct sLOCGetRegisteredEventsIndication_RegistrationMask +{ + bool mPositionReport:1; + bool mGNSSSatelliteInfo:1; + bool mNMEA:1; + bool mNINotifyVerifyRequest:1; + bool mInjectTimeRequest:1; + bool mInjectPredictedOrbitsRequest:1; + bool mInjectPositionRequest:1; + bool mEngineState:1; + bool mFixSessionState:1; + bool mWiFiRequest:1; + bool mSensorStreamingReadyStatus:1; + bool mTimeSyncRequest:1; + bool mSetSPIStreamingReport:1; + bool mLocationServerConnectionRequest:1; + + // Padding out 50 bits + UINT8 mReserved1:2; + UINT8 mReserved2[6]; +}; + +// Structure to describe request TLV 0x01 for LOCSetOperationMode() +struct sLOCSetOperationModeRequest_OperationMode +{ + eQMILOCOperationMode mOperationMode; +}; + +// Structure to describe indication TLV 0x10 for LOC GetOperationModeIndication +struct sLOCGetOperationModeIndication_OperationMode +{ + eQMILOCOperationMode mOperationMode; +}; + +// Structure to describe request TLV 0x01 for LOCSetSPIStatus() +struct sLOCSetSPIStatusRequest_StationaryStatus +{ + INT8 mDeviceIsStationary; +}; + +// Structure to describe request TLV 0x10 for LOCSetSPIStatus() +struct sLOCSetSPIStatusRequest_Confidence +{ + UINT8 mStationaryConfidence; +}; + +// Structure to describe request TLV 0x10 for LOCInjectSensorData() +struct sLOCInjectSensorDataRequest_OpaqueIdentifier +{ + UINT32 mOpaqueIdentifier; +}; + +// Structure to describe request TLV 0x11 for LOCInjectSensorData() +struct sLOCInjectSensorDataRequest_AccelerometerData +{ + UINT32 mTimeOfFirstSampleMilliseconds; + bool mSignReversal:1; + + // Padding out 7 bits + UINT8 mReserved1:7; + + UINT8 mSensorDataLength; + + struct sSensorData + { + UINT16 mTimeOffsetMilliseconds; + float mXAxis; + float mYAxis; + float mZAxis; + }; + + // This array must be the size specified by mSensorDataLength + // sSensorData mSensorDatas[1]; +}; + +// Structure to describe request TLV 0x12 for LOCInjectSensorData() +struct sLOCInjectSensorDataRequest_GyrometerData +{ + UINT32 mTimeOfFirstSampleMilliseconds; + bool mSignReversal:1; + + // Padding out 7 bits + UINT8 mReserved1:7; + + UINT8 mSensorDataLength; + + struct sSensorData + { + UINT16 mTimeOffsetMilliseconds; + float mXAxis; + float mYAxis; + float mZAxis; + }; + + // This array must be the size specified by mSensorDataLength + // sSensorData mSensorDatas[1]; +}; + +// Structure to describe indication TLV 0x10 for LOC InjectSensorDataIndication +struct sLOCInjectSensorDataIndication_OpaqueIdentifier +{ + UINT32 mOpaqueIdentifier; +}; + +// Structure to describe indication TLV 0x11 for LOC InjectSensorDataIndication +struct sLOCInjectSensorDataIndication_AccelerometerSampleAccepted +{ + INT8 mAccelerometerSampleAccepted; +}; + +// Structure to describe indication TLV 0x12 for LOC InjectSensorDataIndication +struct sLOCInjectSensorDataIndication_GyrometerSamplesAccepted +{ + INT8 mGyrometerSamplesAccepted; +}; + +// Structure to describe request TLV 0x01 for LOCInjectTimeSyncData() +struct sLOCInjectTimeSyncDataRequest_ReferenceCounter +{ + UINT32 mReferenceCounter; +}; + +// Structure to describe request TLV 0x03 for LOCInjectTimeSyncData() +struct sLOCInjectTimeSyncDataRequest_SensorTransmitTime +{ + UINT32 mProcessTXTimeMilliseconds; +}; + +// Structure to describe request TLV 0x01 for LOCSetCradleMountConfig() +struct sLOCSetCradleMountConfigRequest_State +{ + eQMILOCCradleMountState mCradleMountState; +}; + +// Structure to describe request TLV 0x10 for LOCSetCradleMountConfig() +struct sLOCSetCradleMountConfigRequest_Confidence +{ + UINT8 mCradleMountConfidence; +}; + +// Structure to describe indication TLV 0x10 for LOC GetCradleMountConfigIndication +struct sLOCGetCradleMountConfigIndication_State +{ + eQMILOCCradleMountState mCradleMountState; +}; + +// Structure to describe indication TLV 0x11 for LOC GetCradleMountConfigIndication +struct sLOCGetCradleMountConfigIndication_Confidence +{ + UINT8 mCradleMountConfidence; +}; + +// Structure to describe request TLV 0x01 for LOCSetExternalPowerConfig() +struct sLOCSetExternalPowerConfigRequest_PowerState +{ + eQMILOCPowerState mPowerState; +}; + +// Structure to describe indication TLV 0x10 for LOC GetExternalPowerConfigIndication +struct sLOCGetExternalPowerConfigIndication_PowerState +{ + eQMILOCPowerState mPowerState; +}; + +// Structure to describe request TLV 0x01 for LOCProvideConnectionStatus() +struct sLOCProvideConnectionStatusRequest_ConnectionHandle +{ + UINT32 mConnectionHandle; +}; + +// Structure to describe request TLV 0x03 for LOCProvideConnectionStatus() +struct sLOCProvideConnectionStatusRequest_ConnectionStatus +{ + eQMILOCConnectionStatus mConnectionStatus; +}; + +// Structure to describe request TLV 0x10 for LOCProvideConnectionStatus() +struct sLOCProvideConnectionStatusRequest_APNProfile +{ + eQMILOCPDNType mPDNType; + UINT8 mAPNNameLength; + + // This array must be the size specified by mAPNNameLength + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0x10 for LOCSetProtocolConfigParameters() +struct sLOCSetProtocolConfigParametersRequest_SUPLSecurity +{ + INT8 mSUPLSecurityEnabled; +}; + +// Structure to describe request TLV 0x11 for LOCSetProtocolConfigParameters() +struct sLOCSetProtocolConfigParametersRequest_VXVersion +{ + eQMILOCVXVersion mVXVersion; +}; + +// Structure to describe request TLV 0x12 for LOCSetProtocolConfigParameters() +struct sLOCSetProtocolConfigParametersRequest_SUPLVersion +{ + eQMILOCSUPLVersion mSUPLVersion; +}; + +// Structure to describe indication TLV 0x10 for LOC SetProtocolConfigParametersIndication +struct sLOCSetProtocolConfigParametersIndication_FailedParameters +{ + bool mSUPLSecurity:1; + bool mVXVersion:1; + bool mSUPLVersion:1; + + // Padding out 61 bits + UINT8 mReserved1:5; + UINT8 mReserved2[7]; +}; + +// Structure to describe request TLV 0x01 for LOCGetProtocolConfigParameters() +struct sLOCGetProtocolConfigParametersRequest_ConfigParameters +{ + bool mSUPLSecurity:1; + bool mVXVersion:1; + bool mSUPLVersion:1; + + // Padding out 61 bits + UINT8 mReserved1:5; + UINT8 mReserved2[7]; +}; + +// Structure to describe indication TLV 0x10 for LOC GetProtocolConfigParametersIndication +struct sLOCGetProtocolConfigParametersIndication_SUPLSecurity +{ + INT8 mSUPLSecurityEnabled; +}; + +// Structure to describe indication TLV 0x11 for LOC GetProtocolConfigParametersIndication +struct sLOCGetProtocolConfigParametersIndication_VXVersion +{ + eQMILOCVXVersion mVXVersion; +}; + +// Structure to describe indication TLV 0x12 for LOC GetProtocolConfigParametersIndication +struct sLOCGetProtocolConfigParametersIndication_SUPLVersion +{ + eQMILOCSUPLVersion mSUPLVersion; +}; + +// Structure to describe request TLV 0x10 for LOCSetSensorControlConfig() +struct sLOCSetSensorControlConfigRequest_SensorUsage +{ + eQMILOCSensorUsage mSensorUsage; +}; + +// Structure to describe indication TLV 0x10 for LOC GetSensorControlConfigIndication +struct sLOCGetSensorControlConfigIndication_SensorUsage +{ + eQMILOCSensorUsage mSensorUsage; +}; + +// Structure to describe request TLV 0x10 for LOCSetSensorProperties() +struct sLOCSetSensorPropertiesRequest_GyroBiasVariance +{ + float mGyroBiasVariance; +}; + +// Structure to describe indication TLV 0x10 for LOC GetSensorPropertiesIndication +struct sLOCGetSensorPropertiesIndication_GyroBiasVariance +{ + float mGyroBiasVariance; +}; + +// Structure to describe request TLV 0x10 for LOCSetSensorPerformanceConfig() +struct sLOCSetSensorPerformanceConfigRequest_ControlMode +{ + eQMILOCControlMode mControlMode; +}; + +// Structure to describe request TLV 0x11 for LOCSetSensorPerformanceConfig() +struct sLOCSetSensorPerformanceConfigRequest_AccelerometerSampling +{ + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe request TLV 0x12 for LOCSetSensorPerformanceConfig() +struct sLOCSetSensorPerformanceConfigRequest_GyrometerSampling +{ + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe indication TLV 0x10 for LOC SetSensorPerformanceConfigIndication +struct sLOCSetSensorPerformanceConfigIndication_FailedConfiguration +{ + bool mPerformanceMode:1; + bool mAccelerometerSampling:1; + bool mGyrometerSampling:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x10 for LOC GetSensorPerformanceConfigIndication +struct sLOCGetSensorPerformanceConfigIndication_ControlMode +{ + eQMILOCControlMode mControlMode; +}; + +// Structure to describe indication TLV 0x11 for LOC GetSensorPerformanceConfigIndication +struct sLOCGetSensorPerformanceConfigIndication_AccelerometerSampling +{ + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe indication TLV 0x12 for LOC GetSensorPerformanceConfigIndication +struct sLOCGetSensorPerformanceConfigIndication_GyrometerSampling +{ + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe request TLV 0x10 for CATSetEventReport() +struct sCATSetEventReportRequest_ReportMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + bool mRefresh:1; + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + bool mSetupEventBrowserTermination:1; + bool mProvideLocalInformationTime:1; + + // Padding out 9 bits + UINT8 mReserved1:1; + UINT8 mReserved2; +}; + +// Structure to describe request TLV 0x11 for CATSetEventReport() +struct sCATSetEventReportRequest_DecodeReportMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mSCWSEvent:1; + + // Padding out 8 bits + UINT8 mReserved3; +}; + +// Structure to describe request TLV 0x12 for CATSetEventReport() +struct sCATSetEventReportRequest_Slot +{ + bool mSlot1:1; + bool mSlot2:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x10 for CATSetEventReport() +struct sCATSetEventReportResponse_RegStatusMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + bool mRefresh:1; + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + bool mSetupEventBrowserTermination:1; + bool mProvideLocalInformationTime:1; + + // Padding out 9 bits + UINT8 mReserved1:1; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x11 for CATSetEventReport() +struct sCATSetEventReportResponse_DecodedRegStatusMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mSCWSEvent:1; + + // Padding out 8 bits + UINT8 mReserved3; +}; + +// Structure to describe indication TLV 0x10 for CAT EventReport +struct sCATEventReportIndication_DisplayTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mDisplayTextCommand[1]; +}; + +// Structure to describe indication TLV 0x11 for CAT EventReport +struct sCATEventReportIndication_GetInkeyEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInkeyCommand[1]; +}; + +// Structure to describe indication TLV 0x12 for CAT EventReport +struct sCATEventReportIndication_GetInputEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInputCommand[1]; +}; + +// Structure to describe indication TLV 0x13 for CAT EventReport +struct sCATEventReportIndication_SetupMenuEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupMenuCommand[1]; +}; + +// Structure to describe indication TLV 0x14 for CAT EventReport +struct sCATEventReportIndication_SelectItemEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSelectItemCommand[1]; +}; + +// Structure to describe indication TLV 0x15 for CAT EventReport +struct sCATEventReportIndication_AlphaIDAvailable +{ + eQMICATAlphaIDCommandType mAlphaIDCommandType; + UINT16 mAlphaIDLength; + + // This array must be the size specified by mAlphaIDLength + // UINT8 mAlphaID[1]; +}; + +// Structure to describe indication TLV 0x16 for CAT EventReport +struct sCATEventReportIndication_SetupEventList +{ + bool mUserActivityNotify:1; + bool mIdleScreenAvailable:1; + bool mLanguageSelectionNotify:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x17 for CAT EventReport +struct sCATEventReportIndication_SetupIdleModeTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupIdleModeTextCommand[1]; +}; + +// Structure to describe indication TLV 0x18 for CAT EventReport +struct sCATEventReportIndication_LanguageNotificationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLanguageNotificationCommand[1]; +}; + +// Structure to describe indication TLV 0x19 for CAT EventReport +struct sCATEventReportIndication_RefreshEvent +{ + UINT16 mRefreshMode; + eQMICATRefreshStage mRefreshStage; +}; + +// Structure to describe indication TLV 0x1A for CAT EventReport +struct sCATEventReportIndication_EndProactiveSession +{ + eQMICATProactiveSessionEndType mProactiveSessionEndType; +}; + +// Structure to describe indication TLV 0x1B for CAT EventReport +struct sCATEventReportIndication_DecodedHeaderID +{ + eQMICATCommandID mCommandID; + UINT32 mReferenceID; + UINT8 mCommandNumber; +}; + +// Structure to describe indication TLV 0x1C for CAT EventReport +struct sCATEventReportIndication_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x1D for CAT EventReport +struct sCATEventReportIndication_HighPriority +{ + eQMICATHighPriority mHighPriority; +}; + +// Structure to describe indication TLV 0x1E for CAT EventReport +struct sCATEventReportIndication_UserControl +{ + eQMICATUserControl mUserControl; +}; + +// Structure to describe indication TLV 0x1F for CAT EventReport +struct sCATEventReportIndication_Icon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x20 for CAT EventReport +struct sCATEventReportIndication_Duration +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe indication TLV 0x21 for CAT EventReport +struct sCATEventReportIndication_ResponseFormat +{ + eQMICATResponseFormat mResponseFormat; +}; + +// Structure to describe indication TLV 0x22 for CAT EventReport +struct sCATEventReportIndication_HelpAvailable +{ + eQMICATHelpAvailable mHelpAvailable; +}; + +// Structure to describe indication TLV 0x23 for CAT EventReport +struct sCATEventReportIndication_ResponsePackingFormat +{ + eQMICATResponsePackingFormat mResponsePackingFormat; +}; + +// Structure to describe indication TLV 0x24 for CAT EventReport +struct sCATEventReportIndication_ResponseLength +{ + UINT8 mMaximumUserInput; + UINT8 mMinimumUserInput; +}; + +// Structure to describe indication TLV 0x25 for CAT EventReport +struct sCATEventReportIndication_ShowUserInput +{ + eQMICATShowUserInput mShowUserInput; +}; + +// Structure to describe indication TLV 0x26 for CAT EventReport +struct sCATEventReportIndication_Tone +{ + eQMICATTone mTone; +}; + +// Structure to describe indication TLV 0x27 for CAT EventReport +struct sCATEventReportIndication_SoftkeySelection +{ + eQMICATSoftkeySelection mSoftkeySelection; +}; + +// Structure to describe indication TLV 0x28 for CAT EventReport +struct sCATEventReportIndication_Items +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe indication TLV 0x29 for CAT EventReport +struct sCATEventReportIndication_DefaultItem +{ + UINT8 mDefaultItem; +}; + +// Structure to describe indication TLV 0x2A for CAT EventReport +struct sCATEventReportIndication_NextActionIdentifier +{ + UINT8 mActionsLength; + + // This array must be the size specified by mActionsLength + // eQMICATNextAction mNextAction[1]; +}; + +// Structure to describe indication TLV 0x2B for CAT EventReport +struct sCATEventReportIndication_IconIDList +{ + eQMICATDisplayIconOnly mDisplayIconOnly; + UINT8 mItemsLength; + + struct sItem + { + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe indication TLV 0x2C for CAT EventReport +struct sCATEventReportIndication_Presentation +{ + eQMICATPresentation mPresentation; +}; + +// Structure to describe indication TLV 0x2D for CAT EventReport +struct sCATEventReportIndication_PackingRequired +{ + eQMICATPackingRequired mPackingRequired; +}; + +// Structure to describe indication TLV 0x2E for CAT EventReport +struct sCATEventReportIndication_SMSTPDU +{ + UINT8 mSMSTPDUDataLength; + + // This array must be the size specified by mSMSTPDUDataLength + // UINT8 mSMSTPDUData[1]; +}; + +// Structure to describe indication TLV 0x2F for CAT EventReport +struct sCATEventReportIndication_IsCDMASMS +{ + eQMICATIsCDMASMS mIsCDMASMS; +}; + +// Structure to describe indication TLV 0x30 for CAT EventReport +struct sCATEventReportIndication_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x31 for CAT EventReport +struct sCATEventReportIndication_CallSetupRequirement +{ + eQMICATCallSetupRequirement mCallSetupRequirement; +}; + +// Structure to describe indication TLV 0x32 for CAT EventReport +struct sCATEventReportIndication_Redial +{ + eQMICATRedialNecessary mRedialNecessary; + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe indication TLV 0x33 for CAT EventReport +struct sCATEventReportIndication_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe indication TLV 0x34 for CAT EventReport +struct sCATEventReportIndication_CapabilitiesConfiguration +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe indication TLV 0x35 for CAT EventReport +struct sCATEventReportIndication_DTMF +{ + UINT8 mDTMFDataLength; + + struct sDTMFData + { + UINT8 mDTMFData1:4; + UINT8 mDTMFData2:4; + }; + + // This array must be the size specified by mDTMFDataLength + // sDTMFData mDTMFDatas[1]; +}; + +// Structure to describe indication TLV 0x36 for CAT EventReport +struct sCATEventReportIndication_SpecificLanguageNotification +{ + eQMICATSpecificLanguageNotfication mSpecificLanguageNotification; +}; + +// Structure to describe indication TLV 0x37 for CAT EventReport +struct sCATEventReportIndication_Language +{ + char mLanguage[2]; +}; + +// Structure to describe indication TLV 0x38 for CAT EventReport +struct sCATEventReportIndication_LaunchMode +{ + eQMICATLaunchMode mLaunchMode; +}; + +// Structure to describe indication TLV 0x39 for CAT EventReport +struct sCATEventReportIndication_URL +{ + UINT8 mURLDataLength; + + // This array must be the size specified by mURLDataLength + // char mURLData[1]; +}; + +// Structure to describe indication TLV 0x3A for CAT EventReport +struct sCATEventReportIndication_BrowserID +{ + UINT8 mBrowserID; +}; + +// Structure to describe indication TLV 0x3B for CAT EventReport +struct sCATEventReportIndication_BearerList +{ + UINT8 mBearerListLength; + + // This array must be the size specified by mBearerListLength + // eQMICATBearer mBearerList[1]; +}; + +// Structure to describe indication TLV 0x3C for CAT EventReport +struct sCATEventReportIndication_ProvisioningFile +{ + UINT32 mNumberOfProvisioningFiles; + + struct sFile + { + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // char mPath[1]; + }; + + // This array must be the size specified by mNumberOfProvisioningFiles + // sFile mFiles[1]; +}; + +// Structure to describe indication TLV 0x3D for CAT EventReport +struct sCATEventReportIndication_USSDString +{ + eQMICATUSSDDataCodingScheme mOriginalDataCodingScheme; + eQMICATUSSDDataCodingScheme mDataCodingScheme; + UINT8 mUSSDTextLength; + + // This array must be the size specified by mUSSDTextLength + // UINT8 mUSSDText[1]; +}; + +// Structure to describe indication TLV 0x3E for CAT EventReport +struct sCATEventReportIndication_DefaultText +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x3F for CAT EventReport +struct sCATEventReportIndication_ImmediateResponseRequired +{ + eQMICATImmediateResponse mImmediateResponse; +}; + +// Structure to describe indication TLV 0x40 for CAT EventReport +struct sCATEventReportIndication_UserConfirmationAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x41 for CAT EventReport +struct sCATEventReportIndication_SetupCallDisplayAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x42 for CAT EventReport +struct sCATEventReportIndication_UserConfirmationIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x43 for CAT EventReport +struct sCATEventReportIndication_SetupCallDisplayIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x44 for CAT EventReport +struct sCATEventReportIndication_GatewayProxy +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x45 for CAT EventReport +struct sCATEventReportIndication_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x46 for CAT EventReport +struct sCATEventReportIndication_NotificationRequired +{ + eQMICATNotificationRequired mNotificationRequired; +}; + +// Structure to describe indication TLV 0x47 for CAT EventReport +struct sCATEventReportIndication_PlayToneEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mPlayToneCommand[1]; +}; + +// Structure to describe indication TLV 0x48 for CAT EventReport +struct sCATEventReportIndication_SetupCallEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupCallCommand[1]; +}; + +// Structure to describe indication TLV 0x49 for CAT EventReport +struct sCATEventReportIndication_SendDTMFEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDTMFCommand[1]; +}; + +// Structure to describe indication TLV 0x4A for CAT EventReport +struct sCATEventReportIndication_LaunchBrowserEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLaunchBrowserCommand[1]; +}; + +// Structure to describe indication TLV 0x4B for CAT EventReport +struct sCATEventReportIndication_SendSMSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSMSCommand[1]; +}; + +// Structure to describe indication TLV 0x4C for CAT EventReport +struct sCATEventReportIndication_SendSSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSSCommand[1]; +}; + +// Structure to describe indication TLV 0x4D for CAT EventReport +struct sCATEventReportIndication_SendUSSDEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendUSSDCommand[1]; +}; + +// Structure to describe indication TLV 0x4E for CAT EventReport +struct sCATEventReportIndication_ProvideLocalInformationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mProvideLocalInformationCommand[1]; +}; + +// Structure to describe indication TLV 0x4F for CAT EventReport +struct sCATEventReportIndication_SetupRawEventList +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupEventListCommand[1]; +}; + +// Structure to describe indication TLV 0x50 for CAT EventReport +struct sCATEventReportIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x51 for CAT EventReport +struct sCATEventReportIndication_OpenChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mOpenChannelCommand[1]; +}; + +// Structure to describe indication TLV 0x52 for CAT EventReport +struct sCATEventReportIndication_CloseChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mCloseChannelCommand[1]; +}; + +// Structure to describe indication TLV 0x53 for CAT EventReport +struct sCATEventReportIndication_SendDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDataCommand[1]; +}; + +// Structure to describe indication TLV 0x54 for CAT EventReport +struct sCATEventReportIndication_ReceiveDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mReceiveDataCommand[1]; +}; + +// Structure to describe indication TLV 0x55 for CAT EventReport +struct sCATEventReportIndication_OnDemmandLinkEstablish +{ + eQMICATOnDemandLinkEstablish mOnDemandLinkEstablish; +}; + +// Structure to describe indication TLV 0x56 for CAT EventReport +struct sCATEventReportIndication_CSDBearerDescription +{ + UINT8 mSpeed; + eQMICATCSDBearerName mCSDBearerName; + eQMICATConnectionElement mConnectionElement; +}; + +// Structure to describe indication TLV 0x57 for CAT EventReport +struct sCATEventReportIndication_GPRSBearerDescription +{ + UINT8 mPrecedenceClass; + UINT8 mDelayClass; + UINT8 mReliabilityClass; + UINT8 mPeakThroughput; + UINT8 mMeanThroughput; + eQMICATPacketDataProtocol mPacketDataProtocol; +}; + +// Structure to describe indication TLV 0x58 for CAT EventReport +struct sCATEventReportIndication_EUTRANExternalParameterBearerDescription +{ + eQMICATTrafficClass mTrafficClass; + UINT16 mMaxUploadBitrate; + UINT16 mMaxDownloadBitrate; + UINT16 mGuaranteedUploadBitrate; + UINT16 mGuaranteedDownloadBitrate; + eQMICATDeliveryOrder mDeliveryOrder; + UINT8 mMaxSDUSize; + UINT8 mMaxSDUErrorRatio; + UINT8 mResidualBitErrorRatio; + eQMICATDeliverErrorSDU mDeliverErrorSDU; + UINT8 mTransferDelay; + UINT8 mTrafficHandlingPRI; + eQMICATPDPType mPDPType; +}; + +// Structure to describe indication TLV 0x59 for CAT EventReport +struct sCATEventReportIndication_EUTRANExternalMappedUTRANBearerDescription +{ + UINT8 mQCI; + UINT8 mMaxUploadBitrate; + UINT8 mMaxDownloadBitrate; + UINT8 mGuaranteedUploadBitrate; + UINT8 mGuaranteedDownloadBitrate; + UINT8 mMaximumUploadBitrateExt; + UINT8 mMaximumDownloadBitrateExt; + UINT8 mGuaranteedUploadBitrateExt; + UINT8 mGuaranteedDownloadBitrateExt; + eQMICATPDPType mPDPType; +}; + +// Structure to describe indication TLV 0x5A for CAT EventReport +struct sCATEventReportIndication_BufferSize +{ + UINT16 mBufferSize; +}; + +// Structure to describe indication TLV 0x5B for CAT EventReport +struct sCATEventReportIndication_NetworkAccessName +{ + UINT8 mNetworkAccessNameLength; + + // This array must be the size specified by mNetworkAccessNameLength + // UINT8 mNetworkAccessName[1]; +}; + +// Structure to describe indication TLV 0x5C for CAT EventReport +struct sCATEventReportIndication_OtherAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x5D for CAT EventReport +struct sCATEventReportIndication_UserLogin +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x5E for CAT EventReport +struct sCATEventReportIndication_UserPassword +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x5F for CAT EventReport +struct sCATEventReportIndication_TransportLevel +{ + eQMICATTransportProtocol mTransportProtocol; + UINT16 mPortNumber; +}; + +// Structure to describe indication TLV 0x60 for CAT EventReport +struct sCATEventReportIndication_DataDestinationAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x61 for CAT EventReport +struct sCATEventReportIndication_ChannelDataLength +{ + UINT8 mChannelDataLength; +}; + +// Structure to describe indication TLV 0x62 for CAT EventReport +struct sCATEventReportIndication_SendDataImmediately +{ + eQMICATSendDataImmediately mSendDataImmediately; +}; + +// Structure to describe indication TLV 0x63 for CAT EventReport +struct sCATEventReportIndication_ChannelData +{ + UINT16 mChannelDataLength; + + // This array must be the size specified by mChannelDataLength + // UINT8 mChannelData[1]; +}; + +// Structure to describe indication TLV 0x64 for CAT EventReport +struct sCATEventReportIndication_ChannelID +{ + UINT8 mChannelID; +}; + +// Structure to describe response TLV 0x01 for CATGetServiceState() +struct sCATGetServiceStateResponse_CATServiceState +{ + bool mCommonDisplayText:1; + bool mCommonGetInkey:1; + bool mCommonGetInput:1; + bool mCommonSetupMenu:1; + bool mCommonSelectItem:1; + bool mCommonSendSMSAlphaIdentifier:1; + bool mCommonSetupEventUserActivity:1; + bool mCommonSetupEventIdleScreenNotify:1; + bool mCommonSetupEventLanguageSelNotify:1; + bool mCommonSetupIdleModeText:1; + bool mCommonLanguageNotification:1; + bool mCommonRefresh:1; + bool mCommonEndProactiveSession:1; + bool mCommonPlayTone:1; + bool mCommonSetupCall:1; + bool mCommonSendDTMF:1; + bool mCommonLaunchBrowser:1; + bool mCommonSendSS:1; + bool mCommonSendUSSD:1; + bool mCommonProvideLocalInformationLanguage:1; + bool mCommonBearerIndependentProtocol:1; + bool mCommonSetupEventBrowserTermination:1; + bool mCommonProvideLocalInformationTime:1; + + // Padding out 9 bits + UINT8 mReserved1:1; + UINT8 mReserved2; + + bool mControlDisplayText:1; + bool mControlGetInkey:1; + bool mControlGetInput:1; + bool mControlSetupMenu:1; + bool mControlSelectItem:1; + bool mControlSendSMSAlphaIdentifier:1; + bool mControlSetupEventUserActivity:1; + bool mControlSetupEventIdleScreenNotify:1; + bool mControlSetupEventLanguageSelNotify:1; + bool mControlSetupIdleModeText:1; + bool mControlLanguageNotification:1; + bool mControlRefresh:1; + bool mControlEndProactiveSession:1; + bool mControlPlayTone:1; + bool mControlSetupCall:1; + bool mControlSendDTMF:1; + bool mControlLaunchBrowser:1; + bool mControlSendSS:1; + bool mControlSendUSSD:1; + bool mControlProvideLocalInformationLanguage:1; + bool mControlBearerIndependentProtocol:1; + bool mControlSetupEventBrowserTermination:1; + bool mControlProvideLocalInformationTime:1; + + // Padding out 9 bits + UINT8 mReserved3:1; + UINT8 mReserved4; +}; + +// Structure to describe response TLV 0x10 for CATGetServiceState() +struct sCATGetServiceStateResponse_DecodedCATServiceState +{ + bool mCommonDisplayText:1; + bool mCommonGetInkey:1; + bool mCommonGetInput:1; + bool mCommonSetupMenu:1; + bool mCommonSelectItem:1; + bool mCommonSendSMSAlphaIdentifier:1; + bool mCommonSetupEventUserActivity:1; + bool mCommonSetupEventIdleScreenNotify:1; + bool mCommonSetupEventLanguageSelNotify:1; + bool mCommonSetupIdleModeText:1; + bool mCommonLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mCommonEndProactiveSession:1; + bool mCommonPlayTone:1; + bool mCommonSetupCall:1; + bool mCommonSendDTMF:1; + bool mCommonLaunchBrowser:1; + bool mCommonSendSS:1; + bool mCommonSendUSSD:1; + bool mCommonProvideLocalInformationLanguage:1; + bool mCommonBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mCommonSCWSEvent:1; + + // Padding out 8 bits + UINT8 mReserved3; + + bool mControlDisplayText:1; + bool mControlGetInkey:1; + bool mControlGetInput:1; + bool mControlSetupMenu:1; + bool mControlSelectItem:1; + bool mControlSendSMSAlphaIdentifier:1; + bool mControlSetupEventUserActivity:1; + bool mControlSetupEventIdleScreenNotify:1; + bool mControlSetupEventLanguageSelNotify:1; + bool mControlSetupIdleModeText:1; + bool mControlLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved4:1; + + bool mControlEndProactiveSession:1; + bool mControlPlayTone:1; + bool mControlSetupCall:1; + bool mControlSendDTMF:1; + bool mControlLaunchBrowser:1; + bool mControlSendSS:1; + bool mControlSendUSSD:1; + bool mControlProvideLocalInformationLanguage:1; + bool mControlBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved5:2; + + bool mControlSCWSEvent:1; + + // Padding out 8 bits + UINT8 mReserved6; +}; + +// Structure to describe request TLV 0x01 for CATSendTerminalResponse() +struct sCATSendTerminalResponseRequest_TerminalResponseType +{ + UINT32 mReferenceID; + UINT16 mTerminalResponseLength; + + // This array must be the size specified by mTerminalResponseLength + // UINT8 mTerminalResponse[1]; +}; + +// Structure to describe request TLV 0x10 for CATSendTerminalResponse() +struct sCATSendTerminalResponseRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATEnvelopeCommand() +struct sCATEnvelopeCommandRequest_EnvelopeCommand +{ + eQMICATEnvelopeCommandType mEnvelopeCommandType; + UINT16 mEnvelopeLength; + + // This array must be the size specified by mEnvelopeLength + // UINT8 mEnvelopeData[1]; +}; + +// Structure to describe request TLV 0x10 for CATEnvelopeCommand() +struct sCATEnvelopeCommandRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATGetEventReport() +struct sCATGetEventReportRequest_CommandInput +{ + UINT32 mCommandID; + eQMICATCommandFormat mCommandFormat; +}; + +// Structure to describe response TLV 0x10 for CATGetEventReport() +struct sCATGetEventReportResponse_DisplayTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mDisplayTextCommand[1]; +}; + +// Structure to describe response TLV 0x11 for CATGetEventReport() +struct sCATGetEventReportResponse_GetInkeyEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInkeyCommand[1]; +}; + +// Structure to describe response TLV 0x12 for CATGetEventReport() +struct sCATGetEventReportResponse_GetInputEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInputCommand[1]; +}; + +// Structure to describe response TLV 0x13 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupMenuEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupMenuCommand[1]; +}; + +// Structure to describe response TLV 0x14 for CATGetEventReport() +struct sCATGetEventReportResponse_SelectItemEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSelectItemCommand[1]; +}; + +// Structure to describe response TLV 0x15 for CATGetEventReport() +struct sCATGetEventReportResponse_AlphaIDAvailable +{ + eQMICATAlphaIDCommandType mAlphaIDCommandType; + UINT16 mAlphaIDLength; + + // This array must be the size specified by mAlphaIDLength + // UINT8 mAlphaID[1]; +}; + +// Structure to describe response TLV 0x16 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupEventList +{ + bool mUserActivityNotify:1; + bool mIdleScreenAvailable:1; + bool mLanguageSelectionNotify:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x17 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupIdleModeTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupIdleModeTextCommand[1]; +}; + +// Structure to describe response TLV 0x18 for CATGetEventReport() +struct sCATGetEventReportResponse_LanguageNotificationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLanguageNotificationCommand[1]; +}; + +// Structure to describe response TLV 0x19 for CATGetEventReport() +struct sCATGetEventReportResponse_RefreshEvent +{ + UINT16 mRefreshMode; + eQMICATRefreshStage mRefreshStage; +}; + +// Structure to describe response TLV 0x1A for CATGetEventReport() +struct sCATGetEventReportResponse_EndProactiveSession +{ + eQMICATProactiveSessionEndType mProactiveSessionEndType; +}; + +// Structure to describe response TLV 0x1B for CATGetEventReport() +struct sCATGetEventReportResponse_DecodedHeaderID +{ + eQMICATCommandID mCommandID; + UINT32 mReferenceID; + UINT8 mCommandNumber; +}; + +// Structure to describe response TLV 0x1C for CATGetEventReport() +struct sCATGetEventReportResponse_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x1D for CATGetEventReport() +struct sCATGetEventReportResponse_HighPriority +{ + eQMICATHighPriority mHighPriority; +}; + +// Structure to describe response TLV 0x1E for CATGetEventReport() +struct sCATGetEventReportResponse_UserControl +{ + eQMICATUserControl mUserControl; +}; + +// Structure to describe response TLV 0x1F for CATGetEventReport() +struct sCATGetEventReportResponse_Icon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x20 for CATGetEventReport() +struct sCATGetEventReportResponse_Duration +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe response TLV 0x21 for CATGetEventReport() +struct sCATGetEventReportResponse_ResponseFormat +{ + eQMICATResponseFormat mResponseFormat; +}; + +// Structure to describe response TLV 0x22 for CATGetEventReport() +struct sCATGetEventReportResponse_HelpAvailable +{ + eQMICATHelpAvailable mHelpAvailable; +}; + +// Structure to describe response TLV 0x23 for CATGetEventReport() +struct sCATGetEventReportResponse_ResponsePackingFormat +{ + eQMICATResponsePackingFormat mResponsePackingFormat; +}; + +// Structure to describe response TLV 0x24 for CATGetEventReport() +struct sCATGetEventReportResponse_ResponseLength +{ + UINT8 mMaximumUserInput; + UINT8 mMinimumUserInput; +}; + +// Structure to describe response TLV 0x25 for CATGetEventReport() +struct sCATGetEventReportResponse_ShowUserInput +{ + eQMICATShowUserInput mShowUserInput; +}; + +// Structure to describe response TLV 0x26 for CATGetEventReport() +struct sCATGetEventReportResponse_Tone +{ + eQMICATTone mTone; +}; + +// Structure to describe response TLV 0x27 for CATGetEventReport() +struct sCATGetEventReportResponse_SoftkeySelection +{ + eQMICATSoftkeySelection mSoftkeySelection; +}; + +// Structure to describe response TLV 0x28 for CATGetEventReport() +struct sCATGetEventReportResponse_Items +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe response TLV 0x29 for CATGetEventReport() +struct sCATGetEventReportResponse_DefaultItems +{ + UINT8 mDefaultItem; +}; + +// Structure to describe response TLV 0x2A for CATGetEventReport() +struct sCATGetEventReportResponse_NextActionIdentifier +{ + UINT8 mActionsLength; + + // This array must be the size specified by mActionsLength + // eQMICATNextAction mNextAction[1]; +}; + +// Structure to describe response TLV 0x2B for CATGetEventReport() +struct sCATGetEventReportResponse_IconIDList +{ + eQMICATDisplayIconOnly mDisplayIconOnly; + UINT8 mItemsLength; + + struct sItem + { + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe response TLV 0x2C for CATGetEventReport() +struct sCATGetEventReportResponse_Presentation +{ + eQMICATPresentation mPresentation; +}; + +// Structure to describe response TLV 0x2D for CATGetEventReport() +struct sCATGetEventReportResponse_PackingRequired +{ + eQMICATPackingRequired mPackingRequired; +}; + +// Structure to describe response TLV 0x2E for CATGetEventReport() +struct sCATGetEventReportResponse_SMSTPDU +{ + UINT8 mSMSTPDUDataLength; + + // This array must be the size specified by mSMSTPDUDataLength + // UINT8 mSMSTPDUData[1]; +}; + +// Structure to describe response TLV 0x2F for CATGetEventReport() +struct sCATGetEventReportResponse_IsCDMASMS +{ + eQMICATIsCDMASMS mIsCDMASMS; +}; + +// Structure to describe response TLV 0x30 for CATGetEventReport() +struct sCATGetEventReportResponse_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x31 for CATGetEventReport() +struct sCATGetEventReportResponse_CallSetupRequirement +{ + eQMICATCallSetupRequirement mCallSetupRequirement; +}; + +// Structure to describe response TLV 0x32 for CATGetEventReport() +struct sCATGetEventReportResponse_Redial +{ + eQMICATRedialNecessary mRedialNecessary; + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe response TLV 0x33 for CATGetEventReport() +struct sCATGetEventReportResponse_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe response TLV 0x34 for CATGetEventReport() +struct sCATGetEventReportResponse_CapabilityConfiguration +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x35 for CATGetEventReport() +struct sCATGetEventReportResponse_DTMF +{ + UINT8 mDTMFDataLength; + + struct sDTMFData + { + UINT8 mDTMFData1:4; + UINT8 mDTMFData2:4; + }; + + // This array must be the size specified by mDTMFDataLength + // sDTMFData mDTMFDatas[1]; +}; + +// Structure to describe response TLV 0x36 for CATGetEventReport() +struct sCATGetEventReportResponse_SpecificLanguageNotification +{ + eQMICATSpecificLanguageNotfication mSpecificLanguageNotification; +}; + +// Structure to describe response TLV 0x37 for CATGetEventReport() +struct sCATGetEventReportResponse_Language +{ + char mLanguage[2]; +}; + +// Structure to describe response TLV 0x38 for CATGetEventReport() +struct sCATGetEventReportResponse_LaunchMode +{ + eQMICATLaunchMode mLaunchMode; +}; + +// Structure to describe response TLV 0x39 for CATGetEventReport() +struct sCATGetEventReportResponse_URL +{ + UINT8 mURLDataLength; + + // This array must be the size specified by mURLDataLength + // char mURLData[1]; +}; + +// Structure to describe response TLV 0x3A for CATGetEventReport() +struct sCATGetEventReportResponse_BrowserID +{ + UINT8 mBrowserID; +}; + +// Structure to describe response TLV 0x3B for CATGetEventReport() +struct sCATGetEventReportResponse_BearerList +{ + UINT8 mBearerListLength; + + // This array must be the size specified by mBearerListLength + // eQMICATBearer mBearerList[1]; +}; + +// Structure to describe response TLV 0x3C for CATGetEventReport() +struct sCATGetEventReportResponse_ProvisioningFiles +{ + UINT32 mNumberOfProvisioningFiles; + + struct sFile + { + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // char mPath[1]; + }; + + // This array must be the size specified by mNumberOfProvisioningFiles + // sFile mFiles[1]; +}; + +// Structure to describe response TLV 0x3D for CATGetEventReport() +struct sCATGetEventReportResponse_USSDString +{ + eQMICATUSSDDataCodingScheme mOriginalDataCodingScheme; + eQMICATUSSDDataCodingScheme mDataCodingScheme; + UINT8 mUSSDTextLength; + + // This array must be the size specified by mUSSDTextLength + // UINT8 mUSSDText[1]; +}; + +// Structure to describe response TLV 0x3E for CATGetEventReport() +struct sCATGetEventReportResponse_DefaultText +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x3F for CATGetEventReport() +struct sCATGetEventReportResponse_ImmediateResponseRequest +{ + eQMICATImmediateResponse mImmediateResponse; +}; + +// Structure to describe response TLV 0x40 for CATGetEventReport() +struct sCATGetEventReportResponse_UserConfirmationAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x41 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupCallDisplayAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x42 for CATGetEventReport() +struct sCATGetEventReportResponse_UserConfirmationIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x43 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupCallDisplayIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x44 for CATGetEventReport() +struct sCATGetEventReportResponse_GatewayProxy +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x45 for CATGetEventReport() +struct sCATGetEventReportResponse_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x46 for CATGetEventReport() +struct sCATGetEventReportResponse_NotificationRequired +{ + eQMICATNotificationRequired mNotificationRequired; +}; + +// Structure to describe response TLV 0x47 for CATGetEventReport() +struct sCATGetEventReportResponse_PlayToneEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mPlayToneCommand[1]; +}; + +// Structure to describe response TLV 0x48 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupCallEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupCallCommand[1]; +}; + +// Structure to describe response TLV 0x49 for CATGetEventReport() +struct sCATGetEventReportResponse_SendDTMFEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDTMFCommand[1]; +}; + +// Structure to describe response TLV 0x4A for CATGetEventReport() +struct sCATGetEventReportResponse_LaunchBrowserEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLaunchBrowserCommand[1]; +}; + +// Structure to describe response TLV 0x4B for CATGetEventReport() +struct sCATGetEventReportResponse_SendSMSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSMSCommand[1]; +}; + +// Structure to describe response TLV 0x4C for CATGetEventReport() +struct sCATGetEventReportResponse_SendSSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSSCommand[1]; +}; + +// Structure to describe response TLV 0x4D for CATGetEventReport() +struct sCATGetEventReportResponse_SendUSSDEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendUSSDCommand[1]; +}; + +// Structure to describe response TLV 0x4E for CATGetEventReport() +struct sCATGetEventReportResponse_ProvideLocalInformationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mProvideLocalInformationCommand[1]; +}; + +// Structure to describe response TLV 0x4F for CATGetEventReport() +struct sCATGetEventReportResponse_SetupEventListRawEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupEventListCommand[1]; +}; + +// Structure to describe response TLV 0x50 for CATGetEventReport() +struct sCATGetEventReportResponse_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe response TLV 0x51 for CATGetEventReport() +struct sCATGetEventReportResponse_OpenChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mOpenChannelCommand[1]; +}; + +// Structure to describe response TLV 0x52 for CATGetEventReport() +struct sCATGetEventReportResponse_CloseChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mCloseChannelCommand[1]; +}; + +// Structure to describe response TLV 0x53 for CATGetEventReport() +struct sCATGetEventReportResponse_SendDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDataCommand[1]; +}; + +// Structure to describe response TLV 0x54 for CATGetEventReport() +struct sCATGetEventReportResponse_ReceiveDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mReceiveDataCommand[1]; +}; + +// Structure to describe response TLV 0x55 for CATGetEventReport() +struct sCATGetEventReportResponse_OnDemandLinkEstablish +{ + eQMICATOnDemandLinkEstablish mOnDemandLinkEstablish; +}; + +// Structure to describe response TLV 0x56 for CATGetEventReport() +struct sCATGetEventReportResponse_CSDBearerDescription +{ + UINT8 mSpeed; + eQMICATCSDBearerName mCSDBearerName; + eQMICATConnectionElement mConnectionElement; +}; + +// Structure to describe response TLV 0x57 for CATGetEventReport() +struct sCATGetEventReportResponse_GPRSBearerDescription +{ + UINT8 mPrecedenceClass; + UINT8 mDelayClass; + UINT8 mReliabilityClass; + UINT8 mPeakThroughput; + UINT8 mMeanThroughput; + eQMICATPacketDataProtocol mPacketDataProtocol; +}; + +// Structure to describe response TLV 0x58 for CATGetEventReport() +struct sCATGetEventReportResponse_EUTRANExternalParameterBearerDescription +{ + eQMICATTrafficClass mTrafficClass; + UINT16 mMaxUploadBitrate; + UINT16 mMaxDownloadBitrate; + UINT16 mGuaranteedUploadBitrate; + UINT16 mGuaranteedDownloadBitrate; + eQMICATDeliveryOrder mDeliveryOrder; + UINT8 mMaxSDUSize; + UINT8 mMaxSDUErrorRatio; + UINT8 mResidualBitErrorRatio; + eQMICATDeliverErrorSDU mDeliverErrorSDU; + UINT8 mTransferDelay; + UINT8 mTrafficHandlingPRI; + eQMICATPDPType mPDPType; +}; + +// Structure to describe response TLV 0x59 for CATGetEventReport() +struct sCATGetEventReportResponse_EUTRANExternalMappedUTRANBearerDescription +{ + UINT8 mQCI; + UINT8 mMaxUploadBitrate; + UINT8 mMaxDownloadBitrate; + UINT8 mGuaranteedUploadBitrate; + UINT8 mGuaranteedDownloadBitrate; + UINT8 mMaximumUploadBitrateExt; + UINT8 mMaximumDownloadBitrateExt; + UINT8 mGuaranteedUploadBitrateExt; + UINT8 mGuaranteedDownloadBitrateExt; + eQMICATPDPType mPDPType; +}; + +// Structure to describe response TLV 0x5A for CATGetEventReport() +struct sCATGetEventReportResponse_BufferSize +{ + UINT16 mBufferSize; +}; + +// Structure to describe response TLV 0x5B for CATGetEventReport() +struct sCATGetEventReportResponse_NetworkAccessName +{ + UINT8 mNetworkAccessNameLength; + + // This array must be the size specified by mNetworkAccessNameLength + // UINT8 mNetworkAccessName[1]; +}; + +// Structure to describe response TLV 0x5C for CATGetEventReport() +struct sCATGetEventReportResponse_OtherAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x5D for CATGetEventReport() +struct sCATGetEventReportResponse_UserLogin +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x5E for CATGetEventReport() +struct sCATGetEventReportResponse_UserPassword +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x5F for CATGetEventReport() +struct sCATGetEventReportResponse_TransportLevel +{ + eQMICATTransportProtocol mTransportProtocol; + UINT16 mPortNumber; +}; + +// Structure to describe response TLV 0x60 for CATGetEventReport() +struct sCATGetEventReportResponse_DataDestinationAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x61 for CATGetEventReport() +struct sCATGetEventReportResponse_ChannelDataLength +{ + UINT8 mChannelDataLength; +}; + +// Structure to describe response TLV 0x62 for CATGetEventReport() +struct sCATGetEventReportResponse_SendDataImmediately +{ + eQMICATSendDataImmediately mSendDataImmediately; +}; + +// Structure to describe response TLV 0x63 for CATGetEventReport() +struct sCATGetEventReportResponse_ChannelData +{ + UINT16 mChannelDataLength; + + // This array must be the size specified by mChannelDataLength + // UINT8 mChannelData[1]; +}; + +// Structure to describe response TLV 0x64 for CATGetEventReport() +struct sCATGetEventReportResponse_ChannelID +{ + UINT8 mChannelID; +}; + +// Structure to describe request TLV 0x01 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_TerminalResponse +{ + UINT32 mReferenceID; + UINT8 mCommandNumber; + eQMICATResponseCommand mResponseCommand; + UINT8 mGeneralResult; + UINT8 mAdditionalInformationLength; + + // This array must be the size specified by mAdditionalInformationLength + // UINT8 mTerminalResponseAdditionalInformation[1]; +}; + +// Structure to describe request TLV 0x10 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x11 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_ItemIdentifier +{ + UINT8 mItemIdentifier; +}; + +// Structure to describe request TLV 0x12 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_GetInkeyExtraInfo +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x13 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_LanguageInfo +{ + char mLanguage[2]; +}; + +// Structure to describe request TLV 0x14 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_EnvelopeCommand +{ + eQMICATDecodedEnvelopeCommand mEnvelopeCommand; +}; + +// Structure to describe request TLV 0x10 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_ItemIdentifier +{ + UINT8 mItemIdentifier; +}; + +// Structure to describe request TLV 0x11 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_HelpRequest +{ + eQMICATHelpRequest mHelpRequest; +}; + +// Structure to describe request TLV 0x12 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_Language +{ + char mLanguage[2]; +}; + +// Structure to describe request TLV 0x13 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x14 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe request TLV 0x15 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe request TLV 0x16 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_CapabilityConfigParam1 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe request TLV 0x17 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_CapabilityConfigParam2 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe request TLV 0x18 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_USSDString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x19 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_PDPContextActivation +{ + UINT8 mPDPContextActivationDataLength; + + // This array must be the size specified by mPDPContextActivationDataLength + // UINT8 mPDPContextActivationData[1]; +}; + +// Structure to describe request TLV 0x1A for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_EPSPDNConnectActivation +{ + UINT8 mEPSPDNConnectActivationDataLength; + + // This array must be the size specified by mEPSPDNConnectActivationDataLength + // UINT8 mEPSPDNConnectActivationData[1]; +}; + +// Structure to describe response TLV 0x10 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_CallControlResult +{ + eQMICATCallControlResult mCallControlResult; +}; + +// Structure to describe response TLV 0x11 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x12 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe response TLV 0x13 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_CapabilityConfigParam1 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x14 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_CapabilityConfigParam2 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x15 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_USSDString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x16 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_PDPContextActivation +{ + UINT8 mPDPContextActivationDataLength; + + // This array must be the size specified by mPDPContextActivationDataLength + // UINT8 mPDPContextActivationData[1]; +}; + +// Structure to describe response TLV 0x17 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_EPSPDNConnectActivation +{ + UINT8 mEPSPDNConnectActivationDataLength; + + // This array must be the size specified by mEPSPDNConnectActivationDataLength + // UINT8 mEPSPDNConnectActivationData[1]; +}; + +// Structure to describe response TLV 0x18 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x19 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_BCRepeatIndicator +{ + eQMICATBearerCapabilityRepeatIndicator mBearerCapabilityRepeatIndicator; +}; + +// Structure to describe request TLV 0x10 for CATEventConfirmation() +struct sCATEventConfirmationRequest_UserConfirmed +{ + eQMICATUserConfirmed mUserConfirmed; +}; + +// Structure to describe request TLV 0x11 for CATEventConfirmation() +struct sCATEventConfirmationRequest_IconIsDisplayed +{ + eQMICATIconIsDisplayed mIconIsDisplayed; +}; + +// Structure to describe request TLV 0x12 for CATEventConfirmation() +struct sCATEventConfirmationRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATSCWSOpenChannel() +struct sCATSCWSOpenChannelRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CATSCWSOpenChannel() +struct sCATSCWSOpenChannelRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT SCWSOpenChannelIndication +struct sCATSCWSOpenChannelIndication_OpenChannelInformation +{ + UINT32 mChannelID; + UINT16 mPortNumber; + UINT16 mBufferSize; +}; + +// Structure to describe indication TLV 0x11 for CAT SCWSOpenChannelIndication +struct sCATSCWSOpenChannelIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATSCWSCloseChannel() +struct sCATSCWSCloseChannelRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CATSCWSCloseChannel() +struct sCATSCWSCloseChannelRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT SCWSCloseChannelIndication +struct sCATSCWSCloseChannelIndication_CloseChannelInfo +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe response TLV 0x11 for CATSCWSCloseChannel() +struct sCATSCWSCloseChannelResponse_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATSCWSSendData() +struct sCATSCWSSendDataRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATSendDataResult mDataSendResult; +}; + +// Structure to describe request TLV 0x10 for CATSCWSSendData() +struct sCATSCWSSendDataRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT SCWSSendDataIndication +struct sCATSCWSSendDataIndication_SendDataInfo +{ + UINT32 mChannelID; + UINT8 mTotalPackets; + UINT8 mCurrentPacket; + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe indication TLV 0x11 for CAT SCWSSendDataIndication +struct sCATSCWSSendDataIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATSCWSDataAvailable() +struct sCATSCWSDataAvailableRequest_RemainingData +{ + UINT32 mChannelID; + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x10 for CATSCWSDataAvailable() +struct sCATSCWSDataAvailableRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATSCWSChannelStatus() +struct sCATSCWSChannelStatusRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CATSCWSChannelStatus() +struct sCATSCWSChannelStatusRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe response TLV 0x10 for RMSGetSMSWake() +struct sRMSGetSMSWakeResponse_State +{ + INT8 mSMSWakeEnabled; +}; + +// Structure to describe request TLV 0x11 for RMSGetSMSWake() +struct sRMSGetSMSWakeRequest_Mask +{ + UINT32 mMask; +}; + +// Structure to describe request TLV 0x10 for RMSSetSMSWake() +struct sRMSSetSMSWakeRequest_State +{ + INT8 mSMSWakeEnabled; +}; + +// Structure to describe request TLV 0x11 for RMSSetSMSWake() +struct sRMSSetSMSWakeRequest_Mask +{ + UINT32 mMask; +}; + +// Structure to describe request TLV 0x10 for OMASetEventReport() +struct sOMASetEventReportRequest_NIA +{ + INT8 mReportNetworkInitiatedAlerts; +}; + +// Structure to describe request TLV 0x11 for OMASetEventReport() +struct sOMASetEventReportRequest_Status +{ + INT8 mReportSessionStatus; +}; + +// Structure to describe indication TLV 0x10 for OMA EventReport +struct sOMAEventReportIndication_NIA +{ + eQMIOMASessionTypes mSessionType; + UINT16 mSessionID; +}; + +// Structure to describe indication TLV 0x11 for OMA EventReport +struct sOMAEventReportIndication_Status +{ + eQMIOMASessionStates mSessionState; +}; + +// Structure to describe indication TLV 0x12 for OMA EventReport +struct sOMAEventReportIndication_Failure +{ + eQMIOMASessionFailureReasons mSessionFailure; +}; + +// Structure to describe request TLV 0x10 for OMAStartSession() +struct sOMAStartSessionRequest_Type +{ + eQMIOMASessionTypes mSessionType; +}; + +// Structure to describe response TLV 0x10 for OMAGetSessionInfo() +struct sOMAGetSessionInfoResponse_Info +{ + eQMIOMASessionStates mSessionState; + eQMIOMASessionTypes mSessionType; +}; + +// Structure to describe response TLV 0x11 for OMAGetSessionInfo() +struct sOMAGetSessionInfoResponse_Failure +{ + eQMIOMASessionFailureReasons mSessionFailure; +}; + +// Structure to describe response TLV 0x12 for OMAGetSessionInfo() +struct sOMAGetSessionInfoResponse_Retry +{ + UINT8 mRetryCount; + UINT16 mRetryPauseTimer; + UINT16 mRemainingTime; +}; + +// Structure to describe response TLV 0x13 for OMAGetSessionInfo() +struct sOMAGetSessionInfoResponse_NIA +{ + eQMIOMASessionTypes mSessionType; + UINT16 mSessionID; +}; + +// Structure to describe request TLV 0x10 for OMASendSelection() +struct sOMASendSelectionRequest_Type +{ + eQMIOMASelections mSelection; + UINT16 mSessionID; +}; + +// Structure to describe response TLV 0x10 for OMAGetFeatures() +struct sOMAGetFeaturesResponse_Provisioning +{ + INT8 mDeviceProvisioningServiceUpdateEnabled; +}; + +// Structure to describe response TLV 0x11 for OMAGetFeatures() +struct sOMAGetFeaturesResponse_PRLUpdate +{ + INT8 mPRLServiceUpdateEnabled; +}; + +// Structure to describe response TLV 0x12 for OMAGetFeatures() +struct sOMAGetFeaturesResponse_HFAFeature +{ + INT8 mHFAFeatureEnabled; +}; + +// Structure to describe response TLV 0x13 for OMAGetFeatures() +struct sOMAGetFeaturesResponse_HFADoneState +{ + eQMIOMAHFADoneStates mHFAFeatureDoneState; +}; + +// Structure to describe request TLV 0x10 for OMASetFeatures() +struct sOMASetFeaturesRequest_Provisioning +{ + INT8 mDeviceProvisioningServiceUpdateEnabled; +}; + +// Structure to describe request TLV 0x11 for OMASetFeatures() +struct sOMASetFeaturesRequest_PRLUpdate +{ + INT8 mPRLServiceUpdateEnabled; +}; + +// Structure to describe request TLV 0x12 for OMASetFeatures() +struct sOMASetFeaturesRequest_HFAFeature +{ + INT8 mHFAFeatureEnabled; +}; + + +#pragma pack( pop ) diff --git a/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp new file mode 100755 index 0000000..7522cd1 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp @@ -0,0 +1,17234 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtExports.cpp + +DESCRIPTION: + QUALCOMM Gobi Connection Management API exports + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Stdafx.h" +#include "GobiConnectionMgmt.h" + +/*=========================================================================*/ +// Exported Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GobiConnect + +DESCRIPTION: + This function connects the CM API library to the specified Gobi + device + +PARAMETERS: + pQMIFile [ I ] - Device interface to connect to + pServicesCount [I/O] - Upon input the number of QMI services to connect to, + upon output the number of QMI services successfully + connected to + pServices [I/O] - Upon input the array of QMI service IDs to connect + to, upon output the array of QMI service IDs + successfully connected to + pHandle [ O ] - The returned Gobi interface handle + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiConnect( + LPCSTR pInterface, + ULONG * pServicesCount, + ULONG * pServices, + GOBIHANDLE * pHandle ) +{ + // Validate arguments + if ( (pInterface == 0) + || (pServicesCount == 0) + || (*pServicesCount == 0) + || (pServices == 0) + || (pHandle == 0) ) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + GOBIHANDLE handle = gDLL.CreateAPI(); + if (handle == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcCount = *pServicesCount; + *pServicesCount = 0; + *pHandle = 0; + + std::set inSvcs; + std::set outSvcs; + + ULONG s = 0; + for (s = 0; s < svcCount; s++) + { + inSvcs.insert( (eQMIService)pServices[s] ); + } + + outSvcs = pAPI->Connect( pInterface, inSvcs ); + + ULONG outSvcsCount = (ULONG)outSvcs.size(); + if (outSvcsCount > svcCount) + { + outSvcsCount = svcCount; + } + + if (outSvcsCount == 0) + { + ULONG rc = (ULONG)pAPI->GetCorrectedLastError(); + pAPI = 0; + + gDLL.DeleteAPI( handle ); + return rc; + } + + std::set ::const_iterator pOutSvc = outSvcs.begin(); + for (s = 0; s < svcCount; s++) + { + pServices[s] = UCHAR_MAX; + if (s < outSvcsCount) + { + pServices[s] = (ULONG)*pOutSvc++; + } + } + + *pHandle = handle; + *pServicesCount = outSvcsCount; + + return (ULONG)eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GobiCancel + +DESCRIPTION: + This function cancels the most recent outstanding request for the + specified QMI service + +PARAMETERS: + handle [ I ] - Gobi interface handle + svcID [ I ] - Service whose outstanding request is to be cancelled + pTXID [ O ] - QMI transaction ID of outstanding request + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiCancel( + GOBIHANDLE handle, + ULONG svcID, + ULONG * pTXID ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->CancelSend( svcID, pTXID ); +} + +/*=========================================================================== +METHOD: + GobiDisconnect + +DESCRIPTION: + This function disconnects the CM API library from the currently + connected Gobi device + +PARAMETERS: + handle [ I ] - Gobi interface handle + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiDisconnect( GOBIHANDLE handle ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + bool bDisco = pAPI->Disconnect(); + if (bDisco == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + return (ULONG)eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetGenericCallback + +DESCRIPTION: + This function enables/disables a generic callback + +PARAMETERS: + handle [ I ] - Gobi interface handle + svcID [ I ] - Service ID to monitor + msgID [ I ] - Message ID to look for + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG SetGenericCallback( + GOBIHANDLE handle, + ULONG svcID, + ULONG msgID, + tFNGenericCallback pCallback ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetGenericCallback( svcID, + msgID, + pCallback, + handle ); +} + +/*=========================================================================== +METHOD: + WDSReset + +DESCRIPTION: + The function sends 'WDS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetEventReport + +DESCRIPTION: + The function sends 'WDS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSAbort + +DESCRIPTION: + The function sends 'WDS/Abort Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSAbort( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 2; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSStartNetworkInterface + +DESCRIPTION: + The function sends 'WDS/Start Network Interface Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSStartNetworkInterface( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSStopNetworkInterface + +DESCRIPTION: + The function sends 'WDS/Stop Network Interface Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSStopNetworkInterface( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetPacketServiceStatus + +DESCRIPTION: + The function sends 'WDS/Get Packet Service Status Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPacketServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetChannelRates + +DESCRIPTION: + The function sends 'WDS/Get Channel Rates Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetChannelRates( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetPacketStatistics + +DESCRIPTION: + The function sends 'WDS/Get Packet Statistics Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPacketStatistics( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGoDormant + +DESCRIPTION: + The function sends 'WDS/Go Dormant Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGoDormant( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGoActive + +DESCRIPTION: + The function sends 'WDS/Go Active Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGoActive( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSCreateProfile + +DESCRIPTION: + The function sends 'WDS/Create Profile Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSCreateProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSModifyProfile + +DESCRIPTION: + The function sends 'WDS/Modify Profile Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSModifyProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSDeleteProfile + +DESCRIPTION: + The function sends 'WDS/Delete Profile Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSDeleteProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetProfileList + +DESCRIPTION: + The function sends 'WDS/Get Profile List Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetProfileList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetProfileSettings + +DESCRIPTION: + The function sends 'WDS/Get Profile Settings Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetProfileSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDefaultSettings + +DESCRIPTION: + The function sends 'WDS/Get Default Settings Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDefaultSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCurrentSettings + +DESCRIPTION: + The function sends 'WDS/Get Current Settings Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCurrentSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetMIPMode + +DESCRIPTION: + The function sends 'WDS/Set MIP Mode Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetMIPMode + +DESCRIPTION: + The function sends 'WDS/Get MIP Mode Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDormancy + +DESCRIPTION: + The function sends 'WDS/Get Dormancy Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDormancy( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetAutoconnectSetting + +DESCRIPTION: + The function sends 'WDS/Get Autoconnect Setting Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetAutoconnectSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDataSessionDuration + +DESCRIPTION: + The function sends 'WDS/Get Data Session Duration Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDataSessionDuration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetModemStatus + +DESCRIPTION: + The function sends 'WDS/Get Modem Status Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetModemStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDataBearerTechnology + +DESCRIPTION: + The function sends 'WDS/Get Data Bearer Technology Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDataBearerTechnology( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetModemInfo + +DESCRIPTION: + The function sends 'WDS/Get Modem Info Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetModemInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetActiveMIPProfile + +DESCRIPTION: + The function sends 'WDS/Get Active MIP Profile Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetActiveMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetActiveMIPProfile + +DESCRIPTION: + The function sends 'WDS/Set Active MIP Profile Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetActiveMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetMIPProfile + +DESCRIPTION: + The function sends 'WDS/Get MIP Profile Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 62; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetMIPProfile + +DESCRIPTION: + The function sends 'WDS/Set MIP Profile Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetMIPParameters + +DESCRIPTION: + The function sends 'WDS/Get MIP Parameters Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetMIPParameters + +DESCRIPTION: + The function sends 'WDS/Set MIP Parameters Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetLastMIPStatus + +DESCRIPTION: + The function sends 'WDS/Get Last MIP Status Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetLastMIPStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetANAAAAuthenticationStatus + +DESCRIPTION: + The function sends 'WDS/Get AN-AAA Authentication Status Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetANAAAAuthenticationStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCurrentDataBearerTechnology + +DESCRIPTION: + The function sends 'WDS/Get Current Data Bearer Technology Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCurrentDataBearerTechnology( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCallList + +DESCRIPTION: + The function sends 'WDS/Get Call List Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCallRecord + +DESCRIPTION: + The function sends 'WDS/Get Call Record Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 70; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSClearCallList + +DESCRIPTION: + The function sends 'WDS/Clear Call List Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSClearCallList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 71; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCallListMaxSize + +DESCRIPTION: + The function sends 'WDS/Get Call List Max Size Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallListMaxSize( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 72; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDefaultProfileNumber + +DESCRIPTION: + The function sends 'WDS/Get Default Profile Number Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDefaultProfileNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 73; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetDefaultProfileNumber + +DESCRIPTION: + The function sends 'WDS/Set Default Profile Number Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDefaultProfileNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 74; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSResetProfile + +DESCRIPTION: + The function sends 'WDS/Reset Profile Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSResetProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 75; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSResetProfileParamToInvalid + +DESCRIPTION: + The function sends 'WDS/Reset Profile Param To Invalid Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSResetProfileParamToInvalid( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 76; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetIPFamilyPreference + +DESCRIPTION: + The function sends 'WDS/Set IP Family Preference Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetIPFamilyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 77; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetAutoconnectSetting + +DESCRIPTION: + The function sends 'WDS/Set Autoconnect Setting Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetAutoconnectSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 81; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDNSSetting + +DESCRIPTION: + The function sends 'WDS/Get DNS Setting Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDNSSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 82; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetDNSSetting + +DESCRIPTION: + The function sends 'WDS/Set DNS Setting Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDNSSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 83; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCDMAPreDormancySettings + +DESCRIPTION: + The function sends 'WDS/Get CDMA Pre-Dormancy Settings Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCDMAPreDormancySettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 84; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetCAMTimer + +DESCRIPTION: + The function sends 'WDS/Set CAM Timer Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetCAMTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 85; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCAMTimer + +DESCRIPTION: + The function sends 'WDS/Get CAM Timer Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCAMTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 86; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetSCRM + +DESCRIPTION: + The function sends 'WDS/Set SCRM Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetSCRM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 87; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetSCRM + +DESCRIPTION: + The function sends 'WDS/Get SCRM Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetSCRM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 88; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetRDUD + +DESCRIPTION: + The function sends 'WDS/Set RDUD Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetRDUD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 89; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetRDUD + +DESCRIPTION: + The function sends 'WDS/Get RDUD Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetRDUD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 90; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetSIPMIPCallType + +DESCRIPTION: + The function sends 'WDS/Get SIP/MIP Call Type Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetSIPMIPCallType( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 91; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetEVDOPageMonitorPeriod + +DESCRIPTION: + The function sends 'WDS/Set EV-DO Page Monitor Period Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEVDOPageMonitorPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 92; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetEVDOLongSleep + +DESCRIPTION: + The function sends 'WDS/Set EV-DO Long Sleep Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEVDOLongSleep( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 93; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetEVDOPageMonitorPeriod + +DESCRIPTION: + The function sends 'WDS/Get EV-DO Page Monitor Period Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetEVDOPageMonitorPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 94; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCallThrottleInfo + +DESCRIPTION: + The function sends 'WDS/Get Call Throttle Info Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallThrottleInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 95; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetNSAPI + +DESCRIPTION: + The function sends 'WDS/Get NSAPI Request' (0x0060) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetNSAPI( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 96; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetDUNCallControlPreference + +DESCRIPTION: + The function sends 'WDS/Set DUN Call Control Preference Request' (0x0061) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDUNCallControlPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 97; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDUNCallControlInfo + +DESCRIPTION: + The function sends 'WDS/Get DUN Call Control Info Request' (0x0062) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDUNCallControlInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 98; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetDUNCallControlEventReport + +DESCRIPTION: + The function sends 'WDS/Set DUN Call Control Event Report Request' (0x0063) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDUNCallControlEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 99; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSPendingDUNCallControl + +DESCRIPTION: + The function sends 'WDS/Pending DUN Call Control Request' (0x0064) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSPendingDUNCallControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 100; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetPreferredDataSystem + +DESCRIPTION: + The function sends 'WDS/Get Preferred Data System Request' (0x0069) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPreferredDataSystem( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 105; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetLastDataCallStatus + +DESCRIPTION: + The function sends 'WDS/Get Last Data Call Status Request' (0x006A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetLastDataCallStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 106; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSReset + +DESCRIPTION: + The function sends 'DMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetEventReport + +DESCRIPTION: + The function sends 'DMS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceCapabilities + +DESCRIPTION: + The function sends 'DMS/Get Device Capabilities Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceManfacturer + +DESCRIPTION: + The function sends 'DMS/Get Device Manfacturer Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceManfacturer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceModel + +DESCRIPTION: + The function sends 'DMS/Get Device Model Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceModel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceRevision + +DESCRIPTION: + The function sends 'DMS/Get Device Revision Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceVoiceNumber + +DESCRIPTION: + The function sends 'DMS/Get Device Voice Number Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceVoiceNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceSerialNumbers + +DESCRIPTION: + The function sends 'DMS/Get Device Serial Numbers Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceSerialNumbers( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetPowerState + +DESCRIPTION: + The function sends 'DMS/Get Power State Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetPowerState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMSetPINProtection + +DESCRIPTION: + The function sends 'DMS/UIM Set PIN Protection Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMSetPINProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMVerifyPIN + +DESCRIPTION: + The function sends 'DMS/UIM Verify PIN Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMVerifyPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMUnblockPIN + +DESCRIPTION: + The function sends 'DMS/UIM Unblock PIN Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMUnblockPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMChangePIN + +DESCRIPTION: + The function sends 'DMS/UIM Change PIN Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMChangePIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMGetPINStatus + +DESCRIPTION: + The function sends 'DMS/UIM Get PIN Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetPINStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetHardwareRevision + +DESCRIPTION: + The function sends 'DMS/Get Hardware Revision Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetHardwareRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetOperatingMode + +DESCRIPTION: + The function sends 'DMS/Get Operating Mode Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetOperatingMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetOperatingMode + +DESCRIPTION: + The function sends 'DMS/Set Operating Mode Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetOperatingMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetTimestamp + +DESCRIPTION: + The function sends 'DMS/Get Timestamp Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetTimestamp( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetPRLVersion + +DESCRIPTION: + The function sends 'DMS/Get PRL Version Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetPRLVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetActivationState + +DESCRIPTION: + The function sends 'DMS/Get Activation State Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetActivationState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSActivateAutomatic + +DESCRIPTION: + The function sends 'DMS/Activate Automatic Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSActivateAutomatic( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 50; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSActivateManual + +DESCRIPTION: + The function sends 'DMS/Activate Manual Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSActivateManual( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetLockState + +DESCRIPTION: + The function sends 'DMS/Get Lock State Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetLockState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetLockState + +DESCRIPTION: + The function sends 'DMS/Set Lock State Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetLockState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetLockCode + +DESCRIPTION: + The function sends 'DMS/Set Lock Code Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetLockCode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSReadUserData + +DESCRIPTION: + The function sends 'DMS/Read User Data Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReadUserData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSWriteUserData + +DESCRIPTION: + The function sends 'DMS/Write User Data Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSWriteUserData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSReadERIData + +DESCRIPTION: + The function sends 'DMS/Read ERI Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReadERIData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSResetFactoryDefaults + +DESCRIPTION: + The function sends 'DMS/Reset Factory Defaults Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSResetFactoryDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSValidateSPC + +DESCRIPTION: + The function sends 'DMS/Validate SPC Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSValidateSPC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMGetICCID + +DESCRIPTION: + The function sends 'DMS/UIM Get ICCID Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetICCID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMGetHostLockID + +DESCRIPTION: + The function sends 'DMS/UIM Get Host Lock ID Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetHostLockID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMGetControlKeyStatus + +DESCRIPTION: + The function sends 'DMS/UIM Get Control Key Status Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetControlKeyStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMSetControlKeyProtection + +DESCRIPTION: + The function sends 'DMS/UIM Set Control Key Protection Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMSetControlKeyProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMUnblockControlKey + +DESCRIPTION: + The function sends 'DMS/UIM Unblock Control Key Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMUnblockControlKey( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetIMSI + +DESCRIPTION: + The function sends 'DMS/Get IMSI Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetIMSI( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetUIMState + +DESCRIPTION: + The function sends 'DMS/Get UIM State Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetUIMState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetBandCapabilities + +DESCRIPTION: + The function sends 'DMS/Get Band Capabilities Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetBandCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetFactorySerialNumber + +DESCRIPTION: + The function sends 'DMS/Get Factory Serial Number Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetFactorySerialNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 70; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetDeviceTime + +DESCRIPTION: + The function sends 'DMS/Set Device Time Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetDeviceTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 75; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetSoftwareVersion + +DESCRIPTION: + The function sends 'DMS/Get Software Version Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetSoftwareVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 81; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetSPC + +DESCRIPTION: + The function sends 'DMS/Set SPC Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetSPC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 82; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASReset + +DESCRIPTION: + The function sends 'NAS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASAbort + +DESCRIPTION: + The function sends 'NAS/Abort Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASAbort( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetEventReport + +DESCRIPTION: + The function sends 'NAS/Set Event Report Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 2; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetRegistrationEventReport + +DESCRIPTION: + The function sends 'NAS/Set Registration Event Report Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRegistrationEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 3; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetSignalStrength + +DESCRIPTION: + The function sends 'NAS/Get Signal Strength Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSignalStrength( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASPerformNetworkScan + +DESCRIPTION: + The function sends 'NAS/Perform Network Scan Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASPerformNetworkScan( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASInitiateNetworkRegister + +DESCRIPTION: + The function sends 'NAS/Initiate Network Register Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASInitiateNetworkRegister( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASInitiateAttach + +DESCRIPTION: + The function sends 'NAS/Initiate Attach Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASInitiateAttach( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetServingSystem + +DESCRIPTION: + The function sends 'NAS/Get Serving System Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetServingSystem( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetHomeNetwork + +DESCRIPTION: + The function sends 'NAS/Get Home Network Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetHomeNetwork( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetPreferredNetworks + +DESCRIPTION: + The function sends 'NAS/Get Preferred Networks Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetPreferredNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetPreferredNetworks + +DESCRIPTION: + The function sends 'NAS/Set Preferred Networks Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetPreferredNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetForbiddenNetworks + +DESCRIPTION: + The function sends 'NAS/Get Forbidden Networks Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetForbiddenNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetForbiddenNetworks + +DESCRIPTION: + The function sends 'NAS/Set Forbidden Networks Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetForbiddenNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetTechnologyPreference + +DESCRIPTION: + The function sends 'NAS/Set Technology Preference Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetTechnologyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetTechnologyPreference + +DESCRIPTION: + The function sends 'NAS/Get Technology Preference Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetTechnologyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetACCOLC + +DESCRIPTION: + The function sends 'NAS/Get ACCOLC Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetACCOLC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetACCOLC + +DESCRIPTION: + The function sends 'NAS/Set ACCOLC Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetACCOLC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetSystemPreference + +DESCRIPTION: + The function sends 'NAS/Get System Preference' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetNetworkParameters + +DESCRIPTION: + The function sends 'NAS/Get Network Parameters Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetNetworkParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetNetworkParameters + +DESCRIPTION: + The function sends 'NAS/Set Network Parameters Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetNetworkParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetRFInfo + +DESCRIPTION: + The function sends 'NAS/Get RF Info Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRFInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetANAAAAuthenticationStatus + +DESCRIPTION: + The function sends 'NAS/Get AN-AAA Authentication Status Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetANAAAAuthenticationStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 50; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetSystemSelectionPref + +DESCRIPTION: + The function sends 'NAS/Set System Selection Pref Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetSystemSelectionPref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetSystemSelectionPref + +DESCRIPTION: + The function sends 'NAS/Get System Selection Pref Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemSelectionPref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetDDTMPreference + +DESCRIPTION: + The function sends 'NAS/Set DDTM Preference Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetDDTMPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetDDTMPreference + +DESCRIPTION: + The function sends 'NAS/Get DDTM Preference Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetDDTMPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetOperatorNameData + +DESCRIPTION: + The function sends 'NAS/Get Operator Name Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetOperatorNameData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetCSPPLMNMode + +DESCRIPTION: + The function sends 'NAS/Get CSP PLMN Mode Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCSPPLMNMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASUpdateAKEY + +DESCRIPTION: + The function sends 'NAS/Update AKEY Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASUpdateAKEY( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGet3GPP2SubscriptionInfo + +DESCRIPTION: + The function sends 'NAS/Get 3GPP2 Subscription Info Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGet3GPP2SubscriptionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 62; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSet3GPP2SubscriptionInfo + +DESCRIPTION: + The function sends 'NAS/Set 3GPP2 Subscription Info Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSet3GPP2SubscriptionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetMobileCAIRevision + +DESCRIPTION: + The function sends 'NAS/Get Mobile CAI Revision Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetMobileCAIRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetRTREConfig + +DESCRIPTION: + The function sends 'NAS/Get RTRE Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRTREConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetRTREConfig + +DESCRIPTION: + The function sends 'NAS/Set RTRE Config Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRTREConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetCellLocationInfo + +DESCRIPTION: + The function sends 'NAS/Get Cell Location Info Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCellLocationInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetPLMNName + +DESCRIPTION: + The function sends 'NAS/Get PLMN Name Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetPLMNName( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASBindSubscription + +DESCRIPTION: + The function sends 'NAS/Bind Subscription Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetModePref + +DESCRIPTION: + The function sends 'NAS/Get Mode Pref Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetModePref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 73; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetDualStandbyPreference + +DESCRIPTION: + The function sends 'NAS/Set Dual Standby Preference Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetDualStandbyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 75; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetSystemInfo + +DESCRIPTION: + The function sends 'NAS/Get System Info Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 77; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetSignalInfo + +DESCRIPTION: + The function sends 'NAS/Get Signal Info Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSignalInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 79; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASConfigureSignalInfo + +DESCRIPTION: + The function sends 'NAS/Configure Signal Info Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASConfigureSignalInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 80; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetErrorRate + +DESCRIPTION: + The function sends 'NAS/Get Error Rate Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetErrorRate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 82; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetEVDOProtocolSubtype + +DESCRIPTION: + The function sends 'NAS/Get EV-DO Protocol Subtype Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetEVDOProtocolSubtype( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 86; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetEVDOColorCode + +DESCRIPTION: + The function sends 'NAS/Get EV-DO Color Code Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetEVDOColorCode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 87; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetAcquisitionSystemMode + +DESCRIPTION: + The function sends 'NAS/Get Acquisition System Mode Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetAcquisitionSystemMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 88; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetRXDiversity + +DESCRIPTION: + The function sends 'NAS/Set RX Diversity Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRXDiversity( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 89; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetRXTXInfo + +DESCRIPTION: + The function sends 'NAS/Get RX/TX Info Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRXTXInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 90; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASUpdateAKEYExtended + +DESCRIPTION: + The function sends 'NAS/Update A-KEY Extended Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASUpdateAKEYExtended( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 91; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetDualStandbyPreference + +DESCRIPTION: + The function sends 'NAS/Get Dual Standby Preference Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetDualStandbyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 92; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSReset + +DESCRIPTION: + The function sends 'WMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetEventReport + +DESCRIPTION: + The function sends 'WMS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSRawSend + +DESCRIPTION: + The function sends 'WMS/Raw Send Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawSend( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSRawWrite + +DESCRIPTION: + The function sends 'WMS/Raw Write Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawWrite( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSRawRead + +DESCRIPTION: + The function sends 'WMS/Raw Read Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawRead( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSModifyTag + +DESCRIPTION: + The function sends 'WMS/Modify Tag Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSModifyTag( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSDelete + +DESCRIPTION: + The function sends 'WMS/Delete Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSDelete( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetMessageProtocol + +DESCRIPTION: + The function sends 'WMS/Get Message Protocol Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetMessageProtocol( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSListMessages + +DESCRIPTION: + The function sends 'WMS/List Messages Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSListMessages( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetRoutes + +DESCRIPTION: + The function sends 'WMS/Set Routes Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRoutes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 50; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetRoutes + +DESCRIPTION: + The function sends 'WMS/Get Routes Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetRoutes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetSMSCAddress + +DESCRIPTION: + The function sends 'WMS/Get SMSC Address Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetSMSCAddress( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetSMSCAddress + +DESCRIPTION: + The function sends 'WMS/Set SMSC Address Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetSMSCAddress( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetStorageMaxSize + +DESCRIPTION: + The function sends 'WMS/Get Storage Max Size Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetStorageMaxSize( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSendACK + +DESCRIPTION: + The function sends 'WMS/Send ACK Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSendACK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetRetryPeriod + +DESCRIPTION: + The function sends 'WMS/Set Retry Period Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRetryPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetRetryInterval + +DESCRIPTION: + The function sends 'WMS/Set Retry Interval Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRetryInterval( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetDCDisconnectTimer + +DESCRIPTION: + The function sends 'WMS/Set DC Disconnect Timer Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetDCDisconnectTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetMemoryStatus + +DESCRIPTION: + The function sends 'WMS/Set Memory Status Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetMemoryStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetBroadcastActivation + +DESCRIPTION: + The function sends 'WMS/Set Broadcast Activation Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetBroadcastActivation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetBroadcastConfig + +DESCRIPTION: + The function sends 'WMS/Set Broadcast Config Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetBroadcastConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetBroadcastConfig + +DESCRIPTION: + The function sends 'WMS/Get Broadcast Config Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetBroadcastConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 62; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetDomainPreference + +DESCRIPTION: + The function sends 'WMS/Get Domain Preference Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetDomainPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetDomainPreference + +DESCRIPTION: + The function sends 'WMS/Set Domain Preference Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetDomainPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSendFromMemoryStore + +DESCRIPTION: + The function sends 'WMS/Send From Memory Store Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSendFromMemoryStore( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetWaitingMessage + +DESCRIPTION: + The function sends 'WMS/Get Waiting Message Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetWaitingMessage( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetPrimaryClient + +DESCRIPTION: + The function sends 'WMS/Set Primary Client Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetPrimaryClient( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSIndicatorRegistration + +DESCRIPTION: + The function sends 'WMS/Indicator Registration Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSIndicatorRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 71; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetTransportLayerInfo + +DESCRIPTION: + The function sends 'WMS/Get Transport Layer Info Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetTransportLayerInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 72; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetNetworkRegistrationInfo + +DESCRIPTION: + The function sends 'WMS/Get Network Registration Info Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetNetworkRegistrationInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 74; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSBindSubscription + +DESCRIPTION: + The function sends 'WMS/Bind Subscription Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 76; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetIndicatorRegistration + +DESCRIPTION: + The function sends 'WMS/Get Indicator Registration Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetIndicatorRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 77; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetSMSParameters + +DESCRIPTION: + The function sends 'WMS/Get SMS Parameters Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetSMSParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 78; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetSMSParameters + +DESCRIPTION: + The function sends 'WMS/Set SMS Parameters Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetSMSParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 79; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSReset + +DESCRIPTION: + The function sends 'PDS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetEventReport + +DESCRIPTION: + The function sends 'PDS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetServiceState + +DESCRIPTION: + The function sends 'PDS/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetServiceState + +DESCRIPTION: + The function sends 'PDS/Set Service State Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSStartTrackingSession + +DESCRIPTION: + The function sends 'PDS/Start Tracking Session Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSStartTrackingSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetTrackingSessionInfo + +DESCRIPTION: + The function sends 'PDS/Get Tracking Session Info Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetTrackingSessionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSFixPosition + +DESCRIPTION: + The function sends 'PDS/Fix Position Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSFixPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSEndTrackingSession + +DESCRIPTION: + The function sends 'PDS/End Tracking Session Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSEndTrackingSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetNMEAConfig + +DESCRIPTION: + The function sends 'PDS/Get NMEA Config Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetNMEAConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetNMEAConfig + +DESCRIPTION: + The function sends 'PDS/Set NMEA Config Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetNMEAConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectTimeReference + +DESCRIPTION: + The function sends 'PDS/Inject Time Reference Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeReference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetDefaults + +DESCRIPTION: + The function sends 'PDS/Get Defaults Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetDefaults + +DESCRIPTION: + The function sends 'PDS/Set Defaults Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetXTRAParameters + +DESCRIPTION: + The function sends 'PDS/Get XTRA Parameters Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetXTRAParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetXTRAParameters + +DESCRIPTION: + The function sends 'PDS/Set XTRA Parameters Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetXTRAParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSForceXTRADownload + +DESCRIPTION: + The function sends 'PDS/Force XTRA Download Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSForceXTRADownload( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetAGPSConfig + +DESCRIPTION: + The function sends 'PDS/Get AGPS Config Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetAGPSConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetAGPSConfig + +DESCRIPTION: + The function sends 'PDS/Set AGPS Config Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetAGPSConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetServiceAutoTrackingState + +DESCRIPTION: + The function sends 'PDS/Get Service Auto-Tracking State Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceAutoTrackingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetServiceAutoTrackingState + +DESCRIPTION: + The function sends 'PDS/Set Service Auto-Tracking State Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetServiceAutoTrackingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetCOMPortAutoTrackingConfig + +DESCRIPTION: + The function sends 'PDS/Get COM Port Auto-Tracking Config Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetCOMPortAutoTrackingConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 50; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetCOMPortAutoTrackingConfig + +DESCRIPTION: + The function sends 'PDS/Set COM Port Auto-Tracking Config Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetCOMPortAutoTrackingConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSResetPDSData + +DESCRIPTION: + The function sends 'PDS/Reset PDS Data Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSResetPDSData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSinglePositionFix + +DESCRIPTION: + The function sends 'PDS/Single Position Fix Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSinglePositionFix( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetServiceVersion + +DESCRIPTION: + The function sends 'PDS/Get Service Version Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectXTRAData + +DESCRIPTION: + The function sends 'PDS/Inject XTRA Data Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectXTRAData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectPositionData + +DESCRIPTION: + The function sends 'PDS/Inject Position Data Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectPositionData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectWiFiPositionData + +DESCRIPTION: + The function sends 'PDS/Inject Wi-Fi Position Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectWiFiPositionData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetSBASConfig + +DESCRIPTION: + The function sends 'PDS/Get SBAS Config Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSBASConfig + +DESCRIPTION: + The function sends 'PDS/Set SBAS Config Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSendNetworkInitiatedResponse + +DESCRIPTION: + The function sends 'PDS/Send Network Initiated Response Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSendNetworkInitiatedResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectAbsoluteTime + +DESCRIPTION: + The function sends 'PDS/Inject Absolute Time Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectAbsoluteTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectEFSData + +DESCRIPTION: + The function sends 'PDS/Inject EFS Data Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectEFSData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 62; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetDPOConfig + +DESCRIPTION: + The function sends 'PDS/Get DPO Config Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetDPOConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetDPOConfig + +DESCRIPTION: + The function sends 'PDS/Set DPO Config Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetDPOConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetODPConfig + +DESCRIPTION: + The function sends 'PDS/Get ODP Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetODPConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetODPConfig + +DESCRIPTION: + The function sends 'PDS/Set ODP Config Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetODPConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSCancelSinglePositionFix + +DESCRIPTION: + The function sends 'PDS/Cancel Single Position Fix Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSCancelSinglePositionFix( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetGPSState + +DESCRIPTION: + The function sends 'PDS/Get GPS State Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetGPSState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetPPMEventReport + +DESCRIPTION: + The function sends 'PDS/Set PPM Event Report Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPPMEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSPIStreamingReport + +DESCRIPTION: + The function sends 'PDS/Set SPI Streaming Report Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSPIStreamingReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 70; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSPIStatus + +DESCRIPTION: + The function sends 'PDS/Set SPI Status Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSPIStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 71; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetPPMReportingState + +DESCRIPTION: + The function sends 'PDS/Set PPM Reporting State Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPPMReportingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 72; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSForceReceiverOff + +DESCRIPTION: + The function sends 'PDS/Force Receiver Off Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSForceReceiverOff( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 73; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetPositionMethodsState + +DESCRIPTION: + The function sends 'PDS/Get Position Methods State Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetPositionMethodsState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 80; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetPositionMethodsState + +DESCRIPTION: + The function sends 'PDS/Set Position Methods State Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPositionMethodsState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 81; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectSensorData + +DESCRIPTION: + The function sends 'PDS/Inject Sensor Data Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectSensorData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 82; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectTimeSyncData + +DESCRIPTION: + The function sends 'PDS/Inject Time Sync Data Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeSyncData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 83; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetSensorConfig + +DESCRIPTION: + The function sends 'PDS/Get Sensor Config Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSensorConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 84; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSensorConfig + +DESCRIPTION: + The function sends 'PDS/Set Sensor Config Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSensorConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 85; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetSensorNavigation + +DESCRIPTION: + The function sends 'PDS/Get Sensor Navigation Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSensorNavigation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 86; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetNavigationConfig + +DESCRIPTION: + The function sends 'PDS/Set Navigation Config Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetNavigationConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 87; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetWLANBlanking + +DESCRIPTION: + The function sends 'PDS/Set WLAN Blanking Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetWLANBlanking( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 90; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSecurityChallengeReport + +DESCRIPTION: + The function sends 'PDS/Set Security Challenge Report Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityChallengeReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 91; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSecurityChallenge + +DESCRIPTION: + The function sends 'PDS/Set Security Challenge Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityChallenge( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 92; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetSecurityEncryptionConfig + +DESCRIPTION: + The function sends 'PDS/Get Security Encryption Config Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSecurityEncryptionConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 93; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSecurityUpdateRate + +DESCRIPTION: + The function sends 'PDS/Set Security Update Rate Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityUpdateRate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 94; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetCellDatabaseControl + +DESCRIPTION: + The function sends 'PDS/Set Cell Database Control Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetCellDatabaseControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 95; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + AUTHStartEAPSession + +DESCRIPTION: + The function sends 'AUTH/Start EAP Session Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHStartEAPSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 7; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + AUTHSendEAPPacket + +DESCRIPTION: + The function sends 'AUTH/Send EAP Packet Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHSendEAPPacket( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 7; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + AUTHGetEAPSessionKeys + +DESCRIPTION: + The function sends 'AUTH/Get EAP Session Keys Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHGetEAPSessionKeys( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 7; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + AUTHEndEAPSession + +DESCRIPTION: + The function sends 'AUTH/End EAP Session Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHEndEAPSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 7; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + AUTHRunAKA + +DESCRIPTION: + The function sends 'AUTH/Run AKA Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHRunAKA( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 7; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceIndicationRegistration + +DESCRIPTION: + The function sends 'Voice/Indication Registration Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceIndicationRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 3; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceCallOriginate + +DESCRIPTION: + The function sends 'Voice/Call Originate Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallOriginate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceCallEnd + +DESCRIPTION: + The function sends 'Voice/Call End Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallEnd( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceCallAnswer + +DESCRIPTION: + The function sends 'Voice/Call Answer Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallAnswer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCallInfo + +DESCRIPTION: + The function sends 'Voice/Get Call Info Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceSendFlash + +DESCRIPTION: + The function sends 'Voice/Send Flash Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSendFlash( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceBurstDTMF + +DESCRIPTION: + The function sends 'Voice/Burst DTMF Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceBurstDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceStartContinuousDTMF + +DESCRIPTION: + The function sends 'Voice/Start Continuous DTMF Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceStartContinuousDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceStopContinuousDTMF + +DESCRIPTION: + The function sends 'Voice/Stop Continuous DTMF Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceStopContinuousDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceSetPreferredPrivacy + +DESCRIPTION: + The function sends 'Voice/Set Preferred Privacy Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetPreferredPrivacy( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetAllCallInfo + +DESCRIPTION: + The function sends 'Voice/Get All Call Info Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetAllCallInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceManageCalls + +DESCRIPTION: + The function sends 'Voice/Manage Calls Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceManageCalls( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceSetSupplementaryService + +DESCRIPTION: + The function sends 'Voice/Set Supplementary Service Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetSupplementaryService( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCallWaiting + +DESCRIPTION: + The function sends 'Voice/Get Call Waiting Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallWaiting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCallBarring + +DESCRIPTION: + The function sends 'Voice/Get Call Barring Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallBarring( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCLIP + +DESCRIPTION: + The function sends 'Voice/Get CLIP Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCLIP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCLIR + +DESCRIPTION: + The function sends 'Voice/Get CLIR Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCLIR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCallForwarding + +DESCRIPTION: + The function sends 'Voice/Get Call Forwarding Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallForwarding( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceSetCallBarringPassword + +DESCRIPTION: + The function sends 'Voice/Set Call Barring Password Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetCallBarringPassword( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceInitiateUSSD + +DESCRIPTION: + The function sends 'Voice/Initiate USSD Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceInitiateUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceAnswerUSSD + +DESCRIPTION: + The function sends 'Voice/Answer USSD Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAnswerUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceCancelUSSD + +DESCRIPTION: + The function sends 'Voice/Cancel USSD Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCancelUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceSetConfig + +DESCRIPTION: + The function sends 'Voice/Set Config Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetConfig + +DESCRIPTION: + The function sends 'Voice/Get Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceAsyncInitiateUSSD + +DESCRIPTION: + The function sends 'Voice/Async Initiate USSD Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAsyncInitiateUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceBindSubscription + +DESCRIPTION: + The function sends 'Voice/Bind Subscription Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceALSSetLineSwitching + +DESCRIPTION: + The function sends 'Voice/ALS Set Line Switching Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceALSSetLineSwitching( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceALSSelectLine + +DESCRIPTION: + The function sends 'Voice/ALS Select Line Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceALSSelectLine( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 70; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceAOCResetACM + +DESCRIPTION: + The function sends 'Voice/AOC Reset ACM Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCResetACM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 71; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceAOCSetACMMaximum + +DESCRIPTION: + The function sends 'Voice/AOC Set ACM Maximum Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCSetACMMaximum( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 72; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceAOCGetCallMeterInfo + +DESCRIPTION: + The function sends 'Voice/AOC Get Call Meter Info Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCGetCallMeterInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 73; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCOLP + +DESCRIPTION: + The function sends 'Voice/Get COLP Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCOLP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 75; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCOLR + +DESCRIPTION: + The function sends 'Voice/Get COLR Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCOLR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 76; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCNAP + +DESCRIPTION: + The function sends 'Voice/Get CNAP Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCNAP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 77; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceManageIPCalls + +DESCRIPTION: + The function sends 'Voice/Manage IP Calls Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceManageIPCalls( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 78; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2Reset + +DESCRIPTION: + The function sends 'CAT2/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2Reset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SetEventReport + +DESCRIPTION: + The function sends 'CAT2/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2GetServiceState + +DESCRIPTION: + The function sends 'CAT2/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SendTerminalResponse + +DESCRIPTION: + The function sends 'CAT2/Send Terminal Response Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2EnvelopeCommand + +DESCRIPTION: + The function sends 'CAT2/Envelope Command Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2EnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2GetEventReport + +DESCRIPTION: + The function sends 'CAT2/Get Event Report Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SendDecodedTerminalResponse + +DESCRIPTION: + The function sends 'CAT2/Send Decoded Terminal Response Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendDecodedTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SendDecodedEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT2/Send Decoded Envelope Command Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendDecodedEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2EventConfirmation + +DESCRIPTION: + The function sends 'CAT2/Event Confirmation Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2EventConfirmation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SCWSOpenChannel + +DESCRIPTION: + The function sends 'CAT2/SCWS Open Channel Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSOpenChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SCWSCloseChannel + +DESCRIPTION: + The function sends 'CAT2/SCWS Close Channel Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSCloseChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SCWSSendData + +DESCRIPTION: + The function sends 'CAT2/SCWS Send Data Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSSendData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SCWSDataAvailable + +DESCRIPTION: + The function sends 'CAT2/SCWS Data Available Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSDataAvailable( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SCWSChannelStatus + +DESCRIPTION: + The function sends 'CAT2/SCWS Channel Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSChannelStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMReset + +DESCRIPTION: + The function sends 'UIM/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMReadTransparent + +DESCRIPTION: + The function sends 'UIM/Read Transparent Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReadTransparent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMReadRecord + +DESCRIPTION: + The function sends 'UIM/Read Record Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReadRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMWriteTransparent + +DESCRIPTION: + The function sends 'UIM/Write Transparent Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMWriteTransparent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMWriteRecord + +DESCRIPTION: + The function sends 'UIM/Write Record Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMWriteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetFileAttributes + +DESCRIPTION: + The function sends 'UIM/Get File Attributes Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetFileAttributes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSetPINProtection + +DESCRIPTION: + The function sends 'UIM/Set PIN Protection Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetPINProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMVerifyPIN + +DESCRIPTION: + The function sends 'UIM/Verify PIN Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMVerifyPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMUnblockPIN + +DESCRIPTION: + The function sends 'UIM/Unblock PIN Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMChangePIN + +DESCRIPTION: + The function sends 'UIM/Change PIN Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangePIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMDepersonalization + +DESCRIPTION: + The function sends 'UIM/Depersonalization Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMDepersonalization( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMRefreshRegister + +DESCRIPTION: + The function sends 'UIM/Refresh Register Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshRegister( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMRefreshOK + +DESCRIPTION: + The function sends 'UIM/Refresh OK Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshOK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMRefreshComplete + +DESCRIPTION: + The function sends 'UIM/Refresh Complete Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshComplete( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetLastRefreshEvent + +DESCRIPTION: + The function sends 'UIM/Get Last Refresh Event Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetLastRefreshEvent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMEventRegistration + +DESCRIPTION: + The function sends 'UIM/Event Registration Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMEventRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetCardStatus + +DESCRIPTION: + The function sends 'UIM/Get Card Status Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetCardStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMPowerDown + +DESCRIPTION: + The function sends 'UIM/Power Down Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMPowerDown( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMPowerUp + +DESCRIPTION: + The function sends 'UIM/Power Up Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMPowerUp( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMAuthenticate + +DESCRIPTION: + The function sends 'UIM/Authenticate Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMAuthenticate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMCloseSession + +DESCRIPTION: + The function sends 'UIM/Close Session Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMCloseSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetServiceStatus + +DESCRIPTION: + The function sends 'UIM/Get Service Status Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSetServiceStatus + +DESCRIPTION: + The function sends 'UIM/Set Service Status Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMChangeProvisioningSession + +DESCRIPTION: + The function sends 'UIM/Change Provisioning Session Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangeProvisioningSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetLabel + +DESCRIPTION: + The function sends 'UIM/Get Label Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetLabel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetConfiguration + +DESCRIPTION: + The function sends 'UIM/Get Configuration Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSendADPU + +DESCRIPTION: + The function sends 'UIM/Send ADPU Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSendADPU( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSAPConnection + +DESCRIPTION: + The function sends 'UIM/SAP Connection Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSAPConnection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSAPRequest + +DESCRIPTION: + The function sends 'UIM/SAP Request Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSAPRequest( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMLogicalChannel + +DESCRIPTION: + The function sends 'UIM/Logical Channel Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMLogicalChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSubscriptionOK + +DESCRIPTION: + The function sends 'UIM/Subscription OK Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSubscriptionOK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetATR + +DESCRIPTION: + The function sends 'UIM/Get ATR Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetATR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMSetIndicationRegistrationState + +DESCRIPTION: + The function sends 'PBM/Set Indication Registration State Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetIndicationRegistrationState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetCapabilities + +DESCRIPTION: + The function sends 'PBM/Get Capabilities Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 2; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetAllCapabilities + +DESCRIPTION: + The function sends 'PBM/Get All Capabilities Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAllCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 3; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMReadRecords + +DESCRIPTION: + The function sends 'PBM/Read Records Request' (0x0004) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMReadRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 4; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMWriteRecord + +DESCRIPTION: + The function sends 'PBM/Write Record Request' (0x0005) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMWriteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 5; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMDeleteRecord + +DESCRIPTION: + The function sends 'PBM/Delete Record Request' (0x0006) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMDeleteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 6; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMDeleteAllRecords + +DESCRIPTION: + The function sends 'PBM/Delete All Records Request' (0x0007) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMDeleteAllRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 7; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMSearchRecords + +DESCRIPTION: + The function sends 'PBM/Search Records Request' (0x0008) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSearchRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 8; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetEmergencyList + +DESCRIPTION: + The function sends 'PBM/Get Emergency List Request' (0x000E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetEmergencyList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 14; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetAllGroups + +DESCRIPTION: + The function sends 'PBM/Get All Groups Request' (0x000F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAllGroups( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 15; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMSetGroupInfo + +DESCRIPTION: + The function sends 'PBM/Set Group Info Request' (0x0010) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetGroupInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 16; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetState + +DESCRIPTION: + The function sends 'PBM/Get State Request' (0x0011) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 17; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMReadAllHiddenRecords + +DESCRIPTION: + The function sends 'PBM/Read All Hidden Records Request' (0x0012) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMReadAllHiddenRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 18; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetNextEmptyRecordID + +DESCRIPTION: + The function sends 'PBM/Get Next Empty Record ID Request' (0x0014) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetNextEmptyRecordID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 20; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetNextRecordID + +DESCRIPTION: + The function sends 'PBM/Get Next Record ID Request' (0x0015) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetNextRecordID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 21; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetAASList + +DESCRIPTION: + The function sends 'PBM/Get AAS List Request' (0x0016) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAASList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 22; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMSetAAS + +DESCRIPTION: + The function sends 'PBM/Set AAS Request' (0x0017) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetAAS( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 23; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMBindSubscription + +DESCRIPTION: + The function sends 'PBM/Bind Subscription Request' (0x001A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 26; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCClientRevision + +DESCRIPTION: + The function sends 'LOC/Client Revision Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCClientRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCRegisterEvents + +DESCRIPTION: + The function sends 'LOC/Register Events Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCRegisterEvents( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCStart + +DESCRIPTION: + The function sends 'LOC/Start Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCStart( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCStop + +DESCRIPTION: + The function sends 'LOC/Stop Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCStop( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetServiceRevision + +DESCRIPTION: + The function sends 'LOC/Get Service Revision Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetServiceRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 50; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetFixCriteria + +DESCRIPTION: + The function sends 'LOC/Get Fix Criteria Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetFixCriteria( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCProvideNIUserResponse + +DESCRIPTION: + The function sends 'LOC/Provide NI User Response Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideNIUserResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectPredictedOrbitsData + +DESCRIPTION: + The function sends 'LOC/Inject Predicted Orbits Data Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectPredictedOrbitsData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetPredictedOrbitsDataSource + +DESCRIPTION: + The function sends 'LOC/Get Predicted Orbits Data Source Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetPredictedOrbitsDataSource( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetPredictedOrbitsDataValidity + +DESCRIPTION: + The function sends 'LOC/Get Predicted Orbits Data Validity Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetPredictedOrbitsDataValidity( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectUTCTime + +DESCRIPTION: + The function sends 'LOC/Inject UTC Time Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectUTCTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectPosition + +DESCRIPTION: + The function sends 'LOC/Inject Position Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetEngineLock + +DESCRIPTION: + The function sends 'LOC/Set Engine Lock Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetEngineLock( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetEngineLock + +DESCRIPTION: + The function sends 'LOC/Get Engine Lock Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetEngineLock( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetSBASConfig + +DESCRIPTION: + The function sends 'LOC/Set SBAS Config Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetSBASConfig + +DESCRIPTION: + The function sends 'LOC/Get SBAS Config Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetNMEATypes + +DESCRIPTION: + The function sends 'LOC/Set NMEA Types Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetNMEATypes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 62; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetNMEATypes + +DESCRIPTION: + The function sends 'LOC/Get NMEA Types Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetNMEATypes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetLowPowerMode + +DESCRIPTION: + The function sends 'LOC/Set Low Power Mode Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetLowPowerMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetLowPowerMode + +DESCRIPTION: + The function sends 'LOC/Get Low Power Mode Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetLowPowerMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetLocationServer + +DESCRIPTION: + The function sends 'LOC/Set Location Server Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetLocationServer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetLocationServer + +DESCRIPTION: + The function sends 'LOC/Get Location Server Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetLocationServer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCDeleteAssistData + +DESCRIPTION: + The function sends 'LOC/Delete Assist Data Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCDeleteAssistData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetXTRATSessionControl + +DESCRIPTION: + The function sends 'LOC/Set XTRA-T Session Control Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetXTRATSessionControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOC + +DESCRIPTION: + The function sends 'LOC' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 70; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectWiFiPosition + +DESCRIPTION: + The function sends 'LOC/Inject Wi-Fi Position Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectWiFiPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 71; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCProvideWiFiStatus + +DESCRIPTION: + The function sends 'LOC/Provide Wi-Fi Status Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideWiFiStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 72; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetRegisteredEvents + +DESCRIPTION: + The function sends 'LOC/Get Registered Events Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetRegisteredEvents( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 73; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetOperationMode + +DESCRIPTION: + The function sends 'LOC/Set Operation Mode Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetOperationMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 74; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetOperationMode + +DESCRIPTION: + The function sends 'LOC/Get Operation Mode Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetOperationMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 75; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetSPIStatus + +DESCRIPTION: + The function sends 'LOC/Set SPI Status Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSPIStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 76; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectSensorData + +DESCRIPTION: + The function sends 'LOC/Inject Sensor Data Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectSensorData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 77; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectTimeSyncData + +DESCRIPTION: + The function sends 'LOC/Inject Time Sync Data Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectTimeSyncData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 78; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetCradleMountConfig + +DESCRIPTION: + The function sends 'LOC/Set Cradle Mount Config Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetCradleMountConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 79; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetCradleMountConfig + +DESCRIPTION: + The function sends 'LOC/Get Cradle Mount Config Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetCradleMountConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 80; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetExternalPowerConfig + +DESCRIPTION: + The function sends 'LOC/Set External Power Config Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetExternalPowerConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 81; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetExternalPowerConfig + +DESCRIPTION: + The function sends 'LOC/Get External Power Config Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetExternalPowerConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 82; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCProvideConnectionStatus + +DESCRIPTION: + The function sends 'LOC/Provide Connection Status Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideConnectionStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 83; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetProtocolConfigParameters + +DESCRIPTION: + The function sends 'LOC/Set Protocol Config Parameters Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetProtocolConfigParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 84; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetProtocolConfigParameters + +DESCRIPTION: + The function sends 'LOC/Get Protocol Config Parameters Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetProtocolConfigParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 85; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetSensorControlConfig + +DESCRIPTION: + The function sends 'LOC/Set Sensor Control Config Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorControlConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 86; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetSensorControlConfig + +DESCRIPTION: + The function sends 'LOC/Get Sensor Control Config Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorControlConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 87; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetSensorProperties + +DESCRIPTION: + The function sends 'LOC/Set Sensor Properties Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorProperties( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 88; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetSensorProperties + +DESCRIPTION: + The function sends 'LOC/Get Sensor Properties Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorProperties( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 89; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetSensorPerformanceConfig + +DESCRIPTION: + The function sends 'LOC/Set Sensor Performance Config Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorPerformanceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 90; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetSensorPerformanceConfig + +DESCRIPTION: + The function sends 'LOC/Get Sensor Performance Config Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorPerformanceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 91; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATReset + +DESCRIPTION: + The function sends 'CAT/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSetEventReport + +DESCRIPTION: + The function sends 'CAT/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATGetServiceState + +DESCRIPTION: + The function sends 'CAT/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSendTerminalResponse + +DESCRIPTION: + The function sends 'CAT/Send Terminal Response Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT/Envelope Command Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATGetEventReport + +DESCRIPTION: + The function sends 'CAT/Get Event Report Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSendDecodedTerminalResponse + +DESCRIPTION: + The function sends 'CAT/Send Decoded Terminal Response Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendDecodedTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSendDecodedEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT/Send Decoded Envelope Command Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendDecodedEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATEventConfirmation + +DESCRIPTION: + The function sends 'CAT/Event Confirmation Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATEventConfirmation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSCWSOpenChannel + +DESCRIPTION: + The function sends 'CAT/SCWS Open Channel Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSOpenChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSCWSCloseChannel + +DESCRIPTION: + The function sends 'CAT/SCWS Close Channel Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSCloseChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSCWSSendData + +DESCRIPTION: + The function sends 'CAT/SCWS Send Data Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSSendData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSCWSDataAvailable + +DESCRIPTION: + The function sends 'CAT/SCWS Data Available Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSDataAvailable( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSCWSChannelStatus + +DESCRIPTION: + The function sends 'CAT/SCWS Channel Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSChannelStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + RMSReset + +DESCRIPTION: + The function sends 'RMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 225; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + RMSGetSMSWake + +DESCRIPTION: + The function sends 'RMS/Get SMS Wake Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSGetSMSWake( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 225; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + RMSSetSMSWake + +DESCRIPTION: + The function sends 'RMS/Set SMS Wake Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSSetSMSWake( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 225; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMAReset + +DESCRIPTION: + The function sends 'OMA/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMASetEventReport + +DESCRIPTION: + The function sends 'OMA/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMAStartSession + +DESCRIPTION: + The function sends 'OMA/Start Session Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAStartSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMACancelSession + +DESCRIPTION: + The function sends 'OMA/Cancel Session Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMACancelSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMAGetSessionInfo + +DESCRIPTION: + The function sends 'OMA/Get Session Info Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAGetSessionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMASendSelection + +DESCRIPTION: + The function sends 'OMA/Send Selection Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASendSelection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMAGetFeatures + +DESCRIPTION: + The function sends 'OMA/Get Features Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAGetFeatures( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMASetFeatures + +DESCRIPTION: + The function sends 'OMA/Set Features Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASetFeatures( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} diff --git a/gobi-api/Gobi_2011-11-28-1533/Readme.txt b/gobi-api/Gobi_2011-11-28-1533/Readme.txt new file mode 100755 index 0000000..7e3b458 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Readme.txt @@ -0,0 +1,38 @@ +Gobi Extensible API 2011-11-28-1533 + +This readme covers important information concerning +the Gobi Extensible API. + +Table of Contents + +1. What's new in this release +2. Known issues +3. Build steps + +------------------------------------------------------------------------------- + +1. WHAT'S NEW + +Initial Release (Gobi Extensible API 2011-11-28-1533) +a. Initial beta code release + +------------------------------------------------------------------------------- + +2. KNOWN ISSUES + +No known issues. + +------------------------------------------------------------------------------- + +3. BUILD STEPS + +a. Start in the 'GobiConnectionMgmt' folder +b. For Android, run: + make Android ANDROID_PATH= + For x86, run: + make + +------------------------------------------------------------------------------- + + + diff --git a/gobi-api/Gobi_2011-11-28-1533/Shared/GobiError.h b/gobi-api/Gobi_2011-11-28-1533/Shared/GobiError.h new file mode 100755 index 0000000..5abd51d --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Shared/GobiError.h @@ -0,0 +1,137 @@ +/*=========================================================================== +FILE: + GobiError.h + +DESCRIPTION: + QUALCOMM Gobi Errors + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "QMIEnum.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// eGobiError Enumeration +// Gobi API Error Enumeration +/*=========================================================================*/ +enum eGobiError +{ + eGOBI_ERR_ENUM_BEGIN = -1, + + eGOBI_ERR_NONE, // 00 Success + eGOBI_ERR_GENERAL, // 01 General error + eGOBI_ERR_INTERNAL, // 02 Internal error + eGOBI_ERR_MEMORY, // 03 Memory error + eGOBI_ERR_INVALID_ARG, // 04 Invalid argument + eGOBI_ERR_BUFFER_SZ, // 05 Buffer too small + eGOBI_ERR_NO_DEVICE, // 06 Unable to detect device + eGOBI_ERR_INVALID_DEVID, // 07 Invalid device ID + eGOBI_ERR_NO_CONNECTION, // 08 No connection to device + eGOBI_ERR_IFACE, // 09 Unable to obtain required interace + eGOBI_ERR_CONNECT, // 10 Unable to connect to interface + eGOBI_ERR_REQ_SCHEDULE, // 11 Unable to schedule request + eGOBI_ERR_REQUEST, // 12 Error sending request + eGOBI_ERR_RESPONSE, // 13 Error receiving response + eGOBI_ERR_REQUEST_TO, // 14 Timeout while sending request + eGOBI_ERR_RESPONSE_TO, // 15 Timeout while receiving response + eGOBI_ERR_MALFORMED_RSP, // 16 Malformed response received + eGOBI_ERR_INVALID_RSP, // 17 Invalid/error response received + eGOBI_ERR_INVALID_FILE, // 18 Invalid file path + eGOBI_ERR_FILE_OPEN, // 19 Unable to open file + eGOBI_ERR_FILE_COPY, // 20 Unable to copy file + eGOBI_ERR_QDL_SCM, // 21 Unable to open service control mgr + eGOBI_ERR_NO_QDL_SVC, // 22 Unable to detect QDL service + eGOBI_ERR_NO_QDL_SVC_INFO, // 23 Unable to obtain QDL service info + eGOBI_ERR_NO_QDL_SVC_PATH, // 24 Unable to locate QSL service + eGOBI_ERR_QDL_SVC_CFG, // 25 Unable to reconfigure QDL service + eGOBI_ERR_QDL_SVC_IFACE, // 26 Unable to interface to QDL service + eGOBI_ERR_OFFLINE, // 27 Unable to set device offline + eGOBI_ERR_RESET, // 28 Unable to reset device + eGOBI_ERR_NO_SIGNAL, // 29 No available signal + eGOBI_ERR_MULTIPLE_DEVICES, // 30 Multiple devices detected + eGOBI_ERR_DRIVER, // 31 Error interfacing to driver + eGOBI_ERR_NO_CANCELABLE_OP, // 32 No cancelable operation is pending + eGOBI_ERR_CANCEL_OP, // 33 Error canceling outstanding operation + eGOBI_ERR_QDL_CRC, // 34 QDL image data CRC error + eGOBI_ERR_QDL_PARSING, // 35 QDL image data parsing error + eGOBI_ERR_QDL_AUTH, // 36 QDL image authentication error + eGOBI_ERR_QDL_WRITE, // 37 QDL image write error + eGOBI_ERR_QDL_OPEN_SIZE, // 38 QDL image size error + eGOBI_ERR_QDL_OPEN_TYPE, // 39 QDL image type error + eGOBI_ERR_QDL_OPEN_PROT, // 40 QDL memory protection error + eGOBI_ERR_QDL_OPEN_SKIP, // 41 QDL image not required + eGOBI_ERR_QDL_ERR_GENERAL, // 42 QDL general error + eGOBI_ERR_QDL_BAR_MODE, // 43 QDL BAR mode error + + eGOBI_ERR_ENUM_END, + + // Offset from which mapped QMI error codes start from (see eQMIErrorCode) + eGOBI_ERR_QMI_OFFSET = 1000, +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eGobiError validity check + +PARAMETERS: + ec [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eGobiError ec ) +{ + bool retVal = false; + if (ec > eGOBI_ERR_ENUM_BEGIN && ec < eGOBI_ERR_ENUM_END) + { + retVal = true; + } + + if (ec >= eGOBI_ERR_QMI_OFFSET) + { + ULONG tmp = (ULONG)ec - (ULONG)eGOBI_ERR_QMI_OFFSET; + retVal = ::IsValid( (eQMIErrorCode)tmp ); + } + + return retVal; +}; \ No newline at end of file diff --git a/gobi-api/Gobi_2011-11-28-1533/Shared/GobiQMICore.cpp b/gobi-api/Gobi_2011-11-28-1533/Shared/GobiQMICore.cpp new file mode 100755 index 0000000..ab8d3b7 --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Shared/GobiQMICore.cpp @@ -0,0 +1,531 @@ +/*=========================================================================== +FILE: + GobiQMICore.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Stdafx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" +#include "ProtocolNotification.h" + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiQMICore (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiQMICore::cGobiQMICore() + : mLastError( eGOBI_ERR_NONE ) +{ + mInterface[0] = 0; +} + +/*=========================================================================== +METHOD: + ~cGobiQMICore (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + BOOL +===========================================================================*/ +cGobiQMICore::~cGobiQMICore() +{ + Cleanup(); +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Initialize() +{ + return true; +} + +/*=========================================================================== +METHOD: + Cleanup (Public Method) + +DESCRIPTION: + Cleanup the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Cleanup() +{ + Disconnect(); + return true; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified Gobi device + +PARAMETERS: + pQMIFile [ I ] - Gobi device interface to connect to + services [ I ] - QMI services to connect to + +RETURN VALUE: + std::set - Services successfuly configured +===========================================================================*/ +std::set cGobiQMICore::Connect( + LPCSTR pInterface, + std::set & services ) +{ + // The services we successfully connected to + std::set retServices; + + // Clear last error recorded + ClearLastError(); + + size_t ifaceLen = strnlen( pInterface, MAX_PATH ) + 1; + if (ifaceLen >= (size_t)MAX_PATH) + { + mLastError = eGOBI_ERR_INVALID_ARG; + return retServices; + } + + // Allocate configured QMI servers + std::set ::const_iterator pIter = services.begin(); + while (pIter != services.end()) + { + cQMIProtocolServer * pSvr = 0; + pSvr = new cQMIProtocolServer( *pIter, 8192, 512 ); + if (pSvr != 0) + { + // Initialize server (we don't care about the return code + // since the following Connect() call will fail if we are + // unable to initialize the server) + pSvr->Initialize(); + + bool bRC = pSvr->Connect( pInterface ); + if (bRC == true) + { + sServerInfo si( pSvr ); + std::pair entry( *pIter, si ); + mServers.insert( entry ); + + retServices.insert( *pIter ); + } + } + + pIter++; + } + + // All servers fail? + if (retServices.size() == 0) + { + // Yes, disconnect them all + Disconnect(); + + // ... and set the error code + mLastError = eGOBI_ERR_CONNECT; + } + + memcpy( mInterface, pInterface, ifaceLen ); + return retServices; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the currently connected Gobi device + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Disconnect() +{ + // Clear last error recorded + ClearLastError(); + + // Clear device interface + mInterface[0] = 0; + + // Assume failure + bool bRC = false; + if (mServers.size() == 0) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return bRC; + } + + // Disconnect/clean-up all configured QMI servers + std::map ::iterator pIter; + pIter = mServers.begin(); + + while (pIter != mServers.end()) + { + sServerInfo & si = pIter->second; + cQMIProtocolServer * pSvr = si.mpServer; + if (pSvr != 0) + { + pSvr->Disconnect(); + pSvr->Exit(); + + delete pSvr; + } + + si.mLogsProcessed = 0; + pIter++; + } + + mServers.clear(); + + bRC = true; + return bRC; +} + +/*=========================================================================== +METHOD: + Send (Public Method) + +DESCRIPTION: + Send a request using the specified QMI protocol server and wait for (and + then return) the response + +PARAMETERS: + svcID [ I ] - QMI service type + msgID [ I ] - QMI message ID + to [ I ] - Timeout value (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + eGobiError - The result +===========================================================================*/ +eGobiError cGobiQMICore::Send( + ULONG svcID, + ULONG msgID, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + // Clear last error recorded + ClearLastError(); + + if (msgID > 0xffff) + { + mLastError = eGOBI_ERR_INVALID_ARG; + return mLastError; + } + + sSharedBuffer * pRequest = 0; + pRequest = sQMIServiceBuffer::BuildBuffer( (eQMIService)svcID, + (WORD)msgID, + false, + false, + pIn, + inLen ); + + if (pRequest == 0) + { + mLastError = eGOBI_ERR_MEMORY; + return mLastError; + } + + // We use the event based notification approach + cSyncQueue evts( 12, true ); + cProtocolQueueNotification pn( &evts ); + + // Build the request object + sProtocolRequest req( pRequest, 0, to, 1, 1, &pn ); + if (to == 0) + { + mLastError = eGOBI_ERR_INTERNAL; + return mLastError; + } + + // Grab the server + std::map ::iterator pSvrIter; + pSvrIter = mServers.find( (eQMIService)svcID ); + if (pSvrIter == mServers.end()) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return mLastError; + } + + sServerInfo & si = pSvrIter->second; + cQMIProtocolServer * pSvr = si.mpServer; + if (pSvr == 0 || pSvr->IsConnected() == false) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return mLastError; + } + + // Grab the log from the server + const cProtocolLog & protocolLog = pSvr->GetLog(); + + // Schedule the request + ULONG reqID = pSvr->AddRequest( req ); + if (reqID == INVALID_REQUEST_ID) + { + mLastError = eGOBI_ERR_REQ_SCHEDULE; + return mLastError; + } + + // Store for external cancel + si.mRequestID = reqID; + + bool bReq = false; + bool bExit = false; + DWORD idx; + + // Returned response + sProtocolBuffer rsp; + + // Process up to the indicated timeout + cEvent & sigEvt = evts.GetSignalEvent(); + while (bExit == false) + { + int wc = sigEvt.Wait( to, idx ); + if (wc == ETIME) + { + if (bReq == true) + { + mLastError = eGOBI_ERR_RESPONSE_TO; + } + else + { + mLastError = eGOBI_ERR_REQUEST_TO; + } + break; + } + else if (wc != 0) + { + mLastError = eGOBI_ERR_INTERNAL; + break; + } + + sProtocolNotificationEvent evt; + bool bEvt = evts.GetElement( idx, evt ); + if (bEvt == false) + { + mLastError = eGOBI_ERR_INTERNAL; + bExit = true; + break; + } + + switch (evt.mEventType) + { + case ePROTOCOL_EVT_REQ_ERR: + mLastError = eGOBI_ERR_REQUEST; + bExit = true; + break; + + case ePROTOCOL_EVT_RSP_ERR: + mLastError = eGOBI_ERR_RESPONSE; + bExit = true; + break; + + case ePROTOCOL_EVT_REQ_SENT: + { + // Grab the as-sent request + DWORD id = evt.mParam2; + sProtocolBuffer tmpReq = protocolLog.GetBuffer( id ); + sSharedBuffer * pTmpRequest = tmpReq.GetSharedBuffer(); + if (pTmpRequest != 0) + { + // Grab the transaction ID + sQMIServiceBuffer actualReq( pTmpRequest ); + si.mRequestTXID = actualReq.GetTransactionID(); + } + + bReq = true; + } + break; + + case ePROTOCOL_EVT_RSP_RECV: + // Success! + rsp = protocolLog.GetBuffer( evt.mParam2 ); + bExit = true; + break; + } + } + + if ( (mLastError == eGOBI_ERR_INTERNAL) + || (mLastError == eGOBI_ERR_REQUEST_TO) + || (mLastError == eGOBI_ERR_RESPONSE_TO) ) + { + // Remove the request as our protocol notification object is + // about to go out of scope and hence be destroyed + pSvr->RemoveRequest( reqID ); + } + + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + mLastError = eGOBI_ERR_MALFORMED_RSP; + return mLastError; + } + + // Caller might not be interested in actual output (beyond error code) + ULONG maxSz = 0; + if (pOutLen != 0) + { + maxSz = *pOutLen; + } + + if (maxSz > 0) + { + // TLV 2 is always present + ULONG needSz = 0; + const BYTE * pData = (const BYTE *)qmiRsp.GetRawContents( needSz ); + if (needSz == 0 || pData == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pOutLen = needSz; + if (needSz > maxSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pOut, pData, needSz ); + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + mLastError = eGOBI_ERR_MALFORMED_RSP; + return mLastError; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Success! + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + CancelSend (Public Method) + +DESCRIPTION: + Cancel the most recent in-progress Send() based operation + +PARAMETERS: + svcID [ I ] - Service whose outstanding request is to be cancelled + pTXID [ O ] - QMI transaction ID of outstanding request + +RETURN VALUE: + eGobiError - The result +===========================================================================*/ +eGobiError cGobiQMICore::CancelSend( + ULONG svcID, + ULONG * pTXID ) +{ + // Grab the server + std::map ::iterator pSvrIter; + pSvrIter = mServers.find( (eQMIService)svcID ); + if (pSvrIter == mServers.end()) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return mLastError; + } + + sServerInfo & si = pSvrIter->second; + cQMIProtocolServer * pSvr = si.mpServer; + if (pSvr == 0) + { + return eGOBI_ERR_INTERNAL; + } + + if (si.mRequestID == 0xffffffff) + { + return eGOBI_ERR_NO_CANCELABLE_OP; + } + + bool bRemove = pSvr->RemoveRequest( si.mRequestID ); + if (bRemove == false) + { + return eGOBI_ERR_CANCEL_OP; + } + + if (pTXID != 0) + { + *pTXID = si.mRequestTXID; + } + + return eGOBI_ERR_NONE; +} + + + diff --git a/gobi-api/Gobi_2011-11-28-1533/Shared/GobiQMICore.h b/gobi-api/Gobi_2011-11-28-1533/Shared/GobiQMICore.h new file mode 100755 index 0000000..f0e650a --- /dev/null +++ b/gobi-api/Gobi_2011-11-28-1533/Shared/GobiQMICore.h @@ -0,0 +1,192 @@ +/*=========================================================================== +FILE: + GobiQMICore.h + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "QMIProtocolServer.h" +#include "SyncQueue.h" +#include "GobiError.h" + +/*=========================================================================*/ +// Class cGobiQMICore +/*=========================================================================*/ +class cGobiQMICore +{ + public: + // Constructor + cGobiQMICore(); + + // Destructor + virtual ~cGobiQMICore(); + + // Initialize the object + virtual bool Initialize(); + + // Cleanup the object + virtual bool Cleanup(); + + // (Inline) Return the server as determined by the service type + cQMIProtocolServer * GetServer( eQMIService svc ) + { + cQMIProtocolServer * pSvr = 0; + + std::map ::const_iterator pIter; + pIter = mServers.find( svc ); + + if (pIter != mServers.end()) + { + const sServerInfo & si = pIter->second; + pSvr = si.mpServer; + } + + return pSvr; + }; + + // (Inline) Clear last error recorded + void ClearLastError() + { + mLastError = eGOBI_ERR_NONE; + }; + + // (Inline) Get last error recorded + eGobiError GetLastError() + { + return mLastError; + }; + + // (Inline) Return the last recorded error (if this happens to indicate + // that no error occurred then return eGOBI_ERR_INTERNAL) + eGobiError GetCorrectedLastError() + { + eGobiError ec = GetLastError(); + if (ec == eGOBI_ERR_NONE) + { + ec = eGOBI_ERR_INTERNAL; + } + + return ec; + }; + + // (Inline) Return the correct QMI error (if this happens to indicate + // that no error occurred then return the mapped eQMI_ERR_INTERNAL + // value) + eGobiError GetCorrectedQMIError( ULONG qmiErrorCode ) + { + ULONG ec = (ULONG)eQMI_ERR_INTERNAL + (ULONG)eGOBI_ERR_QMI_OFFSET; + if (qmiErrorCode != (ULONG)eQMI_ERR_NONE) + { + ec = qmiErrorCode + (ULONG)eGOBI_ERR_QMI_OFFSET; + } + + return (eGobiError)ec; + }; + + // Connect to the specified Gobi device interface + virtual std::set Connect( + LPCSTR pInterface, + std::set & services ); + + // Disconnect from the currently connected device interface + virtual bool Disconnect(); + + // Send a request using the specified QMI protocol server and wait + // for (and then return) the response + eGobiError Send( + ULONG svcID, + ULONG msgID, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + + // Cancel the most recent in-progress Send() based operation + eGobiError CancelSend( + ULONG svcID, + ULONG * pTXID ); + + protected: + /* Device interface */ + CHAR mInterface[MAX_PATH]; + + /* QMI protocol server/protocol server log count */ + struct sServerInfo + { + public: + // Constructor (default) + sServerInfo() + : mpServer( 0 ), + mLogsProcessed( 0 ), + mRequestID( 0xffffffff ), + mRequestTXID( 0xffffffff ) + { }; + + // Constructor (parameterized) + sServerInfo( cQMIProtocolServer * pServer ) + : mpServer( pServer ), + mLogsProcessed( 0 ), + mRequestID( 0xffffffff ), + mRequestTXID( 0xffffffff ) + { }; + + /* Protocol server */ + cQMIProtocolServer * mpServer; + + /* Protocol server logs processed */ + ULONG mLogsProcessed; + + /* Last scheduled request ID */ + ULONG mRequestID; + + /* Last schedule request QMI transaction ID */ + ULONG mRequestTXID; + }; + + /* QMI protocol servers */ + std::map mServers; + + /* Last error recorded */ + eGobiError mLastError; +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/Comm.cpp b/gobi-api/Gobi_2012-06-18-1054/Core/Comm.cpp new file mode 100755 index 0000000..7afacf1 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/Comm.cpp @@ -0,0 +1,642 @@ +/*=========================================================================== +FILE: + Comm.cpp + +DESCRIPTION: + Implementation of cComm class + +PUBLIC CLASSES AND METHODS: + cComm + This class wraps low level port communications + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "Comm.h" +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +// Thread commands +#define START_READ_CMD 0 +#define STOP_READ_CMD 1 +#define EXIT_CMD 2 + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + RxThread (Free Method) + +DESCRIPTION: + Thread for simulating asynchronous reads + +PARAMETERS: + pData [ I ] Asynchronous read object + +RETURN VALUE: + void * - thread exit value (always 0) +===========================================================================*/ +void * RxThread( void * pData ) +{ + cComm * pComm = (cComm*)pData; + if (pComm == NULL || pComm->IsValid() == false) + { + return 0; + } + + fd_set inputSet, outputSet; + FD_ZERO( &inputSet ); + FD_SET( pComm->mCommandPipe[READING], &inputSet ); + int largestFD = pComm->mCommandPipe[READING]; + + int status = 0; + while (true) + { + // No FD_COPY() available + memcpy( &outputSet, &inputSet, sizeof( fd_set ) ); + + status = select( largestFD + 1, &outputSet, NULL, NULL, NULL ); + if (status <= 0) + { + TRACE( "error %d in select, errno %d\n", status, errno ); + break; + } + + if (FD_ISSET( pComm->mCommandPipe[READING], &outputSet ) == true) + { + // Read from the pipe + BYTE cmd; + status = read( pComm->mCommandPipe[READING], &cmd, 1 ); + if (status != 1) + { + TRACE( "cmd error %d\n", status ); + break; + } + + if (cmd == START_READ_CMD) + { + FD_SET( pComm->mPort, &inputSet ); + largestFD = std::max( pComm->mPort, + pComm->mCommandPipe[READING] ); + } + else if (cmd == STOP_READ_CMD) + { + FD_CLR( pComm->mPort, &inputSet ); + largestFD = pComm->mCommandPipe[READING]; + } + else + { + // EXIT_CMD or anything else + break; + } + } + else if (FD_ISSET( pComm->mPort, &outputSet ) == true) + { + // Stop watching for read data + FD_CLR( pComm->mPort, &inputSet ); + largestFD = pComm->mCommandPipe[READING]; + + // Perform a read + status = read( pComm->mPort, + pComm->mpBuffer, + pComm->mBuffSz ); + + cIOCallback * pCallback = pComm->mpRxCallback; + pComm->mpRxCallback = 0; + + if (pCallback == (cIOCallback *)1) + { + // We wanted to read, but not to be notified + } + else if (status >= 0) + { + pCallback->IOComplete( 0, status ); + } + else + { + pCallback->IOComplete( status, 0 ); + } + } + } + + return 0; +}; + +/*=========================================================================*/ +// cComm Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cComm (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cComm::cComm() + : mPortName( "" ), + mPort( INVALID_HANDLE_VALUE ), + mbCancelWrite( false ), + mpBuffer( 0 ), + mBuffSz( 0 ), + mRxThreadID( 0 ) +{ + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; +} + +/*=========================================================================== +METHOD: + ~cComm (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cComm::~cComm() +{ + // Disconnect from current port + Disconnect(); + + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + Bool +===========================================================================*/ +bool cComm::IsValid() +{ + // Nothing to do, dependant on extended class functionality + return true; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified port + +PARAMETERS: + pPort [ I ] - Name of port to open (IE: /dev/qcqmi0) + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::Connect( LPCSTR pPort ) +{ + if (IsValid() == false || pPort == 0 || pPort[0] == 0) + { + return false; + } + + if (mPort != INVALID_HANDLE_VALUE) + { + Disconnect(); + } + + // Initialize command pipe for read thread + int nRet = pipe( mCommandPipe ); + if (nRet != 0) + { + TRACE( "cComm:Connect() pipe creation failed %d\n", nRet ); + return false; + } + + // Start the read thread + nRet = pthread_create( &mRxThreadID, + 0, + RxThread, + this ); + if (nRet != 0) + { + TRACE( "cComm::Connect() pthread_create = %d\n", nRet ); + + Disconnect(); + return false; + } + + // Opening the com port + mPort = open( pPort, O_RDWR ); + if (mPort == INVALID_HANDLE_VALUE) + { + Disconnect(); + return false; + } + + // Save port name + mPortName = pPort; + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + SendCtl (Public Method) + +DESCRIPTION: + Run an IOCTL on the open file handle + +PARAMETERS: + ioctlReq [ I ] - ioctl request value + pData [I/O] - input or output specific to ioctl request value + +RETURN VALUE: + int - ioctl return value (0 for success) +===========================================================================*/ +int cComm::SendCtl( + UINT ioctlReq, + void * pData ) +{ + if (mPort == INVALID_HANDLE_VALUE) + { + TRACE( "Invalid file handle\n" ); + return -EBADFD; + } + + return ioctl( mPort, ioctlReq, pData ); +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the current port + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::Disconnect() +{ + // Assume success + bool bRC = true; + + if (mCommandPipe[WRITING] != INVALID_HANDLE_VALUE) + { + if (mRxThreadID != 0) + { + // Notify the thread to exit + BYTE byte = EXIT_CMD; + write( mCommandPipe[WRITING], &byte, 1 ); + + // And wait for it + TRACE( "cComm::Disconnnect() joining thread %lu\n", mRxThreadID ); + int nRC = pthread_join( mRxThreadID, 0 ); + if (nRC != 0) + { + TRACE( "failed to join thread %d\n", nRC ); + bRC = false; + } + + mRxThreadID = 0; + } + + close( mCommandPipe[WRITING] ); + close( mCommandPipe[READING] ); + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; + } + + if (mPort != INVALID_HANDLE_VALUE) + { + close( mPort ); + mPort = INVALID_HANDLE_VALUE; + } + + mPortName.clear(); + return bRC; +} + +/*=========================================================================== +METHOD: + ConfigureSettings (Public Method) + +DESCRIPTION: + Configure the port with the passed in parameters + +PARAMETERS: + pSettings [ I ] - Desired port settings + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::ConfigureSettings( termios * pSettings ) +{ + if (mPort == INVALID_HANDLE_VALUE || pSettings == 0) + { + return false; + } + + tcflush( mPort, TCIOFLUSH ); + int nRC = tcsetattr( mPort, TCSANOW, pSettings ); + if (nRC == -1) + { + return false; + } + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + GetSettings (Public Method) + +DESCRIPTION: + Return the current port settings + +PARAMETERS: + pSettings [ I ] - Current port settings + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::GetSettings( termios * pSettings ) +{ + if (mPort == INVALID_HANDLE_VALUE || pSettings == 0) + { + return false; + } + + // Get the COM port settings + int nRC = tcgetattr( mPort, pSettings ); + if (nRC == -1) + { + return false; + } + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + CancelIO (Public Method) + +DESCRIPTION: + Cancel any in-progress I/O + +PARAMETERS: + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelIO() +{ + if (mPort == INVALID_HANDLE_VALUE) + { + return false; + } + + bool bRxCancel = CancelRx(); + bool bTxCancel = CancelTx(); + + return (bRxCancel && bTxCancel); +} + +/*=========================================================================== +METHOD: + CancelRx (Public Method) + +DESCRIPTION: + Cancel any in-progress receive operation + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelRx() +{ + if (mPort == INVALID_HANDLE_VALUE + || mCommandPipe[WRITING] == INVALID_HANDLE_VALUE + || mpRxCallback == 0 + || mRxThreadID == 0) + { + TRACE( "cannot cancel, thread not active\n" ); + return false; + } + + // Notify the thread to stop reading + BYTE byte = STOP_READ_CMD; + int nRC = write( mCommandPipe[WRITING], &byte, 1 ); + if (nRC != 1) + { + TRACE( "error %d canceling read\n", nRC ); + return false; + } + + // Remove the old callback + mpRxCallback = 0; + + return true; +} + +/*=========================================================================== +METHOD: + CancelTx (Public Method) + +DESCRIPTION: + Cancel any in-progress transmit operation + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelTx() +{ + if (mPort == INVALID_HANDLE_VALUE) + { + return false; + } + + mbCancelWrite = true; + + return true; +} + +/*=========================================================================== +METHOD: + RxData (Public Method) + +DESCRIPTION: + Receive data + +PARAMETERS: + pBuf [ I ] - Buffer to contain received data + bufSz [ I ] - Amount of data to be received + pCallback [ I ] - Callback object to be exercised when the + operation completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::RxData( + BYTE * pBuf, + ULONG bufSz, + cIOCallback * pCallback ) +{ + if (IsValid() == false || mpRxCallback != 0) + { + return false; + } + + if (pCallback == 0) + { + // Not interested in being notified, but we still need a value + // for this so that only one outstanding I/O operation is active + // at any given point in time + mpRxCallback = (cIOCallback * )1; + } + else + { + mpRxCallback = pCallback; + } + + mpBuffer = pBuf; + mBuffSz = bufSz; + + // Notify the thread to stop reading + BYTE byte = START_READ_CMD; + int nRC = write( mCommandPipe[WRITING], &byte, 1 ); + if (nRC != 1) + { + TRACE( "error %d starting read\n", nRC ); + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + TxData (Public Method) + +DESCRIPTION: + Transmit data + +PARAMETERS: + pBuf [ I ] - Data to be transmitted + bufSz [ I ] - Amount of data to be transmitted + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::TxData( + const BYTE * pBuf, + ULONG bufSz ) +{ + if (IsValid() == false) + { + return false; + } + +#ifdef DEBUG + ULONGLONG nStart = GetTickCount(); +#endif + + // Allow ourselves to be interupted + mbCancelWrite = false; + + // This seems a bit pointless, but we're still going verify + // the device is ready for writing, and give it up to + // (1000 + num bytes) MS to be ready (in 100 MS chunks) + + struct timeval TimeOut; + fd_set set; + + int nReady = 0; + int nCount = 0; + + while ( nReady == 0 ) + { + if (mbCancelWrite == true) + { + TRACE( "cComm::TxData() write canceled before device was ready\n" ); + return false; + } + + if (nCount >= (1000 + bufSz) / 100) + { + // Timeout is expired + break; + } + + FD_ZERO( &set ); + FD_SET( mPort, &set ); + TimeOut.tv_sec = 0; + TimeOut.tv_usec = 100000; + nReady = select( mPort + 1, NULL, &set, NULL, &TimeOut ); + + nCount++; + } + + if (nReady <= 0) + { + TRACE( "cComm::TxData() Unable to get device ready for" + " Write, error %d: %s\n", + nReady, + strerror( nReady) ); + return false; + } + + int nRet = write( mPort, pBuf, bufSz ); + if (nRet != bufSz) + { + TRACE( "cComm::TxData() write returned %d instead of %lu\n", + nRet, + bufSz ); + return false; + } + +#ifdef DEBUG + TRACE( "Write of %lu bytes took %llu miliseconds\n", bufSz, GetTickCount() - nStart ); +#endif + + return true; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/Comm.h b/gobi-api/Gobi_2012-06-18-1054/Core/Comm.h new file mode 100755 index 0000000..14ffe47 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/Comm.h @@ -0,0 +1,139 @@ +/*=========================================================================== +FILE: + Comm.h + +DESCRIPTION: + Declaration of cComm class + +PUBLIC CLASSES AND METHODS: + cComm + This class wraps low level port communications + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Event.h" +#include "Connection.h" + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// Class cComm +/*=========================================================================*/ +class cComm : public cConnection +{ + public: + // Constructor + cComm(); + + // Destructor + ~cComm(); + + // Is this object valid? + bool IsValid(); + + // Connect to the specified port + bool Connect( LPCSTR pPort ); + + // Run an IOCTL on the open file handle + int SendCtl( + UINT ioctlReq, + void * pData ); + + // Disconnect from the current port + bool Disconnect(); + + // Configure the port with the passed in parameters + bool ConfigureSettings( termios * pSettings ); + + // Return the current port settings + bool GetSettings( termios * pSettings ); + + // Cancel any in-progress I/O + bool CancelIO(); + + // Cancel any in-progress receive operation + bool CancelRx(); + + // Cancel any in-progress transmit operation + bool CancelTx(); + + // Receive data + bool RxData( + BYTE * pBuf, + ULONG bufSz, + cIOCallback * pCallback ); + + // Transmit data + bool TxData( + const BYTE * pBuf, + ULONG bufSz ); + + // (Inline) Return current port name + std::string GetPortName() const + { + return mPortName; + }; + + // Are we currently connected to a port? + bool IsConnected() + { + return (mPort != INVALID_HANDLE_VALUE); + }; + + protected: + /* Name of current port */ + std::string mPortName; + + /* Handle to COM port */ + int mPort; + + // Cancel the write request? + bool mbCancelWrite; + + /* Buffer */ + BYTE * mpBuffer; + + /* Buffer size */ + ULONG mBuffSz; + + /* Pipe for comunication with thread */ + int mCommandPipe[2]; + + /* Thread ID of Rx Thread. */ + pthread_t mRxThreadID; + + // Rx thread is allowed complete access + friend void * RxThread( void * pData ); +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/Connection.h b/gobi-api/Gobi_2012-06-18-1054/Core/Connection.h new file mode 100755 index 0000000..8a2a763 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/Connection.h @@ -0,0 +1,149 @@ +/*=========================================================================== +FILE: + Connection.h + +DESCRIPTION: + Declaration of cConnection class + +PUBLIC CLASSES AND METHODS: + cComm + This class defines a prototype for low level communications + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Event.h" + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// Class cIOCallback +/*=========================================================================*/ +class cIOCallback +{ + public: + // (Inline) Constructor + cIOCallback() { }; + + // (Inline) Destructor + virtual ~cIOCallback() { }; + + // The I/O has been completed, process the results + virtual void IOComplete( + DWORD status, + DWORD bytesTransferred ) = 0; +}; + +/*=========================================================================*/ +// Class cConnection +/*=========================================================================*/ +class cConnection +{ + public: + // Constructor + cConnection() + : mpRxCallback( 0 ) + { }; + + // Is this object valid? + virtual bool IsValid() + { + return false; + }; + + // Connect to the specified interface + virtual bool Connect( LPCSTR pPort ) + { + return false; + }; + + // Send a control message + virtual int SendCtl( + UINT type, + void * pData ) + { + return -1; + }; + + // Disconnect from the current port + virtual bool Disconnect() + { + return false; + }; + + // Cancel any in-progress I/O + virtual bool CancelIO() + { + return false; + }; + + // Cancel any in-progress receive operation + virtual bool CancelRx() + { + return false; + }; + + // Cancel any in-progress transmit operation + virtual bool CancelTx() + { + return false; + }; + + // Receive data + virtual bool RxData( + BYTE * pBuf, + ULONG bufSz, + cIOCallback * pCallback ) + { + return false; + }; + + // Transmit data + virtual bool TxData( + const BYTE * pBuf, + ULONG bufSz ) + { + return false; + }; + + // Are we currently connected to a port? + virtual bool IsConnected() + { + return false; + }; + + protected: + /* Read callbacks */ + cIOCallback * mpRxCallback; +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/Event.cpp b/gobi-api/Gobi_2012-06-18-1054/Core/Event.cpp new file mode 100755 index 0000000..f653ea8 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/Event.cpp @@ -0,0 +1,437 @@ +/*=========================================================================== +FILE: + Event.cpp + +DESCRIPTION: + Implementation of cEvent class + +PUBLIC CLASSES AND METHODS: + WaitOnMultipleEvents + cEvent + Functionality to mimic Windows events using UNIX pipes (enhanced + somewhat to allow one to specify a DWORD value to pass through + when signalling the event) + + WARNING: + This class is not designed to be thread safe + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "Event.h" + +/*=========================================================================== +METHOD: + WaitOnMultipleEvents (Free Method) + +DESCRIPTION: + Wait for any of the events to be set and return the value + + Note: If multiple events are set, only the event specified by + eventIndex will be read from. Run this function again + to get the next event. + +PARAMETERS: + events [ I ] - Vector of events which may be signaled + timeoutMS [ I ] - Relative timeout length (in milliseconds) + val [ O ] - Associated value upon success + eventIndex [ O ] - Index of event which was signaled + +RETURN VALUE: + Return code + positive for number of events set + -ETIME on timeout + negative errno value on failure +===========================================================================*/ +int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ) +{ + // Check internal pipes' status + for (ULONG index = 0; index < events.size(); index++) + { + int error = events[index]->mError; + if (error != 0) + { + TRACE( "cEvent %lu has error %d\n", index, error ); + return -error; + } + } + + // Initialize the FD set + fd_set fds; + FD_ZERO( &fds ); + + // Add each item to the FD set, keeping track of the largest, + // which is used for select() + int largestFD = 0; + for (ULONG index = 0; index < events.size(); index++) + { + int pipe = events[index]->mPipes[READING]; + FD_SET( pipe, &fds ); + + largestFD = std::max( pipe, largestFD ); + } + + struct timeval timeOut; + + // Add avoiding an overflow on (long)usec + timeOut.tv_sec = timeoutMS / 1000l; + timeOut.tv_usec = ( timeoutMS % 1000l ) * 1000l; + + // Wait for activity on the pipes for the specified amount of time + int rc = select( largestFD + 1, &fds, 0, 0, &timeOut ); + if (rc == -1) + { + TRACE( "WaitOnMultipleEvents error %d\n", errno ); + return -errno; + } + else if (rc == 0) + { + // No activity on the pipes + return -ETIME; + } + + int numSignaled = rc; + + // Only read from first pipe which was signaled + int signaled = -1; + for (ULONG index = 0; index < events.size(); index++) + { + int pipe = events[index]->mPipes[READING]; + if (FD_ISSET( pipe, &fds ) != 0) + { + signaled = index; + break; + } + } + + if (signaled == -1) + { + // Odd, no one was signaled + return -ENODATA; + } + + DWORD tempVal = 0; + rc = events[signaled]->Read( tempVal ); + if (rc == 0) + { + // Success + val = tempVal; + eventIndex = signaled; + return numSignaled; + } + else + { + // failure + return rc; + } +} + +/*=========================================================================*/ +// cEvent Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cEvent (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cEvent::cEvent() + : mError( 0 ) +{ + int rc = pipe( mPipes ); + if (rc != 0) + { + mError = errno; + TRACE( "cEvent - Error %d creating pipe, %s\n", + mError, + strerror( mError ) ); + } +} + +/*=========================================================================== +METHOD: + ~cEvent (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cEvent::~cEvent() +{ + // Check internal pipe status + if (mError == 0) + { + Close(); + mError = EBADF; + } +} + +/*=========================================================================== +METHOD: + Close (Internal Method) + +DESCRIPTION: + Close pipe + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Close() +{ + int retCode = 0; + + int rc = close( mPipes[READING] ); + mPipes[READING] = -1; + + if (rc != 0) + { + retCode = errno; + TRACE( "cEvent - Error %d deleting pipe[READING], %s\n", + retCode, + strerror( retCode ) ); + } + + rc = close( mPipes[WRITING] ); + mPipes[WRITING] = -1; + + if (rc != 0) + { + retCode = errno; + TRACE( "cEvent - Error %d deleting pipe[WRITING], %s\n", + retCode, + strerror( retCode ) ); + } + + return retCode; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Set/signal the event with the specified value + +PARAMETERS: + val [ I ] - Value to pass through with signal + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Set( DWORD val ) +{ + // Check internal pipe status + if (mError != 0) + { + return mError; + } + + PBYTE pWrite = (PBYTE)&val; + + int writeSize = sizeof( DWORD ); + while (writeSize > 0) + { + int bytesWritten = write( mPipes[WRITING], pWrite, writeSize ); + if (bytesWritten == -1) + { + // Store error from write + int writeErr = errno; + + // First error? + if (mError == 0) + { + // Yes, save the error + mError = writeErr; + } + + // We cannot recover from this error + Close(); + return writeErr; + } + + pWrite += bytesWritten; + writeSize -= bytesWritten; + } + + // Success + return 0; +} + +/*=========================================================================== +METHOD: + Wait (Free Method) + +DESCRIPTION: + Wait for the event to be signalled and return the read in value + +PARAMETERS: + timeoutMS [ I ] - Relative timeout length (in milliseconds) + val [ O ] - Associated value upon success + +RETURN VALUE: + Return code + 0 on success + ETIME on timeout + errno value on failure +===========================================================================*/ +int cEvent::Wait( + DWORD timeoutMS, + DWORD & val ) +{ + // Check internal pipe status + if (mError != 0) + { + return mError; + } + + fd_set fds; + FD_ZERO( &fds ); + FD_SET( mPipes[READING], &fds ); + + struct timeval timeOut; + + // Add avoiding an overflow on (long)usec + timeOut.tv_sec = timeoutMS / 1000l; + timeOut.tv_usec = ( timeoutMS % 1000l ) * 1000l; + + // Wait for activity on the pipe for the specified amount of time + int rc = select( mPipes[READING] + 1, &fds, 0, 0, &timeOut ); + if (rc == -1) + { + // Store error from select + int selectErr = errno; + + // First error? + if (mError == 0) + { + // Yes, save the error + mError = selectErr; + } + + // We cannot recover from this error + Close(); + return selectErr; + } + else if (rc == 0) + { + // No activity on the pipe + return ETIME; + } + + return Read( val ); +} + +/*=========================================================================== +METHOD: + Clear (Free Method) + +DESCRIPTION: + Read and discard all values currently in the pipe +===========================================================================*/ +void cEvent::Clear() +{ + DWORD unusedVal; + int rc = 0; + while (rc == 0) + { + rc = Wait( (DWORD)0, unusedVal ); + } +} + + +/*=========================================================================== +METHOD: + Read (Internal Method) + +DESCRIPTION: + Read a DWORD from the pipe + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Read( DWORD & val ) +{ + DWORD tempVal; + PBYTE pRead = (PBYTE)&tempVal; + + int readSize = sizeof( DWORD ); + while (readSize > 0) + { + int bytesRead = read( mPipes[READING], pRead, readSize ); + if (bytesRead <= 0) + { + // Store error from read + int readErr = errno; + if (readErr == 0) + { + // Hard error! This should NEVER happen for a pipe + ASSERT( 0 ); + readErr = EBADF; + } + + // First error? + if (mError == 0) + { + // Yes, store the error + mError = readErr; + } + + // We cannot recover from this error + Close(); + return readErr; + } + + pRead += bytesRead; + readSize -= bytesRead; + } + + val = tempVal; + + return 0; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/Event.h b/gobi-api/Gobi_2012-06-18-1054/Core/Event.h new file mode 100755 index 0000000..8bbbc4f --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/Event.h @@ -0,0 +1,117 @@ +/*=========================================================================== +FILE: + Event.h + +DESCRIPTION: + Declaration of cEvent class + +PUBLIC CLASSES AND METHODS: + WaitOnMultipleEvents + cEvent + Functionality to mimic Windows events using UNIX pipes (enhanced + somewhat to allow one to specify a DWORD value to pass through + when signalling the event) + + WARNING: + This class is not designed to be thread safe + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include + +//--------------------------------------------------------------------------- +// Prototype +//--------------------------------------------------------------------------- + +class cEvent; + +/*=========================================================================*/ +// Free methods +/*=========================================================================*/ + +// Wait for any of the events to be set and return the value +int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ); + +/*=========================================================================*/ +// Class cEvent +/*=========================================================================*/ +class cEvent +{ + public: + // Constructor + cEvent(); + + // Destructor + ~cEvent(); + + // Set/signal the event with the specified value + int Set( DWORD val ); + + // Wait for the event to be signalled and return the read in value + int Wait( + DWORD timeoutMS, + DWORD & val ); + + // Read and discard all values currently in the pipe + void Clear(); + + protected: + // Close pipe (used in errors or normal exit) + int Close(); + + // Read from the pipe + int Read( DWORD & val ); + + /* Internal error status */ + int mError; + + /* Internal pipes */ + int mPipes[2]; + + // WaitOnMultipleEvents gets full access + friend int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ); +}; + diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolBuffer.cpp b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolBuffer.cpp new file mode 100755 index 0000000..756e568 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolBuffer.cpp @@ -0,0 +1,222 @@ +/*=========================================================================== +FILE: + ProtocolBuffer.cpp + +DESCRIPTION: + Generic protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sProtocolBuffer + Simple struct to represent a protocol buffer using a reference counted + (shared) buffer, this allows us to use in in several places without + copying it once in each place. A few base services are provided + but the main purpose is to provide a class to inherit off of for + specific protocols + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolBuffer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sProtocolBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Constructor (default) + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer() + : mpData( 0 ), + mbValid( false ) +{ + // Object is currently invalid + mTimestamp = EMPTY_TIME; +} + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Constructor (parameterized) + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the DIAG data + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer( sSharedBuffer * pBuffer ) + : mpData( 0 ), + mbValid( false ) +{ + mTimestamp = EMPTY_TIME; + + time_t rawtime; + time( &rawtime ); + tm * timestamp = localtime( &rawtime ); + if (timestamp != 0) + { + mTimestamp = *timestamp; + } + + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->Release(); + mpData = 0; + } + + mpData = pBuffer; + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + } + + // NOTE: Derived classes need to call their own validation method + // in their constructors since the override might try to access + // data that is not yet in place + sProtocolBuffer::Validate(); +} + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Copy constructor + +PARAMETERS: + copyThis [ I ] - sProtocolBuffer to base the new one on + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer( const sProtocolBuffer & copyThis ) + : mpData( copyThis.mpData ), + mTimestamp( copyThis.mTimestamp ), + mbValid( copyThis.mbValid ) +{ + // Bump reference count for shared buffer + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + mbValid = false; + } +} + +/*=========================================================================== +METHOD: + operator = (Public Method) + +DESCRIPTION: + Assignment operator + +PARAMETERS: + copyThis [ I ] - sProtocolBuffer to base the new one on + +RETURN VALUE: + sProtocolBuffer & +===========================================================================*/ +sProtocolBuffer & sProtocolBuffer::operator = ( const sProtocolBuffer & copyThis ) +{ + // Do we already have data? + if (mpData != 0) + { + // Is it different than what we are duplicating? + if (mpData != copyThis.mpData) + { + // Yes, release our current buffer + mpData->Release(); + } + } + + mpData = copyThis.mpData; + mTimestamp = copyThis.mTimestamp; + mbValid = copyThis.mbValid; + + // Bump reference count for shared buffer + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + mbValid = false; + } + + return *this; +} + +/*=========================================================================== +METHOD: + ~sProtocolBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::~sProtocolBuffer() +{ + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->Release(); + mpData = 0; + } + else if (mpData != 0) + { + ASSERT( 0 ); + } + + mbValid = false; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolBuffer.h b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolBuffer.h new file mode 100755 index 0000000..c23ecbc --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolBuffer.h @@ -0,0 +1,162 @@ +/*=========================================================================== +FILE: + ProtocolBuffer.h + +DESCRIPTION: + Generic protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sProtocolBuffer + Simple struct to represent a protocol buffer using a reference counted + (shared) buffer, this allows us to use in in several places without + copying it once in each place. A few base services are provided + but the main purpose is to provide a class to inherit off of for + specific protocols + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "SharedBuffer.h" +#include "ProtocolEnum.h" + +static const tm EMPTY_TIME = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + +/*=========================================================================*/ +// Struct sProtocolBuffer +/*=========================================================================*/ +struct sProtocolBuffer +{ + public: + // Constructor (default) + sProtocolBuffer(); + + // Constructor (parameterized) + sProtocolBuffer( sSharedBuffer * pBuffer ); + + // Copy constructor + sProtocolBuffer( const sProtocolBuffer & copyThis ); + + // Assignment operator + sProtocolBuffer & operator = ( const sProtocolBuffer & copyThis ); + + // Destructor + virtual ~sProtocolBuffer(); + + // (Inline) Get buffer + const BYTE * GetBuffer() const + { + BYTE * pRet = 0; + if (IsValid() == true) + { + pRet = (BYTE *)mpData->GetBuffer(); + } + + return (const BYTE *)pRet; + }; + + // (Inline) Get buffer size + ULONG GetSize() const + { + ULONG size = 0; + if (IsValid() == true) + { + size = mpData->GetSize(); + } + + return size; + }; + + // (Inline) Return the protocol type + eProtocolType GetType() const + { + eProtocolType pt = ePROTOCOL_ENUM_BEGIN; + if (IsValid() == true) + { + pt = (eProtocolType)mpData->GetType(); + } + + return pt; + }; + + // (Inline) Return the shared buffer + sSharedBuffer * GetSharedBuffer() const + { + sSharedBuffer * pRet = 0; + if (IsValid() == true) + { + pRet = mpData; + } + + return pRet; + }; + + // (Inline) Return the timestamp + tm GetTimestamp() const + { + tm ft = EMPTY_TIME; + + if (IsValid() == true) + { + ft = mTimestamp; + } + + return ft; + }; + + // (Inline) Is this buffer valid? + virtual bool IsValid() const + { + return mbValid; + }; + + protected: + // (Inline) Validate buffer + virtual bool Validate() + { + // Do we have a shared buffer and is it valid? + mbValid = (mpData != 0 && mpData->IsValid()); + return mbValid; + }; + + /* Our data buffer */ + sSharedBuffer * mpData; + + /* Time buffer was created */ + tm mTimestamp; + + /* Has this buffer been validated? (NOTE: *NOT* set in base) */ + bool mbValid; +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolEnum.h b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolEnum.h new file mode 100755 index 0000000..3a88050 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolEnum.h @@ -0,0 +1,244 @@ +/*=========================================================================== +FILE: + ProtocolEnum.h + +DESCRIPTION: + Generic protocol enumerations and related methods + +PUBLIC ENUMERATIONS AND METHODS: + eProtocolType + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// eProtocolType Enumeration +// +// NOTE: QMI protocol types need to be in the same order as eQMIService +// with RX added first then TX +/*=========================================================================*/ +enum eProtocolType +{ + ePROTOCOL_ENUM_BEGIN = -1, + + ePROTOCOL_COMMAND, // 000 Protocol server command + ePROTOCOL_AT, // 001 AT command protocol + ePROTOCOL_NMEA, // 002 NMEA (GPS) protocol + ePROTOCOL_DIAG_RX, // 003 DIAG protocol (incoming) + ePROTOCOL_DIAG_TX, // 004 DIAG protocol (outgoing) + ePROTOCOL_DOWNLOAD_RX, // 005 Download protocol (incoming) + ePROTOCOL_DOWNLOAD_TX, // 006 Download protocol (outgoing) + ePROTOCOL_SDOWNLOAD_RX, // 007 Streaming download protocol (incoming) + ePROTOCOL_SDOWNLOAD_TX, // 008 Streaming download protocol (outgoing) + ePROTOCOL_QDL_RX, // 009 QDL streaming protocol (incoming) + ePROTOCOL_QDL_TX, // 010 QDL streaming protocol (outgoing) + + ePROTOCOL_QMI_CTL_RX = 60, // 060 QMI CTL protocol (incoming) + ePROTOCOL_QMI_CTL_TX, // 061 QMI CTL protocol (outgoing) + ePROTOCOL_QMI_WDS_RX, // 062 QMI WDS protocol (incoming) + ePROTOCOL_QMI_WDS_TX, // 063 QMI WDS protocol (outgoing) + ePROTOCOL_QMI_DMS_RX, // 064 QMI DMS protocol (incoming) + ePROTOCOL_QMI_DMS_TX, // 065 QMI DMS protocol (outgoing) + ePROTOCOL_QMI_NAS_RX, // 066 QMI NAS protocol (incoming) + ePROTOCOL_QMI_NAS_TX, // 067 QMI NAS protocol (outgoing) + ePROTOCOL_QMI_QOS_RX, // 068 QMI QOS protocol (incoming) + ePROTOCOL_QMI_QOS_TX, // 069 QMI QOS protocol (outgoing) + ePROTOCOL_QMI_WMS_RX, // 070 QMI WMS protocol (incoming) + ePROTOCOL_QMI_WMS_TX, // 071 QMI WMS protocol (outgoing) + ePROTOCOL_QMI_PDS_RX, // 072 QMI PDS protocol (incoming) + ePROTOCOL_QMI_PDS_TX, // 073 QMI PDS protocol (outgoing) + ePROTOCOL_QMI_AUTH_RX, // 074 QMI AUTH protocol (incoming) + ePROTOCOL_QMI_AUTH_TX, // 075 QMI AUTH protocol (outgoing) + ePROTOCOL_QMI_AT_RX, // 076 QMI AUTH protocol (incoming) + ePROTOCOL_QMI_AT_TX, // 077 QMI AUTH protocol (outgoing) + ePROTOCOL_QMI_VOICE_RX, // 078 QMI Voice protocol (incoming) + ePROTOCOL_QMI_VOICE_TX, // 079 QMI Voice protocol (outgoing) + ePROTOCOL_QMI_CAT2_RX, // 080 QMI CAT (new) protocol (incoming) + ePROTOCOL_QMI_CAT2_TX, // 081 QMI CAT (new) protocol (outgoing) + ePROTOCOL_QMI_UIM_RX, // 082 QMI UIM protocol (incoming) + ePROTOCOL_QMI_UIM_TX, // 083 QMI UIM protocol (outgoing) + ePROTOCOL_QMI_PBM_RX, // 084 QMI PBM protocol (incoming) + ePROTOCOL_QMI_PBM_TX, // 085 QMI PBM protocol (outgoing) + ePROTOCOL_QMI_13_RX, // 086 QMI service ID 13 protocol (incoming) + ePROTOCOL_QMI_13_TX, // 087 QMI service ID 13 protocol (outgoing) + ePROTOCOL_QMI_RMTFS_RX, // 088 QMI RMTFS protocol (incoming) + ePROTOCOL_QMI_RMTFS_TX, // 089 QMI RMTFS protocol (outgoing) + ePROTOCOL_QMI_15_RX, // 090 QMI service ID 15 protocol (incoming) + ePROTOCOL_QMI_15_TX, // 091 QMI service ID 15 protocol (outgoing) + ePROTOCOL_QMI_LOC_RX, // 092 QMI UIM protocol (incoming) + ePROTOCOL_QMI_LOC_TX, // 093 QMI UIM protocol (outgoing) + ePROTOCOL_QMI_SAR_RX, // 094 QMI PBM protocol (incoming) + ePROTOCOL_QMI_SAR_TX, // 095 QMI PBM protocol (outgoing) + ePROTOCOL_QMI_18_RX, // 096 QMI service ID 18 protocol (incoming) + ePROTOCOL_QMI_18_TX, // 097 QMI service ID 18 protocol (outgoing) + ePROTOCOL_QMI_19_RX, // 098 QMI service ID 19 protocol (incoming) + ePROTOCOL_QMI_19_TX, // 099 QMI service ID 19 protocol (outgoing) + ePROTOCOL_QMI_CSD_RX, // 100 QMI CSD protocol (incoming) + ePROTOCOL_QMI_CSD_TX, // 101 QMI CSD protocol (outgoing) + ePROTOCOL_QMI_EFS_RX, // 102 QMI EFS protocol (incoming) + ePROTOCOL_QMI_EFS_TX, // 103 QMI EFS protocol (outgoing) + ePROTOCOL_QMI_22_RX, // 104 QMI service ID 22 protocol (incoming) + ePROTOCOL_QMI_22_TX, // 105 QMI service ID 22 protocol (outgoing) + ePROTOCOL_QMI_TS_RX, // 106 QMI TS protocol (incoming) + ePROTOCOL_QMI_TS_TX, // 107 QMI TS protocol (outgoing) + ePROTOCOL_QMI_TMD_RX, // 108 QMI TMD protocol (incoming) + ePROTOCOL_QMI_TMD_TX, // 109 QMI TMD protocol (outgoing) + ePROTOCOL_QMI_25_RX, // 110 QMI service ID 25 protocol (incoming) + ePROTOCOL_QMI_25_TX, // 111 QMI service ID 25 protocol (outgoing) + ePROTOCOL_QMI_26_RX, // 112 QMI service ID 26 protocol (incoming) + ePROTOCOL_QMI_26_TX, // 113 QMI service ID 26 protocol (outgoing) + ePROTOCOL_QMI_27_RX, // 114 QMI service ID 27 protocol (incoming) + ePROTOCOL_QMI_27_TX, // 115 QMI service ID 27 protocol (outgoing) + ePROTOCOL_QMI_28_RX, // 116 QMI service ID 28 protocol (incoming) + ePROTOCOL_QMI_28_TX, // 117 QMI service ID 28 protocol (outgoing) + + ePROTOCOL_QMI_CAT_RX = 508, // 508 QMI CAT protocol (incoming) + ePROTOCOL_QMI_CAT_TX, // 509 QMI CAT protocol (outgoing) + ePROTOCOL_QMI_RMS_RX, // 510 QMI RMS protocol (incoming) + ePROTOCOL_QMI_RMS_TX, // 511 QMI RMS protocol (outgoing) + ePROTOCOL_QMI_OMA_RX, // 512 QMI OMA protocol (incoming) + ePROTOCOL_QMI_OMA_TX, // 513 QMI OMA protocol (outgoing) + + ePROTOCOL_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eProtocolType validity check + +PARAMETERS: + pt [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eProtocolType pt ) +{ + bool retVal = false; + if ( (pt > ePROTOCOL_ENUM_BEGIN && pt <= ePROTOCOL_QDL_TX) + || (pt >= ePROTOCOL_QMI_CTL_RX && pt <= ePROTOCOL_QMI_28_TX) + || (pt >= ePROTOCOL_QMI_CAT_RX && pt < ePROTOCOL_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocol (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocol( eProtocolType pt ) +{ + bool retVal = false; + if ( (pt >= ePROTOCOL_QMI_CTL_RX && pt <= ePROTOCOL_QMI_28_TX) + || (pt >= ePROTOCOL_QMI_CAT_RX && pt < ePROTOCOL_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocolRX (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol and if so in the + incoming direction? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocolRX( eProtocolType pt ) +{ + bool retVal = false; + + // QMI protocol values that are even are RX + if ( (IsQMIProtocol( pt ) == true) + && ((DWORD)pt % 2 == 0) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocolTX (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol and if so in the + outgoing direction? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocolTX( eProtocolType pt ) +{ + bool retVal = false; + + // QMI protocol values that are odd are TX + if ( (IsQMIProtocol( pt ) == true) + && ((DWORD)pt % 2 == 1) ) + { + retVal = true; + } + + return retVal; +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolLog.cpp b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolLog.cpp new file mode 100755 index 0000000..165daf0 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolLog.cpp @@ -0,0 +1,190 @@ +/*=========================================================================== +FILE: + ProtocolLog.h + +DESCRIPTION: + Simple protocol 'log' class definition + +PUBLIC CLASSES AND METHODS: + cProtocolLog + This class stores protocol buffers in to a flat array (actually a + double-ended queue) so that they can be accessed by other objects + during the flow of normal processing. Note that the storage is + in-memory and therefore finite + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolLog.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// The maximum number of in-memory buffers we allow +const ULONG MAX_PROTOCOL_BUFFERS = 1024 * 16; + +/*=========================================================================*/ +// cProtocolLog Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolLog (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + maxBuffers [ I ] - Maximum number of buffers to store in the log + +RETURN VALUE: + None +===========================================================================*/ +cProtocolLog::cProtocolLog( ULONG maxBuffers ) + : mLog( maxBuffers > MAX_PROTOCOL_BUFFERS ? MAX_PROTOCOL_BUFFERS : maxBuffers, + true ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cProtocolLog (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cProtocolLog::~cProtocolLog() +{ + // Empty out the log + Clear(); +} + +/*=========================================================================== +METHOD: + AddBuffer (Public Method) + +DESCRIPTION: + Add an protocol buffer to the end of the log + +PARAMETERS: + buff [ I ] - Protocol buffer to add + +RETURN VALUE: + ULONG - Index of newly added buffer (INVALID_LOG_INDEX upon failure) +===========================================================================*/ +ULONG cProtocolLog::AddBuffer( sProtocolBuffer & buf ) +{ + ULONG idx = INVALID_LOG_INDEX; + if (buf.IsValid() == false) + { + return idx; + } + + bool bRC = mLog.AddElement( buf, idx ); + if (bRC == false) + { + idx = INVALID_LOG_INDEX; + } + + return idx; +} + +/*=========================================================================== +METHOD: + GetBuffer (Public Method) + +DESCRIPTION: + Return the protocol buffer at the given index from the log + +PARAMETERS: + idx [ I ] - Index of protocol buffer to obtain + +RETURN VALUE: + sProtocolBuffer - Protocol buffer +===========================================================================*/ +sProtocolBuffer cProtocolLog::GetBuffer( ULONG idx ) const +{ + sProtocolBuffer buf; + mLog.GetElement( idx, buf ); + return buf; +} + +/*=========================================================================== +METHOD: + GetSignalEvent (Public Method) + +DESCRIPTION: + Return the underlying signal event, which will be set when + the log is updated. + +RETURN VALUE: + cEvent - Signal event +===========================================================================*/ +cEvent & cProtocolLog::GetSignalEvent() const +{ + return mLog.GetSignalEvent(); +} + +/*=========================================================================== +METHOD: + GetCount (Public Method) + +DESCRIPTION: + Return the total number of buffers added to the log + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cProtocolLog::GetCount() const +{ + return mLog.GetTotalCount(); +} + +/*=========================================================================== +METHOD: + Clear (Public Method) + +DESCRIPTION: + Clear the log + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolLog::Clear() +{ + mLog.EmptyQueue(); +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolLog.h b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolLog.h new file mode 100755 index 0000000..683fd83 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolLog.h @@ -0,0 +1,91 @@ +/*=========================================================================== +FILE: + ProtocolLog.h + +DESCRIPTION: + Simple protocol 'log' class declaration + +PUBLIC CLASSES AND METHODS: + cProtocolLog + This class stores protocol buffers in to a flat array (actually a + double-ended queue) so that they can be accessed by other objects + during the flow of normal processing. Note that the storage is + in-memory and therefore finite + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "SyncQueue.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +const ULONG INVALID_LOG_INDEX = ULONG_MAX; + +/*=========================================================================*/ +// Class cProtocolLog +/*=========================================================================*/ +class cProtocolLog +{ + public: + // Constructor + cProtocolLog( ULONG maxBuffers ); + + // Destructor + virtual ~cProtocolLog(); + + // Add an protocol buffer to the end of the log + virtual ULONG AddBuffer( sProtocolBuffer & buf ); + + // Return the protocol buffer at the given index from the log + virtual sProtocolBuffer GetBuffer( ULONG idx ) const; + + // Return the underlying signal event + virtual cEvent & GetSignalEvent() const; + + // Return the total number of buffers added to the log + virtual ULONG GetCount() const; + + // Clear the log + virtual void Clear(); + + protected: + /* The underlying 'log' */ + cSyncQueue mLog; +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolNotification.cpp b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolNotification.cpp new file mode 100755 index 0000000..6c7d725 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolNotification.cpp @@ -0,0 +1,171 @@ +/*=========================================================================== +FILE: + ProtocolNotification.cpp + +DESCRIPTION: + Implementation of cProtocolNotification base class and derivations + +PUBLIC CLASSES AND METHODS: + sProtocolNotificationEvent + Generic protocol event notification structure + + cProtocolNotification + This abstract base class provides notification of protocol server + events sent from the protocol server to protocol server clients + + cProtocolQueueNotification + This class provides notification via a cSyncQueue object + populated with sProtocolNotificationEvent objects + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolNotification.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cProtocolQueueNotification Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pSQ [ I ] - Sync queue to utilize + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::cProtocolQueueNotification( + cSyncQueue * pSQ ) + : mpSQ( pSQ ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Copy constructor + +PARAMETERS: + notifier [ I ] - Notifier to base the new one on + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::cProtocolQueueNotification( + const cProtocolQueueNotification & notifier ) + : mpSQ( notifier.mpSQ ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::~cProtocolQueueNotification() +{ + mpSQ = 0; +} + +/*=========================================================================== +METHOD: + Clone (Public Method) + +DESCRIPTION: + Return an allocated copy of this object downcasted to our base class + +RETURN VALUE: + cProtocolNotification * : Cloned object (0 on error) +===========================================================================*/ +cProtocolNotification * cProtocolQueueNotification::Clone() const +{ + cProtocolQueueNotification * pCopy = 0; + + try + { + pCopy = new cProtocolQueueNotification( *this ); + } + catch (...) + { + // Simply return 0 + } + + return ((cProtocolNotification *)pCopy); +} + +/*=========================================================================== +METHOD: + Notify (Public Method) + +DESCRIPTION: + Notify view of a protocol event by adding notification structure to + the underlying sync queue (which will provide the notification + by signalling an event) + +PARAMETERS: + eventType [ I ] - Protocol event type + param1 [ I ] - Event type specific argument (see header description) + param2 [ I ] - Event type specific argument (see header description) + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolQueueNotification::Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const +{ + sProtocolNotificationEvent evt( eventType, param1, param2 ); + if (evt.IsValid() == true && mpSQ != 0 && mpSQ->IsValid() == true) + { + sProtocolNotificationEvent elem( eventType, param1, param2 ); + mpSQ->AddElement( elem ); + } +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolNotification.h b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolNotification.h new file mode 100755 index 0000000..c31d1e5 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolNotification.h @@ -0,0 +1,237 @@ +/*=========================================================================== +FILE: + ProtocolNotification.h + +DESCRIPTION: + Declaration of cProtocolNotification base class and derivations + +PUBLIC CLASSES AND METHODS: + sProtocolNotificationEvent + Generic protocol event notification structure + + cProtocolNotification + This abstract base class provides notification of protocol server + events sent from the protocol server to protocol server clients + + cProtocolQueueNotification + This class provides notification via a cSyncQueue object + populated with sProtocolNotificationEvent objects + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "SyncQueue.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +enum eProtocolEventType +{ + ePROTOCOL_EVT_BEGIN = -1, + + ePROTOCOL_EVT_REQ_ERR, // There was an error sending the request + ePROTOCOL_EVT_REQ_SENT, // The request has been sent + + ePROTOCOL_EVT_RSP_ERR, // There was an error receiving the response + ePROTOCOL_EVT_RSP_RECV, // The response has been received + + ePROTOCOL_EVT_AUX_TU_SENT, // Auxiliary data transmission unit sent + + ePROTOCOL_EVT_END +}; + +// NOTE: The arguments for each event are currently as follows: +// +// ePROTOCOL_EVT_REQ_ERR +// param1: Request ID +// param2: Error code +// +// ePROTOCOL_EVT_REQ_SENT +// param1: Request ID +// param2: Index of request buffer in associated protocol log + +// ePROTOCOL_EVT_RSP_ERR +// param1: Request ID +// param2: Error code +// +// ePROTOCOL_EVT_RSP_RECV +// param1: Request ID +// param2: Index of response buffer in associated protocol log +// +// ePROTOCOL_EVT_AUX_TU_SENT +// param1: Request ID +// param2: Size of transmission unit + +// NOTE: To handle protoocl events using the Windows notifier add the following +// prototype to your Window class header file: +// +// afx_msg LRESULT OnProtocolEvent( +// WPARAM wParam, +// LPARAM lParam ); +// +// Then add an entry to the message map in your Window class source file: +// +// BEGIN_MESSAGE_MAP( CView, CChildView ) +// ON_MESSAGE( PROTOCOL_WM_BASE + (ULONG)ePROTOCOL_EVT_XXX, OnProtocolEvent ) +// END_MESSAGE_MAP() +// +// Finally write the handler itself: +// +// LRESULT CView::OnProtocolEvent( +// WPARAM wParam, +// LPARAM lParam ) +// { +// Do something +// return 0; +// } + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eProtocolEventType validity check + +PARAMETERS: + evtType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eProtocolEventType evtType ) +{ + bool bRC = false; + if (evtType > ePROTOCOL_EVT_BEGIN && evtType < ePROTOCOL_EVT_END) + { + bRC = true; + } + + return bRC; +}; + +/*=========================================================================*/ +// Struct sProtocolNotificationEvent +/*=========================================================================*/ +struct sProtocolNotificationEvent +{ + public: + // (Inline) Default constructor (results in invalid object) + sProtocolNotificationEvent() + : mEventType( ePROTOCOL_EVT_BEGIN ), + mParam1( 0 ), + mParam2( 0 ) + { + // Nothing to do + }; + + // (Inline) Parameter constructor + sProtocolNotificationEvent( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) + : mEventType( eventType ), + mParam1( param1 ), + mParam2( param2 ) + { + // Nothing to do + }; + + // (Inline) Is this object valid? + bool IsValid() + { + return ::IsValid( mEventType ); + } + + /* Event type */ + eProtocolEventType mEventType; + + /* First parameter (see above) */ + DWORD mParam1; + + /* Second parameter (see above) */ + DWORD mParam2; +}; + +/*=========================================================================*/ +// Class cProtocolNotification +// +// This abstract base class provides notification of protocol server +// events sent from the protocol server to protocol server clients +/*=========================================================================*/ +class cProtocolNotification +{ + public: + // Return an allocated copy of this object + virtual cProtocolNotification * Clone() const = 0; + + // Notify view of a protocol event + virtual void Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const = 0; +}; + +/*=========================================================================*/ +// Class cProtocolQueueNotification +// +// This class provides notification via a cSyncQueue object +// populated with sProtocolNotificationEvent objects +/*=========================================================================*/ +class cProtocolQueueNotification : public cProtocolNotification +{ + public: + // Constructor + cProtocolQueueNotification( cSyncQueue * pSQ ); + + // Copy constructor + cProtocolQueueNotification( const cProtocolQueueNotification & notifier ); + + // Destructor + virtual ~cProtocolQueueNotification(); + + // Return a copy of this object + virtual cProtocolNotification * Clone() const; + + // Notify view of a MIS event + virtual void Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const; + + protected: + /* Event notification queue */ + mutable cSyncQueue * mpSQ; +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolRequest.cpp b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolRequest.cpp new file mode 100755 index 0000000..21235e0 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolRequest.cpp @@ -0,0 +1,254 @@ +/*=========================================================================== +FILE: + ProtocolRequest.cpp + +DESCRIPTION: + Generic protocol request/command related structures and + affliated methods, these structures are used by clients of + the protocol server to specify outgoing requests + +PUBLIC CLASSES AND METHODS: + sProtocolRequest + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" + +#include "ProtocolRequest.h" +#include "ProtocolNotification.h" +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default protocol request timeout +const ULONG DEFAULT_REQ_TIMEOUT = 1000; + +// Minimum and maximum allowable timeout values (in milliseconds) +const ULONG MIN_REQ_TIMEOUT = 100; +const ULONG MAX_REQ_TIMEOUT = 300000; + +// Minimum number of attempts a request can be scheduled for +const ULONG MIN_REQ_ATTEMPTS = 1; + +// Value to indicate that a request is to be sent out indefinately +const ULONG INFINITE_REQS = 0xFFFFFFFF; + +// Minimum/default amount of time between repeated requests (in milliseconds) +const ULONG MIN_REQ_FREQUENCY = 10; +const ULONG DEFAULT_REQ_FREQUENCY = 100; + +/*=========================================================================*/ +// sProtocolRequest Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Parameterized constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer representing the request (must be + valid) + + schedule [ I ] - When (from now, in milliseconds) to send the first + request, this isn't a hard value as the request is + only guaranteed to go out after this time elapses + + timeout [ I ] - Milliseconds to wait for a response to an individual + request before declaring a timeout. Regardless of + what is passed in the timeout value used will be + between MIN/MAX_REQ_TIMEOUT + + requests [ I ] - Number of request attempts to make, this isn't a + retry count rather this value is used to specify + repeating requests. Regardless of what is passed in + the requests value used will be at least + MIN_REQ_ATTEMPTS + + frequency [ I ] - If the 'requests' value is greater than the + MIN_REQ_ATTEMPTS than this represents the amount of + time to wait between requests (from the completion of + the last request attempt, in milliseconds), again this + isn't a hard value. Regardless of what is passed in + the frequency value used will be at least + MIN_REQ_FREQUENCY + + pNotifier [ I ] - Status notification mechanism (may be 0) + + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( + sSharedBuffer * pBuffer, + ULONG schedule, + ULONG timeout, + ULONG requests, + ULONG frequency, + cProtocolNotification * pNotifier ) + : sProtocolBuffer( pBuffer ), + mSchedule( schedule ), + mTimeout( DEFAULT_REQ_TIMEOUT ), + mRequests( MIN_REQ_ATTEMPTS ), + mFrequency( DEFAULT_REQ_FREQUENCY ), + mpNotifier( 0 ), + mpAuxData( 0 ), + mAuxDataSize( 0 ), + mbTXOnly( false ) +{ + // Constrain requested timeout to allowable range + if (timeout < MIN_REQ_TIMEOUT) + { + timeout = MIN_REQ_TIMEOUT; + } + + if (timeout > MAX_REQ_TIMEOUT) + { + timeout = MAX_REQ_TIMEOUT; + } + + mTimeout = timeout; + + // Constrain request attempts + if (requests >= MIN_REQ_ATTEMPTS) + { + mRequests = requests; + } + + // Constrain frequency + if (frequency >= MIN_REQ_FREQUENCY) + { + mFrequency = frequency; + } + + // Clone notifier? + if (pNotifier != 0) + { + mpNotifier = pNotifier->Clone(); + } +} + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Parameterized constructor (notification with defaults) + +PARAMETERS: + pBuffer [ I ] - Shareable buffer representing the request (must be + valid) + + pNotifier [ I ] - Status notification mechanism (may be 0) + + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( + sSharedBuffer * pBuffer, + cProtocolNotification * pNotifier ) + : sProtocolBuffer( pBuffer ), + mSchedule( 0 ), + mTimeout( DEFAULT_REQ_TIMEOUT ), + mRequests( MIN_REQ_ATTEMPTS ), + mFrequency( DEFAULT_REQ_FREQUENCY ), + mpNotifier( pNotifier ), + mpAuxData( 0 ), + mAuxDataSize( 0 ), + mbTXOnly( false ) +{ + // Clone notifier? + if (pNotifier != 0) + { + mpNotifier = pNotifier->Clone(); + } + + Validate(); +} + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Copy constructor + +PARAMETERS: + req [ I ] - Request to copy + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( const sProtocolRequest & req ) + : sProtocolBuffer( req ), + mSchedule( req.mSchedule ), + mTimeout( req.mTimeout ), + mRequests( req.mRequests ), + mFrequency( req.mFrequency ), + mpNotifier( 0 ), + mpAuxData( req.mpAuxData ), + mAuxDataSize( req.mAuxDataSize ), + mbTXOnly( req.mbTXOnly ) +{ + // Clone notifier? + if (req.mpNotifier != 0) + { + mpNotifier = req.mpNotifier->Clone(); + } + + Validate(); +} + +/*=========================================================================== +METHOD: + ~sProtocolRequest + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::~sProtocolRequest() +{ + // Delete cloned notifier? + if (mpNotifier != 0) + { + delete mpNotifier; + mpNotifier = 0; + } +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolRequest.h b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolRequest.h new file mode 100755 index 0000000..0b9b295 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolRequest.h @@ -0,0 +1,193 @@ +/*=========================================================================== +FILE: + ProtocolRequest.h + +DESCRIPTION: + Generic protocol request/command related structures and + affliated methods, these structures are used by clients of + the protocol server to specify outgoing protocol requests + +PUBLIC CLASSES AND METHODS: + sProtocolRequest + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +class cProtocolNotification; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default protocol request timeout +extern const ULONG DEFAULT_REQ_TIMEOUT; + +// Minimum and maximum allowable timeout values (in milliseconds) +extern const ULONG MIN_REQ_TIMEOUT; +extern const ULONG MAX_REQ_TIMEOUT; + +// Minimum number of attempts a request can be scheduled for +extern const ULONG MIN_REQ_ATTEMPTS; + +// Value to indicate that a request is to be sent out indefinately +extern const ULONG INFINITE_REQS; + +// Minimum/default amount of time between repeated requests (in milliseconds) +extern const ULONG MIN_REQ_FREQUENCY; +extern const ULONG DEFAULT_REQ_FREQUENCY; + +/*=========================================================================*/ +// Struct sProtocolRequest +// +// Structure to represent a generic request packet, including all the +// information needed to schedule the request, send the request, and +// (optionally) reschedule the request for another TX/RX attempt +// +// The default parameters schedule an immediate request (indicated by +// passing in '0' for the schedule parameter) to be sent once with +// the default timeout value +/*=========================================================================*/ +struct sProtocolRequest : public sProtocolBuffer +{ + public: + // Parameterized constructor + sProtocolRequest( + sSharedBuffer * pBuffer, + ULONG schedule = 0, + ULONG timeout = DEFAULT_REQ_TIMEOUT, + ULONG requests = MIN_REQ_ATTEMPTS, + ULONG frequency = DEFAULT_REQ_FREQUENCY, + cProtocolNotification * pNotifier = 0 ); + + // Parameterized constructor (notification with defaults) + sProtocolRequest( + sSharedBuffer * pBuffer, + cProtocolNotification * pNotifier ); + + // Copy constructor + sProtocolRequest( const sProtocolRequest & req ); + + // Destructor + virtual ~sProtocolRequest(); + + // (Inline) Get schedule value (value is in milliseconds) + ULONG GetSchedule() const + { + return mSchedule; + }; + + // (Inline) Get timeout value + ULONG GetTimeout() const + { + return mTimeout; + }; + + // (Inline) Get requests value + ULONG GetRequests() const + { + return mRequests; + }; + + // (Inline) Get frequency value (value is in milliseconds) + ULONG GetFrequency() const + { + return mFrequency; + }; + + const cProtocolNotification * GetNotifier() const + { + return mpNotifier; + }; + + // (Inline) Set auxiliary data + void SetAuxiliaryData( + const BYTE * pData, + ULONG dataSz ) + { + mpAuxData = pData; + mAuxDataSize = dataSz; + }; + + // (Inline) Get auxiliary data + const BYTE * GetAuxiliaryData( ULONG & dataSz ) const + { + dataSz = mAuxDataSize; + return mpAuxData; + }; + + // (Inline) Set TX only flag + void SetTXOnly() + { + mbTXOnly = true; + }; + + // (Inline) Get TX only flag + bool IsTXOnly() const + { + return mbTXOnly; + }; + + protected: + /* Schedule (approximately when to send the initial request) */ + ULONG mSchedule; + + /* Timeout value for receiving a response */ + ULONG mTimeout; + + /* Number of requests to schedule (must be at least one) */ + ULONG mRequests; + + /* Frequency (approximately how long to wait before next request) */ + ULONG mFrequency; + + /* Notification object */ + cProtocolNotification * mpNotifier; + + /* Auxiliary data */ + const BYTE * mpAuxData; + + /* Auxilary data size */ + ULONG mAuxDataSize; + + /* TX only (i.e. do not wait for a response) ? */ + bool mbTXOnly; +}; + diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolServer.cpp b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolServer.cpp new file mode 100755 index 0000000..66bd3b2 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolServer.cpp @@ -0,0 +1,1750 @@ +/*=========================================================================== +FILE: + ProtocolServer.cpp + +DESCRIPTION: + Generic protocol packet server + +PUBLIC CLASSES AND METHODS: + cProtocolServer + Abstract base class for protocol servers + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" + +#include "ProtocolServer.h" +#include "ProtocolNotification.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid request ID +const ULONG INVALID_REQUEST_ID = 0; + +// Default activity timeout value +const ULONG DEFAULT_WAIT = 100; + +// MTU (Maximum Transmission Unit) for auxiliary data (QC USB imposed) +const ULONG MAX_AUX_MTU_SIZE = 1024 * 256; + +// USB's MaxPacketSize +const ULONG MAX_PACKET_SIZE = 512; + +// Maximum amount of time to wait on external access synchronization object +#ifdef DEBUG + // For the sake of debugging do not be so quick to assume failure + const ULONG DEADLOCK_TIME = 180000; +#else + const ULONG DEADLOCK_TIME = 10000; +#endif + +// Maximum amount of time to wait for the protocol server to process a command +const ULONG COMMAND_TIME = DEADLOCK_TIME; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + ScheduleThread (Free Method) + +DESCRIPTION: + Watch schedule for event to process or timeout + +PARAMETERS: + pArg [ I ] - The protocol server object + +RETURN VALUE: + void * - thread exit value (always NULL) +===========================================================================*/ +void * ScheduleThread( PVOID pArg ) +{ + // Do we have a server? + cProtocolServer * pServer = (cProtocolServer *)pArg; + if (pServer == 0) + { + TRACE( "ScheduleThread started with empty pArg." + " Unable to locate cProtocolServer\n" ); + + ASSERT( 0 ); + return NULL; + } + + TRACE( "Schedule thread [%lu] started\n", + pthread_self() ); + + // Default wait event + timespec toTime = TimeIn( DEFAULT_WAIT ); + + // Return value checking + int nRet; + + while (pServer->mbExiting == false) + { + DWORD nTemp; + nRet = pServer->mThreadScheduleEvent.Wait( TimeFromNow( toTime ), nTemp ); + if (nRet != 0 && nRet != ETIME) + { + // Error condition + TRACE( "ScheduleThread [%lu] ScheduleThread wait error %d, %s\n", + pthread_self(), + nRet, + strerror( nRet ) ); + break; + } + + // Time to exit? + if (pServer->mbExiting == true) + { + break; + } + + // Get Schedule Mutex (non-blocking) + nRet = pthread_mutex_trylock( &pServer->mScheduleMutex ); + if (nRet == EBUSY) + { + // Not an error, we're just too slow + // Someone else got to the ScheduleMutex before us + // We'll wait for the signal again + toTime = TimeIn( DEFAULT_WAIT ); + TRACE( "ScheduleThread [%lu] unable to lock ScheduleMutex\n", + pthread_self() ); + continue; + } + else if (nRet != 0) + { + // Error condition + TRACE( "ScheduleThread [%lu] mScheduleMutex error %d, %s\n", + pthread_self(), + nRet, + strerror( nRet ) ); + break; + } + + // Verify time. In the rare event it does move backward + // it would simply place all our schedule items as due now + pServer->CheckSystemTime(); + + // Default next wait period + toTime = TimeIn( DEFAULT_WAIT ); + + timespec curTime = TimeIn( 0 ); + + if (pServer->mpActiveRequest != 0) + { + if (pServer->mpActiveRequest->mbWaitingForResponse == true) + { + // Waiting on a response, this takes priority over the next + // scheduled event + + // Has timeout expired? + if (pServer->mActiveRequestTimeout <= curTime) + { + // Response timeout + + // Note: This may clear mpActiveRequest + pServer->RxTimeout(); + } + else + { + // Active response timer is not yet due to expire + // Default timeout again, or this response's timeout? + if (pServer->mActiveRequestTimeout <= toTime) + { + toTime = pServer->mActiveRequestTimeout; + } + } + } + else + { + // This should never happen + + TRACE( "ScheduleThread() Sequencing error: " + "Active request %lu is not waiting for response ???\n", + pServer->mpActiveRequest->mID ); + + break; + } + } + + if (pServer->mpActiveRequest == 0 + && pServer->mRequestSchedule.size() > 0) + { + // No response timer active, ready to start the next + // scheduled item if due + + timespec scheduledItem = pServer->GetNextRequestTime(); + + // Is item due to be scheduled? + if (scheduledItem <= curTime) + { + // Process scheduled item + pServer->ProcessRequest(); + } + else + { + // Scheduled item is not yet due to be processed + // Default timeout again, or this item's start time? + if (scheduledItem <= toTime) + { + toTime = scheduledItem; + } + } + } + + /*TRACE( "Updated timer at %llu waiting %lu\n", + GetTickCount(), + TimeFromNow( toTime ) ); */ + + // Unlock schedule mutex + nRet = pthread_mutex_unlock( &pServer->mScheduleMutex ); + if (nRet != 0) + { + TRACE( "ScheduleThread Unable to unlock schedule mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + } + + TRACE( "Schedule thread [%lu] exited\n", + pthread_self() ); + + return NULL; +} + +/*=========================================================================== +METHOD: + TimeIn (Free Method) + +DESCRIPTION: + Fill timespec with the time it will be in specified milliseconds + Relative time to Absolute time + +PARAMETERS: + millis [ I ] - Milliseconds from current time + +RETURN VALUE: + timespec - resulting time (from epoc) + NOTE: tv_sec of 0 is an error +===========================================================================*/ +timespec TimeIn( ULONG millis ) +{ + timespec outTime; + + int nRC = clock_gettime( CLOCK_REALTIME, &outTime ); + if (nRC == 0) + { + // Add avoiding an overflow on (long)nsec + outTime.tv_sec += millis / 1000l; + outTime.tv_nsec += ( millis % 1000l ) * 1000000l; + + // Check if we need to carry + if (outTime.tv_nsec >= 1000000000l) + { + outTime.tv_sec += outTime.tv_nsec / 1000000000l; + outTime.tv_nsec = outTime.tv_nsec % 1000000000l; + } + } + else + { + outTime.tv_sec = 0; + outTime.tv_nsec = 0; + } + + return outTime; +} + +/*=========================================================================== +METHOD: + TimeFromNow (Free Method) + +DESCRIPTION: + Find the milliseconds from current time this timespec will occur + Absolute time to Relative time + +PARAMETERS: + time [ I ] - Absolute time + +RETURN VALUE: + Milliseconds in which absolute time will occur + 0 if time has passed or error has occured +===========================================================================*/ +ULONG TimeFromNow( timespec time ) +{ + // Assume failure + ULONG nOutTime = 0; + + timespec now; + int nRC = clock_gettime( CLOCK_REALTIME, &now ); + if (nRC == -1) + { + TRACE( "Error %d with gettime, %s\n", errno, strerror( errno ) ); + return nOutTime; + } + + if (time <= now) + { + return nOutTime; + } + + nOutTime = (time.tv_sec - now.tv_sec) * 1000l; + nOutTime += (time.tv_nsec - now.tv_nsec) / 1000000l; + + return nOutTime; +} + +/*=========================================================================== +METHOD: + GetTickCount (Free Method) + +DESCRIPTION: + Provide a number for sequencing reference, similar to the windows + ::GetTickCount(). + + NOTE: This number is based on the time since epoc, not + uptime. + +PARAMETERS: + +RETURN VALUE: + ULONGLONG - Number of milliseconds system has been up +===========================================================================*/ +ULONGLONG GetTickCount() +{ + timespec curtime = TimeIn( 0 ); + + ULONGLONG outtime = curtime.tv_sec * 1000LL; + outtime += curtime.tv_nsec / 1000000LL; + + return outtime; +} + +/*=========================================================================*/ +// cProtocolServerRxCallback Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + IOComplete (Free Method) + +DESCRIPTION: + The I/O has been completed, process the results + +PARAMETERS: + status [ I ] - Status of operation + bytesReceived [ I ] - Bytes received during operation + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServerRxCallback::IOComplete( + DWORD status, + DWORD bytesReceived ) +{ + if (mpServer != 0) + { + mpServer->RxComplete( status, bytesReceived ); + } +} + +/*=========================================================================*/ +// cProtocolServer::sProtocolReqRsp Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolServer::sProtocolReqRsp (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + requestInfo [ I ] - Underlying request object + requestID [ I ] - Request ID + auxDataMTU [ I ] - MTU (Maximum Transmission Unit) for auxiliary data + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::sProtocolReqRsp::sProtocolReqRsp( + const sProtocolRequest & requestInfo, + ULONG requestID, + ULONG auxDataMTU ) + : mRequest( requestInfo ), + mID( requestID ), + mAttempts( 0 ), + mEncodedSize( requestInfo.GetSize() ), + mRequiredAuxTxs( 0 ), + mCurrentAuxTx( 0 ), + mbWaitingForResponse( false ) +{ + ULONG auxDataSz = 0; + const BYTE * pAuxData = requestInfo.GetAuxiliaryData( auxDataSz ); + + // Compute the number of required auxiliary data transmissions? + if (auxDataMTU > 0 && pAuxData != 0 && auxDataSz > 0) + { + mRequiredAuxTxs = 1; + if (auxDataSz > auxDataMTU) + { + mRequiredAuxTxs = auxDataSz / auxDataMTU; + if ((auxDataSz % auxDataMTU) != 0) + { + mRequiredAuxTxs++; + } + } + } +} + +/*=========================================================================== +METHOD: + cProtocolServer::sProtocolReqRsp (Public Method) + +DESCRIPTION: + Copy constructor + +PARAMETERS: + reqRsp [ I ] - Object being copied + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::sProtocolReqRsp::sProtocolReqRsp( + const sProtocolReqRsp & reqRsp ) + : mRequest( reqRsp.mRequest ), + mID( reqRsp.mID ), + mAttempts( reqRsp.mAttempts ), + mEncodedSize( reqRsp.mEncodedSize ), + mRequiredAuxTxs( reqRsp.mRequiredAuxTxs ), + mCurrentAuxTx( reqRsp.mCurrentAuxTx ), + mbWaitingForResponse( reqRsp.mbWaitingForResponse ) +{ + // Nothing to do +}; + +/*=========================================================================*/ +// cProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + rxType [ I ] - Protocol type to assign to incoming data + txType [ I ] - Protocol type to verify for outgoing data + bufferSzRx [ I ] - Size of data buffer for incoming data + logSz [ I ] - Size of log (number of buffers) + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::cProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ) + : mpConnection( 0 ), + mConnectionType( eConnectionType_Begin ), + mRxCallback(), + mScheduleThreadID( 0 ), + mThreadScheduleEvent(), + mbExiting( false ), + mpServerControl( 0 ), + mLastRequestID( 1 ), + mpActiveRequest( 0 ), + mpRxBuffer( 0 ), + mRxBufferSize( bufferSzRx ), + mRxType( rxType ), + mTxType( txType ), + mLog( logSz ) +{ + mLastTime = TimeIn( 0 ); + + // Allocate receive buffer? + if (mRxBufferSize > 0) + { + mpRxBuffer = new BYTE[mRxBufferSize]; + } + + // Before continuing verify receive buffer was allocated + if (mpRxBuffer != 0) + { + // Schedule mutex + int nRet = pthread_mutex_init( &mScheduleMutex, NULL ); + if (nRet != 0) + { + TRACE( "Unable to init schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + } +} + +/*=========================================================================== +METHOD: + ~cProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (destroys sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::~cProtocolServer() +{ + // This should have already been called, but ... + Exit(); + + // Schedule mutex + int nRet = pthread_mutex_destroy( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to destroy schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + } + + // Free receive buffer + if (mpRxBuffer != 0) + { + delete [] mpRxBuffer; + mpRxBuffer = 0; + } +} + +/*=========================================================================== +METHOD: + HandleRemoveRequest (Public Method) + +DESCRIPTION: + Remove a previously added protocol request + + Note: if a request is being processed, it cannot be inturrupted + +PARAMETERS: + reqID [ I ] - Server assigned request ID + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::HandleRemoveRequest( ULONG reqID ) +{ + // Assume failure + bool bRC = false; + + // Find and erase request from request map + std::map ::iterator pReqIter; + pReqIter = mRequestMap.find( reqID ); + + if (pReqIter != mRequestMap.end()) + { + sProtocolReqRsp * pReqRsp = pReqIter->second; + if (pReqRsp != 0) + { + delete pReqRsp; + } + + mRequestMap.erase( pReqIter ); + + // Success! + bRC = true; + + // Find and erase request from schedule + bool bFound = false; + int entryIndex = -1; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + while (pScheduleIter != mRequestSchedule.end()) + { + entryIndex++; + + tSchedule entry = *pScheduleIter; + if (entry.second == reqID) + { + bFound = true; + mRequestSchedule.erase( pScheduleIter ); + break; + } + else + { + pScheduleIter++; + } + } + + // Note: schedule will be updated when mutex is unlocked/signaled + } + else if (mpActiveRequest != 0 && mpActiveRequest->mID == reqID) + { + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Cancel the response timer (when active) + if (mpActiveRequest->mbWaitingForResponse == true) + { + // Schedule will be updated when mutex is unlocked + + // Failure to receive response, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_ERR, + (DWORD)reqID, + ECANCELED ); + } + } + else + { + // This is the active request, cancel the underlying transmit + // Note: Because ProcessRequest and RemoveRequest are both muxed + // with ScheduleMutex, it is impossible to for the write + // to actually be in progress when this code is reached. + if (mpConnection != 0) + { + mpConnection->CancelTx(); + } + + // Failure to send request, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_ERR, + (DWORD)reqID, + ECANCELED ); + } + } + + // Now delete the request + delete mpActiveRequest; + mpActiveRequest = 0; + + // Success! + bRC = true; + } + else + { + TRACE( "cProtocolServer::RemoveRequest( %lu )," + " invalid request ID\n", + reqID ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ScheduleRequest (Internal Method) + +DESCRIPTION: + Schedule a request for transmission + +PARAMETERS: + reqID [ I ] - ID of the request being scheduled this ID must exist + in the internal request/schedule maps + + schedule [ I ] - Value in milliseconds that indicates the approximate + time from now that the request is to be sent out, the + actual time that the request is sent will be greater + than or equal to this value dependant on requests + scheduled before the request in question and + standard server processing time + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::ScheduleRequest( + ULONG reqID, + ULONG schedule ) +{ + // Assume failure + bool bRC = false; + + // Schedule adjust is in milliseconds + timespec schTimer = TimeIn( schedule ); + + // Create the schedule entry + tSchedule newEntry( schTimer, reqID ); + + // Fit this request into the schedule (ordered by scheduled time) + mRequestSchedule.insert( newEntry ); + + // Note: timer will be updated when mScheduleMutex is unlocked + + return bRC; +} + +/*=========================================================================== +METHOD: + RescheduleActiveRequest (Internal Method) + +DESCRIPTION: + Reschedule (or cleanup) the active request + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RescheduleActiveRequest() +{ + // Are there more attempts to be made? + if (mpActiveRequest->mAttempts < mpActiveRequest->mRequest.GetRequests()) + { + // Yes, first reset the request + mpActiveRequest->Reset(); + + // Now add it back to the request map + mRequestMap[mpActiveRequest->mID] = mpActiveRequest; + + TRACE( "RescheduleActiveRequest(): req %lu rescheduled\n", mpActiveRequest->mID ); + + // Lastly reschedule the request + ScheduleRequest( mpActiveRequest->mID, + mpActiveRequest->mRequest.GetFrequency() ); + + } + else + { + TRACE( "RescheduleActiveRequest(): req %lu removed\n", mpActiveRequest->mID ); + + // No, we are through with this request + delete mpActiveRequest; + } + + // There is no longer an active request + mpActiveRequest = 0; + +} + +/*=========================================================================== +METHOD: + ProcessRequest (Internal Method) + +DESCRIPTION: + Process a single outgoing protocol request, this consists of removing + the request ID from the head of the schedule, looking up the internal + request object in the request map, sending out the request, and setting + up the response timer (if a response is required) + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: +===========================================================================*/ +void cProtocolServer::ProcessRequest() +{ + // Is there already an active request? + if (mpActiveRequest != 0 || mpConnection == 0) + { + return; + } + + // Grab request ID from the schedule + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + // Did we find the request? + if (pScheduleIter == mRequestSchedule.end()) + { + // No + return; + } + + // Yes, grab the request ID + ULONG reqID = pScheduleIter->second; + + // Remove from schedule + mRequestSchedule.erase( pScheduleIter ); + + // Look up the internal request object + std::map ::iterator pReqIter; + pReqIter = mRequestMap.find( reqID ); + + // Request not found around? + if (pReqIter == mRequestMap.end() || pReqIter->second == 0) + { + // No + return; + } + + // Set this request as the active request + mpActiveRequest = pReqIter->second; + + TRACE( "ProcessRequest(): req %lu started\n", mpActiveRequest->mID ); + + // Remove request from pending request map + mRequestMap.erase( pReqIter ); + + // Extract the underlying request + const sProtocolRequest & req = mpActiveRequest->mRequest; + + // Increment attempt count? + if (req.GetRequests() != INFINITE_REQS) + { + // This request isn't an indefinite one, so keep track of each attempt + mpActiveRequest->mAttempts++; + } + + bool bTxSuccess = false; + + // Encode data for transmission? + bool bEncoded = false; + sSharedBuffer * pEncoded = 0; + pEncoded = EncodeTxData( req.GetSharedBuffer(), bEncoded ); + if (bEncoded == false) + { + // Note: no longer asynchronus + // Send the request data + bTxSuccess = mpConnection->TxData( req.GetBuffer(), + req.GetSize() ); + } + else if (bEncoded == true) + { + if (pEncoded != 0 && pEncoded->IsValid() == true) + { + // Note: no longer asynchronus + // Send the request data + mpActiveRequest->mEncodedSize = pEncoded->GetSize(); + bTxSuccess = mpConnection->TxData( pEncoded->GetBuffer(), + pEncoded->GetSize() ); + } + } + + if (bTxSuccess == true) + { + TRACE( "ProcessRequest(): req %lu finished\n", mpActiveRequest->mID ); + TxComplete(); + } + else + { + TxError(); + TRACE( "ProcessRequest(): req finished with a TxError\n" ); + } + + return; +} + +/*=========================================================================== +METHOD: + CheckSystemTime (Internal Method) + +DESCRIPTION: + Check that system time hasn't moved backwards. Since we use the system + time for scheduling requests we need to periodically check that the + user (or system itself) hasn't reset system time backwards, if it has + then we reschedule everything to the current system time. This disrupts + the schedule but avoids stranding requests + + Updates mLastTime + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool: System time moved backwards? +===========================================================================*/ +bool cProtocolServer::CheckSystemTime() +{ + // Assume that time is still marching forward + bool bAdjust = false; + + timespec curTime = TimeIn( 0 ); + + if (curTime < mLastTime) + { + // Looks like the system clock has been adjusted to an earlier + // value, go through the current schedule and adjust each timer + // to reflect the adjustment. This isn't an exact approach but + // it prevents requests from being stranded which is our goal + + // Note: set iterators are constant. This means we need to + // create a set with the new data, we can't modify this one + + std::set < tSchedule, std::less > tempSchedule; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + while (pScheduleIter != mRequestSchedule.end()) + { + tSchedule entry = *pScheduleIter; + entry.first.tv_sec = curTime.tv_sec; + entry.first.tv_nsec = curTime.tv_nsec; + tempSchedule.insert( entry ); + + pScheduleIter++; + } + + mRequestSchedule = tempSchedule; + + // Update mActiveRequestTimeout + if ( (mpActiveRequest != 0) + && (mpActiveRequest->mbWaitingForResponse == true) ) + { + // Restart active request's timeout + ULONG mTimeout = mpActiveRequest->mRequest.GetTimeout(); + mActiveRequestTimeout = TimeIn( mTimeout ); + } + + TRACE( "Time has moved backwards, schedule updated\n" ); + + // Indicate the change + bAdjust = true; + } + + mLastTime.tv_sec = curTime.tv_sec; + mLastTime.tv_nsec = curTime.tv_nsec; + + return bAdjust; +} + +/*=========================================================================== +METHOD: + RxComplete (Internal Method) + +DESCRIPTION: + Handle completion of receive data operation + +PARAMETERS: + status [ I ] - Status of operation + bytesReceived [ I ] - Number of bytes received + +SEQUENCING: + This method is sequenced according to the schedule mutex + i.e. any other thread that needs to modify the schedule + will block until this method completes + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RxComplete( + DWORD status, + DWORD bytesReceived ) +{ + if (status != NO_ERROR) + { + TRACE( "cProtocolServer::RxComplete() = %lu\n", status ); + } + + if (mpConnection == 0) + { + TRACE( "cProtocolServer::RxComplete() - Not initialized\n" ); + return; + } + + // Error with the read + if (status != NO_ERROR || bytesReceived == 0) + { + // Setup the next read + mpConnection->RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + + return; + } + + // Get Schedule Mutex + if (GetScheduleMutex() == false) + { + TRACE( "RxComplete(), unable to get schedule Mutex\n" ); + return; + } + + TRACE( "RxComplete() - Entry at %llu\n", GetTickCount() ); + + // Decode data + bool bAbortTx = false; + ULONG rspIdx = INVALID_LOG_INDEX; + bool bRsp = DecodeRxData( bytesReceived, rspIdx, bAbortTx ); + + // Is there an active request that needs to be aborted + if (mpActiveRequest != 0 && bAbortTx == true) + { + // Yes, terminate the transmission and handle the error + mpConnection->CancelTx(); + TxError(); + } + // Is there an active request and a valid response? + else if (mpActiveRequest != 0 && bRsp == true) + { + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Notify client that response was received + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_RECV, + (DWORD)mpActiveRequest->mID, + (DWORD)rspIdx ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); + } + + // Setup the next read + mpConnection->RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + + TRACE( "RxComplete() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return; + } + + return; +} + +/*=========================================================================== +METHOD: + RxTimeout (Internal Method) + +DESCRIPTION: + Handle the response timer expiring + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RxTimeout() +{ + // No active request? + if (mpActiveRequest == 0) + { + TRACE( "RxTimeout() with no active request\n" ); + ASSERT( 0 ); + } + + TRACE( "RxTimeout() for req %lu\n", mpActiveRequest->mID ); + + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Failure to receive response, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_ERR, + (DWORD)mpActiveRequest->mID, + (DWORD)0 ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); +} + +/*=========================================================================== +METHOD: + TxComplete (Internal Method) + +DESCRIPTION: + Handle completion of transmit data operation + +PARAMETERS: + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::TxComplete() +{ + // No active request? + if (mpActiveRequest == 0 || mpConnection == 0) + { + TRACE( "TxComplete() called with no active request\n" ); + ASSERT( 0 ); + } + + TRACE( "TxComplete() req %lu started\n", mpActiveRequest->mID ); + + ULONG reqID = mpActiveRequest->mID; + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Notify client of auxiliary data being sent? + if (mpActiveRequest->mRequiredAuxTxs && mpActiveRequest->mCurrentAuxTx) + { + pNotifier->Notify( ePROTOCOL_EVT_AUX_TU_SENT, + (DWORD)reqID, + (DWORD)mpActiveRequest->mEncodedSize ); + } + + // Check for more auxiliary data to transmit + if (mpActiveRequest->mCurrentAuxTx < mpActiveRequest->mRequiredAuxTxs) + { + ULONG auxDataSz = 0; + const BYTE * pAuxData = req.GetAuxiliaryData( auxDataSz ); + if (auxDataSz > 0 && pAuxData != 0) + { + bool bRC = false; + + // Adjust for current MTU + pAuxData += (mpActiveRequest->mCurrentAuxTx * MAX_AUX_MTU_SIZE); + mpActiveRequest->mCurrentAuxTx++; + + // Last MTU? + if (mpActiveRequest->mCurrentAuxTx == mpActiveRequest->mRequiredAuxTxs) + { + // More than one MTU? + if (mpActiveRequest->mRequiredAuxTxs > 1) + { + auxDataSz = (auxDataSz % MAX_AUX_MTU_SIZE); + if (auxDataSz == 0) + { + auxDataSz = MAX_AUX_MTU_SIZE; + } + } + + if (auxDataSz % MAX_PACKET_SIZE == 0) + { + // If last write of unframed write request is divisible + // by 512, break off last byte and send seperatly. + TRACE( "TxComplete() Special case, break off last byte\n" ); + + bRC = mpConnection->TxData( pAuxData, + auxDataSz - 1 ); + + if (bRC == true) + { + bRC = mpConnection->TxData( pAuxData + auxDataSz -1, + 1 ); + } + } + else + { + bRC = mpConnection->TxData( pAuxData, + auxDataSz ); + } + } + else if (mpActiveRequest->mRequiredAuxTxs > 1) + { + auxDataSz = MAX_AUX_MTU_SIZE; + + bRC = mpConnection->TxData( pAuxData, + auxDataSz ); + } + + if (bRC == true) + { + mpActiveRequest->mEncodedSize = auxDataSz; + TxComplete(); + } + else + { + TxError(); + } + + return; + } + } + + // Another successful transmission, add the buffer to the log + ULONG reqIdx = INVALID_LOG_INDEX; + + sProtocolBuffer pb( req.GetSharedBuffer() ); + reqIdx = mLog.AddBuffer( pb ); + + // Notify client? + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_SENT, (DWORD)reqID, (DWORD)reqIdx ); + } + + // Wait for a response? + if (mpActiveRequest->mRequest.IsTXOnly() == false) + { + // We now await the response + mpActiveRequest->mbWaitingForResponse = true; + mActiveRequestTimeout = TimeIn( mpActiveRequest->mRequest.GetTimeout() ); + } + else + { + // Reschedule request as needed + RescheduleActiveRequest(); + } +} + +/*=========================================================================== +METHOD: + TxError (Internal Method) + +DESCRIPTION: + Handle transmit data operation error be either rescheduling the + request or cleaning it up + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::TxError() +{ + // No active request? + if (mpActiveRequest == 0) + { + return; + } + + ULONG reqID = mpActiveRequest->mID; + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Failure to send request, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_ERR, (DWORD)reqID, (DWORD)0 ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the protocol server by starting up the schedule thread + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Initialize() +{ + // Assume failure + bool bRC = false; + + mbExiting = false; + + // Get mScheduleMutex + if (GetScheduleMutex() == true) + { + if (mScheduleThreadID == 0) + { + // Yes, start thread + int nRet = pthread_create( &mScheduleThreadID, + NULL, + ScheduleThread, + this ); + if (nRet == 0) + { + // Success! + bRC = true; + } + } + } + else + { + TRACE( "cProtocolServer::Initialize(), unable to aquire ScheduleMutex\n" ); + return false; + } + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return false; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Exit (Public Method) + +DESCRIPTION: + Exit the protocol server by exiting the schedule thread (if necessary) + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Exit() +{ + // Assume failure + bool bRC = false; + + if (mScheduleThreadID != 0) + { + if (GetScheduleMutex() == false) + { + // This should never happen + return false; + } + + // Check that mScheduleTheadID is still not 0 + if (mScheduleThreadID == 0) + { + printf( "mScheduleThreadID was zero!!!\n" ); + ReleaseScheduleMutex( false ); + return false; + } + + // Set exit event + mbExiting = true; + + // Signal a schedule update + if (mThreadScheduleEvent.Set( 1 ) != 0) + { + // This should never happen + return false; + } + + TRACE( "Joining ScheduleThread %lu\n", mScheduleThreadID ); + + // Allow process to continue until it finishes + int nRet = pthread_join( mScheduleThreadID, NULL ); + if (nRet == ESRCH) + { + TRACE( "ScheduleThread has exited already\n" ); + } + else if (nRet != 0) + { + TRACE( "Unable to join ScheduleThread. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + TRACE( "cProtocolServer::Exit(), completed thread %lu\n", + (ULONG)mScheduleThreadID ); + + bRC = true; + + // Release "handle" + mScheduleThreadID = 0; + + // Release mutex lock, don't signal ScheduleThread + if (ReleaseScheduleMutex( false ) == false) + { + // This should never happen + return false; + } + } + else + { + // No ScheduleThread + bRC = true; + } + + // Free any allocated requests + std::map ::iterator pReqIter; + pReqIter = mRequestMap.begin(); + + while (pReqIter != mRequestMap.end()) + { + sProtocolReqRsp * pReqRsp = pReqIter->second; + if (pReqRsp != 0) + { + delete pReqRsp; + } + + pReqIter++; + } + + mRequestMap.clear(); + + // Free log + mLog.Clear(); + + return bRC; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the given communications port + +PARAMETERS: + pPort [ I ] - String pointer representing the device node to + connect to (IE: /dev/qcqmi0) + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Connect( LPCSTR pPort ) +{ + // Assume failure + bool bRC = false; + if (pPort == 0 || pPort[0] == 0 || mpConnection == 0) + { + return bRC; + } + + // Connect to device + + // Set callback + mRxCallback.SetServer( this ); + + // Override to initialize port with protocol specific options + bRC = mpConnection->Connect( pPort ); + if (bRC == true) + { + bRC = InitializeComm(); + if (bRC == true) + { + // Setup the initial read + mpConnection->RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the current communications port + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Disconnect() +{ + // Disconnect + + if (mpConnection != 0) + { + // Cancel any outstanding I/O + mpConnection->CancelIO(); + } + + // Empty callback + mRxCallback.SetServer( 0 ); + + // Cleanup COM port + CleanupComm(); + + if (mpConnection != 0) + { + // Now disconnect + bool bDis = mpConnection->Disconnect(); + delete mpConnection; + return bDis; + } + else + { + return true; + } +} + +/*=========================================================================== +METHOD: + IsConnected (Public Method) + +DESCRIPTION: + Are we currently connected to a port? + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::IsConnected() +{ + return (mpConnection != 0 && mpConnection->IsConnected()); +} + +/*=========================================================================== +METHOD: + AddRequest (Public Method) + +DESCRIPTION: + Add an outgoing protocol request to the protocol server request queue + +PARAMETERS: + req [ I ] - Request being added + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + ULONG - ID of scheduled request (INVALID_REQUEST_ID upon error) +===========================================================================*/ +ULONG cProtocolServer::AddRequest( const sProtocolRequest & req ) +{ + // Assume failure + ULONG reqID = INVALID_REQUEST_ID; + + // Server not configured for sending requests? + if (IsValid( mTxType ) == false) + { + return reqID; + } + + // Request type not valid for server? + if (req.GetType() != mTxType) + { + return reqID; + } + + // Invalide request? + if (ValidateRequest( req ) == false) + { + return reqID; + } + + // Get mScheduleMutex + if (GetScheduleMutex() == true) + { + TRACE( "AddRequest() - Entry at %llu\n", GetTickCount() ); + + // Grab next available request ID + if (++mLastRequestID == 0) + { + mLastRequestID++; + } + + reqID = mLastRequestID; + while (mRequestMap.find( reqID ) != mRequestMap.end()) + { + reqID++; + } + + // Wrap in our internal structure + sProtocolReqRsp * pReqRsp = 0; + pReqRsp = new sProtocolReqRsp( req, reqID, MAX_AUX_MTU_SIZE ); + + if (pReqRsp != 0) + { + // Add to request map + mRequestMap[reqID] = pReqRsp; + + // ... and schedule + ScheduleRequest( reqID, req.GetSchedule() ); + } + + TRACE( "AddRequest() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return INVALID_REQUEST_ID; + } + } + else + { + TRACE( "cProtocolServer::AddRequest(), unable to get schedule Mutex\n" ); + } + + return reqID; +} + +/*=========================================================================== +METHOD: + RemoveRequest (Public Method) + +DESCRIPTION: + Remove a previously added protocol request + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + + Note: If a request is being written, it cannot be inturrupted as + both ProcessRequest and RemoveRequest depend on the ScheduleMutex + and the write is synchronus. If the request has been written but + the read has not been triggered it can be removed. + +PARAMETERS: + reqID [ I ] - ID of request being removed + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::RemoveRequest( ULONG reqID ) +{ + // Assume failure + bool bRC = false; + + // Get Schedule Mutex + if (GetScheduleMutex() == true) + { + TRACE( "RemoveRequest() - Entry at %llu\n", GetTickCount() ); + + bRC = HandleRemoveRequest( reqID ); + + TRACE( "RemoveRequest() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return false; + } + } + else + { + TRACE( "cProtocolServer::RemoveRequest(), unable to get mScheduleMutex\n" ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetScheduleMutex (Internal Method) + +DESCRIPTION: + Get the schedule mutex. Additionally a check is applied to verify the + DEADLOCK_TIME was not exceeded + +SEQUENCING: + This function will block until the mScheduleMutex is aquired + +PARAMETERS: + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::GetScheduleMutex() +{ + ULONGLONG nStart = GetTickCount(); + + //TRACE( "Locking Schedule mutex\n" ); + int nRet = pthread_mutex_lock( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to lock schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + ULONGLONG nEnd = GetTickCount(); + if (nEnd - nStart > DEADLOCK_TIME) + { + TRACE( "Deadlock time exceeded: took %llu ms\n", nEnd - nStart ); + ReleaseScheduleMutex( true ); + return false; + } + + //TRACE( "Locked ScheduleMutex\n" ); + return true; +} + +/*=========================================================================== +METHOD: + ReleaseScheduleMutex (Internal Method) + +DESCRIPTION: + Release lock on the schedule mutex + +SEQUENCING: + Calling process must have lock + +PARAMETERS: + bSignalThread [ I ] - Signal Schedule thread as well? + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::ReleaseScheduleMutex( bool bSignalThread ) +{ + if (bSignalThread == true) + { + if (mThreadScheduleEvent.Set( 1 ) != 0) + { + return false; + } + } + + int nRet = pthread_mutex_unlock( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to unlock schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return true; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolServer.h b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolServer.h new file mode 100755 index 0000000..4db0d5c --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/ProtocolServer.h @@ -0,0 +1,363 @@ +/*=========================================================================== +FILE: + ProtocolServer.h + +DESCRIPTION: + Generic protocol packet server + +PUBLIC CLASSES AND METHODS: + cProtocolServer + Abstract base class for protocol servers + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Connection.h" +#include "ProtocolRequest.h" +#include "ProtocolLog.h" +#include "Event.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +class cProtocolServer; +struct sServerControl; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid request ID +extern const ULONG INVALID_REQUEST_ID; + +// Fill timespec with the time it will be in specified milliseconds +// Relative time to Absolute time +timespec TimeIn( ULONG millis ); + +// Find the milliseconds from current time this timespec will occur +// Absolute time to Relative time +ULONG TimeFromNow( timespec time ); + +// Provide a number for sequencing reference, similar to the windows function +ULONGLONG GetTickCount(); + +// timespec < comparison method +inline bool operator< (const timespec & first, const timespec & second) +{ + return ( (first.tv_sec < second.tv_sec) + ||( (first.tv_sec == second.tv_sec) + &&(first.tv_nsec < second.tv_nsec) ) ); +} + +// timespec <= comparison method +inline bool operator<= (const timespec & first, const timespec & second) +{ + return ( (first.tv_sec < second.tv_sec) + ||( (first.tv_sec == second.tv_sec) + &&(first.tv_nsec <= second.tv_nsec) ) ); +} + +/*=========================================================================*/ +// Class cProtocolServerRxCallback +/*=========================================================================*/ +class cProtocolServerRxCallback +{ + public: + // (Inline) Constructor + cProtocolServerRxCallback() + : mpServer( 0 ) + { }; + + // (Inline) Destructor + virtual ~cProtocolServerRxCallback() { }; + + // (Inline) Set server object to pass results to + void SetServer( cProtocolServer * pServer ) + { + mpServer = pServer; + }; + + // The I/O has been completed, process the results + virtual void IOComplete( + DWORD status, + DWORD bytesReceived ); + + protected: + /* Protocol server to interact with */ + cProtocolServer * mpServer; +}; + +/*=========================================================================*/ +// Class cProtocolServer +/*=========================================================================*/ +class cProtocolServer +{ + public: + // Constructor + cProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cProtocolServer(); + + // Initialize the protocol server + bool Initialize(); + + // Exit the protocol server + bool Exit(); + + // Connect to the given communications port + bool Connect( LPCSTR pPort ); + + // Disconnect from target + bool Disconnect(); + + // Are we currently connected to a port? + bool IsConnected(); + + // Add an outgoing protocol request to the protocol server request queue + ULONG AddRequest( const sProtocolRequest & req ); + + // Remove a previously added protocol request + bool RemoveRequest( ULONG reqID ); + + // (Inline) Return the protocol log + const cProtocolLog & GetLog() + { + return mLog; + }; + + protected: + // Internal protocol server request/response structure, used to track + // info related to sending out a request + struct sProtocolReqRsp + { + public: + // Constructor + sProtocolReqRsp( + const sProtocolRequest & requestInfo, + ULONG requestID, + ULONG auxDataMTU ); + + // Copy constructor + sProtocolReqRsp( const sProtocolReqRsp & reqRsp ); + + // (Inline) Reset for next transmission attempt + void Reset() + { + mEncodedSize = mRequest.GetSize(); + + mCurrentAuxTx = 0; + mbWaitingForResponse = 0; + }; + + /* Request ID */ + ULONG mID; + + /* Number of times this request has been attempted */ + ULONG mAttempts; + + /* Size of encoded data being transmitted */ + ULONG mEncodedSize; + + /* Number of required auxiliary data transmissions */ + ULONG mRequiredAuxTxs; + + /* Current auxiliary data transmission */ + ULONG mCurrentAuxTx; + + /* Are we currently waiting for a response? */ + bool mbWaitingForResponse; + + /* Underlying protocol request */ + sProtocolRequest mRequest; + }; + + // Handle the remove request + bool HandleRemoveRequest( ULONG reqID ); + + // Schedule a request for transmission + bool ScheduleRequest( + ULONG reqID, + ULONG schedule ); + + // (Inline) Get next request's time from mRequestSchedule + timespec GetNextRequestTime() + { + timespec outTime; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + tSchedule entry = *pScheduleIter; + + outTime = entry.first; + return outTime; + } + + // (Inline) Validate a request that is about to be scheduled + virtual bool ValidateRequest( const sProtocolRequest & req ) + { + return req.IsValid(); + }; + + // Reschedule (or cleanup) the active request + void RescheduleActiveRequest(); + + // Process a single outgoing protocol request + void ProcessRequest(); + + // Check that system time hasn't moved backwards + bool CheckSystemTime(); + + // Perform protocol specific communications port initialization + virtual bool InitializeComm() = 0; + + // Perform protocol specific communications port cleanup + virtual bool CleanupComm() = 0; + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) = 0; + + // Decode incoming data into packets returning the last response + virtual bool DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ) = 0; + + // Handle completion of receive data operation + void RxComplete( + DWORD status, + DWORD bytesReceived ); + + // Handle the response timer expiring + void RxTimeout(); + + // Handle completion of transmit data operation + virtual void TxComplete(); + + // Handle a transmission error + void TxError(); + + /* Underlying communications object */ + cConnection * mpConnection; + + /* Underlying connection type */ + enum eConnectionType + { + eConnectionType_Begin = 0, + + eConnectionType_RmNet = 1, + eConnectionType_SMD = 2, + + eConnectionType_End + + } mConnectionType; + + /* Rx callback */ + cProtocolServerRxCallback mRxCallback; + + /* ID of Schedule thread */ + pthread_t mScheduleThreadID; + + // ScheduleThread signal event + cEvent mThreadScheduleEvent; + + // Schedule mutex + // Ensures exclusive access to mRequestSchedule + pthread_mutex_t mScheduleMutex; + + // Is the thread in the process of exiting? + // (no new commands will be accepted) + bool mbExiting; + + /* Client/server thread control object */ + sSharedBuffer * mpServerControl; + + /* Protocol request schedule (scheduled time/request ID) */ + typedef std::pair tSchedule; + std::set < tSchedule, std::less > mRequestSchedule; + + /* Last system time value (used to check for time changes) */ + timespec mLastTime; + + /* Protocol request map (request ID mapped to internal req/rsp struct) */ + std::map mRequestMap; + + /* Last assigned request ID */ + ULONG mLastRequestID; + + /* Current request being processed */ + sProtocolReqRsp * mpActiveRequest; + + /* Absolute timeout for mpActiveRequest + based on when write was completed */ + timespec mActiveRequestTimeout; + + /* Data buffer for incoming data */ + BYTE * mpRxBuffer; + + /* Size of above buffer (i.e. how much data to read in at once) */ + ULONG mRxBufferSize; + + /* Protocol type for incoming/outgoing data*/ + eProtocolType mRxType; + eProtocolType mTxType; + + /* Protocol log */ + cProtocolLog mLog; + + // Get a lock on ScheduleMutex + bool GetScheduleMutex(); + + // Release lock on ScheduleMutex + // Signal ScheduleThread if desired + bool ReleaseScheduleMutex( bool bSignalThread = true ); + + // Schedule Thread gets full access + friend void * ScheduleThread( PVOID pArg ); + + // Callback objects get full access + friend class cProtocolServerRxCallback; +}; + diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/QMIBuffers.cpp b/gobi-api/Gobi_2012-06-18-1054/Core/QMIBuffers.cpp new file mode 100755 index 0000000..79c647a --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/QMIBuffers.cpp @@ -0,0 +1,366 @@ +/*=========================================================================== +FILE: + QMIBuffers.cpp + +DESCRIPTION: + QMI service protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQMIControlRawTransactionHeader + sQMIServiceRawTransactionHeader + sQMIRawMessageHeader + sQMIRawContentHeader + + sQMIServiceBuffer + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sQMIServiceBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQMIServiceBuffer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the DIAG data + +RETURN VALUE: + None +===========================================================================*/ +sQMIServiceBuffer::sQMIServiceBuffer( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQMIServiceBuffer::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQMIServiceBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQMIServiceBuffer::~sQMIServiceBuffer() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + GetResult (Public Method) + +DESCRIPTION: + Return contents of mandatory result content + +PARAMETERS: + returnCode [ I ] - The return code (should be eQMIResultCode) + errorCode [ I ] - The error code (should be eQMIErrorCode) + +RETURN VALUE: + bool +===========================================================================*/ +bool sQMIServiceBuffer::GetResult( + ULONG & returnCode, + ULONG & errorCode ) +{ + if (IsResponse() == false) + { + return false; + } + + std::map ::const_iterator pIter; + pIter = mContents.find( QMI_TLV_ID_RESULT ); + if (pIter == mContents.end()) + { + return false; + } + + const sQMIRawContentHeader * pContent = pIter->second; + if (pContent == 0) + { + ASSERT( 0 ); + return false; + } + + if (pContent->mLength != 4) + { + return false; + } + + const WORD * pData = (const WORD *)(++pContent); + + returnCode = (ULONG)*pData++; + errorCode = (ULONG)*pData; + + return true; +} + +/*=========================================================================== +METHOD: + BuildBuffer (Static Public Method) + +DESCRIPTION: + Build a QMI request + +PARAMETERS: + serviceType [ I ] - QMI service type + msgID [ I ] - The QMI message request ID + bResponse [ I ] - Build a response? + bIndication [ I ] - Build an indication? + pPayload [ I ] - Payload + payloadLen [ I ] - Size of above payload + +RETURN VALUE: + sSharedBuffer * : The request in an allocated buffer (0 on error) +===========================================================================*/ +sSharedBuffer * sQMIServiceBuffer::BuildBuffer( + eQMIService serviceType, + WORD msgID, + bool bResponse, + bool bIndication, + const BYTE * pPayload, + ULONG payloadLen ) +{ + const ULONG szTransHdr = (ULONG)sizeof(sQMIServiceRawTransactionHeader); + const ULONG szMsgHdr = (ULONG)sizeof(sQMIRawMessageHeader); + const ULONG totalHdrSz = szTransHdr + szMsgHdr; + + // Truncate payload? + if (payloadLen > (QMI_MAX_BUFFER_SIZE - totalHdrSz)) + { + payloadLen = QMI_MAX_BUFFER_SIZE - totalHdrSz; + } + + // Make sure length agrees with pointer + if (pPayload == 0) + { + payloadLen = 0; + } + + // Allocate buffer + PBYTE pBuffer = new BYTE[payloadLen + totalHdrSz]; + if (pBuffer == 0) + { + return 0; + } + + // Format header + sQMIServiceRawTransactionHeader * pHdr = 0; + pHdr = (sQMIServiceRawTransactionHeader *)&pBuffer[0]; + pHdr->mCompound = 0; + pHdr->mResponse = 0; + pHdr->mIndication = 0; + pHdr->mReserved = 0; + pHdr->mTransactionID = 1; + + bool bTX = true; + if (bResponse == true) + { + pHdr->mResponse = 1; + bTX = false; + } + else if (bIndication == true) + { + pHdr->mIndication = 1; + bTX = false; + } + + pHdr++; + + // Format message header + sQMIRawMessageHeader * pMsg = 0; + pMsg = (sQMIRawMessageHeader *)pHdr; + pMsg->mMessageID = msgID; + pMsg->mLength = (WORD)payloadLen; + + // Copy in payload? + if (payloadLen > 0 && pPayload != 0) + { + memcpy( (LPVOID)&pBuffer[totalHdrSz], + (LPCVOID)&pPayload[0], + (SIZE_T)payloadLen ); + } + + // Compute total size + ULONG sz = payloadLen + totalHdrSz; + + // Build and return the shared buffer + eProtocolType pt = MapQMIServiceToProtocol( serviceType, bTX ); + sSharedBuffer * pBuf = new sSharedBuffer( sz, pBuffer, pt ); + return pBuf; +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this open unframed request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQMIServiceBuffer::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (IsQMIProtocol( pt ) == false) + { + mbValid = bRC; + return bRC; + } + + const ULONG szTransHdr = (ULONG)sizeof(sQMIServiceRawTransactionHeader); + const ULONG szMsgHdr = (ULONG)sizeof(sQMIRawMessageHeader); + const ULONG szContentHdr = (ULONG)sizeof(sQMIRawContentHeader); + + // Must be enough space for both headers + ULONG sz = GetSize(); + if (sz < szTransHdr + szMsgHdr) + { + mbValid = bRC; + return bRC; + } + + const BYTE * pBuffer = GetBuffer(); + + // Obtain transaction header + const sQMIServiceRawTransactionHeader * pTransHdr = 0; + pTransHdr = (const sQMIServiceRawTransactionHeader *)pBuffer; + pBuffer += szTransHdr; + + // This is required to be 0 + if (pTransHdr->mCompound != 0) + { + mbValid = bRC; + return bRC; + } + + // These are mutually exclusive + if (pTransHdr->mIndication == 1 && pTransHdr->mResponse == 1) + { + mbValid = bRC; + return bRC; + } + + // Requests/responses required valid transaction IDs + if ( (pTransHdr->mIndication == 0) + && (pTransHdr->mTransactionID == (WORD)INVALID_QMI_TRANSACTION_ID) ) + { + mbValid = bRC; + return bRC; + } + + if ( (pTransHdr->mResponse == 1 || pTransHdr->mIndication == 1) + && (IsQMIProtocolRX( pt ) == false) ) + { + mbValid = bRC; + return bRC; + } + + if ( (pTransHdr->mResponse == 0 && pTransHdr->mIndication == 0) + && (IsQMIProtocolTX( pt ) == false) ) + { + mbValid = bRC; + return bRC; + } + + // Obtain message header + const sQMIRawMessageHeader * pMsgHdr = 0; + pMsgHdr = (const sQMIRawMessageHeader *)pBuffer; + pBuffer += szMsgHdr; + + // Validate reported length + if (sz != ((ULONG)pMsgHdr->mLength + szTransHdr + szMsgHdr)) + { + mbValid = bRC; + return bRC; + } + + // Extract content TLV structures + ULONG contentProcessed = 0; + ULONG contentSz = (ULONG)pMsgHdr->mLength; + while (contentProcessed < contentSz) + { + const sQMIRawContentHeader * pContent = 0; + pContent = (const sQMIRawContentHeader *)pBuffer; + + ULONG tlvLen = szContentHdr + pContent->mLength; + + contentProcessed += tlvLen; + if (contentProcessed <= contentSz) + { + mContents[(ULONG)pContent->mTypeID] = pContent; + } + else + { + mContents.clear(); + + mbValid = bRC; + return bRC; + } + + pBuffer += tlvLen; + } + + // Validate TLV reported lengths + if (contentProcessed != contentSz) + { + mbValid = bRC; + return bRC; + } + + // Success! + bRC = true; + + mbValid = bRC; + return mbValid; +} + diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/QMIBuffers.h b/gobi-api/Gobi_2012-06-18-1054/Core/QMIBuffers.h new file mode 100755 index 0000000..267da36 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/QMIBuffers.h @@ -0,0 +1,391 @@ +/*=========================================================================== +FILE: + QMIBuffers.h + +DESCRIPTION: + QMI service protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQMUXHeader + sQMIControlRawTransactionHeader + sQMIServiceRawTransactionHeader + sQMIRawMessageHeader + sQMIRawContentHeader + + sQMIServiceBuffer + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "QMIEnum.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// QMI maximum buffer size (cannot be larger than MAX_SHARED_BUFFER_SIZE) +const ULONG QMI_MAX_BUFFER_SIZE = MAX_SHARED_BUFFER_SIZE; + +// Content ID for mandatory result TLV +const ULONG QMI_TLV_ID_RESULT = 2; + +/*=========================================================================== +METHOD: + MapQMIServiceToProtocol (Inline Method) + +DESCRIPTION: + Map QMI service type (eQMIService) and direction to a protocol type + (eProtocolType) + +PARAMETERS: + serviceType [ I ] - Enum value being mapped + bTransmission [ I ] - Is this a transmission (TX vs. RX)? + +RETURN VALUE: + eProtocolType +===========================================================================*/ +inline eProtocolType MapQMIServiceToProtocol( + eQMIService serviceType, + bool bTransmission = true ) +{ + eProtocolType pt = ePROTOCOL_ENUM_BEGIN; + if (IsValid( serviceType ) == false) + { + return pt; + } + + DWORD tmp = ((DWORD)serviceType * 2) + (DWORD)ePROTOCOL_QMI_CTL_RX; + if (bTransmission == true) + { + tmp++; + } + + if (IsQMIProtocol( (eProtocolType)tmp ) == true) + { + pt = (eProtocolType)tmp; + } + + return pt; +}; + +/*=========================================================================== +METHOD: + MapProtocolToQMIService (Inline Method) + +DESCRIPTION: + Map protocol type (eProtocolType) to QMI service type (eQMIService) + +PARAMETERS: + protocolType [ I ] - Enum value being mapped + +RETURN VALUE: + bool +===========================================================================*/ +inline eQMIService MapProtocolToQMIService( eProtocolType protocolType ) +{ + eQMIService st = eQMI_SVC_ENUM_BEGIN; + if (IsQMIProtocol( protocolType ) == false) + { + return st; + } + + DWORD tmp = ((DWORD)protocolType - (DWORD)ePROTOCOL_QMI_CTL_RX) / 2; + if (IsValid( (eQMIService)tmp ) == true) + { + st = (eQMIService)tmp; + } + + return st; +}; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sQMUXHeader +// Struct to represent a QMUX transaction header (raw) +/*=========================================================================*/ +struct sQMUXHeader +{ + public: + WORD mLength; + BYTE mFlags; + BYTE mServiceType; + BYTE mClientID; +}; + +/*=========================================================================*/ +// Struct sQMIControlRawTransactionHeader +// Struct to represent a QMI control transaction header (raw) +/*=========================================================================*/ +struct sQMIControlRawTransactionHeader +{ + public: + BYTE mResponse : 1; // Is this a response transaction? + BYTE mIndication : 1; // Is this an indication transaction? + BYTE mReserved : 6; + + BYTE mTransactionID; // Transaction ID +}; + +/*=========================================================================*/ +// Struct sQMIServiceRawTransactionHeader +// Struct to represent a QMI service transaction header (raw) +/*=========================================================================*/ +struct sQMIServiceRawTransactionHeader +{ + public: + BYTE mCompound : 1; // Is this a compound transaction? + BYTE mResponse : 1; // Is this a response transaction? + BYTE mIndication : 1; // Is this an indication transaction? + BYTE mReserved : 5; + + WORD mTransactionID; // Transaction ID +}; + +/*=========================================================================*/ +// Struct sQMIRawMessageHeader +// Struct to represent a QMI (control/service) message header (raw) +/*=========================================================================*/ +struct sQMIRawMessageHeader +{ + public: + WORD mMessageID; // Message ID + WORD mLength; // Length of message (not including this header) +}; + +/*=========================================================================*/ +// Struct sQMIRawContentHeader +// Struct to represent a QMI (control/service) content +// (i.e Type/Length/Value, TLV) header (raw) +/*=========================================================================*/ +struct sQMIRawContentHeader +{ + public: + BYTE mTypeID; // Content type ID + WORD mLength; // Content length (not including this header) +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + + +/*=========================================================================*/ +// Struct sQMIServiceBuffer +// Struct to represent a QMI service channel request/response/indication +// (shared buffer) +/*=========================================================================*/ +struct sQMIServiceBuffer : public sProtocolBuffer +{ + public: + // Constructor + sQMIServiceBuffer( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQMIServiceBuffer(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bRequest = (pHdr->mResponse == 0 && pHdr->mIndication == 0); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bResponse = (pHdr->mResponse == 1); + } + + return bResponse; + }; + + // (Inline) Is this an indication? + bool IsIndication() const + { + bool bInd = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bInd = (pHdr->mIndication == 1); + } + + return bInd; + }; + + // (Inline) Return raw header + const sQMIServiceRawTransactionHeader * GetHeader() const + { + const sQMIServiceRawTransactionHeader * pHdr = 0; + if (IsValid() == true) + { + pHdr = (const sQMIServiceRawTransactionHeader *)GetBuffer(); + } + + return pHdr; + }; + + // (Inline) Return the message ID + ULONG GetMessageID() const + { + ULONG id = (ULONG)0xffffffff; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + pHdr++; + const sQMIRawMessageHeader * pMsgHdr = 0; + pMsgHdr = (sQMIRawMessageHeader *)pHdr; + + id = pMsgHdr->mMessageID; + } + + return id; + }; + + // (Inline) Return the transaction ID + WORD GetTransactionID() const + { + WORD id = (WORD)INVALID_QMI_TRANSACTION_ID; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + id = pHdr->mTransactionID; + } + + return id; + }; + + // (Inline) Return raw content array + const sQMIRawContentHeader * GetRawContents( ULONG & contentLen ) const + { + // Assume failure + ULONG len = 0; + const sQMIRawContentHeader * pRaw = 0; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + pHdr++; + const sQMIRawMessageHeader * pMsgHdr = 0; + pMsgHdr = (sQMIRawMessageHeader *)pHdr; + + len = pMsgHdr->mLength; + pMsgHdr++; + if (len > 0) + { + pRaw = (const sQMIRawContentHeader *)pMsgHdr; + } + } + + contentLen = len; + return pRaw; + }; + + // (Inline) Return content structures + std::map GetContents() const + { + return mContents; + }; + + // Return contents of mandatory result content + bool GetResult( + ULONG & returnCode, + ULONG & errorCode ); + + // Build a QMI request/response/indication + static sSharedBuffer * BuildBuffer( + eQMIService serviceType, + WORD msgID, + bool bResponse = false, + bool bIndication = false, + const BYTE * pData = 0, + ULONG dataLen = 0 ); + + protected: + // QMI protocol server has to be able to set the transaction ID + friend class cQMIProtocolServer; + + // Set the transaction ID + void SetTransactionID( WORD tid ) const + { + if (tid == (WORD)INVALID_QMI_TRANSACTION_ID || IsValid() == false) + { + return; + } + + sQMIServiceRawTransactionHeader * pHdr = 0; + pHdr = (sQMIServiceRawTransactionHeader *)GetHeader(); + if (pHdr != 0) + { + pHdr->mTransactionID = tid; + } + }; + + // Is this QMI request/response/indication packet valid? + virtual bool Validate(); + + /* Content TLV structures (indexed by type ID) */ + std::map mContents; + + private: + // Prevent 'upcopying' + sQMIServiceBuffer( const sProtocolBuffer & ); + sQMIServiceBuffer & operator = ( const sProtocolBuffer & ); +}; + diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/QMIEnum.h b/gobi-api/Gobi_2012-06-18-1054/Core/QMIEnum.h new file mode 100755 index 0000000..dd6dd4b --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/QMIEnum.h @@ -0,0 +1,1722 @@ +/*=========================================================================== +FILE: + QMIEnum.h + +DESCRIPTION: + QMI protocol enumerations and related methods + +PUBLIC ENUMERATIONS AND METHODS: + eQMIService + eQMIMessageCTL + eQMIMessageWDS + eQMIMessageDMS + eQMIMessageNAS + eQMIMessageWMS + eQMIMessagePDS + eQMIMessageAUTH + eQMIMessageAT + eQMIMessageVoice + eQMIMessageUIM + eQMIMessagePBM + eQMIMessageSAR + eQMIMessageRMTFS + eQMIMessageCAT + eQMIMessageRMS + eQMIMessageOMA + eQMIResultCode + eQMIErrorCode + eQMICallEndReason + eIPAddressType + eSMSMessageMode + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid QMI transaction ID +const ULONG INVALID_QMI_TRANSACTION_ID = 0; + +// QMI DMS PRL size constants +const ULONG QMI_DMS_MAX_PRL_SIZE = 16384; +const ULONG QMI_DMS_MAX_PRL_BLOCK = 256; + +/*=========================================================================*/ +// eQMIService Enumeration +// QMI Service Type Enumeration +/*=========================================================================*/ +enum eQMIService +{ + eQMI_SVC_ENUM_BEGIN = -1, + + eQMI_SVC_CONTROL, // 000 Control service + eQMI_SVC_WDS, // 001 Wireless data service + eQMI_SVC_DMS, // 002 Device management service + eQMI_SVC_NAS, // 003 Network access service + eQMI_SVC_QOS, // 004 Quality of service, err, service + eQMI_SVC_WMS, // 005 Wireless messaging service + eQMI_SVC_PDS, // 006 Position determination service + eQMI_SVC_AUTH, // 007 Authentication service + eQMI_SVC_AT, // 008 AT command processor service + eQMI_SVC_VOICE, // 009 Voice service + eQMI_SVC_CAT2, // 010 Card application toolkit service (new) + eQMI_SVC_UIM, // 011 UIM service + eQMI_SVC_PBM, // 012 Phonebook service + eQMI_SVC_RESERVED_13, // 013 Reserved + eQMI_SVC_RMTFS, // 014 Remote file system service + eQMI_SVC_RESERVED_15, // 015 Reserved + eQMI_SVC_LOC, // 016 Location service + eQMI_SVC_SAR, // 017 Specific absorption rate service + eQMI_SVC_RESERVED_18, // 018 Reserved + eQMI_SVC_RESERVED_19, // 019 Reserved + eQMI_SVC_CSD, // 020 Core sound driver service + eQMI_SVC_EFS, // 021 Embedded file system service + eQMI_SVC_RESERVED_22, // 022 Reserved + eQMI_SVC_TS, // 023 Thermal sensors service + eQMI_SVC_TMD, // 024 Thermal mitigation device service + eQMI_SVC_RESERVED_25, // 025 Reserved + eQMI_SVC_RESERVED_26, // 026 Reserved + eQMI_SVC_RESERVED_27, // 027 Reserved + eQMI_SVC_RESERVED_28, // 028 Reserved + + eQMI_SVC_CAT = 224, // 224 Card application toolkit service + eQMI_SVC_RMS, // 225 Remote management service + eQMI_SVC_OMA, // 226 Open mobile alliance dev mgmt service + + eQMI_SVC_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIService validity check + +PARAMETERS: + svc [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIService svc ) +{ + bool retVal = false; + if ( (svc > eQMI_SVC_ENUM_BEGIN && svc <= eQMI_SVC_RESERVED_28) + || (svc >= eQMI_SVC_CAT && svc < eQMI_SVC_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageCTL Enumeration +// QMI Control Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageCTL +{ + eQMI_CTL_ENUM_BEGIN = -1, + + eQMI_CTL_SET_INSTANCE_ID = 32, // 32 Set the unique link instance ID + eQMI_CTL_GET_VERSION_INFO, // 33 Get supported service version info + eQMI_CTL_GET_CLIENT_ID, // 34 Get a unique client ID + eQMI_CTL_RELEASE_CLIENT_ID, // 35 Release the unique client ID + eQMI_CTL_REVOKE_CLIENT_ID_IND, // 36 Indication of client ID revocation + eQMI_CTL_INVALID_CLIENT_ID, // 37 Indication of invalid client ID + eQMI_CTL_SET_DATA_FORMAT, // 38 Set host driver data format + eQMI_CTL_SYNC, // 39 Synchronize client/server + eQMI_CTL_SYNC_IND = 39, // 39 Synchronize indication + eQMI_CTL_SET_EVENT, // 40 Set event report conditions + eQMI_CTL_EVENT_IND = 40, // 40 Event report indication + eQMI_CTL_SET_POWER_SAVE_CFG, // 41 Set power save config + eQMI_CTL_SET_POWER_SAVE_MODE, // 42 Set power save mode + eQMI_CTL_GET_POWER_SAVE_MODE, // 43 Get power save mode + + eQMI_CTL_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageCTL validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageCTL msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_CTL_SET_INSTANCE_ID && msgID < eQMI_CTL_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageWDS Enumeration +// QMI WDS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageWDS +{ + eQMI_WDS_ENUM_BEGIN = -1, + + eQMI_WDS_RESET, // 000 Reset WDS service state variables + eQMI_WDS_SET_EVENT, // 001 Set connection state report conditions + eQMI_WDS_EVENT_IND = 1, // 001 Connection state report indication + eQMI_WDS_ABORT, // 002 Abort previously issued WDS command + eQMI_WDS_SET_INDICATION, // 003 Set indication conditions + + eQMI_WDS_START_NET = 32, // 032 Start WDS network interface + eQMI_WDS_STOP_NET, // 033 Stop WDS network interface + eQMI_WDS_GET_PKT_STATUS, // 034 Get packet data connection status + eQMI_WDS_PKT_STATUS_IND = 34, // 034 Packet data connection status indication + eQMI_WDS_GET_RATES, // 035 Get current bit rates of the connection + eQMI_WDS_GET_STATISTICS, // 036 Get the packet data transfer statistics + eQMI_WDS_G0_DORMANT, // 037 Go dormant + eQMI_WDS_G0_ACTIVE, // 038 Go active + eQMI_WDS_CREATE_PROFILE, // 039 Create profile with specified settings + eQMI_WDS_MODIFY_PROFILE, // 040 Modify profile with specified settings + eQMI_WDS_DELETE_PROFILE, // 041 Delete the specified profile + eQMI_WDS_GET_PROFILE_LIST, // 042 Get all profiles + eQMI_WDS_GET_PROFILE, // 043 Get the specified profile + eQMI_WDS_GET_DEFAULTS, // 044 Get the default data session settings + eQMI_WDS_GET_SETTINGS, // 045 Get the runtime data session settings + eQMI_WDS_SET_MIP, // 046 Get the mobile IP setting + eQMI_WDS_GET_MIP, // 047 Set the mobile IP setting + eQMI_WDS_GET_DORMANCY, // 048 Get the dormancy status + + eQMI_WDS_GET_AUTOCONNECT = 52, // 052 Get the NDIS autoconnect setting + eQMI_WDS_GET_DURATION, // 053 Get the duration of data session + eQMI_WDS_GET_MODEM_STATUS, // 054 Get the modem status + eQMI_WDS_MODEM_IND = 54, // 054 Modem status indication + eQMI_WDS_GET_DATA_BEARER, // 055 Get the data bearer type + eQMI_WDS_GET_MODEM_INFO, // 056 Get the modem info + eQMI_WDS_MODEM_INFO_IND = 56, // 056 Modem info indication + + eQMI_WDS_GET_ACTIVE_MIP = 60, // 060 Get the active mobile IP profile + eQMI_WDS_SET_ACTIVE_MIP, // 061 Set the active mobile IP profile + eQMI_WDS_GET_MIP_PROFILE, // 062 Get mobile IP profile settings + eQMI_WDS_SET_MIP_PROFILE, // 063 Set mobile IP profile settings + eQMI_WDS_GET_MIP_PARAMS, // 064 Get mobile IP parameters + eQMI_WDS_SET_MIP_PARAMS, // 065 Set mobile IP parameters + eQMI_WDS_GET_LAST_MIP_STATUS, // 066 Get last mobile IP status + eQMI_WDS_GET_AAA_AUTH_STATUS, // 067 Get AN-AAA authentication status + eQMI_WDS_GET_CUR_DATA_BEARER, // 068 Get current data bearer + eQMI_WDS_GET_CALL_LIST, // 069 Get the call history list + eQMI_WDS_GET_CALL_ENTRY, // 070 Get an entry from the call history list + eQMI_WDS_CLEAR_CALL_LIST, // 071 Clear the call history list + eQMI_WDS_GET_CALL_LIST_MAX, // 072 Get maximum size of call history list + eQMI_WDS_GET_DEFAULT_PROF_NUM, // 073 Get default profile number + eQMI_WDS_SET_DEFAULT_PROF_NUM, // 074 Set default profile number + eQMI_WDS_RESET_PROFILE, // 075 Reset profile + eQMI_WDS_RESET_PROF_PARAM, // 076 Reset profile param to invalid + eQMI_WDS_SET_IP_FAMILY, // 077 Set the client IP family preference + + eQMI_WDS_SET_AUTOCONNECT = 81, // 081 Set the NDIS autoconnect setting + eQMI_WDS_GET_DNS, // 082 Get the DNS setting + eQMI_WDS_SET_DNS, // 083 Set the DNS setting + eQMI_WDS_GET_PRE_DORMANCY, // 084 Get the CDMA pre-dormancy settings + eQMI_WDS_SET_CAM_TIMER, // 085 Set the CAM timer + eQMI_WDS_GET_CAM_TIMER, // 086 Get the CAM timer + eQMI_WDS_SET_SCRM, // 087 Set SCRM status + eQMI_WDS_GET_SCRM, // 088 Get SCRM status + eQMI_WDS_SET_RDUD, // 089 Set RDUD status + eQMI_WDS_GET_RDUD, // 090 Get RDUD status + eQMI_WDS_GET_SIPMIP_CALL_TYPE, // 091 Set SIP/MIP call type + eQMI_WDS_SET_PM_PERIOD, // 092 Set EV-DO page monitor period + eQMI_WDS_PM_PERIOD_IND = 92, // 092 EV-DO page monitor period indication + eQMI_WDS_SET_FORCE_LONG_SLEEP, // 093 Set EV-DO force long sleep feature + eQMI_WDS_GET_PM_PERIOD, // 094 Get EV-DO page monitor period + eQMI_WDS_GET_CALL_THROTTLE, // 095 Get call throttle info + eQMI_WDS_GET_NSAPI, // 096 Get NSAPI + eQMI_WDS_SET_DUN_CTRL_PREF, // 097 Set DUN control preference + eQMI_WDS_GET_DUN_CTRL_INFO, // 098 Set DUN control info + eQMI_WDS_SET_DUN_CTRL_EVENT, // 099 Set DUN control event preference + eQMI_WDS_DUN_CTRL_IND = 99, // 099 DUN control event report indication + eQMI_WDS_PENDING_DUN_CTRL, // 100 Control pending DUN call + + eQMI_WDS_TMGI_ACTIVATE, // 101 Activate eMBMS TMGI + eQMI_WDS_TMGI_ACT_IND = 101, // 101 eMBMS TMGI activate indication + eQMI_WDS_TMGI_DEACTIVATE, // 102 Activate eMBMS TMGI + eQMI_WDS_TMGI_DEACT_IND = 102, // 102 eMBMS TMGI activate indication + eQMI_WDS_TMGI_LIST_QUERY, // 103 Query for eMBMS TMGI list + eQMI_WDS_TMGI_LIST_IND, // 104 eMBMS TMGI list query indication + eQMI_WDS_GET_PREF_DATA_SYS, // 105 Get preferred data system + eQMI_WDS_GET_LAST_DATA_STATUS, // 106 Get last data call status + eQMI_WDS_GET_CURR_DATA_SYS, // 107 Get current data systems status + eQMI_WDS_GET_PDN_THROTTLE, // 108 Get PDN throttle info + + eQMI_WDS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageWDS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageWDS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_WDS_ENUM_BEGIN && msgID <= eQMI_WDS_SET_INDICATION) + || (msgID >= eQMI_WDS_START_NET && msgID <= eQMI_WDS_GET_DORMANCY) + || (msgID >= eQMI_WDS_GET_AUTOCONNECT && msgID <= eQMI_WDS_MODEM_INFO_IND) + || (msgID >= eQMI_WDS_GET_ACTIVE_MIP && msgID <= eQMI_WDS_SET_IP_FAMILY) + || (msgID >= eQMI_WDS_SET_AUTOCONNECT && msgID < eQMI_WDS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageDMS Enumeration +// QMI DMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageDMS +{ + eQMI_DMS_ENUM_BEGIN = -1, + + eQMI_DMS_RESET, // 00 Reset DMS service state variables + eQMI_DMS_SET_EVENT, // 01 Set connection state report conditions + eQMI_DMS_EVENT_IND = 1, // 01 Connection state report indication + + eQMI_DMS_GET_CAPS = 32, // 32 Get the device capabilities + eQMI_DMS_GET_MANUFACTURER, // 33 Get the device manfacturer + eQMI_DMS_GET_MODEL_ID, // 34 Get the device model ID + eQMI_DMS_GET_REV_ID, // 35 Get the device revision ID + eQMI_DMS_GET_NUMBER, // 36 Get the assigned voice number + eQMI_DMS_GET_IDS, // 37 Get the ESN/IMEI/MEID + eQMI_DMS_GET_POWER_STATE, // 38 Get the get power state + eQMI_DMS_UIM_SET_PIN_PROT, // 39 UIM - Set PIN protection + eQMI_DMS_UIM_PIN_VERIFY, // 40 UIM - Verify PIN + eQMI_DMS_UIM_PIN_UNBLOCK, // 41 UIM - Unblock PIN + eQMI_DMS_UIM_PIN_CHANGE, // 42 UIM - Change PIN + eQMI_DMS_UIM_GET_PIN_STATUS, // 43 UIM - Get PIN status + eQMI_DMS_GET_MSM_ID = 44, // 44 Get MSM ID + eQMI_DMS_GET_OPERATING_MODE, // 45 Get the operating mode + eQMI_DMS_SET_OPERATING_MODE, // 46 Set the operating mode + eQMI_DMS_GET_TIME, // 47 Get timestamp from the device + eQMI_DMS_GET_PRL_VERSION, // 48 Get the PRL version + eQMI_DMS_GET_ACTIVATED_STATE, // 49 Get the activation state + eQMI_DMS_ACTIVATE_AUTOMATIC, // 50 Perform an automatic activation + eQMI_DMS_ACTIVATE_MANUAL, // 51 Perform a manual activation + eQMI_DMS_GET_USER_LOCK_STATE, // 52 Get the lock state + eQMI_DMS_SET_USER_LOCK_STATE, // 53 Set the lock state + eQMI_DMS_SET_USER_LOCK_CODE, // 54 Set the lock PIN + eQMI_DMS_READ_USER_DATA, // 55 Read user data + eQMI_DMS_WRITE_USER_DATA, // 56 Write user data + eQMI_DMS_READ_ERI_FILE, // 57 Read the enhanced roaming indicator file + eQMI_DMS_FACTORY_DEFAULTS, // 58 Reset to factory defaults + eQMI_DMS_VALIDATE_SPC, // 59 Validate service programming code + eQMI_DMS_UIM_GET_ICCID, // 60 Get UIM ICCID + eQMI_DMS_GET_FIRWARE_ID, // 61 Get firmware ID + eQMI_DMS_SET_FIRMWARE_ID, // 62 Set firmware ID + eQMI_DMS_GET_HOST_LOCK_ID, // 63 Get host lock ID + eQMI_DMS_UIM_GET_CK_STATUS, // 64 UIM - Get control key status + eQMI_DMS_UIM_SET_CK_PROT, // 65 UIM - Set control key protection + eQMI_DMS_UIM_UNBLOCK_CK, // 66 UIM - Unblock facility control key + eQMI_DMS_GET_IMSI, // 67 Get the IMSI + eQMI_DMS_UIM_GET_STATE, // 68 UIM - Get the UIM state + eQMI_DMS_GET_BAND_CAPS, // 69 Get the device band capabilities + eQMI_DMS_GET_FACTORY_ID, // 70 Get the device factory ID + eQMI_DMS_GET_FIRMWARE_PREF, // 71 Get firmware preference + eQMI_DMS_SET_FIRMWARE_PREF, // 72 Set firmware preference + eQMI_DMS_LIST_FIRMWARE, // 73 List all stored firmware + eQMI_DMS_DELETE_FIRMWARE, // 74 Delete specified stored firmware + eQMI_DMS_SET_TIME, // 75 Set device time + eQMI_DMS_GET_FIRMWARE_INFO, // 76 Get stored firmware info + eQMI_DMS_GET_ALT_NET_CFG, // 77 Get alternate network config + eQMI_DMS_SET_ALT_NET_CFG, // 78 Set alternate network config + eQMI_DMS_GET_IMG_DLOAD_MODE, // 79 Get next image download mode + eQMI_DMS_SET_IMG_DLOAD_MODE, // 80 Set next image download mode + eQMI_DMS_GET_SW_VERSION, // 81 Get software version + eQMI_DMS_SET_SPC, // 82 Set SPC + + eQMI_DMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageDMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageDMS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_DMS_ENUM_BEGIN && msgID <= eQMI_DMS_EVENT_IND) + || (msgID >= eQMI_DMS_GET_CAPS && msgID < eQMI_DMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageNAS Enumeration +// QMI NAS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageNAS +{ + eQMI_NAS_ENUM_BEGIN = -1, + + eQMI_NAS_RESET, // 000 Reset NAS service state variables + eQMI_NAS_ABORT, // 001 Abort previously issued NAS command + eQMI_NAS_SET_EVENT, // 002 Set NAS state report conditions + eQMI_NAS_EVENT_IND = 2, // 002 Connection state report indication + eQMI_NAS_SET_REG_EVENT, // 003 Set NAS registration report conditions + + eQMI_NAS_GET_RSSI = 32, // 032 Get the signal strength + eQMI_NAS_SCAN_NETS, // 033 Scan for visible network + eQMI_NAS_REGISTER_NET, // 034 Initiate a network registration + eQMI_NAS_ATTACH_DETACH, // 035 Initiate an attach or detach action + eQMI_NAS_GET_SS_INFO, // 036 Get info about current serving system + eQMI_NAS_SS_INFO_IND = 36, // 036 Current serving system info indication + eQMI_NAS_GET_HOME_INFO, // 037 Get info about home network + eQMI_NAS_GET_NET_PREF_LIST, // 038 Get the list of preferred networks + eQMI_NAS_SET_NET_PREF_LIST, // 039 Set the list of preferred networks + eQMI_NAS_GET_NET_BAN_LIST, // 040 Get the list of forbidden networks + eQMI_NAS_SET_NET_BAN_LIST, // 041 Set the list of forbidden networks + eQMI_NAS_SET_TECH_PREF, // 042 Set the technology preference + eQMI_NAS_GET_TECH_PREF, // 043 Get the technology preference + eQMI_NAS_GET_ACCOLC, // 044 Get the Access Overload Class + eQMI_NAS_SET_ACCOLC, // 045 Set the Access Overload Class + eQMI_NAS_GET_SYSPREF, // 046 Get the CDMA system preference + eQMI_NAS_GET_NET_PARAMS, // 047 Get various network parameters + eQMI_NAS_SET_NET_PARAMS, // 048 Set various network parameters + eQMI_NAS_GET_RF_INFO, // 049 Get the SS radio/band channel info + eQMI_NAS_GET_AAA_AUTH_STATUS, // 050 Get AN-AAA authentication status + eQMI_NAS_SET_SYS_SELECT_PREF, // 051 Set system selection preference + eQMI_NAS_GET_SYS_SELECT_PREF, // 052 Get system selection preference + eQMI_NAS_SYS_SELECT_IND = 52, // 052 System selection pref indication + + eQMI_NAS_SET_DDTM_PREF = 55, // 055 Set DDTM preference + eQMI_NAS_GET_DDTM_PREF, // 056 Get DDTM preference + eQMI_NAS_DDTM_IND = 56, // 056 DDTM preference indication + eQMI_NAS_GET_OPERATER_NAME, // 057 Get operator name data + eQMI_NAS_OPERATER_NAME_IND, // 058 Operator name data indication + eQMI_NAS_GET_PLMN_MODE, // 059 Get PLMN mode bit from CSP + eQMI_NAS_PLMN_MODE_IND, // 060 CSP PLMN mode bit indication + eQMI_NAS_UPDATE_AKEY, // 061 Update the A-KEY + eQMI_NAS_GET_3GPP2_SUBS_INFO, // 062 Get 3GPP2 subscription info + eQMI_NAS_SET_3GPP2_SUBS_INFO, // 063 Set 3GPP2 subscription info + eQMI_NAS_MOB_CAI_REV, // 064 Get mobile CAI revision information + eQMI_NAS_GET_RTRE_CONFIG, // 065 Get RTRE configuration information + eQMI_NAS_SET_RTRE_CONFIG, // 066 Set RTRE configuration information + eQMI_NAS_GET_CELL_LOC_INFO, // 067 Get cell location information + eQMI_NAS_GET_PLMN_NAME, // 068 Get operator name for specified network + eQMI_NAS_BIND_SUBS, // 069 Bind client to a specific subscription + eQMI_NAS_MANAGED_ROAMING_IND, // 070 Managed roaming indication + eQMI_NAS_DSB_PREF_IND, // 071 Dual standby preference indication + eQMI_NAS_SUBS_INFO_IND, // 072 Subscription info indication + eQMI_NAS_GET_MODE_PREF, // 073 Get mode preference + + eQMI_NAS_SET_DSB_PREF = 75, // 075 Set dual standby preference + eQMI_NAS_NETWORK_TIME_IND, // 076 Network time indication + eQMI_NAS_GET_SYSTEM_INFO, // 077 Get system info + eQMI_NAS_SYSTEM_INFO_IND, // 078 System info indication + eQMI_NAS_GET_SIGNAL_INFO, // 079 Get signal info + eQMI_NAS_CFG_SIGNAL_INFO, // 080 Configure signal info report + eQMI_NAS_SIGNAL_INFO_IND, // 081 Signal info indication + eQMI_NAS_GET_ERROR_RATE, // 082 Get error rate info + eQMI_NAS_ERROR_RATE_IND, // 083 Error rate indication + eQMI_NAS_EVDO_SESSION_IND, // 084 CDMA 1xEV-DO session close indication + eQMI_NAS_EVDO_UATI_IND, // 085 CDMA 1xEV-DO UATI update indication + eQMI_NAS_GET_EVDO_SUBTYPE, // 086 Get CDMA 1xEV-DO protocol subtype + eQMI_NAS_GET_EVDO_COLOR_CODE, // 087 Get CDMA 1xEV-DO color code + eQMI_NAS_GET_ACQ_SYS_MODE, // 088 Get current acquisition system mode + eQMI_NAS_SET_RX_DIVERSITY, // 089 Set the RX diversity + eQMI_NAS_GET_RX_TX_INFO, // 090 Get detailed RX/TX information + eQMI_NAS_UPDATE_AKEY_EXT, // 091 Update the A-KEY (extended) + eQMI_NAS_GET_DSB_PREF, // 092 Get dual standby preference + + eQMI_NAS_DETACH_LTE, // 093 Detach the current LTE system + eQMI_NAS_BLOCK_LTE_PLMN, // 094 Block LTE PLMN + eQMI_NAS_UNBLOCK_LTE_PLMN, // 095 Unblock LTE PLMN + eQMI_NAS_RESET_LTE_PLMN_BLK, // 096 Reset LTE PLMN blocking + eQMI_NAS_CUR_PLMN_NAME_IND, // 097 Current PLMN name indication + eQMI_NAS_CONFIG_EMBMS, // 098 Configure eMBMS + eQMI_NAS_GET_EMBMS_STATUS, // 099 Get eMBMS status + eQMI_NAS_EMBMS_STATUS_IND, // 100 eMBMS status indication + eQMI_NAS_GET_CDMA_POS_INFO, // 101 Get CDMA position info + eQMI_NAS_RF_BAND_INFO_IND, // 102 RF band info indication + + eQMI_NAS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageNAS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageNAS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_NAS_ENUM_BEGIN && msgID <= eQMI_NAS_SET_REG_EVENT) + || (msgID >= eQMI_NAS_GET_RSSI && msgID <= eQMI_NAS_SYS_SELECT_IND) + || (msgID >= eQMI_NAS_SET_DDTM_PREF && msgID <= eQMI_NAS_GET_MODE_PREF) + || (msgID >= eQMI_NAS_SET_DSB_PREF && msgID < eQMI_NAS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageWMS Enumeration +// QMI WMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageWMS +{ + eQMI_WMS_ENUM_BEGIN = -1, + + eQMI_WMS_RESET, // 00 Reset WMS service state variables + eQMI_WMS_SET_EVENT, // 01 Set new message report conditions + eQMI_WMS_EVENT_IND = 1, // 01 New message report indication + + eQMI_WMS_RAW_SEND = 32, // 32 Send a raw message + eQMI_WMS_RAW_WRITE, // 33 Write a raw message to the device + eQMI_WMS_RAW_READ, // 34 Read a raw message from the device + eQMI_WMS_MODIFY_TAG, // 35 Modify message tag on the device + eQMI_WMS_DELETE, // 36 Delete message by index/tag/memory + + eQMI_WMS_GET_MSG_PROTOCOL = 48, // 48 Get the current message protocol + eQMI_WMS_GET_MSG_LIST, // 49 Get list of messages from the device + eQMI_WMS_SET_ROUTES, // 50 Set routes for message memory storage + eQMI_WMS_GET_ROUTES, // 51 Get routes for message memory storage + eQMI_WMS_GET_SMSC_ADDR, // 52 Get SMSC address + eQMI_WMS_SET_SMSC_ADDR, // 53 Set SMSC address + eQMI_WMS_GET_MSG_LIST_MAX, // 54 Get maximum size of SMS storage + eQMI_WMS_SEND_ACK, // 55 Send ACK + eQMI_WMS_SET_RETRY_PERIOD, // 56 Set retry period + eQMI_WMS_SET_RETRY_INTERVAL, // 57 Set retry interval + eQMI_WMS_SET_DC_DISCO_TIMER, // 58 Set DC auto-disconnect timer + eQMI_WMS_SET_MEMORY_STATUS, // 59 Set memory storage status + eQMI_WMS_SET_BC_ACTIVATION, // 60 Set broadcast activation + eQMI_WMS_SET_BC_CONFIG, // 61 Set broadcast config + eQMI_WMS_GET_BC_CONFIG, // 62 Get broadcast config + eQMI_WMS_MEMORY_FULL_IND, // 63 Memory full indication + eQMI_WMS_GET_DOMAIN_PREF, // 64 Get domain preference + eQMI_WMS_SET_DOMAIN_PREF, // 65 Set domain preference + eQMI_WMS_MEMORY_SEND, // 66 Send message from memory store + eQMI_WMS_GET_MSG_WAITING, // 67 Get message waiting info + eQMI_WMS_MSG_WAITING_IND, // 68 Message waiting indication + eQMI_WMS_SET_PRIMARY_CLIENT, // 69 Set client as primary client + eQMI_WMS_SMSC_ADDR_IND, // 70 SMSC address indication + eQMI_WMS_INDICATOR_REG, // 71 Register for indicators + eQMI_WMS_GET_TRANSPORT_INFO, // 72 Get transport layer info + eQMI_WMS_TRANSPORT_INFO_IND, // 73 Transport layer info indication + eQMI_WMS_GET_NW_REG_INFO, // 74 Get network registration info + eQMI_WMS_NW_REG_INFO_IND, // 75 Network registration info indication + eQMI_WMS_BIND_SUBSCRIPTION, // 76 Bind client to a subscription + eQMI_WMS_GET_INDICATOR_REG, // 77 Get indicator registration + eQMI_WMS_GET_SMS_PARAMETERS, // 78 Get SMS EF-SMSP parameters + eQMI_WMS_SET_SMS_PARAMETERS, // 79 Set SMS EF-SMSP parameters + eQMI_WMS_CALL_STATUS_IND, // 80 Call status indication + + eQMI_WMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageWMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageWMS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_WMS_ENUM_BEGIN && msgID <= eQMI_WMS_EVENT_IND) + || (msgID >= eQMI_WMS_RAW_SEND && msgID <= eQMI_WMS_DELETE) + || (msgID >= eQMI_WMS_GET_MSG_PROTOCOL && msgID < eQMI_WMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessagePDS Enumeration +// QMI PDS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessagePDS +{ + eQMI_PDS_ENUM_BEGIN = -1, + + eQMI_PDS_RESET, // 00 Reset PDS service state variables + eQMI_PDS_SET_EVENT, // 01 Set PDS report conditions + eQMI_PDS_EVENT_IND = 1, // 01 PDS report indication + + eQMI_PDS_GET_STATE = 32, // 32 Return PDS service state + eQMI_PDS_STATE_IND = 32, // 32 PDS service state indication + eQMI_PDS_SET_STATE, // 33 Set PDS service state + eQMI_PDS_START_SESSION, // 34 Start a PDS tracking session + eQMI_PDS_GET_SESSION_INFO, // 35 Get PDS tracking session info + eQMI_PDS_FIX_POSITION, // 36 Manual tracking session position + eQMI_PDS_END_SESSION, // 37 End a PDS tracking session + eQMI_PDS_GET_NMEA_CFG, // 38 Get NMEA sentence config + eQMI_PDS_SET_NMEA_CFG, // 39 Set NMEA sentence config + eQMI_PDS_INJECT_TIME, // 40 Inject a time reference + eQMI_PDS_GET_DEFAULTS, // 41 Get default tracking session config + eQMI_PDS_SET_DEFAULTS, // 42 Set default tracking session config + eQMI_PDS_GET_XTRA_PARAMS, // 43 Get the GPS XTRA parameters + eQMI_PDS_SET_XTRA_PARAMS, // 44 Set the GPS XTRA parameters + eQMI_PDS_FORCE_XTRA_DL, // 45 Force a GPS XTRA database download + eQMI_PDS_GET_AGPS_CONFIG, // 46 Get the AGPS mode configuration + eQMI_PDS_SET_AGPS_CONFIG, // 47 Set the AGPS mode configuration + eQMI_PDS_GET_SVC_AUTOTRACK, // 48 Get the service auto-tracking state + eQMI_PDS_SET_SVC_AUTOTRACK, // 49 Set the service auto-tracking state + eQMI_PDS_GET_COM_AUTOTRACK, // 50 Get COM port auto-tracking config + eQMI_PDS_SET_COM_AUTOTRACK, // 51 Set COM port auto-tracking config + eQMI_PDS_RESET_DATA, // 52 Reset PDS service data + eQMI_PDS_SINGLE_FIX, // 53 Request single position fix + eQMI_PDS_GET_VERSION, // 54 Get PDS service version + eQMI_PDS_INJECT_XTRA, // 55 Inject XTRA data + eQMI_PDS_INJECT_POSITION, // 56 Inject position data + eQMI_PDS_INJECT_WIFI, // 57 Inject Wi-Fi obtained data + eQMI_PDS_GET_SBAS_CONFIG, // 58 Get SBAS config + eQMI_PDS_SET_SBAS_CONFIG, // 59 Set SBAS config + eQMI_PDS_SEND_NI_RESPONSE, // 60 Send network initiated response + eQMI_PDS_INJECT_ABS_TIME, // 61 Inject absolute time + eQMI_PDS_INJECT_EFS, // 62 Inject EFS data + eQMI_PDS_GET_DPO_CONFIG, // 63 Get DPO config + eQMI_PDS_SET_DPO_CONFIG, // 64 Set DPO config + eQMI_PDS_GET_ODP_CONFIG, // 65 Get ODP config + eQMI_PDS_SET_ODP_CONFIG, // 66 Set ODP config + eQMI_PDS_CANCEL_SINGLE_FIX, // 67 Cancel single position fix + eQMI_PDS_GET_GPS_STATE, // 68 Get GPS state + eQMI_PDS_SET_PPM_EVT_REPORT, // 69 Set PPM event report + eQMI_PDS_SET_SPI_REPORT, // 70 Set SPI streaming reporting + eQMI_PDS_SET_SPI_RPT_IND = 70, // 70 Set SPI streaming indication + eQMI_PDS_SET_SPI_STATUS, // 71 Set SPI status + eQMI_PDS_SET_PPM_REPORT, // 72 Set PPM reporting state + eQMI_PDS_SET_PPM_RPT_IND = 72, // 72 Set PPM reporting state indication + eQMI_PDS_FORCE_RECEIVER_OFF, // 73 Force receiver off + + eQMI_PDS_GET_METHODS = 80, // 80 Get GPS position methods state + eQMI_PDS_SET_METHODS, // 81 Set GPS position methods state + eQMI_PDS_INJECT_SENSOR, // 82 Inject sensor data + eQMI_PDS_INJECT_TIME_SYNC, // 83 Inject time sync data + eQMI_PDS_GET_SENSOR_CFG, // 84 Get sensor config + eQMI_PDS_SET_SENSOR_CFG, // 85 Set sensor config + eQMI_PDS_GET_NAV_CFG, // 86 Get navigation config + eQMI_PDS_SET_NAV_CFG, // 87 Set navigation config + + eQMI_PDS_SET_WLAN_BLANK = 90, // 90 Set WLAN blanking + eQMI_PDS_SET_LBS_SC_RPT, // 91 Set LBS security challenge reporting + eQMI_PDS_LBS_SC_IND = 91, // 91 LBS security challenge indication + eQMI_PDS_SET_LBS_SC, // 92 Set LBS security challenge + eQMI_PDS_GET_LBS_ENCRYPT_CFG, // 93 Get LBS security encryption config + eQMI_PDS_SET_LBS_UPDATE_RATE, // 94 Set LBS security update rate + eQMI_PDS_SET_CELLDB_CONTROL, // 95 Set cell database control + eQMI_PDS_READY_IND, // 96 Ready indication + + eQMI_PDS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessagePDS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessagePDS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_PDS_ENUM_BEGIN && msgID <= eQMI_PDS_EVENT_IND) + || (msgID >= eQMI_PDS_GET_STATE && msgID <= eQMI_PDS_FORCE_RECEIVER_OFF) + || (msgID >= eQMI_PDS_GET_METHODS && msgID <= eQMI_PDS_SET_NAV_CFG) + || (msgID >= eQMI_PDS_SET_WLAN_BLANK && msgID < eQMI_PDS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageAUTH Enumeration +// QMI Authentication Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageAUTH +{ + eQMI_AUTH_ENUM_BEGIN = -1, + + eQMI_AUTH_START_EAP = 32, // 32 Start the EAP session + eQMI_AUTH_SEND_EAP, // 33 Send and receive EAP packets + eQMI_AUTH_EAP_RESULT_IND, // 34 EAP session result indication + eQMI_AUTH_GET_EAP_KEYS, // 35 Get the EAP session keys + eQMI_AUTH_END_EAP, // 36 End the EAP session + eQMI_AUTH_RUN_AKA, // 37 Runs the AKA algorithm + eQMI_AUTH_AKA_RESULT_IND, // 38 AKA algorithm result indication + + eQMI_AUTH_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageAUTH validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageAUTH msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_AUTH_START_EAP && msgID < eQMI_AUTH_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageAT Enumeration +// QMI AT Command Processor Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageAT +{ + eQMI_AT_ENUM_BEGIN = -1, + + eQMI_AT_RESET, // 00 Reset AT service state variables + + eQMI_AT_REG_COMMANDS = 32, // 32 Register AT commands to be forwarded + eQMI_AT_COMMAND_IND, // 33 AT command indication + eQMI_AT_SEND_RESPONSE, // 34 Send the response to an AT command + eQMI_AT_ABORT_IND, // 35 AT command abort indication + + eQMI_AT_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageAT validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageAT msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_AT_RESET) + || (msgID >= eQMI_AT_REG_COMMANDS && msgID < eQMI_AT_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + + +/*=========================================================================*/ +// eQMIMessageVoice Enumeration +// QMI Voice Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageVoice +{ + eQMI_VOICE_ENUM_BEGIN = -1, + + eQMI_VOICE_INDICATION_REG = 3, // 03 Set indication registration state + + eQMI_VOICE_CALL_ORIGINATE = 32, // 32 Originate a voice call + eQMI_VOICE_CALL_END, // 33 End a voice call + eQMI_VOICE_CALL_ANSWER, // 34 Answer incoming voice call + + eQMI_VOICE_GET_CALL_INFO = 36, // 36 Get call information + eQMI_VOICE_OTASP_STATUS_IND, // 37 OTASP/OTAPA event indication + eQMI_VOICE_INFO_REC_IND, // 38 New info record indication + eQMI_VOICE_SEND_FLASH, // 39 Send a simple flash + eQMI_VOICE_BURST_DTMF, // 40 Send a burst DTMF + eQMI_VOICE_START_CONT_DTMF, // 41 Starts a continuous DTMF + eQMI_VOICE_STOP_CONT_DTMF, // 42 Stops a continuous DTMF + eQMI_VOICE_DTMF_IND, // 43 DTMF event indication + eQMI_VOICE_SET_PRIVACY_PREF, // 44 Set privacy preference + eQMI_VOICE_PRIVACY_IND, // 45 Privacy change indication + eQMI_VOICE_ALL_STATUS_IND, // 46 Voice all call status indication + eQMI_VOICE_GET_ALL_STATUS, // 47 Get voice all call status + + eQMI_VOICE_MANAGE_CALLS = 49, // 49 Manage calls + eQMI_VOICE_SUPS_NOTIFICATION_IND, // 50 Supplementary service notifications + eQMI_VOICE_SET_SUPS_SERVICE, // 51 Manage supplementary service + eQMI_VOICE_GET_CALL_WAITING, // 52 Query sup service call waiting + eQMI_VOICE_GET_CALL_BARRING, // 53 Query sup service call barring + eQMI_VOICE_GET_CLIP, // 54 Query sup service CLIP + eQMI_VOICE_GET_CLIR, // 55 Query sup service CLIR + eQMI_VOICE_GET_CALL_FWDING, // 56 Query sup service call forwarding + eQMI_VOICE_SET_CALL_BARRING_PWD, // 57 Set call barring password + eQMI_VOICE_ORIG_USSD, // 58 Initiate USSD operation then wait + eQMI_VOICE_ANSWER_USSD, // 59 Answer USSD request + eQMI_VOICE_CANCEL_USSD, // 60 Cancel USSD operation + eQMI_VOICE_USSD_RELEASE_IND, // 61 USSD release indication + eQMI_VOICE_USSD_IND, // 62 USSD request/notification indication + eQMI_VOICE_UUS_IND, // 63 UUS information indication + eQMI_VOICE_SET_CONFIG, // 64 Set config + eQMI_VOICE_GET_CONFIG, // 65 Get config + eQMI_VOICE_SUPS_IND, // 66 Sup service request indication + eQMI_VOICE_ASYNC_ORIG_USSD, // 67 Initiate USSD operation + eQMI_VOICE_ASYNC_USSD_IND = 67, // 67 USSD request/notification indication + + eQMI_VOICE_BIND_SUBSCRIPTION, // 68 Bind subscription + eQMI_VOICE_ALS_SET_LINE_SW, // 69 ALS set line switching + eQMI_VOICE_ALS_SELECT_LINE, // 70 ALS select line + eQMI_VOICE_AOC_RESET_ACM, // 71 AOC reset ACM + eQMI_VOICE_AOC_SET_ACM_MAX, // 72 ACM set ACM maximum + eQMI_VOICE_AOC_GET_CM_INFO, // 73 AOC get call meter info + eQMI_VOICE_AOC_LOW_FUNDS_IND, // 74 AOC low funds indication + eQMI_VOICE_GET_COLP, // 75 Get COLP info + eQMI_VOICE_GET_COLR, // 76 Get COLR info + eQMI_VOICE_GET_CNAP, // 77 Get CNAP info + eQMI_VOICE_MANAGE_IP_CALLS, // 78 Manage VoIP calls + + eQMI_VOICE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageVoice validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageVoice msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_VOICE_INDICATION_REG) + || (msgID >= eQMI_VOICE_CALL_ORIGINATE && msgID <= eQMI_VOICE_CALL_ANSWER) + || (msgID >= eQMI_VOICE_GET_CALL_INFO && msgID <= eQMI_VOICE_GET_ALL_STATUS) + || (msgID >= eQMI_VOICE_MANAGE_CALLS && msgID < eQMI_VOICE_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageUIM Enumeration +// QMI UIM Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageUIM +{ + eQMI_UIM_ENUM_BEGIN = -1, + + eQMI_UIM_RESET, // 00 Reset + + eQMI_UIM_READ_TRANSPARENT = 32, // 32 Read data + eQMI_UIM_READ_TRANSPARENT_IND = 32, // 32 Read data indication + eQMI_UIM_READ_RECORD, // 33 Read one or more records + eQMI_UIM_READ_RECORD_IND = 33, // 33 Read records indication + eQMI_UIM_WRITE_TRANSPARENT, // 34 Write data + eQMI_UIM_WRITE_TRANSPARENT_IND = 34, // 34 Write data indication + eQMI_UIM_WRITE_RECORD, // 35 Write a record + eQMI_UIM_WRITE_RECORD_IND = 35, // 35 Write a record indication + eQMI_UIM_GET_FILE_ATTRIBUTES, // 36 Get file attributes + eQMI_UIM_GET_FILE_ATTRIBUTES_IND = 36, // 36 Get file attributes indication + eQMI_UIM_SET_PIN_PROTECTION, // 37 Set PIN protection + eQMI_UIM_SET_PIN_PROTECTION_IND = 37, // 37 Set PIN protection indication + eQMI_UIM_VERITFY_PIN, // 38 Verify PIN + eQMI_UIM_VERITFY_PIN_IND = 38, // 38 Verify PIN indication + eQMI_UIM_UNBLOCK_PIN, // 39 Unblock PIN + eQMI_UIM_UNBLOCK_PIN_IND = 39, // 39 Unblock PIN indication + eQMI_UIM_CHANGE_PIN, // 40 Change PIN + eQMI_UIM_CHANGE_PIN_IND = 40, // 40 Change PIN indication + eQMI_UIM_DEPERSONALIZATION, // 41 Depersonalization + eQMI_UIM_REFRESH_REGISTER, // 42 Refresh register + eQMI_UIM_REFRESH_OK, // 43 Validate refresh + eQMI_UIM_REFRESH_COMPLETE, // 44 Complete refresh + eQMI_UIM_GET_LAST_REFRESH_EVENT, // 45 Get last refresh event + eQMI_UIM_EVENT_REGISTRATION, // 46 Register for indications + eQMI_UIM_GET_CARD_STATUS, // 47 Get card status + eQMI_UIM_POWER_DOWN, // 48 Power down + eQMI_UIM_POWER_UP, // 49 Power up + eQMI_UIM_CARD_STATUS_IND, // 50 Card status indication + eQMI_UIM_REFRESH_IND, // 51 Refresh indication + eQMI_UIM_AUTHENTICATE, // 52 Authenticate + eQMI_UIM_AUTHENTICATE_IND = 52, // 52 Authenticate indication + eQMI_UIM_CLOSE_SESSION, // 53 Close session + eQMI_UIM_GET_SERVICE_STATUS, // 54 Get service status + eQMI_UIM_SET_SERVICE_STATUS, // 55 Set service status + eQMI_UIM_CHANGE_PROVISIONING, // 56 Change provisioning + eQMI_UIM_GET_LABEL, // 57 Get label + eQMI_UIM_GET_CONFIG, // 58 Get configuration + eQMI_UIM_SEND_ADPU, // 59 Send ADPU + eQMI_UIM_SAP_CONNECTION, // 60 SAP connection + eQMI_UIM_SAP_REQUEST, // 61 SAP request + eQMI_UIM_SAP_CONNECTION_IND, // 62 SAP connection indication + eQMI_UIM_LOGICAL_CHANNEL, // 63 Logical channel + eQMI_UIM_SUBSCRIPTION_OK, // 64 OK to publish subscription? + eQMI_UIM_GET_ATR, // 65 Get ATR + + eQMI_UIM_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageUIM validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageUIM msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_UIM_RESET) + || (msgID >= eQMI_UIM_READ_TRANSPARENT && msgID < eQMI_UIM_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessagePBM Enumeration +// QMI PBM Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessagePBM +{ + eQMI_PBM_ENUM_BEGIN = -1, + + eQMI_PBM_INDICATION_REG = 1, // 01 Set indication registration state + eQMI_PBM_GET_CAPABILITIES, // 02 Get phonebook capabilities by type + eQMI_PBM_GET_ALL_CAPABILITIES, // 03 Get all phonebook capabilities + eQMI_PBM_READ_RECORDS, // 04 Read phonebook records + eQMI_PBM_READ_RECORD_IND = 4, // 04 Read phonebook record indication + eQMI_PBM_WRITE_RECORD, // 05 Add/modify a phonebook record + eQMI_PBM_DELETE_RECORD, // 06 Delete a phonebook record + eQMI_PBM_DELETE_ALL_RECORDS, // 07 Delete all phonebook records + eQMI_PBM_SEARCH_RECORDS, // 08 Search phonebook records + eQMI_PBM_RECORD_UPDATE_IND, // 09 Phonebook record update indication + eQMI_PBM_REFRESH_IND, // 10 Phonebook refresh indication + eQMI_PBM_READY_IND, // 11 Phonebook ready indication + eQMI_PBM_EMERGENCY_LIST_IND, // 12 Phonebook emergency list indication + eQMI_PBM_ALL_READY_IND, // 13 All phonebooks ready indication + eQMI_PBM_GET_EMERGENCY_LIST, // 14 Get phonebook emergency list + eQMI_PBM_GET_ALL_GROUPS, // 15 Get all phonebook groups + eQMI_PBM_SET_GROUP_INFO, // 16 Set phonebook group info + eQMI_PBM_GET_STATE, // 17 Get phonebook state + eQMI_PBM_READ_ALL_HIDDEN_RECS, // 18 Read all hidden phonebook records + eQMI_PBM_HIDDEN_REC_STATUS_IND, // 19 Hidden record status indication + eQMI_PBM_GET_NEXT_EMPTY_REC_ID, // 20 Get next empty record ID + eQMI_PBM_GET_NEXT_REC_ID, // 21 Get next non-empty record ID + eQMI_PBM_GET_AAS_LIST, // 22 Get AAS list + eQMI_PBM_SET_AAS, // 23 Add/modify/delete AAS entry + eQMI_PBM_UPDATE_AAS_IND, // 24 AAS change indication + eQMI_PBM_UPDATE_GAS_IND, // 25 GAS change indication + eQMI_PBM_BIND_SUBSCRIPTION, // 26 Bind client to specific subscription + + eQMI_PBM_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessagePBM validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessagePBM msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_PBM_INDICATION_REG && msgID < eQMI_PBM_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageLOC Enumeration +// QMI LOC Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageLOC +{ + eQMI_LOC_ENUM_BEGIN = -1, + + eQMI_LOC_CLIENT_REVISION = 32, // 32 Send client revision to service + eQMI_LOC_REGISTER_EVENTS, // 33 Register for events/indications + eQMI_LOC_START, // 34 Start GPS session + eQMI_LOC_STOP, // 35 Start GPS session + eQMI_LOC_POSITION_REPORT_IND, // 36 Position report indication + eQMI_LOC_GNSS_SAT_INFO_IND, // 37 GNSS satellite info indication + eQMI_LOC_NMEA_IND, // 38 NMEA sentence indication + eQMI_LOC_NETWORK_REQ_IND, // 39 Network initiated request indication + eQMI_LOC_INJECT_TIME_REQ_IND, // 40 Inject time request indication + eQMI_LOC_INJECT_ORBITS_REQ_IND, // 41 Inject predicted orbits req ind + eQMI_LOC_INJECT_POS_REQ_IND, // 42 Inject position request indication + eQMI_LOC_ENGINE_STATE_IND, // 43 Engine state indication + eQMI_LOC_FIX_SESSION_STATE_IND, // 44 Fi session state indication + eQMI_LOC_WIFI_REQ_IND, // 45 Wi-Fi request indication + eQMI_LOC_SENSOR_DATA_IND, // 46 Sensor streaming ready status ind + eQMI_LOC_INJECT_TIME_SYNC_IND, // 47 Inject time sync data indication + eQMI_LOC_SPI_STREAM_REQ_IND, // 48 SPI streaming reports req indication + eQMI_LOC_SVR_CONNECTION_REQ_IND, // 49 Server connection req indication + eQMI_LOC_GET_REV_REQ, // 50 Get service revision + eQMI_LOC_GET_REV_REQ_IND = 50, // 50 Get service revision indication + eQMI_LOC_GET_FIX_CRIT, // 51 Get fix criteria + eQMI_LOC_GET_FIX_CRIT_IND = 51, // 51 Get fix criteria indication + eQMI_LOC_NI_USER_RSP, // 52 Network initiated user response + eQMI_LOC_NI_USER_RSP_IND = 52, // 52 Network initiated user response ind + eQMI_LOC_INJECT_ORBITS, // 53 Inject predicted orbits data + eQMI_LOC_INJECT_ORBITS_IND = 53, // 53 Inject predicted orbits indication + eQMI_LOC_GET_ORBIT_SRC, // 54 Get predicted orbits data source + eQMI_LOC_GET_ORBIT_SRC_IND = 54, // 54 Get predicted orbits data source ind + eQMI_LOC_GET_ORBIT_VLD, // 55 Get predicted orbits data validity + eQMI_LOC_GET_ORBIT_VLD_IND = 55, // 55 Get predicted orbits validity ind + eQMI_LOC_INJECT_UTC, // 56 Inject UTC time + eQMI_LOC_INJECT_UTC_IND = 56, // 56 Inject UTC time indication + eQMI_LOC_INJECT_POS, // 57 Inject position + eQMI_LOC_INJECT_POS_IND = 57, // 57 Inject position indication + eQMI_LOC_SET_ENG_LOCK, // 58 Set engine lock + eQMI_LOC_SET_ENG_LOCK_IND = 58, // 58 Set engine lock indication + eQMI_LOC_GET_ENG_LOCK, // 59 Get engine lock + eQMI_LOC_GET_ENG_LOCK_IND = 59, // 59 Get engine lock indication + eQMI_LOC_SET_SBAS_CFG, // 60 Set SBAS config + eQMI_LOC_SET_SBAS_CFG_IND = 60, // 60 Set SBAS config indication + eQMI_LOC_GET_SBAS_CFG, // 61 Get SBAS config + eQMI_LOC_GET_SBAS_CFG_IND = 61, // 61 Get SBAS config indication + eQMI_LOC_SET_NMEA_TYPS, // 62 Set NMEA sentence types + eQMI_LOC_SET_NMEA_TYPS_IND = 62, // 62 Set NMEA sentence types indication + eQMI_LOC_GET_NMEA_TYPS, // 63 Get NMEA sentence types + eQMI_LOC_GET_NMEA_TYPS_IND = 63, // 63 Get NMEA sentence types indication + eQMI_LOC_SET_LPM_CFG, // 64 Set low power mode config + eQMI_LOC_SET_LPM_CFG_IND = 64, // 64 Set low power mode config indication + eQMI_LOC_GET_LPM_CFG, // 65 Get low power mode config + eQMI_LOC_GET_LPM_CFG_IND = 65, // 65 Get low power mode config indication + eQMI_LOC_SET_SERVER, // 66 Set A-GPS server + eQMI_LOC_SET_SERVER_IND = 66, // 66 Set A-GPS server indication + eQMI_LOC_GET_SERVER, // 67 Set A-GPS server + eQMI_LOC_GET_SERVER_IND = 67, // 67 Set A-GPS server indication + eQMI_LOC_DEL_ASST_DATA, // 68 Delete assistance data + eQMI_LOC_DEL_ASST_DATA_IND = 68, // 68 Delete assistance data indication + eQMI_LOC_SET_XTRA_T, // 69 Set XTRA_T session control + eQMI_LOC_SET_XTRA_T_IND = 69, // 69 Set XTRA_T session control indication + eQMI_LOC_GET_XTRA_T, // 70 Get XTRA_T session control + eQMI_LOC_GET_XTRA_T_IND = 70, // 70 Get XTRA_T session control indication + eQMI_LOC_INJECT_WIFI, // 71 Inject Wi-Fi info + eQMI_LOC_INJECT_WIFI_IND = 71, // 71 Inject Wi-Fi info indication + eQMI_LOC_NOTIFY_WIFI, // 72 Notify server of Wi-Fi status + eQMI_LOC_NOTIFY_WIFI_IND = 72, // 72 Notify server of Wi-Fi status ind + eQMI_LOC_GET_REG_EVENTS, // 73 Get registered event status + eQMI_LOC_GET_REG_EVENTS_IND = 73,// 73 Get registered event status ind + eQMI_LOC_SET_OP_MODE, // 74 Set operation mode + eQMI_LOC_SET_OP_MODE_IND = 74, // 74 Set operation mode indication + eQMI_LOC_GET_OP_MODE, // 75 Get operation mode + eQMI_LOC_GET_OP_MODE_IND = 75, // 75 Get operation mode indication + eQMI_LOC_SET_SPI_STATUS, // 76 Set SPI status + eQMI_LOC_SET_SPI_STATUS_IND = 76,// 76 Set SPI status indication + eQMI_LOC_INJECT_SENSOR, // 77 Inject sensor data + eQMI_LOC_INJECT_SENSOR_IND = 77, // 77 Inject sensor data indication + eQMI_LOC_INJ_TIME_SYNC, // 78 Inject time sync data + eQMI_LOC_INJ_TIME_SYNC_IND = 78, // 78 Inject time sync data indication + eQMI_LOC_SET_CRADLE, // 79 Set cradle mount config + eQMI_LOC_SET_CRADLE_IND = 79, // 79 Set cradle mount config indication + eQMI_LOC_GET_CRADLE, // 80 Get cradle mount config + eQMI_LOC_GET_CRADLE_IND = 80, // 80 Get cradle mount config indication + eQMI_LOC_SET_EXT_POWER, // 81 Set external power config + eQMI_LOC_SET_EXT_POWER_IND = 81, // 81 Set external power config indication + eQMI_LOC_GET_EXT_POWER, // 82 Get external power config + eQMI_LOC_GET_EXT_POWER_IND = 82, // 82 Get external power config indication + eQMI_LOC_INFORM_CONN, // 83 Inform service of connection status + eQMI_LOC_INFORM_CONN_IND = 83, // 83 Inform connection status indication + eQMI_LOC_SET_PROTO_CFG, // 84 Set protocol config + eQMI_LOC_SET_PROTO_CFG_IND = 84, // 84 Set protocol config indication + eQMI_LOC_GET_PROTO_CFG, // 85 Get protocol config + eQMI_LOC_GET_PROTO_CFG_IND = 85, // 85 Get protocol config indication + eQMI_LOC_SET_SENSOR_CFG, // 86 Set sensor control config + eQMI_LOC_SET_SENSOR_CFG_IND = 86,// 86 Set sensor control config indication + eQMI_LOC_GET_SENSOR_CFG, // 87 Get sensor control config + eQMI_LOC_GET_SENSOR_CFG_IND = 87,// 87 Get sensor control config indication + eQMI_LOC_SET_SENSOR_PRP, // 88 Set sensor properties + eQMI_LOC_SET_SENSOR_PRP_IND = 88,// 88 Set sensor properties indication + eQMI_LOC_GET_SENSOR_PRP, // 89 Get sensor properties + eQMI_LOC_GET_SENSOR_PRP_IND = 89,// 89 Get sensor properties indication + eQMI_LOC_SET_SENSOR_PRF, // 90 Set sensor performance control + eQMI_LOC_SET_SENSOR_PRF_IND = 90,// 90 Set sensor performance control ind + eQMI_LOC_GET_SENSOR_PRF, // 91 Get sensor performance control + eQMI_LOC_GET_SENSOR_PRF_IND = 91,// 91 Get sensor performance control ind + eQMI_LOC_INJ_SUPL_CERT, // 92 Inject SUPL certificate + eQMI_LOC_INJ_SUPL_CERT_IND = 92, // 92 Inject SUPL certificate indication + eQMI_LOC_DEL_SUPL_CERT, // 93 Delete SUPL certificate + eQMI_LOC_DEL_SUPL_CERT_IND = 93, // 93 Delete SUPL certificate indication + eQMI_LOC_SET_ENGINE_CFG, // 94 Set position engine config + eQMI_LOC_SET_ENGINE_CFG_IND = 94,// 94 Set position engine config ind + eQMI_LOC_GET_ENGINE_CFG, // 95 Get position engine config + eQMI_LOC_GET_ENGINE_CFG_IND = 95,// 95 Get position engine config ind + + eQMI_LOC_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageLOC validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageLOC msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_LOC_CLIENT_REVISION && msgID < eQMI_LOC_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageSAR Enumeration +// QMI SAR Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageSAR +{ + eQMI_SAR_ENUM_BEGIN = -1, + + eQMI_SAR_SET_RF_SAR_STATE = 1, // 01 Set the RF SAR state + eQMI_SAR_GET_RF_SAR_STATE, // 02 Get the RF SAR state + + eQMI_SAR_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageSAR validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageSAR msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_SAR_SET_RF_SAR_STATE && msgID < eQMI_SAR_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageRMTFS Enumeration +// QMI Remote Filesystem Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageRMTFS +{ + eQMI_RMTFS_ENUM_BEGIN = -1, + + eQMI_RMTFS_OPEN = 1, // 01 Request an open + eQMI_RMTFS_CLOSE, // 02 Request a close + eQMI_RMTFS_IO_VECTOR, // 03 Request an I/O vector operation + eQMI_RMTFS_ALLOC_BUFFER, // 04 Allocate a buffer + eQMI_RMTFS_GET_DEV_ERROR, // 05 Return device error for last request + eQMI_RMTFS_FORCE_SYNC_IND, // 06 Force sync indication + + eQMI_RMTFS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageRMTFS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageRMTFS msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_RMTFS_OPEN && msgID < eQMI_RMTFS_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageCAT Enumeration +// QMI CAT Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageCAT +{ + eQMI_CAT_ENUM_BEGIN = -1, + + eQMI_CAT_RESET, // 00 Reset CAT service state variables + eQMI_CAT_SET_EVENT, // 01 Set new message report conditions + eQMI_CAT_EVENT_IND = 1, // 01 New message report indication + + eQMI_CAT_GET_STATE = 32, // 32 Get service state information + eQMI_CAT_SEND_TERMINAL, // 33 Send a terminal response + eQMI_CAT_SEND_ENVELOPE, // 34 Send an envelope command + eQMI_CAT_GET_EVENT, // 35 Get last message report + eQMI_CAT_SEND_DECODED_TERMINAL, // 36 Send a decoded terminal response + eQMI_CAT_SEND_DECODED_ENVELOPE, // 37 Send a decoded envelope command + eQMI_CAT_EVENT_CONFIRMATION, // 38 Event confirmation + eQMI_CAT_SCWS_OPEN_CHANNEL, // 39 Open a channel to a SCWS + eQMI_CAT_SCWS_OPEN_IND = 39, // 39 SCWS open channel indication + eQMI_CAT_SCWS_CLOSE_CHANNEL, // 40 Close a channel to a SCWS + eQMI_CAT_SCWS_CLOSE_IND = 40, // 40 SCWS close channel indication + eQMI_CAT_SCWS_SEND_DATA, // 41 Send data to a SCWS + eQMI_CAT_SCWS_SEND_IND = 41, // 41 SCWS send data indication + eQMI_CAT_SCWS_DATA_AVAILABLE, // 42 Indicate that data is available + eQMI_CAT_SCWS_CHANNEL_STATUS, // 43 Provide channel status + + eQMI_CAT_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageCAT validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageCAT msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_CAT_ENUM_BEGIN && msgID <= eQMI_CAT_EVENT_IND) + || (msgID >= eQMI_CAT_GET_STATE && msgID < eQMI_CAT_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageRMS Enumeration +// QMI RMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageRMS +{ + eQMI_RMS_ENUM_BEGIN = -1, + + eQMI_RMS_RESET, // 00 Reset RMS service state variables + + eQMI_RMS_GET_SMS_WAKE = 32, // 32 Get SMS wake settings + eQMI_RMS_SET_SMS_WAKE, // 33 Set SMS wake settings + + eQMI_RMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageRMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageRMS msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_RMS_RESET) + || (msgID >= eQMI_RMS_GET_SMS_WAKE && msgID < eQMI_RMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageOMA Enumeration +// QMI OMA-DM Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageOMA +{ + eQMI_OMA_ENUM_BEGIN = -1, + + eQMI_OMA_RESET, // 00 Reset OMA service state variables + eQMI_OMA_SET_EVENT, // 01 Set OMA report conditions + eQMI_OMA_EVENT_IND = 1, // 01 OMA report indication + + eQMI_OMA_START_SESSION = 32, // 32 Start client inititated session + eQMI_OMA_CANCEL_SESSION, // 33 Cancel session + eQMI_OMA_GET_SESSION_INFO, // 34 Get session information + eQMI_OMA_SEND_SELECTION, // 35 Send selection for net inititated msg + eQMI_OMA_GET_FEATURES, // 36 Get feature settings + eQMI_OMA_SET_FEATURES, // 37 Set feature settings + + eQMI_OMA_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageOMA validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageOMA msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_OMA_ENUM_BEGIN && msgID <= eQMI_OMA_EVENT_IND) + || (msgID >= eQMI_OMA_START_SESSION && msgID < eQMI_OMA_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIResultCode Enumeration +// QMI Result Code Enumeration +/*=========================================================================*/ +enum eQMIResultCode +{ + eQMI_RC_ENUM_BEGIN = -1, + + eQMI_RC_SUCCESS, // 00 Success + eQMI_RC_ERROR, // 01 Error + + eQMI_RC_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIResultCode validity check + +PARAMETERS: + rc [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIResultCode rc ) +{ + bool retVal = false; + if (rc > eQMI_RC_ENUM_BEGIN && rc < eQMI_RC_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIErrorCode Enumeration +// QMI Error Code Enumeration +/*=========================================================================*/ +enum eQMIErrorCode +{ + eQMI_ERR_ENUM_BEGIN = -1, + + eQMI_ERR_NONE, // 00 + eQMI_ERR_MALFORMED_MSG, // 01 + eQMI_ERR_NO_MEMORY, // 02 + eQMI_ERR_INTERNAL, // 03 + eQMI_ERR_ABORTED, // 04 + eQMI_ERR_CLIENT_IDS_EXHAUSTED, // 05 + eQMI_ERR_UNABORTABLE_TRANSACTION, // 06 + eQMI_ERR_INVALID_CLIENT_ID, // 07 + eQMI_ERR_NO_THRESHOLDS, // 08 + eQMI_ERR_INVALID_HANDLE, // 09 + eQMI_ERR_INVALID_PROFILE, // 10 + eQMI_ERR_INVALID_PIN_ID, // 11 + eQMI_ERR_INCORRECT_PIN, // 12 + eQMI_ERR_NO_NETWORK_FOUND, // 13 + eQMI_ERR_CALL_FAILED, // 14 + eQMI_ERR_OUT_OF_CALL, // 15 + eQMI_ERR_NOT_PROVISIONED, // 16 + eQMI_ERR_MISSING_ARG, // 17 + eQMI_ERR_18, // 18 + eQMI_ERR_ARG_TOO_LONG, // 19 + eQMI_ERR_20, // 20 + eQMI_ERR_21, // 21 + eQMI_ERR_INVALID_TX_ID, // 22 + eQMI_ERR_DEVICE_IN_USE, // 23 + eQMI_ERR_OP_NETWORK_UNSUPPORTED, // 24 + eQMI_ERR_OP_DEVICE_UNSUPPORTED, // 25 + eQMI_ERR_NO_EFFECT, // 26 + eQMI_ERR_NO_FREE_PROFILE, // 27 + eQMI_ERR_INVALID_PDP_TYPE, // 28 + eQMI_ERR_INVALID_TECH_PREF, // 29 + eQMI_ERR_INVALID_PROFILE_TYPE, // 30 + eQMI_ERR_INVALID_SERVICE_TYPE, // 31 + eQMI_ERR_INVALID_REGISTER_ACTION, // 32 + eQMI_ERR_INVALID_PS_ATTACH_ACTION, // 33 + eQMI_ERR_AUTHENTICATION_FAILED, // 34 + eQMI_ERR_PIN_BLOCKED, // 35 + eQMI_ERR_PIN_ALWAYS_BLOCKED, // 36 + eQMI_ERR_UIM_UNINITIALIZED, // 37 + eQMI_ERR_MAX_QOS_REQUESTS_IN_USE, // 38 + eQMI_ERR_INCORRECT_FLOW_FILTER, // 39 + eQMI_ERR_NETWORK_QOS_UNAWARE, // 40 + eQMI_ERR_INVALID_QOS_ID, // 41 + eQMI_ERR_REQUESTED_NUM_UNSUPPORTED, // 42 + eQMI_ERR_INTERFACE_NOT_FOUND, // 43 + eQMI_ERR_FLOW_SUSPENDED, // 44 + eQMI_ERR_INVALID_DATA_FORMAT, // 45 + eQMI_ERR_GENERAL, // 46 + eQMI_ERR_UNKNOWN, // 47 + eQMI_ERR_INVALID_ARG, // 48 + eQMI_ERR_INVALID_INDEX, // 49 + eQMI_ERR_NO_ENTRY, // 50 + eQMI_ERR_DEVICE_STORAGE_FULL, // 51 + eQMI_ERR_DEVICE_NOT_READY, // 52 + eQMI_ERR_NETWORK_NOT_READY, // 53 + eQMI_ERR_WMS_CAUSE_CODE, // 54 + eQMI_ERR_WMS_MESSAGE_NOT_SENT, // 55 + eQMI_ERR_WMS_MESSAGE_DELIVERY_FAILURE, // 56 + eQMI_ERR_WMS_INVALID_MESSAGE_ID, // 57 + eQMI_ERR_WMS_ENCODING, // 58 + eQMI_ERR_AUTHENTICATION_LOCK, // 59 + eQMI_ERR_INVALID_TRANSITION, // 60 + eQMI_ERR_61, // 61 + eQMI_ERR_62, // 62 + eQMI_ERR_63, // 63 + eQMI_ERR_64, // 64 + eQMI_ERR_SESSION_INACTIVE, // 65 + eQMI_ERR_SESSION_INVALID, // 66 + eQMI_ERR_SESSION_OWNERSHIP, // 67 + eQMI_ERR_INSUFFICIENT_RESOURCES, // 68 + eQMI_ERR_DISABLED, // 69 + eQMI_ERR_INVALID_OPERATION, // 70 + eQMI_ERR_INVALID_QMI_CMD, // 71 + eQMI_ERR_WMS_TPDU_TYPE, // 72 + eQMI_ERR_WMS_SMSC_ADDR, // 73 + eQMI_ERR_INFO_UNAVAILABLE, // 74 + eQMI_ERR_SEGMENT_TOO_LONG, // 75 + eQMI_ERR_SEGMENT_ORDER, // 76 + eQMI_ERR_BUNDLING_NOT_SUPPORTED, // 77 + eQMI_ERR_78, // 78 + eQMI_ERR_POLICY_MISMATCH, // 79 + eQMI_ERR_SIM_FILE_NOT_FOUND, // 80 + eQMI_ERR_EXTENDED_EXTERNAL, // 81 + eQMI_ERR_ACCESS_DENIED, // 82 + eQMI_ERR_HARDWARE_RESTRICTED, // 83 + eQMI_ERR_ACK_NOT_SENT, // 84 + + eQMI_ERR_INCOMPATIBLE_STATE = 90, // 90 + eQMI_ERR_FDN_RESTRICT, // 91 + eQMI_ERR_SUPS_FAILURE_CAUSE, // 92 + eQMI_ERR_NO_RADIO, // 93 + eQMI_ERR_NOT_SUPPORTED, // 94 + + eQMI_ERR_CARD_CALL_CONTROL_FAILED = 96, // 96 + eQMI_ERR_NETWORK_ABORTED, // 97 + + eQMI_ERR_CAT_EVT_REG_FAILED, // 61441 + eQMI_ERR_CAT_INVALID_TR, // 61442 + eQMI_ERR_CAT_INVALID_ENV_CMD, // 61443 + eQMI_ERR_CAT_ENV_CMD_BUSY, // 61444 + eQMI_ERR_CAT_ENV_CMD_FAIL, // 61445 + + eQMI_ERR_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIErrorCode validity check + +PARAMETERS: + ec [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIErrorCode ec ) +{ + bool retVal = false; + if ( (ec > eQMI_ERR_ENUM_BEGIN && ec <= eQMI_ERR_ACK_NOT_SENT) + || (ec >= eQMI_ERR_INCOMPATIBLE_STATE && ec <= eQMI_ERR_NOT_SUPPORTED) + || (ec == eQMI_ERR_CARD_CALL_CONTROL_FAILED) + || (ec == eQMI_ERR_NETWORK_ABORTED) + || (ec >= eQMI_ERR_CAT_EVT_REG_FAILED && ec < eQMI_ERR_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMICallEndReason Enumeration +// QMI Call End Reason Enumeration +/*=========================================================================*/ +enum eQMICallEndReason +{ + eQMI_CALL_END_REASON_BEGIN = -1, + + // General + eQMI_CALL_END_REASON_UNSPECIFIED = 1, // 1 + eQMI_CALL_END_REASON_CLIENT_END, // 2 + eQMI_CALL_END_REASON_NO_SRV, // 3 + eQMI_CALL_END_REASON_FADE, // 4 + eQMI_CALL_END_REASON_REL_NORMAL, // 5 + eQMI_CALL_END_REASON_ACC_IN_PROG, // 6 + eQMI_CALL_END_REASON_ACC_FAIL, // 7 + eQMI_CALL_END_REASON_REDIR_OR_HANDOFF, // 8 + eQMI_CALL_END_REASON_CLOSE_IN_PROGRESS, // 9 + eQMI_CALL_END_REASON_AUTH_FAILED, // 10 + eQMI_CALL_END_REASON_INTERNAL, // 11 + + // CDMA + eQMI_CALL_END_REASON_CDMA_LOCK = 500, // 500 + eQMI_CALL_END_REASON_INTERCEPT, // 501 + eQMI_CALL_END_REASON_REORDER, // 502 + eQMI_CALL_END_REASON_REL_SO_REJ, // 503 + eQMI_CALL_END_REASON_INCOM_CALL, // 504 + eQMI_CALL_END_REASON_ALERT_STOP, // 505 + eQMI_CALL_END_REASON_ACTIVATION, // 506 + eQMI_CALL_END_REASON_MAX_ACCESS_PROBE, // 507 + eQMI_CALL_END_REASON_CCS_NOT_SUPPORTED_BY_BS, // 508 + eQMI_CALL_END_REASON_NO_RESPONSE_FROM_BS, // 509 + eQMI_CALL_END_REASON_REJECTED_BY_BS, // 510 + eQMI_CALL_END_REASON_INCOMPATIBLE, // 511 + eQMI_CALL_END_REASON_ALREADY_IN_TC, // 512 + eQMI_CALL_END_REASON_USER_CALL_ORIG_DURING_GPS, // 513 + eQMI_CALL_END_REASON_USER_CALL_ORIG_DURING_SMS, // 514 + eQMI_CALL_END_REASON_NO_CDMA_SRV, // 515 + + // GSM/WCDMA + eQMI_CALL_END_REASON_CONF_FAILED = 1000, // 1000 + eQMI_CALL_END_REASON_INCOM_REJ, // 1001 + eQMI_CALL_END_REASON_NO_GW_SRV, // 1002 + eQMI_CALL_END_REASON_NETWORK_END, // 1003 + eQMI_CALL_END_REASON_LLC_SNDCP_FAILURE, // 1004 + eQMI_CALL_END_REASON_INSUFFICIENT_RESOURCES, // 1005 + eQMI_CALL_END_REASON_OPTION_TEMP_OOO, // 1006 + eQMI_CALL_END_REASON_NSAPI_ALREADY_USED, // 1007 + eQMI_CALL_END_REASON_REGULAR_DEACTIVATION, // 1008 + eQMI_CALL_END_REASON_NETWORK_FAILURE, // 1009 + eQMI_CALL_END_REASON_UMTS_REATTACH_REQ, // 1010 + eQMI_CALL_END_REASON_UMTS_PROTOCOL_ERROR, // 1011 + eQMI_CALL_END_REASON_OPERATOR_BARRING, // 1012 + eQMI_CALL_END_REASON_UNKNOWN_APN, // 1013 + eQMI_CALL_END_REASON_UNKNOWN_PDP, // 1014 + eQMI_CALL_END_REASON_GGSN_REJECT, // 1015 + eQMI_CALL_END_REASON_ACTIVATION_REJECT, // 1016 + eQMI_CALL_END_REASON_OPTION_NOT_SUPPORTED, // 1017 + eQMI_CALL_END_REASON_OPTION_UNSUBSCRIBED, // 1018 + eQMI_CALL_END_REASON_QOS_NOT_ACCEPTED, // 1019 + eQMI_CALL_END_REASON_TFT_SEMANTIC_ERROR, // 1020 + eQMI_CALL_END_REASON_TFT_SYNTAX_ERROR, // 1021 + eQMI_CALL_END_REASON_UNKNOWN_PDP_CONTEXT, // 1022 + eQMI_CALL_END_REASON_FILTER_SEMANTIC_ERROR, // 1023 + eQMI_CALL_END_REASON_FILTER_SYNTAX_ERROR, // 1024 + eQMI_CALL_END_REASON_PDP_WITHOUT_ACTIVE_TFT, // 1025 + eQMI_CALL_END_REASON_INVALID_TRANSACTION_ID, // 1026 + eQMI_CALL_END_REASON_MESSAGE_SEMANTIC_ERROR, // 1027 + eQMI_CALL_END_REASON_INVALID_MANDATORY_INFO, // 1028 + eQMI_CALL_END_REASON_TYPE_UNSUPPORTED, // 1029 + eQMI_CALL_END_REASON_MSG_TYPE_WRONG_FOR_STATE, // 1030 + eQMI_CALL_END_REASON_UNKNOWN_INFO_ELEMENT, // 1031 + eQMI_CALL_END_REASON_CONDITIONAL_IE_ERROR, // 1032 + eQMI_CALL_END_REASON_MSG_WRONG_FOR_PROTOCOL, // 1033 + eQMI_CALL_END_REASON_APN_TYPE_CONFLICT, // 1034 + eQMI_CALL_END_REASON_NO_GPRS_CONTEXT, // 1035 + eQMI_CALL_END_REASON_FEATURE_NOT_SUPPORTED, // 1036 + + // CDMA 1xEV-DO (HDR) + eQMI_CALL_END_REASON_CD_GEN_OR_BUSY = 1500, // 1500 + eQMI_CALL_END_REASON_CD_BILL_OR_AUTH, // 1501 + eQMI_CALL_END_REASON_CHG_HDR, // 1502 + eQMI_CALL_END_REASON_EXIT_HDR, // 1503 + eQMI_CALL_END_REASON_HDR_NO_SESSION , // 1504 + eQMI_CALL_END_REASON_HDR_ORIG_DURING_GPS_FIX, // 1505 + eQMI_CALL_END_REASON_HDR_CS_TIMEOUT , // 1506 + eQMI_CALL_END_REASON_HDR_RELEASED_BY_CM, // 1507 + + eQMI_CALL_END_REASON_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMICallEndReason validity check + +PARAMETERS: + err [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMICallEndReason err ) +{ + if ( (err >= eQMI_CALL_END_REASON_UNSPECIFIED) + && (err <= eQMI_CALL_END_REASON_INTERNAL) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CDMA_LOCK) + && (err <= eQMI_CALL_END_REASON_NO_CDMA_SRV) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CONF_FAILED) + && (err <= eQMI_CALL_END_REASON_FEATURE_NOT_SUPPORTED) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CD_GEN_OR_BUSY) + && (err <= eQMI_CALL_END_REASON_HDR_RELEASED_BY_CM) ) + { + return true; + } + + return false; +}; + diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/QMIProtocolServer.cpp b/gobi-api/Gobi_2012-06-18-1054/Core/QMIProtocolServer.cpp new file mode 100755 index 0000000..479151e --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/QMIProtocolServer.cpp @@ -0,0 +1,415 @@ +/*=========================================================================== +FILE: + QMIProtocolServer.h + +DESCRIPTION: + QMI protocol server + +PUBLIC CLASSES AND METHODS: + cQMIProtocolServer + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QMIProtocolServer.h" +#include "QMIBuffers.h" +#include "Comm.h" +#include "Socket.h" + +/*=========================================================================*/ +// cQMIProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cQMIProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + serviceType [ I ] - QMI service type requested + bufferSzRx [ I ] - Size of data buffer for incoming data + logSz [ I ] - Size of log (number of buffers) + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQMIProtocolServer::cQMIProtocolServer( + eQMIService serviceType, + ULONG bufferSzRx, + ULONG logSz ) + : cProtocolServer( MapQMIServiceToProtocol( serviceType, false ), + MapQMIServiceToProtocol( serviceType, true ), + bufferSzRx, + logSz ), + mLastTID( (WORD)INVALID_QMI_TRANSACTION_ID ), + mService( serviceType ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cQMIProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQMIProtocolServer::~cQMIProtocolServer() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the configured QMI service using the given QMI + control file + +PARAMETERS: + pControlFile [ I ] - QMI control file + +SEQUENCING: + This method is sequenced according to the command event, i.e. any + other thread that needs to send a command to the protocol server + thread will block until this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::Connect( LPCSTR pControlFile ) +{ + // Assume failure + bool bRC = false; + if (IsValid( mService ) == false || mService == eQMI_SVC_CONTROL) + { + return bRC; + } + + std::string name = pControlFile; + if (name.find( "qcqmi" ) != std::string::npos) + { + mpConnection = new cComm(); + mConnectionType = eConnectionType_RmNet; + } + else + { + // SMD + mpConnection = new cSocket(); + mConnectionType = eConnectionType_SMD; + } + + // Pass service file to base class for actual connection + bRC = cProtocolServer::Connect( pControlFile ); + + if (bRC == false) + { + TRACE( "QMI connect %d failed\n", mService ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateRequest (Internal Method) + +DESCRIPTION: + Validate a request that is about to be scheduled + +SEQUENCING: + This method is sequenced according to the command event, i.e. any + other thread that needs to send a command to the protocol server + thread will block until this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::ValidateRequest( const sProtocolRequest & req ) +{ + if (cProtocolServer::ValidateRequest( req ) == false) + { + return false; + } + + sQMIServiceBuffer qmiReq( req.GetSharedBuffer() ); + return qmiReq.IsValid(); +} + +/*=========================================================================== +METHOD: + InitializeComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port initialization + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::InitializeComm() +{ + bool bResult = false; + if (mpConnection == 0) + { + return bResult; + } + + if (mConnectionType == eConnectionType_RmNet) + { + // Setup the QMI Service type + int result = mpConnection->SendCtl( QMI_GET_SERVICE_FILE_IOCTL, + (void*)(unsigned long)mService ); + bResult = (result == 0); + } + else if (mConnectionType == eConnectionType_SMD) + { + // Setup the QMI Service type + int result = mpConnection->SendCtl( eQMUXD_MSG_ALLOC_QMI_CLIENT_ID, + (void*)&mService ); + bResult = (result == 0); + } + + return bResult; +} + +/*=========================================================================== +METHOD: + CleanupComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port cleanup + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::CleanupComm() +{ + bool bResult = true; + + if (mpConnection != 0 + && mConnectionType == eConnectionType_SMD) + { + // Delete the QMI client + + // NOTE: This is generally unnecessary, when you close the channel + // it is deleted + int result = mpConnection->SendCtl( eQMUXD_MSG_RELEASE_QMI_CLIENT_ID, + 0 ); + bResult = (result == 0); + } + + // Nothing to actually do here + return true; +} + +/*=========================================================================== +METHOD: + DecodeRxData (Internal Method) + +DESCRIPTION: + Decode incoming data into QMI indications/responses + +PARAMETERS: + bytesReceived [ I ] - Number of bytes to decoded + rspIdx [ O ] - Log index of last valid response (not used) + bAbortTx [ O ] - Response aborts current transmission? (not used) + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool - Was a response received? +===========================================================================*/ +bool cQMIProtocolServer::DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ) +{ + // Assume failure + bool bRC = false; + + rspIdx = INVALID_LOG_INDEX; + bAbortTx = false; + + // Something to decode from? + if (bytesReceived == 0) + { + return bRC; + } + + // Set protocol type (we have to be dealing with a valid QMI service) + eProtocolType pt = MapQMIServiceToProtocol( mService, false ); + if (pt == ePROTOCOL_ENUM_BEGIN) + { + return bRC; + } + + sSharedBuffer * pTmp = 0; + pTmp = new sSharedBuffer( mpRxBuffer, bytesReceived, pt ); + if (pTmp != 0) + { + sQMIServiceBuffer tmpBuf( pTmp ); + if (tmpBuf.IsValid() == true) + { + rspIdx = mLog.AddBuffer( tmpBuf ); + if (IsResponse( tmpBuf ) == true) + { + bRC = true; + } + else + { + rspIdx = INVALID_LOG_INDEX; + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + EncodeTxData (Internal Method) + +DESCRIPTION: + Encode data for transmission + +PARAMETERS: + pBuffer [ I ] - Data to be encoded + bEncoded [ O ] - Do we even encode data? + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + sSharedBuffer * - Encoded data (0 upon error when encoding is indicated) +===========================================================================*/ +sSharedBuffer * cQMIProtocolServer::EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) +{ + WORD tid = ++mLastTID; + if (tid == (WORD)INVALID_QMI_TRANSACTION_ID) + { + tid++; + } + + sQMIServiceBuffer tmpBuf( pBuffer ); + tmpBuf.SetTransactionID( tid ); + + // No actual encoding required as we alter the original request + bEncoded = false; + return 0; +}; + +/*=========================================================================== +METHOD: + IsResponse (Internal Method) + +DESCRIPTION: + Is the passed in data a response to the current request? + +PARAMETERS: + rsp [ I ] - Candidate response + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::IsResponse( const sProtocolBuffer & rsp ) +{ + // Assume not + bool bRC = false; + if ( (mpActiveRequest == 0) + || (mpActiveRequest->mRequest.IsValid() == false) + || (mpActiveRequest->mbWaitingForResponse == false) + || (rsp.IsValid() == false) ) + { + return bRC; + } + + sQMIServiceBuffer qmiReq( mpActiveRequest->mRequest.GetSharedBuffer() ); + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + + if (qmiReq.IsValid() == false || qmiRsp.IsValid() == false) + { + return bRC; + } + + if (qmiRsp.IsResponse() == false) + { + return bRC; + } + + WORD reqID = qmiReq.GetTransactionID(); + WORD rspID = qmiRsp.GetTransactionID(); + + if ( (reqID == (WORD)INVALID_QMI_TRANSACTION_ID) + || (rspID == (WORD)INVALID_QMI_TRANSACTION_ID) + || (reqID != rspID) ) + { + return bRC; + } + + // Sadly there are documentated cases of firmware returning responses + // with a matching transaction ID but a mismatching message ID. There + // is no reason for this to be considered valid behavior as of yet + ULONG reqMsgID = qmiReq.GetMessageID(); + ULONG rspMsgID = qmiRsp.GetMessageID(); + + if (reqMsgID != rspMsgID) + { + return bRC; + } + + bRC = true; + return bRC; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/QMIProtocolServer.h b/gobi-api/Gobi_2012-06-18-1054/Core/QMIProtocolServer.h new file mode 100755 index 0000000..7dba8d8 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/QMIProtocolServer.h @@ -0,0 +1,116 @@ +/*=========================================================================== +FILE: + QMIProtocolServer.h + +DESCRIPTION: + QMI protocol server + +PUBLIC CLASSES AND METHODS: + cQMIProtocolServer + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolServer.h" +#include "QMIEnum.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cQMIProtocolServer +/*=========================================================================*/ +class cQMIProtocolServer : public cProtocolServer +{ + public: + // Constructor + cQMIProtocolServer( + eQMIService serviceType, + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cQMIProtocolServer(); + + // Connect to the given QMI service using the configured QMI + // control file + bool Connect( LPCSTR pControlFile ); + + // (Inline) Return the QMI service type + eQMIService GetServiceType() + { + return mService; + }; + + protected: + // Validate a request that is about to be scheduled + virtual bool ValidateRequest( const sProtocolRequest & req ); + + // Perform protocol specific communications port initialization + virtual bool InitializeComm(); + + // Perform protocol specific communications port cleanup + virtual bool CleanupComm(); + + // Decode incoming data into packets returning the last response + virtual bool DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ); + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ); + + // Is the passed in data a response to the current request? + virtual bool IsResponse( const sProtocolBuffer & rsp ); + + // (Inline) Is the passed in data a response that aborts the + // current request? + virtual bool IsTxAbortResponse( const sProtocolBuffer & /* rsp */ ) + { + // QMI doesn't necessarily require this + return false; + }; + + /* Current transaction ID */ + SHORT mLastTID; + + /* Type of QMI service we are serving */ + eQMIService mService; +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/SharedBuffer.cpp b/gobi-api/Gobi_2012-06-18-1054/Core/SharedBuffer.cpp new file mode 100755 index 0000000..6f0566d --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/SharedBuffer.cpp @@ -0,0 +1,375 @@ +/*=========================================================================== +FILE: + SharedBuffer.cpp + +DESCRIPTION: + Shareable protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + + sSharedBuffer + Simple struct to represent a reference counted shareable (no copy) + buffer, as the basis for all buffer related classes + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "SharedBuffer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Synchronization object +struct sSharedBufferSync +{ + public: + // Constructor + sSharedBufferSync() + : mbInitialized( false ) + { + int nRet = pthread_mutex_init( &mSyncSection, NULL ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to init sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + mbInitialized = true; + }; + + // Destructor + ~sSharedBufferSync() + { + mbInitialized = false; + int nRet = pthread_mutex_destroy( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to destroy sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + } + + }; + + // Lock sync object + void Lock() + { + if (mbInitialized == true) + { + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to lock sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + } + }; + + // Unlock sync object + void Unlock() + { + if (mbInitialized == true) + { + int nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to unlock sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + } + }; + + protected: + /* DIAG buffer critical section */ + pthread_mutex_t mSyncSection; + + /* Has this object been initialized? */ + bool mbInitialized; +}; + +// Global (across all shared buffers) reference count guard +sSharedBufferSync gRefCount; + +/*=========================================================================*/ +// sSharedBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sSharedBuffer (Public Method) + +DESCRIPTION: + Constructor (copy passed in buffer) + +PARAMETERS: + pDataToCopy [ I ] - The data buffer to copy (should be non-zero) + dataLen [ I ] - The length of the above buffer (should be > 1) + dataType [ I ] - Type of data (not used internal to class) + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::sSharedBuffer( + const BYTE * pDataToCopy, + ULONG dataLen, + ULONG dataType ) + : mpData( 0 ), + mSize( 0 ), + mType( dataType ), + mRefCount( 0 ) +{ + // Length not too small/not too big? + if (IsValidSize( dataLen ) == true) + { + // Yes, data actually exists? + if (pDataToCopy != 0) + { + // Yes, try to allocate memory + mpData = new BYTE[dataLen]; + if (mpData != 0) + { + // Now copy into our allocation + memcpy( (PVOID)mpData, + (LPCVOID)pDataToCopy, + (SIZE_T)dataLen ); + + // Now set the size, we do this last so that our double + // deletion logic is only applied if we had an allocation + // in the first place + mSize = dataLen; + } + } + } +} + +/*=========================================================================== +METHOD: + sSharedBuffer (Public Method) + +DESCRIPTION: + Constructor (assume ownership of passed in buffer) + +PARAMETERS: + dataLen [ I ] - The length of the above buffer (should be > 1) + pDataToOwn [ I ] - The data buffer to assume ownership of (should + be non-zero) + + dataType [ I ] - Type of data (not used internal to class) + + NOTE: The order is intentionally reversed from the previous constructor + to avoid any cases of mistaken identity (copy versus assume ownership) + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::sSharedBuffer( + ULONG dataLen, + PBYTE pDataToOwn, + ULONG dataType ) + : mpData( 0 ), + mSize( 0 ), + mType( dataType ), + mRefCount( 0 ) +{ + // Data actually exists? + if (pDataToOwn != 0) + { + // Yes, length not too small/not too big? + if (IsValidSize( dataLen ) == true) + { + // Yes, assume ownership of the passed in buffer + mpData = pDataToOwn; + mSize = dataLen; + } + else + { + // This data buffer is not acceptable to us, but we have assumed + // ownership of the memory which we will now free + delete [] pDataToOwn; + } + } +} + +/*=========================================================================== +METHOD: + ~sSharedBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::~sSharedBuffer() +{ + ASSERT( mRefCount == 0 ); + + // Buffer data to free? + if (mpData != 0) + { + // Yes, zero first byte for caution and then delete it + mpData[0] = 0; + delete [] mpData; + + // Even more caution, zero out pointer + mpData = 0; + } + else if (mSize != 0) + { + ASSERT( (PVOID)("Double deletion detected in ~sSharedBuffer") == 0 ); + } +} + +/*=========================================================================== +METHOD: + operator == (Public Method) + +DESCRIPTION: + Equality operator + +RETURN VALUE: + bool +===========================================================================*/ +bool sSharedBuffer::operator == ( const sSharedBuffer & refBuf ) const +{ + // Assume they are not equal + bool bEq = false; + + // The buffers must be the same + if (mpData == refBuf.mpData) + { + if (mSize == refBuf.mSize) + { + if (mRefCount == refBuf.mRefCount) + { + if (mType == refBuf.mType) + { + // The shared buffers are the same + bEq = true; + } + } + else + { + // Very odd - the buffers are the same, but not the ref count?!? + ASSERT( 0 ); + } + } + else + { + // Very odd - the buffers are the same, but not the size?!? + ASSERT( 0 ); + } + } + + return bEq; +} + +/*=========================================================================== +METHOD: + operator != (Public Method) + +DESCRIPTION: + Inequality operator + +RETURN VALUE: + bool +===========================================================================*/ +bool sSharedBuffer::operator != ( const sSharedBuffer & refBuf ) const +{ + if (*this == refBuf) + { + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + AddRef (Internal Method) + +DESCRIPTION: + Increment reference count + +RETURN VALUE: + None +===========================================================================*/ +void sSharedBuffer::AddRef() +{ + gRefCount.Lock(); + mRefCount++; + gRefCount.Unlock(); +} + +/*=========================================================================== +METHOD: + Release (Internal Method) + +DESCRIPTION: + Release reference, delete if reference count zero + +RETURN VALUE: + None +===========================================================================*/ +void sSharedBuffer::Release() +{ + gRefCount.Lock(); + + ASSERT( mRefCount != 0 ); + + // Decrement reference count + if (mRefCount > 0) + { + mRefCount--; + } + + // ... and delete if reference count now 0 + if (mRefCount == 0) + { + delete this; + } + + gRefCount.Unlock(); +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/SharedBuffer.h b/gobi-api/Gobi_2012-06-18-1054/Core/SharedBuffer.h new file mode 100755 index 0000000..c4201e0 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/SharedBuffer.h @@ -0,0 +1,166 @@ +/*=========================================================================== +FILE: + SharedBuffer.h + +DESCRIPTION: + Shareable buffer structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sSharedBuffer + Simple struct to represent a reference counted shareable (no copy) + buffer, as the basis for all buffer related classes + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +struct sProtocolBuffer; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum size of a shared buffer +const ULONG MAX_SHARED_BUFFER_SIZE = 1024 * 16 + 256; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sSharedBuffer +// +// Simple struct to represent a reference counted shareable (no copy) +// buffer, as the basis for all buffer related classes +// +// NOTE: Do *NOT* create instances of this structure on the stack, it +// must be dynamically allocated in order to function correctly +/*=========================================================================*/ +struct sSharedBuffer +{ + public: + // Constructor (copy passed in buffer) + sSharedBuffer( + const BYTE * pDataToCopy, + ULONG dataLen, + ULONG dataType ); + + // Constructor (assume ownership of passed in buffer) + sSharedBuffer( + ULONG dataLen, + PBYTE pDataToOwn, + ULONG dataType ); + + // Destructor + virtual ~sSharedBuffer(); + + // Equality operator + bool operator == ( const sSharedBuffer & ) const; + + // Inequality operator + bool operator != ( const sSharedBuffer & ) const; + + // (Inline) Get buffer + const BYTE * GetBuffer() const + { + return mpData; + }; + + // (Inline) Get buffer size + ULONG GetSize() const + { + return mSize; + }; + + // (Inline) Get buffer type + ULONG GetType() const + { + return mType; + }; + + // (Inline) Is this buffer valid? + bool IsValid() const + { + return (mpData != 0 && IsValidSize( mSize )); + }; + + // (Inline) Get reference count + ULONG GetRefCount() const + { + return mRefCount; + }; + + // (Static Inline) Is the passed in size within the allowable range + // a shared buffer? + static bool IsValidSize( ULONG sz ) + { + return (sz > 0 && sz <= MAX_SHARED_BUFFER_SIZE); + }; + + protected: + // Add reference + void AddRef(); + + // Release reference, delete if reference count zero + void Release(); + + /* Data */ + PBYTE mpData; + + /* Size of data */ + ULONG mSize; + + /* Type of data */ + ULONG mType; + + /* Reference count */ + ULONG mRefCount; + + private: + // Leave copy constructor and assignment operator unimplemented + // to prevent unintentional and unauthorized copying of the object + // (which would lead to bad reference counting) + sSharedBuffer( const sSharedBuffer & ); + sSharedBuffer & operator = ( const sSharedBuffer & ); + + friend struct sProtocolBuffer; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/Socket.cpp b/gobi-api/Gobi_2012-06-18-1054/Core/Socket.cpp new file mode 100755 index 0000000..874b123 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/Socket.cpp @@ -0,0 +1,807 @@ +/*=========================================================================== +FILE: + Socket.cpp + +DESCRIPTION: + Implementation of cSocket class + +PUBLIC CLASSES AND METHODS: + cSocket + This class wraps low level communication to qmuxd + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "Socket.h" +#include "ProtocolServer.h" +#include +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +// Thread commands +#define START_READ_CMD 0 +#define STOP_READ_CMD 1 +#define EXIT_CMD 2 + +// Size of the QMUXD command payload +// GET_CLIENT_ID and RELEASE_CLIENT_ID must pass in a buffer of this size +#define PAYLOAD_SIZE 664 + +/*=========================================================================*/ +// struct sQMUXDHeader +/*=========================================================================*/ +#pragma pack( push, 1 ) + +struct sQMUXDHeader +{ + /* Total size of header and following buffer */ + int mTotalSize; + + /* QMUXD client ID */ + int mQMUXDClientID; + + /* Message type */ + eQMUXDMessageTypes mQMUXDMsgID; + + /* Duplicate of mQMUXDClientID */ + int mQMUXDClientIDDuplicate; + + /* Transaction ID */ + unsigned long mTxID; + + /* System error code */ + int mSysErrCode; + + /* QMI error code (duplicate of TLV 0x02) */ + int mQmiErrCode; + + /* SMD channel. 0 = SMD_DATA_5 */ + int mQMUXDConectionType; + + /* QMI service ID */ + int mQMUXServiceID; + + /* QMI client ID */ + unsigned char mQMUXClientID; + + /* QMI flags */ + unsigned char mRxFlags; + + /* In QMUXD this struct is not packed, so the compiler appends + these two bytes */ + unsigned short int mMissing2Bytes; +}; + +#pragma pack( pop ) + + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + RxSocketThread (Free Method) + +DESCRIPTION: + Thread for simulating asynchronous reads to a socket + +PARAMETERS: + pData [ I ] cSocket pointer + +RETURN VALUE: + void * - thread exit value (always 0) +===========================================================================*/ +void * RxSocketThread( void * pData ) +{ + cSocket * pSocket = (cSocket*)pData; + if (pSocket == NULL || pSocket->IsValid() == false) + { + return 0; + } + + fd_set inputSet, outputSet; + FD_ZERO( &inputSet ); + FD_SET( pSocket->mCommandPipe[READING], &inputSet ); + int largestFD = pSocket->mCommandPipe[READING]; + + int status = 0; + while (true) + { + // No FD_COPY() available + memcpy( &outputSet, &inputSet, sizeof( fd_set ) ); + + // Wait until we recieve a command or data is available + status = select( largestFD + 1, &outputSet, NULL, NULL, NULL ); + if (status <= 0) + { + TRACE( "error %d in select, errno %d\n", status, errno ); + break; + } + + if (FD_ISSET( pSocket->mCommandPipe[READING], &outputSet ) == true) + { + // Read command value from the pipe + BYTE cmd; + status = read( pSocket->mCommandPipe[READING], &cmd, 1 ); + if (status != 1) + { + TRACE( "cmd error %d\n", status ); + break; + } + + if (cmd == START_READ_CMD) + { + FD_SET( pSocket->mSocket, &inputSet ); + largestFD = std::max( pSocket->mSocket, + pSocket->mCommandPipe[READING] ); + } + else if (cmd == STOP_READ_CMD) + { + FD_CLR( pSocket->mSocket, &inputSet ); + largestFD = pSocket->mCommandPipe[READING]; + } + else + { + // EXIT_CMD or anything else + break; + } + } + else if (FD_ISSET( pSocket->mSocket, &outputSet ) == true) + { + // Stop watching for read data + FD_CLR( pSocket->mSocket, &inputSet ); + largestFD = pSocket->mCommandPipe[READING]; + + // Perform a recv for the header + sQMUXDHeader recvHdr; + status = recv( pSocket->mSocket, + &recvHdr, + sizeof( recvHdr ), + 0 ); + if (status != sizeof( recvHdr )) + { + TRACE( "recv error, bad size %d\n", status ); + break; + } + + // Calculate and read the remaining data + int remainder = recvHdr.mTotalSize - sizeof( recvHdr ); + if (remainder > pSocket->mBuffSz) + { + TRACE( "read too large for buffer\n" ); + break; + } + + status = recv( pSocket->mSocket, + pSocket->mpBuffer, + remainder, + 0 ); + + // Is this one of our IOCTLS or a standard message? + if (recvHdr.mQMUXDMsgID == eQMUXD_MSG_WRITE_QMI_SDU) + { + cIOCallback * pCallback = pSocket->mpRxCallback; + pSocket->mpRxCallback = 0; + + if (pCallback == (cIOCallback *)1) + { + // We wanted to read, but not to be notified + } + else if (status >= 0) + { + pCallback->IOComplete( 0, status ); + } + else + { + pCallback->IOComplete( status, 0 ); + } + } + else + { + pSocket->mpRxCallback = 0; + // Notify SendCtl() that control message completed + + if (recvHdr.mQMUXDMsgID == eQMUXD_MSG_ALLOC_QMI_CLIENT_ID) + { + DWORD clientID; + memcpy( &clientID, &pSocket->mpBuffer[0], 4 ); + + pSocket->mCtrlMsgComplete.Set( clientID ); + } + else + { + // Just set the event + pSocket->mCtrlMsgComplete.Set( 0 ); + } + } + } + } + + return 0; +}; + +/*=========================================================================*/ +// cSocket Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cSocket (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cSocket::cSocket() + : mSocket( INVALID_HANDLE_VALUE ), + mbCancelWrite( false ), + mpBuffer( 0 ), + mBuffSz( 0 ), + mRxThreadID( 0 ), + mCtrlMsgComplete(), + mQMUXDClientID( 0 ), + mQMUXClientID( 0 ), + mQMUXServiceID( 0 ), + mChannelID( -1 ), + mQMUXDTxID( 0 ) +{ + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; +} + +/*=========================================================================== +METHOD: + ~cSocket (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cSocket::~cSocket() +{ + // Disconnect from current port + Disconnect(); + + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + Bool +===========================================================================*/ +bool cSocket::IsValid() +{ + // Nothing to do + return true; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified port + +PARAMETERS: + pChannel [ I ] - Channel number (IE: "0" = SMD_DATA_5 ) + +RETURN VALUE: + bool +===========================================================================*/ +bool cSocket::Connect( LPCSTR pChannel ) +{ + if (IsValid() == false || pChannel == 0 || pChannel[0] == 0) + { + return false; + } + + if (mSocket != INVALID_HANDLE_VALUE) + { + Disconnect(); + } + + // Initialize command pipe for read thread + int nRet = pipe( mCommandPipe ); + if (nRet != 0) + { + TRACE( "cSocket:Connect() pipe creation failed %d\n", nRet ); + return false; + } + + // Start the read thread + nRet = pthread_create( &mRxThreadID, + 0, + RxSocketThread, + this ); + if (nRet != 0) + { + TRACE( "cSocket::Connect() pthread_create = %d\n", nRet ); + + Disconnect(); + return false; + } + + // Create a socket + mSocket = socket( AF_UNIX, SOCK_STREAM, 0 ); + if (mSocket == INVALID_HANDLE_VALUE) + { + TRACE( "unable to create socket %d\n", errno ); + + Disconnect(); + return false; + } + + struct sockaddr_un clientSockAddr; + memset( &clientSockAddr, 0, sizeof( clientSockAddr ) ); + clientSockAddr.sun_family = AF_UNIX; + + // Format the client path + snprintf( &clientSockAddr.sun_path[0], + sizeof( clientSockAddr.sun_path ), + "/var/qmux_client_socket%7lu", + (unsigned long)getpid() ); + + // Delete if it exists already + unlink( clientSockAddr.sun_path ); + + // Bind to a client address + nRet = bind( mSocket, + (struct sockaddr *)&clientSockAddr, + sizeof( sockaddr_un ) ); + if (nRet == -1) + { + TRACE( "bad bind %d\n", errno ); + + Disconnect(); + return false; + } + + // Format the connection path + struct sockaddr_un connectSockAddr; + memset( &connectSockAddr, 0, sizeof( connectSockAddr ) ); + connectSockAddr.sun_family = AF_UNIX; + + snprintf( &connectSockAddr.sun_path[0], + sizeof( connectSockAddr.sun_path ), + "/var/qmux_connect_socket" ); + + // Connect to server address + nRet = connect( mSocket, + (struct sockaddr *)&connectSockAddr, + sizeof( sockaddr_un ) ); + if (nRet < 0) + { + TRACE( "bad connect %d\n", errno ); + + Disconnect(); + return false; + } + + int clientID; + nRet = recv( mSocket, &clientID, sizeof( clientID ), 0 ); + if (nRet != sizeof( clientID )) + { + printf( "bad client ID %d\n", errno ); + + Disconnect(); + return false; + } + + // Save QMUXD Client ID + mQMUXDClientID = clientID; + + // Save SMD channel + mChannelID = strtol( pChannel, 0, 10 ); + if (mChannelID == -1) + { + Disconnect(); + return false; + } + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + SendCtl (Public Method) + +DESCRIPTION: + Send a control message to the lower layer + +PARAMETERS: + msgType [ I ] - eQMUXDMessageType + pData [I/O] - input or output specific to ioctl request value + +RETURN VALUE: + int - control message return value (0 for success) +===========================================================================*/ +int cSocket::SendCtl( + UINT msgType, + void * pData ) +{ + if (mSocket == INVALID_HANDLE_VALUE) + { + TRACE( "Invalid file handle\n" ); + return -EBADFD; + } + + BYTE msg[sizeof( sQMUXDHeader ) + PAYLOAD_SIZE]; + memset( &msg[0], 0, sizeof( msg ) ); + + // The important QMUXD header values + sQMUXDHeader * pHdr = (sQMUXDHeader *)&msg[0]; + pHdr->mTotalSize = sizeof( msg ); + pHdr->mQMUXDClientID = mQMUXDClientID; + pHdr->mQMUXDMsgID = (eQMUXDMessageTypes)msgType; + pHdr->mQMUXDClientIDDuplicate = mQMUXDClientID; + + // mQMUXDTxID could go to INT_MAX, but rather than dealing with possible + // overflow in qmuxd or one of the lower layers, we'll stop early + mQMUXDTxID++; + if (mQMUXDTxID > 100000) + { + mQMUXDTxID = 1; + } + pHdr->mTxID = ++mQMUXDTxID; + + // The Payload + BYTE * pPayload = &msg[sizeof( sQMUXDHeader )]; + if (msgType == (int)eQMUXD_MSG_ALLOC_QMI_CLIENT_ID) + { + memcpy( &mQMUXServiceID, pData, 4 ); + memcpy( &pPayload[0], &mQMUXServiceID, 4 ); + } + else if (msgType == (int)eQMUXD_MSG_RELEASE_QMI_CLIENT_ID) + { + memcpy( &pPayload[0], &mQMUXServiceID, 4 ); + memcpy( &pPayload[4], &mQMUXClientID, 4 ); + } + + // Send the message + int rc = send( mSocket, &msg[0], sizeof( msg ), 0 ); + if (rc != sizeof( msg )) + { + TRACE( "bad write %d\n", rc ); + return rc; + } + + if (mpRxCallback == 0) + { + // No one is currently reading, need to trigger a read + // so our data can be recieved + RxData( &msg[0], sizeof( msg ), 0 ); + } + + // Wait for the response (10s timeout) + DWORD val; + rc = mCtrlMsgComplete.Wait( 10000, val ); + if (rc != 0) + { + TRACE( "bad SendCtl() wait %d\n", rc ); + return rc; + } + + if (msgType == (int)eQMUXD_MSG_ALLOC_QMI_CLIENT_ID) + { + // Grab the client ID + mQMUXClientID = val; + } + + return 0; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the current port + +RETURN VALUE: + bool +===========================================================================*/ +bool cSocket::Disconnect() +{ + // Assume success + bool bRC = true; + + if (mCommandPipe[WRITING] != INVALID_HANDLE_VALUE) + { + if (mRxThreadID != 0) + { + // Notify the thread to exit + BYTE byte = EXIT_CMD; + write( mCommandPipe[WRITING], &byte, 1 ); + + // And wait for it + int nRC = pthread_join( mRxThreadID, 0 ); + if (nRC != 0) + { + TRACE( "failed to join thread %d\n", nRC ); + bRC = false; + } + + mRxThreadID = 0; + } + + close( mCommandPipe[WRITING] ); + close( mCommandPipe[READING] ); + mCommandPipe[READING] = INVALID_HANDLE_VALUE; + mCommandPipe[WRITING] = INVALID_HANDLE_VALUE; + } + + if (mSocket != INVALID_HANDLE_VALUE) + { + close( mSocket ); + mSocket = INVALID_HANDLE_VALUE; + } + + mCtrlMsgComplete.Clear(); + mQMUXDClientID = 0; + mQMUXClientID = 0; + mQMUXServiceID = 0; + mQMUXDTxID = 0; + return bRC; +} + +/*=========================================================================== +METHOD: + CancelIO (Public Method) + +DESCRIPTION: + Cancel any in-progress I/O + +PARAMETERS: + +RETURN VALUE: + bool +===========================================================================*/ +bool cSocket::CancelIO() +{ + if (mSocket == INVALID_HANDLE_VALUE) + { + return false; + } + + bool bRxCancel = CancelRx(); + bool bTxCancel = CancelTx(); + + return (bRxCancel && bTxCancel); +} + +/*=========================================================================== +METHOD: + CancelRx (Public Method) + +DESCRIPTION: + Cancel any in-progress receive operation + +RETURN VALUE: + bool +===========================================================================*/ +bool cSocket::CancelRx() +{ + if (mSocket == INVALID_HANDLE_VALUE + || mCommandPipe[WRITING] == INVALID_HANDLE_VALUE + || mpRxCallback == 0 + || mRxThreadID == 0) + { + TRACE( "cannot cancel, thread not active\n" ); + return false; + } + + // Notify the thread to stop reading + BYTE byte = STOP_READ_CMD; + int nRC = write( mCommandPipe[WRITING], &byte, 1 ); + if (nRC != 1) + { + TRACE( "error %d canceling read\n", nRC ); + return false; + } + + // Remove the old callback + mpRxCallback = 0; + + return true; +} + +/*=========================================================================== +METHOD: + CancelTx (Public Method) + +DESCRIPTION: + Cancel any in-progress transmit operation + +RETURN VALUE: + bool +===========================================================================*/ +bool cSocket::CancelTx() +{ + if (mSocket == INVALID_HANDLE_VALUE) + { + return false; + } + + mbCancelWrite = true; + + return true; +} + +/*=========================================================================== +METHOD: + RxData (Public Method) + +DESCRIPTION: + Receive data + +PARAMETERS: + pBuf [ I ] - Buffer to contain received data + bufSz [ I ] - Amount of data to be received + pCallback [ I ] - Callback object to be exercised when the + operation completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cSocket::RxData( + BYTE * pBuf, + ULONG bufSz, + cIOCallback * pCallback ) +{ + if (IsValid() == false || mpRxCallback != 0) + { + return false; + } + + if (pCallback == 0) + { + // Not interested in being notified, but we still need a value + // for this so that only one outstanding I/O operation is active + // at any given point in time + mpRxCallback = (cIOCallback * )1; + } + else + { + mpRxCallback = pCallback; + } + + mpBuffer = pBuf; + mBuffSz = bufSz; + + // Notify the thread to start reading + BYTE byte = START_READ_CMD; + int nRC = write( mCommandPipe[WRITING], &byte, 1 ); + if (nRC != 1) + { + TRACE( "error %d starting read\n", nRC ); + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + TxData (Public Method) + +DESCRIPTION: + Transmit data + +PARAMETERS: + pBuf [ I ] - Data to be transmitted + bufSz [ I ] - Amount of data to be transmitted + +RETURN VALUE: + bool +===========================================================================*/ +bool cSocket::TxData( + const BYTE * pBuf, + ULONG bufSz ) +{ + if (IsValid() == false) + { + return false; + } + +#ifdef DEBUG + ULONGLONG nStart = GetTickCount(); +#endif + + // Allow ourselves to be interupted + mbCancelWrite = false; + + // Format the header + int totalSz = sizeof( sQMUXDHeader ) + bufSz; + BYTE * pMsg = new BYTE[totalSz]; + if (pMsg == 0) + { + TRACE( "unable to allocate buffer\n" ); + return false; + } + memset( pMsg, 0, totalSz ); + + // The important QMUXD header values + sQMUXDHeader * pHdr = (sQMUXDHeader *)pMsg; + pHdr->mTotalSize = totalSz; + pHdr->mQMUXDClientID = mQMUXDClientID; + pHdr->mQMUXDMsgID = eQMUXD_MSG_WRITE_QMI_SDU; + pHdr->mQMUXDClientIDDuplicate = mQMUXDClientID; + + // mQMUXDTxID could go to INT_MAX, but rather than dealing with possible + // overflow in qmuxd or one of the lower layers, we'll stop early + mQMUXDTxID++; + if (mQMUXDTxID > 100000) + { + mQMUXDTxID = 1; + } + pHdr->mTxID = ++mQMUXDTxID; + + pHdr->mQMUXServiceID = mQMUXServiceID; + pHdr->mQMUXClientID = mQMUXClientID; + + // The data payload + memcpy( &pMsg[sizeof( sQMUXDHeader )], pBuf, bufSz ); + + // Send the message + int nRet = send( mSocket, pMsg, totalSz, 0 ); + delete [] pMsg; + if (nRet != totalSz) + { + TRACE( "cSocket::TxData() write returned %d instead of %d\n", + nRet, + totalSz ); + return false; + } + +#ifdef DEBUG + TRACE( "Write of %d bytes took %llu miliseconds\n", + totalSz, + GetTickCount() - nStart ); +#endif + + return true; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/Socket.h b/gobi-api/Gobi_2012-06-18-1054/Core/Socket.h new file mode 100755 index 0000000..9a3e0c4 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/Socket.h @@ -0,0 +1,164 @@ +/*=========================================================================== +FILE: + Socket.h + +DESCRIPTION: + Declaration of cSocket class + +PUBLIC CLASSES AND METHODS: + cSocket + This class wraps low level communication to qmuxd + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Event.h" +#include "Connection.h" + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// Enum eQMUXDMessageTypes +// Types to be passed into SendCtl() for cSocket +/*=========================================================================*/ +enum eQMUXDMessageTypes +{ + eQMUXD_MSG_WRITE_QMI_SDU = 0, + eQMUXD_MSG_ALLOC_QMI_CLIENT_ID = 1, + eQMUXD_MSG_RELEASE_QMI_CLIENT_ID = 2, +}; + +/*=========================================================================*/ +// Class cSocket +/*=========================================================================*/ +class cSocket : public cConnection +{ + public: + // Constructor + cSocket(); + + // Destructor + ~cSocket(); + + // Is this object valid? + bool IsValid(); + + // Connect to the specified channel + bool Connect( LPCSTR pChannel ); + + // Run an IOCTL on the open file handle + int SendCtl( + UINT ioctlReq, + void * pData ); + + // Disconnect from the current port + bool Disconnect(); + + // Configure the port with the passed in parameters + bool ConfigureSettings( termios * pSettings ); + + // Return the current port settings + bool GetSettings( termios * pSettings ); + + // Cancel any in-progress I/O + bool CancelIO(); + + // Cancel any in-progress receive operation + bool CancelRx(); + + // Cancel any in-progress transmit operation + bool CancelTx(); + + // Receive data + bool RxData( + BYTE * pBuf, + ULONG bufSz, + cIOCallback * pCallback ); + + // Transmit data + bool TxData( + const BYTE * pBuf, + ULONG bufSz ); + + // (Inline) Return current channel ID + int GetChannelID() const + { + return mChannelID; + }; + + // Are we currently connected to a port? + bool IsConnected() + { + return (mSocket != INVALID_HANDLE_VALUE); + }; + + protected: + + /* Handle to socket */ + int mSocket; + + // Cancel the write request? + bool mbCancelWrite; + + /* Buffer */ + BYTE * mpBuffer; + + /* Buffer size */ + ULONG mBuffSz; + + /* Pipe for comunication with thread */ + int mCommandPipe[2]; + + /* Thread ID of Rx Thread. */ + pthread_t mRxThreadID; + + /* Control message completion event */ + cEvent mCtrlMsgComplete; + + /* QMUXD client ID */ + int mQMUXDClientID; + + /* QMUX client and service IDs */ + int mQMUXClientID; + int mQMUXServiceID; + + /* SMD Channel ID. 0 = SMD_DATA_5 */ + int mChannelID; + + /* The SMD transaction ID */ + int mQMUXDTxID; + + // Rx thread is allowed complete access + friend void * RxSocketThread( void * pData ); +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/StdAfx.h b/gobi-api/Gobi_2012-06-18-1054/Core/StdAfx.h new file mode 100755 index 0000000..5b6077b --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/StdAfx.h @@ -0,0 +1,200 @@ +/*=========================================================================== +FILE: + StdAfx.h + +DESCRIPTION: + Application Framework eXtenstions for Linux + +PUBLIC CLASSES AND FUNCTIONS: + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once +//--------------------------------------------------------------------------- +// Includes +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//--------------------------------------------------------------------------- +// Macro defination +//--------------------------------------------------------------------------- + +#define ASSERT( x ) assert( x ) + +#ifdef DEBUG + + #ifdef ANDROID + + #include + + // TRACE macro + #define TRACE( format, arg... ) \ + if (true) \ + { \ + __android_log_print( ANDROID_LOG_INFO, \ + "Gobi", "%s:%d: " format, \ + __FILE__, \ + __LINE__, \ + ##arg ); \ + } + + #else + + #define TRACE( format, arg... ) \ + printf( "%s:%d: " format, \ + __FILE__, \ + __LINE__, \ + ##arg ) + #endif + +#else + #define TRACE(...) +#endif + +//--------------------------------------------------------------------------- +// data type defination +//--------------------------------------------------------------------------- +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef CONST +#define CONST const +#endif + +typedef void VOID; +typedef unsigned long DWORD; +typedef int BOOL; +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef float FLOAT; +typedef long long LONGLONG; +typedef unsigned long long ULONGLONG; +typedef signed char INT8; +typedef double DOUBLE; + +typedef int INT; +typedef unsigned int UINT; +typedef unsigned int * PUINT; +typedef INT HANDLE; +typedef HANDLE HMODULE; + +typedef char CHAR; +typedef short SHORT; +typedef long LONG; + +typedef unsigned long ULONG; +typedef ULONG * PULONG; +typedef ULONG * ULONG_PTR; +typedef unsigned short USHORT; +typedef USHORT * PUSHORT; +typedef unsigned char UCHAR; +typedef UCHAR * PUCHAR; +typedef char * PSZ; + + +typedef CONST CHAR * LPCSTR; +typedef CHAR * LPSTR; + +typedef BYTE * PBYTE; +typedef BOOL * PBOOL; +typedef INT * PINT; +typedef UINT * LPINT; +typedef WORD * PWORD; +typedef PWORD LPWORD; +typedef LONG * LPLONG; +typedef DWORD * PDWORD; +typedef VOID * PVOID; +typedef PVOID LPVOID; +typedef const void * LPCVOID; + +typedef size_t SIZE_T; +typedef double DATE; + +// Error code +#define NO_ERROR 0L +#define ERROR_SUCCESS 0L +#define ERROR_NO_MORE_ITEMS 259L +#define ERROR_CRC 23L +#define ERROR_OUTOFMEMORY 14L +#define ERROR_CAN_NOT_COMPLETE 1003L +#define ERROR_REVISION_MISMATCH 1306L +#define ERROR_BAD_ARGUMENTS 160L +#define INVALID_SET_FILE_POINTER -1 +#define VALID_HANDLE_VALUE 0 +#define INVALID_HANDLE_VALUE -1 +#define INVALID_FILE_SZ -1 + +#define ERROR_GEN_FAILURE 31L +#define ERROR_FILE_NOT_FOUND 2L +#define ERROR_NOT_ENOUGH_MEMORY 8L +#define ERROR_INVALID_PARAMETER 87L +#define ERROR_BAD_FORMAT 11L + + +// Other Constant definitions +#define MAX_PATH 512 +#define INFINITE 0xffffffff + + +// SIOCIWFIRSTPRIV = 0x8BE0 + +// Device I/O control code for setting QMI service +#define QMI_GET_SERVICE_FILE_IOCTL 0x8BE0 + 1 + +// Device I/O control code for obtaining device VIDPID +#define QMI_GET_VIDPID_IOCTL 0x8BE0 + 2 + +// Device I/O control code for obtaining device MEID +#define QMI_GET_MEID_IOCTL 0x8BE0 + 3 + +// Define the directions for pipes +#define READING 0 +#define WRITING 1 diff --git a/gobi-api/Gobi_2012-06-18-1054/Core/SyncQueue.h b/gobi-api/Gobi_2012-06-18-1054/Core/SyncQueue.h new file mode 100755 index 0000000..d6f6132 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Core/SyncQueue.h @@ -0,0 +1,419 @@ +/*=========================================================================== +FILE: + SyncQueue.h + +DESCRIPTION: + Declaration/Implementation of cSyncQueue class + +PUBLIC CLASSES AND METHODS: + cSyncQueue + Synchronized shareable (across multiple threads) queue of + structures with event notifications + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include +#include "Event.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cSyncQueue +/*=========================================================================*/ +template class cSyncQueue +{ + public: + // (Inline) Constructor + cSyncQueue( + ULONG maxElements, + bool bSignalEvent = false ) + : mSignature( (ULONG)eSYNC_QUEUE_SIG ), + mSignalEvent(), + mbSignalEvent( bSignalEvent ), + mMaxElements( maxElements ), + mTotalElements( 0 ) + { + // Create sync CS + int nRet = pthread_mutex_init( &mSyncSection, NULL ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to init sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + }; + + // (Inline) Destructor + ~cSyncQueue() + { + if (IsValid() == false) + { + ASSERT( (PVOID)"Double deletion detected in ~cSyncQueue" == 0 ); + } + else + { + EmptyQueue(); + + mSignature = 0; + int nRet = pthread_mutex_destroy( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to destroy sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + } + + }; + + // (Inline) Add an element to the queue + bool AddElement( const tElementType & elem ) + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Are we out of space? + if ((ULONG)mElementDeque.size() >= mMaxElements) + { + // Yes, drop oldest element + mElementDeque.pop_front(); + } + + // Add new item to the queue + mElementDeque.push_back( elem ); + mTotalElements++; + + // Set event? + if (mbSignalEvent == true) + { + // Signal index of event + nRet = mSignalEvent.Set( mTotalElements - 1 ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to signal. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + } + + // Success! + bRC = true; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Add an element to the queue returning the index of + // the element + bool AddElement( + const tElementType & elem, + ULONG & idx ) + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Are we out of space? + if ((ULONG)mElementDeque.size() >= mMaxElements) + { + mElementDeque.pop_front(); + } + + // Add new item to the queue + mElementDeque.push_back( elem ); + idx = mTotalElements++; + + // Set event? + if (mbSignalEvent == true) + { + // Signal index of event + nRet = mSignalEvent.Set( mTotalElements - 1 ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to signal. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + } + + // Success! + bRC = true; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Return given element in the queue + bool GetElement( + ULONG idx, + tElementType & elem ) const + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Is this a current element index? + ULONG expiredIndices = mTotalElements - (ULONG)mElementDeque.size(); + if (idx >= expiredIndices) + { + // Yes, grab it from the deque + idx -= expiredIndices; + if (idx < (ULONG)mElementDeque.size()) + { + elem = mElementDeque[idx]; + bRC = true; + } + } + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Empty element queue + bool EmptyQueue() + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + + mElementDeque.clear(); + mTotalElements = 0; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + bRC = true; + return bRC; + }; + + // (Inline) Return the number of queued elements + ULONG GetQueueCount() const + { + ULONG elems = 0; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return elems; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + elems = (ULONG)mElementDeque.size(); + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + return elems; + }; + + // (Inline) Return the total number of elements added to queue + ULONG GetTotalCount() const + { + ULONG elems = 0; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return elems; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + elems = mTotalElements; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + return elems; + }; + + // (Inline) Return the signal event + cEvent & GetSignalEvent() const + { + return mSignalEvent; + }; + + // (Inline) Is this sync queue valid? + bool IsValid() const + { + return (mSignature == (ULONG)eSYNC_QUEUE_SIG); + }; + + protected: + // Object signature + enum eClassConstants + { + eSYNC_QUEUE_SIG = 0x1799A2BC + }; + + /* Object signature */ + ULONG mSignature; + + /* Multithreaded mutex type */ + mutable pthread_mutex_t mSyncSection; + + /* Signal event, set everytime an element is added (if configured) */ + mutable cEvent mSignalEvent; + + /* Use above signal event? */ + bool mbSignalEvent; + + /* Maximum number of elements to add to the deque */ + ULONG mMaxElements; + + /* Total number of elements added to the deque */ + ULONG mTotalElements; + + /* Element queue */ + std::deque mElementDeque; +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000Translation.cpp b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000Translation.cpp new file mode 100755 index 0000000..9bb704c --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000Translation.cpp @@ -0,0 +1,101 @@ +/*=========================================================================== +FILE: + Gobi3000Translation.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetTLV + +DESCRIPTION: + Return the starting location and size of TLV buffer. + + NOTE: does not include the TLV header + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + type [ I ] - Type ID + pOutLen [ O ] - Length of the output buffer + ppOut [ O ] - Pointer to output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetTLV( + ULONG inLen, + const BYTE * pIn, + BYTE typeID, + ULONG * pOutLen, + const BYTE ** ppOut ) +{ + if (pIn == 0 || pOutLen == 0 || ppOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + for (ULONG offset = 0; + offset + sizeof( sQMIRawContentHeader ) <= inLen; + offset += sizeof( sQMIRawContentHeader )) + { + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pIn + offset); + + // Is it big enough to contain this TLV? + if (offset + sizeof( sQMIRawContentHeader ) + pHeader->mLength > inLen) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + if (pHeader->mTypeID == typeID) + { + *pOutLen = pHeader->mLength; + *ppOut = pIn + offset + sizeof( sQMIRawContentHeader ); + + return eGOBI_ERR_NONE; + } + + offset += pHeader->mLength; + } + + // TLV not found + return eGOBI_ERR_INVALID_RSP; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000Translation.h b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000Translation.h new file mode 100755 index 0000000..18bc89c --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000Translation.h @@ -0,0 +1,1028 @@ +/*=========================================================================== +FILE: + Gobi3000Translation.h + +DESCRIPTION: + QUALCOMM Tanslation for Gobi 3000 + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +#ifndef GOBI_TYPEDEFS +#define GOBI_TYPEDEFS + +// Type Definitions +typedef unsigned long ULONG; +typedef unsigned long * ULONG_PTR; +typedef unsigned long long ULONGLONG; +typedef signed char INT8; +typedef unsigned char UINT8; +typedef signed short INT16; +typedef unsigned short UINT16; +typedef signed int INT32; +typedef unsigned int UINT32; +typedef unsigned char BYTE; +typedef char CHAR; +typedef unsigned short WORD; +typedef unsigned short USHORT; +typedef const char * LPCSTR; + +#ifdef WINDOWS + typedef signed __int64 INT64; + typedef unsigned __int64 UINT64; +#else + typedef signed long long INT64; + typedef unsigned long long UINT64; +#endif + +#endif + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include +#include +#include +#include "GobiConnectionMgmtAPIStructs.h" + +//--------------------------------------------------------------------------- +// Prototypes +//--------------------------------------------------------------------------- + +// Get a TLV +ULONG GetTLV( + ULONG inLen, + const BYTE * pIn, + BYTE typeID, + ULONG * pOutLen, + const BYTE ** ppOut ); + +// WDS + +ULONG ParseGetSessionState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ); + +ULONG ParseGetSessionDuration( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pDuration ); + +ULONG ParseGetDormancyState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ); + +ULONG ParseGetEnhancedAutoconnect( + ULONG inLen, + const BYTE * pIn, + ULONG * pSetting, + ULONG * pRoamSetting ); + +ULONG PackSetEnhancedAutoconnect( + ULONG * pOutLen, + BYTE * pOut, + ULONG setting, + ULONG * pRoamSetting ); + +ULONG PackSetDefaultProfile( + ULONG * pOutLen, + BYTE * pOut, + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ); + +ULONG PackGetDefaultProfile( + ULONG * pOutLen, + BYTE * pOut, + ULONG profileType ); + +ULONG ParseGetDefaultProfile( + ULONG inLen, + const BYTE * pIn, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ); + +ULONG PackStartDataSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword ); + +ULONG ParseStartDataSession( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionId, + ULONG * pFailureReason ); + +ULONG PackStopDataSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG sessionId ); + +ULONG PackGetIPAddress( + ULONG * pOutLen, + BYTE * pOut ); + +ULONG ParseGetIPAddress( + ULONG inLen, + const BYTE * pIn, + ULONG * pIPAddress ); + +ULONG ParseGetConnectionRate( + ULONG inLen, + const BYTE * pIn, + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ); + +ULONG PackGetPacketStatus( + ULONG * pOutLen, + BYTE * pOut ); + +ULONG ParseGetPacketStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ); + +ULONG PackGetByteTotals( + ULONG * pOutLen, + BYTE * pOut ); + +ULONG ParseGetByteTotals( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ); + +ULONG PackSetMobileIP( + ULONG * pOutLen, + BYTE * pOut, + ULONG mode ); + +ULONG ParseGetMobileIP( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode ); + +ULONG PackSetActiveMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE index ); + +ULONG ParseGetActiveMobileIPProfile( + ULONG inLen, + const BYTE * pIn, + BYTE * pIndex ); + +ULONG PackSetMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ); + +ULONG PackGetMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + BYTE index ); + +ULONG ParseGetMobileIPProfile( + ULONG inLen, + const BYTE * pIn, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ); + +ULONG PackSetMobileIPParameters( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + +ULONG ParseGetMobileIPParameters( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + +ULONG ParseGetLastMobileIPError( + ULONG inLen, + const BYTE * pIn, + ULONG * pError ); + +ULONG PackSetDNSSettings( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); + +ULONG ParseGetDNSSettings( + ULONG inLen, + const BYTE * pIn, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); + +ULONG ParseGetDataBearerTechnology( + ULONG inLen, + const BYTE * pIn, + ULONG * pDataBearer ); + +// NAS + +ULONG ParseGetANAAAAuthenticationStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus ); + +ULONG ParseGetSignalStrength( + ULONG inLen, + const BYTE * pIn, + INT8 * pSignalStrength, + ULONG * pRadioInterface ); + +ULONG ParseGetSignalStrengths( + ULONG inLen, + const BYTE * pIn, + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ); + +ULONG ParseGetRFInfo( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances ); + +ULONG ParsePerformNetworkScan( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances ); + +ULONG ParsePerformNetworkRATScan( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ); + +ULONG PackInitiateNetworkRegistration( + ULONG * pOutLen, + BYTE * pOut, + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ); + +ULONG PackInitiateDomainAttach( + ULONG * pOutLen, + BYTE * pOut, + ULONG action ); + +ULONG ParseGetServingNetwork( + ULONG inLen, + const BYTE * pIn, + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ); + +ULONG ParseGetServingNetworkCapabilities( + ULONG inLen, + const BYTE * pIn, + BYTE * pDataCapsSize, + BYTE * pDataCaps ); + +ULONG ParseGetHomeNetwork( + ULONG inLen, + const BYTE * pIn, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ); + +ULONG PackSetNetworkPreference( + ULONG * pOutLen, + BYTE * pOut, + ULONG technologyPref, + ULONG duration ); + +ULONG ParseGetNetworkPreference( + ULONG inLen, + const BYTE * pIn, + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ); + +ULONG PackSetCDMANetworkParameters( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + +ULONG ParseGetCDMANetworkParameters( + ULONG inLen, + const BYTE * pIn, + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + +ULONG ParseGetACCOLC( + ULONG inLen, + const BYTE * pIn, + BYTE * pACCOLC ); + +ULONG PackSetACCOLC( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE accolc ); + +ULONG ParseGetPLMNMode( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode ); + +ULONG PackGetPLMNName( + ULONG * pOutLen, + BYTE * pOut, + USHORT mcc, + USHORT mnc ); + +ULONG ParseGetPLMNName( + ULONG inLen, + const BYTE * pIn, + ULONG * pNamesSize, + BYTE * pNames ); + +// DMS + +ULONG ParseGetDeviceCapabilities( + ULONG inLen, + const BYTE * pIn, + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ); + +ULONG ParseGetManufacturer( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseGetModelID( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseGetFirmwareRevision( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseGetFirmwareRevisions( + ULONG inLen, + const BYTE * pIn, + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ); + +ULONG ParseGetVoiceNumber( + ULONG inLen, + const BYTE * pIn, + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ); + +ULONG ParseGetIMSI( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseGetSerialNumbers( + ULONG inLen, + const BYTE * pIn, + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ); + +ULONG PackSetLock( + ULONG * pOutLen, + BYTE * pOut, + ULONG state, + CHAR * pCurrentPIN ); + +ULONG ParseQueryLock( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ); + +ULONG PackChangeLockPIN( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ); + +ULONG ParseGetHardwareRevision( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseGetPRLVersion( + ULONG inLen, + const BYTE * pIn, + WORD * pPRLVersion ); + +ULONG ParseGetERIFile( + ULONG inLen, + const BYTE * pIn, + ULONG * pFileSize, + BYTE * pFile ); + +ULONG PackActivateAutomatic( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pActivationCode ); + +ULONG PackResetToFactoryDefaults( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC ); + +ULONG ParseGetActivationState( + ULONG inLen, + const BYTE * pIn, + ULONG * pActivationState ); + +ULONG PackSetPower( + ULONG * pOutLen, + BYTE * pOut, + ULONG powerMode ); + +ULONG ParseGetPower( + ULONG inLen, + const BYTE * pIn, + ULONG * pPowerMode ); + +ULONG ParseGetOfflineReason( + ULONG inLen, + const BYTE * pIn, + ULONG * pReasonMask, + ULONG * pbPlatform ); + +ULONG ParseGetNetworkTime( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pTimeCount, + ULONG * pTimeSource ); + +ULONG PackValidateSPC( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC ); + +// SMS + +ULONG PackDeleteSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ); + +ULONG PackGetSMSList( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG * pRequestedTag ); + +ULONG ParseGetSMSList( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageListSize, + BYTE * pMessageList ); + +ULONG PackGetSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageIndex ); + +ULONG ParseGetSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ); + +ULONG PackModifySMSStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ); + +ULONG PackSaveSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage ); + +ULONG ParseSaveSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageIndex ); + +ULONG PackSendSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage ); + +ULONG ParseSendSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageFailureCode ); + +ULONG ParseGetSMSCAddress( + ULONG inLen, + const BYTE * pIn, + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ); + +ULONG PackSetSMSCAddress( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSMSCAddress, + CHAR * pSMSCType ); + +ULONG ParseGetSMSRoutes( + ULONG inLen, + const BYTE * pIn, + BYTE * pRouteSize, + BYTE * pRoutes ); + +ULONG PackSetSMSRoutes( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pRouteSize, + BYTE * pRoutes ); + +// DMS UIM + +ULONG PackUIMUnblockControlKey( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pValue ); + +ULONG ParseUIMUnblockControlKey( + ULONG inLen, + const BYTE * pIn, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMSetControlKeyProtection( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + ULONG status, + CHAR * pValue ); + +ULONG ParseUIMSetControlKeyProtection( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft ); + +ULONG PackUIMGetControlKeyBlockingStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG id ); + +ULONG ParseUIMGetControlKeyBlockingStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ); + +ULONG ParseUIMGetControlKeyStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMGetControlKeyStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG id ); + +ULONG ParseUIMGetICCID( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ); + +ULONG ParseUIMGetPINStatus( + ULONG inLen, + const BYTE * pIn, + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMChangePIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue ); + +ULONG ParseUIMChangePIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMUnblockPIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue ); + +ULONG ParseUIMUnblockPIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMVerifyPIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pValue ); + +ULONG ParseUIMVerifyPIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +ULONG PackUIMSetPINProtection( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + ULONG bEnable, + CHAR * pValue ); + +ULONG ParseUIMSetPINProtection( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +// PDS + +ULONG ParseGetPDSState( + ULONG inLen, + const BYTE * pIn, + ULONG * pEnabled, + ULONG * pTracking ); + +ULONG PackSetPDSState( + ULONG * pOutLen, + BYTE * pOut, + ULONG enable ); + +ULONG PackPDSInjectTimeReference( + ULONG * pOutLen, + BYTE * pOut, + ULONGLONG systemTime, + USHORT systemDiscontinuities ); + +ULONG ParseGetPDSDefaults( + ULONG inLen, + const BYTE * pIn, + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ); + +ULONG PackSetPDSDefaults( + ULONG * pOutLen, + BYTE * pOut, + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ); + +ULONG ParseGetXTRAAutomaticDownload( + ULONG inLen, + const BYTE * pIn, + ULONG * pbEnabled, + USHORT * pInterval ); + +ULONG PackSetXTRAAutomaticDownload( + ULONG * pOutLen, + BYTE * pOut, + ULONG bEnabled, + USHORT interval ); + +ULONG ParseGetXTRANetwork( + ULONG inLen, + const BYTE * pIn, + ULONG * pPreference ); + +ULONG PackSetXTRANetwork( + ULONG * pOutLen, + BYTE * pOut, + ULONG preference ); + +ULONG ParseGetXTRAValidity( + ULONG inLen, + const BYTE * pIn, + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ); + +ULONG ParseGetXTRADataState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ); + +ULONG PackSetXTRADataState( + ULONG * pOutLen, + BYTE * pOut, + ULONG state ); + +ULONG ParseGetXTRATimeState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ); + +ULONG PackSetXTRATimeState( + ULONG * pOutLen, + BYTE * pOut, + ULONG state ); + +ULONG ParseGetAGPSConfig( + ULONG inLen, + const BYTE * pIn, + ULONG * pServerAddress, + ULONG * pServerPort ); + +ULONG PackSetAGPSConfig( + ULONG * pOutLen, + BYTE * pOut, + ULONG serverAddress, + ULONG serverPort ); + +ULONG ParseGetServiceAutomaticTracking( + ULONG inLen, + const BYTE * pIn, + ULONG * pbAuto ); + +ULONG PackSetServiceAutomaticTracking( + ULONG * pOutLen, + BYTE * pOut, + ULONG bAuto ); + +ULONG ParseGetPortAutomaticTracking( + ULONG inLen, + const BYTE * pIn, + ULONG * pbAuto ); + +ULONG PackSetPortAutomaticTracking( + ULONG * pOutLen, + BYTE * pOut, + ULONG bAuto ); + +ULONG PackResetPDSData( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pGPSDataMask, + ULONG * pCellDataMask ); + +// CAT + +ULONG PackCATSendTerminalResponse( + ULONG * pOutLen, + BYTE * pOut, + ULONG refID, + ULONG dataLen, + BYTE * pData ); + +ULONG PackCATSendEnvelopeCommand( + ULONG * pOutLen, + BYTE * pOut, + ULONG cmdID, + ULONG dataLen, + BYTE * pData ); + +// RMS + +ULONG ParseGetSMSWake( + ULONG inLen, + const BYTE * pIn, + ULONG * pbEnabled, + ULONG * pWakeMask ); + +ULONG PackSetSMSWake( + ULONG * pOutLen, + BYTE * pOut, + ULONG bEnable, + ULONG wakeMask ); + +// OMADM + +ULONG PackOMADMStartSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG sessionType ); + +ULONG ParseOMADMGetSessionInfo( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ); + +ULONG ParseOMADMGetPendingNIA( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionType, + USHORT * pSessionID ); + +ULONG PackOMADMSendSelection( + ULONG * pOutLen, + BYTE * pOut, + ULONG selection, + USHORT sessionID ); + +ULONG ParseOMADMGetFeatureSettings( + ULONG inLen, + const BYTE * pIn, + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ); + +ULONG PackOMADMSetProvisioningFeature( + ULONG * pOutLen, + BYTE * pOut, + ULONG bProvisioning ); + +ULONG PackOMADMSetPRLUpdateFeature( + ULONG * pOutLen, + BYTE * pOut, + ULONG bPRLUpdate ); + +// Voice + +ULONG PackOriginateUSSD( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pInfo ); + +ULONG PackAnswerUSSD( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pInfo ); + diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationCAT.cpp b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationCAT.cpp new file mode 100755 index 0000000..c990a87 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationCAT.cpp @@ -0,0 +1,177 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationCAT.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (Card Application Toolkit Service) + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + PackCATSendTerminalResponse + +DESCRIPTION: + This function sends the terminal response to the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + refID [ I ] - UIM reference ID (from CAT event) + dataLen [ I ] - Terminal response data length + pData [ I ] - Terminal response data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackCATSendTerminalResponse( + ULONG * pOutLen, + BYTE * pOut, + ULONG refID, + ULONG dataLen, + BYTE * pData ) +{ + // Validate arguments + if (pOut == 0 || pData == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx01Sz = sizeof( sCATSendTerminalResponseRequest_TerminalResponseType ) + + (WORD)dataLen; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sCATSendTerminalResponseRequest_TerminalResponseType * pTLVx01; + pTLVx01 = (sCATSendTerminalResponseRequest_TerminalResponseType*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mReferenceID = refID; + pTLVx01->mTerminalResponseLength = (UINT16)dataLen; + + offset += sizeof( sCATSendTerminalResponseRequest_TerminalResponseType ); + + if (dataLen > 0) + { + memcpy( pOut + offset, pData, dataLen ); + offset += dataLen; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackCATSendEnvelopeCommand + +DESCRIPTION: + This function sends the envelope command to the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + cmdID [ I ] - Envelope command ID + dataLen [ I ] - Envelope command data length + pData [ I ] - Envelope command data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackCATSendEnvelopeCommand( + ULONG * pOutLen, + BYTE * pOut, + ULONG cmdID, + ULONG dataLen, + BYTE * pData ) +{ + // Validate arguments + if (pOut == 0 || dataLen == 0 || pData == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx01Sz = sizeof( sCATEnvelopeCommandRequest_EnvelopeCommand ) + + (WORD)dataLen; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sCATEnvelopeCommandRequest_EnvelopeCommand * pTLVx01; + pTLVx01 = (sCATEnvelopeCommandRequest_EnvelopeCommand*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mEnvelopeCommandType = (eQMICATEnvelopeCommandType)cmdID; + pTLVx01->mEnvelopeLength = (UINT16)dataLen; + + offset += sizeof( sCATEnvelopeCommandRequest_EnvelopeCommand ); + + if (dataLen > 0) + { + memcpy( pOut + offset, pData, dataLen ); + offset += dataLen; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationDMS.cpp b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationDMS.cpp new file mode 100755 index 0000000..d30dfed --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationDMS.cpp @@ -0,0 +1,1483 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationDMS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (DMS Service) + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + ParseGetDeviceCapabilities + +DESCRIPTION: + This function gets device capabilities + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMaxTXChannelRate [ O ] - Maximum transmission rate (bps) + pMaxRXChannelRate [ O ] - Maximum reception rate (bps) + pDataServiceCapability [ O ] - CS/PS data service capability + pSimCapability [ O ] - Device SIM support + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. + Upon successful output the actual number + of elements in the radio interface array + pRadioIfaces [ O ] - The radio interface array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetDeviceCapabilities( + ULONG inLen, + const BYTE * pIn, + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ) +{ + // Validate arguments + if (pIn == 0 + || pMaxTXChannelRate == 0 + || pMaxRXChannelRate == 0 + || pDataServiceCapability == 0 + || pSimCapability == 0 + || pRadioIfacesSize == 0 + || *pRadioIfacesSize == 0 + || pRadioIfaces == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxRadioIfaces = (ULONG)*pRadioIfacesSize; + + // Assume failure + *pRadioIfacesSize = 0; + + const sDMSGetDeviceCapabilitiesResponse_Capabilities * pTLVx01; + ULONG structSzx01 = sizeof( sDMSGetDeviceCapabilitiesResponse_Capabilities ); + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < structSzx01) + { + return eGOBI_ERR_BUFFER_SZ; + } + + // Populate the variables + *pMaxTXChannelRate = pTLVx01->mMaxTXRatebps; + *pMaxRXChannelRate = pTLVx01->mMaxRXRatebps; + *pDataServiceCapability = pTLVx01->mDataServiceCapability; + + // SIM capability should be treated as a boolean, even though it's not + *pSimCapability = (pTLVx01->mSIMSupported == 0 ? 0 : 1); + + ULONG activeRadioIfaces = pTLVx01->mRadioInterfaceCount; + if (activeRadioIfaces > maxRadioIfaces) + { + activeRadioIfaces = maxRadioIfaces; + } + + const eQMIDMSRadioInterfaces * pInRadioInterfaces; + + // Verify there is room for the array in the TLV + if (outLenx01 < structSzx01 + + sizeof( eQMIDMSRadioInterfaces ) * activeRadioIfaces) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pInRadioInterfaces = (const eQMIDMSRadioInterfaces *) + ((const BYTE *)pTLVx01 + structSzx01); + + ULONG * pOutRadioIfaces = (ULONG *)pRadioIfaces; + for (ULONG r = 0; r < activeRadioIfaces; r++) + { + *pOutRadioIfaces = *pInRadioInterfaces; + pOutRadioIfaces++; + pInRadioInterfaces++; + } + + *pRadioIfacesSize = activeRadioIfaces; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetManufacturer + +DESCRIPTION: + This function returns the device manufacturer name + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetManufacturer( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Find the manufacturer + // sDMSGetDeviceManfacturerResponse_Manfacturer only contains this + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (stringSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, pTLVx01, outLenx01 ); + pString[outLenx01] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetModelID + +DESCRIPTION: + This function returns the device model ID + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetModelID( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Find the model + // sDMSGetDeviceModelResponse_Model only contains the model + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (stringSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, pTLVx01, outLenx01 ); + pString[outLenx01] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetFirmwareRevision + +DESCRIPTION: + This function returns the device firmware revision + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetFirmwareRevision( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Find the PRI revision + // sDMSGetDeviceRevisionResponse_UQCNRevision only contains this + const CHAR * pTLVx11; + ULONG outLenx11; + ULONG rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (stringSize < outLenx11 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, pTLVx11, outLenx11 ); + pString[outLenx11] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetFirmwareRevisions + +DESCRIPTION: + This function returns the device firmware (AMSS, boot, and PRI) + revisions + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + amssSize [ I ] - The maximum number of characters (including NULL + terminator) that the AMSS string array can contain + pAMSSString [ O ] - NULL terminated AMSS revision string + bootSize [ I ] - The maximum number of characters (including NULL + terminator) that the boot string array can contain + pBootString [ O ] - NULL terminated boot code revision string + priSize [ I ] - The maximum number of characters (including NULL + terminator) that the PRI string array can contain + pPRIString [ O ] - NULL terminated PRI revision string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetFirmwareRevisions( + ULONG inLen, + const BYTE * pIn, + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ) +{ + // Validate arguments + if (pIn == 0 + || amssSize == 0 || pAMSSString == 0 + || bootSize == 0 || pBootString == 0 + || priSize == 0 || pPRIString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pAMSSString = 0; + *pBootString = 0; + *pPRIString = 0; + + // Find the AMSS version + // sDMSGetDeviceRevisionResponse_Revision only contains this + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (amssSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pAMSSString, pTLVx01, outLenx01 ); + pAMSSString[outLenx01] = 0; + + // Find the Boot version + // sDMSGetDeviceRevisionResponse_BootCodeRevision only contains this + const CHAR * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (bootSize < outLenx10 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pBootString, pTLVx10, outLenx10 ); + pBootString[outLenx10] = 0; + + // The PRI version is returned by ParseGetFirmwareRevision() + rc = ParseGetFirmwareRevision( inLen, pIn, priSize, pPRIString ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetVoiceNumber + +DESCRIPTION: + This function returns the voice number in use by the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + voiceNumberSize [ I ] - The maximum number of characters (including NULL + terminator) that the voice number array can + contain + pVoiceNumber [ O ] - Voice number (MDN or ISDN) string + minSize [ I ] - The maximum number of characters (including NULL + terminator) that the MIN array can contain + pMIN [ O ] - MIN string (empty string returned when MIN is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetVoiceNumber( + ULONG inLen, + const BYTE * pIn, + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ) +{ + // Validate arguments + if (pIn == 0 + || voiceNumberSize == 0 || pVoiceNumber == 0 + || minSize == 0 || pMIN == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pVoiceNumber = 0; + *pMIN = 0; + + // Find the Voice number + // sDMSGetDeviceVoiceNumberResponse_VoiceNumber only contains this + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (voiceNumberSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pVoiceNumber, pTLVx01, outLenx01 ); + pVoiceNumber[outLenx01] = 0; + + // Find the Mobile ID (optional) + // sDMSGetDeviceVoiceNumberResponse_MobileIDNumber only contains this + const CHAR * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + // Space to perform the copy? + if (minSize < outLenx10 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pMIN, pTLVx10, outLenx10 ); + pMIN[outLenx10] = 0; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetIMSI + +DESCRIPTION: + This function returns the device IMSI + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetIMSI( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Find the IMSI + // sDMSGetDeviceVoiceNumberResponse_IMSI only contains this + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (stringSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, pTLVx01, outLenx01 ); + pString[outLenx01] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSerialNumbers + +DESCRIPTION: + This command returns all serial numbers assigned to the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + esnSize [ I ] - The maximum number of characters (including NULL + terminator) that the ESN array can contain + pESNString [ O ] - ESN string (empty string returned when ESN is + not supported/programmed) + imeiSize [ I ] - The maximum number of characters (including NULL + terminator) that the IMEI array can contain + pIMEIString [ O ] - IMEI string (empty string returned when IMEI is + not supported/programmed) + meidSize [ I ] - The maximum number of characters (including NULL + terminator) that the MEID array can contain + pMEIDString [ O ] - MEID string (empty string returned when MEID is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSerialNumbers( + ULONG inLen, + const BYTE * pIn, + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ) +{ + // Validate arguments + if (pIn == 0 + || esnSize == 0 || pESNString == 0 + || imeiSize == 0 || pIMEIString == 0 + || meidSize == 0 || pMEIDString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pESNString = 0; + *pIMEIString = 0; + *pMEIDString = 0; + + // Find the ESN + // sDMSGetDeviceSerialNumbersResponse_ESN only contains this + const CHAR * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (esnSize < outLenx10 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pESNString, pTLVx10, outLenx10 ); + pESNString[outLenx10] = 0; + + // Find the IMEI + // sDMSGetDeviceSerialNumbersResponse_IMEI only contains this + const CHAR * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (imeiSize < outLenx11 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pIMEIString, pTLVx11, outLenx11 ); + pIMEIString[outLenx11] = 0; + + // Find the MEID + // sDMSGetDeviceSerialNumbersResponse_MEID only contains this + const CHAR * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (meidSize < outLenx12 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pMEIDString, pTLVx12, outLenx12 ); + pMEIDString[outLenx12] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + state [ I ] - Desired lock state + pCurrentPIN [ I ] - Current four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetLock( + ULONG * pOutLen, + BYTE * pOut, + ULONG state, + CHAR * pCurrentPIN ) +{ + // Validate arguments + if (pOut == 0 || pCurrentPIN == 0 || pCurrentPIN[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string thePIN( pCurrentPIN ); + if (thePIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (thePIN.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSSetLockStateRequest_LockState ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSSetLockStateRequest_LockState * pTLVx01; + pTLVx01 = (sDMSSetLockStateRequest_LockState*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mLockState = (eQMIDMSLockStates)state; + memcpy( &pTLVx01->mLockCode[0], thePIN.c_str(), thePIN.size() ); + + offset += tlvx01Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseQueryLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pState [ O ] - Current lock state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseQueryLock( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ) +{ + // Validate arguments + if (pIn == 0 || pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the state + const sDMSGetLockStateResponse_LockState * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSGetLockStateResponse_LockState )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pState = pTLVx01->mLockState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackChangeLockPIN + +DESCRIPTION: + This command sets the user lock code maintained by the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pCurrentPIN [ I ] - Current four digit PIN string + pDesiredPIN [ I ] - New four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackChangeLockPIN( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ) +{ + // Validate arguments + if (pOut == 0 + || pCurrentPIN == 0 || pCurrentPIN[0] == 0 + || pDesiredPIN == 0 || pDesiredPIN[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theCurPIN( pCurrentPIN ); + if (theCurPIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (theCurPIN.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theNewPIN( pDesiredPIN ); + if (theNewPIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (theNewPIN.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSSetLockCodeRequest_LockCode ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSSetLockCodeRequest_LockCode * pTLVx01; + pTLVx01 = (sDMSSetLockCodeRequest_LockCode*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mCurrentLockCode[0], + theCurPIN.c_str(), + theCurPIN.size() ); + + memcpy( &pTLVx01->mNewLockCode[0], + theNewPIN.c_str(), + theNewPIN.size() ); + + offset += tlvx01Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetHardwareRevision + +DESCRIPTION: + This function returns the device hardware revision + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetHardwareRevision( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the hardware revision + // sDMSGetHardwareRevisionResponse_HardwareRevision only contains this + const CHAR * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Space to perform the copy? + if (stringSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, pTLVx01, outLenx01 ); + pString[outLenx01] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPRLVersion + +DESCRIPTION: + This function returns the version of the active Preferred Roaming List + (PRL) in use by the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pPRLVersion [ O ] - The PRL version number + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPRLVersion( + ULONG inLen, + const BYTE * pIn, + WORD * pPRLVersion ) +{ + // Validate arguments + if (pIn == 0 || pPRLVersion == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the state + const sDMSGetPRLVersionResponse_PRLVersion * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSGetPRLVersionResponse_PRLVersion )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pPRLVersion = pTLVx01->mPRLVersion; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetERIFile + +DESCRIPTION: + This command returns the ERI file that is stored in EFS on the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pFileSize [I/O] - Upon input the maximum number of bytes that the file + contents array can contain. Upon successful output + the actual number of bytes written to the file contents + array + pFile [ O ] - The file contents + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetERIFile( + ULONG inLen, + const BYTE * pIn, + ULONG * pFileSize, + BYTE * pFile ) +{ + // Validate arguments + if (pIn == 0 || pFileSize == 0 || *pFileSize == 0 || pFile == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + ULONG maxFileSize = *pFileSize; + *pFileSize = 0; + + // Find the state + const sDMSReadERIDataResponse_UserData * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSReadERIDataResponse_UserData )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG fileSz = pTLVx01->mDataLength; + const BYTE * pInFile; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sDMSReadERIDataResponse_UserData ) + + sizeof( BYTE ) * fileSz) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Space to copy into? + if (fileSz > maxFileSize) + { + return eGOBI_ERR_BUFFER_SZ; + } + + // Align to the first array element + pInFile = (const BYTE *)pTLVx01 + + sizeof( sDMSReadERIDataResponse_UserData ); + + // Perform the copy + memcpy( pFile, pInFile, fileSz ); + *pFileSize = fileSz; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackActivateAutomatic + +DESCRIPTION: + This function requests the device to perform automatic service activation + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pActivationCode [ I ] - Activation code (maximum string length of 12) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackActivateAutomatic( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pActivationCode ) +{ + // Validate arguments + if (pOut == 0 || pActivationCode == 0 || pActivationCode[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string ac( pActivationCode ); + if (ac.size() > 12) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSActivateAutomaticRequest_ActivationCode ) + + (WORD)ac.size(); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSActivateAutomaticRequest_ActivationCode * pTLVx01; + pTLVx01 = (sDMSActivateAutomaticRequest_ActivationCode*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mCodeLength = (UINT8)ac.size(); + + memcpy( (BYTE *)pTLVx01 + + sizeof( sDMSActivateAutomaticRequest_ActivationCode ), + ac.c_str(), + ac.size() ); + + offset += tlvx01Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackResetToFactoryDefaults + +DESCRIPTION: + This function requests the device reset configuration to factory defaults + + CHANGES: + * The client must manually reset the device after this request completes + using DMSSetOperatingMode() + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackResetToFactoryDefaults( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSResetFactoryDefaultsRequest_SPC ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The SPC + sDMSResetFactoryDefaultsRequest_SPC * pTLVx01; + pTLVx01 = (sDMSResetFactoryDefaultsRequest_SPC*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetActivationState + +DESCRIPTION: + This function returns the device activation state + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pActivationState [ O ] - Service activation state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetActivationState( + ULONG inLen, + const BYTE * pIn, + ULONG * pActivationState ) +{ + // Validate arguments + if (pIn == 0 || pActivationState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the state + const sDMSGetActivationStateResponse_ActivationState * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSGetActivationStateResponse_ActivationState )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pActivationState = pTLVx01->mActivationState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetPower + +DESCRIPTION: + This function sets the operating mode of the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied to pOut + pOut [ O ] - Output buffer + powerMode [ I ] - Selected operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetPower( + ULONG * pOutLen, + BYTE * pOut, + ULONG powerMode ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSSetOperatingModeRequest_OperatingMode ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // Set the mode + sDMSSetOperatingModeRequest_OperatingMode * pTLVx01; + pTLVx01 = (sDMSSetOperatingModeRequest_OperatingMode*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mOperatingMode = (eQMIDMSOperatingModes)powerMode; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPower + +DESCRIPTION: + This function returns the operating mode of the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pPowerMode [ O ] - Current operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPower( + ULONG inLen, + const BYTE * pIn, + ULONG * pPowerMode ) +{ + // Validate arguments + if (pIn == 0 || pPowerMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pPowerMode = 0xffffffff; + + // Find the mode + const sDMSGetOperatingModeResponse_OperatingMode * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSGetOperatingModeResponse_OperatingMode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pPowerMode = pTLVx01->mOperatingMode; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetOfflineReason + +DESCRIPTION: + This function returns the reason why the operating mode of the device + is currently offline + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pReasonMask [ O ] - Bitmask of offline reasons + pbPlatform [ O ] - Offline due to being platform retricted? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetOfflineReason( + ULONG inLen, + const BYTE * pIn, + ULONG * pReasonMask, + ULONG * pbPlatform ) +{ + // Validate arguments + if (pIn == 0 || pReasonMask == 0 || pbPlatform == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pReasonMask = 0; + *pbPlatform = 0; + + // Find the reason mask (optional) + const sDMSGetOperatingModeResponse_OfflineReason * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sDMSGetOperatingModeResponse_OfflineReason )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Copy the bitmask to pReasonMask + *pReasonMask = *(WORD*)pTLVx10; + } + + // Find the platform restriction (optional) + const sDMSGetOperatingModeResponse_PlatformRestricted * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sDMSGetOperatingModeResponse_PlatformRestricted )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Copy the value + *pbPlatform = pTLVx11->mPlatformRestricted; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetNetworkTime + +DESCRIPTION: + This function returns the current time of the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pTimeCount [ O ] - Count of 1.25ms that have elapsed from the start + of GPS time (Jan 6, 1980) + pTimeSource [ O ] - Source of the timestamp + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetNetworkTime( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pTimeCount, + ULONG * pTimeSource ) +{ + // Validate arguments + if (pIn == 0 || pTimeCount == 0 || pTimeSource == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the reason mask + const sDMSGetTimestampResponse_Timestamp * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sDMSGetTimestampResponse_Timestamp )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Get the values + *pTimeCount = pTLVx01->mTimestamp; + // mSource is of type eQMIDMSTimestampSources + *pTimeSource = pTLVx01->mSource; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackValidateSPC + +DESCRIPTION: + This function validates the service programming code + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - Six digit service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackValidateSPC( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sDMSValidateSPCRequest_SPC ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The SPC + sDMSValidateSPCRequest_SPC * pTLVx01; + pTLVx01 = (sDMSValidateSPCRequest_SPC*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationNAS.cpp b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationNAS.cpp new file mode 100755 index 0000000..bda91f1 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationNAS.cpp @@ -0,0 +1,2022 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationNAS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (NAS Service) + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +// Maximum length for a scanned network description +const ULONG MAX_SNI_DESCRIPTION_LEN = 255; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sEVDOCustomSCPConfig +// Struct to represent CDMA 1xEV-DO custom SCP config +/*=========================================================================*/ +struct sEVDOCustomSCPConfig +{ + public: + BYTE mbActive; + ULONG mProtocolMask; + ULONG mBroadcastMask; + ULONG mApplicationMask; +}; + +/*=========================================================================*/ +// Struct sScannedNetworkInfo +// Struct to represent scanned network information +/*=========================================================================*/ +struct sScannedNetworkInfo +{ + public: + USHORT mMCC; + USHORT mMNC; + ULONG mInUse; + ULONG mRoaming; + ULONG mForbidden; + ULONG mPreferred; + CHAR mDescription[MAX_SNI_DESCRIPTION_LEN]; +}; + +/*=========================================================================*/ +// Struct sScannedNetworkRATInfo +// Struct to represent scanned network RAT information +/*=========================================================================*/ +struct sScannedNetworkRATInfo +{ + public: + USHORT mMCC; + USHORT mMNC; + ULONG mRAT; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================== +METHOD: + ParseGetANAAAAuthenticationStatus + +DESCRIPTION: + This function gets the AN-AAA authentication status + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pStatus [ O ] - AN-AAA authentication status + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetANAAAAuthenticationStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus ) +{ + // Validate arguments + if (pIn == 0 || pStatus == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sNASGetANAAAAuthenticationStatusResponse_Status * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sNASGetANAAAAuthenticationStatusResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pStatus = pTLVx01->mANAAAAuthenticationStatus; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSignalStrength + +DESCRIPTION: + This function gets the current signal strength (in dBm) as measured by + the device, the signal strength returned will be one of the currently + available technologies with preference CDMA 1xEV-DO, CDMA, AMPS, + WCDMA, GSM + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSignalStrength [ O ] - Received signal strength (dBm) + pRadioInterface [ O ] - Radio interface technology + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSignalStrength( + ULONG inLen, + const BYTE * pIn, + INT8 * pSignalStrength, + ULONG * pRadioInterface ) +{ + // Validate arguments + if (pSignalStrength == 0 || pRadioInterface == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG sigSz = 12; + INT8 sigs[12]; + ULONG radios[12]; + ULONG qcErr = ParseGetSignalStrengths( inLen, + pIn, + &sigSz, + &sigs[0], + &radios[0] ); + if (qcErr != eGOBI_ERR_NONE) + { + return qcErr; + } + + std::map sigMap; + for (ULONG s = 0; s < sigSz; s++) + { + sigMap[radios[s]] = sigs[s]; + } + + std::map ::const_iterator pIter; + + // HDR? + pIter = sigMap.find( 2 ); + if (pIter != sigMap.end()) + { + *pSignalStrength = pIter->second; + *pRadioInterface = pIter->first; + + return eGOBI_ERR_NONE; + } + + // CDMA? + pIter = sigMap.find( 1 ); + if (pIter != sigMap.end()) + { + *pSignalStrength = pIter->second; + *pRadioInterface = pIter->first; + + return eGOBI_ERR_NONE; + } + + // AMPS? + pIter = sigMap.find( 3 ); + if (pIter != sigMap.end()) + { + *pSignalStrength = pIter->second; + *pRadioInterface = pIter->first; + + return eGOBI_ERR_NONE; + } + + // WCDMA? + pIter = sigMap.find( 5 ); + if (pIter != sigMap.end()) + { + *pSignalStrength = pIter->second; + *pRadioInterface = pIter->first; + + return eGOBI_ERR_NONE; + } + + // GSM? + pIter = sigMap.find( 4 ); + if (pIter != sigMap.end()) + { + *pSignalStrength = pIter->second; + *pRadioInterface = pIter->first; + + return eGOBI_ERR_NONE; + } + + // Error values + *pSignalStrength = -128; + *pRadioInterface = 0; + + return eGOBI_ERR_NO_SIGNAL; +} + +/*=========================================================================== +METHOD: + ParseGetSignalStrengths + +DESCRIPTION: + This function gets the current available signal strengths (in dBm) + as measured by the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pArraySizes [I/O] - Upon input the maximum number of elements + that each array can contain can contain. + Upon successful output the actual number + of elements in each array + pSignalStrengths [ O ] - Received signal strength array (dBm) + pRadioInterfaces [ O ] - Radio interface technology array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSignalStrengths( + ULONG inLen, + const BYTE * pIn, + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ) +{ + // Validate arguments + if (pIn == 0 + || pArraySizes == 0 + || *pArraySizes == 0 + || pSignalStrengths == 0 + || pRadioInterfaces == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSignals = (ULONG)*pArraySizes; + + // Assume failure + *pArraySizes = 0; + + // Find the first signal strength value + const sNASGetSignalStrengthResponse_SignalStrength * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sNASGetSignalStrengthResponse_SignalStrength )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Weed out bogus values + std::map sigMap; + + INT8 sigVal = pTLVx01->mSignalStrengthdBm; + ULONG radioVal = pTLVx01->mRadioInterface; + if (sigVal <= -30 && sigVal > -125 && radioVal != 0) + { + sigMap[radioVal] = sigVal; + } + + // Handle list, if present + const sNASGetSignalStrengthResponse_SignalStrengthList * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sNASGetSignalStrengthResponse_SignalStrengthList )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG auxSigs = pTLVx10->mNumberOfInfoInstances; + if (auxSigs > maxSignals) + { + auxSigs = maxSignals; + } + + const sNASGetSignalStrengthResponse_SignalStrengthList::sInfo * pInfo; + + // Verify there is room for the array in the TLV + if (outLenx10 < sizeof( sNASGetSignalStrengthResponse_SignalStrengthList ) + + sizeof( sNASGetSignalStrengthResponse_SignalStrengthList::sInfo ) + * auxSigs) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pInfo = (const sNASGetSignalStrengthResponse_SignalStrengthList::sInfo *) + ((const BYTE *)pTLVx10 + + sizeof( sNASGetSignalStrengthResponse_SignalStrengthList )); + + for (ULONG s = 0; s < auxSigs; s++) + { + sigVal = pInfo->mSignalStrengthdBm; + radioVal = pInfo->mRadioInterface; + if (sigVal <= -30 && sigVal > -125 && radioVal != 0) + { + sigMap[radioVal] = sigVal; + } + + // Move pInfo forward one element + pInfo++; + } + } + + ULONG sigCount = 0; + std::map ::const_iterator pIter; + for (pIter = sigMap.begin(); pIter != sigMap.end(); pIter++, sigCount++) + { + if (sigCount < maxSignals) + { + pSignalStrengths[sigCount] = pIter->second; + pRadioInterfaces[sigCount] = pIter->first; + *pArraySizes = sigCount + 1; + } + } + + // No valid signals? + if (sigCount == 0) + { + return eGOBI_ERR_NO_SIGNAL; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetRFInfo + +DESCRIPTION: + This function gets the current RF information + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pInstanceSize [I/O] - Upon input the maximum number of elements that the + RF info instance array can contain. Upon success + the actual number of elements in the RF info + instance array + pInstances [ O ] - The RF info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetRFInfo( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + // Validate arguments + if (pIn == 0 + || pInstanceSize == 0 + || *pInstanceSize == 0 + || pInstances == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxInstances = *pInstanceSize; + *pInstanceSize = 0; + + // Find the TLV + const sNASGetRFInfoResponse_RFInfo * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sNASGetRFInfoResponse_RFInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + BYTE ifaceCount = pTLVx01->mNumberOfInstances; + if (ifaceCount > maxInstances) + { + ifaceCount = maxInstances; + } + + const sNASGetRFInfoResponse_RFInfo::sInstance * pInstance; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sNASGetRFInfoResponse_RFInfo ) + + sizeof( sNASGetRFInfoResponse_RFInfo::sInstance ) + * ifaceCount) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pInstance = (const sNASGetRFInfoResponse_RFInfo::sInstance *) + ((const BYTE *)pTLVx01 + + sizeof( sNASGetRFInfoResponse_RFInfo )); + + ULONG * pOutput = (ULONG *)pInstances; + for (BYTE i = 0; i < ifaceCount; i++) + { + *pOutput++ = pInstance->mRadioInterface; + *pOutput++ = pInstance->mActiveBandClass; + *pOutput++ = pInstance->mActiveChannel; + + // Move pInstance forward one element + pInstance++; + } + + *pInstanceSize = ifaceCount; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParsePerformNetworkScan + +DESCRIPTION: + This function performs a scan for available networks + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParsePerformNetworkScan( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + // Validate arguments + if (pIn == 0 + || pInstanceSize == 0 + || *pInstanceSize == 0 + || pInstances == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxInstances = *pInstanceSize; + + // Assume failure + *pInstanceSize = 0; + + // Find the TLV + const sNASPerformNetworkScanResponse_NetworkInfo * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sNASPerformNetworkScanResponse_NetworkInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + UINT16 netCount = pTLVx10->mNumberOfInfoInstances; + if (netCount > maxInstances) + { + netCount = maxInstances; + } + + const sNASPerformNetworkScanResponse_NetworkInfo::sNetworkInfo * pNetInfo; + + // Align to the first array element + pNetInfo = (const sNASPerformNetworkScanResponse_NetworkInfo::sNetworkInfo *) + ((const BYTE *)pTLVx10 + + sizeof( sNASPerformNetworkScanResponse_NetworkInfo )); + ULONG offset = sizeof( sNASPerformNetworkScanResponse_NetworkInfo ); + + sScannedNetworkInfo * pNet = (sScannedNetworkInfo *)pInstances; + for (BYTE i = 0; i < netCount; i++) + { + // Check TLV size + if (offset > outLenx10) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + pNet->mMCC = pNetInfo->mMobileCountryCode; + pNet->mMNC = pNetInfo->mMobileNetworkCode; + pNet->mInUse = pNetInfo->mInUseStatus; + pNet->mRoaming = pNetInfo->mRoamingStatus; + pNet->mForbidden = pNetInfo->mForbiddenStatus; + pNet->mPreferred = pNetInfo->mPreferredStatus; + + memset( &pNet->mDescription[0], 0, MAX_SNI_DESCRIPTION_LEN ); + + BYTE descLen = pNetInfo->mDescriptionLength; + if (descLen > 0) + { + // Move pNetInfo forward + pNetInfo++; + offset += sizeof( sNASPerformNetworkScanResponse_NetworkInfo::sNetworkInfo ); + + // Check TLV size + if (offset > outLenx10) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + std::string netDesc( (LPCSTR)pNetInfo ); + + ULONG actualLen = (ULONG)netDesc.size(); + if (actualLen >= MAX_SNI_DESCRIPTION_LEN) + { + actualLen = MAX_SNI_DESCRIPTION_LEN - 1; + } + + LPCSTR pNetDesc = netDesc.c_str(); + memcpy( &pNet->mDescription[0], pNetDesc, actualLen ); + + // Move pNetInfo past string + pNetInfo = (const sNASPerformNetworkScanResponse_NetworkInfo::sNetworkInfo *) + ((const BYTE *)pNetInfo + descLen); + offset += descLen; + } + + pNet++; + } + + *pInstanceSize = (BYTE)netCount; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParsePerformNetworkRATScan + +DESCRIPTION: + This function performs a scan for available networks (includes RAT) + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + pRATSize [I/O] - Upon input the maximum number of elements that the + RAT info instance array can contain. Upon success + the actual number of elements in the RAT info + instance array + pRATInstances [ O ] - The RAT info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParsePerformNetworkRATScan( + ULONG inLen, + const BYTE * pIn, + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ) +{ + // Validate arguments + if (pIn == 0 + || pInstanceSize == 0 + || *pInstanceSize == 0 + || pInstances == 0 + || pRATSize == 0 + || *pRATSize == 0 + || pRATInstances == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxRATInstances = *pRATSize; + + // Assume failure + *pInstanceSize = 0; + *pRATSize = 0; + + // First, generate the instances using ParsePerformNetworkScan + ULONG rc = ParsePerformNetworkScan( inLen, pIn, pInstanceSize, pInstances ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Now find the RAT info too + + // Find the TLV + const sNASPerformNetworkScanResponse_NetworkRAT * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx11 < sizeof( sNASPerformNetworkScanResponse_NetworkRAT )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + UINT16 ratCount = pTLVx11->mNumberOfInfoInstances; + if (ratCount > maxRATInstances) + { + ratCount = maxRATInstances; + } + + const sNASPerformNetworkScanResponse_NetworkRAT::sInfo * pRatInfo; + + // Verify there is room for the array in the TLV + if (outLenx11 < sizeof( sNASPerformNetworkScanResponse_NetworkRAT ) + + sizeof( sNASPerformNetworkScanResponse_NetworkRAT::sInfo ) + * ratCount) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pRatInfo = (const sNASPerformNetworkScanResponse_NetworkRAT::sInfo *) + ((const BYTE *)pTLVx11 + + sizeof( sNASPerformNetworkScanResponse_NetworkRAT )); + + sScannedNetworkRATInfo * pRAT = (sScannedNetworkRATInfo *)pRATInstances; + for (BYTE r = 0; r < ratCount; r++) + { + pRAT->mMCC = pRatInfo->mMobileCountryCode; + pRAT->mMNC = pRatInfo->mMobileNetworkCode; + pRAT->mRAT = pRatInfo->mRadioAccessTechnology; + + pRAT++; + pRatInfo++; + } + + *pRATSize = (BYTE)ratCount; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackInitiateNetworkRegistration + +DESCRIPTION: + This function initiates a network registration + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + regType [ I ] - Registration type + mcc [ I ] - Mobile country code (ignored for auto registration) + mnc [ I ] - Mobile network code (ignored for auto registration) + rat [ I ] - Radio access type (ignored for auto registration) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackInitiateNetworkRegistration( + ULONG * pOutLen, + BYTE * pOut, + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Set the action + + // Check size + WORD tlvx01Sz = sizeof( sNASInitiateNetworkRegisterRequest_Action ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sNASInitiateNetworkRegisterRequest_Action * pTLVx01; + pTLVx01 = (sNASInitiateNetworkRegisterRequest_Action*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mRegisterAction = (eQMINASRegisterActions)regType; + + offset += tlvx01Sz; + + // Set the info + + // Check size + WORD tlvx10Sz = sizeof( sNASInitiateNetworkRegisterRequest_ManualInfo ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset = sizeof( sQMIRawContentHeader ); + + sNASInitiateNetworkRegisterRequest_ManualInfo * pTLVx10; + pTLVx10 = (sNASInitiateNetworkRegisterRequest_ManualInfo*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mMobileCountryCode = mcc; + pTLVx10->mMobileNetworkCode = mnc; + pTLVx10->mRadioAccessTechnology = (eQMINASRadioAccessTechnologies)rat; + + offset += tlvx10Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackInitiateDomainAttach + +DESCRIPTION: + This function initiates a domain attach (or detach) + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + action [ I ] - PS attach action (attach or detach) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackInitiateDomainAttach( + ULONG * pOutLen, + BYTE * pOut, + ULONG action ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx10Sz = sizeof( sNASInitiateAttachRequest_Action ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sNASInitiateAttachRequest_Action * pTLVx10; + pTLVx10 = (sNASInitiateAttachRequest_Action*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mPSAttachAction = (eQMINASPSAttachActions)action; + + offset += tlvx10Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetServingNetwork + +DESCRIPTION: + Gets information regarding the system that currently provides service + to the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pRegistrationState [ O ] - Registration state + pCSDomain [ O ] - Circuit switch domain status + pPSDomain [ O ] - Packet switch domain status + pRAN [ O ] - Radio access network + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. Upon + successful output the actual number of elements + in the radio interface array + pRadioIfaces [ O ] - The radio interface array + pRoaming [ O ] - Roaming indicator (0xFFFFFFFF - Unknown) + pMCC [ O ] - Mobile country code (0xFFFF - Unknown) + pMNC [ O ] - Mobile network code (0xFFFF - Unknown) + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the network name array + can contain + pName [ O ] - The network name or description represented + as a NULL terminated string (empty string + returned when unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetServingNetwork( + ULONG inLen, + const BYTE * pIn, + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ) +{ + // Validate arguments + if (pIn == 0 + || pRegistrationState == 0 + || pCSDomain == 0 + || pPSDomain == 0 + || pRAN == 0 + || pRadioIfacesSize == 0 + || *pRadioIfacesSize == 0 + || pRadioIfaces == 0 + || pRoaming == 0 + || pMCC == 0 + || pMNC == 0 + || nameSize == 0 + || pName == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxRadioIfaces = *pRadioIfacesSize; + + // Assume failure + *pRadioIfacesSize = 0; + *pRoaming = 0xffffffff; + *pMCC = 0xffff; + *pMNC = 0xffff; + *pName = 0; + + // Parse the serving system (mandatory) + + // Find the TLV + const sNASGetServingSystemResponse_ServingSystem * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sNASGetServingSystemResponse_ServingSystem )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Populate the variables + *pRegistrationState = pTLVx01->mRegistrationState; + *pCSDomain = pTLVx01->mCSAttachState; + *pPSDomain = pTLVx01->mPSAttachState; + *pRAN = pTLVx01->mRegisteredNetwork; + + BYTE activeRadioIfaces = pTLVx01->mNumberOfRadioInterfacesInUse; + if (activeRadioIfaces > maxRadioIfaces) + { + activeRadioIfaces = maxRadioIfaces; + } + + const eQMINASRadioInterfaces * pRadioInfo; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sNASGetServingSystemResponse_ServingSystem ) + + sizeof( eQMINASRadioInterfaces ) * activeRadioIfaces) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pRadioInfo = (const eQMINASRadioInterfaces *) + ((const BYTE *)pTLVx01 + + sizeof( sNASGetServingSystemResponse_ServingSystem )); + + ULONG * pOutRadioIfaces = (ULONG *)pRadioIfaces; + for (ULONG r = 0; r < activeRadioIfaces; r++) + { + *pOutRadioIfaces = *pRadioInfo; + pOutRadioIfaces++; + pRadioInfo++; + } + + *pRadioIfacesSize = activeRadioIfaces; + + // Find the roaming indicator (optional) + const sNASGetServingSystemResponse_RoamingIndicator * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sNASGetServingSystemResponse_RoamingIndicator )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Get the values + *pRoaming = (eQMINASRoamingIndicators)pTLVx10->mRoamingIndicator; + } + + // Find the PLMN (optional) + const sNASGetServingSystemResponse_CurrentPLMN * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx12 < sizeof( sNASGetServingSystemResponse_CurrentPLMN )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMCC = pTLVx12->mMobileCountryCode; + *pMNC = pTLVx12->mMobileNetworkCode; + + ULONG descLen = pTLVx12->mDescriptionLength; + const CHAR * pDesc; + + // Verify there is room for the array in the TLV + if (outLenx12 < sizeof( sNASGetServingSystemResponse_CurrentPLMN ) + + sizeof( CHAR ) * descLen) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Space to perform the copy? + if (nameSize < descLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + // Align to the first array element + pDesc = (const CHAR *)((const BYTE *)pTLVx12 + + sizeof( sNASGetServingSystemResponse_CurrentPLMN )); + + memcpy( pName, pDesc, descLen ); + pName[descLen] = 0; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetServingNetworkCapabilities + +DESCRIPTION: + Gets information regarding the data capabilities of the system that + currently provides service to the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pDataCapsSize [I/O] - Upon input the maximum number of elements that the + data capabilities array can contain. Upon success + the actual number of elements in the data + capabilities array + pDataCaps [ O ] - The data capabilities array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetServingNetworkCapabilities( + ULONG inLen, + const BYTE * pIn, + BYTE * pDataCapsSize, + BYTE * pDataCaps ) +{ + // Validate arguments + if (pIn == 0 + || pDataCapsSize == 0 + || *pDataCapsSize == 0 + || pDataCaps == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxDataCaps = *pDataCapsSize; + + // Assume failure + *pDataCapsSize = 0; + + // Find the TLV + const sNASGetServingSystemResponse_DataServices * pTLVx11; + ULONG outLenx11; + ULONG rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx11 < sizeof( sNASGetServingSystemResponse_DataServices )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + BYTE activeDataCaps = pTLVx11->mNumberOfDataCapabilities; + if (activeDataCaps > maxDataCaps) + { + activeDataCaps = maxDataCaps; + } + + const eQMINASDataServiceCapabilities2 * pInDataCaps; + + // Verify there is room for the array in the TLV + if (outLenx11 < sizeof( sNASGetServingSystemResponse_DataServices ) + + sizeof( eQMINASDataServiceCapabilities2 ) * activeDataCaps) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pInDataCaps = (const eQMINASDataServiceCapabilities2 *) + ((const BYTE *)pTLVx11 + + sizeof( sNASGetServingSystemResponse_DataServices )); + + ULONG * pOutDataCaps = (ULONG *)pDataCaps; + for (ULONG d = 0; d < activeDataCaps; d++) + { + *pOutDataCaps = *pInDataCaps; + pOutDataCaps++; + pInDataCaps++; + } + + *pDataCapsSize = activeDataCaps; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetHomeNetwork + +DESCRIPTION: + This function retrieves information about the home network of the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMCC [ O ] - Mobile country code + pMNC [ O ] - Mobile network code + nameSize [ I ] - The maximum number of characters (including NULL + terminator) that the network name array can contain + pName [ O ] - The network name or description represented as a NULL + terminated string (empty string returned when unknown) + pSID [ O ] - Home network system ID (0xFFFF - Unknown) + pNID [ O ] - Home network ID (0xFFFF - Unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetHomeNetwork( + ULONG inLen, + const BYTE * pIn, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ) +{ + // Validate arguments + if (pIn == 0 + || pMCC == 0 + || pMNC == 0 + || nameSize == 0 + || pName == 0 + || pSID == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pName = 0; + *pSID = 0xffff; + *pNID = 0xffff; + + // Find the name (mandatory) + const sNASGetHomeNetworkResponse_HomeNetwork * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sNASGetHomeNetworkResponse_HomeNetwork )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Populate the variables + *pMCC = pTLVx01->mMobileCountryCode; + *pMNC = pTLVx01->mMobileNetworkCode; + + ULONG descLen = pTLVx01->mDescriptionLength; + const CHAR * pDesc; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sNASGetHomeNetworkResponse_HomeNetwork ) + + sizeof( CHAR ) * descLen) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Space to perform the copy? + if (nameSize < descLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + // Align to the first array element + pDesc = (const CHAR *)((const BYTE *)pTLVx01 + + sizeof( sNASGetHomeNetworkResponse_HomeNetwork )); + + memcpy( pName, pDesc, descLen ); + pName[descLen] = 0; + + + // Find the SID/NID (optional) + const sNASGetHomeNetworkResponse_HomeIDs * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sNASGetHomeNetworkResponse_HomeIDs )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSID = pTLVx10->mSystemID; + *pNID = pTLVx10->mNetworkID; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetNetworkPreference + +DESCRIPTION: + This function sets the network registration preference + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + technologyPref [ I ] - Technology preference bitmap + duration [ I ] - Duration of active preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetNetworkPreference( + ULONG * pOutLen, + BYTE * pOut, + ULONG technologyPref, + ULONG duration ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sNASSetTechnologyPreferenceRequest_Preference ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sNASSetTechnologyPreferenceRequest_Preference * pTLVx01; + pTLVx01 = (sNASSetTechnologyPreferenceRequest_Preference*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Copy technology preference WORD as-is + memcpy( &pTLVx01->mValOfTechnology, &technologyPref, 2 ); + + pTLVx01->mDuration = (eQMINASTechPrefDurations)duration; + + offset += tlvx01Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetNetworkPreference + +DESCRIPTION: + This function returns the network registration preference + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pTechnologyPref [ O ] - Technology preference bitmap + pDuration [ O ] - Duration of active preference + pPersistentTechnologyPref [ O ] - Persistent technology preference bitmap + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetNetworkPreference( + ULONG inLen, + const BYTE * pIn, + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ) +{ + // Validate arguments + if (pIn == 0 + || pTechnologyPref == 0 + || pDuration == 0 + || pPersistentTechnologyPref == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the preference (mandatory) + const sNASGetTechnologyPreferenceResponse_ActivePreference * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sNASGetTechnologyPreferenceResponse_ActivePreference )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Copy technology preference WORD as-is + *pTechnologyPref = 0; + memcpy( pTechnologyPref, &pTLVx01->mValOfTechnology, 2 ); + + *pDuration = pTLVx01->mDuration; + + + // Until we know any better the persistent setting is the current setting + *pPersistentTechnologyPref = *pTechnologyPref; + + // Find the persistant technology preference (optional) + const sNASGetTechnologyPreferenceResponse_PersistentPreference * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sNASGetTechnologyPreferenceResponse_PersistentPreference )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Copy technology preference WORD as-is + *pTechnologyPref = 0; + memcpy( pPersistentTechnologyPref, &pTLVx10->mValOfTechnology, 2 ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetCDMANetworkParameters + +DESCRIPTION: + This function sets the desired CDMA network parameters + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - Six digit service programming code + pForceRev0 [ I ] - (Optional) Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ I ] - (Optional) Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ I ] - (Optional) Protocol mask for custom SCP config + pBroadcast [ I ] - (Optional) Broadcast mask for custom SCP config + pApplication [ I ] - (Optional) Application mask for custom SCP config + pRoaming [ I ] - (Optional) Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetCDMANetworkParameters( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // If you specify one of the custom SCP config fields then you must + // specify them all + ULONG scpCount = 0; + if (pCustomSCP != 0) + { + scpCount++; + } + + if (pProtocol != 0) + { + scpCount++; + } + + if (pBroadcast != 0) + { + scpCount++; + } + + if (pApplication != 0) + { + scpCount++; + } + + if (scpCount != 0 && scpCount != 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Rev. 0 and SCP custom config are mutually exclusive + if (pForceRev0 != 0 && scpCount == 4) + { + if (*pForceRev0 != 0 && *pCustomSCP != 0) + { + return eGOBI_ERR_INVALID_ARG; + } + } + + sQMIRawContentHeader * pHeader; + ULONG offset = 0; + + // Need to start with SPC? + if (pForceRev0 != 0 || scpCount == 4) + { + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx10Sz = sizeof( sNASSetNetworkParametersRequest_SPC ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sNASSetNetworkParametersRequest_SPC * pTLVx10; + pTLVx10 = (sNASSetNetworkParametersRequest_SPC*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the values + memcpy( &pTLVx10->mSPC[0], spc.c_str(), spc.size() ); + + offset += tlvx10Sz; + } + + // Force Rev. 0? + if (pForceRev0 != 0) + { + // Check size + WORD tlvx14Sz = sizeof( sNASSetNetworkParametersRequest_CDMA1xEVDORevision ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx14Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x14; + pHeader->mLength = tlvx14Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sNASSetNetworkParametersRequest_CDMA1xEVDORevision * pTLVx14; + pTLVx14 = (sNASSetNetworkParametersRequest_CDMA1xEVDORevision*)(pOut + offset); + memset( pTLVx14, 0, tlvx14Sz ); + + // Set the value + pTLVx14->mForceCDMA1xEVDORev0 = (*pForceRev0 == 0 ? 0 : 1); + + offset += tlvx14Sz; + } + + if (scpCount == 4) + { + // Check size + WORD tlvx15Sz = sizeof( sNASSetNetworkParametersRequest_CDMA1xEVDOSCPCustom ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx15Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x15; + pHeader->mLength = tlvx15Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sNASSetNetworkParametersRequest_CDMA1xEVDOSCPCustom * pTLVx15; + pTLVx15 = (sNASSetNetworkParametersRequest_CDMA1xEVDOSCPCustom*)(pOut + offset); + memset( pTLVx15, 0, tlvx15Sz ); + + // Set the values + pTLVx15->mCDMA1xEVDOSCPCustomConfig = (*pCustomSCP == 0 ? 0 : 1); + + // The pProtocol bitmask + pTLVx15->mSubtype2PhysicalLayer = (*pProtocol & 0x00000001 ? 1 : 0); + pTLVx15->mEnhancedCCMAC = (*pProtocol & 0x00000002 ? 1 : 0); + pTLVx15->mEnhancedACMAC = (*pProtocol & 0x00000004 ? 1 : 0); + pTLVx15->mEnhancedFTCMAC = (*pProtocol & 0x00000008 ? 1 : 0); + pTLVx15->mSubtype3RTCMAC = (*pProtocol & 0x00000010 ? 1 : 0); + pTLVx15->mSubtype1RTCMAC = (*pProtocol & 0x00000020 ? 1 : 0); + pTLVx15->mEnhancedIdle = (*pProtocol & 0x00000040 ? 1 : 0); + pTLVx15->mGenericMultimodeCapableDiscPort + = (*pProtocol & 0x00000080 ? 1 : 0); + + pTLVx15->mGenericBroadcast = (*pBroadcast & 0x00000001 ? 1 : 0); + + pTLVx15->mSNMultiflowPacketApplication + = (*pApplication & 0x00000001 ? 1 : 0); + + pTLVx15->mSNEnhancedMultiflowPacketApplication + = (*pApplication & 0x00000002 ? 1 : 0); + + offset += tlvx15Sz; + } + + if (pRoaming != 0) + { + // Check size + WORD tlvx16Sz = sizeof( sNASSetNetworkParametersRequest_Roaming ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx16Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x16; + pHeader->mLength = tlvx16Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sNASSetNetworkParametersRequest_Roaming * pTLVx16; + pTLVx16 = (sNASSetNetworkParametersRequest_Roaming*)(pOut + offset); + memset( pTLVx16, 0, tlvx16Sz ); + + // Set the values + pTLVx16->mRoamPreference = (eQMINASRoamingPreferences)*pRoaming; + + offset += tlvx16Sz; + } + + // At least one of the optional parameters must have been set + if (offset == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetCDMANetworkParameters + +DESCRIPTION: + This function gets the current CDMA network parameters + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSCI [ O ] - Slot cycle index + pSCM [ O ] - Station class mark + pRegHomeSID [ O ] - Register on home SID? + pRegForeignSID [ O ] - Register on foreign SID? + pRegForeignNID [ O ] - Register on foreign NID? + pForceRev0 [ O ] - Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ O ] - Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ O ] - Protocol mask for custom SCP config + pBroadcast [ O ] - Broadcast mask for custom SCP config + pApplication [ O ] - Application mask for custom SCP config + pRoaming [ O ] - Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetCDMANetworkParameters( + ULONG inLen, + const BYTE * pIn, + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + // Validate arguments + if (pIn == 0 + || pSCI == 0 + || pSCM == 0 + || pRegHomeSID == 0 + || pRegForeignSID == 0 + || pRegForeignNID == 0 + || pForceRev0 == 0 + || pCustomSCP == 0 + || pProtocol == 0 + || pBroadcast == 0 + || pApplication == 0 + || pRoaming == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSCI = 0xff; + *pSCM = 0xff; + *pRegHomeSID = 0xff; + *pRegForeignSID = 0xff; + *pRegForeignNID = 0xff; + *pForceRev0 = 0xff; + *pCustomSCP = 0xff; + *pProtocol = 0xffffffff; + *pBroadcast = 0xffffffff; + *pApplication = 0xffffffff; + *pRoaming = 0xff; + + // Find the SCI + const sNASGetNetworkParametersResponse_SCI * pTLVx11; + ULONG outLenx11; + ULONG rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sNASGetNetworkParametersResponse_SCI )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSCI = pTLVx11->mSlotCycleIndex; + } + + // Find the SCM + const sNASGetNetworkParametersResponse_SCM * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx12 < sizeof( sNASGetNetworkParametersResponse_SCM )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSCM = pTLVx12->mStationClassMark; + } + + // Find the Registration + const sNASGetNetworkParametersResponse_Registration * pTLVx13; + ULONG outLenx13; + rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx13 < sizeof( sNASGetNetworkParametersResponse_Registration )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRegHomeSID = pTLVx13->mRegisterOnHomeSystem; + *pRegForeignSID = pTLVx13->mRegisterOnForeignSystem; + *pRegForeignNID = pTLVx13->mRegisterOnForeignNetwork; + } + + // Rev. 0? + const sNASGetNetworkParametersResponse_CDMA1xEVDORevision * pTLVx14; + ULONG outLenx14; + rc = GetTLV( inLen, pIn, 0x14, &outLenx14, (const BYTE **)&pTLVx14 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx14 < sizeof( sNASGetNetworkParametersResponse_CDMA1xEVDORevision )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRegHomeSID = pTLVx14->mForceCDMA1xEVDORev0; + } + + // We're lazy, so we'll just typecast all the bitmask members from + // sNASGetNetworkParametersResponse_CDMA1xEVDOSCPCustom into their + // respective container parameters + const sEVDOCustomSCPConfig * pTLVx15; + ULONG outLenx15; + rc = GetTLV( inLen, pIn, 0x15, &outLenx15, (const BYTE **)&pTLVx15 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx15 < sizeof( sEVDOCustomSCPConfig )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pCustomSCP = pTLVx15->mbActive; + *pProtocol = pTLVx15->mProtocolMask; + *pBroadcast = pTLVx15->mBroadcastMask; + *pApplication = pTLVx15->mApplicationMask; + } + + // Roaming? + const sNASGetNetworkParametersResponse_Roaming * pTLVx16; + ULONG outLenx16; + rc = GetTLV( inLen, pIn, 0x16, &outLenx16, (const BYTE **)&pTLVx16 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx16 < sizeof( sNASGetNetworkParametersResponse_Roaming )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRoaming = (eQMINASRoamingPreferences)pTLVx16->mRoamPreference; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetACCOLC + +DESCRIPTION: + This function returns the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pACCOLC [ O ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetACCOLC( + ULONG inLen, + const BYTE * pIn, + BYTE * pACCOLC ) +{ + // Validate arguments + if (pIn == 0 || pACCOLC == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the ACCOLC (mandatory) + const sNASGetACCOLCResponse_ACCOLC * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sNASGetACCOLCResponse_ACCOLC )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pACCOLC = pTLVx01->mACCOLC; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetACCOLC + +DESCRIPTION: + This function sets the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + accolc [ I ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetACCOLC( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE accolc ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sNASSetACCOLCRequest_ACCOLC ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sNASSetACCOLCRequest_ACCOLC * pTLVx01; + pTLVx01 = (sNASSetACCOLCRequest_ACCOLC*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + pTLVx01->mACCOLC = accolc; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPLMNMode + +DESCRIPTION: + This function returns the PLMN mode from the CSP + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMode [ O ] - PLMN mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPLMNMode( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode ) +{ + // Validate arguments + if (pIn == 0 || pMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the mode (mandatory) + const sNASGetCSPPLMNModeResponse_Mode * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx10 < sizeof( sNASGetCSPPLMNModeResponse_Mode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMode = pTLVx10->mRestrictManualPLMNSelection; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetPLMNName + +DESCRIPTION: + This function returns PLMN name information for the given MCC/MNC + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + mcc [ I ] - Mobile country code + mnc [ I ] - Mobile network code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetPLMNName( + ULONG * pOutLen, + BYTE * pOut, + USHORT mcc, + USHORT mnc ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sNASGetPLMNNameRequest_PLMN ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sNASGetPLMNNameRequest_PLMN * pTLVx01; + pTLVx01 = (sNASGetPLMNNameRequest_PLMN*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mMobileCountryCode = mcc; + pTLVx01->mMobileNetworkCode = mnc; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPLMNName + +DESCRIPTION: + This function returns PLMN name information for the given MCC/MNC + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pNamesSize [I/O] - Upon input the size in BYTEs of the name structure + array. Upon success the actual number of BYTEs + copied to the name structure array + pNames [ O ] - The name structure array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPLMNName( + ULONG inLen, + const BYTE * pIn, + ULONG * pNamesSize, + BYTE * pNames ) +{ + // Validate arguments + if (pIn == 0 || *pNamesSize == 0 || pNames == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + const BYTE * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // The output format just happens to be the same as + // sNASGetPLMNNameResponse_Name. Copy the full TLV to pNames + if (outLenx10 > *pNamesSize) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pNames, pTLVx10, outLenx10 ); + *pNamesSize = outLenx10; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationOMA.cpp b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationOMA.cpp new file mode 100755 index 0000000..f75192f --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationOMA.cpp @@ -0,0 +1,481 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationOMA.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (OMADM Service) + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + PackOMADMStartSession + +DESCRIPTION: + This function starts an OMA-DM session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + sessionType [ I ] - Type of session to initiate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackOMADMStartSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG sessionType ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add sessionType + + // Check size + WORD tlvx10Sz = sizeof( sOMAStartSessionRequest_Type ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sOMAStartSessionRequest_Type * pTLVx10; + pTLVx10 = (sOMAStartSessionRequest_Type*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mSessionType = (eQMIOMASessionTypes)sessionType; + + offset += tlvx10Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseOMADMGetSessionInfo + +DESCRIPTION: + This function returns information related to the current (or previous + if no session is active) OMA-DM session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSessionState [ O ] - State of session + pSessionType [ O ] - Type of session + pFailureReason [ O ] - Session failure reason (when state indicates failure) + pRetryCount [ O ] - Session retry count (when state indicates retrying) + pSessionPause [ O ] - Session pause timer (when state indicates retrying) + pTimeRemaining [ O ] - Pause time remaining (when state indicates retrying) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseOMADMGetSessionInfo( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ) +{ + // Validate arguments + if (pIn == 0 || pSessionState == 0 || pSessionType == 0 + || pFailureReason == 0 || pRetryCount == 0 || pSessionPause == 0 + || pTimeRemaining == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the first TLV + const sOMAGetSessionInfoResponse_Info * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sOMAGetSessionInfoResponse_Info )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSessionState = pTLVx10->mSessionState; + *pSessionType = pTLVx10->mSessionType; + + // Find the second TLV + const sOMAGetSessionInfoResponse_Failure * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx11 < sizeof( sOMAGetSessionInfoResponse_Failure )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pFailureReason = pTLVx11->mSessionFailure; + + // Find the third TLV + const sOMAGetSessionInfoResponse_Retry * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx12 < sizeof( sOMAGetSessionInfoResponse_Retry )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRetryCount = pTLVx12->mRetryCount; + *pSessionPause = pTLVx12->mRetryPauseTimer; + *pTimeRemaining = pTLVx12->mRemainingTime; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseOMADMGetPendingNIA + +DESCRIPTION: + This function returns information about the pending network initiated + alert + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSessionType [ O ] - Type of session + pSessionID [ O ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseOMADMGetPendingNIA( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionType, + USHORT * pSessionID ) +{ + // Validate arguments + if (pIn == 0 || pSessionType == 0 || pSessionID == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sOMAGetSessionInfoResponse_NIA * pTLVx13; + ULONG outLenx13; + ULONG rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx13 < sizeof( sOMAGetSessionInfoResponse_NIA )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSessionID = pTLVx13->mSessionID; + *pSessionType = pTLVx13->mSessionType; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackOMADMSendSelection + +DESCRIPTION: + This function sends the specified OMA-DM selection for the current + network initiated session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + selection [ I ] - Selection + sessionID [ I ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackOMADMSendSelection( + ULONG * pOutLen, + BYTE * pOut, + ULONG selection, + USHORT sessionID ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add selection and session ID + + // Check size + WORD tlvx10Sz = sizeof( sOMASendSelectionRequest_Type ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sOMASendSelectionRequest_Type * pTLVx10; + pTLVx10 = (sOMASendSelectionRequest_Type*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the values + pTLVx10->mSelection = (eQMIOMASelections)selection; + pTLVx10->mSessionID = sessionID; + + offset += tlvx10Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseOMADMGetFeatureSettings + +DESCRIPTION: + This function returns the OMA-DM feature settings + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pbProvisioning [ O ] - Device provisioning service update enabled + pbPRLUpdate [ O ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseOMADMGetFeatureSettings( + ULONG inLen, + const BYTE * pIn, + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ) +{ + // Validate arguments + if (pIn == 0 || pbProvisioning == 0 || pbPRLUpdate == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the first TLV + const sOMAGetFeaturesResponse_Provisioning * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sOMAGetFeaturesResponse_Provisioning )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbProvisioning = pTLVx10->mDeviceProvisioningServiceUpdateEnabled; + + // Find the second TLV + const sOMAGetFeaturesResponse_PRLUpdate * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sOMAGetFeaturesResponse_PRLUpdate )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbPRLUpdate = pTLVx11->mPRLServiceUpdateEnabled; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackOMADMSetProvisioningFeature + +DESCRIPTION: + This function sets the OMA-DM device provisioning service + update feature setting + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + bProvisioning [ I ] - Device provisioning service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackOMADMSetProvisioningFeature( + ULONG * pOutLen, + BYTE * pOut, + ULONG bProvisioning ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add bProvisioning + + // Check size + WORD tlvx10Sz = sizeof( sOMASetFeaturesRequest_Provisioning ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sOMASetFeaturesRequest_Provisioning * pTLVx10; + pTLVx10 = (sOMASetFeaturesRequest_Provisioning*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mDeviceProvisioningServiceUpdateEnabled = (INT8)bProvisioning; + + offset += tlvx10Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackOMADMSetPRLUpdateFeature + +DESCRIPTION: + This function sets the OMA-DM PRL service update feature setting + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + bPRLUpdate [ I ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackOMADMSetPRLUpdateFeature( + ULONG * pOutLen, + BYTE * pOut, + ULONG bPRLUpdate ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add bPRLUpdate + + // Check size + WORD tlvx11Sz = sizeof( sOMASetFeaturesRequest_PRLUpdate ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sOMASetFeaturesRequest_PRLUpdate * pTLVx11; + pTLVx11 = (sOMASetFeaturesRequest_PRLUpdate*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Set the value + pTLVx11->mPRLServiceUpdateEnabled = (INT8)bPRLUpdate; + + offset += tlvx11Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationPDS.cpp b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationPDS.cpp new file mode 100755 index 0000000..da52e64 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationPDS.cpp @@ -0,0 +1,1207 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationPDS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (Position Determination Service) + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + PackResetPDSData + +DESCRIPTION: + This function resets the specified PDS data + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pGPSDataMask [ I ] - Bitmask of GPS data to clear (optional) + pCellDataMask [ I ] - Bitmask of cell data to clear (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackResetPDSData( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pGPSDataMask, + ULONG * pCellDataMask ) +{ + // Validate arguments (at least one mask must be present) + if (pOut == 0 || (pGPSDataMask == 0 && pCellDataMask == 0)) + { + return eGOBI_ERR_INVALID_ARG; + } + + sQMIRawContentHeader * pHeader; + ULONG offset = 0; + + // Optionally add pGPSDataMask + if (pGPSDataMask != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sPDSResetPDSDataRequest_GPSData ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + offset += sizeof( sQMIRawContentHeader ); + + sPDSResetPDSDataRequest_GPSData * pTLVx10; + pTLVx10 = (sPDSResetPDSDataRequest_GPSData*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Typecast the input over the bitmask + *(ULONG *)pTLVx10 = *pGPSDataMask; + offset += tlvx10Sz; + } + + // Optionally add pCellDataMask + if (pCellDataMask != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sPDSResetPDSDataRequest_CellData ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + offset += sizeof( sQMIRawContentHeader ); + + sPDSResetPDSDataRequest_CellData * pTLVx11; + pTLVx11 = (sPDSResetPDSDataRequest_CellData*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Typecast the input over the bitmask + *(ULONG *)pTLVx11 = *pCellDataMask; + offset += tlvx11Sz; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetPortAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + bAuto [ I ] - Enable automatic tracking for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetPortAutomaticTracking( + ULONG * pOutLen, + BYTE * pOut, + ULONG bAuto ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add bAuto + + // Check size + WORD tlvx01Sz = sizeof( sPDSSetCOMPortAutoTrackingConfigRequest_Config ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetCOMPortAutoTrackingConfigRequest_Config * pTLVx01; + pTLVx01 = (sPDSSetCOMPortAutoTrackingConfigRequest_Config*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mAutoTrackingEnabled = (bAuto == 0 ? 0 : 1); + + offset += tlvx01Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPortAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pbAuto [ O ] - Automatic tracking enabled for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPortAutomaticTracking( + ULONG inLen, + const BYTE * pIn, + ULONG * pbAuto ) +{ + // Validate arguments + if (pIn == 0 || pbAuto == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find pbAuto + const sPDSGetCOMPortAutoTrackingConfigResponse_Config * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sPDSGetCOMPortAutoTrackingConfigResponse_Config )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbAuto = pTLVx01->mAutoTrackingEnabled; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetServiceAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking state for the service + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pbAuto [ I ] - Start automatic tracking session for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetServiceAutomaticTracking( + ULONG * pOutLen, + BYTE * pOut, + ULONG bAuto ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add bAuto + + // Check size + WORD tlvx01Sz = sizeof( sPDSSetServiceAutoTrackingStateRequest_State ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetServiceAutoTrackingStateRequest_State * pTLVx01; + pTLVx01 = (sPDSSetServiceAutoTrackingStateRequest_State*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mAutoTrackingEnabled = (bAuto == 0 ? 0 : 1); + + offset += tlvx01Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} +/*=========================================================================== +METHOD: + ParseGetServiceAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking state for the service + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pbAuto [ O ] - Automatic tracking session started for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetServiceAutomaticTracking( + ULONG inLen, + const BYTE * pIn, + ULONG * pbAuto ) +{ + // Validate arguments + if (pIn == 0 || pbAuto == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find pbAuto + const sPDSGetServiceAutoTrackingStateResponse_State * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sPDSGetServiceAutoTrackingStateResponse_State )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbAuto = pTLVx01->mAutoTrackingEnabled; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetAGPSConfig + +DESCRIPTION: + This function sets the PDS AGPS configuration + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + serverAddress [ I ] - IPv4 address of AGPS server + serverPort [ I ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetAGPSConfig( + ULONG * pOutLen, + BYTE * pOut, + ULONG serverAddress, + ULONG serverPort ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx10Sz = sizeof( sPDSSetAGPSConfigRequest_Server ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetAGPSConfigRequest_Server * pTLVx10; + pTLVx10 = (sPDSSetAGPSConfigRequest_Server*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + ULONG ip0 = (serverAddress & 0x000000FF); + ULONG ip1 = (serverAddress & 0x0000FF00) >> 8; + ULONG ip2 = (serverAddress & 0x00FF0000) >> 16; + ULONG ip3 = (serverAddress & 0xFF000000) >> 24; + + // Set the values + pTLVx10->mServerAddress[0] = (INT8)ip0; + pTLVx10->mServerAddress[1] = (INT8)ip1; + pTLVx10->mServerAddress[2] = (INT8)ip2; + pTLVx10->mServerAddress[3] = (INT8)ip3; + pTLVx10->mServerPort = serverPort; + + offset += tlvx10Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetAGPSConfig + +DESCRIPTION: + This function returns the PDS AGPS configuration + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pServerAddress [ O ] - IPv4 address of AGPS server + pServerPort [ O ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetAGPSConfig( + ULONG inLen, + const BYTE * pIn, + ULONG * pServerAddress, + ULONG * pServerPort ) +{ + // Validate arguments + if (pIn == 0 || pServerAddress == 0 || pServerPort == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find arguments + const sPDSGetAGPSConfigResponse_ServerAddress * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sPDSGetAGPSConfigResponse_ServerAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pServerPort = pTLVx01->mServerPort; + + ULONG ip0 = (ULONG)pTLVx01->mServerAddress[0]; + ULONG ip1 = (ULONG)pTLVx01->mServerAddress[1] << 8; + ULONG ip2 = (ULONG)pTLVx01->mServerAddress[2] << 16; + ULONG ip3 = (ULONG)pTLVx01->mServerAddress[3] << 24; + *pServerAddress = (ip0 | ip1 | ip2 | ip3); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetXTRATimeState + +DESCRIPTION: + This function sets the XTRA time positioning state + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + state [ I ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetXTRATimeState( + ULONG * pOutLen, + BYTE * pOut, + ULONG state ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add state + + // Check size + WORD tlvx10Sz = sizeof( sPDSSetPositionMethodsStateRequest_XTRATime ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetPositionMethodsStateRequest_XTRATime * pTLVx10; + pTLVx10 = (sPDSSetPositionMethodsStateRequest_XTRATime*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mMethodState = (eQMIPDSMethodStates)state; + + offset += tlvx10Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetXTRATimeState + +DESCRIPTION: + This function returns the XTRA time positioning state + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pState [ O ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetXTRATimeState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ) +{ + // Validate arguments + if (pIn == 0 || pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find pState + const sPDSGetPositionMethodsStateResponse_XTRATime * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sPDSGetPositionMethodsStateResponse_XTRATime )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pState = pTLVx10->mMethodState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetXTRADataState + +DESCRIPTION: + This function sets the XTRA data positioning state + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + state [ I ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetXTRADataState( + ULONG * pOutLen, + BYTE * pOut, + ULONG state ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add state + + // Check size + WORD tlvx10Sz = sizeof( sPDSSetPositionMethodsStateRequest_XTRAData ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetPositionMethodsStateRequest_XTRAData * pTLVx10; + pTLVx10 = (sPDSSetPositionMethodsStateRequest_XTRAData*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mMethodState = (eQMIPDSMethodStates)state; + + offset += tlvx10Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetXTRADataState + +DESCRIPTION: + This function returns the XTRA data positioning state + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pState [ O ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetXTRADataState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ) +{ + // Validate arguments + if (pIn == 0 || pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find pState + const sPDSGetPositionMethodsStateResponse_XTRAData * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sPDSGetPositionMethodsStateResponse_XTRAData )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pState = pTLVx10->mMethodState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetXTRAValidity + +DESCRIPTION: + This function returns the XTRA database validity period + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pGPSWeek [ O ] - Starting GPS week of validity period + pGPSWeekOffset [ O ] - Starting GPS week offset (minutes) of validity period + pDuration [ O ] - Length of validity period (hours) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetXTRAValidity( + ULONG inLen, + const BYTE * pIn, + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ) +{ + // Validate arguments + if (pIn == 0 || pGPSWeek == 0 || pGPSWeekOffset == 0 || pDuration == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find arguments + const sPDSGetXTRAParametersResponse_Validity * pTLVx13; + ULONG outLenx13; + ULONG rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx13 < sizeof( sPDSGetXTRAParametersResponse_Validity )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pDuration = pTLVx13->mValidPeriodDurationInHours; + *pGPSWeek = pTLVx13->mValidPeriodGPSStartWeek; + *pGPSWeekOffset = pTLVx13->mValidPeriodGPSStartWeekOffsetInMinutes; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetXTRANetwork + +DESCRIPTION: + This function sets the XTRA WWAN network preference + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + preference [ I ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetXTRANetwork( + ULONG * pOutLen, + BYTE * pOut, + ULONG preference ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add preference + + // Check size + WORD tlvx12Sz = sizeof( sPDSSetXTRAParametersRequest_Network ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx12Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x12; + pHeader->mLength = tlvx12Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetXTRAParametersRequest_Network * pTLVx12; + pTLVx12 = (sPDSSetXTRAParametersRequest_Network*)(pOut + offset); + memset( pTLVx12, 0, tlvx12Sz ); + + // Set the value + pTLVx12->mWWANNetworkPreference = (eQMIPDSWWANNetworkPreferences)preference; + + offset += tlvx12Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetXTRANetwork + +DESCRIPTION: + This function returns the XTRA WWAN network preference + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pPreference [ O ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetXTRANetwork( + ULONG inLen, + const BYTE * pIn, + ULONG * pPreference ) +{ + // Validate arguments + if (pIn == 0 || pPreference == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find pPreference + const sPDSGetXTRAParametersResponse_Network * pTLVx12; + ULONG outLenx12; + ULONG rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx12 < sizeof( sPDSGetXTRAParametersResponse_Network )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pPreference = pTLVx12->mWWANNetworkPreference; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetXTRAAutomaticDownload + +DESCRIPTION: + This function sets the XTRA automatic download configuration + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + bEnabled [ I ] - Automatic download enabled? + interval [ I ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetXTRAAutomaticDownload( + ULONG * pOutLen, + BYTE * pOut, + ULONG bEnabled, + USHORT interval ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx10Sz = sizeof( sPDSSetXTRAParametersRequest_Automatic ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetXTRAParametersRequest_Automatic * pTLVx10; + pTLVx10 = (sPDSSetXTRAParametersRequest_Automatic*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mAutomaticDownloadEnabled = (bEnabled == 0 ? 0 : 1); + pTLVx10->mDownloadIntervalInHours = interval; + + offset += tlvx10Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetXTRAAutomaticDownload + +DESCRIPTION: + This function returns the XTRA automatic download configuration + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pbEnabled [ O ] - Automatic download enabled? + pInterval [ O ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetXTRAAutomaticDownload( + ULONG inLen, + const BYTE * pIn, + ULONG * pbEnabled, + USHORT * pInterval ) +{ + // Validate arguments + if (pIn == 0 || pbEnabled == 0 || pInterval == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find arguments + const sPDSGetXTRAParametersResponse_Automatic * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sPDSGetXTRAParametersResponse_Automatic )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbEnabled = pTLVx10->mAutomaticDownloadEnabled; + *pInterval = pTLVx10->mDownloadIntervalInHours; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPDSState + +DESCRIPTION: + This function returns the current PDS state + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pEnabled [ O ] - Current PDS state (0 = disabled) + pTracking [ O ] - Current PDS tracking session state + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPDSState( + ULONG inLen, + const BYTE * pIn, + ULONG * pEnabled, + ULONG * pTracking ) +{ + // Validate arguments + if (pIn == 0 || pEnabled == 0 || pTracking == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find arguments + const sPDSGetServiceStateResponse_State * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sPDSGetServiceStateResponse_State )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pEnabled = pTLVx01->mServiceEnabled; + *pTracking = pTLVx01->mTrackingSessionState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetPDSState + +DESCRIPTION: + This function sets the PDS state + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + enable [ I ] - Desired PDS state (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetPDSState( + ULONG * pOutLen, + BYTE * pOut, + ULONG enable ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add enable + + // Check size + WORD tlvx01Sz = sizeof( sPDSSetServiceStateRequest_State ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetServiceStateRequest_State * pTLVx01; + pTLVx01 = (sPDSSetServiceStateRequest_State*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mServiceEnabled = (enable == 0 ? 0 : 1); + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackPDSInjectTimeReference + +DESCRIPTION: + This function injects a system time into the PDS engine + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + sysTime [ I ] - System time + sysDiscontinuities [ I ] - Number of system time discontinuities + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackPDSInjectTimeReference( + ULONG * pOutLen, + BYTE * pOut, + ULONGLONG systemTime, + USHORT systemDiscontinuities ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx01Sz = sizeof( sPDSInjectTimeReferenceRequest_Time ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSInjectTimeReferenceRequest_Time * pTLVx01; + pTLVx01 = (sPDSInjectTimeReferenceRequest_Time*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mSystemTimeMilliseconds = systemTime; + pTLVx01->mSystemDiscontinuties = systemDiscontinuities; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPDSDefaults + +DESCRIPTION: + This function returns the default tracking session configuration + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOperation [ O ] - Current session operating mode + pTimeout [ O ] - Maximum amount of time (seconds) to work on each fix + pInterval [ O ] - Interval (milliseconds) between fix requests + pAccuracy [ O ] - Current accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPDSDefaults( + ULONG inLen, + const BYTE * pIn, + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ) +{ + // Validate arguments + if (pIn == 0 || pOperation == 0 || pTimeout == 0 + || pInterval == 0 || pAccuracy == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find arguments + const sPDSGetDefaultsResponse_Defaults * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sPDSGetDefaultsResponse_Defaults )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pOperation = pTLVx01->mSessionOperation; + *pTimeout = pTLVx01->mTimeoutSeconds; + *pInterval = pTLVx01->mFixRequestIntervalSeconds; + *pAccuracy = pTLVx01->mDesiredAccuracyMeters; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetPDSDefaults + +DESCRIPTION: + This function sets the default tracking session configuration + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + operation [ I ] - Desired session operating mode + timeout [ I ] - Maximum amount of time (seconds) to work on each fix + interval [ I ] - Interval (milliseconds) between fix requests + accuracy [ I ] - Desired accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetPDSDefaults( + ULONG * pOutLen, + BYTE * pOut, + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + + // Check size + WORD tlvx01Sz = sizeof( sPDSSetDefaultsRequest_Defaults ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sPDSSetDefaultsRequest_Defaults * pTLVx01; + pTLVx01 = (sPDSSetDefaultsRequest_Defaults*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mDesiredAccuracyMeters = accuracy; + pTLVx01->mFixRequestIntervalSeconds = interval; + pTLVx01->mSessionOperation = (eQMIPDSOperationTypes)operation; + pTLVx01->mTimeoutSeconds = timeout; + + offset += tlvx01Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationRMS.cpp b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationRMS.cpp new file mode 100755 index 0000000..433dcd9 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationRMS.cpp @@ -0,0 +1,188 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationRMS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (Remote Management Service) + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + ParseGetSMSWake + +DESCRIPTION: + This function queries the state of the SMS wake functionality + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pbEnabled [ O ] - SMS wake functionality enabled? + pWakeMask [ O ] - SMS wake mask (only relevant when enabled) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSMSWake( + ULONG inLen, + const BYTE * pIn, + ULONG * pbEnabled, + ULONG * pWakeMask ) +{ + // Validate arguments + if (pIn == 0 || pbEnabled == 0 || pWakeMask == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the first TLV + const sRMSGetSMSWakeResponse_State * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sRMSGetSMSWakeResponse_State )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Find the second TLV + const sRMSGetSMSWakeRequest_Mask * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx11 < sizeof( sRMSGetSMSWakeRequest_Mask )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbEnabled = pTLVx10->mSMSWakeEnabled; + *pWakeMask = pTLVx11->mMask; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetSMSWake + +DESCRIPTION: + This function enables/disables the SMS wake functionality + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + bEnable [ I ] - Enable SMS wake functionality? + wakeMask [ I ] - SMS wake mask (only relevant when enabling) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetSMSWake( + ULONG * pOutLen, + BYTE * pOut, + ULONG bEnable, + ULONG wakeMask ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add bEnable + + // Check size + WORD tlvx10Sz = sizeof( sRMSSetSMSWakeRequest_State ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sRMSSetSMSWakeRequest_State * pTLVx10; + pTLVx10 = (sRMSSetSMSWakeRequest_State*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mSMSWakeEnabled = (INT8)bEnable; + + offset += tlvx10Sz; + + // Add wakeMask if enabled + if (bEnable != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sRMSSetSMSWakeRequest_Mask ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sRMSSetSMSWakeRequest_Mask * pTLVx11; + pTLVx11 = (sRMSSetSMSWakeRequest_Mask*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Set the value + pTLVx11->mMask = wakeMask; + + offset += tlvx11Sz; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationUIM.cpp b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationUIM.cpp new file mode 100755 index 0000000..ef50831 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationUIM.cpp @@ -0,0 +1,1170 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationUIM.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (DMS_UIM Service) + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + ParseUIMUnblockControlKey + +DESCRIPTION: + This function unblocks the specified facility control key + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMUnblockControlKey( + ULONG inLen, + const BYTE * pIn, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMUnblockControlKeyResponse_Status * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMUnblockControlKeyResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pUnblockRetriesLeft = pTLVx10->mRemainingUnblockRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMUnblockControlKey + +DESCRIPTION: + This function unblocks the specified facility control key + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - Facility ID + pValue [ I ] - Control key de-personalization string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMUnblockControlKey( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pValue ) +{ + // Validate arguments + if (pOut == 0 + || pValue == 0 + || pValue[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string val( pValue ); + UINT8 valSz = (UINT8)val.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMUnblockControlKeyRequest_Facility ) + valSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSUIMUnblockControlKeyRequest_Facility * pTLVx01; + pTLVx01 = (sDMSUIMUnblockControlKeyRequest_Facility*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mFacility = (eQMIDMSUIMFacility)id; + pTLVx01->mControlKeyLength = valSz; + + offset += sizeof( sDMSUIMUnblockControlKeyRequest_Facility ); + + memcpy( (pOut + offset), (LPCSTR)val.c_str(), valSz ); + offset += valSz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMSetControlKeyProtection + +DESCRIPTION: + This function changes the specified facility control key + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + control key will be blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMSetControlKeyProtection( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pVerifyRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMSetControlKeyProtectionResponse_Status * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMSetControlKeyProtectionResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx10->mRemainingVerifyRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMSetControlKeyProtection + +DESCRIPTION: + This function changes the specified facility control key + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - Facility ID + status [ I ] - Control key status + pValue [ I ] - Control key de-personalization string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMSetControlKeyProtection( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + ULONG status, + CHAR * pValue ) +{ + // Validate arguments + if (pOut == 0 + || pValue == 0 + || pValue[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string val( pValue ); + UINT8 valSz = (UINT8)val.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMSetControlKeyProtectionRequest_Facility ) + valSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSUIMSetControlKeyProtectionRequest_Facility * pTLVx01; + pTLVx01 = (sDMSUIMSetControlKeyProtectionRequest_Facility*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mFacility = (eQMIDMSUIMFacility)id; + pTLVx01->mFacilityState = (eQMIDMSUIMFacilityStates)status; + pTLVx01->mControlKeyLength = (UINT8)valSz; + + offset += sizeof( sDMSUIMSetControlKeyProtectionRequest_Facility ); + + memcpy( (pOut + offset), val.c_str(), valSz ); + offset += valSz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMGetControlKeyBlockingStatus + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + pbBlocking [ O ] - (Optional) Is the facility blocking? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMGetControlKeyBlockingStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ) +{ + // Validate arguments + if (pIn == 0 + || pStatus == 0 + || pVerifyRetriesLeft == 0 + || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the first arguments + const sDMSUIMGetControlKeyStatusResponse_Status * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sDMSUIMGetControlKeyStatusResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx01->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx01->mRemainingUnblockRetries; + *pStatus = pTLVx01->mFacilityState; + + // Find the last (optional) argument + if (pbBlocking != 0) + { + const sDMSUIMGetControlKeyStatusResponse_Blocking * pTLVx10; + ULONG tlvLenx10; + rc = GetTLV( inLen, pIn, 0x10, &tlvLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (tlvLenx10 < sizeof( sDMSUIMGetControlKeyStatusResponse_Blocking )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pbBlocking = pTLVx10->mOperationBlocking; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMGetControlKeyBlockingStatus + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - Facility ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMGetControlKeyBlockingStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG id ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add id + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMGetControlKeyStatusRequest_Facility ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSUIMGetControlKeyStatusRequest_Facility * pTLVx01; + pTLVx01 = (sDMSUIMGetControlKeyStatusRequest_Facility*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mFacility = (eQMIDMSUIMFacility)id; + + offset += tlvx01Sz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMGetControlKeyStatus + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMGetControlKeyStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 + || pStatus == 0 + || pVerifyRetriesLeft == 0 + || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the arguments + const sDMSUIMGetControlKeyStatusResponse_Status * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sDMSUIMGetControlKeyStatusResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx01->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx01->mRemainingUnblockRetries; + *pStatus = pTLVx01->mFacilityState; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMGetControlKeyStatus + +DESCRIPTION: + This function requests the status of the specified facility control key + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - Facility ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMGetControlKeyStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG id ) +{ + // Request is the same as PackUIMGetControlKeyBlockingStatus + return PackUIMGetControlKeyBlockingStatus( pOutLen, + pOut, + id ); +} + +/*=========================================================================== +METHOD: + ParseUIMGetICCID + +DESCRIPTION: + This function returns the UIM ICCID + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMGetICCID( + ULONG inLen, + const BYTE * pIn, + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (pIn == 0 || stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMGetICCIDResponse_ICCID * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sDMSUIMGetICCIDResponse_ICCID )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // The TLV only contains the string + + // Space to perform the copy? + if (stringSize < outLenx01 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pString, (const CHAR*)pTLVx01, outLenx01 ); + pString[outLenx01] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMGetPINStatus + +DESCRIPTION: + This function returns the status of the pin + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + id [ I ] - PIN ID (1/2) + pStatus [ O ] - PIN status (0xFFFFFFFF = unknown) + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMGetPINStatus( + ULONG inLen, + const BYTE * pIn, + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 + || id < 1 + || id > 2 + || pStatus == 0 + || pVerifyRetriesLeft == 0 + || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG tlvLen; + + // The typeID is either 0x11 or 0x12 + if (id == 1) + { + const sDMSUIMGetPINStatusResponse_PIN1Status * pTLV11; + ULONG rc = GetTLV( inLen, pIn, 0x11, &tlvLen, (const BYTE **)&pTLV11 ); + + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (tlvLen < sizeof( sDMSUIMGetPINStatusResponse_PIN1Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLV11->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLV11->mRemainingUnblockRetries; + *pStatus = pTLV11->mPINStatus; + } + else if (id == 2) + { + const sDMSUIMGetPINStatusResponse_PIN2Status * pTLV12; + ULONG rc = GetTLV( inLen, pIn, 0x12, &tlvLen, (const BYTE **)&pTLV12 ); + + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (tlvLen < sizeof( sDMSUIMGetPINStatusResponse_PIN2Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLV12->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLV12->mRemainingUnblockRetries; + *pStatus = pTLV12->mPINStatus; + } + else + { + return eGOBI_ERR_INVALID_ARG; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMChangePIN + +DESCRIPTION: + This function changes the PIN value + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMChangePIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pVerifyRetriesLeft == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMChangePINResponse_RetryInfo * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMChangePINResponse_RetryInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx10->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx10->mRemainingUnblockRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMChangePIN + +DESCRIPTION: + This function changes the PIN value + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - PIN ID (1/2) + pOldValue [ I ] - Old PIN value of the PIN to change + pNewValue [ I ] - New PIN value of the PIN to change + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMChangePIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue ) +{ + // Validate arguments + if (pOut == 0 + || id < 1 + || id > 2 + || pOldValue == 0 + || pOldValue[0] == 0 + || pNewValue == 0 + || pNewValue[0] == 0 ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string oldVal( pOldValue ); + ULONG oldValSz = (ULONG)oldVal.size(); + std::string newVal( pNewValue ); + ULONG newValSz = (ULONG)newVal.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMChangePINRequest_Info ) + + (WORD)oldValSz + (WORD)newValSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // First part of the TLV + sDMSUIMChangePINRequest_Info1 * pTLVx01_1; + pTLVx01_1 = (sDMSUIMChangePINRequest_Info1*)(pOut + offset); + memset( pTLVx01_1, 0, tlvx01Sz ); + + pTLVx01_1->mPINID = (UINT8)id; + pTLVx01_1->mOldPINLength = (UINT8)oldValSz; + offset += sizeof( sDMSUIMChangePINRequest_Info1 ); + + // mOldPINValue string + memcpy( (pOut + offset), oldVal.c_str(), oldValSz ); + offset += oldValSz; + + // Second part of the TLV + sDMSUIMChangePINRequest_Info2 * pTLVx01_2; + pTLVx01_2 = (sDMSUIMChangePINRequest_Info2*)(pOut + offset); + + pTLVx01_2->mNewPINLength = (UINT8)newValSz; + offset += sizeof( sDMSUIMChangePINRequest_Info2 ); + + // mNewPINValue string + memcpy( (pOut + offset), newVal.c_str(), newValSz ); + offset += newValSz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMUnblockPIN + +DESCRIPTION: + This function unblocks a blocked PIN + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMUnblockPIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pVerifyRetriesLeft == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMUnblockPINResponse_RetryInfo * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMUnblockPINResponse_RetryInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx10->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx10->mRemainingUnblockRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMUnblockPIN + +DESCRIPTION: + This function unblocks a blocked PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pPUKValue [ I ] - PUK value of the PIN to unblock + pNewValue [ I ] - New PIN value of the PIN to unblock + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMUnblockPIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pPUKValue, + CHAR * pNewValue ) +{ + // Validate arguments + if (pOut == 0 + || id < 1 + || id > 2 + || pPUKValue == 0 + || pPUKValue[0] == 0 + || pNewValue == 0 + || pNewValue[0] == 0 ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string oldVal( pPUKValue ); + ULONG oldValSz = (ULONG)oldVal.size(); + std::string newVal( pNewValue ); + ULONG newValSz = (ULONG)newVal.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMUnblockPINRequest_Info ) + + (WORD)oldValSz + (WORD)newValSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // First part of the TLV + sDMSUIMUnblockPINRequest_Info1 * pTLVx01_1; + pTLVx01_1 = (sDMSUIMUnblockPINRequest_Info1*)(pOut + offset); + memset( pTLVx01_1, 0, tlvx01Sz ); + + pTLVx01_1->mPINID = (UINT8)id; + pTLVx01_1->mPUKLength = (UINT8)oldValSz; + offset += sizeof( sDMSUIMUnblockPINRequest_Info1 ); + + // mPUKValue string + memcpy( (pOut + offset), oldVal.c_str(), oldValSz ); + offset += oldValSz; + + // Second part of the TLV + sDMSUIMUnblockPINRequest_Info2 * pTLVx01_2; + pTLVx01_2 = (sDMSUIMUnblockPINRequest_Info2*)(pOut + offset); + + pTLVx01_2->mNewPINLength = (UINT8)newValSz; + offset += sizeof( sDMSUIMUnblockPINRequest_Info2 ); + + // mNewPINValue string + memcpy( (pOut + offset), newVal.c_str(), newValSz ); + offset += newValSz; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMVerifyPIN + +DESCRIPTION: + This function verifies the PIN before accessing the UIM contents + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMVerifyPIN( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pVerifyRetriesLeft == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMVerifyPINResponse_RetryInfo * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMVerifyPINResponse_RetryInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx10->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx10->mRemainingUnblockRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMVerifyPIN + +DESCRIPTION: + This function verifies the PIN before accessing the UIM contents + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - PIN ID (1/2) + pValue [ I ] - PIN value of the PIN to verify + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMVerifyPIN( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + CHAR * pValue ) +{ + // Validate arguments + if (pOut == 0 + || id < 1 + || id > 2 + || pValue == 0 + || pValue[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string val( pValue ); + UINT8 valSz = (UINT8)val.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMVerifyPINRequest_Info ) + valSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSUIMVerifyPINRequest_Info * pTLVx01; + pTLVx01 = (sDMSUIMVerifyPINRequest_Info*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mPINID = (UINT8)id; + pTLVx01->mPINLength = valSz; + offset += sizeof( sDMSUIMVerifyPINRequest_Info ); + + // Add mPINValue + memcpy( (pOut + offset), val.c_str(), valSz ); + offset += valSz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseUIMSetPINProtection + +DESCRIPTION: + This function enables or disables protection of UIM contents by a + given PIN + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseUIMSetPINProtection( + ULONG inLen, + const BYTE * pIn, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pIn == 0 || pVerifyRetriesLeft == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sDMSUIMSetPINProtectionResponse_RetryInfo * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx10 < sizeof( sDMSUIMSetPINProtectionResponse_RetryInfo )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pVerifyRetriesLeft = pTLVx10->mRemainingVerifyRetries; + *pUnblockRetriesLeft = pTLVx10->mRemainingUnblockRetries; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackUIMSetPINProtection + +DESCRIPTION: + This function enables or disables protection of UIM contents by a + given PIN + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + id [ I ] - PIN ID (1/2) + bEnable [ I ] - Enable/disable PIN protection (0 = disable)? + pValue [ I ] - PIN value of the PIN to be enabled/disabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackUIMSetPINProtection( + ULONG * pOutLen, + BYTE * pOut, + ULONG id, + ULONG bEnable, + CHAR * pValue ) +{ + // Validate arguments + if (pOut == 0 + || id < 1 + || id > 2 + || pValue == 0 + || pValue[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add arguments + std::string val( pValue ); + ULONG valSz = (ULONG)val.size(); + + // Check size + WORD tlvx01Sz = sizeof( sDMSUIMSetPINProtectionRequest_Info ) + (WORD)valSz; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sDMSUIMSetPINProtectionRequest_Info * pTLVx01; + pTLVx01 = (sDMSUIMSetPINProtectionRequest_Info*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mPINID = (UINT8)id; + pTLVx01->mPINEnabled = (bEnable == 0 ? 0 : 1); + pTLVx01->mPINLength = (UINT8)valSz; + + offset += sizeof( sDMSUIMSetPINProtectionRequest_Info ); + + // Add mPINValue + memcpy( (pOut + offset), val.c_str(), valSz ); + offset += valSz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationVoice.cpp b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationVoice.cpp new file mode 100755 index 0000000..5260f29 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationVoice.cpp @@ -0,0 +1,174 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationVoice.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (Voice Service for USSD) + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sUSSDInfo +// Struct to represent USSD/Alpha information header +/*=========================================================================*/ +struct sUSSDInfoHdr +{ + public: + BYTE mDCS; + BYTE mLength; + + // Data of 'mLength' follows +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================== +METHOD: + PackOriginateUSSD + +DESCRIPTION: + This function initiates a USSD operation + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackOriginateUSSD( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pInfo ) +{ + // Validate arguments + if (pOut == 0 || pInfo == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + const WORD INFO_HDR_SZ = sizeof( sUSSDInfoHdr ); + + // This assumes that pInfo is at least 2 bytes long + sUSSDInfoHdr * pInInfo = (sUSSDInfoHdr *)pInfo; + WORD infoLen = pInInfo->mLength + INFO_HDR_SZ; + + // Check size + if (*pOutLen < sizeof( sQMIRawContentHeader ) + infoLen) + { + return eGOBI_ERR_BUFFER_SZ; + } + + // Add pInfo + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = infoLen; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // No pTLVx01 since pInfo is our TLV + memcpy( (pOut + offset), pInfo, infoLen ); + + offset += infoLen; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackAnswerUSSD + +DESCRIPTION: + This function responds to a USSD request from the network + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackAnswerUSSD( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pInfo ) +{ + // Validate arguments + if (pOut == 0 || pInfo == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + const WORD INFO_HDR_SZ = sizeof( sUSSDInfoHdr ); + + // This assumes that pInfo is at least 2 bytes long + sUSSDInfoHdr * pInInfo = (sUSSDInfoHdr *)pInfo; + WORD infoLen = pInInfo->mLength + INFO_HDR_SZ; + + // Check size + if (*pOutLen < sizeof( sQMIRawContentHeader ) + infoLen) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = infoLen; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // No pTLVx01 since pInfo is our TLV + memcpy( (pOut + offset), pInfo, infoLen ); + + offset += infoLen; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationWDS.cpp b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationWDS.cpp new file mode 100755 index 0000000..c202fd9 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationWDS.cpp @@ -0,0 +1,3486 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationWDS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (WDS Service) + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + ParseGetSessionState + +DESCRIPTION: + This function returns the state of the current packet data session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pState [ O ] - State of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSessionState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ) +{ + // Validate arguments + if (pIn == 0 || pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sWDSGetPacketServiceStatusResponse_Status * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetPacketServiceStatusResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pState = pTLVx01->mConnectionStatus; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSessionDuration + +DESCRIPTION: + This function returns the duration of the current packet data session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pDuration [ O ] - Duration of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSessionDuration( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pDuration ) +{ + // Validate arguments + if (pIn == 0 || pDuration == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sWDSGetDataSessionDurationResponse_Duration * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetDataSessionDurationResponse_Duration )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pDuration = pTLVx01->mDataSessionDuration; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetDormancyState + +DESCRIPTION: + This function returns the dormancy state of the current packet + data session (when connected) + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pState [ O ] - Dormancy state of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetDormancyState( + ULONG inLen, + const BYTE * pIn, + ULONG * pState ) +{ + // Validate arguments + if (pIn == 0 || pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sWDSGetDormancyResponse_DormancyStatus * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetDormancyResponse_DormancyStatus )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pState = pTLVx01->mDormancyStatus; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetEnhancedAutoconnect + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSetting [ O ] - NDIS autoconnect setting + pRoamSetting [ O ] - NDIS autoconnect roam setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetEnhancedAutoconnect( + ULONG inLen, + const BYTE * pIn, + ULONG * pSetting, + ULONG * pRoamSetting ) +{ + // Validate arguments + if (pIn == 0 || pSetting == 0 || pRoamSetting == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSetting = 0xffffffff; + *pRoamSetting = 0xffffffff; + + // Find the first TLV + const sWDSGetAutoconnectSettingResponse_Autoconnect * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetAutoconnectSettingResponse_Autoconnect )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSetting = pTLVx01->mAutoconnectSetting; + + // Find the second TLV (optional) + const sWDSGetAutoconnectSettingResponse_Roam * pTLVx10; + ULONG outLenx10; + rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + // Is the TLV large enough? + if (outLenx10 < sizeof( sWDSGetAutoconnectSettingResponse_Roam )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRoamSetting = pTLVx10->mAutoconnectRoamSetting; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetEnhancedAutoconnect + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + setting [ I ] - NDIS autoconnect setting + pRoamSetting [ I ] - (Optional) NDIS autoconnect roam setting + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetEnhancedAutoconnect( + ULONG * pOutLen, + BYTE * pOut, + ULONG setting, + ULONG * pRoamSetting ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add setting + + // Check size + WORD tlvx01Sz = sizeof( sWDSSetAutoconnectSettingRequest_Autoconnect ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSSetAutoconnectSettingRequest_Autoconnect * pTLVx01; + pTLVx01 = (sWDSSetAutoconnectSettingRequest_Autoconnect*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mAutoconnectSetting = (eQMIWDSAutoconnectSettings)setting; + + offset += tlvx01Sz; + + // Add roam setting, if specified + if (pRoamSetting != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWDSSetAutoconnectSettingRequest_Roam ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetAutoconnectSettingRequest_Roam * pTLVx10; + pTLVx10 = (sWDSSetAutoconnectSettingRequest_Roam*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mAutoconnectRoamSetting = (eQMIWDSAutoconnectRoamSettings)*pRoamSetting; + + offset += tlvx10Sz; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetDefaultProfile + +DESCRIPTION: + This function writes the default profile settings to the device, the + default profile is used during autoconnect + + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + profileType [ I ] - Profile type being written + pPDPType [ I ] - (Optional) PDP type + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pName [ I ] - (Optional) The profile name or description + pAPNName [ I ] - (Optional) Access point name + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetDefaultProfile( + ULONG * pOutLen, + BYTE * pOut, + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add profileType + + // Check size + WORD tlvx01Sz = sizeof( sWDSModifyProfileRequest_ProfileIdentifier ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_ProfileIdentifier * pTLVx01; + pTLVx01 = (sWDSModifyProfileRequest_ProfileIdentifier*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mProfileType = (eQMIProfileTypes)profileType; + pTLVx01->mProfileIndex = 1; + + offset += tlvx01Sz; + + // Add name, if specified + if (pName != 0) + { + std::string name( pName ); + + // Check size + WORD tlvx10Sz = (WORD)name.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( pOut + offset, name.c_str(), name.size() ); + + offset += tlvx10Sz; + } + + // Add PDP type, if specified + if (pPDPType != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWDSModifyProfileRequest_PDPType ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_PDPType * pTLVx11; + pTLVx11 = (sWDSModifyProfileRequest_PDPType*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Set the value + pTLVx11->mPDPType = (eQMIPDPTypes)*pPDPType; + + offset += tlvx11Sz; + } + + // Add APN Name, if specified + if (pAPNName != 0) + { + std::string apnName( pAPNName ); + + // Check size + WORD tlvx14Sz = (WORD)apnName.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx14Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x14; + pHeader->mLength = tlvx14Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), apnName.c_str(), apnName.size() ); + + offset += tlvx14Sz; + } + + // Add Primary DNS, if specified + if (pPrimaryDNS != 0) + { + // Check size + WORD tlvx15Sz = sizeof( sWDSModifyProfileRequest_PrimaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx15Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x15; + pHeader->mLength = tlvx15Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_PrimaryDNS * pTLVx15; + pTLVx15 = (sWDSModifyProfileRequest_PrimaryDNS*)(pOut + offset); + memset( pTLVx15, 0, tlvx15Sz ); + + ULONG ip0 = (*pPrimaryDNS & 0x000000FF); + ULONG ip1 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx15->mIPV4Address[0] = (INT8)ip0; + pTLVx15->mIPV4Address[1] = (INT8)ip1; + pTLVx15->mIPV4Address[2] = (INT8)ip2; + pTLVx15->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx15Sz; + } + + // Add Secondary DNS, if specified + if (pSecondaryDNS != 0) + { + // Check size + WORD tlvx16Sz = sizeof( sWDSModifyProfileRequest_SecondaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx16Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x16; + pHeader->mLength = tlvx16Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_SecondaryDNS * pTLVx16; + pTLVx16 = (sWDSModifyProfileRequest_SecondaryDNS*)(pOut + offset); + memset( pTLVx16, 0, tlvx16Sz ); + + ULONG ip0 = (*pSecondaryDNS & 0x000000FF); + ULONG ip1 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx16->mIPV4Address[0] = (INT8)ip0; + pTLVx16->mIPV4Address[1] = (INT8)ip1; + pTLVx16->mIPV4Address[2] = (INT8)ip2; + pTLVx16->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx16Sz; + } + + // Add Username, if specified + if (pUsername != 0) + { + std::string username( pUsername ); + + // Check size + WORD tlvx1BSz = (WORD)username.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx1BSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x1B; + pHeader->mLength = tlvx1BSz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), username.c_str(), username.size() ); + + offset += tlvx1BSz; + } + + // Add Password, if specified + if (pPassword != 0) + { + std::string password( pPassword ); + + // Check size + WORD tlvx1CSz = (WORD)password.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx1CSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x1C; + pHeader->mLength = tlvx1CSz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), password.c_str(), password.size() ); + + offset += tlvx1CSz; + } + + // Add Authentication, if specified + if (pAuthentication != 0) + { + // Check size + WORD tlvx1DSz = sizeof( sWDSModifyProfileRequest_Authentication ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx1DSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x1D; + pHeader->mLength = tlvx1DSz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_Authentication * pTLVx1D; + pTLVx1D = (sWDSModifyProfileRequest_Authentication*)(pOut + offset); + memset( pTLVx1D, 0, tlvx1DSz ); + + // Set the value + pTLVx1D->mEnablePAP = ((*pAuthentication & 0x00000001) != 0); + pTLVx1D->mEnableCHAP = ((*pAuthentication & 0x00000002) != 0); + + offset += tlvx1DSz; + } + + // Add IP Address, if specified + if (pIPAddress != 0) + { + // Check size + WORD tlvx1ESz = sizeof( sWDSModifyProfileRequest_IPAddress ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx1ESz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x1E; + pHeader->mLength = tlvx1ESz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSModifyProfileRequest_IPAddress * pTLVx1E; + pTLVx1E = (sWDSModifyProfileRequest_IPAddress*)(pOut + offset); + memset( pTLVx1E, 0, tlvx1ESz ); + + ULONG ip0 = (*pIPAddress & 0x000000FF); + ULONG ip1 = (*pIPAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pIPAddress & 0x00FF0000) >> 16; + ULONG ip3 = (*pIPAddress & 0xFF000000) >> 24; + + // Set the value + pTLVx1E->mIPV4Address[0] = (INT8)ip0; + pTLVx1E->mIPV4Address[1] = (INT8)ip1; + pTLVx1E->mIPV4Address[2] = (INT8)ip2; + pTLVx1E->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx1ESz; + } + + // At least one of the optional parameters must have been set + if (offset <= sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetDefaultProfile + +DESCRIPTION: + This function reads the default profile settings from the device, the + default profile is used during autoconnect + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + profileType [ I ] - Profile type being read + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetDefaultProfile( + ULONG * pOutLen, + BYTE * pOut, + ULONG profileType ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add profileType + + // Check size + WORD tlvx01Sz = sizeof( sWDSGetDefaultSettingsRequest_ProfileType ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSGetDefaultSettingsRequest_ProfileType * pTLVx01; + pTLVx01 = (sWDSGetDefaultSettingsRequest_ProfileType*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mProfileType = (eQMIProfileTypes)profileType; + + offset += tlvx01Sz; + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetDefaultProfile + +DESCRIPTION: + This function reads the default profile settings from the device, the + default profile is used during autoconnect + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pPDPType [ O ] - PDP type + pIPAddress [ O ] - Preferred assigned IPv4 address + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + pAuthentication [ O ] - Authentication algorithm bitmap + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the profile name array + can contain + pName [ O ] - The profile name or description + apnSize [ I ] - The maximum number of characters (including + NULL terminator) that the APN name array + can contain + pAPNName [ O ] - Access point name represented as a NULL + terminated string (empty string returned when + unknown) + userSize [ I ] - The maximum number of characters (including + NULL terminator) that the username array + can contain + pUsername [ O ] - Username used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetDefaultProfile( + ULONG inLen, + const BYTE * pIn, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ) +{ + // Validate arguments + if (pIn == 0 + || pPDPType == 0 + || pIPAddress == 0 + || pPrimaryDNS == 0 + || pSecondaryDNS == 0 + || pAuthentication == 0 + || nameSize == 0 + || pName == 0 + || apnSize == 0 + || pAPNName == 0 + || userSize == 0 + || pUsername == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Set defaults + *pPDPType = 0xffffffff; + *pIPAddress = 0xffffffff; + *pPrimaryDNS = 0xffffffff; + *pSecondaryDNS = 0xffffffff; + *pAuthentication = 0xffffffff; + pName[0] = 0; + pAPNName[0] = 0; + pUsername[0] = 0; + + // Find the name + const sWDSGetDefaultSettingsResponse_ProfileName * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (nameSize < outLenx10 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pName, (const BYTE *)pTLVx10, outLenx10 ); + + // Null terminate + pName[outLenx10] = 0; + } + + // Find the PDP type + const sWDSGetDefaultSettingsResponse_PDPType * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sWDSGetDefaultSettingsResponse_PDPType )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pPDPType = pTLVx11->mPDPType; + } + + // Find the APN name + const sWDSGetDefaultSettingsResponse_APNName * pTLVx14; + ULONG outLenx14; + rc = GetTLV( inLen, pIn, 0x14, &outLenx14, (const BYTE **)&pTLVx14 ); + if (rc == eGOBI_ERR_NONE) + { + if (apnSize < outLenx14 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pAPNName, (const BYTE *)pTLVx14, outLenx14 ); + + // Null terminate + pAPNName[outLenx14] = 0; + } + + // Find the Primary DNS + const sWDSGetDefaultSettingsResponse_PrimaryDNS * pTLVx15; + ULONG outLenx15; + rc = GetTLV( inLen, pIn, 0x15, &outLenx15, (const BYTE **)&pTLVx15 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx15 < sizeof( sWDSGetDefaultSettingsResponse_PrimaryDNS )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx15->mIPV4Address[0]; + ULONG ip1 = pTLVx15->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx15->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx15->mIPV4Address[3] << 24; + + *pPrimaryDNS = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Secondary DNS + const sWDSGetDefaultSettingsResponse_SecondaryDNS * pTLVx16; + ULONG outLenx16; + rc = GetTLV( inLen, pIn, 0x16, &outLenx16, (const BYTE **)&pTLVx16 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx16 < sizeof( sWDSGetDefaultSettingsResponse_SecondaryDNS )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx16->mIPV4Address[0]; + ULONG ip1 = pTLVx16->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx16->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx16->mIPV4Address[3] << 24; + + *pSecondaryDNS = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Username + const sWDSGetDefaultSettingsResponse_APNName * pTLVx1B; + ULONG outLenx1B; + rc = GetTLV( inLen, pIn, 0x1B, &outLenx1B, (const BYTE **)&pTLVx1B ); + if (rc == eGOBI_ERR_NONE) + { + if (userSize < outLenx1B + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pAPNName, (const BYTE *)pTLVx1B, outLenx1B ); + + // Null terminate + pAPNName[outLenx1B] = 0; + } + + // Find the Authentication + const sWDSGetDefaultSettingsResponse_Authentication * pTLVx1D; + ULONG outLenx1D; + rc = GetTLV( inLen, pIn, 0x1D, &outLenx1D, (const BYTE **)&pTLVx1D ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1D < sizeof( sWDSGetDefaultSettingsResponse_Authentication )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG pap = pTLVx1D->mEnablePAP; + ULONG chap = pTLVx1D->mEnableCHAP << 1; + + *pAuthentication = (pap | chap); + } + + // Find the IP Address + const sWDSGetDefaultSettingsResponse_IPAddress * pTLVx1E; + ULONG outLenx1E; + rc = GetTLV( inLen, pIn, 0x1E, &outLenx1E, (const BYTE **)&pTLVx1E ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1E < sizeof( sWDSGetDefaultSettingsResponse_IPAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx1E->mIPV4Address[0]; + ULONG ip1 = pTLVx1E->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx1E->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx1E->mIPV4Address[3] << 24; + + *pIPAddress = (ip0 | ip1 | ip2 | ip3); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackStartDataSession + +DESCRIPTION: + This function activates a packet data session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pTechnology [ I ] - (Optional) Technology bitmap + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pPrimaryNBNS [ I ] - (Optional) Primary NetBIOS NS IPv4 address + pSecondaryNBNS [ I ] - (Optional) Secondary NetBIOS NS IPv4 address + pAPNName [ I ] - (Optional) Access point name + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackStartDataSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + sQMIRawContentHeader * pHeader; + ULONG offset = 0; + + // Add technology, if specified + if (pTechnology != 0) + { + // Check size + WORD tlvx30Sz = sizeof( sWDSStartNetworkInterfaceRequest_TechnologyPreference ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx30Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x30; + pHeader->mLength = tlvx30Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_TechnologyPreference * pTLVx30; + pTLVx30 = (sWDSStartNetworkInterfaceRequest_TechnologyPreference*)(pOut + offset); + memset( pTLVx30, 0, tlvx30Sz ); + + // Set the value + pTLVx30->mEnable3GPP = ((*pTechnology & 0x00000001) != 0); + pTLVx30->mEnable3GPP2 = ((*pTechnology & 0x00000002) != 0); + + offset += tlvx30Sz; + } + + // Add Primary DNS, if specified + if (pPrimaryDNS != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWDSStartNetworkInterfaceRequest_PrimaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_PrimaryDNS * pTLVx10; + pTLVx10 = (sWDSStartNetworkInterfaceRequest_PrimaryDNS*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + ULONG ip0 = (*pPrimaryDNS & 0x000000FF); + ULONG ip1 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx10->mIPV4Address[0] = (INT8)ip0; + pTLVx10->mIPV4Address[1] = (INT8)ip1; + pTLVx10->mIPV4Address[2] = (INT8)ip2; + pTLVx10->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx10Sz; + } + + // Add Secondary DNS, if specified + if (pSecondaryDNS != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWDSStartNetworkInterfaceRequest_SecondaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_SecondaryDNS * pTLVx11; + pTLVx11 = (sWDSStartNetworkInterfaceRequest_SecondaryDNS*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + ULONG ip0 = (*pSecondaryDNS & 0x000000FF); + ULONG ip1 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx11->mIPV4Address[0] = (INT8)ip0; + pTLVx11->mIPV4Address[1] = (INT8)ip1; + pTLVx11->mIPV4Address[2] = (INT8)ip2; + pTLVx11->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx11Sz; + } + + // Add Primary NBNS, if specified + if (pPrimaryNBNS != 0) + { + // Check size + WORD tlvx12Sz = sizeof( sWDSStartNetworkInterfaceRequest_PrimaryNBNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx12Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x12; + pHeader->mLength = tlvx12Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_PrimaryNBNS * pTLVx12; + pTLVx12 = (sWDSStartNetworkInterfaceRequest_PrimaryNBNS*)(pOut + offset); + memset( pTLVx12, 0, tlvx12Sz ); + + ULONG ip0 = (*pPrimaryNBNS & 0x000000FF); + ULONG ip1 = (*pPrimaryNBNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryNBNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pPrimaryNBNS & 0xFF000000) >> 24; + + // Set the value + pTLVx12->mIPV4Address[0] = (INT8)ip0; + pTLVx12->mIPV4Address[1] = (INT8)ip1; + pTLVx12->mIPV4Address[2] = (INT8)ip2; + pTLVx12->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx12Sz; + } + + // Add Secondary NBNS, if specified + if (pSecondaryNBNS != 0) + { + // Check size + WORD tlvx13Sz = sizeof( sWDSStartNetworkInterfaceRequest_SecondaryNBNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx13Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x13; + pHeader->mLength = tlvx13Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_SecondaryNBNS * pTLVx13; + pTLVx13 = (sWDSStartNetworkInterfaceRequest_SecondaryNBNS*)(pOut + offset); + memset( pTLVx13, 0, tlvx13Sz ); + + ULONG ip0 = (*pSecondaryNBNS & 0x000000FF); + ULONG ip1 = (*pSecondaryNBNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryNBNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pSecondaryNBNS & 0xFF000000) >> 24; + + // Set the value + pTLVx13->mIPV4Address[0] = (INT8)ip0; + pTLVx13->mIPV4Address[1] = (INT8)ip1; + pTLVx13->mIPV4Address[2] = (INT8)ip2; + pTLVx13->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx13Sz; + } + + // Add APN Name, if specified + if (pAPNName != 0) + { + std::string apnName( pAPNName ); + + // Check size + WORD tlvx14Sz = (WORD)apnName.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx14Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x14; + pHeader->mLength = tlvx14Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), apnName.c_str(), apnName.size() ); + + offset += tlvx14Sz; + } + + // Add IP Address, if specified + if (pIPAddress != 0) + { + // Check size + WORD tlvx15Sz = sizeof( sWDSStartNetworkInterfaceRequest_IPAddress ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx15Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x15; + pHeader->mLength = tlvx15Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_IPAddress * pTLVx15; + pTLVx15 = (sWDSStartNetworkInterfaceRequest_IPAddress*)(pOut + offset); + memset( pTLVx15, 0, tlvx15Sz ); + + ULONG ip0 = (*pIPAddress & 0x000000FF); + ULONG ip1 = (*pIPAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pIPAddress & 0x00FF0000) >> 16; + ULONG ip3 = (*pIPAddress & 0xFF000000) >> 24; + + // Set the value + pTLVx15->mIPV4Address[0] = (INT8)ip0; + pTLVx15->mIPV4Address[1] = (INT8)ip1; + pTLVx15->mIPV4Address[2] = (INT8)ip2; + pTLVx15->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx15Sz; + } + + // Add Authentication, if specified + if (pAuthentication != 0) + { + // Check size + WORD tlvx16Sz = sizeof( sWDSStartNetworkInterfaceRequest_Authentication ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx16Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x16; + pHeader->mLength = tlvx16Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_Authentication * pTLVx16; + pTLVx16 = (sWDSStartNetworkInterfaceRequest_Authentication*)(pOut + offset); + memset( pTLVx16, 0, tlvx16Sz ); + + // Set the value + pTLVx16->mEnablePAP = ((*pAuthentication & 0x00000001) != 0); + pTLVx16->mEnableCHAP = ((*pAuthentication & 0x00000002) != 0); + + offset += tlvx16Sz; + } + + // Add Username, if specified + if (pUsername != 0) + { + std::string username( pUsername ); + + // Check size + WORD tlvx17Sz = (WORD)username.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx17Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x17; + pHeader->mLength = tlvx17Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), username.c_str(), username.size() ); + + offset += tlvx17Sz; + } + + // Add Password, if specified + if (pPassword != 0) + { + std::string password( pPassword ); + + // Check size + WORD tlvx18Sz = (WORD)password.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx18Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x18; + pHeader->mLength = tlvx18Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), password.c_str(), password.size() ); + + offset += tlvx18Sz; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseStartDataSession + +DESCRIPTION: + This function activates a packet data session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pSessionId [ O ] - The assigned session ID + pFailureReason [ O ] - Upon call failure the failure reason provided + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseStartDataSession( + ULONG inLen, + const BYTE * pIn, + ULONG * pSessionId, + ULONG * pFailureReason ) +{ + // Validate arguments + if (pIn == 0 + || pSessionId == 0 + || pFailureReason == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check mandatory response + const sResultCode * pTLVx02; + ULONG outLenx02; + ULONG rc = GetTLV( inLen, pIn, 0x02, &outLenx02, (const BYTE **)&pTLVx02 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx02 < sizeof( sResultCode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + if (pTLVx02->mQMIResult != eQMIResults_Success) + { + rc = pTLVx02->mQMIError + eGOBI_ERR_QMI_OFFSET; + } + + if (rc != eGOBI_ERR_NONE) + { + // Still parse call end reason, if present + const sWDSStartNetworkInterfaceResponse_CallEndReason * pTLVx10; + ULONG outLenx10; + ULONG rc2 = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc2 == eGOBI_ERR_NONE) + { + if (outLenx10 >= sizeof( sWDSStartNetworkInterfaceResponse_CallEndReason )) + { + *pFailureReason = pTLVx10->mCallEnd; + } + } + + return rc; + } + + // Find the Session ID + const sWDSStartNetworkInterfaceResponse_PacketDataHandle * pTLVx01; + ULONG outLenx01; + rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx01 < sizeof( sWDSStartNetworkInterfaceResponse_PacketDataHandle )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pSessionId = pTLVx01->mPacketDataHandle; + } + + // Session ID is mandatory, if it failed return that error + return rc; +} + +/*=========================================================================== +METHOD: + PackStopDataSession + +DESCRIPTION: + This function stops the current data session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + sessionId [ I ] - The ID of the session to terminate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackStopDataSession( + ULONG * pOutLen, + BYTE * pOut, + ULONG sessionId ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Add session ID + + // Check size + WORD tlvx01Sz = sizeof( sWDSStopNetworkInterfaceRequest_PacketDataHandle ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSStopNetworkInterfaceRequest_PacketDataHandle * pTLVx01; + pTLVx01 = (sWDSStopNetworkInterfaceRequest_PacketDataHandle*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the value + pTLVx01->mPacketDataHandle = sessionId; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetIPAddress + +DESCRIPTION: + This function returns the current packet data session IP address + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetIPAddress( + ULONG * pOutLen, + BYTE * pOut ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Request the settings + + // Check size + WORD tlvx10Sz = sizeof( sWDSGetCurrentSettingsRequest_RequestedSettings ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSGetCurrentSettingsRequest_RequestedSettings * pTLVx10; + pTLVx10 = (sWDSGetCurrentSettingsRequest_RequestedSettings*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mIPAddress = true; + + offset += tlvx10Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetIPAddress + +DESCRIPTION: + This function returns the current packet data session IP address + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pIPAddress [ O ] - Assigned IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetIPAddress( + ULONG inLen, + const BYTE * pIn, + ULONG * pIPAddress ) +{ + // Validate arguments + if (pIn == 0 || pIPAddress == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the IP Address + const sWDSGetDefaultSettingsResponse_IPAddress * pTLVx1E; + ULONG outLenx1E; + ULONG rc = GetTLV( inLen, pIn, 0x1E, &outLenx1E, (const BYTE **)&pTLVx1E ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1E < sizeof( sWDSGetDefaultSettingsResponse_IPAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx1E->mIPV4Address[0]; + ULONG ip1 = pTLVx1E->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx1E->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx1E->mIPV4Address[3] << 24; + + *pIPAddress = (ip0 | ip1 | ip2 | ip3); + } + + // If no IP address is found, fail + return rc; +} + +/*=========================================================================== +METHOD: + ParseGetConnectionRate + +DESCRIPTION: + This function returns connection rate information for the packet data + connection + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pCurrentChannelTXRate [ O ] - Current channel TX rate (bps) + pCurrentChannelRXRate [ O ] - Current channel RX rate (bps) + pMaxChannelTXRate [ O ] - Maximum channel TX rate (bps) + pMaxChannelRXRate [ O ] - Maximum channel RX rate (bps) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetConnectionRate( + ULONG inLen, + const BYTE * pIn, + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ) +{ + // Validate arguments + if (pIn == 0 + || pCurrentChannelTXRate == 0 + || pCurrentChannelRXRate == 0 + || pMaxChannelTXRate == 0 + || pMaxChannelRXRate == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the rates + const sWDSGetChannelRatesResponse_ChannelRates * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx01 < sizeof( sWDSGetChannelRatesResponse_ChannelRates )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Get the values + *pCurrentChannelTXRate = pTLVx01->mChannelTXRatebps; + *pCurrentChannelRXRate = pTLVx01->mChannelRXRatebps; + *pMaxChannelTXRate = pTLVx01->mMaxChannelTXRatebps; + *pMaxChannelRXRate = pTLVx01->mMaxChannelRXRatebps; + } + + // If no rates are found, fail + return rc; +} + +/*=========================================================================== +METHOD: + PackGetPacketStatus + +DESCRIPTION: + This function returns the packet data transfer statistics since the start + of the current packet data session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetPacketStatus( + ULONG * pOutLen, + BYTE * pOut ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Request the settings + + // Check size + WORD tlvx01Sz = sizeof( sWDSGetPacketStatisticsRequest_PacketStatsMask ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSGetPacketStatisticsRequest_PacketStatsMask * pTLVx01; + pTLVx01 = (sWDSGetPacketStatisticsRequest_PacketStatsMask*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mReportTXPacketSuccesses = true; + pTLVx01->mReportRXPacketSuccesses = true; + pTLVx01->mReportTXPacketErrors = true; + pTLVx01->mReportRXPacketErrors = true; + pTLVx01->mReportTXOverflows = true; + pTLVx01->mReportRXOverflows = true; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetPacketStatus + +DESCRIPTION: + This function returns the packet data transfer statistics since the start + of the current packet data session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pTXPacketSuccesses [ O ] - Packets transmitted without error + pRXPacketSuccesses [ O ] - Packets received without error + pTXPacketErrors [ O ] - Outgoing packets with framing errors + pRXPacketErrors [ O ] - Incoming packets with framing errors + pTXPacketOverflows [ O ] - Packets dropped because TX buffer overflowed + pRXPacketOverflows [ O ] - Packets dropped because RX buffer overflowed + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetPacketStatus( + ULONG inLen, + const BYTE * pIn, + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ) +{ + // Validate arguments + if (pIn == 0 + || pTXPacketSuccesses == 0 + || pRXPacketSuccesses == 0 + || pTXPacketErrors == 0 + || pRXPacketErrors == 0 + || pTXPacketOverflows == 0 + || pRXPacketOverflows == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // NOTE: All TLVs are required. If any fail then all fail + + // Find the TX packet sucesses + const sWDSGetPacketStatisticsResponse_TXPacketSuccesses * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWDSGetPacketStatisticsResponse_TXPacketSuccesses )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the RX packet sucesses + const sWDSGetPacketStatisticsResponse_RXPacketSuccesses * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sWDSGetPacketStatisticsResponse_RXPacketSuccesses )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the TX packet errors + const sWDSGetPacketStatisticsResponse_TXPacketErrors * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx12 < sizeof( sWDSGetPacketStatisticsResponse_TXPacketErrors )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the RX packet errors + const sWDSGetPacketStatisticsResponse_RXPacketErrors * pTLVx13; + ULONG outLenx13; + rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx13 < sizeof( sWDSGetPacketStatisticsResponse_RXPacketErrors )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the TX packet overflows + const sWDSGetPacketStatisticsResponse_TXOverflows * pTLVx14; + ULONG outLenx14; + rc = GetTLV( inLen, pIn, 0x14, &outLenx14, (const BYTE **)&pTLVx14 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx14 < sizeof( sWDSGetPacketStatisticsResponse_TXOverflows )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the RX packet overflows + const sWDSGetPacketStatisticsResponse_RXOverflows * pTLVx15; + ULONG outLenx15; + rc = GetTLV( inLen, pIn, 0x15, &outLenx15, (const BYTE **)&pTLVx15 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx15 < sizeof( sWDSGetPacketStatisticsResponse_RXOverflows )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Populate the statistics + *pTXPacketSuccesses = pTLVx10->mTXPacketSuccesses; + *pRXPacketSuccesses = pTLVx11->mRXPacketSuccesses; + *pTXPacketErrors = pTLVx12->mTXPacketErrors; + *pRXPacketErrors = pTLVx13->mRXPacketErrors; + *pTXPacketOverflows = pTLVx14->mTXOverflows; + *pRXPacketOverflows = pTLVx15->mRXOverflows; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetByteTotals + +DESCRIPTION: + This function returns the RX/TX byte counts since the start of the + current packet data session + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetByteTotals( + ULONG * pOutLen, + BYTE * pOut ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Request the settings + + // Check size + WORD tlvx01Sz = sizeof( sWDSGetPacketStatisticsRequest_PacketStatsMask ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSGetPacketStatisticsRequest_PacketStatsMask * pTLVx01; + pTLVx01 = (sWDSGetPacketStatisticsRequest_PacketStatsMask*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mTXByteTotal = true; + pTLVx01->mRXByteTotal = true; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetByteTotals + +DESCRIPTION: + This function returns the RX/TX byte counts since the start of the + current packet data session + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pTXTotalBytes [ O ] - Bytes transmitted without error + pRXTotalBytes [ O ] - Bytes received without error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetByteTotals( + ULONG inLen, + const BYTE * pIn, + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ) +{ + // Validate arguments + if (pIn == 0 + || pTXTotalBytes == 0 + || pRXTotalBytes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // NOTE: All TLVs are required. If any fail then all fail + + // Find the TX bytes + const sWDSGetPacketStatisticsResponse_TXBytes * pTLVx19; + ULONG outLenx19; + ULONG rc = GetTLV( inLen, pIn, 0x19, &outLenx19, (const BYTE **)&pTLVx19 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx19 < sizeof( sWDSGetPacketStatisticsResponse_TXBytes )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Find the RX bytes + const sWDSGetPacketStatisticsResponse_RXBytes * pTLVx1A; + ULONG outLenx1A; + rc = GetTLV( inLen, pIn, 0x1A, &outLenx1A, (const BYTE **)&pTLVx1A ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1A < sizeof( sWDSGetPacketStatisticsResponse_RXBytes )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + } + else + { + return rc; + } + + // Populate the statistics + *pTXTotalBytes = pTLVx19->mTXByteTotal; + *pRXTotalBytes = pTLVx1A->mRXByteTotal; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetMobileIP + +DESCRIPTION: + This function sets the current mobile IP setting + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + mode [ I ] - Desired mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetMobileIP( + ULONG * pOutLen, + BYTE * pOut, + ULONG mode ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Set the mode + + // Check size + WORD tlvx01Sz = sizeof( sWDSSetMIPModeRequest_MobileIPMode ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSSetMIPModeRequest_MobileIPMode * pTLVx01; + pTLVx01 = (sWDSSetMIPModeRequest_MobileIPMode*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mMIPMode = (eQMIMobileIPModes)mode; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetMobileIP + +DESCRIPTION: + This function gets the current mobile IP setting + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMode [ O ] - Current mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetMobileIP( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode ) +{ + // Validate arguments + if (pIn == 0 || pMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the mode + const sWDSGetMIPModeResponse_MobileIPMode * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx01 < sizeof( sWDSGetMIPModeResponse_MobileIPMode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMode = pTLVx01->mMIPMode; + } + + return rc; +} + +/*=========================================================================== +METHOD: + PackSetActiveMobileIPProfile + +DESCRIPTION: + This function sets the active mobile IP profile index + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - Six digit service programming code + index [ I ] - Desired mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetActiveMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE index ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWDSSetActiveMIPProfileRequest_Index ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSSetActiveMIPProfileRequest_Index * pTLVx01; + pTLVx01 = (sWDSSetActiveMIPProfileRequest_Index*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + pTLVx01->mProfileIndex = index; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetActiveMobileIPProfile + +DESCRIPTION: + This function gets the the active mobile IP profile index + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pIndex [ O ] - Active mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetActiveMobileIPProfile( + ULONG inLen, + const BYTE * pIn, + BYTE * pIndex ) +{ + // Validate arguments + if (pIn == 0 || pIndex == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the mode + const sWDSGetActiveMIPProfileResponse_Index * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx01 < sizeof( sWDSGetActiveMIPProfileResponse_Index )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pIndex = pTLVx01->mProfileIndex; + } + + return rc; +} + +/*=========================================================================== +METHOD: + PackSetMobileIPProfile + +DESCRIPTION: + This function sets the specified mobile IP profile settings + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - Six digit service programming code + index [ I ] - Mobile IP profile ID + pEnabled [ I ] - (Optional) Enable MIP profile? + pAddress [ I ] - (Optional) Home IPv4 address + pPrimaryHA [ I ] - (Optional) Primary home agent IPv4 address + pSecondaryHA [ I ] - (Optional) Secondary home agent IPv4 address + bRevTunneling [ I ] - (Optional) Enable reverse tunneling? + pNAI [ I ] - (Optional) Network access identifier string + pHASPI [ I ] - (Optional) HA security parameter index + pAAASPI [ I ] - (Optional) AAA security parameter index + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWDSSetMIPProfileRequest_Index ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_Index * pTLVx01; + pTLVx01 = (sWDSSetMIPProfileRequest_Index*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + pTLVx01->mProfileIndex = index; + + offset += tlvx01Sz; + + // Add Enabled, if specified + if (pEnabled != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWDSSetMIPProfileRequest_State ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_State * pTLVx10; + pTLVx10 = (sWDSSetMIPProfileRequest_State*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mEnabled = (*pEnabled == 0 ? 0 : 1); + + offset += tlvx10Sz; + } + + // Add Home Address, if specified + if (pAddress != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWDSSetMIPProfileRequest_HomeAddress ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_HomeAddress * pTLVx11; + pTLVx11 = (sWDSSetMIPProfileRequest_HomeAddress*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + ULONG ip0 = (*pAddress & 0x000000FF); + ULONG ip1 = (*pAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pAddress & 0x00FF0000) >> 16; + ULONG ip3 = (*pAddress & 0xFF000000) >> 24; + + // Set the value + pTLVx11->mIPV4Address[0] = (INT8)ip0; + pTLVx11->mIPV4Address[1] = (INT8)ip1; + pTLVx11->mIPV4Address[2] = (INT8)ip2; + pTLVx11->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx11Sz; + } + + // Add Primary Home Agent Address, if specified + if (pPrimaryHA != 0) + { + // Check size + WORD tlvx12Sz = sizeof( sWDSSetMIPProfileRequest_PrimaryHomeAgentAddress ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx12Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x12; + pHeader->mLength = tlvx12Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_PrimaryHomeAgentAddress * pTLVx12; + pTLVx12 = (sWDSSetMIPProfileRequest_PrimaryHomeAgentAddress*)(pOut + offset); + memset( pTLVx12, 0, tlvx12Sz ); + + ULONG ip0 = (*pPrimaryHA & 0x000000FF); + ULONG ip1 = (*pPrimaryHA & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryHA & 0x00FF0000) >> 16; + ULONG ip3 = (*pPrimaryHA & 0xFF000000) >> 24; + + // Set the value + pTLVx12->mIPV4Address[0] = (INT8)ip0; + pTLVx12->mIPV4Address[1] = (INT8)ip1; + pTLVx12->mIPV4Address[2] = (INT8)ip2; + pTLVx12->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx12Sz; + } + + // Add Secondary Home Agent Address, if specified + if (pSecondaryHA != 0) + { + // Check size + WORD tlvx13Sz = sizeof( sWDSSetMIPProfileRequest_SecondaryHomeAgentAddress ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx13Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x13; + pHeader->mLength = tlvx13Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_SecondaryHomeAgentAddress * pTLVx13; + pTLVx13 = (sWDSSetMIPProfileRequest_SecondaryHomeAgentAddress*)(pOut + offset); + memset( pTLVx13, 0, tlvx13Sz ); + + ULONG ip0 = (*pSecondaryHA & 0x000000FF); + ULONG ip1 = (*pSecondaryHA & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryHA & 0x00FF0000) >> 16; + ULONG ip3 = (*pSecondaryHA & 0xFF000000) >> 24; + + // Set the value + pTLVx13->mIPV4Address[0] = (INT8)ip0; + pTLVx13->mIPV4Address[1] = (INT8)ip1; + pTLVx13->mIPV4Address[2] = (INT8)ip2; + pTLVx13->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx13Sz; + } + + // Add reverse tunneling, if specified + if (pRevTunneling != 0) + { + // Check size + WORD tlvx14Sz = sizeof( sWDSSetMIPProfileRequest_ReverseTunneling ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx14Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x14; + pHeader->mLength = tlvx14Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_ReverseTunneling * pTLVx14; + pTLVx14 = (sWDSSetMIPProfileRequest_ReverseTunneling*)(pOut + offset); + memset( pTLVx14, 0, tlvx14Sz ); + + // Set the value + pTLVx14->mReverseTunneling = (*pRevTunneling == 0 ? 0 : 1); + + offset += tlvx14Sz; + } + + // Add NAI, if specified + if (pNAI != 0) + { + std::string nai( pNAI ); + + // Check size + WORD tlvx15Sz = (WORD)nai.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx15Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x15; + pHeader->mLength = tlvx15Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), nai.c_str(), nai.size() ); + + offset += tlvx15Sz; + } + + // Add HA SPI, if specified + if (pHASPI != 0) + { + // Check size + WORD tlvx16Sz = sizeof( sWDSSetMIPProfileRequest_HASPI ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx16Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x16; + pHeader->mLength = tlvx16Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequest_HASPI * pTLVx16; + pTLVx16 = (sWDSSetMIPProfileRequest_HASPI*)(pOut + offset); + memset( pTLVx16, 0, tlvx16Sz ); + + // Set the value + pTLVx16->mHASPI = *pHASPI; + + offset += tlvx16Sz; + } + + // Add AAA SPI, if specified + if (pAAASPI != 0) + { + // Check size + WORD tlvx17Sz = sizeof( sWDSSetMIPProfileRequeste_AAASPI ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx17Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x17; + pHeader->mLength = tlvx17Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPProfileRequeste_AAASPI * pTLVx17; + pTLVx17 = (sWDSSetMIPProfileRequeste_AAASPI*)(pOut + offset); + memset( pTLVx17, 0, tlvx17Sz ); + + // Set the value + pTLVx17->mAAASPI = *pAAASPI; + + offset += tlvx17Sz; + } + + // Add MN-HA key, if specified + if (pMNHA != 0) + { + std::string mnha( pMNHA ); + + // Check size + WORD tlvx18Sz = (WORD)mnha.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx18Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x18; + pHeader->mLength = tlvx18Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), mnha.c_str(), mnha.size() ); + + offset += tlvx18Sz; + } + + // Add MN-AAA key, if specified + if (pMNHA != 0) + { + std::string mnaaa( pMNAAA ); + + // Check size + WORD tlvx19Sz = (WORD)mnaaa.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx19Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x19; + pHeader->mLength = tlvx19Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // Set the value + memcpy( (pOut + offset), mnaaa.c_str(), mnaaa.size() ); + + offset += tlvx19Sz; + } + + // At least one of the optional parameters must have been set + if (offset <= sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetMobileIPProfile + +DESCRIPTION: + This function gets the specified mobile IP profile settings + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + index [ I ] - Mobile IP profile ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetMobileIPProfile( + ULONG * pOutLen, + BYTE * pOut, + BYTE index ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWDSGetMIPProfileRequest_Index ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSGetMIPProfileRequest_Index * pTLVx01; + pTLVx01 = (sWDSGetMIPProfileRequest_Index*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mProfileIndex = index; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetMobileIPProfile + +DESCRIPTION: + This function gets the specified mobile IP profile settings + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pEnabled [ O ] - Mobile IP profile enabled? + pAddress [ O ] - Home IPv4 address + pPrimaryHA [ O ] - Primary home agent IPv4 address + pSecondaryHA [ O ] - Secondary home agent IPv4 address + pRevTunneling [ O ] - Reverse tunneling enabled? + naiSize [ I ] - The maximum number of characters (including NULL + terminator) that the NAI array can contain + pNAI [ O ] - Network access identifier string + pHASPI [ O ] - HA security parameter index + pAAASPI [ O ] - AAA security parameter index + pHAState [ O ] - HA key state + pAAAState [ O ] - AAA key state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetMobileIPProfile( + ULONG inLen, + const BYTE * pIn, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ) +{ + // Validate arguments + if (pIn == 0 + || pEnabled == 0 + || pAddress == 0 + || pPrimaryHA == 0 + || pSecondaryHA == 0 + || pRevTunneling == 0 + || naiSize == 0 + || pNAI == 0 + || pHASPI == 0 + || pAAASPI == 0 + || pHAState == 0 + || pAAAState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume errors + *pEnabled = 0xff; + *pAddress = 0xffffffff; + *pPrimaryHA = 0xffffffff; + *pSecondaryHA = 0xffffffff; + *pRevTunneling = 0xff; + *pHASPI = 0xffffffff; + *pAAASPI = 0xffffffff; + *pHAState = 0xffffffff; + *pAAAState = 0xffffffff; + + // Find the State + const sWDSGetMIPProfileResponse_State * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWDSGetMIPProfileResponse_State )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pEnabled = pTLVx10->mEnabled; + } + + // Find the Home Address + const sWDSGetMIPProfileResponse_HomeAddress * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sWDSGetMIPProfileResponse_HomeAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx11->mIPV4Address[0]; + ULONG ip1 = pTLVx11->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx11->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx11->mIPV4Address[3] << 24; + + *pAddress = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Primary Home Agent Address + const sWDSGetMIPProfileResponse_PrimaryHomeAgentAddress * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx12 < sizeof( sWDSGetMIPProfileResponse_PrimaryHomeAgentAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx12->mIPV4Address[0]; + ULONG ip1 = pTLVx12->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx12->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx12->mIPV4Address[3] << 24; + + *pPrimaryHA = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Secondary Home Agent Address + const sWDSGetMIPProfileResponse_SecondaryHomeAgentAddress * pTLVx13; + ULONG outLenx13; + rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx13 < sizeof( sWDSGetMIPProfileResponse_SecondaryHomeAgentAddress )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx13->mIPV4Address[0]; + ULONG ip1 = pTLVx13->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx13->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx13->mIPV4Address[3] << 24; + + *pSecondaryHA = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Reverse tunneling, if enabled + const sWDSGetMIPProfileResponse_ReverseTunneling * pTLVx14; + ULONG outLenx14; + rc = GetTLV( inLen, pIn, 0x14, &outLenx14, (const BYTE **)&pTLVx14 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWDSGetMIPProfileResponse_ReverseTunneling )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRevTunneling = pTLVx14->mReverseTunneling; + } + + // Find the NAI, if enabled + const sWDSGetMIPProfileResponse_NAI * pTLVx15; + ULONG outLenx15; + rc = GetTLV( inLen, pIn, 0x15, &outLenx15, (const BYTE **)&pTLVx15 ); + if (rc == eGOBI_ERR_NONE) + { + if (naiSize < outLenx15 + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pNAI, (const BYTE *)pTLVx15, outLenx15 ); + + // Null terminate + pNAI[outLenx15] = 0; + } + + // Find the HA SPI + const sWDSGetMIPProfileResponse_HASPI * pTLVx16; + ULONG outLenx16; + rc = GetTLV( inLen, pIn, 0x16, &outLenx16, (const BYTE **)&pTLVx16 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx16 < sizeof( sWDSGetMIPProfileResponse_HASPI )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pHASPI = pTLVx16->mHASPI; + } + + // Find the AAA SPI + const sWDSGetMIPProfileResponse_AAASPI * pTLVx17; + ULONG outLenx17; + rc = GetTLV( inLen, pIn, 0x17, &outLenx17, (const BYTE **)&pTLVx17 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx17 < sizeof( sWDSGetMIPProfileResponse_AAASPI )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pAAASPI = pTLVx17->mAAASPI; + } + + // Find the HA state + const sWDSGetMIPProfileResponse_HAState * pTLVx1A; + ULONG outLenx1A; + rc = GetTLV( inLen, pIn, 0x1A, &outLenx1A, (const BYTE **)&pTLVx1A ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1A < sizeof( sWDSGetMIPProfileResponse_HAState )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pHAState = pTLVx1A->mKeyState; + } + + // Find the AAA state + const sWDSGetMIPProfileResponse_AAAState * pTLVx1B; + ULONG outLenx1B; + rc = GetTLV( inLen, pIn, 0x1B, &outLenx1B, (const BYTE **)&pTLVx1B ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx1B < sizeof( sWDSGetMIPProfileResponse_AAAState )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pAAAState = pTLVx1B->mKeyState; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetMobileIPParameters + +DESCRIPTION: + This function sets the specified mobile IP parameters + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSPC [ I ] - Six digit service programming code + pMode [ I ] - (Optional) Desired mobile IP setting + pRetryLimit [ I ] - (Optional) Retry attempt limit + pRetryInterval [ I ] - (Optional) Retry attempt interval + pReRegPeriod [ I ] - (Optional) Re-registration period + pReRegTraffic [ I ] - (Optional) Re-registration only with traffic? + pHAAuthenticator [ I ] - (Optional) MH-HA authenticator calculator? + pHA2002bis [ I ] - (Optional) MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetMobileIPParameters( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + // Validate arguments + if (pOut == 0 || pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (spc.find_first_not_of( "0123456789" ) != std::string::npos ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWDSSetMIPParametersRequest_SPC ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)pOut; + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_SPC * pTLVx01; + pTLVx01 = (sWDSSetMIPParametersRequest_SPC*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + memcpy( &pTLVx01->mSPC[0], spc.c_str(), spc.size() ); + + offset += tlvx01Sz; + + // Add Mode, if specified + if (pMode != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWDSSetMIPParametersRequest_MobileIPMode ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_MobileIPMode * pTLVx10; + pTLVx10 = (sWDSSetMIPParametersRequest_MobileIPMode*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the value + pTLVx10->mMIPMode = (eQMIMobileIPModes)*pMode; + + offset += tlvx10Sz; + } + + // Add Retry Limit, if specified + if (pRetryLimit != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWDSSetMIPParametersRequest_RetryAttemptLimit ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_RetryAttemptLimit * pTLVx11; + pTLVx11 = (sWDSSetMIPParametersRequest_RetryAttemptLimit*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Set the value + pTLVx11->mRetryAttemptLimit = *pRetryLimit; + + offset += tlvx11Sz; + } + + // Add Retry interval, if specified + if (pRetryInterval != 0) + { + // Check size + WORD tlvx12Sz = sizeof( sWDSSetMIPParametersRequest_RetryAttemptInterval ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx12Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x12; + pHeader->mLength = tlvx12Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_RetryAttemptInterval * pTLVx12; + pTLVx12 = (sWDSSetMIPParametersRequest_RetryAttemptInterval*)(pOut + offset); + memset( pTLVx12, 0, tlvx12Sz ); + + // Set the value + pTLVx12->mRetryAttemptInterval = *pRetryInterval; + + offset += tlvx12Sz; + } + + // Add Re-registration period, if specified + if (pReRegPeriod != 0) + { + // Check size + WORD tlvx13Sz = sizeof( sWDSSetMIPParametersRequest_ReRegistrationPeriod ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx13Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x13; + pHeader->mLength = tlvx13Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_ReRegistrationPeriod * pTLVx13; + pTLVx13 = (sWDSSetMIPParametersRequest_ReRegistrationPeriod*)(pOut + offset); + memset( pTLVx13, 0, tlvx13Sz ); + + // Set the value + pTLVx13->mReRegistrationPeriod = *pReRegPeriod; + + offset += tlvx13Sz; + } + + // Add Re-registration on traffic flag, if specified + if (pReRegTraffic != 0) + { + // Check size + WORD tlvx14Sz = sizeof( sWDSSetMIPParametersRequest_ReRegistrationOnlyWithTraffic ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx14Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x14; + pHeader->mLength = tlvx14Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_ReRegistrationOnlyWithTraffic * pTLVx14; + pTLVx14 = (sWDSSetMIPParametersRequest_ReRegistrationOnlyWithTraffic*)(pOut + offset); + memset( pTLVx14, 0, tlvx14Sz ); + + // Set the value + pTLVx14->mReRegistrationOnlyWithTraffic = (*pReRegTraffic == 0 ? 0 : 1); + + offset += tlvx14Sz; + } + + // Add HA authenticator flag, if specified + if (pHAAuthenticator != 0) + { + // Check size + WORD tlvx15Sz = sizeof( sWDSSetMIPParametersRequest_MNHAAuthenticatorCalculator ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx15Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x15; + pHeader->mLength = tlvx15Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_MNHAAuthenticatorCalculator * pTLVx15; + pTLVx15 = (sWDSSetMIPParametersRequest_MNHAAuthenticatorCalculator*)(pOut + offset); + memset( pTLVx15, 0, tlvx15Sz ); + + // Set the value + pTLVx15->mMNHAAuthenticatorCalculator = (*pHAAuthenticator == 0 ? 0 : 1); + + offset += tlvx15Sz; + } + + // Add HA RFC2002bis authentication flag, if specified + if (pHA2002bis != 0) + { + // Check size + WORD tlvx16Sz = sizeof( sWDSSetMIPParametersRequest_MNHARFC2002BISAuthentication ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx16Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x16; + pHeader->mLength = tlvx16Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetMIPParametersRequest_MNHARFC2002BISAuthentication * pTLVx16; + pTLVx16 = (sWDSSetMIPParametersRequest_MNHARFC2002BISAuthentication*)(pOut + offset); + memset( pTLVx16, 0, tlvx16Sz ); + + // Set the value + pTLVx16->mMNHARFC2002BISAuthentication = (*pHA2002bis == 0 ? 0 : 1); + + offset += tlvx16Sz; + } + + // At least one of the optional parameters must have been set + if (offset <= sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetMobileIPParameters + +DESCRIPTION: + This function gets the mobile IP parameters + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMode [ O ] - Current mobile IP setting + pRetryLimit [ O ] - Retry attempt limit + pRetryInterval [ O ] - Retry attempt interval + pReRegPeriod [ O ] - Re-registration period + pReRegTraffic [ O ] - Re-registration only with traffic? + pHAAuthenticator [ O ] - MH-HA authenticator calculator? + pHA2002bis [ O ] - MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetMobileIPParameters( + ULONG inLen, + const BYTE * pIn, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + // Validate arguments + if (pIn == 0 + || pMode == 0 + || pRetryLimit == 0 + || pRetryInterval == 0 + || pReRegPeriod == 0 + || pReRegTraffic == 0 + || pHAAuthenticator == 0 + || pHA2002bis == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pMode = 0xffffffff; + *pRetryLimit = 0xff; + *pRetryInterval = 0xff; + *pReRegPeriod = 0xff; + *pReRegTraffic = 0xff; + *pHAAuthenticator = 0xff; + *pHA2002bis = 0xff; + + // Find the mode + const sWDSGetMIPParametersResponse_MobileIPMode * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWDSGetMIPParametersResponse_MobileIPMode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMode = pTLVx10->mMIPMode; + } + + // Find the Retry limit + const sWDSGetMIPParametersResponse_RetryAttemptLimit * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sWDSGetMIPParametersResponse_RetryAttemptLimit )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRetryLimit = pTLVx11->mRetryAttemptLimit; + } + + // Find the Retry Interval + const sWDSGetMIPParametersResponse_RetryAttemptInterval * pTLVx12; + ULONG outLenx12; + rc = GetTLV( inLen, pIn, 0x12, &outLenx12, (const BYTE **)&pTLVx12 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx12 < sizeof( sWDSGetMIPParametersResponse_RetryAttemptInterval )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pRetryInterval = pTLVx12->mRetryAttemptInterval; + } + + // Find the Re-registration period + const sWDSGetMIPParametersResponse_ReRegistrationPeriod * pTLVx13; + ULONG outLenx13; + rc = GetTLV( inLen, pIn, 0x13, &outLenx13, (const BYTE **)&pTLVx13 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx13 < sizeof( sWDSGetMIPParametersResponse_ReRegistrationPeriod )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pReRegPeriod = pTLVx13->mReRegistrationPeriod; + } + + // Find the Re-register on traffic flag + const sWDSGetMIPParametersResponse_ReRegistrationOnlyWithTraffic * pTLVx14; + ULONG outLenx14; + rc = GetTLV( inLen, pIn, 0x14, &outLenx14, (const BYTE **)&pTLVx14 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx14 < sizeof( sWDSGetMIPParametersResponse_ReRegistrationOnlyWithTraffic )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pReRegTraffic = pTLVx14->mReRegistrationOnlyWithTraffic; + } + + // Find the HA authenticator + const sWDSGetMIPParametersResponse_MNHAAuthenticatorCalculator * pTLVx15; + ULONG outLenx15; + rc = GetTLV( inLen, pIn, 0x15, &outLenx15, (const BYTE **)&pTLVx15 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx15 < sizeof( sWDSGetMIPParametersResponse_MNHAAuthenticatorCalculator )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pHAAuthenticator = pTLVx15->mMNHAAuthenticatorCalculator; + } + + // Find the HA RFC2002bis authentication flag + const sWDSGetMIPParametersResponse_MNHARFC2002BISAuthentication * pTLVx16; + ULONG outLenx16; + rc = GetTLV( inLen, pIn, 0x16, &outLenx16, (const BYTE **)&pTLVx16 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx16 < sizeof( sWDSGetMIPParametersResponse_MNHARFC2002BISAuthentication )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pHA2002bis = pTLVx16->mMNHARFC2002BISAuthentication; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetLastMobileIPError + +DESCRIPTION: + This function gets the last mobile IP error + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pError [ O ] - Last mobile IP error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetLastMobileIPError( + ULONG inLen, + const BYTE * pIn, + ULONG * pError ) +{ + // Validate arguments + if (pIn == 0 || pError == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sWDSGetLastMIPStatusResponse_Status * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetLastMIPStatusResponse_Status )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pError = pTLVx01->mLastMIPStatus; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSetDNSSettings + +DESCRIPTION: + This function sets the DNS settings for the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetDNSSettings( + ULONG * pOutLen, + BYTE * pOut, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + // Validate arguments + // At least one must be specified + if (pOut == 0 || (pPrimaryDNS == 0 && pSecondaryDNS == 0)) + { + return eGOBI_ERR_INVALID_ARG; + } + + sQMIRawContentHeader * pHeader; + ULONG offset = 0; + + // Add Primary DNS, if specified + if (pPrimaryDNS != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWDSSetDNSSettingRequest_PrimaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetDNSSettingRequest_PrimaryDNS * pTLVx10; + pTLVx10 = (sWDSSetDNSSettingRequest_PrimaryDNS*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + ULONG ip0 = (*pPrimaryDNS & 0x000000FF); + ULONG ip1 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx10->mIPV4Address[0] = (INT8)ip0; + pTLVx10->mIPV4Address[1] = (INT8)ip1; + pTLVx10->mIPV4Address[2] = (INT8)ip2; + pTLVx10->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx10Sz; + } + + // Add Secondary DNS, if specified + if (pSecondaryDNS != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWDSSetDNSSettingRequest_SecondaryDNS ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + sWDSSetDNSSettingRequest_SecondaryDNS * pTLVx11; + pTLVx11 = (sWDSSetDNSSettingRequest_SecondaryDNS*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + ULONG ip0 = (*pSecondaryDNS & 0x000000FF); + ULONG ip1 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip3 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // Set the value + pTLVx11->mIPV4Address[0] = (INT8)ip0; + pTLVx11->mIPV4Address[1] = (INT8)ip1; + pTLVx11->mIPV4Address[2] = (INT8)ip2; + pTLVx11->mIPV4Address[3] = (INT8)ip3; + + offset += tlvx11Sz; + } + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetDNSSettings + +DESCRIPTION: + This function gets the DNS settings for the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetDNSSettings( + ULONG inLen, + const BYTE * pIn, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + // Validate arguments + if (pIn == 0 || pPrimaryDNS == 0 || pSecondaryDNS == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the Primary DNS + const sWDSGetDNSSettingResponse_PrimaryDNS * pTLVx10; + ULONG outLenx10; + ULONG rc = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWDSGetDNSSettingResponse_PrimaryDNS )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx10->mIPV4Address[0]; + ULONG ip1 = pTLVx10->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx10->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx10->mIPV4Address[3] << 24; + + *pPrimaryDNS = (ip0 | ip1 | ip2 | ip3); + } + + // Find the Secondary DNS + const sWDSGetDNSSettingResponse_SecondaryDNS * pTLVx11; + ULONG outLenx11; + rc = GetTLV( inLen, pIn, 0x11, &outLenx11, (const BYTE **)&pTLVx11 ); + if (rc == eGOBI_ERR_NONE) + { + if (outLenx11 < sizeof( sWDSGetDNSSettingResponse_SecondaryDNS )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG ip0 = pTLVx11->mIPV4Address[0]; + ULONG ip1 = pTLVx11->mIPV4Address[1] << 8; + ULONG ip2 = pTLVx11->mIPV4Address[2] << 16; + ULONG ip3 = pTLVx11->mIPV4Address[3] << 24; + + *pSecondaryDNS = (ip0 | ip1 | ip2 | ip3); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetDataBearerTechnology + +DESCRIPTION: + This function retrieves the current data bearer technology (only + valid when connected) + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pDataCaps [ O ] - The data bearer technology + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetDataBearerTechnology( + ULONG inLen, + const BYTE * pIn, + ULONG * pDataBearer ) +{ + // Validate arguments + if (pIn == 0 || pDataBearer == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the TLV + const sWDSGetDataBearerTechnologyResponse_Technology * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Is the TLV large enough? + if (outLenx01 < sizeof( sWDSGetDataBearerTechnologyResponse_Technology )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pDataBearer = pTLVx01->mDataBearerTechnology; + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationWMS.cpp b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationWMS.cpp new file mode 100755 index 0000000..6bc2c37 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Gobi3000Translation/Gobi3000TranslationWMS.cpp @@ -0,0 +1,1121 @@ +/*=========================================================================== +FILE: + Gobi3000TranslationWMS.cpp + +DESCRIPTION: + QUALCOMM Translation for Gobi 3000 (WMS Service) + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Gobi3000Translation.h" + +/*=========================================================================== +METHOD: + PackDeleteSMS + +DESCRIPTION: + This function deletes one or more SMS messages from device memory + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + storageType [ I ] - SMS message storage type + pMessageIndex [ I ] - (Optional) message index + pMessageTag [ I ] - (Optional) message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackDeleteSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSDeleteRequest_MemoryStorage ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The SPC + sWMSDeleteRequest_MemoryStorage * pTLVx01; + pTLVx01 = (sWMSDeleteRequest_MemoryStorage*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mStorageType = (eQMIWMSStorageTypes)storageType; + + offset += tlvx01Sz; + + // Add the Message index, if specified + if (pMessageIndex != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWMSDeleteRequest_MessageIndex ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // The SPC + sWMSDeleteRequest_MessageIndex * pTLVx10; + pTLVx10 = (sWMSDeleteRequest_MessageIndex*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the values + pTLVx10->mStorageIndex = *pMessageIndex; + + offset += tlvx10Sz; + } + + // Add the Message tag, if specified + if (pMessageTag != 0) + { + // Check size + WORD tlvx11Sz = sizeof( sWMSDeleteRequest_MessageTag ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx11Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x11; + pHeader->mLength = tlvx11Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // The SPC + sWMSDeleteRequest_MessageTag * pTLVx11; + pTLVx11 = (sWMSDeleteRequest_MessageTag*)(pOut + offset); + memset( pTLVx11, 0, tlvx11Sz ); + + // Set the values + pTLVx11->mMessageTag = (eQMIWMSMessageTags)*pMessageTag; + + offset += tlvx11Sz; + } + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetSMSList + +DESCRIPTION: + This function returns the list of SMS messages stored on the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + storageType [ I ] - SMS message storage type + pRequestedTag [ I ] - Message index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetSMSList( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG * pRequestedTag ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSListMessagesRequest_MemoryStorage ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The storage type + sWMSListMessagesRequest_MemoryStorage * pTLVx01; + pTLVx01 = (sWMSListMessagesRequest_MemoryStorage*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mStorageType = (eQMIWMSStorageTypes)storageType; + + offset += tlvx01Sz; + + // Add the Message tag, if specified + if (pRequestedTag != 0) + { + // Check size + WORD tlvx10Sz = sizeof( sWMSListMessagesRequest_MessageTag ); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHeader = (sQMIRawContentHeader*)(pOut + offset); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + offset += sizeof( sQMIRawContentHeader ); + + // The SPC + sWMSListMessagesRequest_MessageTag * pTLVx10; + pTLVx10 = (sWMSListMessagesRequest_MessageTag*)(pOut + offset); + memset( pTLVx10, 0, tlvx10Sz ); + + // Set the values + pTLVx10->mMessageTag = (eQMIWMSMessageTags)*pRequestedTag; + + offset += tlvx10Sz; + } + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSMSList + +DESCRIPTION: + This function returns the list of SMS messages stored on the device + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMessageListSize [I/O] - Upon input the maximum number of elements that the + message list array can contain. Upon successful + output the actual number of elements in the message + list array + pMessageList [ O ] - The message list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSMSList( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageListSize, + BYTE * pMessageList ) +{ + // Validate arguments + if (pIn == 0 || pMessageListSize == 0 + || *pMessageListSize == 0 || pMessageList == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxMessageListSz = *pMessageListSize; + + // Assume failure + *pMessageListSize = 0; + + // Find the messages + const sWMSListMessagesResponse_MessageList * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sWMSListMessagesResponse_MessageList )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG messageListSz = pTLVx01->mNumberOfMessages; + if (messageListSz == 0) + { + // No stored messages, but not necessarily a failure + return eGOBI_ERR_NONE; + } + + if (maxMessageListSz < messageListSz) + { + messageListSz = maxMessageListSz; + } + + const sWMSListMessagesResponse_MessageList::sMessage * pMessages; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sWMSListMessagesResponse_MessageList ) + + sizeof( sWMSListMessagesResponse_MessageList::sMessage ) + * messageListSz) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pMessages = (const sWMSListMessagesResponse_MessageList::sMessage *) + ((const BYTE *)pTLVx01 + + sizeof( sWMSListMessagesResponse_MessageList )); + + ULONG * pData = (ULONG *)pMessageList; + for (ULONG m = 0; m < messageListSz; m++) + { + *pData++ = pMessages->mStorageIndex; + *pData++ = pMessages->mMessageTag; + pMessages++; + } + + *pMessageListSize = messageListSz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackGetSMS + +DESCRIPTION: + This function returns an SMS message from device memory + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackGetSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageIndex ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSRawReadRequest_MessageIndex ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The index + sWMSRawReadRequest_MessageIndex * pTLVx01; + pTLVx01 = (sWMSRawReadRequest_MessageIndex*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mStorageType = (eQMIWMSStorageTypes)storageType; + pTLVx01->mStorageIndex = messageIndex; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSMS + +DESCRIPTION: + This function returns an SMS message from device memory + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMessageTag [ O ] - Message tag + pMessageFormat [ O ] - Message format + pMessageSize [I/O] - Upon input the maximum number of bytes that can be + written to the message array. Upon successful + output the actual number of bytes written to the + message array + pMessage [ O ] - The message contents array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ) +{ + // Validate arguments + if (pIn == 0 + || pMessageTag == 0 + || pMessageFormat == 0 + || pMessageSize == 0 + || *pMessageSize == 0 + || pMessage == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxMessageSz = *pMessageSize; + + // Assume failure + *pMessageSize = 0; + + // Find the messages + const sWMSRawReadResponse_MessageData * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sWMSRawReadResponse_MessageData )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMessageTag = pTLVx01->mMessageTag; + *pMessageFormat = pTLVx01->mMessageFormat; + + ULONG messageSz = pTLVx01->mRawMessageLength; + if (messageSz == 0) + { + // No stored messages, but not necessarily a failure + return eGOBI_ERR_NONE; + } + + if (messageSz > maxMessageSz) + { + messageSz = maxMessageSz; + } + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sWMSRawReadResponse_MessageData ) + messageSz) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + memcpy( pMessage, + pTLVx01 + sizeof( sWMSRawReadResponse_MessageData ), + messageSz ); + + *pMessageSize = messageSz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackModifySMSStatus + +DESCRIPTION: + This function modifies the status of an SMS message saved in storage on + the device + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + messageTag [ I ] - Message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackModifySMSStatus( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ) +{ + // Validate arguments + if (pOut == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSModifyTagRequest_MessageTag ); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The index + sWMSModifyTagRequest_MessageTag * pTLVx01; + pTLVx01 = (sWMSModifyTagRequest_MessageTag*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mStorageType = (eQMIWMSStorageTypes)storageType; + pTLVx01->mStorageIndex = messageIndex; + pTLVx01->mMessageTag = (eQMIWMSMessageTags)messageTag; + + offset += tlvx01Sz; + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSaveSMS + +DESCRIPTION: + This function saves an SMS message to device memory + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + storageType [ I ] - SMS message storage type + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSaveSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage ) +{ + // Validate arguments + if (pOut == 0 || messageSize == 0 || pMessage == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSRawWriteRequest_MessageData ) + + (WORD)messageSize; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The index + sWMSRawWriteRequest_MessageData * pTLVx01; + pTLVx01 = (sWMSRawWriteRequest_MessageData*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mStorageType = (eQMIWMSStorageTypes)storageType; + pTLVx01->mMessageFormat = (eQMIWMSMessageFormats)messageFormat; + pTLVx01->mRawMessageLength = (UINT16)messageSize; + + offset += sizeof( sWMSRawWriteRequest_MessageData ); + + // Add the message + memcpy( (pOut + offset), pMessage, messageSize ); + + offset += messageSize; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseSaveSMS + +DESCRIPTION: + This function saves an SMS message to device memory + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMessageIndex [ O ] - The message index assigned by the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseSaveSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageIndex ) +{ + // Validate arguments + if (pIn == 0 || pMessageIndex == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Find the messages + const sWMSRawWriteResponse_MessageIndex * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sWMSRawWriteResponse_MessageIndex )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMessageIndex = pTLVx01->mStorageIndex; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PackSendSMS + +DESCRIPTION: + This function sends an SMS message for immediate over the air transmission + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSendSMS( + ULONG * pOutLen, + BYTE * pOut, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage ) +{ + // Validate arguments + if (pOut == 0 || messageSize == 0 || pMessage == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Check size + WORD tlvx01Sz = sizeof( sWMSRawSendRequest_MessageData ) + + (WORD)messageSize; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // The index + sWMSRawSendRequest_MessageData * pTLVx01; + pTLVx01 = (sWMSRawSendRequest_MessageData*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mMessageFormat = (eQMIWMSMessageFormats)messageFormat; + pTLVx01->mRawMessageLength = (UINT16)messageSize; + + offset += sizeof( sWMSRawSendRequest_MessageData ); + + // Add the message + memcpy( (pOut + offset), pMessage, messageSize ); + + offset += messageSize; + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseSendSMS + +DESCRIPTION: + This function sends an SMS message for immediate over the air transmission + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pMessageFailureCode [ O ] - When the function fails due to an error sending + the message this parameter may contain the + message failure cause code (see 3GPP2 N.S0005 + Section 6.5.2.125). If the cause code is not + provided then the value will be 0xFFFFFFFF + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseSendSMS( + ULONG inLen, + const BYTE * pIn, + ULONG * pMessageFailureCode ) +{ + // Validate arguments + if (pIn == 0 || pMessageFailureCode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume we have no message failure cause code + *pMessageFailureCode = 0xffffffff; + + // Check mandatory response + const sResultCode * pTLVx02; + ULONG outLenx02; + ULONG rc = GetTLV( inLen, pIn, 0x02, &outLenx02, (const BYTE **)&pTLVx02 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx02 < sizeof( sResultCode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + if (pTLVx02->mQMIResult != eQMIResults_Success) + { + rc = pTLVx02->mQMIError + eGOBI_ERR_QMI_OFFSET; + } + + if (rc != eGOBI_ERR_NONE) + { + // Check for the failure code (optional) + const sWMSRawSendResponse_CauseCode * pTLVx10; + ULONG outLenx10; + ULONG rc2 = GetTLV( inLen, pIn, 0x10, &outLenx10, (const BYTE **)&pTLVx10 ); + if (rc2 == eGOBI_ERR_NONE) + { + if (outLenx10 < sizeof( sWMSRawSendResponse_CauseCode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + *pMessageFailureCode = pTLVx10->mCauseCode; + } + } + + return rc; +} + +/*=========================================================================== +METHOD: + ParseGetSMSCAddress + +DESCRIPTION: + This function returns the SMS center address + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + addressSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address array + can contain + pSMSCAddress [ O ] - The SMS center address represented as a NULL + terminated string + typeSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address type array + can contain + pSMSCType [ O ] - The SMS center address type represented as a NULL + terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSMSCAddress( + ULONG inLen, + const BYTE * pIn, + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ) +{ + // Validate arguments + if (pIn == 0 + || addressSize == 0 || pSMSCAddress == 0 + || typeSize == 0 || pSMSCType == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume empty + pSMSCAddress[0] = 0; + pSMSCType[0] = 0; + + // Get the address (mandatory) + const sWMSGetSMSCAddressResponse_Address * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sWMSRawSendResponse_CauseCode )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Handle the type as a string (maximum 3 chars) + std::string smscType( &pTLVx01->mSMSCAddressType[0], 3 ); + + // Is the SMSC type present? (optional) + ULONG smscTypeLen = (ULONG)smscType.size(); + if (smscTypeLen > 0) + { + // Space to perform copy? + if (typeSize < smscTypeLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pSMSCType, &pTLVx01->mSMSCAddressType[0], smscTypeLen ); + pSMSCType[smscTypeLen] = 0; + } + + // Treat the address as a null terminated string + std::string smscAddr( (const CHAR *)pTLVx01 + + sizeof( sWMSGetSMSCAddressResponse_Address ), + pTLVx01->mSMSCAddressLength ); + + ULONG smscAddrLen = (ULONG)smscAddr.size(); + if (addressSize < smscAddrLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pSMSCAddress, smscAddr.c_str(), addressSize ); + pSMSCAddress[addressSize] = 0; + + return rc; +} + +/*=========================================================================== +METHOD: + PackSetSMSCAddress + +DESCRIPTION: + This function sets the SMS center address + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + pSMSCAddress [ I ] - The SMS center address represented as a NULL + terminated string + pSMSCType [ I ] - The SMS center address type represented as a NULL + terminated string (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetSMSCAddress( + ULONG * pOutLen, + BYTE * pOut, + CHAR * pSMSCAddress, + CHAR * pSMSCType ) +{ + // Validate arguments + if (pOut == 0 || pSMSCAddress == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // The TLV contains only the address + std::string smscAddr( pSMSCAddress ); + + // Check size + WORD tlvx01Sz = (WORD)smscAddr.size(); + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + memcpy( (pOut + offset), smscAddr.c_str(), tlvx01Sz ); + offset += tlvx01Sz; + + // smscType is optional + if (pSMSCType != 0) + { + // The TLV contains only the type + std::string smscType( pSMSCType ); + + if (smscType.size() != 0) + { + // Check size + WORD tlvx10Sz = (WORD)smscType.size(); + if (*pOutLen < offset + sizeof( sQMIRawContentHeader ) + tlvx10Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x10; + pHeader->mLength = tlvx10Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + memcpy( (pOut + offset), smscType.c_str(), tlvx10Sz ); + offset += tlvx10Sz; + } + } + + + *pOutLen = offset; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ParseGetSMSRoutes + +DESCRIPTION: + This function gets the current incoming SMS routing information + +PARAMETERS: + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pRouteSize [I/O] - Upon input the maximum number of elements that the + SMS route array can contain. Upon succes the actual + number of elements in the SMS route array + pRoutes [ O ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ParseGetSMSRoutes( + ULONG inLen, + const BYTE * pIn, + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + // Validate arguments + if (pIn == 0 || pRouteSize == 0 || *pRouteSize == 0 || pRoutes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxRoutes = *pRouteSize; + *pRouteSize = 0; + + // Get the route list + const sWMSGetRoutesResponse_RouteList * pTLVx01; + ULONG outLenx01; + ULONG rc = GetTLV( inLen, pIn, 0x01, &outLenx01, (const BYTE **)&pTLVx01 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + if (outLenx01 < sizeof( sWMSGetRoutesResponse_RouteList )) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + ULONG routeCount = pTLVx01->mNumberOfRoutes; + if (routeCount > (ULONG)maxRoutes) + { + routeCount = (ULONG)maxRoutes; + } + + const sWMSGetRoutesResponse_RouteList::sRoute * pInRoute; + + // Verify there is room for the array in the TLV + if (outLenx01 < sizeof( sWMSGetRoutesResponse_RouteList ) + + sizeof( sWMSGetRoutesResponse_RouteList::sRoute ) + * routeCount) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Align to the first array element + pInRoute = (const sWMSGetRoutesResponse_RouteList::sRoute *) + ((const BYTE *)pTLVx01 + + sizeof( sWMSGetRoutesResponse_RouteList )); + + ULONG * pRouteArray = (ULONG *)pRoutes; + for (ULONG r = 0; r < routeCount; r++) + { + *pRouteArray++ = pInRoute->mMessageType; + *pRouteArray++ = pInRoute->mMessageClass; + *pRouteArray++ = pInRoute->mStorageType; + *pRouteArray++ = pInRoute->mRouteValue; + pInRoute++; + } + + *pRouteSize = (BYTE)routeCount; + return rc; +} + +/*=========================================================================== +METHOD: + PackSetSMSRoutes + +DESCRIPTION: + This function sets the desired incoming SMS routing information + +PARAMETERS: + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied to pOut + pOut [ O ] - Output buffer + pRouteSize [ I ] - The number of elements in the SMS route array + pRoutes [ I ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PackSetSMSRoutes( + ULONG * pOutLen, + BYTE * pOut, + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + // Validate arguments + if (pOut == 0 || pRouteSize == 0 || *pRouteSize == 0 || pRoutes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + UINT16 routeCount = (ULONG)*pRouteSize; + + // Check size + WORD tlvx01Sz = sizeof( sWMSSetRoutesRequest_RouteList ) + + sizeof( sWMSSetRoutesRequest_RouteList::sRoute ) * routeCount; + if (*pOutLen < sizeof( sQMIRawContentHeader ) + tlvx01Sz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pHeader = (sQMIRawContentHeader*)(pOut); + pHeader->mTypeID = 0x01; + pHeader->mLength = tlvx01Sz; + + ULONG offset = sizeof( sQMIRawContentHeader ); + + // Add route count + sWMSSetRoutesRequest_RouteList * pTLVx01; + pTLVx01 = (sWMSSetRoutesRequest_RouteList*)(pOut + offset); + memset( pTLVx01, 0, tlvx01Sz ); + + // Set the values + pTLVx01->mNumberOfRoutes = routeCount; + offset += sizeof( sWMSSetRoutesRequest_RouteList ); + + sWMSSetRoutesRequest_RouteList::sRoute * pOutRoute; + + // Align to the first array element + pOutRoute = (sWMSSetRoutesRequest_RouteList::sRoute *)(pOut + offset); + + // Add the routes + ULONG * pRouteArray = (ULONG *)pRoutes; + for (ULONG r = 0; r < routeCount; r++) + { + pOutRoute->mMessageType = (eQMIWMSMessageTypes)*pRouteArray++; + pOutRoute->mMessageClass = (eQMIWMSMessageClasses)*pRouteArray++; + pOutRoute->mStorageType = (eQMIWMSStorageTypes)*pRouteArray++; + pOutRoute->mReceiptAction = (eQMIWMSReceiptActions)*pRouteArray++; + pOutRoute++; + offset += sizeof( sWMSSetRoutesRequest_RouteList::sRoute ); + } + + *pOutLen = offset; + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmt.cpp b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmt.cpp new file mode 100755 index 0000000..b6775c0 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmt.cpp @@ -0,0 +1,606 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmt.cpp + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi + +PUBLIC CLASSES AND FUNCTIONS: + CGobiConnectionMgmtDLL + cGobiConnectionMgmt + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiConnectionMgmt.h" +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Global object +CGobiConnectionMgmtDLL gDLL; + +// Interval between traffic processing loop iterations (milliseconds) +const ULONG TRAFFIC_INTERVAL_MS = 300000; + +// Maximum amount of time to wait for the traffic thread to exit +const ULONG THREAD_EXIT_TIME = 2000; + +/*=========================================================================== +METHOD: + TrafficProcessThread (Free Method) + +DESCRIPTION: + QMI traffic process thread - processes all traffic in order to fire + off QMI traffic related callbacks + +PARAMETERS: + pArg [ I ] - Object to interface to + +RETURN VALUE: + void * - thread exit value (always 0) +===========================================================================*/ +void * TrafficProcessThread( PVOID pArg ) +{ + // Keep running? + bool bRun = false; + + // Create a vector of the objects to wait on + std::vector events; + + // Store the index to service type for use later + std::map services; + + // Grab API object + cGobiConnectionMgmt * pAPI = (cGobiConnectionMgmt *)pArg; + if (pAPI != 0) + { + // Time to go to work + bRun = true; + + // Add the thread exit event + events.push_back( &pAPI->mExitEvent ); + + // Grab signal events for our protocol servers + std::map ::const_iterator pIter; + pIter = pAPI->mServers.begin(); + while (pIter != pAPI->mServers.end()) + { + eQMIService svc = pIter->first; + cQMIProtocolServer * pServer = pAPI->GetServer( svc ); + if (pServer != 0) + { + // Grab the log from the server + const cProtocolLog & log = pServer->GetLog(); + + // Grab the Signal event, if it exists + cEvent & sigEvent = log.GetSignalEvent(); + + services[events.size()] = svc; + events.push_back( &sigEvent ); + } + + pIter++; + } + } + + TRACE( "GobiConnectionMgmt traffic thread [%u] started\n", + (UINT)pthread_self() ); + + // Loop waiting for exit event + while (bRun == true) + { + // Wait for activity + DWORD ignoredVal, index; + int nRet = WaitOnMultipleEvents( events, + TRAFFIC_INTERVAL_MS, + ignoredVal, + index ); + + // Timeout + if (nRet == -ETIME) + { + // Do nothing + } + // Error? + else if (nRet <= 0) + { + TRACE( "GobiConnectionMgmt traffic thread wait error %d\n", nRet ); + bRun = false; + } + // Exit event? + else if (index == 0) + { + bRun = false; + } + else if (index < events.size()) + { + // Run ProcessTraffic() for this service type + if (services.find( index ) != services.end()) + { + pAPI->ProcessTraffic( services[index] ); + } + } + else + { + // Fatal error + bRun = false; + } + } + + TRACE( "GobiConnectionMgmt traffic thread [%u] exited\n", + (UINT)pthread_self() ); + + if (pAPI != 0) + { + pAPI->mThreadCleanupFinished = true; + } + + return 0; +} + +/*=========================================================================== +METHOD: + CallbackThread (Free Method) + +DESCRIPTION: + Thread to execute a callback asynchronously + +PARAMETERS: + pArg [ I ] - The cGobiCMCallback object + +RETURN VALUE: + void * - thread exit value (always 0) +===========================================================================*/ +void * CallbackThread( PVOID pArg ) +{ + cGobiCMCallback * pCB = (cGobiCMCallback *)pArg; + if (pCB == 0) + { + ASSERT( 0 ); + return 0; + } + + pCB->Call(); + + delete pCB; + pCB = 0; + + return 0; +} + +/*=========================================================================*/ +// CGobiConnectionMgmtDLL Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + CGobiConnectionMgmtDLL (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +CGobiConnectionMgmtDLL::CGobiConnectionMgmtDLL() +{ + // Create sync CS + pthread_mutex_init( &mSyncSection, NULL ); +} + +/*=========================================================================== +METHOD: + ~CGobiConnectionMgmtDLL (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +CGobiConnectionMgmtDLL::~CGobiConnectionMgmtDLL() +{ + std::map tmpAPI = mAPI; + std::map ::const_iterator pIter; + pIter = tmpAPI.begin(); + + while (pIter != tmpAPI.end()) + { + cGobiConnectionMgmt * pAPI = pIter->second; + if (pAPI != 0) + { + pAPI->Cleanup(); + delete pAPI; + } + + pIter++; + } + + mAPI.clear(); + + pthread_mutex_destroy( &mSyncSection ); +} + +/*=========================================================================== +METHOD: + CreateAPI (Public Method) + +DESCRIPTION: + Create a new API object + +RETURN VALUE: + GOBIHANDLE - Handle to new API object (0 upon failure) +===========================================================================*/ +GOBIHANDLE CGobiConnectionMgmtDLL::CreateAPI() +{ + pthread_mutex_lock( &mSyncSection ); + + cGobiConnectionMgmt * pAPI = new cGobiConnectionMgmt; + if (pAPI != 0) + { + bool bInit = pAPI->Initialize(); + if (bInit == true) + { + mAPI[(GOBIHANDLE)pAPI] = pAPI; + } + } + + pthread_mutex_unlock( &mSyncSection ); + + return (GOBIHANDLE)pAPI; +} + +/*=========================================================================== +METHOD: + DeleteAPI (Public Method) + +DESCRIPTION: + Delete an existing API object + +PARAMETERS: + handle [ I ] - Handle to API object to return + +RETURN VALUE: + None +===========================================================================*/ +void CGobiConnectionMgmtDLL::DeleteAPI( GOBIHANDLE handle ) +{ + pthread_mutex_lock( &mSyncSection ); + + std::map ::iterator pIter; + pIter = mAPI.find( handle ); + if (pIter != mAPI.end()) + { + cGobiConnectionMgmt * pAPI = pIter->second; + delete pAPI; + + mAPI.erase( pIter ); + } + + pthread_mutex_unlock( &mSyncSection ); +} + +/*=========================================================================== +METHOD: + GetAPI (Public Method) + +DESCRIPTION: + Return the requested API object + +PARAMETERS: + handle [ I ] - Handle to API object to return + +RETURN VALUE: + cGobiConnectionMgmt * +===========================================================================*/ +cGobiConnectionMgmt * CGobiConnectionMgmtDLL::GetAPI( GOBIHANDLE handle ) +{ + cGobiConnectionMgmt * pAPI = 0; + + pthread_mutex_lock( &mSyncSection ); + + std::map ::const_iterator pIter; + pIter = mAPI.find( handle ); + if (pIter != mAPI.end()) + { + pAPI = pIter->second; + } + + pthread_mutex_unlock( &mSyncSection ); + + return pAPI; +} + +/*=========================================================================*/ +// cGobiConnectionMgmt Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiConnectionMgmt (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmt::cGobiConnectionMgmt() + : cGobiQMICore(), + mbThreadStarted( false ), + mThreadID( 0 ), + mThreadCleanupFinished( false ) +{ + // Nothing to do but init those variables +} + +/*=========================================================================== +METHOD: + ~cGobiConnectionMgmt (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmt::~cGobiConnectionMgmt() +{ + Disconnect(); +} + +/*=========================================================================== +METHOD: + ProcessTraffic (Internal Method) + +DESCRIPTION: + Process traffic in a QMI server protocol log, this is done to + exercise QMI indication related callbacks + +PARAMETERS: + svc [ I ] - QMI Service type + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessTraffic( eQMIService svc ) +{ + ULONG count = 0; + + std::map ::iterator pIter; + pIter = mServers.find( svc ); + if (pIter == mServers.end()) + { + return; + } + + sServerInfo & si = pIter->second; + cQMIProtocolServer * pSvr = si.mpServer; + if (pSvr == 0) + { + return; + } + + // Grab the service ID from the service + eQMIService svcID = pSvr->GetServiceType(); + if (svcID == eQMI_SVC_ENUM_BEGIN) + { + return; + } + + // Grab the log from the server + const cProtocolLog & logSvr = pSvr->GetLog(); + + // New items to process? + count = logSvr.GetCount(); + if (count != INVALID_LOG_INDEX && count > si.mLogsProcessed) + { + for (ULONG i = si.mLogsProcessed; i < count; i++) + { + sProtocolBuffer buf = logSvr.GetBuffer( i ); + if (buf.IsValid() == false) + { + continue; + } + + eProtocolType pt = buf.GetType(); + if (IsQMIProtocolRX( pt ) == false) + { + continue; + } + + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsIndication() == false) + { + continue; + } + + ULONG msgID = qmiBuf.GetMessageID(); + + tCallbackKey ck( svcID, msgID ); + std::map ::iterator pIter; + pIter = mCallbacks.find( ck ); + if (pIter == mCallbacks.end()) + { + continue; + } + + ULONG outLen = 0; + const BYTE * pOutput = (const BYTE *)qmiBuf.GetRawContents( outLen ); + tCallbackValue cv = pIter->second; + + cGenericCallback * pCB = 0; + pCB = new cGenericCallback( cv.first, + svcID, + msgID, + cv.second, + outLen, + pOutput ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + + si.mLogsProcessed = count; + } +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified Gobi device + +PARAMETERS: + pQMIFile [ I ] - QMI control file to connect to + services [ I ] - QMI services to connect to + +RETURN VALUE: + std::set - Services successfuly configured +===========================================================================*/ +std::set cGobiConnectionMgmt::Connect( + LPCSTR pQMIFile, + std::set & services ) +{ + std::set svcs = cGobiQMICore::Connect( pQMIFile, services ); + if (svcs.size() > 0) + { + // Start the traffic processing thread? + if (mbThreadStarted == false) + { + // Clear mExitEvent; + mExitEvent.Clear(); + + pthread_create( &mThreadID, + NULL, + TrafficProcessThread, + this ); + + mbThreadStarted = true; + } + } + + return svcs; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the currently connected Gobi device + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiConnectionMgmt::Disconnect() +{ + // Clear all callback function pointers + mCallbacks.clear(); + + // Exit traffic processing thread + if (mbThreadStarted == true) + { + // Signal thread to exit + mExitEvent.Set( 0 ); + + // If we are not being called from the thread itself then wait for + // it to exit, if not then it will have to exit automatically + if (pthread_self() != mThreadID) + { + if (mThreadID != 0) + { + pthread_join( mThreadID, NULL ); + } + } + } + + // Clear out thread handle/ID + mbThreadStarted = false; + mThreadID = 0; + + return cGobiQMICore::Disconnect(); +} + +/*=========================================================================== +METHOD: + SetGenericCallback (Public Method) + +DESCRIPTION: + Enable/disable generic callback function + +PARAMETERS: + svcID [ I ] - Service ID to monitor + msgID [ I ] - Message ID to look for + pCallback [ I ] - Generic callback pointer + userValue [ I ] - User value to pass back to callback + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetGenericCallback( + ULONG svcID, + ULONG msgID, + tFNGenericCallback pCallback, + ULONG_PTR userValue ) +{ + // Assume success + eGobiError rc = eGOBI_ERR_NONE; + + tCallbackKey ck( svcID, msgID ); + std::map ::iterator pIter; + pIter = mCallbacks.find( ck ); + + bool bOn = (pCallback != 0 && pIter == mCallbacks.end()); + bool bOff = (pCallback == 0 && pIter != mCallbacks.end()); + bool bReplace = (pCallback != 0 && pIter != mCallbacks.end()); + if (bOn == true || bReplace == true) + { + tCallbackValue cv( pCallback, userValue ); + mCallbacks[ck] = cv; + } + else if (bOff == true) + { + mCallbacks.erase( pIter ); + } + + return rc; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmt.h b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmt.h new file mode 100755 index 0000000..3e84908 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmt.h @@ -0,0 +1,270 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmt.h + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi + +PUBLIC CLASSES AND FUNCTIONS: + CGobiConnectionMgmtDLL + cGobiConnectionMgmt + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Handle to Gobi API +typedef ULONG_PTR GOBIHANDLE; + +extern "C" +{ + // Generic callback function pointer + typedef void (* tFNGenericCallback)( + ULONG svcID, + ULONG msgID, + ULONG_PTR userValue, + ULONG outLen, + const BYTE * pOut ); + +}; + +// CallbackThread prototype +// Thread to execute a callback asynchronously +void * CallbackThread( PVOID pArg ); + +/*=========================================================================*/ +// Class cGobiCMCallback +/*=========================================================================*/ +class cGobiCMCallback +{ + public: + // (Inline) Constructor + cGobiCMCallback() + { }; + + // (Inline) Destructor + virtual ~cGobiCMCallback() + { }; + + // (Inline) Initialize the callback object by starting the thread + bool Initialize() + { + // Start the thread + pthread_t threadID; + pthread_attr_t attributes; + pthread_attr_init( &attributes ); + pthread_attr_setdetachstate( &attributes, PTHREAD_CREATE_DETACHED ); + + int nRC = pthread_create( &threadID, + &attributes, + CallbackThread, + this ); + + if (nRC == 0) + { + // Success! + return true; + } + + return false; + }; + + protected: + // Call the function + virtual void Call() = 0; + + // Function thread gets full access + friend void * CallbackThread( PVOID pArg ); +}; + +/*=========================================================================*/ +// Class cGenericCallback +/*=========================================================================*/ +class cGenericCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cGenericCallback( + tFNGenericCallback pCallback, + ULONG svcID, + ULONG msgID, + ULONG_PTR userValue, + ULONG outLen, + const BYTE * pOut ) + : mServiceID( svcID ), + mMessageID( msgID ), + mUserValue( userValue ), + mOutputLen( 0 ), + mpCallback( pCallback ) + { + memset( &mOutput[0], 0, QMI_MAX_BUFFER_SIZE ); + if (outLen <= QMI_MAX_BUFFER_SIZE && pOut != 0) + { + mOutputLen = outLen; + memcpy( &mOutput[0], pOut, outLen ); + } + }; + + // (Inline) Destructor + virtual ~cGenericCallback() + { + mpCallback = 0; + }; + + protected: + /* Service ID */ + ULONG mServiceID; + + /* Message ID */ + ULONG mMessageID; + + /* User value */ + ULONG_PTR mUserValue; + + /* Actual size of output content */ + ULONG mOutputLen; + + /* Output content buffer */ + BYTE mOutput[QMI_MAX_BUFFER_SIZE]; + + /* Callback function */ + tFNGenericCallback mpCallback; + + // Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mServiceID, + mMessageID, + mUserValue, + mOutputLen, + (const BYTE *)&mOutput[0] ); + } + }; +}; + +/*=========================================================================*/ +// Class cGobiConnectionMgmt +/*=========================================================================*/ +class cGobiConnectionMgmt : public cGobiQMICore +{ + public: + // Constructor + cGobiConnectionMgmt(); + + // Destructor + virtual ~cGobiConnectionMgmt(); + + // Connect to the specified Gobi device interface + virtual std::set Connect( + LPCSTR pInterface, + std::set & services ); + + // Disconnect from the currently connected device interface + virtual bool Disconnect(); + + // Enable/disable generic callback function + eGobiError SetGenericCallback( + ULONG svcID, + ULONG msgID, + tFNGenericCallback pCallback, + ULONG_PTR userValue ); + + protected: + // Process new traffic + void ProcessTraffic( eQMIService svc ); + + /* Is there an active thread? */ + bool mbThreadStarted; + + /* ID of traffic processing thread */ + pthread_t mThreadID; + + /* Traffic processing thread exit event */ + cEvent mExitEvent; + + /* Has the protocol server thread finished cleanup? */ + bool mThreadCleanupFinished; + + /* Generic callback function key/value */ + typedef std::pair tCallbackKey; + typedef std::pair tCallbackValue; + + /* Callback functions */ + std::map mCallbacks; + + // Traffic process thread gets full access + friend VOID * TrafficProcessThread( PVOID pArg ); +}; + +/*=========================================================================*/ +// Class CGobiConnectionMgmtDLL +/*=========================================================================*/ +class CGobiConnectionMgmtDLL +{ + public: + // Constructor + CGobiConnectionMgmtDLL(); + + // Destructor + virtual ~CGobiConnectionMgmtDLL(); + + // Create a new API object + GOBIHANDLE CreateAPI(); + + // Delete an existing API object + void DeleteAPI( GOBIHANDLE handle ); + + // Return the requested API object + cGobiConnectionMgmt * GetAPI( GOBIHANDLE handle ); + + protected: + /* API interface object */ + std::map mAPI; + + /* Synchronization object */ + mutable pthread_mutex_t mSyncSection; +}; + +extern CGobiConnectionMgmtDLL gDLL; diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPI.h b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPI.h new file mode 100755 index 0000000..8d47cf2 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPI.h @@ -0,0 +1,14155 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtAPI.h + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +#ifndef GOBI_TYPEDEFS +#define GOBI_TYPEDEFS + +// Type Definitions +typedef unsigned long ULONG; +typedef unsigned long * ULONG_PTR; +typedef unsigned long long ULONGLONG; +typedef signed char INT8; +typedef unsigned char UINT8; +typedef signed short INT16; +typedef unsigned short UINT16; +typedef signed int INT32; +typedef unsigned int UINT32; +typedef unsigned char BYTE; +typedef char CHAR; +typedef unsigned short WORD; +typedef unsigned short USHORT; +typedef const char * LPCSTR; + +#ifdef WINDOWS + typedef signed __int64 INT64; + typedef unsigned __int64 UINT64; +#else + typedef signed long long INT64; + typedef unsigned long long UINT64; +#endif + +#endif + +/*=========================================================================*/ +// Definitions +/*=========================================================================*/ + +// Handle to Gobi API +typedef ULONG_PTR GOBIHANDLE; + +#ifdef __cplusplus + extern "C" { +#endif + +// Geeneric callback function pointer +typedef void (* tFNGenericCallback)( + ULONG svcID, + ULONG msgID, + GOBIHANDLE handle, + ULONG outLen, + const BYTE * pOut ); + +#ifdef __cplusplus + }; +#endif + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GobiConnect + +DESCRIPTION: + This function connects the CM API library to the specified Gobi + device + +PARAMETERS: + pQMIFile [ I ] - Device interface to connect to + pServicesCount [I/O] - Upon input the number of QMI services to connect to, + upon output the number of QMI services successfully + connected to + pServices [I/O] - Upon input the array of QMI service IDs to connect + to, upon output the array of QMI service IDs + successfully connected to + pHandle [ O ] - The returned Gobi interface handle + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiConnect( + LPCSTR pInterface, + ULONG * pServicesCount, + ULONG * pServices, + GOBIHANDLE * pHandle ); + +/*=========================================================================== +METHOD: + GobiCancel + +DESCRIPTION: + This function cancels the most recent outstanding request for the + specified QMI service + +PARAMETERS: + handle [ I ] - Gobi interface handle + svcID [ I ] - Service whose outstanding request is to be cancelled + pTXID [ O ] - QMI transaction ID of outstanding request + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiCancel( + GOBIHANDLE handle, + ULONG svcID, + ULONG * pTXID ); + +/*=========================================================================== +METHOD: + GobiDisconnect + +DESCRIPTION: + This function disconnects the CM API library from the currently + connected Gobi device + +PARAMETERS: + handle [ I ] - Gobi interface handle + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiDisconnect( GOBIHANDLE handle ); + +/*=========================================================================== +METHOD: + SetGenericCallback + +DESCRIPTION: + This function enables/disables a generic callback + +PARAMETERS: + handle [ I ] - Gobi interface handle + svcID [ I ] - Service ID to monitor + msgID [ I ] - Message ID to look for + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG SetGenericCallback( + GOBIHANDLE handle, + ULONG svcID, + ULONG msgID, + tFNGenericCallback pCallback ); + +/*=========================================================================== +METHOD: + WDSReset + +DESCRIPTION: + The function sends 'WDS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetEventReport + +DESCRIPTION: + The function sends 'WDS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSAbort + +DESCRIPTION: + The function sends 'WDS/Abort Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSAbort( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetIndication + +DESCRIPTION: + The function sends 'WDS/Set Indication Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetIndication( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSStartNetworkInterface + +DESCRIPTION: + The function sends 'WDS/Start Network Interface Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSStartNetworkInterface( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSStopNetworkInterface + +DESCRIPTION: + The function sends 'WDS/Stop Network Interface Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSStopNetworkInterface( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetPacketServiceStatus + +DESCRIPTION: + The function sends 'WDS/Get Packet Service Status Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPacketServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetChannelRates + +DESCRIPTION: + The function sends 'WDS/Get Channel Rates Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetChannelRates( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetPacketStatistics + +DESCRIPTION: + The function sends 'WDS/Get Packet Statistics Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPacketStatistics( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGoDormant + +DESCRIPTION: + The function sends 'WDS/Go Dormant Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGoDormant( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGoActive + +DESCRIPTION: + The function sends 'WDS/Go Active Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGoActive( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSCreateProfile + +DESCRIPTION: + The function sends 'WDS/Create Profile Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSCreateProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSModifyProfile + +DESCRIPTION: + The function sends 'WDS/Modify Profile Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSModifyProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSDeleteProfile + +DESCRIPTION: + The function sends 'WDS/Delete Profile Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSDeleteProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetProfileList + +DESCRIPTION: + The function sends 'WDS/Get Profile List Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetProfileList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetProfileSettings + +DESCRIPTION: + The function sends 'WDS/Get Profile Settings Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetProfileSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDefaultSettings + +DESCRIPTION: + The function sends 'WDS/Get Default Settings Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDefaultSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCurrentSettings + +DESCRIPTION: + The function sends 'WDS/Get Current Settings Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCurrentSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetMIPMode + +DESCRIPTION: + The function sends 'WDS/Set MIP Mode Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetMIPMode + +DESCRIPTION: + The function sends 'WDS/Get MIP Mode Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDormancy + +DESCRIPTION: + The function sends 'WDS/Get Dormancy Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDormancy( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetAutoconnectSetting + +DESCRIPTION: + The function sends 'WDS/Get Autoconnect Setting Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetAutoconnectSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDataSessionDuration + +DESCRIPTION: + The function sends 'WDS/Get Data Session Duration Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDataSessionDuration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetModemStatus + +DESCRIPTION: + The function sends 'WDS/Get Modem Status Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetModemStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDataBearerTechnology + +DESCRIPTION: + The function sends 'WDS/Get Data Bearer Technology Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDataBearerTechnology( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetModemInfo + +DESCRIPTION: + The function sends 'WDS/Get Modem Info Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetModemInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetActiveMIPProfile + +DESCRIPTION: + The function sends 'WDS/Get Active MIP Profile Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetActiveMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetActiveMIPProfile + +DESCRIPTION: + The function sends 'WDS/Set Active MIP Profile Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetActiveMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetMIPProfile + +DESCRIPTION: + The function sends 'WDS/Get MIP Profile Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetMIPProfile + +DESCRIPTION: + The function sends 'WDS/Set MIP Profile Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetMIPParameters + +DESCRIPTION: + The function sends 'WDS/Get MIP Parameters Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetMIPParameters + +DESCRIPTION: + The function sends 'WDS/Set MIP Parameters Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetLastMIPStatus + +DESCRIPTION: + The function sends 'WDS/Get Last MIP Status Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetLastMIPStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetANAAAAuthenticationStatus + +DESCRIPTION: + The function sends 'WDS/Get AN-AAA Authentication Status Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetANAAAAuthenticationStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCurrentDataBearerTechnology + +DESCRIPTION: + The function sends 'WDS/Get Current Data Bearer Technology Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCurrentDataBearerTechnology( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCallList + +DESCRIPTION: + The function sends 'WDS/Get Call List Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCallRecord + +DESCRIPTION: + The function sends 'WDS/Get Call Record Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSClearCallList + +DESCRIPTION: + The function sends 'WDS/Clear Call List Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSClearCallList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCallListMaxSize + +DESCRIPTION: + The function sends 'WDS/Get Call List Max Size Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallListMaxSize( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDefaultProfileNumber + +DESCRIPTION: + The function sends 'WDS/Get Default Profile Number Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDefaultProfileNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetDefaultProfileNumber + +DESCRIPTION: + The function sends 'WDS/Set Default Profile Number Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDefaultProfileNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSResetProfile + +DESCRIPTION: + The function sends 'WDS/Reset Profile Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSResetProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSResetProfileParamToInvalid + +DESCRIPTION: + The function sends 'WDS/Reset Profile Param To Invalid Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSResetProfileParamToInvalid( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetIPFamilyPreference + +DESCRIPTION: + The function sends 'WDS/Set IP Family Preference Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetIPFamilyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetFMCTunnelParameters + +DESCRIPTION: + The function sends 'WDS/Set FMC Tunnel Parameters Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetFMCTunnelParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSClearFMCTunnelParameters + +DESCRIPTION: + The function sends 'WDS/Clear FMC Tunnel Parameters Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSClearFMCTunnelParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetFMCTunnelParameters + +DESCRIPTION: + The function sends 'WDS/Get FMC Tunnel Parameters Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetFMCTunnelParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetAutoconnectSetting + +DESCRIPTION: + The function sends 'WDS/Set Autoconnect Setting Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetAutoconnectSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDNSSetting + +DESCRIPTION: + The function sends 'WDS/Get DNS Setting Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDNSSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetDNSSetting + +DESCRIPTION: + The function sends 'WDS/Set DNS Setting Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDNSSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCDMAPreDormancySettings + +DESCRIPTION: + The function sends 'WDS/Get CDMA Pre-Dormancy Settings Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCDMAPreDormancySettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetCAMTimer + +DESCRIPTION: + The function sends 'WDS/Set CAM Timer Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetCAMTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCAMTimer + +DESCRIPTION: + The function sends 'WDS/Get CAM Timer Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCAMTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetSCRM + +DESCRIPTION: + The function sends 'WDS/Set SCRM Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetSCRM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetSCRM + +DESCRIPTION: + The function sends 'WDS/Get SCRM Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetSCRM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetRDUD + +DESCRIPTION: + The function sends 'WDS/Set RDUD Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetRDUD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetRDUD + +DESCRIPTION: + The function sends 'WDS/Get RDUD Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetRDUD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetSIPMIPCallType + +DESCRIPTION: + The function sends 'WDS/Get SIP/MIP Call Type Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetSIPMIPCallType( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetEVDOPageMonitorPeriod + +DESCRIPTION: + The function sends 'WDS/Set EV-DO Page Monitor Period Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEVDOPageMonitorPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetEVDOLongSleep + +DESCRIPTION: + The function sends 'WDS/Set EV-DO Long Sleep Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEVDOLongSleep( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetEVDOPageMonitorPeriod + +DESCRIPTION: + The function sends 'WDS/Get EV-DO Page Monitor Period Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetEVDOPageMonitorPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCallThrottleInfo + +DESCRIPTION: + The function sends 'WDS/Get Call Throttle Info Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallThrottleInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetNSAPI + +DESCRIPTION: + The function sends 'WDS/Get NSAPI Request' (0x0060) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetNSAPI( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetDUNCallControlPreference + +DESCRIPTION: + The function sends 'WDS/Set DUN Call Control Preference Request' (0x0061) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDUNCallControlPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetDUNCallControlInfo + +DESCRIPTION: + The function sends 'WDS/Get DUN Call Control Info Request' (0x0062) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDUNCallControlInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSSetDUNCallControlEventReport + +DESCRIPTION: + The function sends 'WDS/Set DUN Call Control Event Report Request' (0x0063) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDUNCallControlEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSPendingDUNCallControl + +DESCRIPTION: + The function sends 'WDS/Pending DUN Call Control Request' (0x0064) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSPendingDUNCallControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSEMBMSTMGIActivate + +DESCRIPTION: + The function sends 'WDS/EMBMS TMGI Activate Request' (0x0065) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSEMBMSTMGIActivate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSEMBMSTMGIDeactivate + +DESCRIPTION: + The function sends 'WDS/EMBMS TMGI Deactivate Request' (0x0066) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSEMBMSTMGIDeactivate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSEMBMSTMGIListQuery + +DESCRIPTION: + The function sends 'WDS/EMBMS TMGI List Query Request' (0x0067) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSEMBMSTMGIListQuery( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetPreferredDataSystem + +DESCRIPTION: + The function sends 'WDS/Get Preferred Data System Request' (0x0069) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPreferredDataSystem( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetLastDataCallStatus + +DESCRIPTION: + The function sends 'WDS/Get Last Data Call Status Request' (0x006A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetLastDataCallStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetCurrentDataSystems + +DESCRIPTION: + The function sends 'WDS/Get Current Data Systems Request' (0x006B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCurrentDataSystems( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetPDNThrottleInfo + +DESCRIPTION: + The function sends 'WDS/Get PDN Throttle Info Request' (0x006C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPDNThrottleInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetLTEAttachParameters + +DESCRIPTION: + The function sends 'WDS/Get LTE Attach Parameters Request' (0x0085) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetLTEAttachParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSResetPacketStatistics + +DESCRIPTION: + The function sends 'WDS/Reset Packet Statistics Request' (0x0086) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSResetPacketStatistics( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WDSGetFlowControlStatus + +DESCRIPTION: + The function sends 'WDS/Get Flow Control Status Request' (0x0087) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetFlowControlStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSReset + +DESCRIPTION: + The function sends 'DMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetEventReport + +DESCRIPTION: + The function sends 'DMS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceCapabilities + +DESCRIPTION: + The function sends 'DMS/Get Device Capabilities Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceManfacturer + +DESCRIPTION: + The function sends 'DMS/Get Device Manfacturer Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceManfacturer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceModel + +DESCRIPTION: + The function sends 'DMS/Get Device Model Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceModel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceRevision + +DESCRIPTION: + The function sends 'DMS/Get Device Revision Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceVoiceNumber + +DESCRIPTION: + The function sends 'DMS/Get Device Voice Number Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceVoiceNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetDeviceSerialNumbers + +DESCRIPTION: + The function sends 'DMS/Get Device Serial Numbers Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceSerialNumbers( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetPowerState + +DESCRIPTION: + The function sends 'DMS/Get Power State Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetPowerState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMSetPINProtection + +DESCRIPTION: + The function sends 'DMS/UIM Set PIN Protection Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMSetPINProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMVerifyPIN + +DESCRIPTION: + The function sends 'DMS/UIM Verify PIN Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMVerifyPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMUnblockPIN + +DESCRIPTION: + The function sends 'DMS/UIM Unblock PIN Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMUnblockPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMChangePIN + +DESCRIPTION: + The function sends 'DMS/UIM Change PIN Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMChangePIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMGetPINStatus + +DESCRIPTION: + The function sends 'DMS/UIM Get PIN Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetPINStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetHardwareRevision + +DESCRIPTION: + The function sends 'DMS/Get Hardware Revision Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetHardwareRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetOperatingMode + +DESCRIPTION: + The function sends 'DMS/Get Operating Mode Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetOperatingMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetOperatingMode + +DESCRIPTION: + The function sends 'DMS/Set Operating Mode Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetOperatingMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetTimestamp + +DESCRIPTION: + The function sends 'DMS/Get Timestamp Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetTimestamp( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetPRLVersion + +DESCRIPTION: + The function sends 'DMS/Get PRL Version Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetPRLVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetActivationState + +DESCRIPTION: + The function sends 'DMS/Get Activation State Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetActivationState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSActivateAutomatic + +DESCRIPTION: + The function sends 'DMS/Activate Automatic Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSActivateAutomatic( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSActivateManual + +DESCRIPTION: + The function sends 'DMS/Activate Manual Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSActivateManual( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetLockState + +DESCRIPTION: + The function sends 'DMS/Get Lock State Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetLockState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetLockState + +DESCRIPTION: + The function sends 'DMS/Set Lock State Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetLockState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetLockCode + +DESCRIPTION: + The function sends 'DMS/Set Lock Code Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetLockCode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSReadUserData + +DESCRIPTION: + The function sends 'DMS/Read User Data Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReadUserData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSWriteUserData + +DESCRIPTION: + The function sends 'DMS/Write User Data Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSWriteUserData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSReadERIData + +DESCRIPTION: + The function sends 'DMS/Read ERI Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReadERIData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSResetFactoryDefaults + +DESCRIPTION: + The function sends 'DMS/Reset Factory Defaults Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSResetFactoryDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSValidateSPC + +DESCRIPTION: + The function sends 'DMS/Validate SPC Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSValidateSPC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMGetICCID + +DESCRIPTION: + The function sends 'DMS/UIM Get ICCID Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetICCID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMGetHostLockID + +DESCRIPTION: + The function sends 'DMS/UIM Get Host Lock ID Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetHostLockID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMGetControlKeyStatus + +DESCRIPTION: + The function sends 'DMS/UIM Get Control Key Status Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetControlKeyStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMSetControlKeyProtection + +DESCRIPTION: + The function sends 'DMS/UIM Set Control Key Protection Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMSetControlKeyProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSUIMUnblockControlKey + +DESCRIPTION: + The function sends 'DMS/UIM Unblock Control Key Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMUnblockControlKey( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetIMSI + +DESCRIPTION: + The function sends 'DMS/Get IMSI Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetIMSI( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetUIMState + +DESCRIPTION: + The function sends 'DMS/Get UIM State Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetUIMState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetBandCapabilities + +DESCRIPTION: + The function sends 'DMS/Get Band Capabilities Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetBandCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetFactorySerialNumber + +DESCRIPTION: + The function sends 'DMS/Get Factory Serial Number Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetFactorySerialNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetDeviceTime + +DESCRIPTION: + The function sends 'DMS/Set Device Time Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetDeviceTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetSoftwareVersion + +DESCRIPTION: + The function sends 'DMS/Get Software Version Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetSoftwareVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSSetSPC + +DESCRIPTION: + The function sends 'DMS/Set SPC Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetSPC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + DMSGetCurrentPRLInfo + +DESCRIPTION: + The function sends 'DMS/Get Current PRL Info Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetCurrentPRLInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASReset + +DESCRIPTION: + The function sends 'NAS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASAbort + +DESCRIPTION: + The function sends 'NAS/Abort Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASAbort( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetEventReport + +DESCRIPTION: + The function sends 'NAS/Set Event Report Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetRegistrationEventReport + +DESCRIPTION: + The function sends 'NAS/Set Registration Event Report Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRegistrationEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetSignalStrength + +DESCRIPTION: + The function sends 'NAS/Get Signal Strength Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSignalStrength( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASPerformNetworkScan + +DESCRIPTION: + The function sends 'NAS/Perform Network Scan Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASPerformNetworkScan( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASInitiateNetworkRegister + +DESCRIPTION: + The function sends 'NAS/Initiate Network Register Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASInitiateNetworkRegister( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASInitiateAttach + +DESCRIPTION: + The function sends 'NAS/Initiate Attach Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASInitiateAttach( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetServingSystem + +DESCRIPTION: + The function sends 'NAS/Get Serving System Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetServingSystem( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetHomeNetwork + +DESCRIPTION: + The function sends 'NAS/Get Home Network Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetHomeNetwork( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetPreferredNetworks + +DESCRIPTION: + The function sends 'NAS/Get Preferred Networks Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetPreferredNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetPreferredNetworks + +DESCRIPTION: + The function sends 'NAS/Set Preferred Networks Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetPreferredNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetForbiddenNetworks + +DESCRIPTION: + The function sends 'NAS/Get Forbidden Networks Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetForbiddenNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetForbiddenNetworks + +DESCRIPTION: + The function sends 'NAS/Set Forbidden Networks Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetForbiddenNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetTechnologyPreference + +DESCRIPTION: + The function sends 'NAS/Set Technology Preference Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetTechnologyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetTechnologyPreference + +DESCRIPTION: + The function sends 'NAS/Get Technology Preference Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetTechnologyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetACCOLC + +DESCRIPTION: + The function sends 'NAS/Get ACCOLC Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetACCOLC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetACCOLC + +DESCRIPTION: + The function sends 'NAS/Set ACCOLC Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetACCOLC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetSystemPreference + +DESCRIPTION: + The function sends 'NAS/Get System Preference' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetNetworkParameters + +DESCRIPTION: + The function sends 'NAS/Get Network Parameters Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetNetworkParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetNetworkParameters + +DESCRIPTION: + The function sends 'NAS/Set Network Parameters Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetNetworkParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetRFInfo + +DESCRIPTION: + The function sends 'NAS/Get RF Info Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRFInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetANAAAAuthenticationStatus + +DESCRIPTION: + The function sends 'NAS/Get AN-AAA Authentication Status Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetANAAAAuthenticationStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetSystemSelectionPref + +DESCRIPTION: + The function sends 'NAS/Set System Selection Pref Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetSystemSelectionPref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetSystemSelectionPref + +DESCRIPTION: + The function sends 'NAS/Get System Selection Pref Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemSelectionPref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetDDTMPreference + +DESCRIPTION: + The function sends 'NAS/Set DDTM Preference Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetDDTMPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetDDTMPreference + +DESCRIPTION: + The function sends 'NAS/Get DDTM Preference Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetDDTMPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetOperatorNameData + +DESCRIPTION: + The function sends 'NAS/Get Operator Name Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetOperatorNameData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetCSPPLMNMode + +DESCRIPTION: + The function sends 'NAS/Get CSP PLMN Mode Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCSPPLMNMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASUpdateAKEY + +DESCRIPTION: + The function sends 'NAS/Update AKEY Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASUpdateAKEY( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGet3GPP2SubscriptionInfo + +DESCRIPTION: + The function sends 'NAS/Get 3GPP2 Subscription Info Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGet3GPP2SubscriptionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSet3GPP2SubscriptionInfo + +DESCRIPTION: + The function sends 'NAS/Set 3GPP2 Subscription Info Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSet3GPP2SubscriptionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetMobileCAIRevision + +DESCRIPTION: + The function sends 'NAS/Get Mobile CAI Revision Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetMobileCAIRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetRTREConfig + +DESCRIPTION: + The function sends 'NAS/Get RTRE Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRTREConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetRTREConfig + +DESCRIPTION: + The function sends 'NAS/Set RTRE Config Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRTREConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetCellLocationInfo + +DESCRIPTION: + The function sends 'NAS/Get Cell Location Info Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCellLocationInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetPLMNName + +DESCRIPTION: + The function sends 'NAS/Get PLMN Name Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetPLMNName( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASBindSubscription + +DESCRIPTION: + The function sends 'NAS/Bind Subscription Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetModePref + +DESCRIPTION: + The function sends 'NAS/Get Mode Pref Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetModePref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetDualStandbyPreference + +DESCRIPTION: + The function sends 'NAS/Set Dual Standby Preference Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetDualStandbyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetSystemInfo + +DESCRIPTION: + The function sends 'NAS/Get System Info Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetSignalInfo + +DESCRIPTION: + The function sends 'NAS/Get Signal Info Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSignalInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASConfigureSignalInfo + +DESCRIPTION: + The function sends 'NAS/Configure Signal Info Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASConfigureSignalInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetErrorRate + +DESCRIPTION: + The function sends 'NAS/Get Error Rate Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetErrorRate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetEVDOProtocolSubtype + +DESCRIPTION: + The function sends 'NAS/Get EV-DO Protocol Subtype Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetEVDOProtocolSubtype( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetEVDOColorCode + +DESCRIPTION: + The function sends 'NAS/Get EV-DO Color Code Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetEVDOColorCode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetAcquisitionSystemMode + +DESCRIPTION: + The function sends 'NAS/Get Acquisition System Mode Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetAcquisitionSystemMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASSetRXDiversity + +DESCRIPTION: + The function sends 'NAS/Set RX Diversity Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRXDiversity( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetRXTXInfo + +DESCRIPTION: + The function sends 'NAS/Get RX/TX Info Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRXTXInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASUpdateAKEYExtended + +DESCRIPTION: + The function sends 'NAS/Update A-KEY Extended Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASUpdateAKEYExtended( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetDualStandbyPreference + +DESCRIPTION: + The function sends 'NAS/Get Dual Standby Preference Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetDualStandbyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASDetachLTE + +DESCRIPTION: + The function sends 'NAS/Detach LTE Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASDetachLTE( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASBlockLTEPLMN + +DESCRIPTION: + The function sends 'NAS/Block LTE PLMN Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASBlockLTEPLMN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASUnblockLTEPLMN + +DESCRIPTION: + The function sends 'NAS/Unblock LTE PLMN Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASUnblockLTEPLMN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASResetLTEPLMNBlock + +DESCRIPTION: + The function sends 'NAS/Reset LTE PLMN Block Request' (0x0060) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASResetLTEPLMNBlock( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASConfigureEMBMS + +DESCRIPTION: + The function sends 'NAS/Configure EMBMS Request' (0x0062) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASConfigureEMBMS( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetEMBMSStatus + +DESCRIPTION: + The function sends 'NAS/Get EMBMS Status Request' (0x0063) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetEMBMSStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetCDMAPositionInfo + +DESCRIPTION: + The function sends 'NAS/Get CDMA Position Info Request' (0x0065) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCDMAPositionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASForceNetworkSearch + +DESCRIPTION: + The function sends 'NAS/Force Network Search Request' (0x0067) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASForceNetworkSearch( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetManagedRoamingConfig + +DESCRIPTION: + The function sends 'NAS/Get Managed Roaming Config Request' (0x0069) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetManagedRoamingConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + NASGetCentralizedEONSSupport + +DESCRIPTION: + The function sends 'NAS/Get Centralized EONS Support Request' (0x006B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCentralizedEONSSupport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSReset + +DESCRIPTION: + The function sends 'WMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetEventReport + +DESCRIPTION: + The function sends 'WMS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSRawSend + +DESCRIPTION: + The function sends 'WMS/Raw Send Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawSend( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSRawWrite + +DESCRIPTION: + The function sends 'WMS/Raw Write Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawWrite( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSRawRead + +DESCRIPTION: + The function sends 'WMS/Raw Read Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawRead( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSModifyTag + +DESCRIPTION: + The function sends 'WMS/Modify Tag Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSModifyTag( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSDelete + +DESCRIPTION: + The function sends 'WMS/Delete Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSDelete( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetMessageProtocol + +DESCRIPTION: + The function sends 'WMS/Get Message Protocol Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetMessageProtocol( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSListMessages + +DESCRIPTION: + The function sends 'WMS/List Messages Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSListMessages( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetRoutes + +DESCRIPTION: + The function sends 'WMS/Set Routes Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRoutes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetRoutes + +DESCRIPTION: + The function sends 'WMS/Get Routes Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetRoutes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetSMSCAddress + +DESCRIPTION: + The function sends 'WMS/Get SMSC Address Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetSMSCAddress( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetSMSCAddress + +DESCRIPTION: + The function sends 'WMS/Set SMSC Address Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetSMSCAddress( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetStorageMaxSize + +DESCRIPTION: + The function sends 'WMS/Get Storage Max Size Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetStorageMaxSize( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSendACK + +DESCRIPTION: + The function sends 'WMS/Send ACK Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSendACK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetRetryPeriod + +DESCRIPTION: + The function sends 'WMS/Set Retry Period Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRetryPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetRetryInterval + +DESCRIPTION: + The function sends 'WMS/Set Retry Interval Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRetryInterval( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetDCDisconnectTimer + +DESCRIPTION: + The function sends 'WMS/Set DC Disconnect Timer Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetDCDisconnectTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetMemoryStatus + +DESCRIPTION: + The function sends 'WMS/Set Memory Status Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetMemoryStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetBroadcastActivation + +DESCRIPTION: + The function sends 'WMS/Set Broadcast Activation Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetBroadcastActivation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetBroadcastConfig + +DESCRIPTION: + The function sends 'WMS/Set Broadcast Config Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetBroadcastConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetBroadcastConfig + +DESCRIPTION: + The function sends 'WMS/Get Broadcast Config Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetBroadcastConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetDomainPreference + +DESCRIPTION: + The function sends 'WMS/Get Domain Preference Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetDomainPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetDomainPreference + +DESCRIPTION: + The function sends 'WMS/Set Domain Preference Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetDomainPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSendFromMemoryStore + +DESCRIPTION: + The function sends 'WMS/Send From Memory Store Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSendFromMemoryStore( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetWaitingMessage + +DESCRIPTION: + The function sends 'WMS/Get Waiting Message Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetWaitingMessage( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetPrimaryClient + +DESCRIPTION: + The function sends 'WMS/Set Primary Client Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetPrimaryClient( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSIndicatorRegistration + +DESCRIPTION: + The function sends 'WMS/Indicator Registration Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSIndicatorRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetTransportLayerInfo + +DESCRIPTION: + The function sends 'WMS/Get Transport Layer Info Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetTransportLayerInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetNetworkRegistrationInfo + +DESCRIPTION: + The function sends 'WMS/Get Network Registration Info Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetNetworkRegistrationInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSBindSubscription + +DESCRIPTION: + The function sends 'WMS/Bind Subscription Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetIndicatorRegistration + +DESCRIPTION: + The function sends 'WMS/Get Indicator Registration Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetIndicatorRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetSMSParameters + +DESCRIPTION: + The function sends 'WMS/Get SMS Parameters Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetSMSParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetSMSParameters + +DESCRIPTION: + The function sends 'WMS/Set SMS Parameters Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetSMSParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetDomainPreferenceConfig + +DESCRIPTION: + The function sends 'WMS/Get Domain Preference Config Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetDomainPreferenceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSSetDomainPreferenceConfig + +DESCRIPTION: + The function sends 'WMS/Set Domain Preference Config Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetDomainPreferenceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetRetryPeriod + +DESCRIPTION: + The function sends 'WMS/Get Retry Period Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetRetryPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetRetryInterval + +DESCRIPTION: + The function sends 'WMS/Get Retry Interval Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetRetryInterval( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetDCDisconnectTimer + +DESCRIPTION: + The function sends 'WMS/Get DC Disconnect Timer Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetDCDisconnectTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetMemoryStatus + +DESCRIPTION: + The function sends 'WMS/Get Memory Status Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetMemoryStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetPrimaryClient + +DESCRIPTION: + The function sends 'WMS/Get Primary Client Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetPrimaryClient( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetSubscriptionBinding + +DESCRIPTION: + The function sends 'WMS/Get Subscription Binding Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetSubscriptionBinding( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSAsyncRawSend + +DESCRIPTION: + The function sends 'WMS/Async Raw Send Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSAsyncRawSend( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSAsyncSendACK + +DESCRIPTION: + The function sends 'WMS/Async Send ACK Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSAsyncSendACK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSAsyncSendFromMemoryStore + +DESCRIPTION: + The function sends 'WMS/Async Send From Memory Store Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSAsyncSendFromMemoryStore( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + WMSGetServiceReadyStatus + +DESCRIPTION: + The function sends 'WMS/Get Service Ready Status Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetServiceReadyStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSReset + +DESCRIPTION: + The function sends 'PDS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetEventReport + +DESCRIPTION: + The function sends 'PDS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetServiceState + +DESCRIPTION: + The function sends 'PDS/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetServiceState + +DESCRIPTION: + The function sends 'PDS/Set Service State Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSStartTrackingSession + +DESCRIPTION: + The function sends 'PDS/Start Tracking Session Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSStartTrackingSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetTrackingSessionInfo + +DESCRIPTION: + The function sends 'PDS/Get Tracking Session Info Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetTrackingSessionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSFixPosition + +DESCRIPTION: + The function sends 'PDS/Fix Position Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSFixPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSEndTrackingSession + +DESCRIPTION: + The function sends 'PDS/End Tracking Session Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSEndTrackingSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetNMEAConfig + +DESCRIPTION: + The function sends 'PDS/Get NMEA Config Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetNMEAConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetNMEAConfig + +DESCRIPTION: + The function sends 'PDS/Set NMEA Config Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetNMEAConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectTimeReference + +DESCRIPTION: + The function sends 'PDS/Inject Time Reference Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeReference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetDefaults + +DESCRIPTION: + The function sends 'PDS/Get Defaults Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetDefaults + +DESCRIPTION: + The function sends 'PDS/Set Defaults Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetXTRAParameters + +DESCRIPTION: + The function sends 'PDS/Get XTRA Parameters Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetXTRAParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetXTRAParameters + +DESCRIPTION: + The function sends 'PDS/Set XTRA Parameters Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetXTRAParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSForceXTRADownload + +DESCRIPTION: + The function sends 'PDS/Force XTRA Download Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSForceXTRADownload( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetAGPSConfig + +DESCRIPTION: + The function sends 'PDS/Get AGPS Config Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetAGPSConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetAGPSConfig + +DESCRIPTION: + The function sends 'PDS/Set AGPS Config Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetAGPSConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetServiceAutoTrackingState + +DESCRIPTION: + The function sends 'PDS/Get Service Auto-Tracking State Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceAutoTrackingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetServiceAutoTrackingState + +DESCRIPTION: + The function sends 'PDS/Set Service Auto-Tracking State Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetServiceAutoTrackingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetCOMPortAutoTrackingConfig + +DESCRIPTION: + The function sends 'PDS/Get COM Port Auto-Tracking Config Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetCOMPortAutoTrackingConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetCOMPortAutoTrackingConfig + +DESCRIPTION: + The function sends 'PDS/Set COM Port Auto-Tracking Config Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetCOMPortAutoTrackingConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSResetPDSData + +DESCRIPTION: + The function sends 'PDS/Reset PDS Data Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSResetPDSData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSinglePositionFix + +DESCRIPTION: + The function sends 'PDS/Single Position Fix Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSinglePositionFix( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetServiceVersion + +DESCRIPTION: + The function sends 'PDS/Get Service Version Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectXTRAData + +DESCRIPTION: + The function sends 'PDS/Inject XTRA Data Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectXTRAData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectPositionData + +DESCRIPTION: + The function sends 'PDS/Inject Position Data Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectPositionData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectWiFiPositionData + +DESCRIPTION: + The function sends 'PDS/Inject Wi-Fi Position Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectWiFiPositionData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetSBASConfig + +DESCRIPTION: + The function sends 'PDS/Get SBAS Config Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSBASConfig + +DESCRIPTION: + The function sends 'PDS/Set SBAS Config Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSendNetworkInitiatedResponse + +DESCRIPTION: + The function sends 'PDS/Send Network Initiated Response Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSendNetworkInitiatedResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectAbsoluteTime + +DESCRIPTION: + The function sends 'PDS/Inject Absolute Time Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectAbsoluteTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectEFSData + +DESCRIPTION: + The function sends 'PDS/Inject EFS Data Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectEFSData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetDPOConfig + +DESCRIPTION: + The function sends 'PDS/Get DPO Config Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetDPOConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetDPOConfig + +DESCRIPTION: + The function sends 'PDS/Set DPO Config Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetDPOConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetODPConfig + +DESCRIPTION: + The function sends 'PDS/Get ODP Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetODPConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetODPConfig + +DESCRIPTION: + The function sends 'PDS/Set ODP Config Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetODPConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSCancelSinglePositionFix + +DESCRIPTION: + The function sends 'PDS/Cancel Single Position Fix Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSCancelSinglePositionFix( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetGPSState + +DESCRIPTION: + The function sends 'PDS/Get GPS State Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetGPSState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetPPMEventReport + +DESCRIPTION: + The function sends 'PDS/Set PPM Event Report Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPPMEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSPIStreamingReport + +DESCRIPTION: + The function sends 'PDS/Set SPI Streaming Report Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSPIStreamingReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSPIStatus + +DESCRIPTION: + The function sends 'PDS/Set SPI Status Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSPIStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetPPMReportingState + +DESCRIPTION: + The function sends 'PDS/Set PPM Reporting State Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPPMReportingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSForceReceiverOff + +DESCRIPTION: + The function sends 'PDS/Force Receiver Off Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSForceReceiverOff( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetPositionMethodsState + +DESCRIPTION: + The function sends 'PDS/Get Position Methods State Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetPositionMethodsState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetPositionMethodsState + +DESCRIPTION: + The function sends 'PDS/Set Position Methods State Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPositionMethodsState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectSensorData + +DESCRIPTION: + The function sends 'PDS/Inject Sensor Data Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectSensorData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectTimeSyncData + +DESCRIPTION: + The function sends 'PDS/Inject Time Sync Data Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeSyncData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetSensorConfig + +DESCRIPTION: + The function sends 'PDS/Get Sensor Config Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSensorConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSensorConfig + +DESCRIPTION: + The function sends 'PDS/Set Sensor Config Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSensorConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetSensorNavigation + +DESCRIPTION: + The function sends 'PDS/Get Sensor Navigation Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSensorNavigation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetNavigationConfig + +DESCRIPTION: + The function sends 'PDS/Set Navigation Config Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetNavigationConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetWLANBlanking + +DESCRIPTION: + The function sends 'PDS/Set WLAN Blanking Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetWLANBlanking( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSecurityChallengeReport + +DESCRIPTION: + The function sends 'PDS/Set Security Challenge Report Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityChallengeReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSecurityChallenge + +DESCRIPTION: + The function sends 'PDS/Set Security Challenge Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityChallenge( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSGetSecurityEncryptionConfig + +DESCRIPTION: + The function sends 'PDS/Get Security Encryption Config Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSecurityEncryptionConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetSecurityUpdateRate + +DESCRIPTION: + The function sends 'PDS/Set Security Update Rate Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityUpdateRate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetCellDatabaseControl + +DESCRIPTION: + The function sends 'PDS/Set Cell Database Control Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetCellDatabaseControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectMotionData + +DESCRIPTION: + The function sends 'PDS/Inject Motion Data Request' (0x0061) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectMotionData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetGNSSEngineErrorRecoveryReport + +DESCRIPTION: + The function sends 'PDS/Set GNSS Engine Error Recovery Report Request' (0x0062) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetGNSSEngineErrorRecoveryReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSResetLocationService + +DESCRIPTION: + The function sends 'PDS/Reset Location Service Request' (0x0063) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSResetLocationService( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSInjectTestData + +DESCRIPTION: + The function sends 'PDS/Inject Test Data Request' (0x0064) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTestData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PDSSetGNSSRFConfig + +DESCRIPTION: + The function sends 'PDS/Set GNSS RF Config Request' (0x0065) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetGNSSRFConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + AUTHStartEAPSession + +DESCRIPTION: + The function sends 'AUTH/Start EAP Session Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHStartEAPSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + AUTHSendEAPPacket + +DESCRIPTION: + The function sends 'AUTH/Send EAP Packet Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHSendEAPPacket( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + AUTHGetEAPSessionKeys + +DESCRIPTION: + The function sends 'AUTH/Get EAP Session Keys Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHGetEAPSessionKeys( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + AUTHEndEAPSession + +DESCRIPTION: + The function sends 'AUTH/End EAP Session Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHEndEAPSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + AUTHRunAKA + +DESCRIPTION: + The function sends 'AUTH/Run AKA Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHRunAKA( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceIndicationRegistration + +DESCRIPTION: + The function sends 'Voice/Indication Registration Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceIndicationRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceCallOriginate + +DESCRIPTION: + The function sends 'Voice/Call Originate Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallOriginate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceCallEnd + +DESCRIPTION: + The function sends 'Voice/Call End Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallEnd( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceCallAnswer + +DESCRIPTION: + The function sends 'Voice/Call Answer Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallAnswer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCallInfo + +DESCRIPTION: + The function sends 'Voice/Get Call Info Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceSendFlash + +DESCRIPTION: + The function sends 'Voice/Send Flash Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSendFlash( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceBurstDTMF + +DESCRIPTION: + The function sends 'Voice/Burst DTMF Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceBurstDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceStartContinuousDTMF + +DESCRIPTION: + The function sends 'Voice/Start Continuous DTMF Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceStartContinuousDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceStopContinuousDTMF + +DESCRIPTION: + The function sends 'Voice/Stop Continuous DTMF Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceStopContinuousDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceSetPreferredPrivacy + +DESCRIPTION: + The function sends 'Voice/Set Preferred Privacy Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetPreferredPrivacy( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetAllCallInfo + +DESCRIPTION: + The function sends 'Voice/Get All Call Info Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetAllCallInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceManageCalls + +DESCRIPTION: + The function sends 'Voice/Manage Calls Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceManageCalls( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceSetSupplementaryService + +DESCRIPTION: + The function sends 'Voice/Set Supplementary Service Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetSupplementaryService( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCallWaiting + +DESCRIPTION: + The function sends 'Voice/Get Call Waiting Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallWaiting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCallBarring + +DESCRIPTION: + The function sends 'Voice/Get Call Barring Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallBarring( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCLIP + +DESCRIPTION: + The function sends 'Voice/Get CLIP Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCLIP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCLIR + +DESCRIPTION: + The function sends 'Voice/Get CLIR Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCLIR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCallForwarding + +DESCRIPTION: + The function sends 'Voice/Get Call Forwarding Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallForwarding( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceSetCallBarringPassword + +DESCRIPTION: + The function sends 'Voice/Set Call Barring Password Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetCallBarringPassword( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceInitiateUSSD + +DESCRIPTION: + The function sends 'Voice/Initiate USSD Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceInitiateUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceAnswerUSSD + +DESCRIPTION: + The function sends 'Voice/Answer USSD Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAnswerUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceCancelUSSD + +DESCRIPTION: + The function sends 'Voice/Cancel USSD Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCancelUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceSetConfig + +DESCRIPTION: + The function sends 'Voice/Set Config Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetConfig + +DESCRIPTION: + The function sends 'Voice/Get Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceAsyncInitiateUSSD + +DESCRIPTION: + The function sends 'Voice/Async Initiate USSD Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAsyncInitiateUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceBindSubscription + +DESCRIPTION: + The function sends 'Voice/Bind Subscription Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceALSSetLineSwitching + +DESCRIPTION: + The function sends 'Voice/ALS Set Line Switching Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceALSSetLineSwitching( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceALSSelectLine + +DESCRIPTION: + The function sends 'Voice/ALS Select Line Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceALSSelectLine( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceAOCResetACM + +DESCRIPTION: + The function sends 'Voice/AOC Reset ACM Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCResetACM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceAOCSetACMMaximum + +DESCRIPTION: + The function sends 'Voice/AOC Set ACM Maximum Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCSetACMMaximum( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceAOCGetCallMeterInfo + +DESCRIPTION: + The function sends 'Voice/AOC Get Call Meter Info Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCGetCallMeterInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCOLP + +DESCRIPTION: + The function sends 'Voice/Get COLP Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCOLP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCOLR + +DESCRIPTION: + The function sends 'Voice/Get COLR Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCOLR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceGetCNAP + +DESCRIPTION: + The function sends 'Voice/Get CNAP Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCNAP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + VoiceManageIPCalls + +DESCRIPTION: + The function sends 'Voice/Manage IP Calls Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceManageIPCalls( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2Reset + +DESCRIPTION: + The function sends 'CAT2/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2Reset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SetEventReport + +DESCRIPTION: + The function sends 'CAT2/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2GetServiceState + +DESCRIPTION: + The function sends 'CAT2/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SendTerminalResponse + +DESCRIPTION: + The function sends 'CAT2/Send Terminal Response Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2EnvelopeCommand + +DESCRIPTION: + The function sends 'CAT2/Envelope Command Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2EnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2GetEventReport + +DESCRIPTION: + The function sends 'CAT2/Get Event Report Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SendDecodedTerminalResponse + +DESCRIPTION: + The function sends 'CAT2/Send Decoded Terminal Response Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendDecodedTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SendDecodedEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT2/Send Decoded Envelope Command Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendDecodedEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2EventConfirmation + +DESCRIPTION: + The function sends 'CAT2/Event Confirmation Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2EventConfirmation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SCWSOpenChannel + +DESCRIPTION: + The function sends 'CAT2/SCWS Open Channel Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSOpenChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SCWSCloseChannel + +DESCRIPTION: + The function sends 'CAT2/SCWS Close Channel Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSCloseChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SCWSSendData + +DESCRIPTION: + The function sends 'CAT2/SCWS Send Data Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSSendData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SCWSDataAvailable + +DESCRIPTION: + The function sends 'CAT2/SCWS Data Available Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSDataAvailable( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SCWSChannelStatus + +DESCRIPTION: + The function sends 'CAT2/SCWS Channel Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSChannelStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2GetTerminalProfile + +DESCRIPTION: + The function sends 'CAT2/Get Terminal Profile Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetTerminalProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2SetConfiguration + +DESCRIPTION: + The function sends 'CAT2/Set Configuration Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CAT2GetConfiguration + +DESCRIPTION: + The function sends 'CAT2/Get Configuration Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMReset + +DESCRIPTION: + The function sends 'UIM/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMReadTransparent + +DESCRIPTION: + The function sends 'UIM/Read Transparent Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReadTransparent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMReadRecord + +DESCRIPTION: + The function sends 'UIM/Read Record Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReadRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMWriteTransparent + +DESCRIPTION: + The function sends 'UIM/Write Transparent Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMWriteTransparent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMWriteRecord + +DESCRIPTION: + The function sends 'UIM/Write Record Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMWriteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetFileAttributes + +DESCRIPTION: + The function sends 'UIM/Get File Attributes Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetFileAttributes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSetPINProtection + +DESCRIPTION: + The function sends 'UIM/Set PIN Protection Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetPINProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMVerifyPIN + +DESCRIPTION: + The function sends 'UIM/Verify PIN Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMVerifyPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMUnblockPIN + +DESCRIPTION: + The function sends 'UIM/Unblock PIN Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMChangePIN + +DESCRIPTION: + The function sends 'UIM/Change PIN Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangePIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMDepersonalization + +DESCRIPTION: + The function sends 'UIM/Depersonalization Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMDepersonalization( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMRefreshRegister + +DESCRIPTION: + The function sends 'UIM/Refresh Register Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshRegister( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMRefreshOK + +DESCRIPTION: + The function sends 'UIM/Refresh OK Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshOK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMRefreshComplete + +DESCRIPTION: + The function sends 'UIM/Refresh Complete Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshComplete( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetLastRefreshEvent + +DESCRIPTION: + The function sends 'UIM/Get Last Refresh Event Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetLastRefreshEvent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMEventRegistration + +DESCRIPTION: + The function sends 'UIM/Event Registration Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMEventRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetCardStatus + +DESCRIPTION: + The function sends 'UIM/Get Card Status Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetCardStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMPowerDown + +DESCRIPTION: + The function sends 'UIM/Power Down Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMPowerDown( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMPowerUp + +DESCRIPTION: + The function sends 'UIM/Power Up Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMPowerUp( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMAuthenticate + +DESCRIPTION: + The function sends 'UIM/Authenticate Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMAuthenticate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMCloseSession + +DESCRIPTION: + The function sends 'UIM/Close Session Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMCloseSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetServiceStatus + +DESCRIPTION: + The function sends 'UIM/Get Service Status Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSetServiceStatus + +DESCRIPTION: + The function sends 'UIM/Set Service Status Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMChangeProvisioningSession + +DESCRIPTION: + The function sends 'UIM/Change Provisioning Session Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangeProvisioningSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetLabel + +DESCRIPTION: + The function sends 'UIM/Get Label Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetLabel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetConfiguration + +DESCRIPTION: + The function sends 'UIM/Get Configuration Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSendADPU + +DESCRIPTION: + The function sends 'UIM/Send ADPU Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSendADPU( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSAPConnection + +DESCRIPTION: + The function sends 'UIM/SAP Connection Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSAPConnection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSAPRequest + +DESCRIPTION: + The function sends 'UIM/SAP Request Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSAPRequest( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMLogicalChannel + +DESCRIPTION: + The function sends 'UIM/Logical Channel Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMLogicalChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMSubscriptionOK + +DESCRIPTION: + The function sends 'UIM/Subscription OK Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSubscriptionOK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMGetATR + +DESCRIPTION: + The function sends 'UIM/Get ATR Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetATR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + UIMOpenLogicalChannel + +DESCRIPTION: + The function sends 'UIM/Open Logical Channel Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMOpenLogicalChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMSetIndicationRegistrationState + +DESCRIPTION: + The function sends 'PBM/Set Indication Registration State Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetIndicationRegistrationState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetCapabilities + +DESCRIPTION: + The function sends 'PBM/Get Capabilities Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetAllCapabilities + +DESCRIPTION: + The function sends 'PBM/Get All Capabilities Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAllCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMReadRecords + +DESCRIPTION: + The function sends 'PBM/Read Records Request' (0x0004) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMReadRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMWriteRecord + +DESCRIPTION: + The function sends 'PBM/Write Record Request' (0x0005) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMWriteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMDeleteRecord + +DESCRIPTION: + The function sends 'PBM/Delete Record Request' (0x0006) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMDeleteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMDeleteAllRecords + +DESCRIPTION: + The function sends 'PBM/Delete All Records Request' (0x0007) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMDeleteAllRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMSearchRecords + +DESCRIPTION: + The function sends 'PBM/Search Records Request' (0x0008) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSearchRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetEmergencyList + +DESCRIPTION: + The function sends 'PBM/Get Emergency List Request' (0x000E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetEmergencyList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetAllGroups + +DESCRIPTION: + The function sends 'PBM/Get All Groups Request' (0x000F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAllGroups( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMSetGroupInfo + +DESCRIPTION: + The function sends 'PBM/Set Group Info Request' (0x0010) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetGroupInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetState + +DESCRIPTION: + The function sends 'PBM/Get State Request' (0x0011) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMReadAllHiddenRecords + +DESCRIPTION: + The function sends 'PBM/Read All Hidden Records Request' (0x0012) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMReadAllHiddenRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetNextEmptyRecordID + +DESCRIPTION: + The function sends 'PBM/Get Next Empty Record ID Request' (0x0014) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetNextEmptyRecordID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetNextRecordID + +DESCRIPTION: + The function sends 'PBM/Get Next Record ID Request' (0x0015) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetNextRecordID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetAASList + +DESCRIPTION: + The function sends 'PBM/Get AAS List Request' (0x0016) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAASList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMSetAAS + +DESCRIPTION: + The function sends 'PBM/Set AAS Request' (0x0017) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetAAS( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMBindSubscription + +DESCRIPTION: + The function sends 'PBM/Bind Subscription Request' (0x001A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + PBMGetSubscription + +DESCRIPTION: + The function sends 'PBM/Get Subscription Request' (0x001B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCClientRevision + +DESCRIPTION: + The function sends 'LOC/Client Revision Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCClientRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCRegisterEvents + +DESCRIPTION: + The function sends 'LOC/Register Events Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCRegisterEvents( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCStart + +DESCRIPTION: + The function sends 'LOC/Start Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCStart( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCStop + +DESCRIPTION: + The function sends 'LOC/Stop Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCStop( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetServiceRevision + +DESCRIPTION: + The function sends 'LOC/Get Service Revision Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetServiceRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetFixCriteria + +DESCRIPTION: + The function sends 'LOC/Get Fix Criteria Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetFixCriteria( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCProvideNIUserResponse + +DESCRIPTION: + The function sends 'LOC/Provide NI User Response Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideNIUserResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectPredictedOrbitsData + +DESCRIPTION: + The function sends 'LOC/Inject Predicted Orbits Data Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectPredictedOrbitsData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetPredictedOrbitsDataSource + +DESCRIPTION: + The function sends 'LOC/Get Predicted Orbits Data Source Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetPredictedOrbitsDataSource( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetPredictedOrbitsDataValidity + +DESCRIPTION: + The function sends 'LOC/Get Predicted Orbits Data Validity Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetPredictedOrbitsDataValidity( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectUTCTime + +DESCRIPTION: + The function sends 'LOC/Inject UTC Time Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectUTCTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectPosition + +DESCRIPTION: + The function sends 'LOC/Inject Position Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetEngineLock + +DESCRIPTION: + The function sends 'LOC/Set Engine Lock Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetEngineLock( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetEngineLock + +DESCRIPTION: + The function sends 'LOC/Get Engine Lock Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetEngineLock( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetSBASConfig + +DESCRIPTION: + The function sends 'LOC/Set SBAS Config Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetSBASConfig + +DESCRIPTION: + The function sends 'LOC/Get SBAS Config Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetNMEATypes + +DESCRIPTION: + The function sends 'LOC/Set NMEA Types Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetNMEATypes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetNMEATypes + +DESCRIPTION: + The function sends 'LOC/Get NMEA Types Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetNMEATypes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetLowPowerMode + +DESCRIPTION: + The function sends 'LOC/Set Low Power Mode Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetLowPowerMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetLowPowerMode + +DESCRIPTION: + The function sends 'LOC/Get Low Power Mode Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetLowPowerMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetLocationServer + +DESCRIPTION: + The function sends 'LOC/Set Location Server Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetLocationServer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetLocationServer + +DESCRIPTION: + The function sends 'LOC/Get Location Server Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetLocationServer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCDeleteAssistData + +DESCRIPTION: + The function sends 'LOC/Delete Assist Data Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCDeleteAssistData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetXTRATSessionControl + +DESCRIPTION: + The function sends 'LOC/Set XTRA-T Session Control Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetXTRATSessionControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOC + +DESCRIPTION: + The function sends 'LOC' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectWiFiPosition + +DESCRIPTION: + The function sends 'LOC/Inject Wi-Fi Position Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectWiFiPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCProvideWiFiStatus + +DESCRIPTION: + The function sends 'LOC/Provide Wi-Fi Status Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideWiFiStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetRegisteredEvents + +DESCRIPTION: + The function sends 'LOC/Get Registered Events Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetRegisteredEvents( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetOperationMode + +DESCRIPTION: + The function sends 'LOC/Set Operation Mode Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetOperationMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetOperationMode + +DESCRIPTION: + The function sends 'LOC/Get Operation Mode Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetOperationMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetSPIStatus + +DESCRIPTION: + The function sends 'LOC/Set SPI Status Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSPIStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectSensorData + +DESCRIPTION: + The function sends 'LOC/Inject Sensor Data Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectSensorData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectTimeSyncData + +DESCRIPTION: + The function sends 'LOC/Inject Time Sync Data Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectTimeSyncData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetCradleMountConfig + +DESCRIPTION: + The function sends 'LOC/Set Cradle Mount Config Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetCradleMountConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetCradleMountConfig + +DESCRIPTION: + The function sends 'LOC/Get Cradle Mount Config Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetCradleMountConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetExternalPowerConfig + +DESCRIPTION: + The function sends 'LOC/Set External Power Config Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetExternalPowerConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetExternalPowerConfig + +DESCRIPTION: + The function sends 'LOC/Get External Power Config Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetExternalPowerConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCProvideConnectionStatus + +DESCRIPTION: + The function sends 'LOC/Provide Connection Status Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideConnectionStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetProtocolConfigParameters + +DESCRIPTION: + The function sends 'LOC/Set Protocol Config Parameters Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetProtocolConfigParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetProtocolConfigParameters + +DESCRIPTION: + The function sends 'LOC/Get Protocol Config Parameters Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetProtocolConfigParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetSensorControlConfig + +DESCRIPTION: + The function sends 'LOC/Set Sensor Control Config Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorControlConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetSensorControlConfig + +DESCRIPTION: + The function sends 'LOC/Get Sensor Control Config Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorControlConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetSensorProperties + +DESCRIPTION: + The function sends 'LOC/Set Sensor Properties Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorProperties( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetSensorProperties + +DESCRIPTION: + The function sends 'LOC/Get Sensor Properties Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorProperties( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetSensorPerformanceConfig + +DESCRIPTION: + The function sends 'LOC/Set Sensor Performance Config Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorPerformanceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetSensorPerformanceConfig + +DESCRIPTION: + The function sends 'LOC/Get Sensor Performance Config Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorPerformanceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCInjectSUPLCertificate + +DESCRIPTION: + The function sends 'LOC/Inject SUPL Certificate Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectSUPLCertificate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCDeleteSUPLCertificate + +DESCRIPTION: + The function sends 'LOC/Delete SUPL Certificate Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCDeleteSUPLCertificate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCSetPositionEngineConfig + +DESCRIPTION: + The function sends 'LOC/Set Position Engine Config Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetPositionEngineConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetPositionEngineConfig + +DESCRIPTION: + The function sends 'LOC/Get Position Engine Config Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetPositionEngineConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCAddCircularGeofence + +DESCRIPTION: + The function sends 'LOC/Add Circular Geofence Request' (0x0063) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCAddCircularGeofence( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCDeleteGeofence + +DESCRIPTION: + The function sends 'LOC/Delete Geofence Request' (0x0064) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCDeleteGeofence( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCQueryGeofence + +DESCRIPTION: + The function sends 'LOC/Query Geofence Request' (0x0065) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCQueryGeofence( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCEditGeofence + +DESCRIPTION: + The function sends 'LOC/Edit Geofence Request' (0x0066) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCEditGeofence( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + LOCGetBestAvailablePosition + +DESCRIPTION: + The function sends 'LOC/Get Best Available Position Request' (0x0067) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetBestAvailablePosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATReset + +DESCRIPTION: + The function sends 'CAT/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSetEventReport + +DESCRIPTION: + The function sends 'CAT/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATGetServiceState + +DESCRIPTION: + The function sends 'CAT/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSendTerminalResponse + +DESCRIPTION: + The function sends 'CAT/Send Terminal Response Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT/Envelope Command Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATGetEventReport + +DESCRIPTION: + The function sends 'CAT/Get Event Report Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSendDecodedTerminalResponse + +DESCRIPTION: + The function sends 'CAT/Send Decoded Terminal Response Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendDecodedTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSendDecodedEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT/Send Decoded Envelope Command Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendDecodedEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATEventConfirmation + +DESCRIPTION: + The function sends 'CAT/Event Confirmation Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATEventConfirmation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSCWSOpenChannel + +DESCRIPTION: + The function sends 'CAT/SCWS Open Channel Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSOpenChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSCWSCloseChannel + +DESCRIPTION: + The function sends 'CAT/SCWS Close Channel Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSCloseChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSCWSSendData + +DESCRIPTION: + The function sends 'CAT/SCWS Send Data Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSSendData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSCWSDataAvailable + +DESCRIPTION: + The function sends 'CAT/SCWS Data Available Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSDataAvailable( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSCWSChannelStatus + +DESCRIPTION: + The function sends 'CAT/SCWS Channel Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSChannelStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATGetTerminalProfile + +DESCRIPTION: + The function sends 'CAT/Get Terminal Profile Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetTerminalProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATSetConfiguration + +DESCRIPTION: + The function sends 'CAT/Set Configuration Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + CATGetConfiguration + +DESCRIPTION: + The function sends 'CAT/Get Configuration Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + RMSReset + +DESCRIPTION: + The function sends 'RMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + RMSGetSMSWake + +DESCRIPTION: + The function sends 'RMS/Get SMS Wake Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSGetSMSWake( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + RMSSetSMSWake + +DESCRIPTION: + The function sends 'RMS/Set SMS Wake Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSSetSMSWake( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMAReset + +DESCRIPTION: + The function sends 'OMA/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMASetEventReport + +DESCRIPTION: + The function sends 'OMA/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMAStartSession + +DESCRIPTION: + The function sends 'OMA/Start Session Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAStartSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMACancelSession + +DESCRIPTION: + The function sends 'OMA/Cancel Session Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMACancelSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMAGetSessionInfo + +DESCRIPTION: + The function sends 'OMA/Get Session Info Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAGetSessionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMASendSelection + +DESCRIPTION: + The function sends 'OMA/Send Selection Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASendSelection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMAGetFeatures + +DESCRIPTION: + The function sends 'OMA/Get Features Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAGetFeatures( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================== +METHOD: + OMASetFeatures + +DESCRIPTION: + The function sends 'OMA/Set Features Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASetFeatures( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPIEnums.h b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPIEnums.h new file mode 100755 index 0000000..399a982 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPIEnums.h @@ -0,0 +1,4829 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtAPIEnums.h + +DESCRIPTION: + Declaration of the Gobi API enumerations + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +#pragma once + +// Gobi API error code +enum eGobiError +{ + eGOBI_ERR_ENUM_BEGIN = -1, + + eGOBI_ERR_NONE, // 00 Success + eGOBI_ERR_GENERAL, // 01 General error + eGOBI_ERR_INTERNAL, // 02 Internal error + eGOBI_ERR_MEMORY, // 03 Memory error + eGOBI_ERR_INVALID_ARG, // 04 Invalid argument + eGOBI_ERR_BUFFER_SZ, // 05 Buffer too small + eGOBI_ERR_NO_DEVICE, // 06 Unable to detect device + eGOBI_ERR_INVALID_DEVID, // 07 Invalid device ID + eGOBI_ERR_NO_CONNECTION, // 08 No connection to device + eGOBI_ERR_IFACE, // 09 Unable to obtain required interace + eGOBI_ERR_CONNECT, // 10 Unable to connect to interface + eGOBI_ERR_REQ_SCHEDULE, // 11 Unable to schedule request + eGOBI_ERR_REQUEST, // 12 Error sending request + eGOBI_ERR_RESPONSE, // 13 Error receiving response + eGOBI_ERR_REQUEST_TO, // 14 Timeout while sending request + eGOBI_ERR_RESPONSE_TO, // 15 Timeout while receiving response + eGOBI_ERR_MALFORMED_RSP, // 16 Malformed response received + eGOBI_ERR_INVALID_RSP, // 17 Invalid/error response received + eGOBI_ERR_INVALID_FILE, // 18 Invalid file path + eGOBI_ERR_FILE_OPEN, // 19 Unable to open file + eGOBI_ERR_FILE_COPY, // 20 Unable to copy file + eGOBI_ERR_QDL_SCM, // 21 Unable to open service control mgr + eGOBI_ERR_NO_QDL_SVC, // 22 Unable to detect QDL service + eGOBI_ERR_NO_QDL_SVC_INFO, // 23 Unable to obtain QDL service info + eGOBI_ERR_NO_QDL_SVC_PATH, // 24 Unable to locate QSL service + eGOBI_ERR_QDL_SVC_CFG, // 25 Unable to reconfigure QDL service + eGOBI_ERR_QDL_SVC_IFACE, // 26 Unable to interface to QDL service + eGOBI_ERR_OFFLINE, // 27 Unable to set device offline + eGOBI_ERR_RESET, // 28 Unable to reset device + eGOBI_ERR_NO_SIGNAL, // 29 No available signal + eGOBI_ERR_MULTIPLE_DEVICES, // 30 Multiple devices detected + eGOBI_ERR_DRIVER, // 31 Error interfacing to driver + eGOBI_ERR_NO_CANCELABLE_OP, // 32 No cancelable operation is pending + eGOBI_ERR_CANCEL_OP, // 33 Error canceling outstanding operation + eGOBI_ERR_QDL_CRC, // 34 QDL image data CRC error + eGOBI_ERR_QDL_PARSING, // 35 QDL image data parsing error + eGOBI_ERR_QDL_AUTH, // 36 QDL image authentication error + eGOBI_ERR_QDL_WRITE, // 37 QDL image write error + eGOBI_ERR_QDL_OPEN_SIZE, // 38 QDL image size error + eGOBI_ERR_QDL_OPEN_TYPE, // 39 QDL image type error + eGOBI_ERR_QDL_OPEN_PROT, // 40 QDL memory protection error + eGOBI_ERR_QDL_OPEN_SKIP, // 41 QDL image not required + eGOBI_ERR_QDL_ERR_GENERAL, // 42 QDL general error + eGOBI_ERR_QDL_BAR_MODE, // 43 QDL BAR mode error + + eGOBI_ERR_ENUM_END, + + // Offset from which mapped QMI error codes start from (see eQMIErrors) + eGOBI_ERR_QMI_OFFSET = 1000, +}; + +// Enum to describe QMI AUTH AKA Result +enum eQMIAUTHAKAResult:UINT8 +{ + eQMIAUTHAKAResult_Success = 0, + eQMIAUTHAKAResult_SyncFailure = 1, + eQMIAUTHAKAResult_Failure = 2, +}; + +// Enum to describe QMI AUTH AKA Version +enum eQMIAUTHAKAVersion:UINT8 +{ + eQMIAUTHAKAVersion_Version1 = 0, + eQMIAUTHAKAVersion_Version2 = 1, +}; + +// Enum to describe QMI AUTH EAP Result +enum eQMIAUTHEAPResult:UINT8 +{ + eQMIAUTHEAPResult_Success = 0, + eQMIAUTHEAPResult_Failure = 1, +}; + +// Enum to describe QMI CAT Activate Targets +enum eQMICATActivateTargets:UINT8 +{ + eQMICATActivateTargets_UICCCLFInterface = 1, +}; + +// Enum to describe QMI CAT Address NPI +enum eQMICATAddressNPI:UINT8 +{ + eQMICATAddressNPI_Unknown = 0, + eQMICATAddressNPI_ISDNTelephony = 1, + eQMICATAddressNPI_DataNPI = 2, + eQMICATAddressNPI_TelexNPI = 3, + eQMICATAddressNPI_PrivateNPI = 4, + eQMICATAddressNPI_ExtensionIsReserved = 15, +}; + +// Enum to describe QMI CAT Address TON +enum eQMICATAddressTON:UINT8 +{ + eQMICATAddressTON_Unknown = 0, + eQMICATAddressTON_InternationalNumber = 1, + eQMICATAddressTON_NationalNumber = 2, + eQMICATAddressTON_NetworkSpecificNumber = 3, +}; + +// Enum to describe QMI CAT Address Type +enum eQMICATAddressType:UINT8 +{ + eQMICATAddressType_NoAddressGiven = 1, + eQMICATAddressType_Dynamic = 2, + eQMICATAddressType_IPv4 = 3, + eQMICATAddressType_IPv6 = 4, +}; + +// Enum to describe QMI CAT Alpha ID Command Type +enum eQMICATAlphaIDCommandType:UINT8 +{ + eQMICATAlphaIDCommandType_SendSMSProactiveCommand = 1, +}; + +// Enum to describe QMI CAT Bearer +enum eQMICATBearer:UINT8 +{ + eQMICATBearer_SMS = 0, + eQMICATBearer_CSD = 1, + eQMICATBearer_USSD = 2, + eQMICATBearer_GPRS = 3, + eQMICATBearer_Default = 4, +}; + +// Enum to describe QMI CAT Bearer Capability Repeat Indicator +enum eQMICATBearerCapabilityRepeatIndicator:UINT8 +{ + eQMICATBearerCapabilityRepeatIndicator_AlternateMode = 0, + eQMICATBearerCapabilityRepeatIndicator_SequentialMode = 1, +}; + +// Enum to describe QMI CAT Browser Termination Causes +enum eQMICATBrowserTerminationCauses:UINT32 +{ + eQMICATBrowserTerminationCauses_UserTerminated = 0, + eQMICATBrowserTerminationCauses_ErrorTerminated = 1, +}; + +// Enum to describe QMI CAT CSD Bearer Name +enum eQMICATCSDBearerName:UINT8 +{ + eQMICATCSDBearerName_DataCircuitAsyncUDIOr31kHzModem = 0, + eQMICATCSDBearerName_DataCircuitSyncUDIOr31kHzModem = 1, + eQMICATCSDBearerName_PADAccessAsyncUDI = 2, + eQMICATCSDBearerName_PacketAccessSyncUDI = 3, + eQMICATCSDBearerName_DataCircuitAsyncRDI = 4, + eQMICATCSDBearerName_DataCircuitSyncRDI = 5, + eQMICATCSDBearerName_PADAccessAsyncRDI = 6, + eQMICATCSDBearerName_PacketAccessSyncRDI = 7, +}; + +// Enum to describe QMI CAT Call Control Result +enum eQMICATCallControlResult:UINT8 +{ + eQMICATCallControlResult_AllowedWithNoModification = 0, + eQMICATCallControlResult_NotAllowed = 1, + eQMICATCallControlResult_AllowedWithModification = 2, +}; + +// Enum to describe QMI CAT Call Setup Requirement +enum eQMICATCallSetupRequirement:UINT8 +{ + eQMICATCallSetupRequirement_NoOtherCalls = 0, + eQMICATCallSetupRequirement_HoldActiveCalls = 1, + eQMICATCallSetupRequirement_DisconnectActiveCalls = 2, +}; + +// Enum to describe QMI CAT Channel State +enum eQMICATChannelState:UINT8 +{ + eQMICATChannelState_ClosedState = 0, + eQMICATChannelState_ListenState = 1, + eQMICATChannelState_EstablishedState = 2, +}; + +// Enum to describe QMI CAT Command Format +enum eQMICATCommandFormat:UINT8 +{ + eQMICATCommandFormat_Raw = 1, + eQMICATCommandFormat_Decoded = 2, +}; + +// Enum to describe QMI CAT Command ID +enum eQMICATCommandID:UINT8 +{ + eQMICATCommandID_DisplayText = 1, + eQMICATCommandID_GetInkey = 2, + eQMICATCommandID_GetInput = 3, + eQMICATCommandID_LaunchBrowser = 4, + eQMICATCommandID_PlayTone = 5, + eQMICATCommandID_SelectItem = 6, + eQMICATCommandID_SendSMS = 7, + eQMICATCommandID_SendSS = 8, + eQMICATCommandID_SendUSSD = 9, + eQMICATCommandID_SetupCallUserConfiguration = 10, + eQMICATCommandID_SetupCallAlphaDisplay = 11, + eQMICATCommandID_SetupMenu = 12, + eQMICATCommandID_SetupIdleText = 13, + eQMICATCommandID_ProvideLocalInformationLanguage = 14, + eQMICATCommandID_SendDTMF = 15, + eQMICATCommandID_LanguageNotification = 16, + eQMICATCommandID_SetupEventUserActivity = 17, + eQMICATCommandID_SetupEventIdleScreenNotify = 18, + eQMICATCommandID_SetupEventLanguageSelectionNotify = 19, + eQMICATCommandID_OpenChannel = 20, + eQMICATCommandID_CloseChannel = 21, + eQMICATCommandID_ReceiveData = 22, + eQMICATCommandID_SendData = 23, + eQMICATCommandID_Activate = 24, + eQMICATCommandID_SetupEventHCIConnectivity = 25, +}; + +// Enum to describe QMI CAT Config Modes +enum eQMICATConfigModes:UINT8 +{ + eQMICATConfigModes_DisabledMode = 0, + eQMICATConfigModes_GobiMode = 1, + eQMICATConfigModes_AndroidMode = 2, + eQMICATConfigModes_DecodedMode = 3, + eQMICATConfigModes_DecodedPullOnlyMode = 4, + eQMICATConfigModes_CustomRawMode = 5, + eQMICATConfigModes_CustomDecodedMode = 6, +}; + +// Enum to describe QMI CAT Connection Element +enum eQMICATConnectionElement:UINT8 +{ + eQMICATConnectionElement_Transparent = 0, + eQMICATConnectionElement_Nontransparent = 1, + eQMICATConnectionElement_BothTransparentPreferred = 2, + eQMICATConnectionElement_BothNontransparentPreferred = 3, +}; + +// Enum to describe QMI CAT Data Coding Scheme +enum eQMICATDataCodingScheme:UINT8 +{ + eQMICATDataCodingScheme_7BitGSM = 0, + eQMICATDataCodingScheme_8BitGSM = 1, + eQMICATDataCodingScheme_UCS2 = 2, +}; + +// Enum to describe QMI CAT Decoded Envelope Command +enum eQMICATDecodedEnvelopeCommand:UINT16 +{ + eQMICATDecodedEnvelopeCommand_MenuSelection = 1, + eQMICATDecodedEnvelopeCommand_EventDownloadLanguageSelection = 2, + eQMICATDecodedEnvelopeCommand_EventDownloadUserActivity = 3, + eQMICATDecodedEnvelopeCommand_EventDownloadIdleScreenAvailable = 4, + eQMICATDecodedEnvelopeCommand_SendCallControl = 5, + eQMICATDecodedEnvelopeCommand_EventDownloadHCIConnectivity = 6, + eQMICATDecodedEnvelopeCommand_EventBrowserTermination = 7, +}; + +// Enum to describe QMI CAT Deliver Error SDU +enum eQMICATDeliverErrorSDU:UINT8 +{ + eQMICATDeliverErrorSDU_No = 0, + eQMICATDeliverErrorSDU_Yes = 1, + eQMICATDeliverErrorSDU_NoDetect = 2, + eQMICATDeliverErrorSDU_SubscribedValue = 3, +}; + +// Enum to describe QMI CAT Delivery Order +enum eQMICATDeliveryOrder:UINT8 +{ + eQMICATDeliveryOrder_No = 0, + eQMICATDeliveryOrder_Yes = 1, + eQMICATDeliveryOrder_SubscribedValue = 2, +}; + +// Enum to describe QMI CAT Display Icon Only +enum eQMICATDisplayIconOnly:UINT8 +{ + eQMICATDisplayIconOnly_DoNotDisplayTheIcon = 0, + eQMICATDisplayIconOnly_DisplayOnlyTheIcon = 1, +}; + +// Enum to describe QMI CAT Envelope Command Type +enum eQMICATEnvelopeCommandType:UINT16 +{ + eQMICATEnvelopeCommandType_MenuSelection = 1, + eQMICATEnvelopeCommandType_EventDownloadUserActivity = 2, + eQMICATEnvelopeCommandType_EventDownloadIdleScreenAvailable = 3, + eQMICATEnvelopeCommandType_EventDownloadLanguageSelection = 4, + eQMICATEnvelopeCommandType_UnknownType = 5, + eQMICATEnvelopeCommandType_EventDownloadBrowserTermination = 6, + eQMICATEnvelopeCommandType_SendCallControl = 7, + eQMICATEnvelopeCommandType_EventDownloadHCIConnectivity = 8, +}; + +// Enum to describe QMI CAT Help Available +enum eQMICATHelpAvailable:UINT8 +{ + eQMICATHelpAvailable_NoHelpIsAvailable = 0, + eQMICATHelpAvailable_HelpIsAvailable = 1, +}; + +// Enum to describe QMI CAT Help Request +enum eQMICATHelpRequest:UINT8 +{ + eQMICATHelpRequest_NoHelpIsRequested = 0, + eQMICATHelpRequest_HelpIsRequested = 1, +}; + +// Enum to describe QMI CAT High Priority +enum eQMICATHighPriority:UINT8 +{ + eQMICATHighPriority_DoNotClearTheScreen = 0, + eQMICATHighPriority_ClearAnythingThatIsOnTheScreen = 1, +}; + +// Enum to describe QMI CAT Icon Is Displayed +enum eQMICATIconIsDisplayed:UINT8 +{ + eQMICATIconIsDisplayed_No = 0, + eQMICATIconIsDisplayed_Yes = 1, +}; + +// Enum to describe QMI CAT Icon Qualifier +enum eQMICATIconQualifier:UINT8 +{ + eQMICATIconQualifier_IconIsSelfExplanatory = 0, + eQMICATIconQualifier_IconIsNotSelfExplanatory = 1, +}; + +// Enum to describe QMI CAT Image Coding Scheme +enum eQMICATImageCodingScheme:UINT8 +{ + eQMICATImageCodingScheme_Unknown = 0, + eQMICATImageCodingScheme_Basic = 1, + eQMICATImageCodingScheme_Color = 2, +}; + +// Enum to describe QMI CAT Immediate Response +enum eQMICATImmediateResponse:UINT8 +{ + eQMICATImmediateResponse_No = 0, + eQMICATImmediateResponse_Yes = 1, +}; + +// Enum to describe QMI CAT Is CDMA SMS +enum eQMICATIsCDMASMS:UINT8 +{ + eQMICATIsCDMASMS_NotCDMASMS = 0, + eQMICATIsCDMASMS_CDMASMS = 1, +}; + +// Enum to describe QMI CAT Launch Mode +enum eQMICATLaunchMode:UINT8 +{ + eQMICATLaunchMode_LaunchIfNotAlreadyLaunched = 0, + eQMICATLaunchMode_UseTheExistingBrowser = 1, + eQMICATLaunchMode_CloseTheExistingBroswer = 2, +}; + +// Enum to describe QMI CAT Next Action +enum eQMICATNextAction:UINT8 +{ + eQMICATNextAction_SetupCall = 0, + eQMICATNextAction_SendSS = 1, + eQMICATNextAction_SendUSSD = 2, + eQMICATNextAction_SendShortMessage = 3, + eQMICATNextAction_LaunchBrowser = 4, + eQMICATNextAction_PlayTone = 5, + eQMICATNextAction_DisplayText = 6, + eQMICATNextAction_GetInkey = 7, + eQMICATNextAction_GetInput = 8, + eQMICATNextAction_SelectItem = 9, + eQMICATNextAction_SetupMenu = 10, + eQMICATNextAction_SetupIdleModeText = 11, + eQMICATNextAction_EndOfTheProactiveSession = 12, + eQMICATNextAction_ProvideLocalInformation = 13, +}; + +// Enum to describe QMI CAT Notification Required +enum eQMICATNotificationRequired:UINT8 +{ + eQMICATNotificationRequired_NotificationIsNotRequired = 0, + eQMICATNotificationRequired_NotificationIsRequired = 1, +}; + +// Enum to describe QMI CAT On Demand Link Establish +enum eQMICATOnDemandLinkEstablish:UINT8 +{ + eQMICATOnDemandLinkEstablish_LinkIsNotRequired = 0, + eQMICATOnDemandLinkEstablish_LinkIsRequired = 1, +}; + +// Enum to describe QMI CAT PDP Type +enum eQMICATPDPType:UINT8 +{ + eQMICATPDPType_IP = 2, +}; + +// Enum to describe QMI CAT Packet Data Protocol +enum eQMICATPacketDataProtocol:UINT8 +{ + eQMICATPacketDataProtocol_IP = 2, +}; + +// Enum to describe QMI CAT Packing Required +enum eQMICATPackingRequired:UINT8 +{ + eQMICATPackingRequired_PackingIsNotRequired = 0, + eQMICATPackingRequired_PackingIsRequired = 1, +}; + +// Enum to describe QMI CAT Presentation +enum eQMICATPresentation:UINT8 +{ + eQMICATPresentation_NotSpecified = 0, + eQMICATPresentation_DataValuePresentation = 1, + eQMICATPresentation_NavigationPresentation = 2, +}; + +// Enum to describe QMI CAT Proactive Session End Type +enum eQMICATProactiveSessionEndType:UINT8 +{ + eQMICATProactiveSessionEndType_EndProactiveSessionCommandReceivedFromTheCard = 1, + eQMICATProactiveSessionEndType_EndProactiveSessionInternalToME = 2, +}; + +// Enum to describe QMI CAT Redial Necessary +enum eQMICATRedialNecessary:UINT8 +{ + eQMICATRedialNecessary_RedialIsNotNecessary = 0, + eQMICATRedialNecessary_RedialIsNecessary = 1, +}; + +// Enum to describe QMI CAT Refresh Stage +enum eQMICATRefreshStage:UINT16 +{ + eQMICATRefreshStage_RefreshStart = 1, + eQMICATRefreshStage_RefreshSuccess = 2, + eQMICATRefreshStage_RefreshFailed = 3, +}; + +// Enum to describe QMI CAT Response Command +enum eQMICATResponseCommand:UINT8 +{ + eQMICATResponseCommand_DisplayText = 1, + eQMICATResponseCommand_GetInkey = 2, + eQMICATResponseCommand_GetInput = 3, + eQMICATResponseCommand_LaunchBrowser = 4, + eQMICATResponseCommand_PlayTone = 5, + eQMICATResponseCommand_SelectItemRequest = 6, + eQMICATResponseCommand_SetupMenu = 7, + eQMICATResponseCommand_SetupIdleText = 8, + eQMICATResponseCommand_ProvideLocalInformationLanguage = 9, + eQMICATResponseCommand_SetupEventUserActivity = 10, + eQMICATResponseCommand_SetupEventIdleScreenActivity = 11, + eQMICATResponseCommand_SetupEventLanguageSelectNotify = 12, + eQMICATResponseCommand_LanguageNotification = 13, + eQMICATResponseCommand_Activate = 14, + eQMICATResponseCommand_SetupEventHCIConnectivity = 15, +}; + +// Enum to describe QMI CAT Response Format +enum eQMICATResponseFormat:UINT8 +{ + eQMICATResponseFormat_SMSDefaultAlphabet = 0, + eQMICATResponseFormat_YesOrNo = 1, + eQMICATResponseFormat_NumericalOnly = 2, + eQMICATResponseFormat_UCS2 = 3, + eQMICATResponseFormat_ImmediateDigitResponse = 4, + eQMICATResponseFormat_YesOrNoOrImmediateDigitalResponse = 5, +}; + +// Enum to describe QMI CAT Response Packing Format +enum eQMICATResponsePackingFormat:UINT8 +{ + eQMICATResponsePackingFormat_UnpacketFormat = 0, + eQMICATResponsePackingFormat_PacketFormat = 1, +}; + +// Enum to describe QMI CAT Send Data Immediately +enum eQMICATSendDataImmediately:UINT8 +{ + eQMICATSendDataImmediately_NoStoreInTXBuffer = 0, + eQMICATSendDataImmediately_Yes = 1, +}; + +// Enum to describe QMI CAT Send Data Result +enum eQMICATSendDataResult:UINT8 +{ + eQMICATSendDataResult_Failed = 0, + eQMICATSendDataResult_Success = 1, +}; + +// Enum to describe QMI CAT Show User Input +enum eQMICATShowUserInput:UINT8 +{ + eQMICATShowUserInput_DeviceCanShowAllCharacters = 0, + eQMICATShowUserInput_DeviceCanShowUserInput = 1, +}; + +// Enum to describe QMI CAT Slot +enum eQMICATSlot:UINT8 +{ + eQMICATSlot_Slot1 = 1, + eQMICATSlot_Slot2 = 2, +}; + +// Enum to describe QMI CAT Softkey Selection +enum eQMICATSoftkeySelection:UINT8 +{ + eQMICATSoftkeySelection_SoftkeyIsNotSelected = 0, + eQMICATSoftkeySelection_SoftkeyIsSelected = 1, +}; + +// Enum to describe QMI CAT Specific Language Notfication +enum eQMICATSpecificLanguageNotfication:UINT8 +{ + eQMICATSpecificLanguageNotfication_No = 0, + eQMICATSpecificLanguageNotfication_Yes = 1, +}; + +// Enum to describe QMI CAT Time Units +enum eQMICATTimeUnits:UINT8 +{ + eQMICATTimeUnits_Minutes = 0, + eQMICATTimeUnits_Seconds = 1, + eQMICATTimeUnits_TenthsOfSeconds = 2, + eQMICATTimeUnits_DurationIsNotPresent = 255, +}; + +// Enum to describe QMI CAT Tone +enum eQMICATTone:UINT8 +{ + eQMICATTone_DialTone = 1, + eQMICATTone_CalledSubscriberBusy = 2, + eQMICATTone_Congestion = 3, + eQMICATTone_RadioPathAck = 4, + eQMICATTone_RadioPathNotAvailableCallDrop = 5, + eQMICATTone_ErrorTone = 6, + eQMICATTone_CallWaitingTone = 7, + eQMICATTone_RingingTone = 8, + eQMICATTone_GeneralBeep = 9, + eQMICATTone_PositiveAckTone = 10, + eQMICATTone_NegativeAckTone = 11, + eQMICATTone_RingingToneSelectedByUser = 12, + eQMICATTone_SMSAlertToneSelectedByUser = 13, + eQMICATTone_NotInUse = 255, +}; + +// Enum to describe QMI CAT Traffic Class +enum eQMICATTrafficClass:UINT8 +{ + eQMICATTrafficClass_Conversational = 0, + eQMICATTrafficClass_Streaming = 1, + eQMICATTrafficClass_Interactive = 2, + eQMICATTrafficClass_Background = 3, + eQMICATTrafficClass_SubscribedValue = 4, +}; + +// Enum to describe QMI CAT Transport Protocol +enum eQMICATTransportProtocol:UINT8 +{ + eQMICATTransportProtocol_NotPresent = 0, + eQMICATTransportProtocol_UDP = 1, + eQMICATTransportProtocol_TCP = 2, +}; + +// Enum to describe QMI CAT USSD Data Coding Scheme +enum eQMICATUSSDDataCodingScheme:UINT8 +{ + eQMICATUSSDDataCodingScheme_7BitGSM = 0, + eQMICATUSSDDataCodingScheme_8BitGSM = 1, + eQMICATUSSDDataCodingScheme_8BitUCS2 = 2, + eQMICATUSSDDataCodingScheme_7BitUCS2 = 3, +}; + +// Enum to describe QMI CAT User Confirmed +enum eQMICATUserConfirmed:UINT8 +{ + eQMICATUserConfirmed_No = 0, + eQMICATUserConfirmed_Yes = 1, +}; + +// Enum to describe QMI CAT User Control +enum eQMICATUserControl:UINT8 +{ + eQMICATUserControl_DoNotAllowUserToClearTheScreen = 0, + eQMICATUserControl_AllowUserToClearTheScreen = 1, +}; + +// Enum to describe QMI CTL Driver Data Formats +enum eQMICTLDriverDataFormats +{ + eQMICTLDriverDataFormats_QoSFlowHeaderAbsent = 0, + eQMICTLDriverDataFormats_QoSFlowHeaderPresent = 1, +}; + +// Enum to describe QMI CTL Power Save States +enum eQMICTLPowerSaveStates +{ + eQMICTLPowerSaveStates_Normal = 0, + eQMICTLPowerSaveStates_Suspend = 1, + eQMICTLPowerSaveStates_Powerdown = 2, +}; + +// Enum to describe QMI CTL Service Types +enum eQMICTLServiceTypes +{ + eQMICTLServiceTypes_Control = 0, + eQMICTLServiceTypes_WDS = 1, + eQMICTLServiceTypes_DMS = 2, + eQMICTLServiceTypes_NAS = 3, + eQMICTLServiceTypes_QOS = 4, + eQMICTLServiceTypes_WMS = 5, + eQMICTLServiceTypes_PDS = 6, + eQMICTLServiceTypes_AUTH = 7, + eQMICTLServiceTypes_CAT = 224, + eQMICTLServiceTypes_RMS = 225, + eQMICTLServiceTypes_OMA = 226, +}; + +// Enum to describe QMI Call End Reasons +enum eQMICallEndReasons:UINT16 +{ + eQMICallEndReasons_Unknown = 0, + eQMICallEndReasons_Unspecified = 1, + eQMICallEndReasons_ClientEnd = 2, + eQMICallEndReasons_NoService = 3, + eQMICallEndReasons_Fade = 4, + eQMICallEndReasons_ReleaseNormal = 5, + eQMICallEndReasons_AccInProgress = 6, + eQMICallEndReasons_AccFailed = 7, + eQMICallEndReasons_RedirectOrHandoff = 8, + eQMICallEndReasons_CloseInProgress = 9, + eQMICallEndReasons_AuthenticationFailed = 10, + eQMICallEndReasons_InternalError = 11, + eQMICallEndReasons_CDMALock = 500, + eQMICallEndReasons_Intercept = 501, + eQMICallEndReasons_Reorder = 502, + eQMICallEndReasons_ReleaseServiceOptionRejected = 503, + eQMICallEndReasons_IncomingCall = 504, + eQMICallEndReasons_AlertStop = 505, + eQMICallEndReasons_Activation = 506, + eQMICallEndReasons_MaxAccessProbe = 507, + eQMICallEndReasons_CCSNotSupportedByBS = 508, + eQMICallEndReasons_NoResponseFromBS = 509, + eQMICallEndReasons_RejectedByBS = 510, + eQMICallEndReasons_Incompatible = 511, + eQMICallEndReasons_AlreadyInTC = 512, + eQMICallEndReasons_UserCallOrigDuringGPS = 513, + eQMICallEndReasons_UserCallOrigDuringSMS = 514, + eQMICallEndReasons_NoCDMAService = 515, + eQMICallEndReasons_ConfFailed = 1000, + eQMICallEndReasons_IncomingRejected = 1001, + eQMICallEndReasons_NoGWService = 1002, + eQMICallEndReasons_NetworkEnd = 1003, + eQMICallEndReasons_LLCOrSNDCPFailure = 1004, + eQMICallEndReasons_InsufficientResources = 1005, + eQMICallEndReasons_ServiceOptionOutOfOrder = 1006, + eQMICallEndReasons_NSAPIAlreadyUsed = 1007, + eQMICallEndReasons_RegularPDPContextDeactivation = 1008, + eQMICallEndReasons_NetworkFailure = 1009, + eQMICallEndReasons_ReactivationRequested = 1010, + eQMICallEndReasons_ProtocolError = 1011, + eQMICallEndReasons_OperatorDeterminedBarring = 1012, + eQMICallEndReasons_UnknownOrMissingAPN = 1013, + eQMICallEndReasons_UnknownPDPAddressOrPDPType = 1014, + eQMICallEndReasons_ActivationRejectedByGGSN = 1015, + eQMICallEndReasons_ActivationRejectedUnspecified = 1016, + eQMICallEndReasons_ServiceOptionNotSupported = 1017, + eQMICallEndReasons_RequestedServiceOptionNotSubscribed = 1018, + eQMICallEndReasons_QoSNotAccepted = 1019, + eQMICallEndReasons_SemanticErrorInTheTFTOperation = 1020, + eQMICallEndReasons_SyntacticalErrorInTheTFTOperation = 1021, + eQMICallEndReasons_UnknownPDPContext = 1022, + eQMICallEndReasons_SemanticErrorsInPacketFilters = 1023, + eQMICallEndReasons_SyntacticalErrorsInPacketFilters = 1024, + eQMICallEndReasons_PDPContextWithoutTFTAlreadyActivated = 1025, + eQMICallEndReasons_InvalidTransactionIdentifierValue = 1026, + eQMICallEndReasons_SemanticallyIncorrectMessage = 1027, + eQMICallEndReasons_InvalidMandatoryInformation = 1028, + eQMICallEndReasons_MessageTypeNonExistent = 1029, + eQMICallEndReasons_MessageNotCompatibleWithState = 1030, + eQMICallEndReasons_InformationElementNonexistent = 1031, + eQMICallEndReasons_ConditionalInformationElementError = 1032, + eQMICallEndReasons_MessageNotCompatibleWithProtocolState = 1033, + eQMICallEndReasons_APNRestrictionValueIncompatibleWithActivePDPContext = 1034, + eQMICallEndReasons_NoGPRSContextPresent = 1035, + eQMICallEndReasons_RequestedFeatureNotSupported = 1036, + eQMICallEndReasons_CDGenOrBusy = 1500, + eQMICallEndReasons_CDBillOrAuth = 1501, + eQMICallEndReasons_ChangeHDR = 1502, + eQMICallEndReasons_ExitHDR = 1503, + eQMICallEndReasons_HDRNoSession = 1504, + eQMICallEndReasons_HDROrigDuringGPSFix = 1505, + eQMICallEndReasons_HDRCSTimeout = 1506, + eQMICallEndReasons_HDRReleasedByCM = 1507, +}; + +// Enum to describe QMI Call History Types +enum eQMICallHistoryTypes:UINT8 +{ + eQMICallHistoryTypes_Full = 0, + eQMICallHistoryTypes_IDsOnly = 1, +}; + +// Enum to describe QMI Call Types +enum eQMICallTypes:UINT8 +{ + eQMICallTypes_NDIS = 0, + eQMICallTypes_DUN = 1, +}; + +// Enum to describe QMI Connection Status +enum eQMIConnectionStatus:UINT8 +{ + eQMIConnectionStatus_Disconnected = 1, + eQMIConnectionStatus_Connected = 2, + eQMIConnectionStatus_Suspended = 3, + eQMIConnectionStatus_Authenticating = 4, +}; + +// Enum to describe QMI DMS Activation States +enum eQMIDMSActivationStates:UINT16 +{ + eQMIDMSActivationStates_ServiceNotActivated = 0, + eQMIDMSActivationStates_SerivceActivated = 1, + eQMIDMSActivationStates_ActivationConnecting = 2, + eQMIDMSActivationStates_ActivationInProgress = 3, + eQMIDMSActivationStates_OTASPSecurityAuthenticated = 4, + eQMIDMSActivationStates_OTASPNAMDownloaded = 5, + eQMIDMSActivationStates_OTASPMDNDownloaded = 6, + eQMIDMSActivationStates_OTASPIMSIDownloaded = 7, + eQMIDMSActivationStates_OTASPPRLDownloaded = 8, + eQMIDMSActivationStates_OTASPSPCDownloaded = 9, + eQMIDMSActivationStates_OTASPSettingsCommitted = 10, +}; + +// Enum to describe QMI DMS Activation Types +enum eQMIDMSActivationTypes +{ + eQMIDMSActivationTypes_OTASP = 0, +}; + +// Enum to describe QMI DMS Data Service Capabilities 1 +enum eQMIDMSDataServiceCapabilities1:UINT8 +{ + eQMIDMSDataServiceCapabilities1_NoDataServicesSupported = 0, + eQMIDMSDataServiceCapabilities1_OnlyCircuitSwitched = 1, + eQMIDMSDataServiceCapabilities1_OnlyPacketSwitched = 2, + eQMIDMSDataServiceCapabilities1_SimultaneousCircuitPacketSwitched = 3, + eQMIDMSDataServiceCapabilities1_NonsimultaneousCircuitPacketSwitched = 4, +}; + +// Enum to describe QMI DMS Image Types +enum eQMIDMSImageTypes +{ + eQMIDMSImageTypes_Modem = 0, + eQMIDMSImageTypes_PRI = 1, +}; + +// Enum to describe QMI DMS Lock States +enum eQMIDMSLockStates:UINT8 +{ + eQMIDMSLockStates_LockDisabled = 0, + eQMIDMSLockStates_LockEnabled = 1, +}; + +// Enum to describe QMI DMS Operating Modes +enum eQMIDMSOperatingModes:UINT8 +{ + eQMIDMSOperatingModes_Online = 0, + eQMIDMSOperatingModes_LowPower = 1, + eQMIDMSOperatingModes_FactoryTestMode = 2, + eQMIDMSOperatingModes_Offline = 3, + eQMIDMSOperatingModes_Reset = 4, + eQMIDMSOperatingModes_Shutdown = 5, + eQMIDMSOperatingModes_PersistentLowPower = 6, + eQMIDMSOperatingModes_ModeOnlyLowPower = 7, + eQMIDMSOperatingModes_GWNetworkTest = 8, +}; + +// Enum to describe QMI DMS PIN Status +enum eQMIDMSPINStatus:UINT8 +{ + eQMIDMSPINStatus_PINUninitialized = 0, + eQMIDMSPINStatus_PINEnabledUnverified = 1, + eQMIDMSPINStatus_PINEnabledVerified = 2, + eQMIDMSPINStatus_PINDisabled = 3, + eQMIDMSPINStatus_PINBlocked = 4, + eQMIDMSPINStatus_PINBlockedPermanently = 5, + eQMIDMSPINStatus_PINUnblocked = 6, + eQMIDMSPINStatus_PINChanged = 7, +}; + +// Enum to describe QMI DMS Power Sources +enum eQMIDMSPowerSources:UINT8 +{ + eQMIDMSPowerSources_Battery = 0, + eQMIDMSPowerSources_External = 1, +}; + +// Enum to describe QMI DMS Radio Interfaces +enum eQMIDMSRadioInterfaces:UINT8 +{ + eQMIDMSRadioInterfaces_CDMA20001x = 1, + eQMIDMSRadioInterfaces_CDMA2000HRPD = 2, + eQMIDMSRadioInterfaces_GSM = 4, + eQMIDMSRadioInterfaces_UMTS = 5, + eQMIDMSRadioInterfaces_LTE = 8, + eQMIDMSRadioInterfaces_TDS = 9, +}; + +// Enum to describe QMI DMS Service Capabilities +enum eQMIDMSServiceCapabilities:UINT32 +{ + eQMIDMSServiceCapabilities_DataOnly = 1, + eQMIDMSServiceCapabilities_VoiceOnly = 2, + eQMIDMSServiceCapabilities_SimultaneousVoiceAndData = 3, + eQMIDMSServiceCapabilities_NonsimultaneousVoiceAndData = 4, +}; + +// Enum to describe QMI DMS Time References +enum eQMIDMSTimeReferences:UINT32 +{ + eQMIDMSTimeReferences_User = 0, +}; + +// Enum to describe QMI DMS Timestamp Sources +enum eQMIDMSTimestampSources:UINT16 +{ + eQMIDMSTimestampSources_Device = 0, + eQMIDMSTimestampSources_CDMANetwork = 1, + eQMIDMSTimestampSources_CDMA1xEVDONetwork = 2, + eQMIDMSTimestampSources_GSMNetwork = 3, + eQMIDMSTimestampSources_WCDMANetwork = 4, + eQMIDMSTimestampSources_GPSNetwork = 5, + eQMIDMSTimestampSources_MFLONetwork = 6, +}; + +// Enum to describe QMI DMS UIM Facility +enum eQMIDMSUIMFacility:UINT8 +{ + eQMIDMSUIMFacility_PNNetworkPersonalization = 0, + eQMIDMSUIMFacility_PUNetworkSubsetPersonalization = 1, + eQMIDMSUIMFacility_PPServiceProviderPersonalization = 2, + eQMIDMSUIMFacility_PCCorporatePersonalization = 3, + eQMIDMSUIMFacility_PFUIMPersonalization = 4, +}; + +// Enum to describe QMI DMS UIM Facility States +enum eQMIDMSUIMFacilityStates:UINT8 +{ + eQMIDMSUIMFacilityStates_Deactivated = 0, + eQMIDMSUIMFacilityStates_Activated = 1, + eQMIDMSUIMFacilityStates_Block = 2, +}; + +// Enum to describe QMI DMS UIM States +enum eQMIDMSUIMStates:UINT8 +{ + eQMIDMSUIMStates_InitializationCompleted = 0, + eQMIDMSUIMStates_InitializationFailed = 1, + eQMIDMSUIMStates_NotPresent = 2, + eQMIDMSUIMStates_StateUnavailable = 255, +}; + +// Enum to describe QMI Data Bearer Technologies +enum eQMIDataBearerTechnologies:UINT8 +{ + eQMIDataBearerTechnologies_CDMA20001x = 1, + eQMIDataBearerTechnologies_CDMA20001xEVDORev0 = 2, + eQMIDataBearerTechnologies_GPRS = 3, + eQMIDataBearerTechnologies_WCDMA = 4, + eQMIDataBearerTechnologies_CDMA20001xEVDORevA = 5, + eQMIDataBearerTechnologies_EGPRS = 6, + eQMIDataBearerTechnologies_HSDPAWCDMA = 7, + eQMIDataBearerTechnologies_WCDMAHSUPA = 8, + eQMIDataBearerTechnologies_HSDPAHSUPA = 9, + eQMIDataBearerTechnologies_LTE = 10, + eQMIDataBearerTechnologies_CDMA2000EHRPD = 11, + eQMIDataBearerTechnologies_HSDPAPlusWCDMA = 12, + eQMIDataBearerTechnologies_HSDPAPlusHSUPA = 13, + eQMIDataBearerTechnologies_DualCellHSDPAPlusWCDMA = 14, + eQMIDataBearerTechnologies_DualCellHSDPAPlusHSUPA = 15, + eQMIDataBearerTechnologies_HSDPAPlus64QAM = 16, + eQMIDataBearerTechnologies_HSDPAPlus64QAMHSUPA = 17, + eQMIDataBearerTechnologies_TDSCDMA = 18, + eQMIDataBearerTechnologies_TDSCDMAHSDPA = 19, + eQMIDataBearerTechnologies_Unknown = 255, +}; + +// Enum to describe QMI Dormancy Status +enum eQMIDormancyStatus:UINT8 +{ + eQMIDormancyStatus_TrafficChannelDormant = 1, + eQMIDormancyStatus_TrafficChannelActive = 2, +}; + +// Enum to describe QMI Erroneous SDU Deliveries +enum eQMIErroneousSDUDeliveries:UINT8 +{ + eQMIErroneousSDUDeliveries_Subscribe = 0, + eQMIErroneousSDUDeliveries_NoDetection = 1, + eQMIErroneousSDUDeliveries_ErroneousSDUIsDelivered = 2, + eQMIErroneousSDUDeliveries_ErroneousSDUIsNotDelivered = 3, +}; + +// Enum to describe QMI Errors +enum eQMIErrors:UINT16 +{ + eQMIErrors_None = 0, + eQMIErrors_MalformedMessage = 1, + eQMIErrors_NoMemory = 2, + eQMIErrors_Internal = 3, + eQMIErrors_Aborted = 4, + eQMIErrors_ClientIDsExhausted = 5, + eQMIErrors_UnabortableTransaction = 6, + eQMIErrors_InvalidClientID = 7, + eQMIErrors_NoThresholdsProvided = 8, + eQMIErrors_InvalidHandle = 9, + eQMIErrors_InvalidProfile = 10, + eQMIErrors_InvalidPINID = 11, + eQMIErrors_IncorrectPIN = 12, + eQMIErrors_NoNetworkFound = 13, + eQMIErrors_CallFailed = 14, + eQMIErrors_OutOfCall = 15, + eQMIErrors_NotProvisioned = 16, + eQMIErrors_MissingArgument = 17, + eQMIErrors_ArgumentTooLong = 19, + eQMIErrors_InvalidTransactionID = 22, + eQMIErrors_DeviceInUse = 23, + eQMIErrors_NetworkUnsupported = 24, + eQMIErrors_DeviceUnsupported = 25, + eQMIErrors_NoEffect = 26, + eQMIErrors_NoFreeProfile = 27, + eQMIErrors_InvalidPDPType = 28, + eQMIErrors_InvalidTechnologyPreference = 29, + eQMIErrors_InvalidProfileType = 30, + eQMIErrors_InvalidServiceType = 31, + eQMIErrors_InvalidRegisterAction = 32, + eQMIErrors_InvalidPSAttachAction = 33, + eQMIErrors_AuthenticationFailed = 34, + eQMIErrors_PINBlocked = 35, + eQMIErrors_PINAlwaysBlocked = 36, + eQMIErrors_UIMUninitialized = 37, + eQMIErrors_MaximumQoSRequestsInUse = 38, + eQMIErrors_IncorrectFlowFilter = 39, + eQMIErrors_NetworkQoSUnaware = 40, + eQMIErrors_InvalidQoSID = 41, + eQMIErrors_QoSUnavailable = 42, + eQMIErrors_FlowSuspended = 43, + eQMIErrors_GeneralError = 46, + eQMIErrors_UnknownError = 47, + eQMIErrors_InvalidArgument = 48, + eQMIErrors_InvalidIndex = 49, + eQMIErrors_NoEntry = 50, + eQMIErrors_DeviceStorageFull = 51, + eQMIErrors_DeviceNotReady = 52, + eQMIErrors_NetworkNotReady = 53, + eQMIErrors_WMSCauseCode = 54, + eQMIErrors_WMSMessageNotSent = 55, + eQMIErrors_WMSMessageDeliveryFailure = 56, + eQMIErrors_WMSInvalidMessageID = 57, + eQMIErrors_WMSEncoding = 58, + eQMIErrors_AuthenticationLock = 59, + eQMIErrors_InvalidTransition = 60, + eQMIErrors_SessionInactive = 65, + eQMIErrors_SessionInvalid = 66, + eQMIErrors_SessionOwnership = 67, + eQMIErrors_InsufficientResources = 68, + eQMIErrors_Disabled = 69, + eQMIErrors_InvalidOperation = 70, + eQMIErrors_InvalidQMICommand = 71, + eQMIErrors_WMSTPDUType = 72, + eQMIErrors_WMSSMSCAddress = 73, + eQMIErrors_InformationUnavailable = 74, + eQMIErrors_SegmentTooLong = 75, + eQMIErrors_SegmentOrder = 76, + eQMIErrors_BundlingNotSupported = 77, + eQMIErrors_SIMFileNotFound = 80, + eQMIErrors_AccessDenied = 82, + eQMIErrors_HardwareRestricted = 83, + eQMIErrors_CATEventRegistrationFailed = 61441, + eQMIErrors_CATInvalidTerminalResponse = 61442, + eQMIErrors_CATInvalidEnvelopeCommand = 61443, + eQMIErrors_CATEnvelopeCommandBusy = 61444, + eQMIErrors_CATEnvelopeCommandFailed = 61445, +}; + +// Enum to describe QMI HA/AAA Key States +enum eQMIHAAAAKeyStates:UINT8 +{ + eQMIHAAAAKeyStates_Unset = 0, + eQMIHAAAAKeyStates_SetDefault = 1, + eQMIHAAAAKeyStates_SetModified = 2, +}; + +// Enum to describe QMI LOC Altitude Assumed +enum eQMILOCAltitudeAssumed:UINT32 +{ + eQMILOCAltitudeAssumed_AltitudeIsCalculated = 0, + eQMILOCAltitudeAssumed_AltitudeIsAssumed = 1, +}; + +// Enum to describe QMI LOC Altitude Source +enum eQMILOCAltitudeSource:UINT32 +{ + eQMILOCAltitudeSource_Unknown = 0, + eQMILOCAltitudeSource_GPS = 1, + eQMILOCAltitudeSource_CellID = 2, + eQMILOCAltitudeSource_EnhancedCellID = 3, + eQMILOCAltitudeSource_WiFi = 4, + eQMILOCAltitudeSource_Terrestrial = 5, + eQMILOCAltitudeSource_TerrestrialHybrid = 6, + eQMILOCAltitudeSource_AltitudeDatabase = 7, + eQMILOCAltitudeSource_BarometricAltimeter = 8, + eQMILOCAltitudeSource_Other = 9, +}; + +// Enum to describe QMI LOC Confidence +enum eQMILOCConfidence:UINT32 +{ + eQMILOCConfidence_Low = 1, + eQMILOCConfidence_Medium = 2, + eQMILOCConfidence_High = 3, +}; + +// Enum to describe QMI LOC Connection Request Type +enum eQMILOCConnectionRequestType +{ + eQMILOCConnectionRequestType_Open = 1, + eQMILOCConnectionRequestType_Close = 2, +}; + +// Enum to describe QMI LOC Connection Status +enum eQMILOCConnectionStatus:UINT32 +{ + eQMILOCConnectionStatus_Success = 1, + eQMILOCConnectionStatus_Failure = 2, +}; + +// Enum to describe QMI LOC Control Mode +enum eQMILOCControlMode:UINT32 +{ + eQMILOCControlMode_Automatic = 0, + eQMILOCControlMode_Forced = 1, +}; + +// Enum to describe QMI LOC Coverage +enum eQMILOCCoverage:UINT32 +{ + eQMILOCCoverage_NotSpecified = 0, + eQMILOCCoverage_Point = 1, + eQMILOCCoverage_Full = 2, +}; + +// Enum to describe QMI LOC Cradle Mount State +enum eQMILOCCradleMountState:UINT32 +{ + eQMILOCCradleMountState_NotMounted = 0, + eQMILOCCradleMountState_Mounted = 1, + eQMILOCCradleMountState_Unknown = 2, +}; + +// Enum to describe QMI LOC Data Coding Scheme +enum eQMILOCDataCodingScheme:UINT32 +{ + eQMILOCDataCodingScheme_German = 12, + eQMILOCDataCodingScheme_English = 13, + eQMILOCDataCodingScheme_Italian = 14, + eQMILOCDataCodingScheme_French = 15, + eQMILOCDataCodingScheme_Spanish = 16, + eQMILOCDataCodingScheme_Dutch = 17, + eQMILOCDataCodingScheme_Swedish = 18, + eQMILOCDataCodingScheme_Danish = 19, + eQMILOCDataCodingScheme_Portuguese = 20, + eQMILOCDataCodingScheme_Finnish = 21, + eQMILOCDataCodingScheme_Norwegian = 22, + eQMILOCDataCodingScheme_Greek = 23, + eQMILOCDataCodingScheme_Turkish = 24, + eQMILOCDataCodingScheme_Hungarian = 25, + eQMILOCDataCodingScheme_Polish = 26, + eQMILOCDataCodingScheme_Unspecified = 27, + eQMILOCDataCodingScheme_UTF8 = 28, + eQMILOCDataCodingScheme_UCS2 = 29, + eQMILOCDataCodingScheme_GSMDefault = 30, +}; + +// Enum to describe QMI LOC Encoding Scheme +enum eQMILOCEncodingScheme:UINT32 +{ + eQMILOCEncodingScheme_Octet = 0, + eQMILOCEncodingScheme_EXNProtocolMessage = 1, + eQMILOCEncodingScheme_ASCII = 2, + eQMILOCEncodingScheme_IA5 = 3, + eQMILOCEncodingScheme_Unicode = 4, + eQMILOCEncodingScheme_ShiftJIS = 5, + eQMILOCEncodingScheme_Korean = 6, + eQMILOCEncodingScheme_LatinHebrew = 7, + eQMILOCEncodingScheme_Latin = 8, + eQMILOCEncodingScheme_GSM = 9, +}; + +// Enum to describe QMI LOC Engine State +enum eQMILOCEngineState +{ + eQMILOCEngineState_On = 1, + eQMILOCEngineState_Off = 2, +}; + +// Enum to describe QMI LOC Fix Recurrence Type +enum eQMILOCFixRecurrenceType:UINT32 +{ + eQMILOCFixRecurrenceType_RequestPeriodicFixes = 1, + eQMILOCFixRecurrenceType_RequestSingleFix = 2, +}; + +// Enum to describe QMI LOC Format Type +enum eQMILOCFormatType:UINT32 +{ + eQMILOCFormatType_LogicalName = 0, + eQMILOCFormatType_EmailAddress = 1, + eQMILOCFormatType_MSISDN = 2, + eQMILOCFormatType_URL = 3, + eQMILOCFormatType_SIPURL = 4, + eQMILOCFormatType_MIN = 5, + eQMILOCFormatType_MDN = 6, + eQMILOCFormatType_IMSPublicIdentity = 7, + eQMILOCFormatType_OSSUnknown = 2147483647, +}; + +// Enum to describe QMI LOC Geofence Breach Type +enum eQMILOCGeofenceBreachType +{ + eQMILOCGeofenceBreachType_Entering = 1, + eQMILOCGeofenceBreachType_Leaving = 2, +}; + +// Enum to describe QMI LOC Geofence General Alert +enum eQMILOCGeofenceGeneralAlert:UINT32 +{ + eQMILOCGeofenceGeneralAlert_GNSSUnavailable = 1, + eQMILOCGeofenceGeneralAlert_GNSSAvailable = 2, + eQMILOCGeofenceGeneralAlert_OOS = 3, + eQMILOCGeofenceGeneralAlert_TimeInvalid = 4, +}; + +// Enum to describe QMI LOC Geofence Operation Mode +enum eQMILOCGeofenceOperationMode +{ + eQMILOCGeofenceOperationMode_Added = 1, + eQMILOCGeofenceOperationMode_Deleted = 2, + eQMILOCGeofenceOperationMode_Edited = 3, +}; + +// Enum to describe QMI LOC Geofence Origin +enum eQMILOCGeofenceOrigin:UINT32 +{ + eQMILOCGeofenceOrigin_Network = 1, + eQMILOCGeofenceOrigin_Device = 2, +}; + +// Enum to describe QMI LOC Geofence State +enum eQMILOCGeofenceState:UINT32 +{ + eQMILOCGeofenceState_Active = 1, + eQMILOCGeofenceState_Suspended = 2, +}; + +// Enum to describe QMI LOC Geofence Status +enum eQMILOCGeofenceStatus:UINT32 +{ + eQMILOCGeofenceStatus_Success = 0, + eQMILOCGeofenceStatus_GeneralFailure = 1, + eQMILOCGeofenceStatus_Unsupported = 2, + eQMILOCGeofenceStatus_InvalidParameters = 3, + eQMILOCGeofenceStatus_EngineBusy = 4, + eQMILOCGeofenceStatus_PhoneOffline = 5, + eQMILOCGeofenceStatus_Timeout = 6, + eQMILOCGeofenceStatus_InsufficientMemory = 8, +}; + +// Enum to describe QMI LOC Health Status +enum eQMILOCHealthStatus:UINT8 +{ + eQMILOCHealthStatus_Unhealthy = 0, + eQMILOCHealthStatus_Healthy = 1, +}; + +// Enum to describe QMI LOC Horizontal Accuracy +enum eQMILOCHorizontalAccuracy:UINT32 +{ + eQMILOCHorizontalAccuracy_Low = 1, + eQMILOCHorizontalAccuracy_Medium = 2, + eQMILOCHorizontalAccuracy_High = 3, +}; + +// Enum to describe QMI LOC Intermediate Report State +enum eQMILOCIntermediateReportState:UINT32 +{ + eQMILOCIntermediateReportState_Enable = 1, + eQMILOCIntermediateReportState_Disable = 2, +}; + +// Enum to describe QMI LOC Linkage +enum eQMILOCLinkage:UINT32 +{ + eQMILOCLinkage_NotSpecified = 0, + eQMILOCLinkage_FullyInterdependent = 1, + eQMILOCLinkage_DependsOnLatLong = 2, + eQMILOCLinkage_FullyIndependent = 3, +}; + +// Enum to describe QMI LOC Location Server Type +enum eQMILOCLocationServerType:UINT32 +{ + eQMILOCLocationServerType_CDMAPDE = 1, + eQMILOCLocationServerType_CDMAMPC = 2, + eQMILOCLocationServerType_UMTSSLP = 3, + eQMILOCLocationServerType_CustomPDE = 4, +}; + +// Enum to describe QMI LOC Location Type +enum eQMILOCLocationType:UINT32 +{ + eQMILOCLocationType_CurrentLocation = 1, + eQMILOCLocationType_CurrentOrLastKnownLocation = 2, + eQMILOCLocationType_InitialLocation = 4, +}; + +// Enum to describe QMI LOC Lock Type +enum eQMILOCLockType:UINT32 +{ + eQMILOCLockType_LockNone = 1, + eQMILOCLockType_LockMI = 2, + eQMILOCLockType_LockMT = 3, + eQMILOCLockType_LockAll = 4, +}; + +// Enum to describe QMI LOC Notification Type +enum eQMILOCNotificationType:UINT32 +{ + eQMILOCNotificationType_NoNotifyOrVerify = 1, + eQMILOCNotificationType_NotifyOnly = 2, + eQMILOCNotificationType_AllowNoResponse = 3, + eQMILOCNotificationType_ResponseRequired = 4, + eQMILOCNotificationType_PrivacyOverride = 5, +}; + +// Enum to describe QMI LOC Operation Mode +enum eQMILOCOperationMode:UINT32 +{ + eQMILOCOperationMode_Default = 1, + eQMILOCOperationMode_MSB = 2, + eQMILOCOperationMode_MSA = 3, + eQMILOCOperationMode_StandAlone = 4, + eQMILOCOperationMode_CellID = 5, +}; + +// Enum to describe QMI LOC Orbits Format Type +enum eQMILOCOrbitsFormatType:UINT32 +{ + eQMILOCOrbitsFormatType_PredictedOrbitsXTRA = 0, +}; + +// Enum to describe QMI LOC PDN Type +enum eQMILOCPDNType:UINT32 +{ + eQMILOCPDNType_IPv4 = 1, + eQMILOCPDNType_IPv6 = 2, + eQMILOCPDNType_IPv4OrIPv6 = 3, + eQMILOCPDNType_PPP = 4, +}; + +// Enum to describe QMI LOC Position +enum eQMILOCPosition:UINT32 +{ + eQMILOCPosition_AGPSSetAssisted = 1, + eQMILOCPosition_AGPSSetBased = 2, + eQMILOCPosition_AGPSSetAssistedPreference = 3, + eQMILOCPosition_AGPSSetBasedPreference = 4, + eQMILOCPosition_AutonomousGPS = 5, + eQMILOCPosition_AFLT = 6, + eQMILOCPosition_ECID = 7, + eQMILOCPosition_EOTD = 8, + eQMILOCPosition_OTDOA = 9, + eQMILOCPosition_NoPosition = 10, +}; + +// Enum to describe QMI LOC Position From Geofence +enum eQMILOCPositionFromGeofence:UINT32 +{ + eQMILOCPositionFromGeofence_Inside = 1, + eQMILOCPositionFromGeofence_Outside = 2, +}; + +// Enum to describe QMI LOC Position Mode +enum eQMILOCPositionMode:UINT32 +{ + eQMILOCPositionMode_AssistedOnly = 1, + eQMILOCPositionMode_BasedOnly = 2, + eQMILOCPositionMode_AssistedPreferredBasedAllowed = 3, + eQMILOCPositionMode_BasedPreferredAssistedAllowed = 4, +}; + +// Enum to describe QMI LOC Position Source +enum eQMILOCPositionSource:UINT32 +{ + eQMILOCPositionSource_GNSS = 0, + eQMILOCPositionSource_CellID = 1, + eQMILOCPositionSource_EnhancedCellID = 2, + eQMILOCPositionSource_WiFi = 3, + eQMILOCPositionSource_Terrestrial = 4, + eQMILOCPositionSource_TerrestrialHybrid = 5, + eQMILOCPositionSource_Other = 6, +}; + +// Enum to describe QMI LOC Power State +enum eQMILOCPowerState:UINT32 +{ + eQMILOCPowerState_NotConnected = 0, + eQMILOCPowerState_Connected = 1, + eQMILOCPowerState_Unknown = 2, +}; + +// Enum to describe QMI LOC Reliability +enum eQMILOCReliability:UINT32 +{ + eQMILOCReliability_NotSet = 0, + eQMILOCReliability_VeryLow = 1, + eQMILOCReliability_Low = 2, + eQMILOCReliability_Medium = 3, + eQMILOCReliability_High = 4, +}; + +// Enum to describe QMI LOC Request Type +enum eQMILOCRequestType:UINT32 +{ + eQMILOCRequestType_StartPeriodicHighFrequencyFixes = 0, + eQMILOCRequestType_StartPeriodicKeepWarmFixes = 1, + eQMILOCRequestType_StopPeriodicFixes = 2, +}; + +// Enum to describe QMI LOC Responsiveness +enum eQMILOCResponsiveness:UINT32 +{ + eQMILOCResponsiveness_Low = 1, + eQMILOCResponsiveness_Medium = 2, + eQMILOCResponsiveness_High = 3, +}; + +// Enum to describe QMI LOC SUPL Version +enum eQMILOCSUPLVersion:UINT32 +{ + eQMILOCSUPLVersion_10 = 1, + eQMILOCSUPLVersion_20 = 2, +}; + +// Enum to describe QMI LOC Satellite Status +enum eQMILOCSatelliteStatus:UINT32 +{ + eQMILOCSatelliteStatus_Idle = 1, + eQMILOCSatelliteStatus_Searching = 2, + eQMILOCSatelliteStatus_Tracking = 3, +}; + +// Enum to describe QMI LOC Sensor Usage +enum eQMILOCSensorUsage:UINT32 +{ + eQMILOCSensorUsage_SensorUseEnabled = 0, + eQMILOCSensorUsage_SensorUseDisabled = 1, +}; + +// Enum to describe QMI LOC Service Interaction Type +enum eQMILOCServiceInteractionType:UINT32 +{ + eQMILOCServiceInteractionType_OngoingNIIncomingMO = 1, +}; + +// Enum to describe QMI LOC Session State +enum eQMILOCSessionState:UINT32 +{ + eQMILOCSessionState_Started = 1, + eQMILOCSessionState_Finished = 2, +}; + +// Enum to describe QMI LOC Session Status +enum eQMILOCSessionStatus:UINT32 +{ + eQMILOCSessionStatus_Success = 0, + eQMILOCSessionStatus_InProgress = 1, + eQMILOCSessionStatus_GeneralFailure = 2, + eQMILOCSessionStatus_Timeout = 3, + eQMILOCSessionStatus_UserEnded = 4, + eQMILOCSessionStatus_BadParameter = 5, + eQMILOCSessionStatus_PhoneOffline = 6, + eQMILOCSessionStatus_EngineLocked = 7, +}; + +// Enum to describe QMI LOC Stationary Status +enum eQMILOCStationaryStatus +{ + eQMILOCStationaryStatus_DeviceIsNotStationary = 0, + eQMILOCStationaryStatus_DeviceIsStationary = 1, +}; + +// Enum to describe QMI LOC Status +enum eQMILOCStatus +{ + eQMILOCStatus_Success = 0, + eQMILOCStatus_GeneralFailure = 1, + eQMILOCStatus_Unsupported = 2, + eQMILOCStatus_InvalidParameter = 3, + eQMILOCStatus_EngineBusy = 4, + eQMILOCStatus_PhoneOffline = 5, + eQMILOCStatus_Timeout = 6, +}; + +// Enum to describe QMI LOC System +enum eQMILOCSystem:UINT32 +{ + eQMILOCSystem_GlobalPositioningSystem = 1, + eQMILOCSystem_Galileo = 2, + eQMILOCSystem_SatelliteBasedAugmentationSystem = 3, + eQMILOCSystem_COMPASS = 4, + eQMILOCSystem_GLONASS = 5, +}; + +// Enum to describe QMI LOC Time Source +enum eQMILOCTimeSource:UINT32 +{ + eQMILOCTimeSource_Invalid = 0, + eQMILOCTimeSource_NetworkTimeTransfer = 1, + eQMILOCTimeSource_NetworkTimeTagging = 2, + eQMILOCTimeSource_ExternalInput = 3, + eQMILOCTimeSource_TOWDecode = 4, + eQMILOCTimeSource_TOWConfirmed = 5, + eQMILOCTimeSource_TOWAndWeekConfirmed = 6, + eQMILOCTimeSource_NavigationSolution = 7, + eQMILOCTimeSource_SolveForTime = 8, +}; + +// Enum to describe QMI LOC Trigger Type +enum eQMILOCTriggerType +{ + eQMILOCTriggerType_SingleShot = -1, + eQMILOCTriggerType_Periodic = 0, + eQMILOCTriggerType_AreaEvent = 1, +}; + +// Enum to describe QMI LOC User Response +enum eQMILOCUserResponse:UINT32 +{ + eQMILOCUserResponse_Accept = 1, + eQMILOCUserResponse_Deny = 2, + eQMILOCUserResponse_NoResponse = 3, +}; + +// Enum to describe QMI LOC VX Version +enum eQMILOCVXVersion:UINT32 +{ + eQMILOCVXVersion_V1Only = 1, + eQMILOCVXVersion_V2Only = 2, +}; + +// Enum to describe QMI LOC WWAN Type +enum eQMILOCWWANType:UINT32 +{ + eQMILOCWWANType_Internet = 0, + eQMILOCWWANType_AGNSS = 1, +}; + +// Enum to describe QMI LOC Wi-Fi Fix Error Code +enum eQMILOCWiFiFixErrorCode:UINT32 +{ + eQMILOCWiFiFixErrorCode_Success = 0, + eQMILOCWiFiFixErrorCode_WiFiNotAvailable = 1, + eQMILOCWiFiFixErrorCode_NoAccessPointsFound = 2, + eQMILOCWiFiFixErrorCode_Unauthorized = 3, + eQMILOCWiFiFixErrorCode_ServerUnavailable = 4, + eQMILOCWiFiFixErrorCode_LocationCannotBeDetermined = 5, + eQMILOCWiFiFixErrorCode_Unknown = 6, +}; + +// Enum to describe QMI LOC Wi-Fi Status +enum eQMILOCWiFiStatus:UINT32 +{ + eQMILOCWiFiStatus_Available = 1, + eQMILOCWiFiStatus_Unavailable = 2, +}; + +// Enum to describe QMI Mobile IP Modes +enum eQMIMobileIPModes:UINT8 +{ + eQMIMobileIPModes_MIPOffSimpleIPOnly = 0, + eQMIMobileIPModes_MIPPreferred = 1, + eQMIMobileIPModes_MIPOnly = 2, +}; + +// Enum to describe QMI NAS AN-AAA Authentication Status +enum eQMINASANAAAAuthenticationStatus:UINT8 +{ + eQMINASANAAAAuthenticationStatus_AuthenticationFailed = 0, + eQMINASANAAAAuthenticationStatus_AuthenticationSuccess = 1, + eQMINASANAAAAuthenticationStatus_NoAuthenticationRequested = 2, +}; + +// Enum to describe QMI NAS Acquisition Order +enum eQMINASAcquisitionOrder:UINT32 +{ + eQMINASAcquisitionOrder_Automatic = 0, + eQMINASAcquisitionOrder_GSMThenWCDMA = 1, + eQMINASAcquisitionOrder_WCDMAThenGSM = 2, +}; + +// Enum to describe QMI NAS Active Subscription +enum eQMINASActiveSubscription:UINT8 +{ + eQMINASActiveSubscription_NotActive = 0, + eQMINASActiveSubscription_Active = 1, +}; + +// Enum to describe QMI NAS Band Classes +enum eQMINASBandClasses:UINT16 +{ + eQMINASBandClasses_CDMABandClass0 = 0, + eQMINASBandClasses_CDMABandClass1 = 1, + eQMINASBandClasses_CDMABandClass3 = 3, + eQMINASBandClasses_CDMABandClass4 = 4, + eQMINASBandClasses_CDMABandClass5 = 5, + eQMINASBandClasses_CDMABandClass6 = 6, + eQMINASBandClasses_CDMABandClass7 = 7, + eQMINASBandClasses_CDMABandClass8 = 8, + eQMINASBandClasses_CDMABandClass9 = 9, + eQMINASBandClasses_CDMABandClass10 = 10, + eQMINASBandClasses_CDMABandClass11 = 11, + eQMINASBandClasses_CDMABandClass12 = 12, + eQMINASBandClasses_CDMABandClass13 = 13, + eQMINASBandClasses_CDMABandClass14 = 14, + eQMINASBandClasses_CDMABandClass15 = 15, + eQMINASBandClasses_CDMABandClass16 = 16, + eQMINASBandClasses_CDMABandClass17 = 17, + eQMINASBandClasses_CDMABandClass18 = 18, + eQMINASBandClasses_CDMABandClass19 = 19, + eQMINASBandClasses_GSM450 = 40, + eQMINASBandClasses_GSM480 = 41, + eQMINASBandClasses_GSM750 = 42, + eQMINASBandClasses_GSM850 = 43, + eQMINASBandClasses_GSM900Extended = 44, + eQMINASBandClasses_GSM900Primary = 45, + eQMINASBandClasses_GSM900Railways = 46, + eQMINASBandClasses_GSM1800 = 47, + eQMINASBandClasses_GSM1900 = 48, + eQMINASBandClasses_WCDMA2100 = 80, + eQMINASBandClasses_WCDMAPCS1900 = 81, + eQMINASBandClasses_WCDMADCS1800 = 82, + eQMINASBandClasses_WCDMA1700US = 83, + eQMINASBandClasses_WCDMA850 = 84, + eQMINASBandClasses_WCDMA800 = 85, + eQMINASBandClasses_WCDMA2600 = 86, + eQMINASBandClasses_WCDMA900 = 87, + eQMINASBandClasses_WCDMA1700Japan = 88, + eQMINASBandClasses_WCDMA1500Japan = 90, + eQMINASBandClasses_WCDMA850Japan = 91, + eQMINASBandClasses_EUTRABand1 = 120, + eQMINASBandClasses_EUTRABand2 = 121, + eQMINASBandClasses_EUTRABand3 = 122, + eQMINASBandClasses_EUTRABand4 = 123, + eQMINASBandClasses_EUTRABand5 = 124, + eQMINASBandClasses_EUTRABand6 = 125, + eQMINASBandClasses_EUTRABand7 = 126, + eQMINASBandClasses_EUTRABand8 = 127, + eQMINASBandClasses_EUTRABand9 = 128, + eQMINASBandClasses_EUTRABand10 = 129, + eQMINASBandClasses_EUTRABand11 = 130, + eQMINASBandClasses_EUTRABand12 = 131, + eQMINASBandClasses_EUTRABand13 = 132, + eQMINASBandClasses_EUTRABand14 = 133, + eQMINASBandClasses_EUTRABand17 = 134, + eQMINASBandClasses_EUTRABand33 = 135, + eQMINASBandClasses_EUTRABand34 = 136, + eQMINASBandClasses_EUTRABand35 = 137, + eQMINASBandClasses_EUTRABand36 = 138, + eQMINASBandClasses_EUTRABand37 = 139, + eQMINASBandClasses_EUTRABand38 = 140, + eQMINASBandClasses_EUTRABand39 = 141, + eQMINASBandClasses_EUTRABand40 = 142, + eQMINASBandClasses_EUTRABand18 = 143, + eQMINASBandClasses_EUTRABand19 = 144, + eQMINASBandClasses_EUTRABand20 = 145, + eQMINASBandClasses_EUTRABand21 = 146, + eQMINASBandClasses_EUTRABand24 = 147, + eQMINASBandClasses_EUTRABand25 = 148, + eQMINASBandClasses_EUTRABand41 = 149, + eQMINASBandClasses_EUTRABand42 = 150, + eQMINASBandClasses_EUTRABand43 = 151, + eQMINASBandClasses_TDSCDMABandA = 200, + eQMINASBandClasses_TDSCDMABandB = 201, + eQMINASBandClasses_TDSCDMABandC = 202, + eQMINASBandClasses_TDSCDMABandD = 203, + eQMINASBandClasses_TDSCDMABandE = 204, + eQMINASBandClasses_TDSCDMABandF = 205, +}; + +// Enum to describe QMI NAS CDMA 1xEV-DO Active Protocol +enum eQMINASCDMA1xEVDOActiveProtocol:UINT8 +{ + eQMINASCDMA1xEVDOActiveProtocol_None = 0, + eQMINASCDMA1xEVDOActiveProtocol_CDMA1xEVDORel0 = 2, + eQMINASCDMA1xEVDOActiveProtocol_CDMA1xEVDORelA = 3, + eQMINASCDMA1xEVDOActiveProtocol_CDMA1xEVDORelB = 4, +}; + +// Enum to describe QMI NAS CDMA 1xEV-DO Hybrid Information +enum eQMINASCDMA1xEVDOHybridInformation:UINT8 +{ + eQMINASCDMA1xEVDOHybridInformation_SystemIsNotHybrid = 0, + eQMINASCDMA1xEVDOHybridInformation_SystemIsHybrid = 1, +}; + +// Enum to describe QMI NAS CDMA 1xEV-DO Personality +enum eQMINASCDMA1xEVDOPersonality:UINT8 +{ + eQMINASCDMA1xEVDOPersonality_Unknown = 0, + eQMINASCDMA1xEVDOPersonality_HRPD = 1, + eQMINASCDMA1xEVDOPersonality_EHRPD = 2, +}; + +// Enum to describe QMI NAS CDMA Pilot Types +enum eQMINASCDMAPilotTypes:UINT32 +{ + eQMINASCDMAPilotTypes_Active = 0, + eQMINASCDMAPilotTypes_Neighbor = 1, +}; + +// Enum to describe QMI NAS CS/PS Attach States +enum eQMINASCSPSAttachStates:UINT8 +{ + eQMINASCSPSAttachStates_UnknownNotApplicable = 0, + eQMINASCSPSAttachStates_Attached = 1, + eQMINASCSPSAttachStates_Detached = 2, +}; + +// Enum to describe QMI NAS Call Barring Status +enum eQMINASCallBarringStatus:UINT32 +{ + eQMINASCallBarringStatus_Unknown = 4294967295u, + eQMINASCallBarringStatus_NormalCallsOnly = 0, + eQMINASCallBarringStatus_EmergencyCallsOnly = 1, + eQMINASCallBarringStatus_NoCalls = 2, + eQMINASCallBarringStatus_AllCalls = 3, +}; + +// Enum to describe QMI NAS Cell Broadcast Caps +enum eQMINASCellBroadcastCaps:UINT32 +{ + eQMINASCellBroadcastCaps_Unknown = 0, + eQMINASCellBroadcastCaps_NotSupported = 1, + eQMINASCellBroadcastCaps_Supported = 2, +}; + +// Enum to describe QMI NAS Cell Broadcast Caps 2 +enum eQMINASCellBroadcastCaps2:UINT32 +{ + eQMINASCellBroadcastCaps2_Unknown = 0, + eQMINASCellBroadcastCaps2_NotSupported = 1, + eQMINASCellBroadcastCaps2_Supported = 2, +}; + +// Enum to describe QMI NAS Change Duration +enum eQMINASChangeDuration:UINT8 +{ + eQMINASChangeDuration_PowerCycle = 0, + eQMINASChangeDuration_Permanent = 1, +}; + +// Enum to describe QMI NAS Concurrent Service +enum eQMINASConcurrentService:UINT8 +{ + eQMINASConcurrentService_NotAvailable = 0, + eQMINASConcurrentService_Available = 1, +}; + +// Enum to describe QMI NAS Concurrent Service Supported +enum eQMINASConcurrentServiceSupported:UINT8 +{ + eQMINASConcurrentServiceSupported_NotSupported = 0, + eQMINASConcurrentServiceSupported_Supported = 1, +}; + +// Enum to describe QMI NAS DDTM Preferences +enum eQMINASDDTMPreferences:UINT8 +{ + eQMINASDDTMPreferences_Off = 0, + eQMINASDDTMPreferences_On = 1, + eQMINASDDTMPreferences_NoChange = 2, +}; + +// Enum to describe QMI NAS DTM Support +enum eQMINASDTMSupport:UINT8 +{ + eQMINASDTMSupport_NotAvailable = 0, + eQMINASDTMSupport_Available = 1, +}; + +// Enum to describe QMI NAS Data Service Capabilities 2 +enum eQMINASDataServiceCapabilities2:UINT8 +{ + eQMINASDataServiceCapabilities2_GPRS = 1, + eQMINASDataServiceCapabilities2_EGPRS = 2, + eQMINASDataServiceCapabilities2_HSDPA = 3, + eQMINASDataServiceCapabilities2_HSUPA = 4, + eQMINASDataServiceCapabilities2_WCDMA = 5, + eQMINASDataServiceCapabilities2_CDMA = 6, + eQMINASDataServiceCapabilities2_CDMA1xEVDORev0 = 7, + eQMINASDataServiceCapabilities2_CDMA1xEVDORevA = 8, + eQMINASDataServiceCapabilities2_GSM = 9, + eQMINASDataServiceCapabilities2_CDMA1xEVDORevB = 10, + eQMINASDataServiceCapabilities2_LTE = 11, + eQMINASDataServiceCapabilities2_HSDPAPlus = 12, + eQMINASDataServiceCapabilities2_DCHSDPAPlus = 13, +}; + +// Enum to describe QMI NAS Day Of Week +enum eQMINASDayOfWeek:UINT8 +{ + eQMINASDayOfWeek_Monday = 0, + eQMINASDayOfWeek_Tuesday = 1, + eQMINASDayOfWeek_Wednesday = 2, + eQMINASDayOfWeek_Thursday = 3, + eQMINASDayOfWeek_Friday = 4, + eQMINASDayOfWeek_Saturday = 5, + eQMINASDayOfWeek_Sunday = 6, +}; + +// Enum to describe QMI NAS Daylight Savings Adjustment +enum eQMINASDaylightSavingsAdjustment:UINT8 +{ + eQMINASDaylightSavingsAdjustment_NoAdjustment = 0, + eQMINASDaylightSavingsAdjustment_1HourAdjustment = 1, + eQMINASDaylightSavingsAdjustment_2HourAdjustment = 2, +}; + +// Enum to describe QMI NAS Dual Transfer Mode +enum eQMINASDualTransferMode:UINT8 +{ + eQMINASDualTransferMode_DTMNotSupported = 0, + eQMINASDualTransferMode_DTMSupported = 1, +}; + +// Enum to describe QMI NAS E-UTRA Status +enum eQMINASEUTRAStatus:UINT8 +{ + eQMINASEUTRAStatus_EUTRACellDetected = 0, + eQMINASEUTRAStatus_EUTRACellNotDetected = 1, + eQMINASEUTRAStatus_EUTRADetectionUnknown = 2, + eQMINASEUTRAStatus_EUTRADetectionUnsupported = 3, +}; + +// Enum to describe QMI NAS EGPRS Support +enum eQMINASEGPRSSupport:UINT8 +{ + eQMINASEGPRSSupport_NotAvailable = 0, + eQMINASEGPRSSupport_Available = 1, +}; + +// Enum to describe QMI NAS EV-DO Session Close Reasons +enum eQMINASEVDOSessionCloseReasons:UINT32 +{ + eQMINASEVDOSessionCloseReasons_ReacquiredNewNetwork = 0, + eQMINASEVDOSessionCloseReasons_UATIResponseTimeout = 1, + eQMINASEVDOSessionCloseReasons_KeepAliveTimerExpired = 2, + eQMINASEVDOSessionCloseReasons_InternalDeactivation = 3, + eQMINASEVDOSessionCloseReasons_ReceivedSessionCloseFromAN = 4, + eQMINASEVDOSessionCloseReasons_ConnectionOpenFailure = 5, + eQMINASEVDOSessionCloseReasons_ConfigurationRequestFailure = 6, + eQMINASEVDOSessionCloseReasons_ConfigurationResponseFailure = 7, + eQMINASEVDOSessionCloseReasons_ProtocolNegotiationFailure = 8, + eQMINASEVDOSessionCloseReasons_ANInitSetupTimerExpired = 9, + eQMINASEVDOSessionCloseReasons_ANInitConnectionClosed = 10, + eQMINASEVDOSessionCloseReasons_ConnectionDenyReceived = 11, + eQMINASEVDOSessionCloseReasons_SilentDeactivation = 12, + eQMINASEVDOSessionCloseReasons_NewESN = 13, + eQMINASEVDOSessionCloseReasons_ANGUAP = 14, + eQMINASEVDOSessionCloseReasons_InvalidPersonalityIndex = 15, + eQMINASEVDOSessionCloseReasons_UATINotMaintained = 16, + eQMINASEVDOSessionCloseReasons_NewNAI = 17, + eQMINASEVDOSessionCloseReasons_EHRPDCredentialsChanged = 18, +}; + +// Enum to describe QMI NAS Forbidden States +enum eQMINASForbiddenStates:UINT8 +{ + eQMINASForbiddenStates_Unknown = 0, + eQMINASForbiddenStates_Forbidden = 1, + eQMINASForbiddenStates_NotForbidden = 2, +}; + +// Enum to describe QMI NAS Force CDMA 1xEV-DO SCP +enum eQMINASForceCDMA1xEVDOSCP:UINT8 +{ + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORev0Only = 0, + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORevAWithMFPA = 1, + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORevAWithMFPAAndEMPA = 2, + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORevBWithMMPA = 3, + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORevAWithEHRPD = 4, + eQMINASForceCDMA1xEVDOSCP_CDMA1xEVDORevBWithEHRPD = 5, +}; + +// Enum to describe QMI NAS High Speed Call Status +enum eQMINASHighSpeedCallStatus:UINT8 +{ + eQMINASHighSpeedCallStatus_HSDPAAndHSUPANotSupported = 0, + eQMINASHighSpeedCallStatus_HSDPASupported = 1, + eQMINASHighSpeedCallStatus_HSUPASupported = 2, + eQMINASHighSpeedCallStatus_HSDPAAndHSUPASupported = 3, + eQMINASHighSpeedCallStatus_HSDPAPlusSupported = 4, + eQMINASHighSpeedCallStatus_HSDPAPlusAndHSUPASupported = 5, + eQMINASHighSpeedCallStatus_DualCellHSDPAPlusSupported = 6, + eQMINASHighSpeedCallStatus_DualCellHSDPAPlusAndHSUPASupported = 7, + eQMINASHighSpeedCallStatus_DualCellHSDPAPlusAnd64QAMAndHSUPASupported = 8, + eQMINASHighSpeedCallStatus_DualCellHSDPAPlusAnd64QAMSupported = 9, +}; + +// Enum to describe QMI NAS In Use States +enum eQMINASInUseStates:UINT8 +{ + eQMINASInUseStates_Unknown = 0, + eQMINASInUseStates_CurrentServing = 1, + eQMINASInUseStates_Available = 2, +}; + +// Enum to describe QMI NAS LTE Signal Rates +enum eQMINASLTESignalRates:UINT8 +{ + eQMINASLTESignalRates_Default = 0, + eQMINASLTESignalRates_EverySecond = 1, + eQMINASLTESignalRates_Every2Seconds = 2, + eQMINASLTESignalRates_Every3Seconds = 3, + eQMINASLTESignalRates_Every4Seconds = 4, + eQMINASLTESignalRates_Every5Seconds = 5, + eQMINASLTESignalRates_Every6Seconds = 6, + eQMINASLTESignalRates_Every7Seconds = 7, + eQMINASLTESignalRates_Every8Seconds = 8, + eQMINASLTESignalRates_Every9Seconds = 9, + eQMINASLTESignalRates_Every10Seconds = 10, +}; + +// Enum to describe QMI NAS LTE Voice Domains +enum eQMINASLTEVoiceDomains:UINT32 +{ + eQMINASLTEVoiceDomains_NoVoiceSupport = 0, + eQMINASLTEVoiceDomains_VoiceSupportedOverIMS = 1, + eQMINASLTEVoiceDomains_VoiceSupportedOver1X = 2, + eQMINASLTEVoiceDomains_VoiceSupportedOver3GPP = 3, +}; + +// Enum to describe QMI NAS Network Description Displays +enum eQMINASNetworkDescriptionDisplays:UINT8 +{ + eQMINASNetworkDescriptionDisplays_DoNotDisplay = 0, + eQMINASNetworkDescriptionDisplays_Display = 1, + eQMINASNetworkDescriptionDisplays_Unknown = 255, +}; + +// Enum to describe QMI NAS Network Description Encodings +enum eQMINASNetworkDescriptionEncodings:UINT8 +{ + eQMINASNetworkDescriptionEncodings_UnspecifiedOctet = 0, + eQMINASNetworkDescriptionEncodings_ExtendedProtocolMessage = 1, + eQMINASNetworkDescriptionEncodings_7BitASCII = 2, + eQMINASNetworkDescriptionEncodings_IA5 = 3, + eQMINASNetworkDescriptionEncodings_UNICODE = 4, + eQMINASNetworkDescriptionEncodings_ShiftJIS = 5, + eQMINASNetworkDescriptionEncodings_Korean = 6, + eQMINASNetworkDescriptionEncodings_LatinHebrew = 7, + eQMINASNetworkDescriptionEncodings_Latin = 8, + eQMINASNetworkDescriptionEncodings_GSM7Bit = 9, + eQMINASNetworkDescriptionEncodings_GSMDCS = 10, +}; + +// Enum to describe QMI NAS Network Selection +enum eQMINASNetworkSelection:INT8 +{ + eQMINASNetworkSelection_AutomaticRegistration = 0, + eQMINASNetworkSelection_ManualRegistration = 1, +}; + +// Enum to describe QMI NAS PLMN Name Country Initials +enum eQMINASPLMNNameCountryInitials:UINT8 +{ + eQMINASPLMNNameCountryInitials_DoNotAddCountryInitials = 0, + eQMINASPLMNNameCountryInitials_AddCountryInitials = 1, + eQMINASPLMNNameCountryInitials_Unspecified = 255, +}; + +// Enum to describe QMI NAS PLMN Name Encoding Schemes +enum eQMINASPLMNNameEncodingSchemes:UINT8 +{ + eQMINASPLMNNameEncodingSchemes_ASCII = 0, + eQMINASPLMNNameEncodingSchemes_UCS2LE = 1, +}; + +// Enum to describe QMI NAS PLMN Name Spare Bits +enum eQMINASPLMNNameSpareBits:UINT8 +{ + eQMINASPLMNNameSpareBits_Unknown = 0, + eQMINASPLMNNameSpareBits_Bit8 = 1, + eQMINASPLMNNameSpareBits_Bits78 = 2, + eQMINASPLMNNameSpareBits_Bits68 = 3, + eQMINASPLMNNameSpareBits_Bits58 = 4, + eQMINASPLMNNameSpareBits_Bits48 = 5, + eQMINASPLMNNameSpareBits_Bits38 = 6, + eQMINASPLMNNameSpareBits_Bits28 = 7, +}; + +// Enum to describe QMI NAS PRL Indicator +enum eQMINASPRLIndicator:UINT8 +{ + eQMINASPRLIndicator_SystemNotInPRL = 0, + eQMINASPRLIndicator_SystemIsInPRL = 1, +}; + +// Enum to describe QMI NAS PRL Preferences +enum eQMINASPRLPreferences:UINT16 +{ + eQMINASPRLPreferences_AcquireASideOnly = 1, + eQMINASPRLPreferences_AcquireBSideOnly = 2, + eQMINASPRLPreferences_AcquireAny = 16383, +}; + +// Enum to describe QMI NAS PS Attach Actions +enum eQMINASPSAttachActions:UINT8 +{ + eQMINASPSAttachActions_Attach = 1, + eQMINASPSAttachActions_Detach = 2, +}; + +// Enum to describe QMI NAS Preferred Data Bath +enum eQMINASPreferredDataBath:UINT8 +{ + eQMINASPreferredDataBath_NotPreferred = 0, + eQMINASPreferredDataBath_Preferred = 1, +}; + +// Enum to describe QMI NAS Preferred States +enum eQMINASPreferredStates:UINT8 +{ + eQMINASPreferredStates_Unknown = 0, + eQMINASPreferredStates_Preferred = 1, + eQMINASPreferredStates_NotPreferred = 2, +}; + +// Enum to describe QMI NAS RTRE Configuration +enum eQMINASRTREConfiguration:UINT8 +{ + eQMINASRTREConfiguration_RUIMOnly = 1, + eQMINASRTREConfiguration_InternalSettingsOnly = 2, + eQMINASRTREConfiguration_UseRUIMIfAvailable = 3, + eQMINASRTREConfiguration_GSMOn1X = 4, +}; + +// Enum to describe QMI NAS RX Level +enum eQMINASRXLevel:UINT16 +{ + eQMINASRXLevel_LessThan110dBm = 0, + eQMINASRXLevel_110dBmto109dBm = 1, + eQMINASRXLevel_109dBmto108dBm = 2, + eQMINASRXLevel_108dBmto107dBm = 3, + eQMINASRXLevel_107dBmto106dBm = 4, + eQMINASRXLevel_106dBmto105dBm = 5, + eQMINASRXLevel_105dBmto104dBm = 6, + eQMINASRXLevel_104dBmto103dBm = 7, + eQMINASRXLevel_103dBmto102dBm = 8, + eQMINASRXLevel_102dBmto101dBm = 9, + eQMINASRXLevel_101dBmto100dBm = 10, + eQMINASRXLevel_100dBmto99dBm = 11, + eQMINASRXLevel_99dBmto98dBm = 12, + eQMINASRXLevel_98dBmto97dBm = 13, + eQMINASRXLevel_97dBmto96dBm = 14, + eQMINASRXLevel_96dBmto95dBm = 15, + eQMINASRXLevel_95dBmto94dBm = 16, + eQMINASRXLevel_94dBmto93dBm = 17, + eQMINASRXLevel_93dBmto92dBm = 18, + eQMINASRXLevel_92dBmto91dBm = 19, + eQMINASRXLevel_91dBmto90dBm = 20, + eQMINASRXLevel_90dBmto89dBm = 21, + eQMINASRXLevel_89dBmto88dBm = 22, + eQMINASRXLevel_88dBmto87dBm = 23, + eQMINASRXLevel_87dBmto86dBm = 24, + eQMINASRXLevel_86dBmto85dBm = 25, + eQMINASRXLevel_85dBmto84dBm = 26, + eQMINASRXLevel_84dBmto83dBm = 27, + eQMINASRXLevel_83dBmto82dBm = 28, + eQMINASRXLevel_82dBmto81dBm = 29, + eQMINASRXLevel_81dBmto80dBm = 30, + eQMINASRXLevel_80dBmto79dBm = 31, + eQMINASRXLevel_79dBmto78dBm = 32, + eQMINASRXLevel_78dBmto77dBm = 33, + eQMINASRXLevel_77dBmto76dBm = 34, + eQMINASRXLevel_76dBmto75dBm = 35, + eQMINASRXLevel_75dBmto74dBm = 36, + eQMINASRXLevel_74dBmto73dBm = 37, + eQMINASRXLevel_73dBmto72dBm = 38, + eQMINASRXLevel_72dBmto71dBm = 39, + eQMINASRXLevel_71dBmto70dBm = 40, + eQMINASRXLevel_70dBmto69dBm = 41, + eQMINASRXLevel_69dBmto68dBm = 42, + eQMINASRXLevel_68dBmto67dBm = 43, + eQMINASRXLevel_67dBmto66dBm = 44, + eQMINASRXLevel_66dBmto65dBm = 45, + eQMINASRXLevel_65dBmto64dBm = 46, + eQMINASRXLevel_64dBmto63dBm = 47, + eQMINASRXLevel_63dBmto62dBm = 48, + eQMINASRXLevel_62dBmto61dBm = 49, + eQMINASRXLevel_61dBmto60dBm = 50, + eQMINASRXLevel_60dBmto59dBm = 51, + eQMINASRXLevel_59dBmto58dBm = 52, + eQMINASRXLevel_58dBmto57dBm = 53, + eQMINASRXLevel_57dBmto56dBm = 54, + eQMINASRXLevel_56dBmto55dBm = 55, + eQMINASRXLevel_55dBmto54dBm = 56, + eQMINASRXLevel_54dBmto53dBm = 57, + eQMINASRXLevel_53dBmto52dBm = 58, + eQMINASRXLevel_52dBmto51dBm = 59, + eQMINASRXLevel_51dBmto50dBm = 60, + eQMINASRXLevel_50dBmto49dBm = 61, + eQMINASRXLevel_49dBmto48dBm = 62, + eQMINASRXLevel_GreaterThan48dBm = 63, +}; + +// Enum to describe QMI NAS Radio Access Technologies +enum eQMINASRadioAccessTechnologies:UINT8 +{ + eQMINASRadioAccessTechnologies_GSM = 4, + eQMINASRadioAccessTechnologies_UMTS = 5, + eQMINASRadioAccessTechnologies_LTE = 8, + eQMINASRadioAccessTechnologies_TDSCDMA = 9, + eQMINASRadioAccessTechnologies_NoChange = 255, +}; + +// Enum to describe QMI NAS Radio Interfaces +enum eQMINASRadioInterfaces:UINT8 +{ + eQMINASRadioInterfaces_NoneNoService = 0, + eQMINASRadioInterfaces_CDMA20001x = 1, + eQMINASRadioInterfaces_CDMA2000HRPD = 2, + eQMINASRadioInterfaces_AMPS = 3, + eQMINASRadioInterfaces_GSM = 4, + eQMINASRadioInterfaces_UMTS = 5, + eQMINASRadioInterfaces_LTE = 8, + eQMINASRadioInterfaces_TDSCDMA = 9, +}; + +// Enum to describe QMI NAS Radio System Modes +enum eQMINASRadioSystemModes:UINT32 +{ + eQMINASRadioSystemModes_NoService = 0, + eQMINASRadioSystemModes_Acquiring = 1, + eQMINASRadioSystemModes_InService = 2, +}; + +// Enum to describe QMI NAS Register Actions +enum eQMINASRegisterActions:UINT8 +{ + eQMINASRegisterActions_Automatic = 1, + eQMINASRegisterActions_Manual = 2, +}; + +// Enum to describe QMI NAS Registered Networks +enum eQMINASRegisteredNetworks:UINT8 +{ + eQMINASRegisteredNetworks_Unknown = 0, + eQMINASRegisteredNetworks_3GPP2 = 1, + eQMINASRegisteredNetworks_3GPP = 2, +}; + +// Enum to describe QMI NAS Registration States +enum eQMINASRegistrationStates:UINT8 +{ + eQMINASRegistrationStates_NASNotRegistered = 0, + eQMINASRegistrationStates_NASRegistered = 1, + eQMINASRegistrationStates_NASNotRegisteredSearching = 2, + eQMINASRegistrationStates_NASRegistrationDenied = 3, + eQMINASRegistrationStates_RegistrationStateUnknown = 4, +}; + +// Enum to describe QMI NAS Revision +enum eQMINASRevision:UINT8 +{ + eQMINASRevision_JSTD088 = 1, + eQMINASRevision_IS95RevA = 3, + eQMINASRevision_IS95RevB = 4, + eQMINASRevision_IS2000 = 6, + eQMINASRevision_IS2000RelA = 7, + eQMINASRevision_IS2000RelB = 8, + eQMINASRevision_IS2000RelC = 9, + eQMINASRevision_IS2000RelCMI = 10, + eQMINASRevision_IS2000RelD = 11, +}; + +// Enum to describe QMI NAS Roam Status +enum eQMINASRoamStatus:UINT8 +{ + eQMINASRoamStatus_Off = 0, + eQMINASRoamStatus_On = 1, + eQMINASRoamStatus_Blinking = 2, + eQMINASRoamStatus_OutOfNeighborhood = 3, + eQMINASRoamStatus_OutOfBuilding = 4, + eQMINASRoamStatus_PreferredSystem = 5, + eQMINASRoamStatus_AvailableSystem = 6, + eQMINASRoamStatus_AlliancePartner = 7, + eQMINASRoamStatus_PremiumPartner = 8, + eQMINASRoamStatus_FullService = 9, + eQMINASRoamStatus_PartialService = 10, + eQMINASRoamStatus_BannerIsOn = 11, + eQMINASRoamStatus_BannerIsOff = 12, +}; + +// Enum to describe QMI NAS Roaming Indicators +enum eQMINASRoamingIndicators:UINT8 +{ + eQMINASRoamingIndicators_Roaming = 0, + eQMINASRoamingIndicators_Home = 1, + eQMINASRoamingIndicators_RoamingPartner = 2, +}; + +// Enum to describe QMI NAS Roaming Preferences +enum eQMINASRoamingPreferences:UINT8 +{ + eQMINASRoamingPreferences_Automatic = 0, + eQMINASRoamingPreferences_HomeOnly = 1, + eQMINASRoamingPreferences_RoamingOnly = 2, + eQMINASRoamingPreferences_HomeRoaming = 3, +}; + +// Enum to describe QMI NAS Roaming Preferences 2 +enum eQMINASRoamingPreferences2:UINT16 +{ + eQMINASRoamingPreferences2_AcquireWhenRoamingIndicatorOff = 1, + eQMINASRoamingPreferences2_AcquireWhenRoamingIndicatorNotOff = 2, + eQMINASRoamingPreferences2_AcquireWhenRoamingIndicatorNotFlashing = 3, + eQMINASRoamingPreferences2_AcquireAny = 255, +}; + +// Enum to describe QMI NAS Roaming States +enum eQMINASRoamingStates:UINT8 +{ + eQMINASRoamingStates_Unknown = 0, + eQMINASRoamingStates_Home = 1, + eQMINASRoamingStates_Roam = 2, +}; + +// Enum to describe QMI NAS SIM Reject States +enum eQMINASSIMRejectStates:UINT32 +{ + eQMINASSIMRejectStates_NotAvailable = 0, + eQMINASSIMRejectStates_Available = 1, + eQMINASSIMRejectStates_CSInvalid = 2, + eQMINASSIMRejectStates_PSInvalid = 3, + eQMINASSIMRejectStates_CSAndPSInvalid = 4, +}; + +// Enum to describe QMI NAS SINR Levels +enum eQMINASSINRLevels:UINT8 +{ + eQMINASSINRLevels_Negative9dB = 0, + eQMINASSINRLevels_Negative6dB = 1, + eQMINASSINRLevels_Negative45dB = 2, + eQMINASSINRLevels_Negative3dB = 3, + eQMINASSINRLevels_Negative2dB = 4, + eQMINASSINRLevels_1dB = 5, + eQMINASSINRLevels_3dB = 6, + eQMINASSINRLevels_6dB = 7, + eQMINASSINRLevels_9dB = 8, +}; + +// Enum to describe QMI NAS Service Domain Prefs +enum eQMINASServiceDomainPrefs:UINT32 +{ + eQMINASServiceDomainPrefs_CircuitSwitched = 0, + eQMINASServiceDomainPrefs_PacketSwitched = 1, + eQMINASServiceDomainPrefs_CircuitPacketSwitched = 2, + eQMINASServiceDomainPrefs_PacketSwitchedAttach = 3, + eQMINASServiceDomainPrefs_PacketSwitchedDetach = 4, +}; + +// Enum to describe QMI NAS Service Domains +enum eQMINASServiceDomains:UINT8 +{ + eQMINASServiceDomains_NoService = 0, + eQMINASServiceDomains_CircuitSwitched = 1, +}; + +// Enum to describe QMI NAS Service Option Actions +enum eQMINASServiceOptionActions:UINT8 +{ + eQMINASServiceOptionActions_Add = 0, + eQMINASServiceOptionActions_Replace = 1, + eQMINASServiceOptionActions_Delete = 2, + eQMINASServiceOptionActions_NoChange = 3, +}; + +// Enum to describe QMI NAS Service Status +enum eQMINASServiceStatus:UINT8 +{ + eQMINASServiceStatus_NoService = 0, + eQMINASServiceStatus_LimitedService = 1, + eQMINASServiceStatus_ServiceAvailable = 2, + eQMINASServiceStatus_LimitedRegionalService = 3, + eQMINASServiceStatus_PowerSaveOrDeepSleep = 4, +}; + +// Enum to describe QMI NAS Standby Preference +enum eQMINASStandbyPreference:UINT8 +{ + eQMINASStandbyPreference_SingleStandby = 1, + eQMINASStandbyPreference_DualStandbyWithTuneAway = 2, + eQMINASStandbyPreference_DualStandbyWithoutTuneAway = 4, + eQMINASStandbyPreference_AutomaticModeWithTuneAway = 5, + eQMINASStandbyPreference_AutomaticModeWithoutTuneAway = 6, +}; + +// Enum to describe QMI NAS Subscription Type +enum eQMINASSubscriptionType:UINT8 +{ + eQMINASSubscriptionType_PrimarySubscription = 0, + eQMINASSubscriptionType_SecondarySubscription = 1, +}; + +// Enum to describe QMI NAS System Forbidden +enum eQMINASSystemForbidden:UINT8 +{ + eQMINASSystemForbidden_SystemIsNotForbidden = 0, + eQMINASSystemForbidden_SystemIsForbidden = 1, +}; + +// Enum to describe QMI NAS System Preferences +enum eQMINASSystemPreferences:UINT8 +{ + eQMINASSystemPreferences_Automatic = 0, + eQMINASSystemPreferences_AutomaticA = 1, + eQMINASSystemPreferences_AutomaticB = 2, +}; + +// Enum to describe QMI NAS System Service Capabilities +enum eQMINASSystemServiceCapabilities:UINT8 +{ + eQMINASSystemServiceCapabilities_NoService = 0, + eQMINASSystemServiceCapabilities_CircuitSwitchedOnly = 1, + eQMINASSystemServiceCapabilities_PacketSwitchedOnly = 2, + eQMINASSystemServiceCapabilities_CircuitSwitchedAndPacketSwitched = 3, + eQMINASSystemServiceCapabilities_Camped = 4, +}; + +// Enum to describe QMI NAS Tech Pref Durations +enum eQMINASTechPrefDurations:UINT8 +{ + eQMINASTechPrefDurations_Permanent = 0, + eQMINASTechPrefDurations_PowerCycle = 1, +}; + +// Enum to describe QMI NAS Tech Prefs +enum eQMINASTechPrefs:UINT8 +{ + eQMINASTechPrefs_Automatic = 0, + eQMINASTechPrefs_3GPP2 = 1, + eQMINASTechPrefs_3GPP = 2, + eQMINASTechPrefs_Invalid = 3, +}; + +// Enum to describe QMI OMA HFA Done States +enum eQMIOMAHFADoneStates:UINT8 +{ + eQMIOMAHFADoneStates_None = 0, + eQMIOMAHFADoneStates_Succeeded = 1, + eQMIOMAHFADoneStates_Failed = 2, +}; + +// Enum to describe QMI OMA Selections +enum eQMIOMASelections:UINT8 +{ + eQMIOMASelections_Reject = 0, + eQMIOMASelections_Accept = 1, +}; + +// Enum to describe QMI OMA Session Failure Reasons +enum eQMIOMASessionFailureReasons:UINT8 +{ + eQMIOMASessionFailureReasons_Unknown = 0, + eQMIOMASessionFailureReasons_NetworkUnavailable = 1, + eQMIOMASessionFailureReasons_ServerUnavailable = 2, + eQMIOMASessionFailureReasons_AuthenticationFailed = 3, + eQMIOMASessionFailureReasons_MaxRetryExceeded = 4, + eQMIOMASessionFailureReasons_SessionCancelled = 5, +}; + +// Enum to describe QMI OMA Session States +enum eQMIOMASessionStates:UINT8 +{ + eQMIOMASessionStates_CompleteInfoUpdated = 0, + eQMIOMASessionStates_CompleteInfoUnavailable = 1, + eQMIOMASessionStates_Failed = 2, + eQMIOMASessionStates_Retrying = 3, + eQMIOMASessionStates_Connecting = 4, + eQMIOMASessionStates_Connected = 5, + eQMIOMASessionStates_Authenticated = 6, + eQMIOMASessionStates_MDNDownloaded = 7, + eQMIOMASessionStates_MSIDDownloaded = 8, + eQMIOMASessionStates_PRLDownloaded = 9, + eQMIOMASessionStates_MIPProfileDownloaded = 10, +}; + +// Enum to describe QMI OMA Session Types +enum eQMIOMASessionTypes:UINT8 +{ + eQMIOMASessionTypes_ClientInitiatedDeviceConfigure = 0, + eQMIOMASessionTypes_ClientInitiatedPRLUpdate = 1, + eQMIOMASessionTypes_ClientInitiatedHandsFreeActivation = 2, + eQMIOMASessionTypes_DeviceInitiatedHandsFreeActivation = 3, + eQMIOMASessionTypes_NetworkInitiatedPRLUpdate = 4, + eQMIOMASessionTypes_NetworkInitiatedDeviceConfigure = 5, +}; + +// Enum to describe QMI PBM AAS Operations +enum eQMIPBMAASOperations:UINT8 +{ + eQMIPBMAASOperations_Add = 0, + eQMIPBMAASOperations_Modify = 1, + eQMIPBMAASOperations_Delete = 2, +}; + +// Enum to describe QMI PBM Emergency Categories +enum eQMIPBMEmergencyCategories +{ + eQMIPBMEmergencyCategories_Police = 1, + eQMIPBMEmergencyCategories_Ambulance = 2, + eQMIPBMEmergencyCategories_FireBrigade = 4, + eQMIPBMEmergencyCategories_MarineGuard = 8, + eQMIPBMEmergencyCategories_MountainRescue = 16, + eQMIPBMEmergencyCategories_ManualECall = 32, + eQMIPBMEmergencyCategories_AutomaticECall = 64, + eQMIPBMEmergencyCategories_Spare = 128, +}; + +// Enum to describe QMI PBM Number Plans +enum eQMIPBMNumberPlans:UINT8 +{ + eQMIPBMNumberPlans_Unknown = 0, + eQMIPBMNumberPlans_ISDN = 1, + eQMIPBMNumberPlans_Data = 2, + eQMIPBMNumberPlans_Telex = 3, + eQMIPBMNumberPlans_National = 4, + eQMIPBMNumberPlans_Private = 5, +}; + +// Enum to describe QMI PBM Number Types +enum eQMIPBMNumberTypes:UINT8 +{ + eQMIPBMNumberTypes_Unknown = 0, + eQMIPBMNumberTypes_International = 1, + eQMIPBMNumberTypes_National = 2, + eQMIPBMNumberTypes_NetworkSpecific = 3, + eQMIPBMNumberTypes_DedicatedAccess = 4, +}; + +// Enum to describe QMI PBM Operations +enum eQMIPBMOperations:UINT8 +{ + eQMIPBMOperations_Add = 1, + eQMIPBMOperations_Modify = 2, + eQMIPBMOperations_Delete = 3, +}; + +// Enum to describe QMI PBM Phonebook Types +enum eQMIPBMPhonebookTypes:UINT16 +{ + eQMIPBMPhonebookTypes_AbbreviatedDialingNumber = 1, + eQMIPBMPhonebookTypes_FixedDialingNumber = 2, + eQMIPBMPhonebookTypes_MobileSubscriberIntegratedServicesDigitalNetwork = 4, + eQMIPBMPhonebookTypes_MailBoxDialingNumber = 8, + eQMIPBMPhonebookTypes_ServiceDialingNumber = 16, + eQMIPBMPhonebookTypes_BarredDialingNumber = 32, + eQMIPBMPhonebookTypes_LastNumberDialed = 64, + eQMIPBMPhonebookTypes_MailBoxNumber = 128, +}; + +// Enum to describe QMI PBM Protection Methods +enum eQMIPBMProtectionMethods:UINT32 +{ + eQMIPBMProtectionMethods_AlwaysAllowed = 0, + eQMIPBMProtectionMethods_NeverAllowed = 1, + eQMIPBMProtectionMethods_AllowedOnAllPINsVerified = 2, + eQMIPBMProtectionMethods_AllowedOnAnyPINVerified = 3, + eQMIPBMProtectionMethods_AllowedOnOnePINVerified = 4, +}; + +// Enum to describe QMI PBM Refresh Status +enum eQMIPBMRefreshStatus:UINT8 +{ + eQMIPBMRefreshStatus_RefreshStart = 1, + eQMIPBMRefreshStatus_RefreshEnd = 2, +}; + +// Enum to describe QMI PBM Session Types +enum eQMIPBMSessionTypes:UINT8 +{ + eQMIPBMSessionTypes_GWPrimary = 0, + eQMIPBMSessionTypes_1xPrimary = 1, + eQMIPBMSessionTypes_GWSecondary = 2, + eQMIPBMSessionTypes_1xSecondary = 3, + eQMIPBMSessionTypes_NonProvisioningOnSlot1 = 4, + eQMIPBMSessionTypes_NonProvisioningOnSlot2 = 5, + eQMIPBMSessionTypes_GlobalPhonebookOnSlot1 = 6, + eQMIPBMSessionTypes_GlobalPhonebookOnSlot2 = 7, +}; + +// Enum to describe QMI PBM States +enum eQMIPBMStates:UINT8 +{ + eQMIPBMStates_Ready = 0, + eQMIPBMStates_NotReady = 1, + eQMIPBMStates_NotAvailable = 2, + eQMIPBMStates_PINRestriction = 3, + eQMIPBMStates_PUKRestriction = 4, + eQMIPBMStates_Invalidated = 5, + eQMIPBMStates_Sync = 6, +}; + +// Enum to describe QMI PBM Subscription Types +enum eQMIPBMSubscriptionTypes:UINT8 +{ + eQMIPBMSubscriptionTypes_Primary = 0, + eQMIPBMSubscriptionTypes_Secondary = 1, +}; + +// Enum to describe QMI PDP Types +enum eQMIPDPTypes:UINT8 +{ + eQMIPDPTypes_PDPIPv4 = 0, + eQMIPDPTypes_PDPPPP = 1, + eQMIPDPTypes_PDPIPv6 = 2, + eQMIPDPTypes_PDPIPv4OrIPv6 = 3, +}; + +// Enum to describe QMI PDS Altitude Source +enum eQMIPDSAltitudeSource:UINT8 +{ + eQMIPDSAltitudeSource_Unknown = 0, + eQMIPDSAltitudeSource_GPS = 1, + eQMIPDSAltitudeSource_CellID = 2, + eQMIPDSAltitudeSource_EnhancedCellID = 3, + eQMIPDSAltitudeSource_WiFi = 4, + eQMIPDSAltitudeSource_Terrestrial = 5, + eQMIPDSAltitudeSource_TerrestrialHybrid = 6, + eQMIPDSAltitudeSource_AltitudeDatabase = 7, + eQMIPDSAltitudeSource_BarometricAltimeter = 8, + eQMIPDSAltitudeSource_Other = 9, +}; + +// Enum to describe QMI PDS Blanking Enable +enum eQMIPDSBlankingEnable:UINT8 +{ + eQMIPDSBlankingEnable_DisableBlanking = 0, + eQMIPDSBlankingEnable_EnableBlankingUnconditionally = 1, + eQMIPDSBlankingEnable_EnableBlankingConditionally = 2, + eQMIPDSBlankingEnable_SimulateIMDJamming = 3, +}; + +// Enum to describe QMI PDS Calendar Days +enum eQMIPDSCalendarDays:UINT8 +{ + eQMIPDSCalendarDays_Sunday = 0, + eQMIPDSCalendarDays_Monday = 1, + eQMIPDSCalendarDays_Tuesday = 2, + eQMIPDSCalendarDays_Wednesday = 3, + eQMIPDSCalendarDays_Thursday = 4, + eQMIPDSCalendarDays_Friday = 5, + eQMIPDSCalendarDays_Saturday = 6, +}; + +// Enum to describe QMI PDS Calendar Months +enum eQMIPDSCalendarMonths:UINT8 +{ + eQMIPDSCalendarMonths_January = 0, + eQMIPDSCalendarMonths_February = 1, + eQMIPDSCalendarMonths_March = 2, + eQMIPDSCalendarMonths_April = 3, + eQMIPDSCalendarMonths_May = 4, + eQMIPDSCalendarMonths_June = 5, + eQMIPDSCalendarMonths_July = 6, + eQMIPDSCalendarMonths_August = 7, + eQMIPDSCalendarMonths_September = 8, + eQMIPDSCalendarMonths_October = 9, + eQMIPDSCalendarMonths_November = 10, + eQMIPDSCalendarMonths_December = 11, +}; + +// Enum to describe QMI PDS Comm Event Protocols +enum eQMIPDSCommEventProtocols:UINT8 +{ + eQMIPDSCommEventProtocols_UMTSUserPlaneSUPL = 0, + eQMIPDSCommEventProtocols_1X = 1, + eQMIPDSCommEventProtocols_UMTSControlPlaneWCDMA = 2, + eQMIPDSCommEventProtocols_UMTSControlPlaneGSM = 3, + eQMIPDSCommEventProtocols_V1V2 = 4, + eQMIPDSCommEventProtocols_KDDI = 5, + eQMIPDSCommEventProtocols_XTRADataDownload = 6, + eQMIPDSCommEventProtocols_SNTPTimeDownload = 7, + eQMIPDSCommEventProtocols_1XControlPlane = 8, + eQMIPDSCommEventProtocols_Unknown = 255, +}; + +// Enum to describe QMI PDS Comm Event Types +enum eQMIPDSCommEventTypes:UINT8 +{ + eQMIPDSCommEventTypes_Begin = 0, + eQMIPDSCommEventTypes_Connected = 1, + eQMIPDSCommEventTypes_Failure = 2, + eQMIPDSCommEventTypes_Done = 3, + eQMIPDSCommEventTypes_OtherFailure = 4, +}; + +// Enum to describe QMI PDS Config +enum eQMIPDSConfig:UINT8 +{ + eQMIPDSConfig_PersistentDisabled = 0, + eQMIPDSConfig_PersistentEnabled = 1, + eQMIPDSConfig_NotPersistentDisabled = 240, + eQMIPDSConfig_NotPersistentEnabled = 241, +}; + +// Enum to describe QMI PDS Cradle Mount State +enum eQMIPDSCradleMountState:UINT8 +{ + eQMIPDSCradleMountState_NotMounted = 0, + eQMIPDSCradleMountState_Mounted = 1, + eQMIPDSCradleMountState_Unknown = 2, +}; + +// Enum to describe QMI PDS EFS File Operations +enum eQMIPDSEFSFileOperations:UINT8 +{ + eQMIPDSEFSFileOperations_Write = 0, + eQMIPDSEFSFileOperations_Delete = 1, +}; + +// Enum to describe QMI PDS Encryption Algorithm +enum eQMIPDSEncryptionAlgorithm:UINT8 +{ + eQMIPDSEncryptionAlgorithm_PDSMPDHashAlgorithmSHA1 = 0, + eQMIPDSEncryptionAlgorithm_PDSMPDHashAlgorithmMax = 1, + eQMIPDSEncryptionAlgorithm_PDSMPDHashAlgorithmNone = 255, +}; + +// Enum to describe QMI PDS External Power State +enum eQMIPDSExternalPowerState:UINT8 +{ + eQMIPDSExternalPowerState_NotConnected = 0, + eQMIPDSExternalPowerState_Connected = 1, + eQMIPDSExternalPowerState_Unknown = 2, +}; + +// Enum to describe QMI PDS Force Receiver Off +enum eQMIPDSForceReceiverOff:UINT8 +{ + eQMIPDSForceReceiverOff_Disable = 0, + eQMIPDSForceReceiverOff_Enable = 1, +}; + +// Enum to describe QMI PDS IMD Jamming Bands +enum eQMIPDSIMDJammingBands:UINT32 +{ + eQMIPDSIMDJammingBands_GPS = 0, + eQMIPDSIMDJammingBands_GLONASS = 1, +}; + +// Enum to describe QMI PDS IMD Jamming States +enum eQMIPDSIMDJammingStates:UINT8 +{ + eQMIPDSIMDJammingStates_Terminate = 0, + eQMIPDSIMDJammingStates_Initiate = 1, +}; + +// Enum to describe QMI PDS Injected Position Sources +enum eQMIPDSInjectedPositionSources:UINT8 +{ + eQMIPDSInjectedPositionSources_Unknown = 0, + eQMIPDSInjectedPositionSources_GPS = 1, + eQMIPDSInjectedPositionSources_CellID = 2, + eQMIPDSInjectedPositionSources_EnhancedCellID = 3, + eQMIPDSInjectedPositionSources_WiFi = 4, + eQMIPDSInjectedPositionSources_Terrestial = 5, + eQMIPDSInjectedPositionSources_TerrestialHybrid = 6, + eQMIPDSInjectedPositionSources_Other = 7, +}; + +// Enum to describe QMI PDS Mediums +enum eQMIPDSMediums:UINT8 +{ + eQMIPDSMediums_WWAN = 0, +}; + +// Enum to describe QMI PDS Method States +enum eQMIPDSMethodStates:UINT8 +{ + eQMIPDSMethodStates_Disabled = 0, + eQMIPDSMethodStates_Enabled = 1, + eQMIPDSMethodStates_NotSupported = 255, +}; + +// Enum to describe QMI PDS Motion Modes +enum eQMIPDSMotionModes:UINT8 +{ + eQMIPDSMotionModes_Unknown = 0, + eQMIPDSMotionModes_Pedestrian = 1, + eQMIPDSMotionModes_Vehicle = 2, +}; + +// Enum to describe QMI PDS Motion States +enum eQMIPDSMotionStates:UINT8 +{ + eQMIPDSMotionStates_Unknown = 0, + eQMIPDSMotionStates_Stationary = 1, + eQMIPDSMotionStates_InMotion = 2, +}; + +// Enum to describe QMI PDS Motion Submodes +enum eQMIPDSMotionSubmodes:UINT8 +{ + eQMIPDSMotionSubmodes_Unknown = 0, + eQMIPDSMotionSubmodes_Walking = 1, + eQMIPDSMotionSubmodes_Running = 2, +}; + +// Enum to describe QMI PDS NMEA Reporting Options +enum eQMIPDSNMEAReportingOptions:UINT8 +{ + eQMIPDSNMEAReportingOptions_1HzFromTimeRequestedUntilFinalPositionDetermination = 0, + eQMIPDSNMEAReportingOptions_FinalPositionDeterminationOnly = 1, +}; + +// Enum to describe QMI PDS NMEA Sentence Operating Modes +enum eQMIPDSNMEASentenceOperatingModes:UINT8 +{ + eQMIPDSNMEASentenceOperatingModes_Standalone = 0, + eQMIPDSNMEASentenceOperatingModes_MSBased = 1, + eQMIPDSNMEASentenceOperatingModes_MSAssisted = 2, + eQMIPDSNMEASentenceOperatingModes_Unknown = 255, +}; + +// Enum to describe QMI PDS Network Mode +enum eQMIPDSNetworkMode:UINT8 +{ + eQMIPDSNetworkMode_UMTS = 0, + eQMIPDSNetworkMode_CDMA = 1, +}; + +// Enum to describe QMI PDS ODP States +enum eQMIPDSODPStates:UINT8 +{ + eQMIPDSODPStates_Disables = 0, + eQMIPDSODPStates_EnabledLowPowerMode = 1, + eQMIPDSODPStates_EnabledReadyMode = 2, +}; + +// Enum to describe QMI PDS Operation Types +enum eQMIPDSOperationTypes:UINT8 +{ + eQMIPDSOperationTypes_Standalone = 0, + eQMIPDSOperationTypes_MSBased = 1, + eQMIPDSOperationTypes_MSAssisted = 2, +}; + +// Enum to describe QMI PDS Output Devices +enum eQMIPDSOutputDevices:UINT8 +{ + eQMIPDSOutputDevices_NoneDisabled = 0, + eQMIPDSOutputDevices_USB = 1, + eQMIPDSOutputDevices_UART1 = 2, + eQMIPDSOutputDevices_UART2 = 3, + eQMIPDSOutputDevices_SharedMemory = 4, +}; + +// Enum to describe QMI PDS Privacy Modes +enum eQMIPDSPrivacyModes:UINT8 +{ + eQMIPDSPrivacyModes_NoNotifyVerify = 0, + eQMIPDSPrivacyModes_Notify = 1, + eQMIPDSPrivacyModes_NotifyVerifyAllowNoResponse = 2, + eQMIPDSPrivacyModes_NotifyVerifyRequireResponse = 3, + eQMIPDSPrivacyModes_PrivacyOverride = 4, +}; + +// Enum to describe QMI PDS Reliability Indicator +enum eQMIPDSReliabilityIndicator:UINT8 +{ + eQMIPDSReliabilityIndicator_NotSet = 0, + eQMIPDSReliabilityIndicator_VeryLow = 1, + eQMIPDSReliabilityIndicator_Low = 2, + eQMIPDSReliabilityIndicator_Medium = 3, + eQMIPDSReliabilityIndicator_High = 4, +}; + +// Enum to describe QMI PDS Report Security Challenge +enum eQMIPDSReportSecurityChallenge:UINT8 +{ + eQMIPDSReportSecurityChallenge_Disable = 0, + eQMIPDSReportSecurityChallenge_Enable = 1, +}; + +// Enum to describe QMI PDS Reporting State +enum eQMIPDSReportingState:UINT8 +{ + eQMIPDSReportingState_StopReporting = 0, + eQMIPDSReportingState_StartReporting = 1, +}; + +// Enum to describe QMI PDS Reset Reasons +enum eQMIPDSResetReasons:UINT32 +{ + eQMIPDSResetReasons_PositionEngine = 0, + eQMIPDSResetReasons_GNSSBackgroundSCan = 1, + eQMIPDSResetReasons_InjectClockInconsistency = 2, + eQMIPDSResetReasons_GPSSubframeMisalignment = 3, + eQMIPDSResetReasons_DecodedTimeInconsistency = 4, + eQMIPDSResetReasons_CodeConsistencyError = 5, + eQMIPDSResetReasons_SoftResetFromINTMSError = 6, + eQMIPDSResetReasons_SoftResetFromRFFailure = 7, +}; + +// Enum to describe QMI PDS Reset States +enum eQMIPDSResetStates:UINT32 +{ + eQMIPDSResetStates_InProgress = 0, + eQMIPDSResetStates_Completed = 1, + eQMIPDSResetStates_UnableToInitialize = 2, + eQMIPDSResetStates_E911CallInProgress = 3, +}; + +// Enum to describe QMI PDS SBAS States +enum eQMIPDSSBASStates:UINT8 +{ + eQMIPDSSBASStates_Disabled = 0, + eQMIPDSSBASStates_Enabled = 1, + eQMIPDSSBASStates_Unknown = 255, +}; + +// Enum to describe QMI PDS SPI State +enum eQMIPDSSPIState:UINT8 +{ + eQMIPDSSPIState_DeviceIsNonstationary = 0, + eQMIPDSSPIState_DeviceIsStationary = 1, +}; + +// Enum to describe QMI PDS SUPL Data Coding Schemes +enum eQMIPDSSUPLDataCodingSchemes:UINT8 +{ + eQMIPDSSUPLDataCodingSchemes_UTF8 = 0, + eQMIPDSSUPLDataCodingSchemes_UCS2 = 1, + eQMIPDSSUPLDataCodingSchemes_GSM = 2, + eQMIPDSSUPLDataCodingSchemes_Unknown = 255, +}; + +// Enum to describe QMI PDS SUPL ID/Name Data Coding Schemes +enum eQMIPDSSUPLIDNameDataCodingSchemes:UINT8 +{ + eQMIPDSSUPLIDNameDataCodingSchemes_LogicalName = 0, + eQMIPDSSUPLIDNameDataCodingSchemes_EmailAddress = 1, + eQMIPDSSUPLIDNameDataCodingSchemes_MSISDN = 2, + eQMIPDSSUPLIDNameDataCodingSchemes_URL = 3, + eQMIPDSSUPLIDNameDataCodingSchemes_SIPURL = 4, + eQMIPDSSUPLIDNameDataCodingSchemes_MIN = 5, + eQMIPDSSUPLIDNameDataCodingSchemes_MDN = 6, + eQMIPDSSUPLIDNameDataCodingSchemes_Unknown = 255, +}; + +// Enum to describe QMI PDS SUPL Modes +enum eQMIPDSSUPLModes:UINT8 +{ + eQMIPDSSUPLModes_MSAssisted = 0, + eQMIPDSSUPLModes_MSBased = 1, + eQMIPDSSUPLModes_MSAssistedPreferred = 2, + eQMIPDSSUPLModes_MSBasedPreferred = 3, + eQMIPDSSUPLModes_Standalone = 4, + eQMIPDSSUPLModes_AFLT = 5, + eQMIPDSSUPLModes_ECID = 6, + eQMIPDSSUPLModes_EOTD = 7, + eQMIPDSSUPLModes_OTDOA = 8, + eQMIPDSSUPLModes_NoPosition = 9, +}; + +// Enum to describe QMI PDS SV Almanac Status +enum eQMIPDSSVAlmanacStatus:UINT8 +{ + eQMIPDSSVAlmanacStatus_Unavailable = 0, + eQMIPDSSVAlmanacStatus_Available = 1, +}; + +// Enum to describe QMI PDS SV Ephemeris Status +enum eQMIPDSSVEphemerisStatus:UINT8 +{ + eQMIPDSSVEphemerisStatus_Unavailable = 0, + eQMIPDSSVEphemerisStatus_Available = 1, +}; + +// Enum to describe QMI PDS SV Health Status +enum eQMIPDSSVHealthStatus:UINT8 +{ + eQMIPDSSVHealthStatus_Unhealthy = 0, + eQMIPDSSVHealthStatus_Healthy = 1, +}; + +// Enum to describe QMI PDS SV Processing Status +enum eQMIPDSSVProcessingStatus:UINT8 +{ + eQMIPDSSVProcessingStatus_Idle = 1, + eQMIPDSSVProcessingStatus_Search = 2, + eQMIPDSSVProcessingStatus_SearchVerify = 3, + eQMIPDSSVProcessingStatus_BitEdge = 4, + eQMIPDSSVProcessingStatus_Track = 5, +}; + +// Enum to describe QMI PDS SV Systems +enum eQMIPDSSVSystems:UINT8 +{ + eQMIPDSSVSystems_GPS = 1, + eQMIPDSSVSystems_Galileo = 2, + eQMIPDSSVSystems_SBAS = 3, + eQMIPDSSVSystems_Compass = 4, + eQMIPDSSVSystems_Glonass = 5, +}; + +// Enum to describe QMI PDS Server Options +enum eQMIPDSServerOptions:UINT8 +{ + eQMIPDSServerOptions_Default = 0, +}; + +// Enum to describe QMI PDS Session Control Types +enum eQMIPDSSessionControlTypes:UINT8 +{ + eQMIPDSSessionControlTypes_Automatic = 0, +}; + +// Enum to describe QMI PDS Session Status +enum eQMIPDSSessionStatus:UINT8 +{ + eQMIPDSSessionStatus_Success = 0, + eQMIPDSSessionStatus_InProgress = 1, + eQMIPDSSessionStatus_GeneralFailure = 2, + eQMIPDSSessionStatus_Timeout = 3, + eQMIPDSSessionStatus_UserEnded = 4, + eQMIPDSSessionStatus_BadParameter = 5, + eQMIPDSSessionStatus_PhoneOffline = 6, + eQMIPDSSessionStatus_EngineLocked = 7, + eQMIPDSSessionStatus_E911SessionInProgress = 8, +}; + +// Enum to describe QMI PDS Session Types +enum eQMIPDSSessionTypes:UINT8 +{ + eQMIPDSSessionTypes_New = 0, +}; + +// Enum to describe QMI PDS Source Linkage +enum eQMIPDSSourceLinkage:UINT8 +{ + eQMIPDSSourceLinkage_NotSpecified = 0, + eQMIPDSSourceLinkage_FullyInterDependent = 1, + eQMIPDSSourceLinkage_AltitudeDependsOnLatitudeAndLongitude = 2, + eQMIPDSSourceLinkage_FullyIndependent = 3, +}; + +// Enum to describe QMI PDS Stop Reason +enum eQMIPDSStopReason:UINT8 +{ + eQMIPDSStopReason_UserTerminated = 0, + eQMIPDSStopReason_Other = 1, +}; + +// Enum to describe QMI PDS Streaming Status +enum eQMIPDSStreamingStatus:UINT8 +{ + eQMIPDSStreamingStatus_NotReadyForStreaming = 0, + eQMIPDSStreamingStatus_ReadyForStreaming = 1, +}; + +// Enum to describe QMI PDS Suspend Reason +enum eQMIPDSSuspendReason:UINT8 +{ + eQMIPDSSuspendReason_OoS = 0, + eQMIPDSSuspendReason_LPM = 1, + eQMIPDSSuspendReason_Other = 2, +}; + +// Enum to describe QMI PDS Time Bases +enum eQMIPDSTimeBases:UINT8 +{ + eQMIPDSTimeBases_GPS = 0, + eQMIPDSTimeBases_UTC = 1, +}; + +// Enum to describe QMI PDS Time Source +enum eQMIPDSTimeSource:UINT8 +{ + eQMIPDSTimeSource_Invalid = 0, + eQMIPDSTimeSource_NetworkTimeTransfer = 1, + eQMIPDSTimeSource_NetworkTimeTagging = 2, + eQMIPDSTimeSource_ExternalInput = 3, + eQMIPDSTimeSource_TOWDecode = 4, + eQMIPDSTimeSource_TOWConfirmed = 5, + eQMIPDSTimeSource_TOWAndWeekConfirmed = 6, + eQMIPDSTimeSource_TimeAlignment = 7, + eQMIPDSTimeSource_NavSolution = 8, + eQMIPDSTimeSource_SolveForTime = 9, +}; + +// Enum to describe QMI PDS Time Type +enum eQMIPDSTimeType:UINT8 +{ + eQMIPDSTimeType_UTCTime = 0, + eQMIPDSTimeType_GPSTime = 1, + eQMIPDSTimeType_Age = 2, +}; + +// Enum to describe QMI PDS Tracking Session States +enum eQMIPDSTrackingSessionStates:UINT8 +{ + eQMIPDSTrackingSessionStates_Unknown = 0, + eQMIPDSTrackingSessionStates_Inactive = 1, + eQMIPDSTrackingSessionStates_Active = 2, +}; + +// Enum to describe QMI PDS UMTS CP Data Coding Schemes +enum eQMIPDSUMTSCPDataCodingSchemes:UINT8 +{ + eQMIPDSUMTSCPDataCodingSchemes_German = 0, + eQMIPDSUMTSCPDataCodingSchemes_English = 1, + eQMIPDSUMTSCPDataCodingSchemes_Italian = 2, + eQMIPDSUMTSCPDataCodingSchemes_French = 3, + eQMIPDSUMTSCPDataCodingSchemes_Spanish = 4, + eQMIPDSUMTSCPDataCodingSchemes_Dutch = 5, + eQMIPDSUMTSCPDataCodingSchemes_Swedish = 6, + eQMIPDSUMTSCPDataCodingSchemes_Danish = 7, + eQMIPDSUMTSCPDataCodingSchemes_Portuguese = 8, + eQMIPDSUMTSCPDataCodingSchemes_Finnish = 9, + eQMIPDSUMTSCPDataCodingSchemes_Norwegian = 10, + eQMIPDSUMTSCPDataCodingSchemes_Greek = 11, + eQMIPDSUMTSCPDataCodingSchemes_Turkish = 12, + eQMIPDSUMTSCPDataCodingSchemes_Hungarian = 13, + eQMIPDSUMTSCPDataCodingSchemes_Polish = 14, + eQMIPDSUMTSCPDataCodingSchemes_Unknown = 255, +}; + +// Enum to describe QMI PDS UMTS CP Location Types +enum eQMIPDSUMTSCPLocationTypes:UINT8 +{ + eQMIPDSUMTSCPLocationTypes_Current = 0, + eQMIPDSUMTSCPLocationTypes_CurrentOrLastKnown = 1, + eQMIPDSUMTSCPLocationTypes_Initial = 2, +}; + +// Enum to describe QMI PDS Uncertainty Coverage +enum eQMIPDSUncertaintyCoverage:UINT8 +{ + eQMIPDSUncertaintyCoverage_NotSpecified = 0, + eQMIPDSUncertaintyCoverage_PointUncertainty = 1, + eQMIPDSUncertaintyCoverage_FullyUncertainty = 2, +}; + +// Enum to describe QMI PDS VX Data Coding Schemes +enum eQMIPDSVXDataCodingSchemes:UINT8 +{ + eQMIPDSVXDataCodingSchemes_Octet = 0, + eQMIPDSVXDataCodingSchemes_EXNProtocolMessage = 1, + eQMIPDSVXDataCodingSchemes_ASCII = 2, + eQMIPDSVXDataCodingSchemes_IA5 = 3, + eQMIPDSVXDataCodingSchemes_Unicode = 4, + eQMIPDSVXDataCodingSchemes_ShiftJIS = 5, + eQMIPDSVXDataCodingSchemes_Korean = 6, + eQMIPDSVXDataCodingSchemes_LatinHebrew = 7, + eQMIPDSVXDataCodingSchemes_Latin = 8, + eQMIPDSVXDataCodingSchemes_GSM = 9, +}; + +// Enum to describe QMI PDS VX Modes +enum eQMIPDSVXModes:UINT8 +{ + eQMIPDSVXModes_MSAssisted = 0, + eQMIPDSVXModes_MSBased = 1, + eQMIPDSVXModes_MSAssistedPreferred = 2, + eQMIPDSVXModes_MSBasedPreferred = 3, +}; + +// Enum to describe QMI PDS WWAN Network Preferences +enum eQMIPDSWWANNetworkPreferences:UINT8 +{ + eQMIPDSWWANNetworkPreferences_AnyAvailable = 0, + eQMIPDSWWANNetworkPreferences_HomeOnly = 1, + eQMIPDSWWANNetworkPreferences_RoamOnly = 2, +}; + +// Enum to describe QMI PDS Wi-Fi Request Types +enum eQMIPDSWiFiRequestTypes:UINT8 +{ + eQMIPDSWiFiRequestTypes_StartPeriodicFixesHighFrequency = 0, + eQMIPDSWiFiRequestTypes_StartPeriodicFixesKeepWarm = 1, + eQMIPDSWiFiRequestTypes_StopPeriodicFixes = 2, + eQMIPDSWiFiRequestTypes_Suspend = 4, +}; + +// Enum to describe QMI Profile Types +enum eQMIProfileTypes:UINT8 +{ + eQMIProfileTypes_3GPP = 0, + eQMIProfileTypes_3GPP2 = 1, +}; + +// Enum to describe QMI QoS Delivery Orders +enum eQMIQoSDeliveryOrders:UINT8 +{ + eQMIQoSDeliveryOrders_Subscribe = 0, + eQMIQoSDeliveryOrders_DeliveryOrderOn = 1, + eQMIQoSDeliveryOrders_DeliveryOrderOff = 2, +}; + +// Enum to describe QMI Results +enum eQMIResults:UINT16 +{ + eQMIResults_Success = 0, + eQMIResults_Failure = 1, +}; + +// Enum to describe QMI SAR RF States +enum eQMISARRFStates +{ + eQMISARRFStates_DefaultState = 0, + eQMISARRFStates_State1 = 1, + eQMISARRFStates_State2 = 2, + eQMISARRFStates_State3 = 3, + eQMISARRFStates_State4 = 4, + eQMISARRFStates_State5 = 5, + eQMISARRFStates_State6 = 6, + eQMISARRFStates_State7 = 7, + eQMISARRFStates_State8 = 8, +}; + +// Enum to describe QMI SDU Error Ratios +enum eQMISDUErrorRatios:UINT8 +{ + eQMISDUErrorRatios_Subscribe = 0, + eQMISDUErrorRatios_1X102 = 1, + eQMISDUErrorRatios_7X103 = 2, + eQMISDUErrorRatios_1X103 = 3, + eQMISDUErrorRatios_1X104 = 4, + eQMISDUErrorRatios_1X105 = 5, + eQMISDUErrorRatios_1X106 = 6, + eQMISDUErrorRatios_1X101 = 7, +}; + +// Enum to describe QMI SDU Residual Bit Error Ratios +enum eQMISDUResidualBitErrorRatios:UINT8 +{ + eQMISDUResidualBitErrorRatios_Subscribe = 0, + eQMISDUResidualBitErrorRatios_5X102 = 1, + eQMISDUResidualBitErrorRatios_1X102 = 2, + eQMISDUResidualBitErrorRatios_5X103 = 3, + eQMISDUResidualBitErrorRatios_4X103 = 4, + eQMISDUResidualBitErrorRatios_1X103 = 5, + eQMISDUResidualBitErrorRatios_1X104 = 6, + eQMISDUResidualBitErrorRatios_1X105 = 7, + eQMISDUResidualBitErrorRatios_1X106 = 8, + eQMISDUResidualBitErrorRatios_6X108 = 9, +}; + +// Enum to describe QMI Traffic Classes +enum eQMITrafficClasses:UINT8 +{ + eQMITrafficClasses_Subscribed = 0, + eQMITrafficClasses_Conversational = 1, + eQMITrafficClasses_Streaming = 2, + eQMITrafficClasses_Interactive = 3, + eQMITrafficClasses_Background = 4, +}; + +// Enum to describe QMI UIM APDU Response Status +enum eQMIUIMAPDUResponseStatus:UINT8 +{ + eQMIUIMAPDUResponseStatus_ReturnIntermediateProcedureBytes = 0, + eQMIUIMAPDUResponseStatus_ReturnFinalResultAndStatusWords = 1, +}; + +// Enum to describe QMI UIM Application States +enum eQMIUIMApplicationStates:UINT8 +{ + eQMIUIMApplicationStates_Unknown = 0, + eQMIUIMApplicationStates_Detected = 1, + eQMIUIMApplicationStates_PIN1OrUPINIsRequired = 2, + eQMIUIMApplicationStates_PUK1OrPUKForUPINIsRequired = 3, + eQMIUIMApplicationStates_PersonalizationStateMustBeChecked = 4, + eQMIUIMApplicationStates_PIN1IsBlocked = 5, + eQMIUIMApplicationStates_Illegal = 6, + eQMIUIMApplicationStates_Ready = 7, +}; + +// Enum to describe QMI UIM Application Types +enum eQMIUIMApplicationTypes:UINT8 +{ + eQMIUIMApplicationTypes_Unknown = 0, + eQMIUIMApplicationTypes_SIMCard = 1, + eQMIUIMApplicationTypes_USIMApplication = 2, + eQMIUIMApplicationTypes_RUIMCard = 3, + eQMIUIMApplicationTypes_CSIMApplication = 4, + eQMIUIMApplicationTypes_ISIMApplication = 5, +}; + +// Enum to describe QMI UIM Authentication Contexts +enum eQMIUIMAuthenticationContexts +{ + eQMIUIMAuthenticationContexts_GSMAlgorithm = 0, + eQMIUIMAuthenticationContexts_CAVEAlgorithm = 1, + eQMIUIMAuthenticationContexts_GSMSecurity = 2, + eQMIUIMAuthenticationContexts_3GSecurity = 3, + eQMIUIMAuthenticationContexts_VGCSVBSSecurity = 4, + eQMIUIMAuthenticationContexts_GBASecurityBootstrappingMode = 5, + eQMIUIMAuthenticationContexts_GBASecurityNAFDerivationMode = 6, + eQMIUIMAuthenticationContexts_MBMSSecurityMSKUpdateMode = 7, + eQMIUIMAuthenticationContexts_MBMSSecurityMTKGenerationMode = 8, + eQMIUIMAuthenticationContexts_MBMSSecurityMSKDeletionMode = 9, + eQMIUIMAuthenticationContexts_MBMSSecurityMUKDeletionMode = 10, + eQMIUIMAuthenticationContexts_IMSAKASecurity = 11, + eQMIUIMAuthenticationContexts_HTTPDigestSecurity = 12, + eQMIUIMAuthenticationContexts_ComputeIPCHAP = 13, + eQMIUIMAuthenticationContexts_ComputeIPMNHA = 14, + eQMIUIMAuthenticationContexts_ComputeIPMIPRRQ = 15, + eQMIUIMAuthenticationContexts_ComputeIPMNAAA = 16, + eQMIUIMAuthenticationContexts_ComputeIPHRPD = 17, +}; + +// Enum to describe QMI UIM CK/Session Operations +enum eQMIUIMCKSessionOperations:UINT8 +{ + eQMIUIMCKSessionOperations_Deactivate = 0, + eQMIUIMCKSessionOperations_Activate = 1, +}; + +// Enum to describe QMI UIM Card Error Codes +enum eQMIUIMCardErrorCodes:UINT8 +{ + eQMIUIMCardErrorCodes_Unknown = 0, + eQMIUIMCardErrorCodes_PowerDown = 1, + eQMIUIMCardErrorCodes_PollError = 2, + eQMIUIMCardErrorCodes_NoATRReceived = 3, + eQMIUIMCardErrorCodes_VoltMismatch = 4, + eQMIUIMCardErrorCodes_ParityError = 5, + eQMIUIMCardErrorCodes_UnknownPossiblyRemoved = 6, + eQMIUIMCardErrorCodes_TechnicalProblems = 7, +}; + +// Enum to describe QMI UIM Card States +enum eQMIUIMCardStates:UINT8 +{ + eQMIUIMCardStates_Absent = 0, + eQMIUIMCardStates_Present = 1, + eQMIUIMCardStates_Error = 2, +}; + +// Enum to describe QMI UIM Connect Operations +enum eQMIUIMConnectOperations:UINT8 +{ + eQMIUIMConnectOperations_Disconnect = 0, + eQMIUIMConnectOperations_Connect = 1, + eQMIUIMConnectOperations_CheckStatus = 2, +}; + +// Enum to describe QMI UIM Disonnect Modes +enum eQMIUIMDisonnectModes:UINT8 +{ + eQMIUIMDisonnectModes_ImmediateDisconnect = 0, + eQMIUIMDisonnectModes_GracefulShutdown = 1, +}; + +// Enum to describe QMI UIM FDN Status Values +enum eQMIUIMFDNStatusValues:UINT8 +{ + eQMIUIMFDNStatusValues_NotAvailable = 0, + eQMIUIMFDNStatusValues_AvailableButDisabled = 1, + eQMIUIMFDNStatusValues_AvailableAndEnabled = 2, +}; + +// Enum to describe QMI UIM File Control Information +enum eQMIUIMFileControlInformation:UINT8 +{ + eQMIUIMFileControlInformation_NoData = 0, + eQMIUIMFileControlInformation_FCP = 1, + eQMIUIMFileControlInformation_FCI = 2, + eQMIUIMFileControlInformation_FCIWithInterfaces = 3, + eQMIUIMFileControlInformation_FMD = 4, +}; + +// Enum to describe QMI UIM File Types +enum eQMIUIMFileTypes:UINT8 +{ + eQMIUIMFileTypes_Transparent = 0, + eQMIUIMFileTypes_Cyclic = 1, + eQMIUIMFileTypes_LinearFixed = 2, + eQMIUIMFileTypes_DedicatedFile = 3, + eQMIUIMFileTypes_MasterFile = 4, +}; + +// Enum to describe QMI UIM Hidden Key Status Values +enum eQMIUIMHiddenKeyStatusValues:UINT8 +{ + eQMIUIMHiddenKeyStatusValues_NotSupported = 0, + eQMIUIMHiddenKeyStatusValues_EnabledAndNotVerified = 1, + eQMIUIMHiddenKeyStatusValues_EnabledAndVerified = 2, + eQMIUIMHiddenKeyStatusValues_Disabled = 3, +}; + +// Enum to describe QMI UIM Hot-Swap +enum eQMIUIMHotSwap:UINT8 +{ + eQMIUIMHotSwap_HotSwapNotSupported = 0, + eQMIUIMHotSwap_HotSwapIsSupportedButStatusOfSwitchNotSupported = 1, + eQMIUIMHotSwap_SwitchIndicatesThatCardIsPresent = 2, + eQMIUIMHotSwap_SwichIndicatesThatCardIsNotPresent = 3, +}; + +// Enum to describe QMI UIM Key Reference ID +enum eQMIUIMKeyReferenceID:UINT8 +{ + eQMIUIMKeyReferenceID_PINApplication1 = 1, + eQMIUIMKeyReferenceID_PINApplication2 = 2, + eQMIUIMKeyReferenceID_PINApplication3 = 3, + eQMIUIMKeyReferenceID_PINApplication4 = 4, + eQMIUIMKeyReferenceID_PINApplication5 = 5, + eQMIUIMKeyReferenceID_PINApplication6 = 6, + eQMIUIMKeyReferenceID_PINApplication7 = 7, + eQMIUIMKeyReferenceID_PINApplication8 = 8, +}; + +// Enum to describe QMI UIM PIN IDs +enum eQMIUIMPINIDs +{ + eQMIUIMPINIDs_PIN1 = 1, + eQMIUIMPINIDs_PIN2 = 2, + eQMIUIMPINIDs_UniversalPIN = 3, + eQMIUIMPINIDs_HiddenKey = 4, +}; + +// Enum to describe QMI UIM PIN Operations +enum eQMIUIMPINOperations +{ + eQMIUIMPINOperations_Disable = 0, + eQMIUIMPINOperations_Enable = 1, +}; + +// Enum to describe QMI UIM PIN States +enum eQMIUIMPINStates:UINT8 +{ + eQMIUIMPINStates_Unknown = 0, + eQMIUIMPINStates_EnabledAndNotVerified = 1, + eQMIUIMPINStates_EnabledAndVerified = 2, + eQMIUIMPINStates_Disabled = 3, + eQMIUIMPINStates_Blocked = 4, + eQMIUIMPINStates_PermanentlyBlocked = 5, +}; + +// Enum to describe QMI UIM Personalization Features +enum eQMIUIMPersonalizationFeatures:UINT8 +{ + eQMIUIMPersonalizationFeatures_GWNetwork = 0, + eQMIUIMPersonalizationFeatures_GWNetworkSubset = 1, + eQMIUIMPersonalizationFeatures_GWServiceProvider = 2, + eQMIUIMPersonalizationFeatures_GWCorporate = 3, + eQMIUIMPersonalizationFeatures_GWUIM = 4, + eQMIUIMPersonalizationFeatures_1XNetworkType1 = 5, + eQMIUIMPersonalizationFeatures_1XNetworkType2 = 6, + eQMIUIMPersonalizationFeatures_1XHRPD = 7, + eQMIUIMPersonalizationFeatures_1XServiceProvider = 8, + eQMIUIMPersonalizationFeatures_1XCorporate = 9, + eQMIUIMPersonalizationFeatures_1XRUIM = 10, + eQMIUIMPersonalizationFeatures_Unknown = 11, +}; + +// Enum to describe QMI UIM Personalization States +enum eQMIUIMPersonalizationStates:UINT8 +{ + eQMIUIMPersonalizationStates_Unknown = 0, + eQMIUIMPersonalizationStates_PersonalizationOperationIsInProgress = 1, + eQMIUIMPersonalizationStates_Ready = 2, + eQMIUIMPersonalizationStates_PersonalizationCodeIsRequired = 3, + eQMIUIMPersonalizationStates_PUKForPersonalizationCodeIsRequired = 4, + eQMIUIMPersonalizationStates_PermanentlyBlocked = 5, +}; + +// Enum to describe QMI UIM Refresh Modes +enum eQMIUIMRefreshModes:UINT8 +{ + eQMIUIMRefreshModes_Reset = 0, + eQMIUIMRefreshModes_Init = 1, + eQMIUIMRefreshModes_InitAndFCN = 2, + eQMIUIMRefreshModes_FCN = 3, + eQMIUIMRefreshModes_InitAndFullFCN = 4, + eQMIUIMRefreshModes_ApplicationReset = 5, + eQMIUIMRefreshModes_3GSessionReset = 6, +}; + +// Enum to describe QMI UIM Refresh Stages +enum eQMIUIMRefreshStages:UINT8 +{ + eQMIUIMRefreshStages_WaitingForOK = 0, + eQMIUIMRefreshStages_Start = 1, + eQMIUIMRefreshStages_EndWithSuccess = 2, + eQMIUIMRefreshStages_EndWithFailure = 3, +}; + +// Enum to describe QMI UIM Register Flags +enum eQMIUIMRegisterFlags +{ + eQMIUIMRegisterFlags_Deregister = 0, + eQMIUIMRegisterFlags_Register = 1, +}; + +// Enum to describe QMI UIM SAP Requests +enum eQMIUIMSAPRequests:UINT8 +{ + eQMIUIMSAPRequests_RetrieveATR = 0, + eQMIUIMSAPRequests_SendAPDU = 1, + eQMIUIMSAPRequests_PowerOffSIM = 2, + eQMIUIMSAPRequests_PowerOnSIM = 3, + eQMIUIMSAPRequests_ResetSIM = 4, + eQMIUIMSAPRequests_RetrieveCardReaderStatus = 5, +}; + +// Enum to describe QMI UIM SAP States +enum eQMIUIMSAPStates:UINT8 +{ + eQMIUIMSAPStates_NotEnabled = 0, + eQMIUIMSAPStates_Connecting = 1, + eQMIUIMSAPStates_ConnectedSuccessfully = 2, + eQMIUIMSAPStates_ConnectionError = 3, + eQMIUIMSAPStates_Disconnecting = 4, + eQMIUIMSAPStates_DisconnectedSuccessfully = 5, +}; + +// Enum to describe QMI UIM Security Attributes +enum eQMIUIMSecurityAttributes:UINT8 +{ + eQMIUIMSecurityAttributes_Always = 0, + eQMIUIMSecurityAttributes_Never = 1, + eQMIUIMSecurityAttributes_ANDCondition = 2, + eQMIUIMSecurityAttributes_ORCondition = 3, + eQMIUIMSecurityAttributes_SingleCondition = 4, +}; + +// Enum to describe QMI UIM Session Types +enum eQMIUIMSessionTypes:UINT8 +{ + eQMIUIMSessionTypes_PrimaryGWProvisioning = 0, + eQMIUIMSessionTypes_Primary1XProvisioning = 1, + eQMIUIMSessionTypes_SecondaryGWProvisioning = 2, + eQMIUIMSessionTypes_Secondary1XProvisioning = 3, + eQMIUIMSessionTypes_NonprovisioningOnSlot1 = 4, + eQMIUIMSessionTypes_NonprovisioningOnSlot2 = 5, + eQMIUIMSessionTypes_CardOnSlot1 = 6, + eQMIUIMSessionTypes_CardOnSlot2 = 7, + eQMIUIMSessionTypes_LogicalChannelOnSlot1 = 8, + eQMIUIMSessionTypes_LogicalChannelOnSlot2 = 9, +}; + +// Enum to describe QMI UIM Slots +enum eQMIUIMSlots:UINT8 +{ + eQMIUIMSlots_Slot1 = 1, + eQMIUIMSlots_Slot2 = 2, +}; + +// Enum to describe QMI Voice ALS Line Indicators +enum eQMIVoiceALSLineIndicators:UINT8 +{ + eQMIVoiceALSLineIndicators_Line1 = 0, + eQMIVoiceALSLineIndicators_Line2 = 1, +}; + +// Enum to describe QMI Voice ALS Lines +enum eQMIVoiceALSLines:UINT8 +{ + eQMIVoiceALSLines_Line1 = 0, + eQMIVoiceALSLines_Line2 = 1, +}; + +// Enum to describe QMI Voice Alerting Patterns +enum eQMIVoiceAlertingPatterns:UINT32 +{ + eQMIVoiceAlertingPatterns_Pattern1 = 0, + eQMIVoiceAlertingPatterns_Pattern2 = 1, + eQMIVoiceAlertingPatterns_Pattern3 = 2, + eQMIVoiceAlertingPatterns_Pattern4 = 3, + eQMIVoiceAlertingPatterns_Pattern5 = 4, + eQMIVoiceAlertingPatterns_Pattern6 = 5, + eQMIVoiceAlertingPatterns_Pattern7 = 6, + eQMIVoiceAlertingPatterns_Pattern8 = 7, + eQMIVoiceAlertingPatterns_Pattern9 = 8, +}; + +// Enum to describe QMI Voice Alerting Types +enum eQMIVoiceAlertingTypes:UINT8 +{ + eQMIVoiceAlertingTypes_Local = 0, + eQMIVoiceAlertingTypes_Remote = 1, +}; + +// Enum to describe QMI Voice CLIR Causes +enum eQMIVoiceCLIRCauses:UINT8 +{ + eQMIVoiceCLIRCauses_None = 0, + eQMIVoiceCLIRCauses_RejectedByUser = 1, + eQMIVoiceCLIRCauses_InteractionWithOtherServices = 2, + eQMIVoiceCLIRCauses_CoinLine = 3, + eQMIVoiceCLIRCauses_ServiceUnavailable = 4, + eQMIVoiceCLIRCauses_Reserved = 5, +}; + +// Enum to describe QMI Voice CLIR Types +enum eQMIVoiceCLIRTypes:UINT8 +{ + eQMIVoiceCLIRTypes_Supression = 1, + eQMIVoiceCLIRTypes_Invocation = 2, +}; + +// Enum to describe QMI Voice Call Control Result Types +enum eQMIVoiceCallControlResultTypes:UINT8 +{ + eQMIVoiceCallControlResultTypes_Voice = 0, + eQMIVoiceCallControlResultTypes_SupplementaryService = 1, + eQMIVoiceCallControlResultTypes_USSD = 2, +}; + +// Enum to describe QMI Voice Call Directions +enum eQMIVoiceCallDirections:UINT8 +{ + eQMIVoiceCallDirections_MobileOriginated = 1, + eQMIVoiceCallDirections_MobileTerminated = 2, +}; + +// Enum to describe QMI Voice Call Modes +enum eQMIVoiceCallModes:UINT8 +{ + eQMIVoiceCallModes_CDMA = 1, + eQMIVoiceCallModes_GSM = 2, + eQMIVoiceCallModes_UMTS = 3, + eQMIVoiceCallModes_LTE = 4, + eQMIVoiceCallModes_TDSCDMA = 5, +}; + +// Enum to describe QMI Voice Call States +enum eQMIVoiceCallStates:UINT8 +{ + eQMIVoiceCallStates_Origination = 1, + eQMIVoiceCallStates_Incoming = 2, + eQMIVoiceCallStates_Conversation = 3, + eQMIVoiceCallStates_InProgress = 4, + eQMIVoiceCallStates_Alerting = 5, + eQMIVoiceCallStates_Hold = 6, + eQMIVoiceCallStates_Waiting = 7, + eQMIVoiceCallStates_Disconnecting = 8, + eQMIVoiceCallStates_End = 9, + eQMIVoiceCallStates_Setup = 10, +}; + +// Enum to describe QMI Voice Call Types +enum eQMIVoiceCallTypes:UINT8 +{ + eQMIVoiceCallTypes_VoiceAutomaticSelection = 0, + eQMIVoiceCallTypes_Forced = 1, + eQMIVoiceCallTypes_VoiceOverIP = 2, + eQMIVoiceCallTypes_OTAPA = 6, + eQMIVoiceCallTypes_StandardOTASP = 7, + eQMIVoiceCallTypes_NonStandardOTASP = 8, + eQMIVoiceCallTypes_Emergency = 9, + eQMIVoiceCallTypes_SupplementaryService = 10, +}; + +// Enum to describe QMI Voice DTMF Events +enum eQMIVoiceDTMFEvents:UINT8 +{ + eQMIVoiceDTMFEvents_SendDTMFBurst = 0, + eQMIVoiceDTMFEvents_StartSendingContinuousDTMFTone = 1, + eQMIVoiceDTMFEvents_StopSendingContinuousDTMFTone = 3, + eQMIVoiceDTMFEvents_ReceiveDTMFBurst = 4, + eQMIVoiceDTMFEvents_StartReceivingContinuousDTMFTone = 6, + eQMIVoiceDTMFEvents_StopReceivingContinuousDTMFTone = 7, +}; + +// Enum to describe QMI Voice DTMF Privacy Levels +enum eQMIVoiceDTMFPrivacyLevels:UINT8 +{ + eQMIVoiceDTMFPrivacyLevels_Standard = 0, + eQMIVoiceDTMFPrivacyLevels_Enhanced = 1, +}; + +// Enum to describe QMI Voice Domains +enum eQMIVoiceDomains:UINT8 +{ + eQMIVoiceDomains_CSOnly = 0, + eQMIVoiceDomains_PSOnly = 1, + eQMIVoiceDomains_CSThenPS = 2, + eQMIVoiceDomains_PSThenCS = 3, +}; + +// Enum to describe QMI Voice ECT Call States +enum eQMIVoiceECTCallStates:UINT8 +{ + eQMIVoiceECTCallStates_None = 0, + eQMIVoiceECTCallStates_Alerting = 1, + eQMIVoiceECTCallStates_Active = 2, +}; + +// Enum to describe QMI Voice Even Odd Indicators +enum eQMIVoiceEvenOddIndicators:UINT8 +{ + eQMIVoiceEvenOddIndicators_EvenNumber = 0, + eQMIVoiceEvenOddIndicators_OddNumber = 1, +}; + +// Enum to describe QMI Voice Flash Types +enum eQMIVoiceFlashTypes:UINT8 +{ + eQMIVoiceFlashTypes_Simple = 0, + eQMIVoiceFlashTypes_ActivateAnswerHold = 1, + eQMIVoiceFlashTypes_DeactivateAnswerHold = 2, +}; + +// Enum to describe QMI Voice Interdigit Intervals +enum eQMIVoiceInterdigitIntervals:UINT8 +{ + eQMIVoiceInterdigitIntervals_60ms = 0, + eQMIVoiceInterdigitIntervals_100ms = 1, + eQMIVoiceInterdigitIntervals_150ms = 2, + eQMIVoiceInterdigitIntervals_200ms = 3, +}; + +// Enum to describe QMI Voice NSS Releases +enum eQMIVoiceNSSReleases:UINT8 +{ + eQMIVoiceNSSReleases_Finished = 1, +}; + +// Enum to describe QMI Voice Number Plans +enum eQMIVoiceNumberPlans:UINT8 +{ + eQMIVoiceNumberPlans_Unknown = 0, + eQMIVoiceNumberPlans_ISDN = 1, + eQMIVoiceNumberPlans_Data = 3, + eQMIVoiceNumberPlans_Telex = 4, + eQMIVoiceNumberPlans_National = 8, + eQMIVoiceNumberPlans_Private = 9, + eQMIVoiceNumberPlans_ReservedCTS = 11, + eQMIVoiceNumberPlans_ReservedExtension = 15, +}; + +// Enum to describe QMI Voice Number Types +enum eQMIVoiceNumberTypes:UINT8 +{ + eQMIVoiceNumberTypes_Unknown = 0, + eQMIVoiceNumberTypes_International = 1, + eQMIVoiceNumberTypes_National = 2, + eQMIVoiceNumberTypes_NetworkSpecific = 3, + eQMIVoiceNumberTypes_Subscriber = 4, + eQMIVoiceNumberTypes_Reserved = 5, + eQMIVoiceNumberTypes_Abbreviated = 6, + eQMIVoiceNumberTypes_ReservedExtension = 7, +}; + +// Enum to describe QMI Voice OTASP Stati +enum eQMIVoiceOTASPStati:UINT8 +{ + eQMIVoiceOTASPStati_Unlocked = 0, + eQMIVoiceOTASPStati_RetriesExceeded = 1, + eQMIVoiceOTASPStati_AKeyExchanged = 2, + eQMIVoiceOTASPStati_SSDUpdated = 3, + eQMIVoiceOTASPStati_NAMDownloaded = 4, + eQMIVoiceOTASPStati_MDNDownloaded = 5, + eQMIVoiceOTASPStati_IMSIDownloaded = 6, + eQMIVoiceOTASPStati_PRLDownloaded = 7, + eQMIVoiceOTASPStati_Committed = 8, + eQMIVoiceOTASPStati_OTAPAStarted = 9, + eQMIVoiceOTASPStati_OTAPAStopped = 10, + eQMIVoiceOTASPStati_OTAPAAborted = 11, + eQMIVoiceOTASPStati_OTAPACommitted = 12, +}; + +// Enum to describe QMI Voice Presentation Indicators +enum eQMIVoicePresentationIndicators:UINT8 +{ + eQMIVoicePresentationIndicators_Allowed = 0, + eQMIVoicePresentationIndicators_Restricted = 1, + eQMIVoicePresentationIndicators_Unavailable = 2, + eQMIVoicePresentationIndicators_NameRestricted = 3, + eQMIVoicePresentationIndicators_PayPhone = 4, +}; + +// Enum to describe QMI Voice Privacy Levels +enum eQMIVoicePrivacyLevels:UINT8 +{ + eQMIVoicePrivacyLevels_Standard = 0, + eQMIVoicePrivacyLevels_Enhanced = 1, +}; + +// Enum to describe QMI Voice Provisioning States +enum eQMIVoiceProvisioningStates:UINT8 +{ + eQMIVoiceProvisioningStates_NotProvisioned = 0, + eQMIVoiceProvisioningStates_ProvisionedPermanent = 1, + eQMIVoiceProvisioningStates_PresentationRestricted = 2, + eQMIVoiceProvisioningStates_PresentationAllowed = 3, +}; + +// Enum to describe QMI Voice Pulse Widths +enum eQMIVoicePulseWidths:UINT8 +{ + eQMIVoicePulseWidths_95ms = 0, + eQMIVoicePulseWidths_150ms = 1, + eQMIVoicePulseWidths_200ms = 2, + eQMIVoicePulseWidths_250ms = 3, + eQMIVoicePulseWidths_300ms = 4, + eQMIVoicePulseWidths_350ms = 5, + eQMIVoicePulseWidths_SMSTXSpecial = 6, +}; + +// Enum to describe QMI Voice Screening Indicators +enum eQMIVoiceScreeningIndicators:UINT8 +{ + eQMIVoiceScreeningIndicators_UserNotScreened = 0, + eQMIVoiceScreeningIndicators_UserPassedVerification = 1, + eQMIVoiceScreeningIndicators_UserFailedVerification = 2, + eQMIVoiceScreeningIndicators_ProvidedNetwork = 3, +}; + +// Enum to describe QMI Voice Service Options +enum eQMIVoiceServiceOptions:UINT16 +{ + eQMIVoiceServiceOptions_Any = 0, + eQMIVoiceServiceOptions_IS96A = 1, + eQMIVoiceServiceOptions_EVRC = 3, + eQMIVoiceServiceOptions_IS73313K = 17, + eQMIVoiceServiceOptions_SelectableModeVocoder = 56, + eQMIVoiceServiceOptions_4GVNarrowBand = 68, + eQMIVoiceServiceOptions_4GVWideBand = 70, + eQMIVoiceServiceOptions_13K = 32768, + eQMIVoiceServiceOptions_IS96 = 32769, + eQMIVoiceServiceOptions_WVRC = 32803, +}; + +// Enum to describe QMI Voice Service Types +enum eQMIVoiceServiceTypes:UINT32 +{ + eQMIVoiceServiceTypes_Automatic = 1, + eQMIVoiceServiceTypes_GSM = 2, + eQMIVoiceServiceTypes_WCDMA = 3, + eQMIVoiceServiceTypes_CDMAAutomatic = 4, + eQMIVoiceServiceTypes_GSMOrWCDMA = 5, + eQMIVoiceServiceTypes_LTE = 6, +}; + +// Enum to describe QMI Voice Subaddress Types +enum eQMIVoiceSubaddressTypes:UINT8 +{ + eQMIVoiceSubaddressTypes_NSAP = 0, + eQMIVoiceSubaddressTypes_User = 1, +}; + +// Enum to describe QMI Voice Subscription Types +enum eQMIVoiceSubscriptionTypes:UINT8 +{ + eQMIVoiceSubscriptionTypes_Primary = 0, + eQMIVoiceSubscriptionTypes_Secondary = 1, +}; + +// Enum to describe QMI Voice Supplementary Notification Types +enum eQMIVoiceSupplementaryNotificationTypes:UINT8 +{ + eQMIVoiceSupplementaryNotificationTypes_OutgoingCallIsForwarded = 1, + eQMIVoiceSupplementaryNotificationTypes_OutgoingCallIsWaiting = 2, + eQMIVoiceSupplementaryNotificationTypes_OutgoingCUGCall = 3, + eQMIVoiceSupplementaryNotificationTypes_OutgoingCallsBarred = 4, + eQMIVoiceSupplementaryNotificationTypes_OutgoingCallIsDeflected = 5, + eQMIVoiceSupplementaryNotificationTypes_IncomingCUGCall = 6, + eQMIVoiceSupplementaryNotificationTypes_IncomingCallsBarred = 7, + eQMIVoiceSupplementaryNotificationTypes_IncomingForwardedCall = 8, + eQMIVoiceSupplementaryNotificationTypes_IncomingDeflectedCall = 9, + eQMIVoiceSupplementaryNotificationTypes_IncomingCallIsForwarded = 10, + eQMIVoiceSupplementaryNotificationTypes_UnconditionalCallForwardingActive = 11, + eQMIVoiceSupplementaryNotificationTypes_ConditionalCallForwardingActive = 12, + eQMIVoiceSupplementaryNotificationTypes_CLIRSuppressionRejected = 13, + eQMIVoiceSupplementaryNotificationTypes_CallIsOnHold = 14, + eQMIVoiceSupplementaryNotificationTypes_CallIsRetrieved = 15, + eQMIVoiceSupplementaryNotificationTypes_CallIsInConference = 16, + eQMIVoiceSupplementaryNotificationTypes_CallIsECTWhileAnotherCallIsAlerting = 17, + eQMIVoiceSupplementaryNotificationTypes_CallIsECTWhileAnotherCallIsActive = 18, +}; + +// Enum to describe QMI Voice Supplementary Service Call Types +enum eQMIVoiceSupplementaryServiceCallTypes:UINT8 +{ + eQMIVoiceSupplementaryServiceCallTypes_ReleaseHeldOrWaiting = 1, + eQMIVoiceSupplementaryServiceCallTypes_ReleaseActiveAcceptHeldOrWaiting = 2, + eQMIVoiceSupplementaryServiceCallTypes_HoldActiveAcceptHeldOrWaiting = 3, + eQMIVoiceSupplementaryServiceCallTypes_HoldAllExceptSpecifiedCall = 4, + eQMIVoiceSupplementaryServiceCallTypes_MakeConferenceCall = 5, + eQMIVoiceSupplementaryServiceCallTypes_ExplicitCallTransfer = 6, + eQMIVoiceSupplementaryServiceCallTypes_CCBSActivation = 7, + eQMIVoiceSupplementaryServiceCallTypes_EndAllCalls = 8, + eQMIVoiceSupplementaryServiceCallTypes_ReleaseSpecifiedCall = 9, +}; + +// Enum to describe QMI Voice Supplementary Service Reasons +enum eQMIVoiceSupplementaryServiceReasons:UINT8 +{ + eQMIVoiceSupplementaryServiceReasons_ForwardUnconditional = 1, + eQMIVoiceSupplementaryServiceReasons_ForwardMobileBusy = 2, + eQMIVoiceSupplementaryServiceReasons_ForwardNoReply = 3, + eQMIVoiceSupplementaryServiceReasons_ForwardUnreachable = 4, + eQMIVoiceSupplementaryServiceReasons_ForwardAllForwarding = 5, + eQMIVoiceSupplementaryServiceReasons_ForwardAllConditional = 6, + eQMIVoiceSupplementaryServiceReasons_BarrAllOutgoing = 7, + eQMIVoiceSupplementaryServiceReasons_BarrOutgoingInt = 8, + eQMIVoiceSupplementaryServiceReasons_BarrOutgoingIntExtToHome = 9, + eQMIVoiceSupplementaryServiceReasons_BarrAllIncoming = 10, + eQMIVoiceSupplementaryServiceReasons_BarrIncomingRoaming = 11, + eQMIVoiceSupplementaryServiceReasons_BarrAllBarring = 12, + eQMIVoiceSupplementaryServiceReasons_BarrAllOutgoingBarring = 13, + eQMIVoiceSupplementaryServiceReasons_BarrAllIncomingBarring = 14, + eQMIVoiceSupplementaryServiceReasons_CallWaiting = 15, + eQMIVoiceSupplementaryServiceReasons_CLIR = 16, + eQMIVoiceSupplementaryServiceReasons_CLIP = 17, +}; + +// Enum to describe QMI Voice Supplementary Service Requests +enum eQMIVoiceSupplementaryServiceRequests:UINT8 +{ + eQMIVoiceSupplementaryServiceRequests_Activate = 1, + eQMIVoiceSupplementaryServiceRequests_Deactivate = 2, + eQMIVoiceSupplementaryServiceRequests_Register = 3, + eQMIVoiceSupplementaryServiceRequests_Erase = 4, + eQMIVoiceSupplementaryServiceRequests_Interrogate = 5, + eQMIVoiceSupplementaryServiceRequests_RegisterPassword = 6, + eQMIVoiceSupplementaryServiceRequests_USSD = 7, +}; + +// Enum to describe QMI Voice Supplementary Service Types +enum eQMIVoiceSupplementaryServiceTypes:UINT8 +{ + eQMIVoiceSupplementaryServiceTypes_Activate = 0, + eQMIVoiceSupplementaryServiceTypes_Deactivate = 1, + eQMIVoiceSupplementaryServiceTypes_Register = 2, + eQMIVoiceSupplementaryServiceTypes_Erase = 3, +}; + +// Enum to describe QMI Voice TTY Modes +enum eQMIVoiceTTYModes:UINT8 +{ + eQMIVoiceTTYModes_Full = 0, + eQMIVoiceTTYModes_VoiceCarryOver = 1, + eQMIVoiceTTYModes_HearingCarryOver = 2, + eQMIVoiceTTYModes_Off = 3, +}; + +// Enum to describe QMI Voice USSD Alpha Coding Schemes +enum eQMIVoiceUSSDAlphaCodingSchemes:UINT8 +{ + eQMIVoiceUSSDAlphaCodingSchemes_GSM = 1, + eQMIVoiceUSSDAlphaCodingSchemes_UCS2 = 2, +}; + +// Enum to describe QMI Voice USSD Data Coding Schemes +enum eQMIVoiceUSSDDataCodingSchemes:UINT8 +{ + eQMIVoiceUSSDDataCodingSchemes_ASCII = 1, + eQMIVoiceUSSDDataCodingSchemes_8Bit = 2, + eQMIVoiceUSSDDataCodingSchemes_UCS2 = 3, +}; + +// Enum to describe QMI Voice USSD Notifcation Types +enum eQMIVoiceUSSDNotifcationTypes:UINT8 +{ + eQMIVoiceUSSDNotifcationTypes_NoActionRequired = 1, + eQMIVoiceUSSDNotifcationTypes_ActionIsRequired = 2, +}; + +// Enum to describe QMI Voice UUS Data Coding Schemes +enum eQMIVoiceUUSDataCodingSchemes:UINT8 +{ + eQMIVoiceUUSDataCodingSchemes_USP = 1, + eQMIVoiceUUSDataCodingSchemes_OHLP = 2, + eQMIVoiceUUSDataCodingSchemes_X244 = 3, + eQMIVoiceUUSDataCodingSchemes_SMCF = 4, + eQMIVoiceUUSDataCodingSchemes_IA5 = 5, + eQMIVoiceUUSDataCodingSchemes_RV12RD = 6, + eQMIVoiceUUSDataCodingSchemes_Q931UNCCM = 7, +}; + +// Enum to describe QMI Voice UUS Types +enum eQMIVoiceUUSTypes:UINT8 +{ + eQMIVoiceUUSTypes_Data = 0, + eQMIVoiceUUSTypes_Type1Implicit = 1, + eQMIVoiceUUSTypes_Type1Required = 2, + eQMIVoiceUUSTypes_Type1NotRequired = 3, + eQMIVoiceUUSTypes_Type2Required = 4, + eQMIVoiceUUSTypes_Type2NotRequired = 5, + eQMIVoiceUUSTypes_Type3Required = 6, + eQMIVoiceUUSTypes_Type3NotRequired = 7, +}; + +// Enum to describe QMI Voice VoIP SUPS Call Types +enum eQMIVoiceVoIPSUPSCallTypes:UINT8 +{ + eQMIVoiceVoIPSUPSCallTypes_ReleaseHeldOrWaiting = 1, + eQMIVoiceVoIPSUPSCallTypes_ReleaseActiveAcceptHeldOrWaiting = 2, + eQMIVoiceVoIPSUPSCallTypes_HoldActiveAcceptHeldOrWaiting = 3, + eQMIVoiceVoIPSUPSCallTypes_MakeConferenceCall = 4, + eQMIVoiceVoIPSUPSCallTypes_EndAllExistingCalls = 5, +}; + +// Enum to describe QMI WDS 3GPP Call End Reasons +enum eQMIWDS3GPPCallEndReasons:UINT16 +{ + eQMIWDS3GPPCallEndReasons_OperatorDeterminedBarring = 8, + eQMIWDS3GPPCallEndReasons_LLCSNDCPFailure = 25, + eQMIWDS3GPPCallEndReasons_InsufficientResources = 26, + eQMIWDS3GPPCallEndReasons_UnknownAPN = 27, + eQMIWDS3GPPCallEndReasons_UnknownPDP = 28, + eQMIWDS3GPPCallEndReasons_AuthenticationFailed = 29, + eQMIWDS3GPPCallEndReasons_GGSNReject = 30, + eQMIWDS3GPPCallEndReasons_ActivationReject = 31, + eQMIWDS3GPPCallEndReasons_OptionNotSupported = 32, + eQMIWDS3GPPCallEndReasons_OptionUnsubscribed = 33, + eQMIWDS3GPPCallEndReasons_OptionTemporarilyOOO = 34, + eQMIWDS3GPPCallEndReasons_NSAPIAlreadyUsed = 35, + eQMIWDS3GPPCallEndReasons_RegularDeactivation = 36, + eQMIWDS3GPPCallEndReasons_QoSNotAccepted = 37, + eQMIWDS3GPPCallEndReasons_NetworkFailure = 38, + eQMIWDS3GPPCallEndReasons_UMTSReactivationRequest = 39, + eQMIWDS3GPPCallEndReasons_FeatureNotSupported = 40, + eQMIWDS3GPPCallEndReasons_TFTSemanticError = 41, + eQMIWDS3GPPCallEndReasons_TFTSyntaxError = 42, + eQMIWDS3GPPCallEndReasons_UnknownPDPContext = 43, + eQMIWDS3GPPCallEndReasons_FilterSemanticError = 44, + eQMIWDS3GPPCallEndReasons_FilterSyntaxError = 45, + eQMIWDS3GPPCallEndReasons_PDPWithoutActiveTFT = 46, + eQMIWDS3GPPCallEndReasons_IPv4OnlyAllowed = 50, + eQMIWDS3GPPCallEndReasons_IPv6OnlyAllowed = 51, + eQMIWDS3GPPCallEndReasons_SingleAddressBearerOnly = 52, + eQMIWDS3GPPCallEndReasons_ESMInfoNotReceived = 53, + eQMIWDS3GPPCallEndReasons_NoPDNConnection = 54, + eQMIWDS3GPPCallEndReasons_MultipleConnectionsNotAllowed = 55, + eQMIWDS3GPPCallEndReasons_InvalidTransactionID = 81, + eQMIWDS3GPPCallEndReasons_MessageIncorrectSemantic = 95, + eQMIWDS3GPPCallEndReasons_InvalidMandatoryID = 96, + eQMIWDS3GPPCallEndReasons_MessageTypeUnsupported = 97, + eQMIWDS3GPPCallEndReasons_MessageTypeNoncompatibleState = 98, + eQMIWDS3GPPCallEndReasons_UnknownInfoElement = 99, + eQMIWDS3GPPCallEndReasons_ConditionalInfoElementError = 100, + eQMIWDS3GPPCallEndReasons_MessageAndProtocolStateUncompatible = 101, + eQMIWDS3GPPCallEndReasons_ProtocolError = 111, + eQMIWDS3GPPCallEndReasons_APNTypeConflict = 112, +}; + +// Enum to describe QMI WDS 3GPP2 RAT Types +enum eQMIWDS3GPP2RATTypes:UINT8 +{ + eQMIWDS3GPP2RATTypes_HRPD = 1, + eQMIWDS3GPP2RATTypes_EHRPD = 2, + eQMIWDS3GPP2RATTypes_HRPDEHRPD = 3, +}; + +// Enum to describe QMI WDS Address Allocation Preference +enum eQMIWDSAddressAllocationPreference:UINT8 +{ + eQMIWDSAddressAllocationPreference_NASSignaling = 0, + eQMIWDSAddressAllocationPreference_DHCP = 1, +}; + +// Enum to describe QMI WDS Application Type +enum eQMIWDSApplicationType:UINT32 +{ + eQMIWDSApplicationType_DefaultApplicationType = 0, + eQMIWDSApplicationType_LBSApplicationType = 32, + eQMIWDSApplicationType_TetheredApplicationType = 64, +}; + +// Enum to describe QMI WDS Authentication Protocol +enum eQMIWDSAuthenticationProtocol:UINT8 +{ + eQMIWDSAuthenticationProtocol_PAP = 1, + eQMIWDSAuthenticationProtocol_CHAP = 2, + eQMIWDSAuthenticationProtocol_PAPOrCHAP = 3, +}; + +// Enum to describe QMI WDS Autoconnect Roam Settings +enum eQMIWDSAutoconnectRoamSettings:UINT8 +{ + eQMIWDSAutoconnectRoamSettings_Always = 0, + eQMIWDSAutoconnectRoamSettings_HomeOnly = 1, +}; + +// Enum to describe QMI WDS Autoconnect Settings +enum eQMIWDSAutoconnectSettings:UINT8 +{ + eQMIWDSAutoconnectSettings_Disabled = 0, + eQMIWDSAutoconnectSettings_Enabled = 1, + eQMIWDSAutoconnectSettings_Paused = 2, +}; + +// Enum to describe QMI WDS CDMA Networks +enum eQMIWDSCDMANetworks:UINT8 +{ + eQMIWDSCDMANetworks_NoService = 0, + eQMIWDSCDMANetworks_CDMA = 2, + eQMIWDSCDMANetworks_CDMA1xEVDO = 4, +}; + +// Enum to describe QMI WDS CDMA Service Options +enum eQMIWDSCDMAServiceOptions:UINT16 +{ + eQMIWDSCDMAServiceOptions_IS657 = 7, + eQMIWDSCDMAServiceOptions_IS657OverRateSet2 = 15, + eQMIWDSCDMAServiceOptions_IS707AWithRateSet1 = 22, + eQMIWDSCDMAServiceOptions_IS707AWithRateSet2 = 25, + eQMIWDSCDMAServiceOptions_CDMA2000PacketService = 33, + eQMIWDSCDMAServiceOptions_IS707 = 4103, + eQMIWDSCDMAServiceOptions_QCProprietaryRateSet2 = 32800, + eQMIWDSCDMAServiceOptions_NullServiceOption = 65535, +}; + +// Enum to describe QMI WDS Call End Reason Types +enum eQMIWDSCallEndReasonTypes:UINT16 +{ + eQMIWDSCallEndReasonTypes_Unspecified = 0, + eQMIWDSCallEndReasonTypes_MobileIP = 1, + eQMIWDSCallEndReasonTypes_Internal = 2, + eQMIWDSCallEndReasonTypes_CallManagerDefined = 3, + eQMIWDSCallEndReasonTypes_3GPPSpecificationDefined = 6, + eQMIWDSCallEndReasonTypes_PPP = 7, + eQMIWDSCallEndReasonTypes_EHRPD = 8, + eQMIWDSCallEndReasonTypes_IPv6 = 9, +}; + +// Enum to describe QMI WDS Call Manager Call End Reasons +enum eQMIWDSCallManagerCallEndReasons:UINT16 +{ + eQMIWDSCallManagerCallEndReasons_CDMALock = 500, + eQMIWDSCallManagerCallEndReasons_Intercept = 501, + eQMIWDSCallManagerCallEndReasons_Reorder = 502, + eQMIWDSCallManagerCallEndReasons_ReleaseServiceOptionReject = 503, + eQMIWDSCallManagerCallEndReasons_IncomingCall = 504, + eQMIWDSCallManagerCallEndReasons_AlertStop = 505, + eQMIWDSCallManagerCallEndReasons_Activation = 506, + eQMIWDSCallManagerCallEndReasons_MaxAccessProbe = 507, + eQMIWDSCallManagerCallEndReasons_CCSNotSupportedByBS = 508, + eQMIWDSCallManagerCallEndReasons_NoResponseFromBS = 509, + eQMIWDSCallManagerCallEndReasons_RejectedByBS = 510, + eQMIWDSCallManagerCallEndReasons_Incompatible = 511, + eQMIWDSCallManagerCallEndReasons_AlreadyInTC = 512, + eQMIWDSCallManagerCallEndReasons_UserCallOrigDuringGPS = 513, + eQMIWDSCallManagerCallEndReasons_UserCallOrigDuringSMS = 514, + eQMIWDSCallManagerCallEndReasons_NoCDMAService = 515, + eQMIWDSCallManagerCallEndReasons_RetryOrder = 519, + eQMIWDSCallManagerCallEndReasons_AccessBlock = 520, + eQMIWDSCallManagerCallEndReasons_AccessBlockAll = 521, + eQMIWDSCallManagerCallEndReasons_IS707BMaxAccess = 522, + eQMIWDSCallManagerCallEndReasons_ThermalEmergency = 523, + eQMIWDSCallManagerCallEndReasons_CallOriginationThrottled = 524, + eQMIWDSCallManagerCallEndReasons_ConfFailed = 1000, + eQMIWDSCallManagerCallEndReasons_IncomingRejected = 1001, + eQMIWDSCallManagerCallEndReasons_NoGWService = 1002, + eQMIWDSCallManagerCallEndReasons_NoGPRSContext = 1003, + eQMIWDSCallManagerCallEndReasons_IllegalMS = 1004, + eQMIWDSCallManagerCallEndReasons_IllegalME = 1005, + eQMIWDSCallManagerCallEndReasons_GPRSServicesAndNonGPRSServiceNotAllowed = 1006, + eQMIWDSCallManagerCallEndReasons_GPRSServicesNotAllowed = 1007, + eQMIWDSCallManagerCallEndReasons_MSIdentityCannotBeDerivedByTheNetwork = 1008, + eQMIWDSCallManagerCallEndReasons_ImplicitlyDetached = 1009, + eQMIWDSCallManagerCallEndReasons_PLMNNotAllowed = 1010, + eQMIWDSCallManagerCallEndReasons_LANotAllowed = 1011, + eQMIWDSCallManagerCallEndReasons_GPRSServicesNotAllowedInThisPLMN = 1012, + eQMIWDSCallManagerCallEndReasons_PDPDuplicate = 1013, + eQMIWDSCallManagerCallEndReasons_UERATChange = 1014, + eQMIWDSCallManagerCallEndReasons_Congestion = 1015, + eQMIWDSCallManagerCallEndReasons_NoPDPContextActivated = 1016, + eQMIWDSCallManagerCallEndReasons_AccessClassDSACRejection = 1017, + eQMIWDSCallManagerCallEndReasons_CDGenOrBusy = 1500, + eQMIWDSCallManagerCallEndReasons_CDBillOrAuth = 1501, + eQMIWDSCallManagerCallEndReasons_ChangeHDR = 1502, + eQMIWDSCallManagerCallEndReasons_ExitHDR = 1503, + eQMIWDSCallManagerCallEndReasons_HDRNoSession = 1504, + eQMIWDSCallManagerCallEndReasons_HDROrigDuringGPSFix = 1505, + eQMIWDSCallManagerCallEndReasons_HDRCSTimeout = 1506, + eQMIWDSCallManagerCallEndReasons_HDRReleasedByCM = 1507, + eQMIWDSCallManagerCallEndReasons_NoHybridHDRService = 1510, + eQMIWDSCallManagerCallEndReasons_ClientEnd = 2000, + eQMIWDSCallManagerCallEndReasons_NoService = 2001, + eQMIWDSCallManagerCallEndReasons_Fade = 2002, + eQMIWDSCallManagerCallEndReasons_NormalRelease = 2003, + eQMIWDSCallManagerCallEndReasons_AccessInProgress = 2004, + eQMIWDSCallManagerCallEndReasons_AccessFail = 2005, + eQMIWDSCallManagerCallEndReasons_RedirectOrHandoff = 2006, + eQMIWDSCallManagerCallEndReasons_Offline = 2500, + eQMIWDSCallManagerCallEndReasons_EmergencyMode = 2501, + eQMIWDSCallManagerCallEndReasons_PhoneInUse = 2502, + eQMIWDSCallManagerCallEndReasons_InvalidMode = 2503, + eQMIWDSCallManagerCallEndReasons_InvalidSIMState = 2504, + eQMIWDSCallManagerCallEndReasons_NoCollocHDR = 2505, + eQMIWDSCallManagerCallEndReasons_CallControlRejected = 2506, +}; + +// Enum to describe QMI WDS Call Types +enum eQMIWDSCallTypes:UINT8 +{ + eQMIWDSCallTypes_Laptop = 0, + eQMIWDSCallTypes_Embedded = 1, +}; + +// Enum to describe QMI WDS DUN Control Events +enum eQMIWDSDUNControlEvents:UINT8 +{ + eQMIWDSDUNControlEvents_DUNCall = 1, + eQMIWDSDUNControlEvents_Entitlement = 2, + eQMIWDSDUNControlEvents_SilentRedial = 3, +}; + +// Enum to describe QMI WDS DUN Control Preferences +enum eQMIWDSDUNControlPreferences:UINT8 +{ + eQMIWDSDUNControlPreferences_RelinquishDUNControl = 0, + eQMIWDSDUNControlPreferences_ExerciseDUNConrol = 1, +}; + +// Enum to describe QMI WDS Data Call Status +enum eQMIWDSDataCallStatus:UINT8 +{ + eQMIWDSDataCallStatus_Unknown = 0, + eQMIWDSDataCallStatus_Activated = 1, + eQMIWDSDataCallStatus_Terminated = 2, +}; + +// Enum to describe QMI WDS Data Call Types +enum eQMIWDSDataCallTypes:UINT8 +{ + eQMIWDSDataCallTypes_Unknown = 0, + eQMIWDSDataCallTypes_Embedded = 1, + eQMIWDSDataCallTypes_Tethered = 2, + eQMIWDSDataCallTypes_ModemEmbedded = 3, +}; + +// Enum to describe QMI WDS Data Mode +enum eQMIWDSDataMode:UINT8 +{ + eQMIWDSDataMode_CDMAOrHDR = 0, + eQMIWDSDataMode_CDMAOnly = 1, + eQMIWDSDataMode_HDROnly = 2, +}; + +// Enum to describe QMI WDS Data Rate +enum eQMIWDSDataRate:UINT8 +{ + eQMIWDSDataRate_LowSO15Only = 0, + eQMIWDSDataRate_MediumSO33PlusLowRSCH = 1, + eQMIWDSDataRate_HighSO33PlusHighRSCH = 2, +}; + +// Enum to describe QMI WDS Data System Network Types +enum eQMIWDSDataSystemNetworkTypes:UINT8 +{ + eQMIWDSDataSystemNetworkTypes_3GPP = 0, + eQMIWDSDataSystemNetworkTypes_3GPP2 = 1, +}; + +// Enum to describe QMI WDS Data Systems +enum eQMIWDSDataSystems:UINT32 +{ + eQMIWDSDataSystems_Unknown = 0, + eQMIWDSDataSystems_CDMA1x = 1, + eQMIWDSDataSystems_CDMA1xEVDO = 2, + eQMIWDSDataSystems_GPRS = 3, + eQMIWDSDataSystems_WCDMA = 4, + eQMIWDSDataSystems_LTE = 5, + eQMIWDSDataSystems_TDSCDMA = 6, +}; + +// Enum to describe QMI WDS EHRPD Call End Reason +enum eQMIWDSEHRPDCallEndReason:UINT16 +{ + eQMIWDSEHRPDCallEndReason_SubsLimitedToV4 = 1, + eQMIWDSEHRPDCallEndReason_SubsLimitedToV6 = 2, + eQMIWDSEHRPDCallEndReason_VSNCPTimeout = 4, + eQMIWDSEHRPDCallEndReason_VSNCPFailure = 5, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IGeneralError = 6, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IUnauthAPN = 7, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IPDNLimit = 8, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2INoPDNGW = 9, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IPDNGWUnreach = 10, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IPDNGWRejected = 11, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IInsufficientParam = 12, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IResourceUnavailable = 13, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IAdminProhibited = 14, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IPDNIDInUse = 15, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2ISubscriberLimitation = 16, + eQMIWDSEHRPDCallEndReason_VSNCP3GPP2IPDNExistsForAPN = 17, +}; + +// Enum to describe QMI WDS EMBMS Error Codes +enum eQMIWDSEMBMSErrorCodes:UINT16 +{ + eQMIWDSEMBMSErrorCodes_NotSupported = 108, + eQMIWDSEMBMSErrorCodes_ActivationInProgress = 111, + eQMIWDSEMBMSErrorCodes_Invalid = 124, + eQMIWDSEMBMSErrorCodes_DeactivationInProgress = 203, +}; + +// Enum to describe QMI WDS EMBMS List Types +enum eQMIWDSEMBMSListTypes:UINT8 +{ + eQMIWDSEMBMSListTypes_Active = 0, + eQMIWDSEMBMSListTypes_Available = 1, + eQMIWDSEMBMSListTypes_OOSWarning = 2, +}; + +// Enum to describe QMI WDS EMBMS Operation Status +enum eQMIWDSEMBMSOperationStatus:UINT32 +{ + eQMIWDSEMBMSOperationStatus_Success = 0, + eQMIWDSEMBMSOperationStatus_RadioConfigFailure = 65536, + eQMIWDSEMBMSOperationStatus_ChannelUnavailable = 65537, + eQMIWDSEMBMSOperationStatus_EMBMBSNotEnabled = 65538, + eQMIWDSEMBMSOperationStatus_OutOfCoverage = 65539, +}; + +// Enum to describe QMI WDS Extended Error Code +enum eQMIWDSExtendedErrorCode:UINT16 +{ + eQMIWDSExtendedErrorCode_Failure = 1, + eQMIWDSExtendedErrorCode_InvalidHandle = 2, + eQMIWDSExtendedErrorCode_InvalidOperation = 3, + eQMIWDSExtendedErrorCode_InvalidProfileType = 4, + eQMIWDSExtendedErrorCode_InvalidProfileNumber = 5, + eQMIWDSExtendedErrorCode_InvalidIdentifier = 6, + eQMIWDSExtendedErrorCode_InvalidArgument = 7, + eQMIWDSExtendedErrorCode_NotInitialized = 8, + eQMIWDSExtendedErrorCode_InvalidLength = 9, + eQMIWDSExtendedErrorCode_ListEnd = 10, + eQMIWDSExtendedErrorCode_InvalidSubscriptionID = 11, + eQMIWDSExtendedErrorCode_InvalidProfileFamily = 12, + eQMIWDSExtendedErrorCode_3GPPInvalidProfileFamily = 4097, + eQMIWDSExtendedErrorCode_3GPPAccessError = 4098, + eQMIWDSExtendedErrorCode_3GPPContextNotDefined = 4099, + eQMIWDSExtendedErrorCode_3GPPValidFlagNotSet = 4100, + eQMIWDSExtendedErrorCode_3GPPReadOnlyFlagSet = 4101, + eQMIWDSExtendedErrorCode_3GPPErrorMaxProfileNumber = 4102, + eQMIWDSExtendedErrorCode_3GPP2ErrorInvalidIdentifierForProfile = 4353, + eQMIWDSExtendedErrorCode_3GPP2ErrorProfileLimitReached = 4354, +}; + +// Enum to describe QMI WDS Extended Tech Prefs +enum eQMIWDSExtendedTechPrefs:UINT16 +{ + eQMIWDSExtendedTechPrefs_CDMA = 32769, + eQMIWDSExtendedTechPrefs_UMTS = 32772, + eQMIWDSExtendedTechPrefs_EPC = 34944, + eQMIWDSExtendedTechPrefs_EMBMS = 34946, + eQMIWDSExtendedTechPrefs_ModemLinkLocal = 34952, +}; + +// Enum to describe QMI WDS IP Families +enum eQMIWDSIPFamilies:UINT8 +{ + eQMIWDSIPFamilies_IPv4 = 4, + eQMIWDSIPFamilies_IPv6 = 6, + eQMIWDSIPFamilies_Unspecified = 8, +}; + +// Enum to describe QMI WDS IP Version +enum eQMIWDSIPVersion:UINT8 +{ + eQMIWDSIPVersion_IPv4 = 4, + eQMIWDSIPVersion_IPv6 = 6, +}; + +// Enum to describe QMI WDS IPv6 Call End Reason +enum eQMIWDSIPv6CallEndReason:UINT16 +{ + eQMIWDSIPv6CallEndReason_PrefixUnavailable = 1, + eQMIWDSIPv6CallEndReason_IPv6HRPDDisabled = 2, +}; + +// Enum to describe QMI WDS Internal Call End Reasons +enum eQMIWDSInternalCallEndReasons:UINT16 +{ + eQMIWDSInternalCallEndReasons_Internal = 201, + eQMIWDSInternalCallEndReasons_CallEnded = 202, + eQMIWDSInternalCallEndReasons_InternalUnknownCauseCode = 203, + eQMIWDSInternalCallEndReasons_UnknownCauseCode = 204, + eQMIWDSInternalCallEndReasons_CloseInProgress = 205, + eQMIWDSInternalCallEndReasons_NWInitiatedTermination = 206, + eQMIWDSInternalCallEndReasons_AppPreempted = 207, + eQMIWDSInternalCallEndReasons_PDNIPv4CallDisallowed = 208, + eQMIWDSInternalCallEndReasons_PDNIPv4CallThrottled = 209, + eQMIWDSInternalCallEndReasons_PDNIPv6CallDisallowed = 210, + eQMIWDSInternalCallEndReasons_ModemRestart = 212, + eQMIWDSInternalCallEndReasons_PDPPPPNotSupported = 213, + eQMIWDSInternalCallEndReasons_UnpreferredRAT = 214, + eQMIWDSInternalCallEndReasons_PhysicalLinkCloseInProgress = 215, + eQMIWDSInternalCallEndReasons_APNPendingHandover = 216, + eQMIWDSInternalCallEndReasons_ProfileBearerIncompatible = 217, + eQMIWDSInternalCallEndReasons_MMGDSICardEvent = 218, + eQMIWDSInternalCallEndReasons_LPMOrPowerDown = 219, + eQMIWDSInternalCallEndReasons_APNDisabled = 220, + eQMIWDSInternalCallEndReasons_MPITExpired = 221, + eQMIWDSInternalCallEndReasons_IPv6AddressTransferFailed = 222, + eQMIWDSInternalCallEndReasons_TRATSwapFailed = 223, +}; + +// Enum to describe QMI WDS LTE IP Types +enum eQMIWDSLTEIPTypes:UINT8 +{ + eQMIWDSLTEIPTypes_IPv4 = 0, + eQMIWDSLTEIPTypes_IPv6 = 1, + eQMIWDSLTEIPTypes_IPv4OrIPv6 = 2, +}; + +// Enum to describe QMI WDS Mobile IP Call End Reasons +enum eQMIWDSMobileIPCallEndReasons:UINT16 +{ + eQMIWDSMobileIPCallEndReasons_FAUnspecified = 64, + eQMIWDSMobileIPCallEndReasons_FAAdministrativelyProhibited = 65, + eQMIWDSMobileIPCallEndReasons_FAInsufficientResources = 66, + eQMIWDSMobileIPCallEndReasons_FAMobileNodeAuthenticationFailure = 67, + eQMIWDSMobileIPCallEndReasons_FAHAAuthenticationFailure = 68, + eQMIWDSMobileIPCallEndReasons_FARequestedLifetimeTooLong = 69, + eQMIWDSMobileIPCallEndReasons_FAMalformedRequest = 70, + eQMIWDSMobileIPCallEndReasons_FAMalformedReply = 71, + eQMIWDSMobileIPCallEndReasons_FAEncapsulationUnavailable = 72, + eQMIWDSMobileIPCallEndReasons_FAVJHCUnavailable = 73, + eQMIWDSMobileIPCallEndReasons_FAReverseTunnelUnavailable = 74, + eQMIWDSMobileIPCallEndReasons_FAReverseTunnelIsMandatoryAndTBitIsNotSet = 75, + eQMIWDSMobileIPCallEndReasons_FADeliveryStyleNotSupported = 79, + eQMIWDSMobileIPCallEndReasons_FAMissingNAI = 97, + eQMIWDSMobileIPCallEndReasons_FAMissingHA = 98, + eQMIWDSMobileIPCallEndReasons_FAMissingHomeAddress = 99, + eQMIWDSMobileIPCallEndReasons_FAUnknownChallenge = 104, + eQMIWDSMobileIPCallEndReasons_FAMissingChallenge = 105, + eQMIWDSMobileIPCallEndReasons_FAStaleChallenge = 106, + eQMIWDSMobileIPCallEndReasons_HAReasonUnspecified = 128, + eQMIWDSMobileIPCallEndReasons_HAAdministrativelyProhibited = 129, + eQMIWDSMobileIPCallEndReasons_HAInsufficientResources = 130, + eQMIWDSMobileIPCallEndReasons_HAMobileNodeAuthenticationFailure = 131, + eQMIWDSMobileIPCallEndReasons_HAFAAuthenticationFailure = 132, + eQMIWDSMobileIPCallEndReasons_HARegistrationIDMismatch = 133, + eQMIWDSMobileIPCallEndReasons_HAMalformedRequest = 134, + eQMIWDSMobileIPCallEndReasons_HAUnknownHAAddress = 136, + eQMIWDSMobileIPCallEndReasons_HAReverseTunnelUnavailable = 137, + eQMIWDSMobileIPCallEndReasons_HAReverseTunnelIsMandatoryAndTBitIsNotSet = 138, + eQMIWDSMobileIPCallEndReasons_HAEncapsulationUnavailable = 139, + eQMIWDSMobileIPCallEndReasons_Unknown = 65535, +}; + +// Enum to describe QMI WDS Network Types +enum eQMIWDSNetworkTypes:UINT8 +{ + eQMIWDSNetworkTypes_Unknown = 0, + eQMIWDSNetworkTypes_CDMA = 1, + eQMIWDSNetworkTypes_UMTS = 2, +}; + +// Enum to describe QMI WDS OOS Warning Reasons +enum eQMIWDSOOSWarningReasons:UINT32 +{ + eQMIWDSOOSWarningReasons_UnicastOOS = 0, + eQMIWDSOOSWarningReasons_MulticastOOS = 1, + eQMIWDSOOSWarningReasons_Cleared = 2, +}; + +// Enum to describe QMI WDS PDN Type +enum eQMIWDSPDNType:UINT8 +{ + eQMIWDSPDNType_IPv4PDNType = 0, + eQMIWDSPDNType_IPv6PDNType = 1, + eQMIWDSPDNType_IPv4orIPv6PDNType = 2, + eQMIWDSPDNType_UnspecifiedPDNType = 3, +}; + +// Enum to describe QMI WDS PDP Access Control Flag +enum eQMIWDSPDPAccessControlFlag:UINT8 +{ + eQMIWDSPDPAccessControlFlag_PDPAccessControlNone = 0, + eQMIWDSPDPAccessControlFlag_PDPAccessControlReject = 1, + eQMIWDSPDPAccessControlFlag_PDPAccessControlPermission = 2, +}; + +// Enum to describe QMI WDS PDP Data Compression Type +enum eQMIWDSPDPDataCompressionType:UINT8 +{ + eQMIWDSPDPDataCompressionType_Off = 0, + eQMIWDSPDPDataCompressionType_ManufacturerPreferred = 1, + eQMIWDSPDPDataCompressionType_V42BIS = 2, + eQMIWDSPDPDataCompressionType_V44 = 3, +}; + +// Enum to describe QMI WDS PDP Header Compression Type +enum eQMIWDSPDPHeaderCompressionType:UINT8 +{ + eQMIWDSPDPHeaderCompressionType_Off = 0, + eQMIWDSPDPHeaderCompressionType_ManufacturerPreferred = 1, + eQMIWDSPDPHeaderCompressionType_RFC1144 = 2, + eQMIWDSPDPHeaderCompressionType_RFC2507 = 3, + eQMIWDSPDPHeaderCompressionType_RFC3095 = 4, +}; + +// Enum to describe QMI WDS PPP Call End Reason +enum eQMIWDSPPPCallEndReason:UINT16 +{ + eQMIWDSPPPCallEndReason_Timeout = 1, + eQMIWDSPPPCallEndReason_AuthenticationFailed = 2, + eQMIWDSPPPCallEndReason_OptionMismatch = 3, + eQMIWDSPPPCallEndReason_PAPFailure = 31, + eQMIWDSPPPCallEndReason_CHAPFailure = 32, + eQMIWDSPPPCallEndReason_Unknown = 65535, +}; + +// Enum to describe QMI WDS Profile Family +enum eQMIWDSProfileFamily:UINT8 +{ + eQMIWDSProfileFamily_Embedded = 0, + eQMIWDSProfileFamily_TetheredSocketsFamily = 1, +}; + +// Enum to describe QMI WDS Profile Param ID +enum eQMIWDSProfileParamID:UINT32 +{ + eQMIWDSProfileParamID_UMTSRequestedQoS = 23, + eQMIWDSProfileParamID_UMTSMinimumQoS = 24, + eQMIWDSProfileParamID_GPRSRequestedQoS = 25, + eQMIWDSProfileParamID_GPRSMinimumQoS = 26, + eQMIWDSProfileParamID_TFTFilterID1 = 50, + eQMIWDSProfileParamID_TFTFilterID2 = 51, +}; + +// Enum to describe QMI WDS QoS Class Identifier +enum eQMIWDSQoSClassIdentifier:UINT8 +{ + eQMIWDSQoSClassIdentifier_NetworkAssignQCI = 0, + eQMIWDSQoSClassIdentifier_GuaranteedBitrate1 = 1, + eQMIWDSQoSClassIdentifier_GuaranteedBitrate2 = 2, + eQMIWDSQoSClassIdentifier_GuaranteedBitrate3 = 3, + eQMIWDSQoSClassIdentifier_GuaranteedBitrate4 = 4, + eQMIWDSQoSClassIdentifier_NonGuaranteedBitrate5 = 5, + eQMIWDSQoSClassIdentifier_NonGuaranteedBitrate6 = 6, + eQMIWDSQoSClassIdentifier_NonGuaranteedBitrate7 = 7, + eQMIWDSQoSClassIdentifier_NonGuaranteedBitrate8 = 8, +}; + +// Enum to describe QMI WDS SIP/MIP Call Types +enum eQMIWDSSIPMIPCallTypes:UINT8 +{ + eQMIWDSSIPMIPCallTypes_NotUp = 0, + eQMIWDSSIPMIPCallTypes_SIPUp = 1, + eQMIWDSSIPMIPCallTypes_MIPUp = 2, +}; + +// Enum to describe QMI WDS Slot Cycle Set Results +enum eQMIWDSSlotCycleSetResults:UINT8 +{ + eQMIWDSSlotCycleSetResults_Succcess = 0, + eQMIWDSSlotCycleSetResults_FailureRequestRejected = 1, + eQMIWDSSlotCycleSetResults_FailureRequestFailedTX = 2, + eQMIWDSSlotCycleSetResults_FailureNotSupported = 3, + eQMIWDSSlotCycleSetResults_FailureNoNetwork = 4, +}; + +// Enum to describe QMI WDS Tethered Call Types +enum eQMIWDSTetheredCallTypes:UINT8 +{ + eQMIWDSTetheredCallTypes_NonTethered = 0, + eQMIWDSTetheredCallTypes_RmNet = 1, + eQMIWDSTetheredCallTypes_DUN = 2, +}; + +// Enum to describe QMI WMS ACK Failure Cause +enum eQMIWMSACKFailureCause:UINT8 +{ + eQMIWMSACKFailureCause_NoNetworkResponse = 0, + eQMIWMSACKFailureCause_NetworkReleasedLink = 1, + eQMIWMSACKFailureCause_NotSent = 2, +}; + +// Enum to describe QMI WMS CDMA Service Options +enum eQMIWMSCDMAServiceOptions:UINT8 +{ + eQMIWMSCDMAServiceOptions_Automatic = 0, + eQMIWMSCDMAServiceOptions_SO6 = 6, + eQMIWMSCDMAServiceOptions_SO14 = 14, +}; + +// Enum to describe QMI WMS Cause Codes +enum eQMIWMSCauseCodes +{ + eQMIWMSCauseCodes_AddressVacant = 0, + eQMIWMSCauseCodes_AddressTranslation = 1, + eQMIWMSCauseCodes_NetworkResourceShortage = 2, + eQMIWMSCauseCodes_NetworkFailure = 3, + eQMIWMSCauseCodes_InvalidTeleserviceID = 4, + eQMIWMSCauseCodes_NetworkOther = 5, + eQMIWMSCauseCodes_NoPageResponse = 32, + eQMIWMSCauseCodes_DestinationBusy = 33, + eQMIWMSCauseCodes_DestinationNoACK = 34, + eQMIWMSCauseCodes_DestinationResourceShortage = 35, + eQMIWMSCauseCodes_DeliveryPostponed = 36, + eQMIWMSCauseCodes_DestinationOutOfService = 37, + eQMIWMSCauseCodes_DestinationNotAtAddress = 38, + eQMIWMSCauseCodes_DestinationOther = 39, + eQMIWMSCauseCodes_RadioResourceShortage = 64, + eQMIWMSCauseCodes_RadioIncompatibility = 65, + eQMIWMSCauseCodes_RadioOther = 66, + eQMIWMSCauseCodes_Encoding = 96, + eQMIWMSCauseCodes_SMSOriginationDenied = 97, + eQMIWMSCauseCodes_SMSDestinationDenied = 98, + eQMIWMSCauseCodes_SupplementarySErviceNotSupported = 99, + eQMIWMSCauseCodes_SMSNotSupported = 100, + eQMIWMSCauseCodes_MissingExpectedParameter = 101, + eQMIWMSCauseCodes_MissingMandatoryParameter = 102, + eQMIWMSCauseCodes_UnrecognizedParameterValue = 103, + eQMIWMSCauseCodes_UnexpectedParameterValue = 104, + eQMIWMSCauseCodes_UserDataSizeError = 105, + eQMIWMSCauseCodes_GeneralOther = 106, +}; + +// Enum to describe QMI WMS Delivery Failures +enum eQMIWMSDeliveryFailures:UINT8 +{ + eQMIWMSDeliveryFailures_BlockedByCallControl = 0, +}; + +// Enum to describe QMI WMS Error Classes +enum eQMIWMSErrorClasses:UINT8 +{ + eQMIWMSErrorClasses_Temporary = 0, + eQMIWMSErrorClasses_Permanent = 1, +}; + +// Enum to describe QMI WMS Error Classes 2 +enum eQMIWMSErrorClasses2:UINT8 +{ + eQMIWMSErrorClasses2_Temporary = 2, + eQMIWMSErrorClasses2_Permanent = 3, +}; + +// Enum to describe QMI WMS GSM/WCDMA Domains +enum eQMIWMSGSMWCDMADomains:UINT8 +{ + eQMIWMSGSMWCDMADomains_CSPreferred = 0, + eQMIWMSGSMWCDMADomains_PSPreferred = 1, + eQMIWMSGSMWCDMADomains_CSOnly = 2, + eQMIWMSGSMWCDMADomains_PSOnly = 3, +}; + +// Enum to describe QMI WMS LTE Domains +enum eQMIWMSLTEDomains:UINT8 +{ + eQMIWMSLTEDomains_None = 0, + eQMIWMSLTEDomains_IMS = 1, +}; + +// Enum to describe QMI WMS Language +enum eQMIWMSLanguage:UINT16 +{ + eQMIWMSLanguage_Unknown = 0, + eQMIWMSLanguage_English = 1, + eQMIWMSLanguage_French = 2, + eQMIWMSLanguage_Spanish = 3, + eQMIWMSLanguage_Japanese = 4, + eQMIWMSLanguage_Korean = 5, + eQMIWMSLanguage_Chinese = 6, + eQMIWMSLanguage_Hebrew = 7, +}; + +// Enum to describe QMI WMS Message Classes +enum eQMIWMSMessageClasses:UINT8 +{ + eQMIWMSMessageClasses_Class0 = 0, + eQMIWMSMessageClasses_Class1 = 1, + eQMIWMSMessageClasses_Class2 = 2, + eQMIWMSMessageClasses_Class3 = 3, + eQMIWMSMessageClasses_ClassNone = 4, + eQMIWMSMessageClasses_ClassCDMA = 5, +}; + +// Enum to describe QMI WMS Message Delivery Failure Type +enum eQMIWMSMessageDeliveryFailureType:UINT8 +{ + eQMIWMSMessageDeliveryFailureType_Temporary = 0, + eQMIWMSMessageDeliveryFailureType_Permanent = 1, +}; + +// Enum to describe QMI WMS Message Formats +enum eQMIWMSMessageFormats:UINT8 +{ + eQMIWMSMessageFormats_CDMA = 0, + eQMIWMSMessageFormats_AnalogCLIUnsupported = 1, + eQMIWMSMessageFormats_AnalogVoiceMailUnsupported = 2, + eQMIWMSMessageFormats_AnalogWMSUnsupported = 3, + eQMIWMSMessageFormats_AnalogAWIWMSUnsupported = 4, + eQMIWMSMessageFormats_MWIUnsupported = 5, + eQMIWMSMessageFormats_GSMWCDMAPP = 6, + eQMIWMSMessageFormats_GSMWCDMABC = 7, + eQMIWMSMessageFormats_MWI = 8, +}; + +// Enum to describe QMI WMS Message Protocols +enum eQMIWMSMessageProtocols:UINT8 +{ + eQMIWMSMessageProtocols_CDMA = 0, + eQMIWMSMessageProtocols_GSMWCDMAUnsupported = 1, +}; + +// Enum to describe QMI WMS Message Tags +enum eQMIWMSMessageTags:UINT8 +{ + eQMIWMSMessageTags_MTRead = 0, + eQMIWMSMessageTags_MTNotRead = 1, + eQMIWMSMessageTags_MOSend = 2, + eQMIWMSMessageTags_MONotSent = 3, +}; + +// Enum to describe QMI WMS Message Types +enum eQMIWMSMessageTypes:UINT8 +{ + eQMIWMSMessageTypes_PointToPoint = 0, + eQMIWMSMessageTypes_Broadcast = 1, +}; + +// Enum to describe QMI WMS Network Registration Status +enum eQMIWMSNetworkRegistrationStatus:UINT8 +{ + eQMIWMSNetworkRegistrationStatus_NoService = 0, + eQMIWMSNetworkRegistrationStatus_InProgress = 1, + eQMIWMSNetworkRegistrationStatus_Failed = 2, + eQMIWMSNetworkRegistrationStatus_LimitedService = 3, + eQMIWMSNetworkRegistrationStatus_FullService = 4, +}; + +// Enum to describe QMI WMS Notification Type +enum eQMIWMSNotificationType:UINT8 +{ + eQMIWMSNotificationType_Primary = 0, + eQMIWMSNotificationType_SecondaryGSM = 1, + eQMIWMSNotificationType_SecondaryUMTS = 2, +}; + +// Enum to describe QMI WMS Protocol Identifier Data +enum eQMIWMSProtocolIdentifierData:UINT8 +{ + eQMIWMSProtocolIdentifierData_Default = 0, + eQMIWMSProtocolIdentifierData_Implicit = 32, + eQMIWMSProtocolIdentifierData_Telex = 33, + eQMIWMSProtocolIdentifierData_G3Fax = 34, + eQMIWMSProtocolIdentifierData_G4Fax = 35, + eQMIWMSProtocolIdentifierData_VoicePhone = 36, + eQMIWMSProtocolIdentifierData_Ermes = 37, + eQMIWMSProtocolIdentifierData_NATPaging = 38, + eQMIWMSProtocolIdentifierData_Videotex = 39, + eQMIWMSProtocolIdentifierData_TeltexUnspecified = 40, + eQMIWMSProtocolIdentifierData_TeltexPSPDN = 41, + eQMIWMSProtocolIdentifierData_TeltexCSPDN = 42, + eQMIWMSProtocolIdentifierData_TeltexPSTN = 43, + eQMIWMSProtocolIdentifierData_TeltexISDN = 44, + eQMIWMSProtocolIdentifierData_UCI = 45, + eQMIWMSProtocolIdentifierData_MessageHandling = 48, + eQMIWMSProtocolIdentifierData_X400 = 49, + eQMIWMSProtocolIdentifierData_InternetEMail = 50, + eQMIWMSProtocolIdentifierData_SCSpecific1 = 56, + eQMIWMSProtocolIdentifierData_SCSpecific2 = 57, + eQMIWMSProtocolIdentifierData_SCSpecific3 = 58, + eQMIWMSProtocolIdentifierData_SCSpecific4 = 59, + eQMIWMSProtocolIdentifierData_SCSpecific5 = 60, + eQMIWMSProtocolIdentifierData_SCSpecific6 = 61, + eQMIWMSProtocolIdentifierData_SCSpecific7 = 62, + eQMIWMSProtocolIdentifierData_GSMUMTS = 63, + eQMIWMSProtocolIdentifierData_SMType0 = 64, + eQMIWMSProtocolIdentifierData_ReplaceSM1 = 65, + eQMIWMSProtocolIdentifierData_ReplaceSM2 = 66, + eQMIWMSProtocolIdentifierData_ReplaceSM3 = 67, + eQMIWMSProtocolIdentifierData_ReplaceSM4 = 68, + eQMIWMSProtocolIdentifierData_ReplaceSM5 = 69, + eQMIWMSProtocolIdentifierData_ReplaceSM6 = 70, + eQMIWMSProtocolIdentifierData_ReplaceSM7 = 71, + eQMIWMSProtocolIdentifierData_ReturnCall = 95, + eQMIWMSProtocolIdentifierData_ANSI136RData = 124, + eQMIWMSProtocolIdentifierData_MEDataDownload = 125, + eQMIWMSProtocolIdentifierData_MEDepersonalizationShortMessage = 126, + eQMIWMSProtocolIdentifierData_SIMDataDownload = 127, +}; + +// Enum to describe QMI WMS RP Cause Codes +enum eQMIWMSRPCauseCodes +{ + eQMIWMSRPCauseCodes_UnassignedNumber = 1, + eQMIWMSRPCauseCodes_OperatorDeterminedBarring = 8, + eQMIWMSRPCauseCodes_CallBarred = 10, + eQMIWMSRPCauseCodes_Reserved = 11, + eQMIWMSRPCauseCodes_ShortMessageTransferRejected = 21, + eQMIWMSRPCauseCodes_MemoryCapacityExceeded = 22, + eQMIWMSRPCauseCodes_DestinationOutOfOrder = 27, + eQMIWMSRPCauseCodes_UnidentifiedSubscriber = 28, + eQMIWMSRPCauseCodes_FacilityRejected = 29, + eQMIWMSRPCauseCodes_UnknownSubscriber = 30, + eQMIWMSRPCauseCodes_NetworkOutOfOrder = 38, + eQMIWMSRPCauseCodes_TemporaryFailure = 41, + eQMIWMSRPCauseCodes_Congestion = 42, + eQMIWMSRPCauseCodes_UnspecifiedResourcesUnavailable = 47, + eQMIWMSRPCauseCodes_RequestedFacilityNotSubscribed = 50, + eQMIWMSRPCauseCodes_RequestedFacilityNotImplemented = 69, + eQMIWMSRPCauseCodes_InvalidShortMessageTransferValue = 81, + eQMIWMSRPCauseCodes_SemanticallyIncorrectMessage = 95, + eQMIWMSRPCauseCodes_InvalidManadatoryInfo = 96, + eQMIWMSRPCauseCodes_MessageTypeNotImplemented = 97, + eQMIWMSRPCauseCodes_MessageNotCompatibleWithSMS = 98, + eQMIWMSRPCauseCodes_InfoElementNotImplemented = 99, + eQMIWMSRPCauseCodes_UnspecifiedProtocolError = 111, + eQMIWMSRPCauseCodes_UnspecifiedInterworking = 127, +}; + +// Enum to describe QMI WMS Receipt Actions +enum eQMIWMSReceiptActions:UINT8 +{ + eQMIWMSReceiptActions_Discard = 0, + eQMIWMSReceiptActions_StoreAndNotify = 1, + eQMIWMSReceiptActions_TransferOnly = 2, + eQMIWMSReceiptActions_TransfterAndAcknowledge = 3, +}; + +// Enum to describe QMI WMS Route Values +enum eQMIWMSRouteValues:UINT8 +{ + eQMIWMSRouteValues_Discard = 0, + eQMIWMSRouteValues_StoreAndNotify = 1, + eQMIWMSRouteValues_TransferOnly = 2, + eQMIWMSRouteValues_TransferAndAcknowledge = 3, + eQMIWMSRouteValues_Unknown = 255, +}; + +// Enum to describe QMI WMS SMS Call Status +enum eQMIWMSSMSCallStatus:UINT8 +{ + eQMIWMSSMSCallStatus_Incoming = 0, + eQMIWMSSMSCallStatus_Connected = 1, + eQMIWMSSMSCallStatus_Aborted = 2, + eQMIWMSSMSCallStatus_Disconnected = 3, + eQMIWMSSMSCallStatus_Connecting = 4, +}; + +// Enum to describe QMI WMS SMS Message Mode +enum eQMIWMSSMSMessageMode:UINT8 +{ + eQMIWMSSMSMessageMode_GSMWCDMA = 1, +}; + +// Enum to describe QMI WMS Service Categories +enum eQMIWMSServiceCategories +{ + eQMIWMSServiceCategories_Unknown = 0, + eQMIWMSServiceCategories_EmergencyBroadcast = 1, + eQMIWMSServiceCategories_Administrative = 2, + eQMIWMSServiceCategories_Maintenance = 3, + eQMIWMSServiceCategories_GeneralNewsLocal = 4, + eQMIWMSServiceCategories_GeneralNewsRegional = 5, + eQMIWMSServiceCategories_GeneralNewsNational = 6, + eQMIWMSServiceCategories_GeneralNewsInternational = 7, + eQMIWMSServiceCategories_BusinessNewsLocal = 8, + eQMIWMSServiceCategories_BusinessNewsRegional = 9, + eQMIWMSServiceCategories_BusinessNewsNational = 10, + eQMIWMSServiceCategories_BusinessNewsInternational = 11, + eQMIWMSServiceCategories_SportsNewsLocal = 12, + eQMIWMSServiceCategories_SportsNewsRegional = 13, + eQMIWMSServiceCategories_SportsNewsNational = 14, + eQMIWMSServiceCategories_SportsNewsInternational = 15, + eQMIWMSServiceCategories_EntertainmentNewsLocal = 16, + eQMIWMSServiceCategories_EntertainmentNewsRegional = 17, + eQMIWMSServiceCategories_EntertainmentNewsNational = 18, + eQMIWMSServiceCategories_EntertainmentNewsInternational = 19, + eQMIWMSServiceCategories_LocalWeather = 20, + eQMIWMSServiceCategories_AreaTrafficReports = 21, + eQMIWMSServiceCategories_LocalAirplaneFlightSchedules = 22, + eQMIWMSServiceCategories_Restaurants = 23, + eQMIWMSServiceCategories_Lodgings = 24, + eQMIWMSServiceCategories_RetailDirectory = 25, + eQMIWMSServiceCategories_Advertisements = 26, + eQMIWMSServiceCategories_StockQuotes = 27, + eQMIWMSServiceCategories_EmploymentOpportunities = 28, + eQMIWMSServiceCategories_MedicalHealthHospitals = 29, + eQMIWMSServiceCategories_TechnologyNews = 30, + eQMIWMSServiceCategories_Multicategory = 31, + eQMIWMSServiceCategories_CardApplicationToolkitProtocolTeleservice = 32, + eQMIWMSServiceCategories_PresidentialLevelAlert = 4096, + eQMIWMSServiceCategories_ExtremeThreattoLifeandProperty = 4097, + eQMIWMSServiceCategories_SevereThreattoLifeandProperty = 4098, + eQMIWMSServiceCategories_AMBERChildAbductionEmergency = 4099, + eQMIWMSServiceCategories_CMASTestMessage = 4100, +}; + +// Enum to describe QMI WMS Service Ready Status +enum eQMIWMSServiceReadyStatus:UINT32 +{ + eQMIWMSServiceReadyStatus_SMSServiceNotReady = 0, + eQMIWMSServiceReadyStatus_3GPPSMSServiceReady = 1, + eQMIWMSServiceReadyStatus_3GPP2SMSServiceReady = 2, + eQMIWMSServiceReadyStatus_3GPPAnd3GPP2SMSServicesReady = 3, +}; + +// Enum to describe QMI WMS Storage Types +enum eQMIWMSStorageTypes:UINT8 +{ + eQMIWMSStorageTypes_UIM = 0, + eQMIWMSStorageTypes_NV = 1, + eQMIWMSStorageTypes_Unknown = 255, +}; + +// Enum to describe QMI WMS Subscription Type +enum eQMIWMSSubscriptionType:UINT8 +{ + eQMIWMSSubscriptionType_PrimarySubscription = 0, + eQMIWMSSubscriptionType_SecondarySubscription = 1, +}; + +// Enum to describe QMI WMS TP Cause Codes +enum eQMIWMSTPCauseCodes +{ + eQMIWMSTPCauseCodes_TelematicInterworkingNotSupported = 128, + eQMIWMSTPCauseCodes_ShortMessageType0NotSupported = 129, + eQMIWMSTPCauseCodes_CannotReplaceShortMessage = 130, + eQMIWMSTPCauseCodes_UnspecifiedPIDError = 143, + eQMIWMSTPCauseCodes_DataCodingSchemeNotSupported = 144, + eQMIWMSTPCauseCodes_MessageClassNotSupported = 145, + eQMIWMSTPCauseCodes_UnspecifiedDCSError = 159, + eQMIWMSTPCauseCodes_CommandCannotBeActioned = 160, + eQMIWMSTPCauseCodes_CommandUnsupported = 161, + eQMIWMSTPCauseCodes_UnspecifiedCommandError = 175, + eQMIWMSTPCauseCodes_TPDUNotSupported = 176, + eQMIWMSTPCauseCodes_SCBusy = 192, + eQMIWMSTPCauseCodes_NoSCSubscription = 193, + eQMIWMSTPCauseCodes_SCSystemFailure = 194, + eQMIWMSTPCauseCodes_InvalidSMEAddress = 195, + eQMIWMSTPCauseCodes_DestinationSMEBarred = 196, + eQMIWMSTPCauseCodes_SMRejectedOrDuplicate = 197, + eQMIWMSTPCauseCodes_VPFNotSupported = 198, + eQMIWMSTPCauseCodes_VPNotSupported = 199, + eQMIWMSTPCauseCodes_SIMSMSStorageFull = 208, + eQMIWMSTPCauseCodes_NoSIMSMSStorageCapability = 209, + eQMIWMSTPCauseCodes_ErrorInMS = 210, + eQMIWMSTPCauseCodes_MemoryCapacityExceeded = 211, + eQMIWMSTPCauseCodes_SIMApplicationToolkitBusy = 212, + eQMIWMSTPCauseCodes_SIMDataDownloadError = 213, + eQMIWMSTPCauseCodes_UnspecifiedError = 255, +}; + +// Enum to describe QMI WMS Transport Capability +enum eQMIWMSTransportCapability:UINT8 +{ + eQMIWMSTransportCapability_CDMA = 0, + eQMIWMSTransportCapability_GW = 1, +}; + +// Enum to describe QMI WMS Transport Type +enum eQMIWMSTransportType:UINT8 +{ + eQMIWMSTransportType_IMS = 0, +}; + +// Enum to describe QMI WMS Waiting Message Type +enum eQMIWMSWaitingMessageType:UINT8 +{ + eQMIWMSWaitingMessageType_Voicemail = 0, + eQMIWMSWaitingMessageType_Fax = 1, + eQMIWMSWaitingMessageType_Email = 2, + eQMIWMSWaitingMessageType_Other = 3, + eQMIWMSWaitingMessageType_Videomail = 4, +}; + diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPIStructs.h b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPIStructs.h new file mode 100755 index 0000000..f2e10d3 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtAPIStructs.h @@ -0,0 +1,25670 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtAPIStructs.h + +DESCRIPTION: + Declaration of the Gobi API structures + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +#pragma once + +// Include the enumerations +#include "GobiConnectionMgmtAPIEnums.h" + +#pragma pack( push, 1 ) + +// Structure to represent a QMI (control/service) content +struct sQMIRawContentHeader +{ + BYTE mTypeID; + WORD mLength; + + // This array must be the size specified by mLength + // BYTE mValue[1]; +}; + +// Structure to describe TLV 0x02, the Result Code +// It is common for all Responses +struct sResultCode +{ + eQMIResults mQMIResult; + eQMIErrors mQMIError; +}; + +// Structure to describe TLV 0x01 for QMI LOC, the status +// It is common for QMI LOC indications above 0x0032 +struct sLOCIndication_Status +{ + eQMILOCStatus mStatus; +}; + +// Structure to describe request TLV 0x10 for WDSSetEventReport() +struct sWDSSetEventReportRequest_ChannelRateIndicator +{ + INT8 mReportChannelRate; +}; + +// Structure to describe request TLV 0x11 for WDSSetEventReport() +struct sWDSSetEventReportRequest_TransferStatisticsIndicator +{ + UINT8 mTransferStatisticsIntervalSeconds; + bool mReportTXPacketSuccesses:1; + bool mReportRXPacketSuccesses:1; + bool mReportTXPacketErrors:1; + bool mReportRXPacketErrors:1; + bool mReportTXOverflows:1; + bool mReportRXOverflows:1; + bool mTXByteTotal:1; + bool mRXByteTotal:1; + bool mTXPacketsDropped:1; + bool mRXPacketsDropped:1; + + // Padding out 22 bits + UINT8 mReserved1:6; + UINT8 mReserved2[2]; +}; + +// Structure to describe request TLV 0x12 for WDSSetEventReport() +struct sWDSSetEventReportRequest_DataBearerTechnologyIndicator +{ + INT8 mReportDataBearerTechnology; +}; + +// Structure to describe request TLV 0x13 for WDSSetEventReport() +struct sWDSSetEventReportRequest_DormancyStatusIndicator +{ + INT8 mReportDormancyStatus; +}; + +// Structure to describe request TLV 0x14 for WDSSetEventReport() +struct sWDSSetEventReportRequest_MIPStatusIndicator +{ + INT8 mReportMIPStatus; +}; + +// Structure to describe request TLV 0x15 for WDSSetEventReport() +struct sWDSSetEventReportRequest_CurrentDataBearerTechnologyIndicator +{ + INT8 mReportDataBearerTechnology; +}; + +// Structure to describe request TLV 0x17 for WDSSetEventReport() +struct sWDSSetEventReportRequest_DataCallStatusIndicator +{ + INT8 mReportDataCallStatus; +}; + +// Structure to describe request TLV 0x18 for WDSSetEventReport() +struct sWDSSetEventReportRequest_PreferredDataSystemIndicator +{ + INT8 mReportPreferredDataSystem; +}; + +// Structure to describe request TLV 0x19 for WDSSetEventReport() +struct sWDSSetEventReportRequest_EVDOPMChangeIndicator +{ + INT8 mReportEVDOPageMonitorPeriodChange; +}; + +// Structure to describe request TLV 0x1A for WDSSetEventReport() +struct sWDSSetEventReportRequest_DataSystemsIndicator +{ + INT8 mReportDataSystems; +}; + +// Structure to describe request TLV 0x1B for WDSSetEventReport() +struct sWDSSetEventReportRequest_UplinkFlowControlIndicator +{ + INT8 mReportUplinkFlowControl; +}; + +// Structure to describe indication TLV 0x10 for WDS EventReport +struct sWDSEventReportIndication_TXPacketSuccesses +{ + UINT32 mTXPacketSuccesses; +}; + +// Structure to describe indication TLV 0x11 for WDS EventReport +struct sWDSEventReportIndication_RXPacketSuccesses +{ + UINT32 mRXPacketSuccesses; +}; + +// Structure to describe indication TLV 0x12 for WDS EventReport +struct sWDSEventReportIndication_TXPacketErrors +{ + UINT32 mTXPacketErrors; +}; + +// Structure to describe indication TLV 0x13 for WDS EventReport +struct sWDSEventReportIndication_RXPacketErrors +{ + UINT32 mRXPacketErrors; +}; + +// Structure to describe indication TLV 0x14 for WDS EventReport +struct sWDSEventReportIndication_TXOverflows +{ + UINT32 mTXOverflows; +}; + +// Structure to describe indication TLV 0x15 for WDS EventReport +struct sWDSEventReportIndication_RXOverflows +{ + UINT32 mRXOverflows; +}; + +// Structure to describe indication TLV 0x16 for WDS EventReport +struct sWDSEventReportIndication_ChannelRates +{ + UINT32 mChannelTXRatebps; + UINT32 mChannelRXRatebps; +}; + +// Structure to describe indication TLV 0x17 for WDS EventReport +struct sWDSEventReportIndication_DataBearerTechnology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe indication TLV 0x18 for WDS EventReport +struct sWDSEventReportIndication_DormancyStatus +{ + eQMIDormancyStatus mDormancyStatus; +}; + +// Structure to describe indication TLV 0x19 for WDS EventReport +struct sWDSEventReportIndication_TXBytes +{ + UINT64 mTXByteTotal; +}; + +// Structure to describe indication TLV 0x1A for WDS EventReport +struct sWDSEventReportIndication_RXBytes +{ + UINT64 mRXByteTotal; +}; + +// Structure to describe indication TLV 0x1B for WDS EventReport +struct sWDSEventReportIndication_MIPStatus +{ + UINT8 mMIPStatus; +}; + +// Structure to describe indication TLV 0x1D for WDS EventReport +struct sWDSEventReportIndication_CurrentDataBearerTechnology +{ + eQMIWDSNetworkTypes mNetworkType; + + // The following union is based on the value of mNetworkType + union uValOfNetworkType + { + // If the value of mNetworkType == 1 + struct sNetworkTypeIs1 + { + bool mCDMA1x:1; + bool mCDMA1xEvDORev0:1; + bool mCDMA1xEvDORevA:1; + bool mCDMA1xEvDORevB:1; + bool mCDMAEHRPD:1; + bool mCDMAFMC:1; + + // Padding out 25 bits + UINT8 mReserved1:2; + UINT8 mReserved2[2]; + UINT8 mReserved3:7; + + bool mNullBearer:1; + + // The following union is for handing both mCDMA1x and mCDMA1xEvDORev(0, A, B) + union uValOfCDMA1x_or_CDMA1xEvDORevX + { + // If the value of mCDMA1x == 1 + struct sCDMA1xIs1 + { + bool mCDMA1xIS95:1; + bool mCDMA1xIS2000:1; + bool mCDMA1xIS2000RelA:1; + + // Padding out 29 bits + UINT8 mReserved4:5; + UINT8 mReserved5[3]; + }; + + sCDMA1xIs1 mCDMA1xIs1; + + // If the value of mCDMA1xEvDORev0 == 1 + struct sCDMA1xEvDORev0Is1 + { + bool mCDMA1xEvDORev0DPA:1; + + // Padding out 31 bits + UINT8 mReserved6:7; + UINT8 mReserved7[3]; + }; + + sCDMA1xEvDORev0Is1 mCDMA1xEvDORev0Is1; + + // If the value of mCDMA1xEvDORevA == 1 + struct sCDMA1xEvDORevAIs1 + { + bool mCDMA1xEvDORevADPA:1; + bool mCDMA1xEvDORevAMFPA:1; + bool mCDMA1xEvDORevAEMPA:1; + bool mCDMA1xEvDORevAEMPAEHRPD:1; + + // Padding out 28 bits + UINT8 mReserved8:4; + UINT8 mReserved9[3]; + }; + + sCDMA1xEvDORevAIs1 mCDMA1xEvDORevAIs1; + + // If the value of mCDMA1xEvDORevB == 1 + struct sCDMA1xEvDORevBIs1 + { + bool mCDMA1xEvDORevBDPA:1; + bool mCDMA1xEvDORevBMFPA:1; + bool mCDMA1xEvDORevBEMPA:1; + bool mCDMA1xEvDORevBEMPAEHRPD:1; + bool mCDMA1xEvDORevBMMPA:1; + bool mCDMA1xEvDORevBMMPAEHRPD:1; + + // Padding out 26 bits + UINT8 mReserved10:2; + UINT8 mReserved11[3]; + }; + + sCDMA1xEvDORevBIs1 mCDMA1xEvDORevBIs1; + + // Padding out 32 bits + UINT8 mReserved12[4]; + }; + + uValOfCDMA1x_or_CDMA1xEvDORevX mValOfCDMA1x_or_CDMA1xEvDORevX; + }; + + sNetworkTypeIs1 mNetworkTypeIs1; + + // If the value of mNetworkType == 2 + struct sNetworkTypeIs2 + { + bool mWCDMA:1; + bool mGPRS:1; + bool mHSDPA:1; + bool mHSUPA:1; + bool mEDGE:1; + bool mLTE:1; + bool mHSDPAPlus:1; + bool mDualCellHSDPAPlus:1; + bool m64QAM:1; + bool mTDSCDMA:1; + + // Padding out 21 bits + UINT8 mReserved13:6; + UINT8 mReserved14; + UINT8 mReserved15:7; + + bool mNullBearer:1; + }; + + sNetworkTypeIs2 mNetworkTypeIs2; + + // Padding out 64 bits + UINT8 mReserved16[8]; + }; + + uValOfNetworkType mValOfNetworkType; +}; + +// Structure to describe indication TLV 0x1F for WDS EventReport +struct sWDSEventReportIndication_DataCallStatus +{ + eQMIWDSDataCallStatus mDataCallStatus; +}; + +// Structure to describe indication TLV 0x20 for WDS EventReport +struct sWDSEventReportIndication_PreferredDataSystem +{ + eQMIWDSDataSystems mPreferredDataSystem; +}; + +// Structure to describe indication TLV 0x22 for WDS EventReport +struct sWDSEventReportIndication_DataCallType +{ + eQMIWDSDataCallTypes mDataCallType; + eQMIWDSTetheredCallTypes mTetheredCallType; +}; + +// Structure to describe indication TLV 0x23 for WDS EventReport +struct sWDSEventReportIndication_EVDOPageMonitorPeriodChange +{ + UINT8 mEVDOPageMonitorPeriodChange; + INT8 mEVDOForceLongSleep; +}; + +// Structure to describe indication TLV 0x24 for WDS EventReport +struct sWDSEventReportIndication_DataSystems +{ + eQMIWDSDataSystemNetworkTypes mPreferredNetworkType; + UINT8 mNetworkCount; + + struct sNetwork + { + eQMIWDSDataSystemNetworkTypes mNetworkType; + + // The following union is based on the value of mNetworkType + union uValOfNetworkType + { + // If the value of mNetworkType == 0 + struct sNetworkTypeIs0 + { + bool mWCDMA:1; + bool mGPRS:1; + bool mHSDPA:1; + bool mHSUPA:1; + bool mEDGE:1; + bool mLTE:1; + bool mHSDPAPlus:1; + bool mDualCellHSDPAPlus:1; + bool m64QAM:1; + bool mTDSCDMA:1; + + // Padding out 21 bits + UINT8 mReserved1:6; + UINT8 mReserved2; + UINT8 mReserved3:7; + + bool mNULLBearer:1; + }; + + sNetworkTypeIs0 mNetworkTypeIs0; + + // If the value of mNetworkType == 1 + struct sNetworkTypeIs1 + { + bool mCDMA1x:1; + bool mCDMA1xEvDORev0:1; + bool mCDMA1xEvDORevA:1; + bool mCDMA1xEvDORevB:1; + bool mCDMAEHRPD:1; + bool mCDMAFMC:1; + + // Padding out 25 bits + UINT8 mReserved4:2; + UINT8 mReserved5[2]; + UINT8 mReserved6:7; + + bool mNULLBearer:1; + + // The following union is for handing all mCDMA1x types + union uValOfCDMA1xTypes + { + // If the value of mCDMA1x == 1 + struct sCDMA1xIs1 + { + bool mCDMA1xIS95:1; + bool mCDMA1xIS2000:1; + bool mCDMA1xIS2000RelA:1; + + // Padding out 29 bits + UINT8 mReserved7:5; + UINT8 mReserved8[3]; + }; + + sCDMA1xIs1 mCDMA1xIs1; + + // If the value of mCDMA1xEvDORev0 == 1 + struct sCDMA1xEvDORev0Is1 + { + bool mCDMA1xEvDORev0DPA:1; + + // Padding out 31 bits + UINT8 mReserved9:7; + UINT8 mReserved10[3]; + }; + + sCDMA1xEvDORev0Is1 mCDMA1xEvDORev0Is1; + + // If the value of mCDMA1xEvDORevA == 1 + struct sCDMA1xEvDORevAIs1 + { + bool mCDMA1xEvDORevADPA:1; + bool mCDMA1xEvDORevAMFPA:1; + bool mCDMA1xEvDORevAEMPA:1; + bool mCDMA1xEvDORevAEMPAEHRPD:1; + + // Padding out 28 bits + UINT8 mReserved11:4; + UINT8 mReserved12[3]; + }; + + sCDMA1xEvDORevAIs1 mCDMA1xEvDORevAIs1; + + // If the value of mCDMA1xEvDORevB == 1 + struct sCDMA1xEvDORevBIs1 + { + bool mCDMA1xEvDORevBDPA:1; + bool mCDMA1xEvDORevBMFPA:1; + bool mCDMA1xEvDORevBEMPA:1; + bool mCDMA1xEvDORevBEMPAEHRPD:1; + bool mCDMA1xEvDORevBMMPA:1; + bool mCDMA1xEvDORevBMMPAEHRPD:1; + + // Padding out 26 bits + UINT8 mReserved13:2; + UINT8 mReserved14[3]; + }; + + sCDMA1xEvDORevBIs1 mCDMA1xEvDORevBIs1; + + // Padding out 32 bits + UINT8 mReserved15[4]; + }; + + uValOfCDMA1xTypes mValOfCDMA1xTypes; + }; + + sNetworkTypeIs1 mNetworkTypeIs1; + + // Padding out 64 bits + UINT8 mReserved16[8]; + }; + + uValOfNetworkType mValOfNetworkType; + }; + + // This array must be the size specified by mNetworkCount + // sNetwork mNetworks[1]; +}; + +// Structure to describe indication TLV 0x25 for WDS EventReport +struct sWDSEventReportIndication_TXPacketsDropped +{ + UINT32 mTXPacketsDropped; +}; + +// Structure to describe indication TLV 0x26 for WDS EventReport +struct sWDSEventReportIndication_RXPacketsDropped +{ + UINT32 mRXPacketsDropped; +}; + +// Structure to describe indication TLV 0x27 for WDS EventReport +struct sWDSEventReportIndication_UplinkFlowControl +{ + INT8 mUplinkFlowControlEnabled; +}; + +// Structure to describe request TLV 0x01 for WDSAbort() +struct sWDSAbortRequest_TransactionID +{ + UINT16 mTransactionID; +}; + +// Structure to describe request TLV 0x10 for WDSSetIndication() +struct sWDSSetIndicationRequest_TMGIList +{ + INT8 mReportEMBMSTMGIList; +}; + +// Structure to describe request TLV 0x10 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x11 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x12 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_PrimaryNBNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x13 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_SecondaryNBNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x14 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_ContextAPNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0x15 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x16 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe request TLV 0x17 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x18 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_Password +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x19 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_IPFamily +{ + eQMIWDSIPFamilies mIPFamily; +}; + +// Structure to describe request TLV 0x30 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_TechnologyPreference +{ + bool mEnable3GPP:1; + bool mEnable3GPP2:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe request TLV 0x31 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_3GPPProfileIdentifier +{ + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x32 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_3GPP2ProfileIdentifier +{ + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x33 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_Autoconnect +{ + eQMIWDSAutoconnectSettings mAutoconnectSetting; +}; + +// Structure to describe request TLV 0x34 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_ExtendedTechnologyPreference +{ + eQMIWDSExtendedTechPrefs mExtendedTechnologyPreference; +}; + +// Structure to describe request TLV 0x35 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceRequest_CallType +{ + eQMIWDSCallTypes mCallType; +}; + +// Structure to describe response TLV 0x01 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceResponse_PacketDataHandle +{ + UINT32 mPacketDataHandle; +}; + +// Structure to describe response TLV 0x10 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceResponse_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe response TLV 0x11 for WDSStartNetworkInterface() +struct sWDSStartNetworkInterfaceResponse_VerboseCallEndReason +{ + eQMIWDSCallEndReasonTypes mCallEndReasonType; + + // The following union is based on the value of mCallEndReasonType + union uValOfCallEndReasonType + { + // Always present + UINT16 mCallEndReasonValue; + + // If the value of mCallEndReasonType == 1 + struct sCallEndReasonTypeIs1 + { + eQMIWDSMobileIPCallEndReasons mMobileIPCallEndReason; + }; + + sCallEndReasonTypeIs1 mCallEndReasonTypeIs1; + + // If the value of mCallEndReasonType == 2 + struct sCallEndReasonTypeIs2 + { + eQMIWDSInternalCallEndReasons mInternalCallEndReason; + }; + + sCallEndReasonTypeIs2 mCallEndReasonTypeIs2; + + // If the value of mCallEndReasonType == 3 + struct sCallEndReasonTypeIs3 + { + eQMIWDSCallManagerCallEndReasons mCallManagerCallEndReason; + }; + + sCallEndReasonTypeIs3 mCallEndReasonTypeIs3; + + // If the value of mCallEndReasonType == 6 + struct sCallEndReasonTypeIs6 + { + eQMIWDS3GPPCallEndReasons m3GPPCallEndReason; + }; + + sCallEndReasonTypeIs6 mCallEndReasonTypeIs6; + + // If the value of mCallEndReasonType == 7 + struct sCallEndReasonTypeIs7 + { + eQMIWDSPPPCallEndReason mPPPCallEndReason; + }; + + sCallEndReasonTypeIs7 mCallEndReasonTypeIs7; + + // If the value of mCallEndReasonType == 8 + struct sCallEndReasonTypeIs8 + { + eQMIWDSEHRPDCallEndReason mEHRPDCallEndReason; + }; + + sCallEndReasonTypeIs8 mCallEndReasonTypeIs8; + + // If the value of mCallEndReasonType == 9 + struct sCallEndReasonTypeIs9 + { + eQMIWDSIPv6CallEndReason mIPv6CallEndReason; + }; + + sCallEndReasonTypeIs9 mCallEndReasonTypeIs9; + + // Padding out 16 bits + UINT8 mReserved1[2]; + }; + + uValOfCallEndReasonType mValOfCallEndReasonType; +}; + +// Structure to describe request TLV 0x01 for WDSStopNetworkInterface() +struct sWDSStopNetworkInterfaceRequest_PacketDataHandle +{ + UINT32 mPacketDataHandle; +}; + +// Structure to describe request TLV 0x10 for WDSStopNetworkInterface() +struct sWDSStopNetworkInterfaceRequest_Autoconnect +{ + INT8 mAutoconnectOff; +}; + +// Structure to describe response TLV 0x01 for WDSGetPacketServiceStatus() +struct sWDSGetPacketServiceStatusResponse_Status +{ + eQMIConnectionStatus mConnectionStatus; +}; + +// Structure to describe indication TLV 0x01 for WDS PacketServiceStatusReport +struct sWDSPacketServiceStatusReportIndication_Status +{ + eQMIConnectionStatus mConnectionStatus; + INT8 mReconfigureRequired; +}; + +// Structure to describe indication TLV 0x10 for WDS PacketServiceStatusReport +struct sWDSPacketServiceStatusReportIndication_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe indication TLV 0x11 for WDS PacketServiceStatusReport +struct sWDSPacketServiceStatusReportIndication_VerboseCallEndReason +{ + eQMIWDSCallEndReasonTypes mCallEndReasonType; + + // The following union is based on the value of mCallEndReasonType + union uValOfCallEndReasonType + { + // Always present + UINT16 mCallEndReasonValue; + + // If the value of mCallEndReasonType == 1 + struct sCallEndReasonTypeIs1 + { + eQMIWDSMobileIPCallEndReasons mMobileIPCallEndReason; + }; + + sCallEndReasonTypeIs1 mCallEndReasonTypeIs1; + + // If the value of mCallEndReasonType == 2 + struct sCallEndReasonTypeIs2 + { + eQMIWDSInternalCallEndReasons mInternalCallEndReason; + }; + + sCallEndReasonTypeIs2 mCallEndReasonTypeIs2; + + // If the value of mCallEndReasonType == 3 + struct sCallEndReasonTypeIs3 + { + eQMIWDSCallManagerCallEndReasons mCallManagerCallEndReason; + }; + + sCallEndReasonTypeIs3 mCallEndReasonTypeIs3; + + // If the value of mCallEndReasonType == 6 + struct sCallEndReasonTypeIs6 + { + eQMIWDS3GPPCallEndReasons m3GPPCallEndReason; + }; + + sCallEndReasonTypeIs6 mCallEndReasonTypeIs6; + + // If the value of mCallEndReasonType == 7 + struct sCallEndReasonTypeIs7 + { + eQMIWDSPPPCallEndReason mPPPCallEndReason; + }; + + sCallEndReasonTypeIs7 mCallEndReasonTypeIs7; + + // If the value of mCallEndReasonType == 8 + struct sCallEndReasonTypeIs8 + { + eQMIWDSEHRPDCallEndReason mEHRPDCallEndReason; + }; + + sCallEndReasonTypeIs8 mCallEndReasonTypeIs8; + + // If the value of mCallEndReasonType == 9 + struct sCallEndReasonTypeIs9 + { + eQMIWDSIPv6CallEndReason mIPv6CallEndReason; + }; + + sCallEndReasonTypeIs9 mCallEndReasonTypeIs9; + + // Padding out 16 bits + UINT8 mReserved1[2]; + }; + + uValOfCallEndReasonType mValOfCallEndReasonType; +}; + +// Structure to describe indication TLV 0x12 for WDS PacketServiceStatusReport +struct sWDSPacketServiceStatusReportIndication_IPFamily +{ + eQMIWDSIPFamilies mIPFamily; +}; + +// Structure to describe indication TLV 0x13 for WDS PacketServiceStatusReport +struct sWDSPacketServiceStatusReportIndication_ExtendedTechnology +{ + eQMIWDSExtendedTechPrefs mExtendedTechnology; +}; + +// Structure to describe response TLV 0x01 for WDSGetChannelRates() +struct sWDSGetChannelRatesResponse_ChannelRates +{ + UINT32 mChannelTXRatebps; + UINT32 mChannelRXRatebps; + UINT32 mMaxChannelTXRatebps; + UINT32 mMaxChannelRXRatebps; +}; + +// Structure to describe request TLV 0x01 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsRequest_PacketStatsMask +{ + bool mReportTXPacketSuccesses:1; + bool mReportRXPacketSuccesses:1; + bool mReportTXPacketErrors:1; + bool mReportRXPacketErrors:1; + bool mReportTXOverflows:1; + bool mReportRXOverflows:1; + bool mTXByteTotal:1; + bool mRXByteTotal:1; + bool mTXPacketsDropped:1; + bool mRXPacketsDropped:1; + + // Padding out 22 bits + UINT8 mReserved1:6; + UINT8 mReserved2[2]; +}; + +// Structure to describe response TLV 0x10 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_TXPacketSuccesses +{ + UINT32 mTXPacketSuccesses; +}; + +// Structure to describe response TLV 0x11 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_RXPacketSuccesses +{ + UINT32 mRXPacketSuccesses; +}; + +// Structure to describe response TLV 0x12 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_TXPacketErrors +{ + UINT32 mTXPacketErrors; +}; + +// Structure to describe response TLV 0x13 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_RXPacketErrors +{ + UINT32 mRXPacketErrors; +}; + +// Structure to describe response TLV 0x14 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_TXOverflows +{ + UINT32 mTXOverflows; +}; + +// Structure to describe response TLV 0x15 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_RXOverflows +{ + UINT32 mRXOverflows; +}; + +// Structure to describe response TLV 0x19 for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_TXBytes +{ + UINT64 mTXByteTotal; +}; + +// Structure to describe response TLV 0x1A for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_RXBytes +{ + UINT64 mRXByteTotal; +}; + +// Structure to describe response TLV 0x1B for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_PreviousTXBytes +{ + UINT64 mPreviousCallTXByteTotal; +}; + +// Structure to describe response TLV 0x1C for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_PreviousRXBytes +{ + UINT64 mPreviousCallRXByteTotal; +}; + +// Structure to describe response TLV 0x1D for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_TXPacketsDropped +{ + UINT32 mTXPacketsDropped; +}; + +// Structure to describe response TLV 0x1E for WDSGetPacketStatistics() +struct sWDSGetPacketStatisticsResponse_RXPacketsDropped +{ + UINT32 mRXPacketsDropped; +}; + +// Structure to describe request TLV 0x01 for WDSCreateProfile() +struct sWDSCreateProfileRequest_ProfileType +{ + eQMIProfileTypes mProfileType; +}; + +// Structure to describe request TLV 0x10 for WDSCreateProfile() +struct sWDSCreateProfileRequest_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe request TLV 0x11 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe request TLV 0x12 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPHeaderCompressionType +{ + eQMIWDSPDPHeaderCompressionType mPDPHeaderCompressionType; +}; + +// Structure to describe request TLV 0x13 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPDataCompressionType +{ + eQMIWDSPDPDataCompressionType mPDPDataCompressionType; +}; + +// Structure to describe request TLV 0x14 for WDSCreateProfile() +struct sWDSCreateProfileRequest_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0x15 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x16 for WDSCreateProfile() +struct sWDSCreateProfileRequest_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x17 for WDSCreateProfile() +struct sWDSCreateProfileRequest_UMTSRequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x18 for WDSCreateProfile() +struct sWDSCreateProfileRequest_UMTSMinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x19 for WDSCreateProfile() +struct sWDSCreateProfileRequest_GPRSRequestedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1A for WDSCreateProfile() +struct sWDSCreateProfileRequest_GPRSMinimumQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1B for WDSCreateProfile() +struct sWDSCreateProfileRequest_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x1C for WDSCreateProfile() +struct sWDSCreateProfileRequest_Password +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x1D for WDSCreateProfile() +struct sWDSCreateProfileRequest_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe request TLV 0x1E for WDSCreateProfile() +struct sWDSCreateProfileRequest_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x1F for WDSCreateProfile() +struct sWDSCreateProfileRequest_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe request TLV 0x20 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPAccessControlFlag +{ + eQMIWDSPDPAccessControlFlag mPDPAccessControlFlag; +}; + +// Structure to describe request TLV 0x21 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PCSCFAddressUsingDHCP +{ + INT8 mPCSCFAddressUsingDHCP; +}; + +// Structure to describe request TLV 0x22 for WDSCreateProfile() +struct sWDSCreateProfileRequest_IMCNFlag +{ + INT8 mIMCN; +}; + +// Structure to describe request TLV 0x23 for WDSCreateProfile() +struct sWDSCreateProfileRequest_TrafficFlowTemplateID1Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x24 for WDSCreateProfile() +struct sWDSCreateProfileRequest_TrafficFlowTemplateID2Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x25 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPContextNumber +{ + UINT8 mPDPContextNumber; +}; + +// Structure to describe request TLV 0x26 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPContextSecondaryFlag +{ + INT8 mPDPContextSecondaryFlag; +}; + +// Structure to describe request TLV 0x27 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDPContextPrimaryID +{ + UINT8 mPDPPrimaryID; +}; + +// Structure to describe request TLV 0x28 for WDSCreateProfile() +struct sWDSCreateProfileRequest_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x29 for WDSCreateProfile() +struct sWDSCreateProfileRequest_RequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2A for WDSCreateProfile() +struct sWDSCreateProfileRequest_MinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2B for WDSCreateProfile() +struct sWDSCreateProfileRequest_PrimaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2C for WDSCreateProfile() +struct sWDSCreateProfileRequest_SecondaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2D for WDSCreateProfile() +struct sWDSCreateProfileRequest_AddressPreference +{ + eQMIWDSAddressAllocationPreference mAddressAllocationPreference; +}; + +// Structure to describe request TLV 0x2E for WDSCreateProfile() +struct sWDSCreateProfileRequest_LTEQoSParameters +{ + eQMIWDSQoSClassIdentifier mQoSClassIdentifier; + UINT32 mGuaranteedDownlinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mMaxUplinkBitrate; +}; + +// Structure to describe request TLV 0x2F for WDSCreateProfile() +struct sWDSCreateProfileRequest_APNDisabled +{ + INT8 mAPNDisabled; +}; + +// Structure to describe request TLV 0x30 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerSeconds; +}; + +// Structure to describe request TLV 0x31 for WDSCreateProfile() +struct sWDSCreateProfileRequest_APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe request TLV 0x35 for WDSCreateProfile() +struct sWDSCreateProfileRequest_APNBearer +{ + bool mGSM:1; + bool mWCDMA:1; + bool mLTE:1; + + // Padding out 60 bits + UINT8 mReserved1:5; + UINT8 mReserved2[6]; + UINT8 mReserved3:7; + + bool mAny:1; +}; + +// Structure to describe request TLV 0x8F for WDSCreateProfile() +struct sWDSCreateProfileRequest_ProfilePersistent +{ + INT8 mProfilePersistent; +}; + +// Structure to describe request TLV 0x90 for WDSCreateProfile() +struct sWDSCreateProfileRequest_NegotiateDNSServerPreference +{ + INT8 mNegotiateDNSServerPreference; +}; + +// Structure to describe request TLV 0x91 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PPPSessionCloseTimerDO +{ + UINT32 mPPPSessionCloseTimerDOSeconds; +}; + +// Structure to describe request TLV 0x92 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PPPSessionCloseTimer1X +{ + UINT32 mPPPSessionCloseTimer1XSeconds; +}; + +// Structure to describe request TLV 0x93 for WDSCreateProfile() +struct sWDSCreateProfileRequest_AllowLinger +{ + INT8 mAllowLinger; +}; + +// Structure to describe request TLV 0x94 for WDSCreateProfile() +struct sWDSCreateProfileRequest_LCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x95 for WDSCreateProfile() +struct sWDSCreateProfileRequest_IPCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x96 for WDSCreateProfile() +struct sWDSCreateProfileRequest_AuthenticationTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x97 for WDSCreateProfile() +struct sWDSCreateProfileRequest_LCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x98 for WDSCreateProfile() +struct sWDSCreateProfileRequest_IPCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x99 for WDSCreateProfile() +struct sWDSCreateProfileRequest_AuthenticationRetry +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x9A for WDSCreateProfile() +struct sWDSCreateProfileRequest_AuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe request TLV 0x9B for WDSCreateProfile() +struct sWDSCreateProfileRequest_UserID +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x9C for WDSCreateProfile() +struct sWDSCreateProfileRequest_AuthenticationPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x9D for WDSCreateProfile() +struct sWDSCreateProfileRequest_DataRate +{ + eQMIWDSDataRate mDataRate; +}; + +// Structure to describe request TLV 0x9E for WDSCreateProfile() +struct sWDSCreateProfileRequest_ApplicationType +{ + eQMIWDSApplicationType mApplicationType; +}; + +// Structure to describe request TLV 0x9F for WDSCreateProfile() +struct sWDSCreateProfileRequest_DataMode +{ + eQMIWDSDataMode mDataMode; +}; + +// Structure to describe request TLV 0xA0 for WDSCreateProfile() +struct sWDSCreateProfileRequest_ApplicationPriority +{ + UINT8 mApplicationPriority; +}; + +// Structure to describe request TLV 0xA1 for WDSCreateProfile() +struct sWDSCreateProfileRequest_APNString +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0xA2 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDNType +{ + eQMIWDSPDNType mPDNType; +}; + +// Structure to describe request TLV 0xA3 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PCSCFAddressNeeded +{ + INT8 mPCSCFAddressNeeded; +}; + +// Structure to describe request TLV 0xA4 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PrimaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA5 for WDSCreateProfile() +struct sWDSCreateProfileRequest_SecondaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA6 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PrimaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0xA7 for WDSCreateProfile() +struct sWDSCreateProfileRequest_SecondaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0xA8 for WDSCreateProfile() +struct sWDSCreateProfileRequest_RATType +{ + eQMIWDS3GPP2RATTypes mRATType; +}; + +// Structure to describe request TLV 0xA9 for WDSCreateProfile() +struct sWDSCreateProfileRequest_3GPP2APNEnabled +{ + INT8 mAPNEnabled; +}; + +// Structure to describe request TLV 0xAA for WDSCreateProfile() +struct sWDSCreateProfileRequest_3GPP2PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerMinutes; +}; + +// Structure to describe request TLV 0xAB for WDSCreateProfile() +struct sWDSCreateProfileRequest_3GPP2APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe request TLV 0xAD for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDNAuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe request TLV 0xAE for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDNUserID +{ + // String is variable length, but must be size of the container + // char mUserID[1]; +}; + +// Structure to describe request TLV 0xAF for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDNPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0xB0 for WDSCreateProfile() +struct sWDSCreateProfileRequest_PDNLabel +{ + // String is variable length, but must be size of the container + // char mLabel[1]; +}; + +// Structure to describe response TLV 0x01 for WDSCreateProfile() +struct sWDSCreateProfileResponse_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0xE0 for WDSCreateProfile() +struct sWDSCreateProfileResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSModifyProfile() +struct sWDSModifyProfileRequest_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x10 for WDSModifyProfile() +struct sWDSModifyProfileRequest_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe request TLV 0x11 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe request TLV 0x12 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPHeaderCompressionType +{ + eQMIWDSPDPHeaderCompressionType mPDPHeaderCompressionType; +}; + +// Structure to describe request TLV 0x13 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPDataCompressionType +{ + eQMIWDSPDPDataCompressionType mPDPDataCompressionType; +}; + +// Structure to describe request TLV 0x14 for WDSModifyProfile() +struct sWDSModifyProfileRequest_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0x15 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x16 for WDSModifyProfile() +struct sWDSModifyProfileRequest_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x17 for WDSModifyProfile() +struct sWDSModifyProfileRequest_UMTSRequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x18 for WDSModifyProfile() +struct sWDSModifyProfileRequest_UMTSMinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x19 for WDSModifyProfile() +struct sWDSModifyProfileRequest_GPRSRequestedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1A for WDSModifyProfile() +struct sWDSModifyProfileRequest_GPRSMinimumQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1B for WDSModifyProfile() +struct sWDSModifyProfileRequest_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x1C for WDSModifyProfile() +struct sWDSModifyProfileRequest_Password +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x1D for WDSModifyProfile() +struct sWDSModifyProfileRequest_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe request TLV 0x1E for WDSModifyProfile() +struct sWDSModifyProfileRequest_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x1F for WDSModifyProfile() +struct sWDSModifyProfileRequest_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe request TLV 0x20 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPAccessControlFlag +{ + eQMIWDSPDPAccessControlFlag mPDPAccessControlFlag; +}; + +// Structure to describe request TLV 0x21 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PCSCFAddressUsingDHCP +{ + INT8 mPCSCFAddressUsingDHCP; +}; + +// Structure to describe request TLV 0x22 for WDSModifyProfile() +struct sWDSModifyProfileRequest_IMCNFlag +{ + INT8 mIMCN; +}; + +// Structure to describe request TLV 0x23 for WDSModifyProfile() +struct sWDSModifyProfileRequest_TrafficFlowTemplateID1Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x24 for WDSModifyProfile() +struct sWDSModifyProfileRequest_TrafficFlowTemplateID2Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x25 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPContextNumber +{ + UINT8 mPDPContextNumber; +}; + +// Structure to describe request TLV 0x26 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPContextSecondaryFlag +{ + INT8 mPDPContextSecondaryFlag; +}; + +// Structure to describe request TLV 0x27 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDPContextPrimaryID +{ + UINT8 mPDPPrimaryID; +}; + +// Structure to describe request TLV 0x28 for WDSModifyProfile() +struct sWDSModifyProfileRequest_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x29 for WDSModifyProfile() +struct sWDSModifyProfileRequest_RequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2A for WDSModifyProfile() +struct sWDSModifyProfileRequest_MinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2B for WDSModifyProfile() +struct sWDSModifyProfileRequest_PrimaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2C for WDSModifyProfile() +struct sWDSModifyProfileRequest_SecondaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2D for WDSModifyProfile() +struct sWDSModifyProfileRequest_AddressPreference +{ + eQMIWDSAddressAllocationPreference mAddressAllocationPreference; +}; + +// Structure to describe request TLV 0x2E for WDSModifyProfile() +struct sWDSModifyProfileRequest_LTEQoSParameters +{ + eQMIWDSQoSClassIdentifier mQoSClassIdentifier; + UINT32 mGuaranteedDownlinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mMaxUplinkBitrate; +}; + +// Structure to describe request TLV 0x2F for WDSModifyProfile() +struct sWDSModifyProfileRequest_APNDisabled +{ + INT8 mAPNDisabled; +}; + +// Structure to describe request TLV 0x30 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerSeconds; +}; + +// Structure to describe request TLV 0x31 for WDSModifyProfile() +struct sWDSModifyProfileRequest_APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe request TLV 0x35 for WDSModifyProfile() +struct sWDSModifyProfileRequest_APNBearer +{ + bool mGSM:1; + bool mWCDMA:1; + bool mLTE:1; + + // Padding out 60 bits + UINT8 mReserved1:5; + UINT8 mReserved2[6]; + UINT8 mReserved3:7; + + bool mAny:1; +}; + +// Structure to describe request TLV 0x90 for WDSModifyProfile() +struct sWDSModifyProfileRequest_NegotiateDNSServerPrefrence +{ + INT8 mNegotiateDNSServerPreference; +}; + +// Structure to describe request TLV 0x91 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PPPSessionCloseTimerDO +{ + UINT32 mPPPSessionCloseTimerDOSeconds; +}; + +// Structure to describe request TLV 0x92 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PPPSessionCloseTimer1X +{ + UINT32 mPPPSessionCloseTimer1XSeconds; +}; + +// Structure to describe request TLV 0x93 for WDSModifyProfile() +struct sWDSModifyProfileRequest_AllowLinger +{ + INT8 mAllowLinger; +}; + +// Structure to describe request TLV 0x94 for WDSModifyProfile() +struct sWDSModifyProfileRequest_LCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x95 for WDSModifyProfile() +struct sWDSModifyProfileRequest_IPCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x96 for WDSModifyProfile() +struct sWDSModifyProfileRequest_AuthenticationTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x97 for WDSModifyProfile() +struct sWDSModifyProfileRequest_LCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x98 for WDSModifyProfile() +struct sWDSModifyProfileRequest_IPCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x99 for WDSModifyProfile() +struct sWDSModifyProfileRequest_AuthenticationRetry +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x9A for WDSModifyProfile() +struct sWDSModifyProfileRequest_AuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe request TLV 0x9B for WDSModifyProfile() +struct sWDSModifyProfileRequest_UserID +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x9C for WDSModifyProfile() +struct sWDSModifyProfileRequest_AuthenticationPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x9D for WDSModifyProfile() +struct sWDSModifyProfileRequest_DataRate +{ + eQMIWDSDataRate mDataRate; +}; + +// Structure to describe request TLV 0x9E for WDSModifyProfile() +struct sWDSModifyProfileRequest_ApplicationType +{ + eQMIWDSApplicationType mApplicationType; +}; + +// Structure to describe request TLV 0x9F for WDSModifyProfile() +struct sWDSModifyProfileRequest_DataMode +{ + eQMIWDSDataMode mDataMode; +}; + +// Structure to describe request TLV 0xA0 for WDSModifyProfile() +struct sWDSModifyProfileRequest_ApplicationPriority +{ + UINT8 mApplicationPriority; +}; + +// Structure to describe request TLV 0xA1 for WDSModifyProfile() +struct sWDSModifyProfileRequest_APNString +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0xA2 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDNType +{ + eQMIWDSPDNType mPDNType; +}; + +// Structure to describe request TLV 0xA3 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PCSCFAddressNeeded +{ + INT8 mPCSCFAddressNeeded; +}; + +// Structure to describe request TLV 0xA4 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PrimaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA5 for WDSModifyProfile() +struct sWDSModifyProfileRequest_SecondaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA6 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PrimaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0xA7 for WDSModifyProfile() +struct sWDSModifyProfileRequest_SecondaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0xA8 for WDSModifyProfile() +struct sWDSModifyProfileRequest_RATType +{ + eQMIWDS3GPP2RATTypes mRATType; +}; + +// Structure to describe request TLV 0xA9 for WDSModifyProfile() +struct sWDSModifyProfileRequest_3GPP2APNEnabled +{ + INT8 mAPNEnabled; +}; + +// Structure to describe request TLV 0xAA for WDSModifyProfile() +struct sWDSModifyProfileRequest_3GPP2PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerMinutes; +}; + +// Structure to describe request TLV 0xAB for WDSModifyProfile() +struct sWDSModifyProfileRequest_3GPP2APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe request TLV 0xAD for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDNAuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe request TLV 0xAE for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDNUserID +{ + // String is variable length, but must be size of the container + // char mUserID[1]; +}; + +// Structure to describe request TLV 0xAF for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDNPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0xB0 for WDSModifyProfile() +struct sWDSModifyProfileRequest_PDNLabel +{ + // String is variable length, but must be size of the container + // char mLabel[1]; +}; + +// Structure to describe response TLV 0xE0 for WDSModifyProfile() +struct sWDSModifyProfileResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSDeleteProfile() +struct sWDSDeleteProfileRequest_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0xE0 for WDSDeleteProfile() +struct sWDSDeleteProfileResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x10 for WDSGetProfileList() +struct sWDSGetProfileListRequest_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe request TLV 0x11 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe request TLV 0x12 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPHeaderCompressionType +{ + eQMIWDSPDPHeaderCompressionType mPDPHeaderCompressionType; +}; + +// Structure to describe request TLV 0x13 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPDataCompressionType +{ + eQMIWDSPDPDataCompressionType mPDPDataCompressionType; +}; + +// Structure to describe request TLV 0x14 for WDSGetProfileList() +struct sWDSGetProfileListRequest_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0x15 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x16 for WDSGetProfileList() +struct sWDSGetProfileListRequest_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x17 for WDSGetProfileList() +struct sWDSGetProfileListRequest_UMTSRequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x18 for WDSGetProfileList() +struct sWDSGetProfileListRequest_UMTSMinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe request TLV 0x19 for WDSGetProfileList() +struct sWDSGetProfileListRequest_GPRSRequestedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1A for WDSGetProfileList() +struct sWDSGetProfileListRequest_GPRSMinimumQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe request TLV 0x1B for WDSGetProfileList() +struct sWDSGetProfileListRequest_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x1C for WDSGetProfileList() +struct sWDSGetProfileListRequest_Password +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x1D for WDSGetProfileList() +struct sWDSGetProfileListRequest_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe request TLV 0x1E for WDSGetProfileList() +struct sWDSGetProfileListRequest_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x1F for WDSGetProfileList() +struct sWDSGetProfileListRequest_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe request TLV 0x20 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPAccessControlFlag +{ + eQMIWDSPDPAccessControlFlag mPDPAccessControlFlag; +}; + +// Structure to describe request TLV 0x21 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PCSCFAddressUsingDHCP +{ + INT8 mPCSCFAddressUsingDHCP; +}; + +// Structure to describe request TLV 0x22 for WDSGetProfileList() +struct sWDSGetProfileListRequest_IMCNFlag +{ + INT8 mIMCN; +}; + +// Structure to describe request TLV 0x23 for WDSGetProfileList() +struct sWDSGetProfileListRequest_TrafficFlowTemplateID1Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x24 for WDSGetProfileList() +struct sWDSGetProfileListRequest_TrafficFlowTemplateID2Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe request TLV 0x25 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPContextNumber +{ + UINT8 mPDPContextNumber; +}; + +// Structure to describe request TLV 0x26 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPContextSecondaryFlag +{ + INT8 mPDPContextSecondaryFlag; +}; + +// Structure to describe request TLV 0x27 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDPContextPrimaryID +{ + UINT8 mPDPPrimaryID; +}; + +// Structure to describe request TLV 0x28 for WDSGetProfileList() +struct sWDSGetProfileListRequest_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x29 for WDSGetProfileList() +struct sWDSGetProfileListRequest_RequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2A for WDSGetProfileList() +struct sWDSGetProfileListRequest_MinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe request TLV 0x2B for WDSGetProfileList() +struct sWDSGetProfileListRequest_PrimaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2C for WDSGetProfileList() +struct sWDSGetProfileListRequest_SecondaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x2D for WDSGetProfileList() +struct sWDSGetProfileListRequest_AddressPreference +{ + eQMIWDSAddressAllocationPreference mAddressAllocationPreference; +}; + +// Structure to describe request TLV 0x2E for WDSGetProfileList() +struct sWDSGetProfileListRequest_LTEQoSParameters +{ + eQMIWDSQoSClassIdentifier mQoSClassIdentifier; + UINT32 mGuaranteedDownlinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mMaxUplinkBitrate; +}; + +// Structure to describe request TLV 0x90 for WDSGetProfileList() +struct sWDSGetProfileListRequest_NegotiateDNSServerPreferences +{ + INT8 mNegotiateDNSServerPreference; +}; + +// Structure to describe request TLV 0x91 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PPPSessionCloseTimerDO +{ + UINT32 mPPPSessionCloseTimerDOSeconds; +}; + +// Structure to describe request TLV 0x92 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PPPSessionCloseTimer1X +{ + UINT32 mPPPSessionCloseTimer1XSeconds; +}; + +// Structure to describe request TLV 0x93 for WDSGetProfileList() +struct sWDSGetProfileListRequest_AllowLinger +{ + INT8 mAllowLinger; +}; + +// Structure to describe request TLV 0x94 for WDSGetProfileList() +struct sWDSGetProfileListRequest_LCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x95 for WDSGetProfileList() +struct sWDSGetProfileListRequest_IPCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x96 for WDSGetProfileList() +struct sWDSGetProfileListRequest_AuthenticationTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe request TLV 0x97 for WDSGetProfileList() +struct sWDSGetProfileListRequest_LCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x98 for WDSGetProfileList() +struct sWDSGetProfileListRequest_IPCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x99 for WDSGetProfileList() +struct sWDSGetProfileListRequest_AuthenticationRetry +{ + UINT8 mRetryCount; +}; + +// Structure to describe request TLV 0x9A for WDSGetProfileList() +struct sWDSGetProfileListRequest_AuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe request TLV 0x9B for WDSGetProfileList() +struct sWDSGetProfileListRequest_UserID +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe request TLV 0x9C for WDSGetProfileList() +struct sWDSGetProfileListRequest_AuthenticationPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe request TLV 0x9D for WDSGetProfileList() +struct sWDSGetProfileListRequest_DataRate +{ + eQMIWDSDataRate mDataRate; +}; + +// Structure to describe request TLV 0x9E for WDSGetProfileList() +struct sWDSGetProfileListRequest_ApplicationType +{ + eQMIWDSApplicationType mApplicationType; +}; + +// Structure to describe request TLV 0x9F for WDSGetProfileList() +struct sWDSGetProfileListRequest_DataMode +{ + eQMIWDSDataMode mDataMode; +}; + +// Structure to describe request TLV 0xA0 for WDSGetProfileList() +struct sWDSGetProfileListRequest_ApplicationPriority +{ + UINT8 mApplicationPriority; +}; + +// Structure to describe request TLV 0xA1 for WDSGetProfileList() +struct sWDSGetProfileListRequest_APNString +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0xA2 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PDNType +{ + eQMIWDSPDNType mPDNType; +}; + +// Structure to describe request TLV 0xA3 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PCSCFAddressNeeded +{ + INT8 mPCSCFAddressNeeded; +}; + +// Structure to describe request TLV 0xA4 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PrimaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA5 for WDSGetProfileList() +struct sWDSGetProfileListRequest_SecondaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0xA6 for WDSGetProfileList() +struct sWDSGetProfileListRequest_PrimaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0xA7 for WDSGetProfileList() +struct sWDSGetProfileListRequest_SecondaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x01 for WDSGetProfileList() +struct sWDSGetProfileListResponse_ProfileList +{ + UINT8 mNumberOfProfiles; + + struct sProfile + { + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; + UINT8 mProfileNameLength; + + // This array must be the size specified by mProfileNameLength + // char mProfileName[1]; + }; + + // This array must be the size specified by mNumberOfProfiles + // sProfile mProfiles[1]; +}; + +// Structure to describe response TLV 0xE0 for WDSGetProfileList() +struct sWDSGetProfileListResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsRequest_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0x10 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe response TLV 0x11 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe response TLV 0x12 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPHeaderCompressionType +{ + eQMIWDSPDPHeaderCompressionType mPDPHeaderCompressionType; +}; + +// Structure to describe response TLV 0x13 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPDataCompressionType +{ + eQMIWDSPDPDataCompressionType mPDPDataCompressionType; +}; + +// Structure to describe response TLV 0x14 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0x15 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x16 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x17 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_UMTSRequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe response TLV 0x18 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_UMTSMinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe response TLV 0x19 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_GPRSRequestedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe response TLV 0x1A for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_GPRSMinimumQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe response TLV 0x1B for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe response TLV 0x1D for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x1E for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x1F for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe response TLV 0x20 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPAccessControlFlag +{ + eQMIWDSPDPAccessControlFlag mPDPAccessControlFlag; +}; + +// Structure to describe response TLV 0x21 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PCSCFAddressUsingDHCP +{ + INT8 mPCSCFAddressUsingDHCP; +}; + +// Structure to describe response TLV 0x22 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_IMCMFlag +{ + INT8 mIMCN; +}; + +// Structure to describe response TLV 0x23 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_TrafficFlowTemplateID1Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe response TLV 0x24 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_TrafficFlowTemplateID2Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe response TLV 0x25 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPContextNumber +{ + UINT8 mPDPContextNumber; +}; + +// Structure to describe response TLV 0x26 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPContextSecondaryFlag +{ + INT8 mPDPContextSecondaryFlag; +}; + +// Structure to describe response TLV 0x27 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDPContextPrimaryID +{ + UINT8 mPDPPrimaryID; +}; + +// Structure to describe response TLV 0x28 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x29 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_RequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe response TLV 0x2A for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_MinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe response TLV 0x2B for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PrimaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x2C for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_SecondaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x2D for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AddressPreference +{ + eQMIWDSAddressAllocationPreference mAddressAllocationPreference; +}; + +// Structure to describe response TLV 0x2E for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_LTEQoSParameters +{ + eQMIWDSQoSClassIdentifier mQoSClassIdentifier; + UINT32 mGuaranteedDownlinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mMaxUplinkBitrate; +}; + +// Structure to describe response TLV 0x2F for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_APNDisabled +{ + INT8 mAPNDisabled; +}; + +// Structure to describe response TLV 0x30 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerSeconds; +}; + +// Structure to describe response TLV 0x31 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe response TLV 0x35 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_APNBearer +{ + bool mGSM:1; + bool mWCDMA:1; + bool mLTE:1; + + // Padding out 60 bits + UINT8 mReserved1:5; + UINT8 mReserved2[6]; + UINT8 mReserved3:7; + + bool mAny:1; +}; + +// Structure to describe response TLV 0x90 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_NegotiateDNSServerPreference +{ + INT8 mNegotiateDNSServerPreference; +}; + +// Structure to describe response TLV 0x91 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PPPSessionCloseTimerDO +{ + UINT32 mPPPSessionCloseTimerDOSeconds; +}; + +// Structure to describe response TLV 0x92 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PPPSessionCloseTimer1X +{ + UINT32 mPPPSessionCloseTimer1XSeconds; +}; + +// Structure to describe response TLV 0x93 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AllowLinger +{ + INT8 mAllowLinger; +}; + +// Structure to describe response TLV 0x94 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_LCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x95 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_IPCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x96 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AuthenticationTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x97 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_LCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x98 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_IPCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x99 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AuthenticationRetry +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x9A for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe response TLV 0x9B for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_UserID +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe response TLV 0x9C for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_AuthenticationPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe response TLV 0x9D for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_DataRate +{ + eQMIWDSDataRate mDataRate; +}; + +// Structure to describe response TLV 0x9E for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_ApplicationType +{ + eQMIWDSApplicationType mApplicationType; +}; + +// Structure to describe response TLV 0x9F for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_DataMode +{ + eQMIWDSDataMode mDataMode; +}; + +// Structure to describe response TLV 0xA0 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_ApplicationPriority +{ + UINT8 mApplicationPriority; +}; + +// Structure to describe response TLV 0xA1 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_APNString +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0xA2 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDNType +{ + eQMIWDSPDNType mPDNType; +}; + +// Structure to describe response TLV 0xA3 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PCSCFAddressNeeded +{ + INT8 mPCSCFAddressNeeded; +}; + +// Structure to describe response TLV 0xA4 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PrimaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0xA5 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_SecondaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0xA6 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PrimaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0xA7 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_SecondaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0xA8 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_RATType +{ + eQMIWDS3GPP2RATTypes mRATType; +}; + +// Structure to describe response TLV 0xA9 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_3GPP2APNEnabled +{ + INT8 mAPNEnabled; +}; + +// Structure to describe response TLV 0xAA for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_3GPP2PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerMinutes; +}; + +// Structure to describe response TLV 0xAB for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_3GPP2APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe response TLV 0xAD for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDNAuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe response TLV 0xAE for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDNUserID +{ + // String is variable length, but must be size of the container + // char mUserID[1]; +}; + +// Structure to describe response TLV 0xAF for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDNPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe response TLV 0xB0 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_PDNLabel +{ + // String is variable length, but must be size of the container + // char mLabel[1]; +}; + +// Structure to describe response TLV 0xE0 for WDSGetProfileSettings() +struct sWDSGetProfileSettingsResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsRequest_ProfileType +{ + eQMIProfileTypes mProfileType; +}; + +// Structure to describe response TLV 0x10 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe response TLV 0x11 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe response TLV 0x12 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPHeaderCompressionType +{ + eQMIWDSPDPHeaderCompressionType mPDPHeaderCompressionType; +}; + +// Structure to describe response TLV 0x13 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPDataCompressionType +{ + eQMIWDSPDPDataCompressionType mPDPDataCompressionType; +}; + +// Structure to describe response TLV 0x14 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0x15 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x16 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x17 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_UMTSRequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe response TLV 0x18 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_UMTSMinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe response TLV 0x19 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_GPRSRequestedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe response TLV 0x1A for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_GPRSMinimumQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe response TLV 0x1B for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe response TLV 0x1C for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_Password +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe response TLV 0x1D for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x1E for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x1F for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe response TLV 0x20 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPAccessControlFlag +{ + eQMIWDSPDPAccessControlFlag mPDPAccessControlFlag; +}; + +// Structure to describe response TLV 0x21 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PCSCFAddressUsingDHCP +{ + INT8 mPCSCFAddressUsingDHCP; +}; + +// Structure to describe response TLV 0x22 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_IMCNFlag +{ + INT8 mIMCN; +}; + +// Structure to describe response TLV 0x23 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_TrafficFlowTemplateID1Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe response TLV 0x24 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_TrafficFlowTemplateID2Parameters +{ + UINT8 mFilterID; + UINT8 mEvaluationID; + eQMIWDSIPVersion mIPVersion; + + // The following union is based on the value of mIPVersion + union uValOfIPVersion + { + // If the value of mIPVersion == 4 + struct sIPVersionIs4 + { + UINT8 mIPV4Address[4]; + }; + + sIPVersionIs4 mIPVersionIs4; + + // If the value of mIPVersion == 6 + struct sIPVersionIs6 + { + UINT16 mIPv6Address[8]; + }; + + sIPVersionIs6 mIPVersionIs6; + + // Padding out 128 bits + UINT8 mReserved1[16]; + }; + + uValOfIPVersion mValOfIPVersion; + + UINT8 mSourceIPMask; + UINT8 mNextHeader; + UINT16 mDestinationPortRangeStart; + UINT16 mDestinationPortRangeEnd; + UINT16 mSourcePortRangeStart; + UINT16 mSourcePortRangeEnd; + UINT32 mIPSECSecurityParameterIndex; + UINT16 mTOSMask; + UINT32 mFlowLabel; +}; + +// Structure to describe response TLV 0x25 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPContextNumber +{ + UINT8 mPDPContextNumber; +}; + +// Structure to describe response TLV 0x26 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPContextSecondaryFlag +{ + INT8 mPDPContextSecondaryFlag; +}; + +// Structure to describe response TLV 0x27 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDPContextPrimaryID +{ + UINT8 mPDPPrimaryID; +}; + +// Structure to describe response TLV 0x28 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x29 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_RequestedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe response TLV 0x2A for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_MinimumQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; + INT8 mSignalingIndication; +}; + +// Structure to describe response TLV 0x2B for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PrimaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x2C for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_SecondaryIPv6 +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x2D for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AddressPreference +{ + eQMIWDSAddressAllocationPreference mAddressAllocationPreference; +}; + +// Structure to describe response TLV 0x2E for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_LTEQoSParameters +{ + eQMIWDSQoSClassIdentifier mQoSClassIdentifier; + UINT32 mGuaranteedDownlinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mMaxUplinkBitrate; +}; + +// Structure to describe response TLV 0x2F for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_APNDisabled +{ + INT8 mAPNDisabled; +}; + +// Structure to describe response TLV 0x30 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerSeconds; +}; + +// Structure to describe response TLV 0x31 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe response TLV 0x35 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_APNBearer +{ + bool mGSM:1; + bool mWCDMA:1; + bool mLTE:1; + + // Padding out 60 bits + UINT8 mReserved1:5; + UINT8 mReserved2[6]; + UINT8 mReserved3:7; + + bool mAny:1; +}; + +// Structure to describe response TLV 0x90 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_NegotiateDNSServerPreferences +{ + INT8 mNegotiateDNSServerPreference; +}; + +// Structure to describe response TLV 0x91 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PPPSessionCloseTimerDO +{ + UINT32 mPPPSessionCloseTimerDOSeconds; +}; + +// Structure to describe response TLV 0x92 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PPPSessionCloseTimer1X +{ + UINT32 mPPPSessionCloseTimer1XSeconds; +}; + +// Structure to describe response TLV 0x93 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AllowLinger +{ + INT8 mAllowLinger; +}; + +// Structure to describe response TLV 0x94 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_LCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x95 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_IPCPACKTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x96 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AuthenticationTimeout +{ + UINT16 mTimeoutMilliseconds; +}; + +// Structure to describe response TLV 0x97 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_LCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x98 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_IPCPConfigRetryCount +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x99 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AuthenticationRetry +{ + UINT8 mRetryCount; +}; + +// Structure to describe response TLV 0x9A for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe response TLV 0x9B for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_UserID +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe response TLV 0x9C for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_AuthenticationPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe response TLV 0x9D for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_DataRate +{ + eQMIWDSDataRate mDataRate; +}; + +// Structure to describe response TLV 0x9E for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_ApplicationType +{ + eQMIWDSApplicationType mApplicationType; +}; + +// Structure to describe response TLV 0x9F for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_DataMode +{ + eQMIWDSDataMode mDataMode; +}; + +// Structure to describe response TLV 0xA0 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_ApplicationPriority +{ + UINT8 mApplicationPriority; +}; + +// Structure to describe response TLV 0xA1 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_APNString +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0xA2 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDNType +{ + eQMIWDSPDNType mPDNType; +}; + +// Structure to describe response TLV 0xA3 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PCSCFAddressNeeded +{ + INT8 mPCSCFAddressNeeded; +}; + +// Structure to describe response TLV 0xA4 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PrimaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0xA5 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_SecondaryIPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0xA6 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PrimaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0xA7 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_SecondaryIPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0xA8 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_RATType +{ + eQMIWDS3GPP2RATTypes mRATType; +}; + +// Structure to describe response TLV 0xA9 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_3GPP2APNEnabled +{ + INT8 mAPNEnabled; +}; + +// Structure to describe response TLV 0xAA for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_3GPP2PDNInactivityTimer +{ + UINT32 mPDNInactivityTimerMinutes; +}; + +// Structure to describe response TLV 0xAB for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_3GPP2APNClass +{ + UINT8 mAPNClass; +}; + +// Structure to describe response TLV 0xAD for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDNAuthenticationProtocol +{ + eQMIWDSAuthenticationProtocol mAuthenticationProtocol; +}; + +// Structure to describe response TLV 0xAE for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDNUserID +{ + // String is variable length, but must be size of the container + // char mUserID[1]; +}; + +// Structure to describe response TLV 0xAF for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDNPassword +{ + // String is variable length, but must be size of the container + // char mPassword[1]; +}; + +// Structure to describe response TLV 0xB0 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_PDNLabel +{ + // String is variable length, but must be size of the container + // char mLabel[1]; +}; + +// Structure to describe response TLV 0xE0 for WDSGetDefaultSettings() +struct sWDSGetDefaultSettingsResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x10 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsRequest_RequestedSettings +{ + bool mProfileID:1; + bool mProfileName:1; + bool mPDPType:1; + bool mAPNName:1; + bool mDNSAddress:1; + bool mGrantedQoS:1; + bool mUsername:1; + bool mAuthenticationProtocol:1; + bool mIPAddress:1; + bool mGatewayInfo:1; + bool mPCSCFAddress:1; + bool mPCSCFServerAddressList:1; + bool mPCSCFDomainNameList:1; + bool mMTU:1; + bool mDomainNameList:1; + bool mIPFamily:1; + bool mIMCNFlag:1; + bool mExtendedTechnology:1; + + // Padding out 14 bits + UINT8 mReserved1:6; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x10 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_ProfileName +{ + // String is variable length, but must be size of the container + // char mProfileName[1]; +}; + +// Structure to describe response TLV 0x11 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PDPType +{ + eQMIPDPTypes mPDPType; +}; + +// Structure to describe response TLV 0x14 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_APNName +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0x15 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x16 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x17 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_UMTSGrantedQoS +{ + eQMITrafficClasses mTrafficClass; + UINT32 mMaxUplinkBitrate; + UINT32 mMaxDownlinkBitrate; + UINT32 mGuaranteedUplinkBitrate; + UINT32 mGuaranteedDownlinkBitrate; + eQMIQoSDeliveryOrders mQoSDeliveryOrder; + UINT32 mMaxSDUSize; + eQMISDUErrorRatios mSDUErrorRatio; + eQMISDUResidualBitErrorRatios mSDUResidualBitErrorRatio; + eQMIErroneousSDUDeliveries mErroneousSDUDelivery; + UINT32 mTransferDelay; + UINT32 mTrafficHandlingPriority; +}; + +// Structure to describe response TLV 0x19 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_GPRSGrantedQoS +{ + UINT32 mPrecedenceClass; + UINT32 mDelayClass; + UINT32 mReliabilityClass; + UINT32 mPeakThroughputClass; + UINT32 mMeanThroughputClass; +}; + +// Structure to describe response TLV 0x1B for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_Username +{ + // String is variable length, but must be size of the container + // char mUsername[1]; +}; + +// Structure to describe response TLV 0x1D for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_Authentication +{ + bool mEnablePAP:1; + bool mEnableCHAP:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x1E for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_IPAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x1F for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_ProfileID +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0x20 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_GatewayAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x21 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_GatewaySubnetMask +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x22 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PCSCF +{ + INT8 mPCSCFAddressUsingPCO; +}; + +// Structure to describe response TLV 0x23 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PCSCFServerAddressList +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + UINT8 mIPV4Address[4]; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x24 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PCSCFDomainNameList +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + UINT16 mFQDNLength; + + // This array must be the size specified by mFQDNLength + // char mFQDN[1]; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x25 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_IPv6Address +{ + UINT16 mIPv6Address[8]; + UINT8 mIPPrefixLength; +}; + +// Structure to describe response TLV 0x26 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_IPv6GatewayAddress +{ + UINT16 mIPv6Address[8]; + UINT8 mIPPrefixLength; +}; + +// Structure to describe response TLV 0x27 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PrimaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x28 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_SecondaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x29 for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_MTU +{ + UINT32 mMTU; +}; + +// Structure to describe response TLV 0x2A for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_DomainNameList +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + UINT16 mDomainNameLength; + + // This array must be the size specified by mDomainNameLength + // char mDomainName[1]; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x2B for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_IPFamily +{ + eQMIWDSIPFamilies mIPFamily; +}; + +// Structure to describe response TLV 0x2C for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_IMCNFlag +{ + INT8 mIMCN; +}; + +// Structure to describe response TLV 0x2D for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_ExtendedTechnology +{ + eQMIWDSExtendedTechPrefs mExtendedTechnologyPreference; +}; + +// Structure to describe response TLV 0x2E for WDSGetCurrentSettings() +struct sWDSGetCurrentSettingsResponse_PCSCFIPv6AddressList +{ + UINT8 mNumberOfAddresses; + + struct sAddress + { + UINT16 mIPv6Address[8]; + }; + + // This array must be the size specified by mNumberOfAddresses + // sAddress mAddresses[1]; +}; + +// Structure to describe request TLV 0x01 for WDSSetMIPMode() +struct sWDSSetMIPModeRequest_MobileIPMode +{ + eQMIMobileIPModes mMIPMode; +}; + +// Structure to describe response TLV 0x01 for WDSGetMIPMode() +struct sWDSGetMIPModeResponse_MobileIPMode +{ + eQMIMobileIPModes mMIPMode; +}; + +// Structure to describe response TLV 0x01 for WDSGetDormancy() +struct sWDSGetDormancyResponse_DormancyStatus +{ + eQMIDormancyStatus mDormancyStatus; +}; + +// Structure to describe response TLV 0x01 for WDSGetAutoconnectSetting() +struct sWDSGetAutoconnectSettingResponse_Autoconnect +{ + eQMIWDSAutoconnectSettings mAutoconnectSetting; +}; + +// Structure to describe response TLV 0x10 for WDSGetAutoconnectSetting() +struct sWDSGetAutoconnectSettingResponse_Roam +{ + eQMIWDSAutoconnectRoamSettings mAutoconnectRoamSetting; +}; + +// Structure to describe response TLV 0x01 for WDSGetDataSessionDuration() +struct sWDSGetDataSessionDurationResponse_Duration +{ + UINT64 mDataSessionDuration; +}; + +// Structure to describe response TLV 0x10 for WDSGetDataSessionDuration() +struct sWDSGetDataSessionDurationResponse_PreviousDuration +{ + UINT64 mPreviousDataSessionDuration; +}; + +// Structure to describe response TLV 0x11 for WDSGetDataSessionDuration() +struct sWDSGetDataSessionDurationResponse_ActiveDuration +{ + UINT64 mDataSessionActiveDuration; +}; + +// Structure to describe response TLV 0x12 for WDSGetDataSessionDuration() +struct sWDSGetDataSessionDurationResponse_PreviousActiveDuration +{ + UINT64 mPreviousDataSessionActiveDuration; +}; + +// Structure to describe response TLV 0x01 for WDSGetModemStatus() +struct sWDSGetModemStatusResponse_Status +{ + eQMIConnectionStatus mConnectionStatus; + UINT64 mDataSessionDuration; +}; + +// Structure to describe response TLV 0x10 for WDSGetModemStatus() +struct sWDSGetModemStatusResponse_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe indication TLV 0x01 for WDS ModemStatusReport +struct sWDSModemStatusReportIndication_Status +{ + eQMIConnectionStatus mConnectionStatus; +}; + +// Structure to describe indication TLV 0x10 for WDS ModemStatusReport +struct sWDSModemStatusReportIndication_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe response TLV 0x01 for WDSGetDataBearerTechnology() +struct sWDSGetDataBearerTechnologyResponse_Technology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe response TLV 0x10 for WDSGetDataBearerTechnology() +struct sWDSGetDataBearerTechnologyResponse_LastCallTechnology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe request TLV 0x01 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_RequestedStatus +{ + bool mConnectionStatus:1; + bool mLastCallEndReason:1; + bool mRXTXByteTotals:1; + bool mDormancyStatus:1; + bool mDataBearerTechnology:1; + bool mChannelRates:1; + bool mDuration:1; + + // Padding out 25 bits + UINT8 mReserved1:1; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x10 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_ConnectionStatusIndicator +{ + INT8 mReportConnectionStatus; +}; + +// Structure to describe request TLV 0x11 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_TransferStatisticsIndicator +{ + UINT8 mTransferStatisticsIntervalSeconds; + + // Padding out 6 bits + UINT8 mReserved1:6; + + bool mTXByteTotal:1; + bool mRXByteTotal:1; + + // Padding out 24 bits + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x12 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_DormancyStatusIndicator +{ + INT8 mReportDormancyStatus; +}; + +// Structure to describe request TLV 0x13 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_DataBearerTechnologyIndicator +{ + INT8 mReportDataBearerTechnology; +}; + +// Structure to describe request TLV 0x14 for WDSGetModemInfo() +struct sWDSGetModemInfoRequest_ChannelRateIndicator +{ + INT8 mReportChannelRate; +}; + +// Structure to describe response TLV 0x10 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_Status +{ + eQMIConnectionStatus mConnectionStatus; + UINT64 mDataSessionDuration; +}; + +// Structure to describe response TLV 0x11 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe response TLV 0x12 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_TXBytes +{ + UINT64 mTXByteTotal; +}; + +// Structure to describe response TLV 0x13 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_RXBytes +{ + UINT64 mRXByteTotal; +}; + +// Structure to describe response TLV 0x14 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_DormancyStatus +{ + eQMIDormancyStatus mDormancyStatus; +}; + +// Structure to describe response TLV 0x15 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_Technology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe response TLV 0x16 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_Rates +{ + UINT32 mChannelTXRatebps; + UINT32 mChannelRXRatebps; + UINT32 mMaxChannelTXRatebps; + UINT32 mMaxChannelRXRatebps; +}; + +// Structure to describe response TLV 0x17 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_PreviousTXBytes +{ + UINT64 mPreviousCallTXByteTotal; +}; + +// Structure to describe response TLV 0x18 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_PreviousRXBytes +{ + UINT64 mPreviousCallRXByteTotal; +}; + +// Structure to describe response TLV 0x19 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_ActiveDuration +{ + UINT64 mDataSessionActiveDuration; +}; + +// Structure to describe response TLV 0x20 for WDSGetModemInfo() +struct sWDSGetModemInfoResponse_LastCallTechnology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe indication TLV 0x10 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_Status +{ + eQMIConnectionStatus mConnectionStatus; +}; + +// Structure to describe indication TLV 0x11 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_CallEndReason +{ + eQMICallEndReasons mCallEnd; +}; + +// Structure to describe indication TLV 0x12 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_TXBytes +{ + UINT64 mTXByteTotal; +}; + +// Structure to describe indication TLV 0x13 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_RXBytes +{ + UINT64 mRXByteTotal; +}; + +// Structure to describe indication TLV 0x14 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_DormancyStatus +{ + eQMIDormancyStatus mDormancyStatus; +}; + +// Structure to describe indication TLV 0x15 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_Technology +{ + eQMIDataBearerTechnologies mDataBearerTechnology; +}; + +// Structure to describe indication TLV 0x16 for WDS ModemInfoReport +struct sWDSModemInfoReportIndication_Rates +{ + UINT32 mChannelTXRatebps; + UINT32 mChannelRXRatebps; +}; + +// Structure to describe response TLV 0x01 for WDSGetActiveMIPProfile() +struct sWDSGetActiveMIPProfileResponse_Index +{ + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x01 for WDSSetActiveMIPProfile() +struct sWDSSetActiveMIPProfileRequest_Index +{ + char mSPC[6]; + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x01 for WDSGetMIPProfile() +struct sWDSGetMIPProfileRequest_Index +{ + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0x10 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_State +{ + INT8 mEnabled; +}; + +// Structure to describe response TLV 0x11 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_HomeAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x12 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_PrimaryHomeAgentAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x13 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_SecondaryHomeAgentAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x14 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_ReverseTunneling +{ + INT8 mReverseTunneling; +}; + +// Structure to describe response TLV 0x15 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_NAI +{ + // String is variable length, but must be size of the container + // char mNAI[1]; +}; + +// Structure to describe response TLV 0x16 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_HASPI +{ + UINT32 mHASPI; +}; + +// Structure to describe response TLV 0x17 for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_AAASPI +{ + UINT32 mAAASPI; +}; + +// Structure to describe response TLV 0x1A for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_HAState +{ + eQMIHAAAAKeyStates mKeyState; +}; + +// Structure to describe response TLV 0x1B for WDSGetMIPProfile() +struct sWDSGetMIPProfileResponse_AAAState +{ + eQMIHAAAAKeyStates mKeyState; +}; + +// Structure to describe request TLV 0x01 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_Index +{ + char mSPC[6]; + UINT8 mProfileIndex; +}; + +// Structure to describe request TLV 0x10 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_State +{ + INT8 mEnabled; +}; + +// Structure to describe request TLV 0x11 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_HomeAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x12 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_PrimaryHomeAgentAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x13 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_SecondaryHomeAgentAddress +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x14 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_ReverseTunneling +{ + INT8 mReverseTunneling; +}; + +// Structure to describe request TLV 0x15 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_NAI +{ + // String is variable length, but must be size of the container + // char mNAI[1]; +}; + +// Structure to describe request TLV 0x16 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_HASPI +{ + UINT32 mHASPI; +}; + +// Structure to describe request TLV 0x17 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequeste_AAASPI +{ + UINT32 mAAASPI; +}; + +// Structure to describe request TLV 0x18 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_MNHA +{ + // String is variable length, but must be size of the container + // char mMNHAKey[1]; +}; + +// Structure to describe request TLV 0x19 for WDSSetMIPProfile() +struct sWDSSetMIPProfileRequest_MNAAA +{ + // String is variable length, but must be size of the container + // char mMNAAAKey[1]; +}; + +// Structure to describe response TLV 0x10 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_MobileIPMode +{ + eQMIMobileIPModes mMIPMode; +}; + +// Structure to describe response TLV 0x11 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_RetryAttemptLimit +{ + UINT8 mRetryAttemptLimit; +}; + +// Structure to describe response TLV 0x12 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_RetryAttemptInterval +{ + UINT8 mRetryAttemptInterval; +}; + +// Structure to describe response TLV 0x13 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_ReRegistrationPeriod +{ + UINT8 mReRegistrationPeriod; +}; + +// Structure to describe response TLV 0x14 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_ReRegistrationOnlyWithTraffic +{ + INT8 mReRegistrationOnlyWithTraffic; +}; + +// Structure to describe response TLV 0x15 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_MNHAAuthenticatorCalculator +{ + INT8 mMNHAAuthenticatorCalculator; +}; + +// Structure to describe response TLV 0x16 for WDSGetMIPParameters() +struct sWDSGetMIPParametersResponse_MNHARFC2002BISAuthentication +{ + INT8 mMNHARFC2002BISAuthentication; +}; + +// Structure to describe request TLV 0x01 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_SPC +{ + char mSPC[6]; +}; + +// Structure to describe request TLV 0x10 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_MobileIPMode +{ + eQMIMobileIPModes mMIPMode; +}; + +// Structure to describe request TLV 0x11 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_RetryAttemptLimit +{ + UINT8 mRetryAttemptLimit; +}; + +// Structure to describe request TLV 0x12 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_RetryAttemptInterval +{ + UINT8 mRetryAttemptInterval; +}; + +// Structure to describe request TLV 0x13 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_ReRegistrationPeriod +{ + UINT8 mReRegistrationPeriod; +}; + +// Structure to describe request TLV 0x14 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_ReRegistrationOnlyWithTraffic +{ + INT8 mReRegistrationOnlyWithTraffic; +}; + +// Structure to describe request TLV 0x15 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_MNHAAuthenticatorCalculator +{ + INT8 mMNHAAuthenticatorCalculator; +}; + +// Structure to describe request TLV 0x16 for WDSSetMIPParameters() +struct sWDSSetMIPParametersRequest_MNHARFC2002BISAuthentication +{ + INT8 mMNHARFC2002BISAuthentication; +}; + +// Structure to describe response TLV 0x01 for WDSGetLastMIPStatus() +struct sWDSGetLastMIPStatusResponse_Status +{ + UINT8 mLastMIPStatus; +}; + +// Structure to describe response TLV 0x01 for WDSGetANAAAAuthenticationStatus() +struct sWDSGetANAAAAuthenticationStatusResponse_Status +{ + INT8 mANAAAAuthenticated; +}; + +// Structure to describe response TLV 0x01 for WDSGetCurrentDataBearerTechnology() +struct sWDSGetCurrentDataBearerTechnologyResponse_Technology +{ + eQMIWDSNetworkTypes mNetworkType; + + // The following union is based on the value of mNetworkType + union uValOfNetworkType + { + // If the value of mNetworkType == 1 + struct sNetworkTypeIs1 + { + bool mCDMA1x:1; + bool mCDMA1xEvDORev0:1; + bool mCDMA1xEvDORevA:1; + bool mCDMA1xEvDORevB:1; + bool mCDMAEHRPD:1; + bool mCDMAFMC:1; + + // Padding out 25 bits + UINT8 mReserved1:2; + UINT8 mReserved2[2]; + UINT8 mReserved3:7; + + bool mNullBearer:1; + + // The following union is for handing both mCDMA1x and mCDMA1xEvDORev(0, A, B) + union uValOfCDMA1x_or_CDMA1xEvDORevX + { + // If the value of mCDMA1x == 1 + struct sCDMA1xIs1 + { + bool mCDMA1xIS95:1; + bool mCDMA1xIS2000:1; + bool mCDMA1xIS2000RelA:1; + + // Padding out 29 bits + UINT8 mReserved4:5; + UINT8 mReserved5[3]; + }; + + sCDMA1xIs1 mCDMA1xIs1; + + // If the value of mCDMA1xEvDORev0 == 1 + struct sCDMA1xEvDORev0Is1 + { + bool mCDMA1xEvDORev0DPA:1; + + // Padding out 31 bits + UINT8 mReserved6:7; + UINT8 mReserved7[3]; + }; + + sCDMA1xEvDORev0Is1 mCDMA1xEvDORev0Is1; + + // If the value of mCDMA1xEvDORevA == 1 + struct sCDMA1xEvDORevAIs1 + { + bool mCDMA1xEvDORevADPA:1; + bool mCDMA1xEvDORevAMFPA:1; + bool mCDMA1xEvDORevAEMPA:1; + bool mCDMA1xEvDORevAEMPAEHRPD:1; + + // Padding out 28 bits + UINT8 mReserved8:4; + UINT8 mReserved9[3]; + }; + + sCDMA1xEvDORevAIs1 mCDMA1xEvDORevAIs1; + + // If the value of mCDMA1xEvDORevB == 1 + struct sCDMA1xEvDORevBIs1 + { + bool mCDMA1xEvDORevBDPA:1; + bool mCDMA1xEvDORevBMFPA:1; + bool mCDMA1xEvDORevBEMPA:1; + bool mCDMA1xEvDORevBEMPAEHRPD:1; + bool mCDMA1xEvDORevBMMPA:1; + bool mCDMA1xEvDORevBMMPAEHRPD:1; + + // Padding out 26 bits + UINT8 mReserved10:2; + UINT8 mReserved11[3]; + }; + + sCDMA1xEvDORevBIs1 mCDMA1xEvDORevBIs1; + + // Padding out 32 bits + UINT8 mReserved12[4]; + }; + + uValOfCDMA1x_or_CDMA1xEvDORevX mValOfCDMA1x_or_CDMA1xEvDORevX; + }; + + sNetworkTypeIs1 mNetworkTypeIs1; + + // If the value of mNetworkType == 2 + struct sNetworkTypeIs2 + { + bool mWCDMA:1; + bool mGPRS:1; + bool mHSDPA:1; + bool mHSUPA:1; + bool mEDGE:1; + bool mLTE:1; + bool mHSDPAPlus:1; + bool mDualCellHSDPAPlus:1; + bool m64QAM:1; + bool mTDSCDMA:1; + + // Padding out 21 bits + UINT8 mReserved13:6; + UINT8 mReserved14; + UINT8 mReserved15:7; + + bool mNullBearer:1; + }; + + sNetworkTypeIs2 mNetworkTypeIs2; + + // Padding out 64 bits + UINT8 mReserved16[8]; + }; + + uValOfNetworkType mValOfNetworkType; +}; + +// Structure to describe response TLV 0x10 for WDSGetCurrentDataBearerTechnology() +struct sWDSGetCurrentDataBearerTechnologyResponse_LastCallTechnology +{ + eQMIWDSNetworkTypes mNetworkType; + + // The following union is based on the value of mNetworkType + union uValOfNetworkType + { + // If the value of mNetworkType == 1 + struct sNetworkTypeIs1 + { + bool mCDMA1x:1; + bool mCDMA1xEvDORev0:1; + bool mCDMA1xEvDORevA:1; + bool mCDMA1xEvDORevB:1; + bool mCDMAEHRPD:1; + bool mCDMAFMC:1; + + // Padding out 25 bits + UINT8 mReserved1:2; + UINT8 mReserved2[2]; + UINT8 mReserved3:7; + + bool mNullBearer:1; + + // The following union is for handing both mCDMA1x and mCDMA1xEvDORev(0, A, B) + union uValOfCDMA1x_or_CDMA1xEvDORevX + { + // If the value of mCDMA1x == 1 + struct sCDMA1xIs1 + { + bool mCDMA1xIS95:1; + bool mCDMA1xIS2000:1; + bool mCDMA1xIS2000RelA:1; + + // Padding out 29 bits + UINT8 mReserved4:5; + UINT8 mReserved5[3]; + }; + + sCDMA1xIs1 mCDMA1xIs1; + + // If the value of mCDMA1xEvDORev0 == 1 + struct sCDMA1xEvDORev0Is1 + { + bool mCDMA1xEvDORev0DPA:1; + + // Padding out 31 bits + UINT8 mReserved6:7; + UINT8 mReserved7[3]; + }; + + sCDMA1xEvDORev0Is1 mCDMA1xEvDORev0Is1; + + // If the value of mCDMA1xEvDORevA == 1 + struct sCDMA1xEvDORevAIs1 + { + bool mCDMA1xEvDORevADPA:1; + bool mCDMA1xEvDORevAMFPA:1; + bool mCDMA1xEvDORevAEMPA:1; + bool mCDMA1xEvDORevAEMPAEHRPD:1; + + // Padding out 28 bits + UINT8 mReserved8:4; + UINT8 mReserved9[3]; + }; + + sCDMA1xEvDORevAIs1 mCDMA1xEvDORevAIs1; + + // If the value of mCDMA1xEvDORevB == 1 + struct sCDMA1xEvDORevBIs1 + { + bool mCDMA1xEvDORevBDPA:1; + bool mCDMA1xEvDORevBMFPA:1; + bool mCDMA1xEvDORevBEMPA:1; + bool mCDMA1xEvDORevBEMPAEHRPD:1; + bool mCDMA1xEvDORevBMMPA:1; + bool mCDMA1xEvDORevBMMPAEHRPD:1; + + // Padding out 26 bits + UINT8 mReserved10:2; + UINT8 mReserved11[3]; + }; + + sCDMA1xEvDORevBIs1 mCDMA1xEvDORevBIs1; + + // Padding out 32 bits + UINT8 mReserved12[4]; + }; + + uValOfCDMA1x_or_CDMA1xEvDORevX mValOfCDMA1x_or_CDMA1xEvDORevX; + }; + + sNetworkTypeIs1 mNetworkTypeIs1; + + // If the value of mNetworkType == 2 + struct sNetworkTypeIs2 + { + bool mWCDMA:1; + bool mGPRS:1; + bool mHSDPA:1; + bool mHSUPA:1; + bool mEDGE:1; + bool mLTE:1; + bool mHSDPAPlus:1; + bool mDualCellHSDPAPlus:1; + bool m64QAM:1; + bool mTDSCDMA:1; + + // Padding out 21 bits + UINT8 mReserved13:6; + UINT8 mReserved14; + UINT8 mReserved15:7; + + bool mNullBearer:1; + }; + + sNetworkTypeIs2 mNetworkTypeIs2; + + // Padding out 64 bits + UINT8 mReserved16[8]; + }; + + uValOfNetworkType mValOfNetworkType; +}; + +// Structure to describe request TLV 0x10 for WDSGetCallList() +struct sWDSGetCallListRequest_ListType +{ + eQMICallHistoryTypes mCallListType; +}; + +// Structure to describe response TLV 0x10 for WDSGetCallList() +struct sWDSGetCallListResponse_FullList +{ + UINT16 mCallRecords; + + struct sRecord + { + UINT16 mID; + eQMICallTypes mType; + eQMIDataBearerTechnologies mDataBearer; + UINT64 mTimestamp; + UINT8 mIPV4Address[4]; + UINT64 mTotalDuration; + UINT64 mActiveDuration; + UINT64 mRXByteTotal; + UINT64 mTXByteTotal; + eQMICallEndReasons mCallEnd; + UINT8 mPhoneNumberLength; + + // This array must be the size specified by mPhoneNumberLength + // char mPhoneNumber[1]; + }; + + // This array must be the size specified by mCallRecords + // sRecord mRecords[1]; +}; + +// Structure to describe response TLV 0x11 for WDSGetCallList() +struct sWDSGetCallListResponse_IDList +{ + UINT16 mCallRecords; + + struct sRecord + { + UINT16 mID; + }; + + // This array must be the size specified by mCallRecords + // sRecord mRecords[1]; +}; + +// Structure to describe request TLV 0x01 for WDSGetCallRecord() +struct sWDSGetCallRecordRequest_RecordID +{ + UINT16 mID; +}; + +// Structure to describe response TLV 0x01 for WDSGetCallRecord() +struct sWDSGetCallRecordResponse_Record +{ + UINT16 mID; + eQMICallTypes mType; + eQMIDataBearerTechnologies mDataBearer; + UINT64 mTimestamp; + UINT8 mIPV4Address[4]; + UINT64 mTotalDuration; + UINT64 mActiveDuration; + UINT64 mRXByteTotal; + UINT64 mTXByteTotal; + eQMICallEndReasons mCallEnd; + UINT8 mPhoneNumberLength; + + // This array must be the size specified by mPhoneNumberLength + // char mPhoneNumber[1]; +}; + +// Structure to describe response TLV 0x01 for WDSGetCallListMaxSize() +struct sWDSGetCallListMaxSizeResponse_Maximum +{ + UINT16 mCallListMaxSize; +}; + +// Structure to describe request TLV 0x01 for WDSGetDefaultProfileNumber() +struct sWDSGetDefaultProfileNumberRequest_ProfileType +{ + eQMIProfileTypes mProfileType; + eQMIWDSProfileFamily mProfileFamily; +}; + +// Structure to describe response TLV 0x01 for WDSGetDefaultProfileNumber() +struct sWDSGetDefaultProfileNumberResponse_ProfileNumber +{ + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0xE0 for WDSGetDefaultProfileNumber() +struct sWDSGetDefaultProfileNumberResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSSetDefaultProfileNumber() +struct sWDSSetDefaultProfileNumberRequest_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + eQMIWDSProfileFamily mProfileFamily; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0xE0 for WDSSetDefaultProfileNumber() +struct sWDSSetDefaultProfileNumberResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSResetProfile() +struct sWDSResetProfileRequest_ProfileIdentifier +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; +}; + +// Structure to describe response TLV 0xE0 for WDSResetProfile() +struct sWDSResetProfileResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSResetProfileParamToInvalid() +struct sWDSResetProfileParamToInvalidRequest_ProfileParam +{ + eQMIProfileTypes mProfileType; + UINT8 mProfileIndex; + eQMIWDSProfileParamID mProfileParamID; +}; + +// Structure to describe response TLV 0xE0 for WDSResetProfileParamToInvalid() +struct sWDSResetProfileParamToInvalidResponse_ExtendedErrorCode +{ + eQMIWDSExtendedErrorCode mExtendedErrorCode; +}; + +// Structure to describe request TLV 0x01 for WDSSetIPFamilyPreference() +struct sWDSSetIPFamilyPreferenceRequest_IPFamilyPreference +{ + eQMIWDSIPFamilies mIPFamily; +}; + +// Structure to describe request TLV 0x01 for WDSSetFMCTunnelParameters() +struct sWDSSetFMCTunnelParametersRequest_Parameters +{ + UINT32 mStreamID; + INT8 mNATIsPresent; + UINT16 mPortID; +}; + +// Structure to describe request TLV 0x10 for WDSSetFMCTunnelParameters() +struct sWDSSetFMCTunnelParametersRequest_IPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x11 for WDSSetFMCTunnelParameters() +struct sWDSSetFMCTunnelParametersRequest_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x10 for WDSGetFMCTunnelParameters() +struct sWDSGetFMCTunnelParametersResponse_Parameters +{ + UINT32 mStreamID; + INT8 mNATIsPresent; + UINT16 mPortID; +}; + +// Structure to describe response TLV 0x11 for WDSGetFMCTunnelParameters() +struct sWDSGetFMCTunnelParametersResponse_IPv4Address +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x12 for WDSGetFMCTunnelParameters() +struct sWDSGetFMCTunnelParametersResponse_IPv6Address +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x01 for WDSSetAutoconnectSetting() +struct sWDSSetAutoconnectSettingRequest_Autoconnect +{ + eQMIWDSAutoconnectSettings mAutoconnectSetting; +}; + +// Structure to describe request TLV 0x10 for WDSSetAutoconnectSetting() +struct sWDSSetAutoconnectSettingRequest_Roam +{ + eQMIWDSAutoconnectRoamSettings mAutoconnectRoamSetting; +}; + +// Structure to describe response TLV 0x10 for WDSGetDNSSetting() +struct sWDSGetDNSSettingResponse_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x11 for WDSGetDNSSetting() +struct sWDSGetDNSSettingResponse_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe response TLV 0x12 for WDSGetDNSSetting() +struct sWDSGetDNSSettingResponse_PrimaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x13 for WDSGetDNSSetting() +struct sWDSGetDNSSettingResponse_SecondaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x10 for WDSSetDNSSetting() +struct sWDSSetDNSSettingRequest_PrimaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x11 for WDSSetDNSSetting() +struct sWDSSetDNSSettingRequest_SecondaryDNS +{ + UINT8 mIPV4Address[4]; +}; + +// Structure to describe request TLV 0x12 for WDSSetDNSSetting() +struct sWDSSetDNSSettingRequest_PrimaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe request TLV 0x13 for WDSSetDNSSetting() +struct sWDSSetDNSSettingRequest_SecondaryIPv6DNS +{ + UINT16 mIPv6Address[8]; +}; + +// Structure to describe response TLV 0x01 for WDSGetCDMAPreDormancySettings() +struct sWDSGetCDMAPreDormancySettingsResponse_Settings +{ + eQMIWDSCDMAServiceOptions mServiceOption; + eQMIWDSCDMANetworks mDataSessionNetwork; +}; + +// Structure to describe request TLV 0x01 for WDSSetCAMTimer() +struct sWDSSetCAMTimerRequest_Timer +{ + UINT32 mCAMTimerSeconds; +}; + +// Structure to describe response TLV 0x01 for WDSGetCAMTimer() +struct sWDSGetCAMTimerResponse_Timer +{ + UINT32 mCAMTimerSeconds; +}; + +// Structure to describe request TLV 0x01 for WDSSetSCRM() +struct sWDSSetSCRMRequest_SCRM +{ + INT8 mSCRMEnabled; +}; + +// Structure to describe response TLV 0x01 for WDSGetSCRM() +struct sWDSGetSCRMResponse_SCRM +{ + INT8 mSCRMEnabled; +}; + +// Structure to describe request TLV 0x01 for WDSSetRDUD() +struct sWDSSetRDUDRequest_RDUD +{ + INT8 mRDUDEnabled; +}; + +// Structure to describe response TLV 0x01 for WDSGetRDUD() +struct sWDSGetRDUDResponse_RDUD +{ + INT8 mRDUDEnabled; +}; + +// Structure to describe response TLV 0x01 for WDSGetSIPMIPCallType() +struct sWDSGetSIPMIPCallTypeResponse_CallType +{ + eQMIWDSSIPMIPCallTypes mCallType; +}; + +// Structure to describe request TLV 0x01 for WDSSetEVDOPageMonitorPeriod() +struct sWDSSetEVDOPageMonitorPeriodRequest_Period +{ + UINT8 mPageMonitorPeriod; +}; + +// Structure to describe indication TLV 0x01 for WDS EVDOPageMonitorPeriodIndication +struct sWDSEVDOPageMonitorPeriodIndication_Result +{ + eQMIWDSSlotCycleSetResults mSlotCycleSetResult; +}; + +// Structure to describe request TLV 0x01 for WDSSetEVDOLongSleep() +struct sWDSSetEVDOLongSleepRequest_Setting +{ + INT8 mForceLongSleep; +}; + +// Structure to describe response TLV 0x01 for WDSGetEVDOPageMonitorPeriod() +struct sWDSGetEVDOPageMonitorPeriodResponse_Details +{ + UINT8 mPageMonitorPeriod; + INT8 mForceLongSleep; +}; + +// Structure to describe response TLV 0x01 for WDSGetCallThrottleInfo() +struct sWDSGetCallThrottleInfoResponse_Details +{ + UINT32 mEVDOThrottledDelaySeconds; + UINT32 mCDMAThrottledDelaySeconds; +}; + +// Structure to describe request TLV 0x01 for WDSGetNSAPI() +struct sWDSGetNSAPIRequest_APN +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0x01 for WDSGetNSAPI() +struct sWDSGetNSAPIResponse_NSAPI +{ + UINT8 mNSAPICount; + + // This array must be the size specified by mNSAPICount + // UINT8 mNSAPI[1]; +}; + +// Structure to describe request TLV 0x01 for WDSSetDUNCallControlPreference() +struct sWDSSetDUNCallControlPreferenceRequest_Preference +{ + eQMIWDSDUNControlPreferences mDUNControl; +}; + +// Structure to describe request TLV 0x10 for WDSSetDUNCallControlPreference() +struct sWDSSetDUNCallControlPreferenceRequest_AllowDUN +{ + INT8 mAllowDUNCalls; +}; + +// Structure to describe response TLV 0x01 for WDSGetDUNCallControlInfo() +struct sWDSGetDUNCallControlInfoResponse_Status +{ + INT8 mDUNControlEnabled; +}; + +// Structure to describe response TLV 0x10 for WDSGetDUNCallControlInfo() +struct sWDSGetDUNCallControlInfoResponse_AllowDUN +{ + INT8 mAllowDUNCalls; +}; + +// Structure to describe response TLV 0x11 for WDSGetDUNCallControlInfo() +struct sWDSGetDUNCallControlInfoResponse_CurrentClient +{ + INT8 mSetByCurrentClient; +}; + +// Structure to describe response TLV 0x12 for WDSGetDUNCallControlInfo() +struct sWDSGetDUNCallControlInfoResponse_ReportMask +{ + bool mSendDUNCallNotifications:1; + bool mSendEntitlementNotifications:1; + bool mSendSilentRedailNotifications:1; + + // Padding out 5 bits + UINT8 mReserved1:5; +}; + +// Structure to describe request TLV 0x01 for WDSSetDUNCallControlEventReport() +struct sWDSSetDUNCallControlEventReportRequest_CallNotifications +{ + INT8 mEnableDUNCallNotifications; +}; + +// Structure to describe request TLV 0x10 for WDSSetDUNCallControlEventReport() +struct sWDSSetDUNCallControlEventReportRequest_EntitlementNotifications +{ + INT8 mEnableEntitlementNotifications; +}; + +// Structure to describe request TLV 0x11 for WDSSetDUNCallControlEventReport() +struct sWDSSetDUNCallControlEventReportRequest_RedialNotifications +{ + INT8 mEnableSilentRedailNotifications; +}; + +// Structure to describe response TLV 0x01 for WDSSetDUNCallControlEventReport() +struct sWDSSetDUNCallControlEventReportResponse_ReportMask +{ + bool mSendDUNCallNotifications:1; + bool mSendEntitlementNotifications:1; + bool mSendSilentRedailNotifications:1; + + // Padding out 5 bits + UINT8 mReserved1:5; +}; + +// Structure to describe indication TLV 0x01 for WDS DUNCallControlEventReport +struct sWDSDUNCallControlEventReportIndication_Event +{ + eQMIWDSDUNControlEvents mDUNControlEvent; +}; + +// Structure to describe indication TLV 0x10 for WDS DUNCallControlEventReport +struct sWDSDUNCallControlEventReportIndication_CallNotification +{ + INT8 mDUNCallAllowed; +}; + +// Structure to describe indication TLV 0x11 for WDS DUNCallControlEventReport +struct sWDSDUNCallControlEventReportIndication_CallID +{ + UINT8 mDUNCallID; +}; + +// Structure to describe indication TLV 0x12 for WDS DUNCallControlEventReport +struct sWDSDUNCallControlEventReportIndication_PreviousFailureReason +{ + eQMIWDSCallEndReasonTypes mCallEndReasonType; + + // The following union is based on the value of mCallEndReasonType + union uValOfCallEndReasonType + { + // Always present + UINT16 mCallEndReasonValue; + + // If the value of mCallEndReasonType == 1 + struct sCallEndReasonTypeIs1 + { + eQMIWDSMobileIPCallEndReasons mMobileIPCallEndReason; + }; + + sCallEndReasonTypeIs1 mCallEndReasonTypeIs1; + + // If the value of mCallEndReasonType == 2 + struct sCallEndReasonTypeIs2 + { + eQMIWDSInternalCallEndReasons mInternalCallEndReason; + }; + + sCallEndReasonTypeIs2 mCallEndReasonTypeIs2; + + // If the value of mCallEndReasonType == 3 + struct sCallEndReasonTypeIs3 + { + eQMIWDSCallManagerCallEndReasons mCallManagerCallEndReason; + }; + + sCallEndReasonTypeIs3 mCallEndReasonTypeIs3; + + // If the value of mCallEndReasonType == 6 + struct sCallEndReasonTypeIs6 + { + eQMIWDS3GPPCallEndReasons m3GPPCallEndReason; + }; + + sCallEndReasonTypeIs6 mCallEndReasonTypeIs6; + + // If the value of mCallEndReasonType == 7 + struct sCallEndReasonTypeIs7 + { + eQMIWDSPPPCallEndReason mPPPCallEndReason; + }; + + sCallEndReasonTypeIs7 mCallEndReasonTypeIs7; + + // If the value of mCallEndReasonType == 8 + struct sCallEndReasonTypeIs8 + { + eQMIWDSEHRPDCallEndReason mEHRPDCallEndReason; + }; + + sCallEndReasonTypeIs8 mCallEndReasonTypeIs8; + + // If the value of mCallEndReasonType == 9 + struct sCallEndReasonTypeIs9 + { + eQMIWDSIPv6CallEndReason mIPv6CallEndReason; + }; + + sCallEndReasonTypeIs9 mCallEndReasonTypeIs9; + + // Padding out 16 bits + UINT8 mReserved1[2]; + }; + + uValOfCallEndReasonType mValOfCallEndReasonType; +}; + +// Structure to describe request TLV 0x01 for WDSPendingDUNCallControl() +struct sWDSPendingDUNCallControlRequest_Action +{ + INT8 mDUNCallAllowed; +}; + +// Structure to describe request TLV 0x01 for WDSEMBMSTMGIActivate() +struct sWDSEMBMSTMGIActivateRequest_TMGI +{ + UINT8 mTMGI[6]; + INT8 mSessionIDValid; + UINT8 mSessionID; +}; + +// Structure to describe response TLV 0x10 for WDSEMBMSTMGIActivate() +struct sWDSEMBMSTMGIActivateResponse_ExtendedError +{ + eQMIWDSEMBMSErrorCodes mExtendedEMBMSErrorCode; +}; + +// Structure to describe indication TLV 0x01 for WDS EMBMSTMGIActivateIndication +struct sWDSEMBMSTMGIActivateIndication_Status +{ + eQMIWDSEMBMSOperationStatus mTMGIOperationStatus; +}; + +// Structure to describe request TLV 0x01 for WDSEMBMSTMGIDeactivate() +struct sWDSEMBMSTMGIDeactivateRequest_TMGI +{ + UINT8 mTMGI[6]; + INT8 mSessionIDValid; + UINT8 mSessionID; +}; + +// Structure to describe response TLV 0x10 for WDSEMBMSTMGIDeactivate() +struct sWDSEMBMSTMGIDeactivateResponse_ExtendedError +{ + eQMIWDSEMBMSErrorCodes mExtendedEMBMSErrorCode; +}; + +// Structure to describe indication TLV 0x01 for WDS EMBMSTMGIDectivateIndication +struct sWDSEMBMSTMGIDectivateIndication_Status +{ + eQMIWDSEMBMSOperationStatus mTMGIOperationStatus; +}; + +// Structure to describe request TLV 0x01 for WDSEMBMSTMGIListQuery() +struct sWDSEMBMSTMGIListQueryRequest_Type +{ + eQMIWDSEMBMSListTypes mTMGIListType; +}; + +// Structure to describe response TLV 0x10 for WDSEMBMSTMGIListQuery() +struct sWDSEMBMSTMGIListQueryResponse_List +{ + eQMIWDSEMBMSListTypes mTMGIListType; + UINT8 mTMGIListCount; + + struct sEntry + { + UINT8 mTMGI[6]; + INT8 mSessionIDValid; + UINT8 mSessionID; + }; + + // This array must be the size specified by mTMGIListCount + // sEntry mEntrys[1]; +}; + +// Structure to describe response TLV 0x11 for WDSEMBMSTMGIListQuery() +struct sWDSEMBMSTMGIListQueryResponse_OOS +{ + eQMIWDSOOSWarningReasons mOOSWarningReason; +}; + +// Structure to describe indication TLV 0x10 for WDS EMBMSTMGIListIndication +struct sWDSEMBMSTMGIListIndication_List +{ + eQMIWDSEMBMSListTypes mTMGIListType; + UINT8 mTMGIListCount; + + struct sEntry + { + UINT8 mTMGI[6]; + INT8 mSessionIDValid; + UINT8 mSessionID; + }; + + // This array must be the size specified by mTMGIListCount + // sEntry mEntrys[1]; +}; + +// Structure to describe indication TLV 0x11 for WDS EMBMSTMGIListIndication +struct sWDSEMBMSTMGIListIndication_OOS +{ + eQMIWDSOOSWarningReasons mOOSWarningReason; +}; + +// Structure to describe response TLV 0x10 for WDSGetPreferredDataSystem() +struct sWDSGetPreferredDataSystemResponse_PreferredDataSystem +{ + eQMIWDSDataSystems mPreferredDataSystem; +}; + +// Structure to describe response TLV 0x10 for WDSGetLastDataCallStatus() +struct sWDSGetLastDataCallStatusResponse_DataCallStatus +{ + eQMIWDSDataCallStatus mDataCallStatus; +}; + +// Structure to describe response TLV 0x11 for WDSGetLastDataCallStatus() +struct sWDSGetLastDataCallStatusResponse_DataCallType +{ + eQMIWDSDataCallTypes mDataCallType; + eQMIWDSTetheredCallTypes mTetheredCallType; +}; + +// Structure to describe response TLV 0x10 for WDSGetCurrentDataSystems() +struct sWDSGetCurrentDataSystemsResponse_Systems +{ + eQMIWDSDataSystemNetworkTypes mPreferredNetworkType; + UINT8 mNetworkCount; + + struct sNetwork + { + eQMIWDSDataSystemNetworkTypes mNetworkType; + + // The following union is based on the value of mNetworkType + union uValOfNetworkType + { + // If the value of mNetworkType == 0 + struct sNetworkTypeIs0 + { + bool mWCDMA:1; + bool mGPRS:1; + bool mHSDPA:1; + bool mHSUPA:1; + bool mEDGE:1; + bool mLTE:1; + bool mHSDPAPlus:1; + bool mDualCellHSDPAPlus:1; + bool m64QAM:1; + bool mTDSCDMA:1; + + // Padding out 21 bits + UINT8 mReserved1:6; + UINT8 mReserved2; + UINT8 mReserved3:7; + + bool mNULLBearer:1; + }; + + sNetworkTypeIs0 mNetworkTypeIs0; + + // If the value of mNetworkType == 1 + struct sNetworkTypeIs1 + { + bool mCDMA1x:1; + bool mCDMA1xEvDORev0:1; + bool mCDMA1xEvDORevA:1; + bool mCDMA1xEvDORevB:1; + bool mCDMAEHRPD:1; + bool mCDMAFMC:1; + + // Padding out 25 bits + UINT8 mReserved4:2; + UINT8 mReserved5[2]; + UINT8 mReserved6:7; + + bool mNULLBearer:1; + + // The following union is for handing all mCDMA1x types + union uValOfCDMA1xTypes + { + // If the value of mCDMA1x == 1 + struct sCDMA1xIs1 + { + bool mCDMA1xIS95:1; + bool mCDMA1xIS2000:1; + bool mCDMA1xIS2000RelA:1; + + // Padding out 29 bits + UINT8 mReserved7:5; + UINT8 mReserved8[3]; + }; + + sCDMA1xIs1 mCDMA1xIs1; + + // If the value of mCDMA1xEvDORev0 == 1 + struct sCDMA1xEvDORev0Is1 + { + bool mCDMA1xEvDORev0DPA:1; + + // Padding out 31 bits + UINT8 mReserved9:7; + UINT8 mReserved10[3]; + }; + + sCDMA1xEvDORev0Is1 mCDMA1xEvDORev0Is1; + + // If the value of mCDMA1xEvDORevA == 1 + struct sCDMA1xEvDORevAIs1 + { + bool mCDMA1xEvDORevADPA:1; + bool mCDMA1xEvDORevAMFPA:1; + bool mCDMA1xEvDORevAEMPA:1; + bool mCDMA1xEvDORevAEMPAEHRPD:1; + + // Padding out 28 bits + UINT8 mReserved11:4; + UINT8 mReserved12[3]; + }; + + sCDMA1xEvDORevAIs1 mCDMA1xEvDORevAIs1; + + // If the value of mCDMA1xEvDORevB == 1 + struct sCDMA1xEvDORevBIs1 + { + bool mCDMA1xEvDORevBDPA:1; + bool mCDMA1xEvDORevBMFPA:1; + bool mCDMA1xEvDORevBEMPA:1; + bool mCDMA1xEvDORevBEMPAEHRPD:1; + bool mCDMA1xEvDORevBMMPA:1; + bool mCDMA1xEvDORevBMMPAEHRPD:1; + + // Padding out 26 bits + UINT8 mReserved13:2; + UINT8 mReserved14[3]; + }; + + sCDMA1xEvDORevBIs1 mCDMA1xEvDORevBIs1; + + // Padding out 32 bits + UINT8 mReserved15[4]; + }; + + uValOfCDMA1xTypes mValOfCDMA1xTypes; + }; + + sNetworkTypeIs1 mNetworkTypeIs1; + + // Padding out 64 bits + UINT8 mReserved16[8]; + }; + + uValOfNetworkType mValOfNetworkType; + }; + + // This array must be the size specified by mNetworkCount + // sNetwork mNetworks[1]; +}; + +// Structure to describe request TLV 0x01 for WDSGetPDNThrottleInfo() +struct sWDSGetPDNThrottleInfoRequest_Type +{ + eQMIWDSDataSystemNetworkTypes mTechnologyType; +}; + +// Structure to describe response TLV 0x10 for WDSGetPDNThrottleInfo() +struct sWDSGetPDNThrottleInfoResponse_Info +{ + UINT8 mThrottleInfoCount; + + struct sInfo + { + INT8 mIPv4Throttled; + INT8 mIPv6Throttled; + UINT32 mIPv4ThrottleTimeLeftInMilliseconds; + UINT32 mIPv6ThrottleTimeLeftInMilliseconds; + UINT8 mAPNNameLength; + + // This array must be the size specified by mAPNNameLength + // char mAPNName[1]; + }; + + // This array must be the size specified by mThrottleInfoCount + // sInfo mInfos[1]; +}; + +// Structure to describe response TLV 0x10 for WDSGetLTEAttachParameters() +struct sWDSGetLTEAttachParametersResponse_APNString +{ + // String is variable length, but must be size of the container + // char mAPNName[1]; +}; + +// Structure to describe response TLV 0x11 for WDSGetLTEAttachParameters() +struct sWDSGetLTEAttachParametersResponse_IPSupport +{ + eQMIWDSLTEIPTypes mIPType; +}; + +// Structure to describe response TLV 0x10 for WDSGetFlowControlStatus() +struct sWDSGetFlowControlStatusResponse_UplinkFlowControl +{ + INT8 mUplinkFlowControlEnabled; +}; + +// Structure to describe request TLV 0x10 for DMSSetEventReport() +struct sDMSSetEventReportRequest_PowerState +{ + INT8 mReportPowerState; +}; + +// Structure to describe request TLV 0x11 for DMSSetEventReport() +struct sDMSSetEventReportRequest_BatteryLevel +{ + UINT8 mBatteryLevelLowerLimit; + UINT8 mBatteryLevelUpperLimit; +}; + +// Structure to describe request TLV 0x12 for DMSSetEventReport() +struct sDMSSetEventReportRequest_PINStatus +{ + INT8 mReportPINStatus; +}; + +// Structure to describe request TLV 0x13 for DMSSetEventReport() +struct sDMSSetEventReportRequest_ActivationState +{ + INT8 mReportActivationState; +}; + +// Structure to describe request TLV 0x14 for DMSSetEventReport() +struct sDMSSetEventReportRequest_OperatingMode +{ + INT8 mReportOperatingMode; +}; + +// Structure to describe request TLV 0x15 for DMSSetEventReport() +struct sDMSSetEventReportRequest_UIMState +{ + INT8 mReportUIMState; +}; + +// Structure to describe request TLV 0x16 for DMSSetEventReport() +struct sDMSSetEventReportRequest_WirelessDisableState +{ + INT8 mReportWirelessDisableState; +}; + +// Structure to describe request TLV 0x17 for DMSSetEventReport() +struct sDMSSetEventReportRequest_PRLInit +{ + INT8 mReportPRLInitialization; +}; + +// Structure to describe indication TLV 0x10 for DMS EventReport +struct sDMSEventReportIndication_PowerState +{ + eQMIDMSPowerSources mPowerSource:1; + bool mBatteryConnected:1; + bool mBatteryCharging:1; + bool mPowerFault:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + + UINT8 mBatteryLevel; +}; + +// Structure to describe indication TLV 0x11 for DMS EventReport +struct sDMSEventReportIndication_PIN1State +{ + eQMIDMSPINStatus mPINStatus; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x12 for DMS EventReport +struct sDMSEventReportIndication_PIN2State +{ + eQMIDMSPINStatus mPINStatus; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x13 for DMS EventReport +struct sDMSEventReportIndication_ActivationState +{ + eQMIDMSActivationStates mActivationState; +}; + +// Structure to describe indication TLV 0x14 for DMS EventReport +struct sDMSEventReportIndication_OperatingMode +{ + eQMIDMSOperatingModes mOperatingMode; +}; + +// Structure to describe indication TLV 0x15 for DMS EventReport +struct sDMSEventReportIndication_UIMState +{ + eQMIDMSUIMStates mUIMState; +}; + +// Structure to describe indication TLV 0x16 for DMS EventReport +struct sDMSEventReportIndication_WirelessDisableState +{ + INT8 mWirelessDisableOn; +}; + +// Structure to describe indication TLV 0x17 for DMS EventReport +struct sDMSEventReportIndication_PRLInit +{ + INT8 mPRLLoaded; +}; + +// Structure to describe response TLV 0x01 for DMSGetDeviceCapabilities() +struct sDMSGetDeviceCapabilitiesResponse_Capabilities +{ + UINT32 mMaxTXRatebps; + UINT32 mMaxRXRatebps; + eQMIDMSDataServiceCapabilities1 mDataServiceCapability; + INT8 mSIMSupported; + UINT8 mRadioInterfaceCount; + + // This array must be the size specified by mRadioInterfaceCount + // eQMIDMSRadioInterfaces mRadioInterface[1]; +}; + +// Structure to describe response TLV 0x10 for DMSGetDeviceCapabilities() +struct sDMSGetDeviceCapabilitiesResponse_ServiceCapability +{ + eQMIDMSServiceCapabilities mServiceCapability; +}; + +// Structure to describe response TLV 0x11 for DMSGetDeviceCapabilities() +struct sDMSGetDeviceCapabilitiesResponse_VoiceCapability +{ + bool mGWCSFBCapable:1; + bool m1xCSFBCapable:1; + bool mVoLTECapable:1; + + // Padding out 61 bits + UINT8 mReserved1:5; + UINT8 mReserved2[7]; +}; + +// Structure to describe response TLV 0x01 for DMSGetDeviceManfacturer() +struct sDMSGetDeviceManfacturerResponse_Manfacturer +{ + // String is variable length, but must be size of the container + // char mDeviceManfacturer[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetDeviceModel() +struct sDMSGetDeviceModelResponse_Model +{ + // String is variable length, but must be size of the container + // char mDeviceModelID[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetDeviceRevision() +struct sDMSGetDeviceRevisionResponse_Revision +{ + // String is variable length, but must be size of the container + // char mDeviceRevisionID[1]; +}; + +// Structure to describe response TLV 0x10 for DMSGetDeviceRevision() +struct sDMSGetDeviceRevisionResponse_BootCodeRevision +{ + // String is variable length, but must be size of the container + // char mBootCodeRevisionID[1]; +}; + +// Structure to describe response TLV 0x11 for DMSGetDeviceRevision() +struct sDMSGetDeviceRevisionResponse_UQCNRevision +{ + // String is variable length, but must be size of the container + // char mBootCodeRevisionID[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetDeviceVoiceNumber() +struct sDMSGetDeviceVoiceNumberResponse_VoiceNumber +{ + // String is variable length, but must be size of the container + // char mDeviceVoiceNumber[1]; +}; + +// Structure to describe response TLV 0x10 for DMSGetDeviceVoiceNumber() +struct sDMSGetDeviceVoiceNumberResponse_MobileIDNumber +{ + // String is variable length, but must be size of the container + // char mDeviceMobileIDNumber[1]; +}; + +// Structure to describe response TLV 0x11 for DMSGetDeviceVoiceNumber() +struct sDMSGetDeviceVoiceNumberResponse_IMSI +{ + // String is variable length, but must be size of the container + // char mIMSI[1]; +}; + +// Structure to describe response TLV 0x10 for DMSGetDeviceSerialNumbers() +struct sDMSGetDeviceSerialNumbersResponse_ESN +{ + // String is variable length, but must be size of the container + // char mESN[1]; +}; + +// Structure to describe response TLV 0x11 for DMSGetDeviceSerialNumbers() +struct sDMSGetDeviceSerialNumbersResponse_IMEI +{ + // String is variable length, but must be size of the container + // char mIMEI[1]; +}; + +// Structure to describe response TLV 0x12 for DMSGetDeviceSerialNumbers() +struct sDMSGetDeviceSerialNumbersResponse_MEID +{ + // String is variable length, but must be size of the container + // char mMEID[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetPowerState() +struct sDMSGetPowerStateResponse_PowerState +{ + eQMIDMSPowerSources mPowerSource:1; + bool mBatteryConnected:1; + bool mBatteryCharging:1; + bool mPowerFault:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + + UINT8 mBatteryLevel; +}; + +// Structure to describe request TLV 0x01 for DMSUIMSetPINProtection() +struct sDMSUIMSetPINProtectionRequest_Info +{ + UINT8 mPINID; + UINT8 mPINEnabled; + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // char mPINValue[1]; +}; + +// Structure to describe response TLV 0x10 for DMSUIMSetPINProtection() +struct sDMSUIMSetPINProtectionResponse_RetryInfo +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe request TLV 0x01 for DMSUIMVerifyPIN() +struct sDMSUIMVerifyPINRequest_Info +{ + UINT8 mPINID; + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // char mPINValue[1]; +}; + +// Structure to describe response TLV 0x10 for DMSUIMVerifyPIN() +struct sDMSUIMVerifyPINResponse_RetryInfo +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe request TLV 0x01 for DMSUIMUnblockPIN() +struct sDMSUIMUnblockPINRequest_Info1 +{ + UINT8 mPINID; + UINT8 mPUKLength; + + // This array must be the size specified by mPUKLength + // char mPUKValue[1]; +}; + +struct sDMSUIMUnblockPINRequest_Info2 +{ + UINT8 mNewPINLength; + + // This array must be the size specified by mNewPINLength + // char mNewPINValue[1]; +}; + +struct sDMSUIMUnblockPINRequest_Info +{ + sDMSUIMUnblockPINRequest_Info1 mDMSUIMUnblockPINRequest_Info1; + sDMSUIMUnblockPINRequest_Info2 mDMSUIMUnblockPINRequest_Info2; +}; + +// Structure to describe response TLV 0x10 for DMSUIMUnblockPIN() +struct sDMSUIMUnblockPINResponse_RetryInfo +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe request TLV 0x01 for DMSUIMChangePIN() +struct sDMSUIMChangePINRequest_Info1 +{ + UINT8 mPINID; + UINT8 mOldPINLength; + + // This array must be the size specified by mOldPINLength + // char mOldPINValue[1]; +}; + +struct sDMSUIMChangePINRequest_Info2 +{ + UINT8 mNewPINLength; + + // This array must be the size specified by mNewPINLength + // char mNewPINValue[1]; +}; + +struct sDMSUIMChangePINRequest_Info +{ + sDMSUIMChangePINRequest_Info1 mDMSUIMChangePINRequest_Info1; + sDMSUIMChangePINRequest_Info2 mDMSUIMChangePINRequest_Info2; +}; + +// Structure to describe response TLV 0x10 for DMSUIMChangePIN() +struct sDMSUIMChangePINResponse_RetryInfo +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x11 for DMSUIMGetPINStatus() +struct sDMSUIMGetPINStatusResponse_PIN1Status +{ + eQMIDMSPINStatus mPINStatus; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x12 for DMSUIMGetPINStatus() +struct sDMSUIMGetPINStatusResponse_PIN2Status +{ + eQMIDMSPINStatus mPINStatus; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x01 for DMSGetHardwareRevision() +struct sDMSGetHardwareRevisionResponse_HardwareRevision +{ + // String is variable length, but must be size of the container + // char mDeviceHardwareRevision[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetOperatingMode() +struct sDMSGetOperatingModeResponse_OperatingMode +{ + eQMIDMSOperatingModes mOperatingMode; +}; + +// Structure to describe response TLV 0x10 for DMSGetOperatingMode() +struct sDMSGetOperatingModeResponse_OfflineReason +{ + UINT8 mHostImageMismatch:1; + UINT8 mUQCNImageMismatch:1; + UINT8 mIncompatibleUQCN:1; + UINT8 mUQCNCopyIssue:1; + + // Padding out 12 bits + UINT8 mReserved1:4; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x11 for DMSGetOperatingMode() +struct sDMSGetOperatingModeResponse_PlatformRestricted +{ + INT8 mPlatformRestricted; +}; + +// Structure to describe request TLV 0x01 for DMSSetOperatingMode() +struct sDMSSetOperatingModeRequest_OperatingMode +{ + eQMIDMSOperatingModes mOperatingMode; +}; + +// Structure to describe response TLV 0x01 for DMSGetTimestamp() +struct sDMSGetTimestampResponse_Timestamp +{ + UINT64 mTimestamp:48; + + // mSource is of type eQMIDMSTimestampSources + UINT64 mSource:16; +}; + +// Structure to describe response TLV 0x01 for DMSGetPRLVersion() +struct sDMSGetPRLVersionResponse_PRLVersion +{ + UINT16 mPRLVersion; +}; + +// Structure to describe response TLV 0x01 for DMSGetActivationState() +struct sDMSGetActivationStateResponse_ActivationState +{ + eQMIDMSActivationStates mActivationState; +}; + +// Structure to describe request TLV 0x01 for DMSActivateAutomatic() +struct sDMSActivateAutomaticRequest_ActivationCode +{ + UINT8 mCodeLength; + + // This array must be the size specified by mCodeLength + // char mCode[1]; +}; + +// Structure to describe request TLV 0x01 for DMSActivateManual() +struct sDMSActivateManualRequest_ActivationData1 +{ + char mSPC[6]; + UINT16 mSID; + UINT8 mMDNLength; + + // This array must be the size specified by mMDNLength + // char mMDN[1]; +}; + +struct sDMSActivateManualRequest_ActivationData2 +{ + UINT8 mMINLength; + + // This array must be the size specified by mMINLength + // char mMIN[1]; +}; + +struct sDMSActivateManualRequest_ActivationData +{ + sDMSActivateManualRequest_ActivationData1 mDMSActivateManualRequest_ActivationData1; + sDMSActivateManualRequest_ActivationData2 mDMSActivateManualRequest_ActivationData2; +}; + +// Structure to describe request TLV 0x10 for DMSActivateManual() +struct sDMSActivateManualRequest_PRLObsolete +{ + UINT16 mPRLLength; + + // This array must be the size specified by mPRLLength + // UINT8 mPRL[1]; +}; + +// Structure to describe request TLV 0x11 for DMSActivateManual() +struct sDMSActivateManualRequest_MNHAKey +{ + UINT8 mMNHALength; + + // This array must be the size specified by mMNHALength + // char mMNHA[1]; +}; + +// Structure to describe request TLV 0x12 for DMSActivateManual() +struct sDMSActivateManualRequest_MNAAAKey +{ + UINT8 mMNAAALength; + + // This array must be the size specified by mMNAAALength + // char mMNAAA[1]; +}; + +// Structure to describe request TLV 0x13 for DMSActivateManual() +struct sDMSActivateManualRequest_PRL +{ + UINT16 mPRLTotalLength; + UINT16 mPRLSegmentLength; + UINT8 mPRLSegmentID; + + // This array must be the size specified by mPRLSegmentLength + // UINT8 mPRL[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetLockState() +struct sDMSGetLockStateResponse_LockState +{ + eQMIDMSLockStates mLockState; +}; + +// Structure to describe request TLV 0x01 for DMSSetLockState() +struct sDMSSetLockStateRequest_LockState +{ + eQMIDMSLockStates mLockState; + char mLockCode[4]; +}; + +// Structure to describe request TLV 0x01 for DMSSetLockCode() +struct sDMSSetLockCodeRequest_LockCode +{ + char mCurrentLockCode[4]; + char mNewLockCode[4]; +}; + +// Structure to describe response TLV 0x01 for DMSReadUserData() +struct sDMSReadUserDataResponse_UserData +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x01 for DMSWriteUserData() +struct sDMSWriteUserDataRequest_UserData +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe response TLV 0x01 for DMSReadERIData() +struct sDMSReadERIDataResponse_UserData +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x01 for DMSResetFactoryDefaults() +struct sDMSResetFactoryDefaultsRequest_SPC +{ + char mSPC[6]; +}; + +// Structure to describe request TLV 0x01 for DMSValidateSPC() +struct sDMSValidateSPCRequest_SPC +{ + char mSPC[6]; +}; + +// Structure to describe response TLV 0x01 for DMSUIMGetICCID() +struct sDMSUIMGetICCIDResponse_ICCID +{ + // String is variable length, but must be size of the container + // char mICCID[1]; +}; + +// Structure to describe response TLV 0x01 for DMSUIMGetHostLockID() +struct sDMSUIMGetHostLockIDResponse_ID +{ + UINT32 mHostLockCode; +}; + +// Structure to describe request TLV 0x01 for DMSUIMGetControlKeyStatus() +struct sDMSUIMGetControlKeyStatusRequest_Facility +{ + eQMIDMSUIMFacility mFacility; +}; + +// Structure to describe response TLV 0x01 for DMSUIMGetControlKeyStatus() +struct sDMSUIMGetControlKeyStatusResponse_Status +{ + eQMIDMSUIMFacilityStates mFacilityState; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x10 for DMSUIMGetControlKeyStatus() +struct sDMSUIMGetControlKeyStatusResponse_Blocking +{ + INT8 mOperationBlocking; +}; + +// Structure to describe request TLV 0x01 for DMSUIMSetControlKeyProtection() +struct sDMSUIMSetControlKeyProtectionRequest_Facility +{ + eQMIDMSUIMFacility mFacility; + eQMIDMSUIMFacilityStates mFacilityState; + UINT8 mControlKeyLength; + + // This array must be the size specified by mControlKeyLength + // char mControlKey[1]; +}; + +// Structure to describe response TLV 0x10 for DMSUIMSetControlKeyProtection() +struct sDMSUIMSetControlKeyProtectionResponse_Status +{ + UINT8 mRemainingVerifyRetries; +}; + +// Structure to describe request TLV 0x01 for DMSUIMUnblockControlKey() +struct sDMSUIMUnblockControlKeyRequest_Facility +{ + eQMIDMSUIMFacility mFacility; + UINT8 mControlKeyLength; + + // This array must be the size specified by mControlKeyLength + // char mControlKey[1]; +}; + +// Structure to describe response TLV 0x10 for DMSUIMUnblockControlKey() +struct sDMSUIMUnblockControlKeyResponse_Status +{ + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x01 for DMSGetIMSI() +struct sDMSGetIMSIResponse_IMSI +{ + // String is variable length, but must be size of the container + // char mIMSI[1]; +}; + +// Structure to describe response TLV 0x01 for DMSGetUIMState() +struct sDMSGetUIMStateResponse_State +{ + eQMIDMSUIMStates mUIMState; +}; + +// Structure to describe response TLV 0x01 for DMSGetBandCapabilities() +struct sDMSGetBandCapabilitiesResponse_Bands +{ + bool mBandClass0ASystem:1; + bool mBandClass0BSystem:1; + bool mBandClass1:1; + bool mBandClass2:1; + bool mBandClass3ASystem:1; + bool mBandClass4:1; + bool mBandClass5:1; + bool mGSMDCS:1; + bool mGSMPrimary:1; + bool mGSMExtended:1; + bool mBandClass6:1; + bool mBandClass7:1; + bool mBandClass8:1; + bool mBandClass9:1; + bool mBandClass10:1; + bool mBandClass11:1; + bool mGSM450:1; + bool mGSM480:1; + bool mGSM750:1; + bool mGSM850:1; + bool mGSMRailways:1; + bool mGSMPCS:1; + bool mWCDMA2100I:1; + bool mWCDMAPCS1900:1; + bool mWCDMADCS1800:1; + bool mWCDMA1700US:1; + bool mWCDMA850:1; + bool mWCDMA800:1; + bool mBandClass12:1; + bool mBandClass14:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mBandClass15:1; + + // Padding out 16 bits + UINT8 mReserved2[2]; + + bool mWCDMA2600:1; + bool mWCDMA900:1; + bool mWCDMA1700Japan:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + bool mBandClass16:1; + bool mBandClass17:1; + bool mBandClass18:1; + bool mBandClass19:1; + + // Padding out 4 bits + UINT8 mReserved4:4; +}; + +// Structure to describe response TLV 0x10 for DMSGetBandCapabilities() +struct sDMSGetBandCapabilitiesResponse_LTEBands +{ + bool mEUTRANBand1:1; + bool mEUTRANBand2:1; + bool mEUTRANBand3:1; + bool mEUTRANBand4:1; + bool mEUTRANBand5:1; + bool mEUTRANBand6:1; + bool mEUTRANBand7:1; + bool mEUTRANBand8:1; + bool mEUTRANBand9:1; + bool mEUTRANBand10:1; + bool mEUTRANBand11:1; + bool mEUTRANBand12:1; + bool mEUTRANBand13:1; + bool mEUTRANBand14:1; + + // Padding out 2 bits + UINT8 mReserved1:2; + + bool mEUTRANBand17:1; + bool mEUTRANBand18:1; + bool mEUTRANBand19:1; + bool mEUTRANBand20:1; + bool mEUTRANBand21:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mEUTRANBand24:1; + bool mEUTRANBand25:1; + + // Padding out 7 bits + UINT8 mReserved3:7; + + bool mEUTRANBand33:1; + bool mEUTRANBand34:1; + bool mEUTRANBand35:1; + bool mEUTRANBand36:1; + bool mEUTRANBand37:1; + bool mEUTRANBand38:1; + bool mEUTRANBand39:1; + bool mEUTRANBand40:1; + bool mEUTRANBand41:1; + + // Padding out 23 bits + UINT8 mReserved4:7; + UINT8 mReserved5[2]; +}; + +// Structure to describe response TLV 0x11 for DMSGetBandCapabilities() +struct sDMSGetBandCapabilitiesResponse_TDSBands +{ + bool mTDSBandA:1; + bool mTDSBandB:1; + bool mTDSBandC:1; + bool mTDSBandD:1; + bool mTDSBandE:1; + bool mTDSBandF:1; + + // Padding out 58 bits + UINT8 mReserved1:2; + UINT8 mReserved2[7]; +}; + +// Structure to describe response TLV 0x01 for DMSGetFactorySerialNumber() +struct sDMSGetFactorySerialNumberResponse_ID +{ + // String is variable length, but must be size of the container + // char mFactorySerialNumber[1]; +}; + +// Structure to describe request TLV 0x01 for DMSSetDeviceTime() +struct sDMSSetDeviceTimeRequest_Time +{ + UINT64 mTimeInMilliseconds; +}; + +// Structure to describe request TLV 0x10 for DMSSetDeviceTime() +struct sDMSSetDeviceTimeRequest_Type +{ + eQMIDMSTimeReferences mTimeReference; +}; + +// Structure to describe response TLV 0x01 for DMSGetSoftwareVersion() +struct sDMSGetSoftwareVersionResponse_Version +{ + // String is variable length, but must be size of the container + // char mSoftwareVersion[1]; +}; + +// Structure to describe request TLV 0x01 for DMSSetSPC() +struct sDMSSetSPCRequest_CurrentSPC +{ + char mCurrentSPC[6]; +}; + +// Structure to describe response TLV 0x10 for DMSGetCurrentPRLInfo() +struct sDMSGetCurrentPRLInfoResponse_Version +{ + UINT16 mPRLVersion; +}; + +// Structure to describe response TLV 0x11 for DMSGetCurrentPRLInfo() +struct sDMSGetCurrentPRLInfoResponse_Preference +{ + INT8 mPRLOnlyPreferenceSet; +}; + +// Structure to describe request TLV 0x01 for NASAbort() +struct sNASAbortRequest_TransactionID +{ + UINT16 mTransactionID; +}; + +// Structure to describe request TLV 0x10 for NASSetEventReport() +struct sNASSetEventReportRequest_SignalIndicator +{ + INT8 mReportSignalStrength; + UINT8 mNumberOfThresholds; + + // This array must be the size specified by mNumberOfThresholds + // INT8 mSignalStrengthThresholddBm[1]; +}; + +// Structure to describe request TLV 0x11 for NASSetEventReport() +struct sNASSetEventReportRequest_RFIndicator +{ + INT8 mReportRFInfo; +}; + +// Structure to describe request TLV 0x12 for NASSetEventReport() +struct sNASSetEventReportRequest_RegistrationRejectIndicator +{ + INT8 mReportLUReject; +}; + +// Structure to describe request TLV 0x13 for NASSetEventReport() +struct sNASSetEventReportRequest_RSSIIndicator +{ + INT8 mReportRSSI; + UINT8 mRSSIDelta; +}; + +// Structure to describe request TLV 0x14 for NASSetEventReport() +struct sNASSetEventReportRequest_ECIOIndicator +{ + INT8 mReportECIO; + UINT8 mECIODelta; +}; + +// Structure to describe request TLV 0x15 for NASSetEventReport() +struct sNASSetEventReportRequest_IOIndicator +{ + INT8 mReportIO; + UINT8 mIODelta; +}; + +// Structure to describe request TLV 0x16 for NASSetEventReport() +struct sNASSetEventReportRequest_SINRIndicator +{ + INT8 mReportSINR; + UINT8 mSINRDelta; +}; + +// Structure to describe request TLV 0x17 for NASSetEventReport() +struct sNASSetEventReportRequest_ErrorRateIndicator +{ + INT8 mReportErrorRate; +}; + +// Structure to describe request TLV 0x18 for NASSetEventReport() +struct sNASSetEventReportRequest_RSRQIndicator +{ + INT8 mReportRSRQ; + UINT8 mRSRQDelta; +}; + +// Structure to describe request TLV 0x19 for NASSetEventReport() +struct sNASSetEventReportRequest_ECIOThreshold +{ + INT8 mReportECIO; + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT16 mThreshold[1]; +}; + +// Structure to describe request TLV 0x1A for NASSetEventReport() +struct sNASSetEventReportRequest_SINRThreshold +{ + INT8 mReportSINR; + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // UINT8 mThreshold[1]; +}; + +// Structure to describe request TLV 0x1B for NASSetEventReport() +struct sNASSetEventReportRequest_LTESNRDelta +{ + INT8 mReportLTESNR; + UINT16 mLTESNRDelta; +}; + +// Structure to describe request TLV 0x1C for NASSetEventReport() +struct sNASSetEventReportRequest_LTERSPSDelta +{ + INT8 mReportLTERSRP; + UINT8 mLTERSRPDelta; +}; + +// Structure to describe indication TLV 0x10 for NAS EventReport +struct sNASEventReportIndication_SignalStrength +{ + INT8 mSignalStrengthdBm; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe indication TLV 0x11 for NAS EventReport +struct sNASEventReportIndication_RFInfo +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + eQMINASRadioInterfaces mRadioInterface; + eQMINASBandClasses mActiveBandClass; + UINT16 mActiveChannel; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x12 for NAS EventReport +struct sNASEventReportIndication_RegistrationReject +{ + eQMINASServiceDomains mServiceDomain; + UINT16 mRejectCause; +}; + +// Structure to describe indication TLV 0x13 for NAS EventReport +struct sNASEventReportIndication_RSSI +{ + UINT8 mRSSIDelta; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe indication TLV 0x14 for NAS EventReport +struct sNASEventReportIndication_ECIO +{ + UINT8 mECIO; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe indication TLV 0x15 for NAS EventReport +struct sNASEventReportIndication_IO +{ + UINT32 mIO; +}; + +// Structure to describe indication TLV 0x16 for NAS EventReport +struct sNASEventReportIndication_SINR +{ + eQMINASSINRLevels mSINR; +}; + +// Structure to describe indication TLV 0x17 for NAS EventReport +struct sNASEventReportIndication_ErrorRate +{ + UINT16 mErrorRate; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe indication TLV 0x18 for NAS EventReport +struct sNASEventReportIndication_RSRQ +{ + INT8 mRSRQ; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe indication TLV 0x19 for NAS EventReport +struct sNASEventReportIndication_LTESNR +{ + INT16 mLTESNR; +}; + +// Structure to describe indication TLV 0x1A for NAS EventReport +struct sNASEventReportIndication_LTERSRP +{ + INT16 mLTERSRP; +}; + +// Structure to describe request TLV 0x10 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_SystemSelectIndicator +{ + INT8 mReportSystemSelect; +}; + +// Structure to describe request TLV 0x12 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_DDTMIndicator +{ + INT8 mReportDDTM; +}; + +// Structure to describe request TLV 0x13 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_ServingSystemIndicator +{ + INT8 mReportServingSystem; +}; + +// Structure to describe request TLV 0x14 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_DualStandbyIndicator +{ + INT8 mReportDualStandby; +}; + +// Structure to describe request TLV 0x15 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_SubscriptionInformationIndicator +{ + INT8 mReportSubscriptionInformation; +}; + +// Structure to describe request TLV 0x17 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_NetworkTimeIndicator +{ + INT8 mReportNetworkTime; +}; + +// Structure to describe request TLV 0x18 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_SystemInformationIndicator +{ + INT8 mReportSystemInformation; +}; + +// Structure to describe request TLV 0x19 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_SignalStrengthIndicator +{ + INT8 mReportSignalStrength; +}; + +// Structure to describe request TLV 0x1A for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_ErrorRateIndicator +{ + INT8 mReportErrorRate; +}; + +// Structure to describe request TLV 0x1B for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_NewEVDOUATIIndicator +{ + INT8 mReportNewEVDOUATI; +}; + +// Structure to describe request TLV 0x1C for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_EVDOSessionIndicator +{ + INT8 mReportEVDOSessionClose; +}; + +// Structure to describe request TLV 0x1D for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_ManagedRoamingIndicator +{ + INT8 mReportManagedRoaming; +}; + +// Structure to describe request TLV 0x1E for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_CurrentPLMNName +{ + INT8 mReportCurrentPLMNName; +}; + +// Structure to describe request TLV 0x1F for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_EMBMSStatus +{ + INT8 mReportEMBMSStatus; +}; + +// Structure to describe request TLV 0x20 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_RFBandInfo +{ + INT8 mReportRFBandInfo; +}; + +// Structure to describe request TLV 0x21 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_NetworkReject +{ + INT8 mNetworkRejectEnabled; + INT8 mSupressSytemInfoEnabled; +}; + +// Structure to describe request TLV 0x22 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_OperatorNameData +{ + INT8 mOperatorNameDataEnabled; +}; + +// Structure to describe request TLV 0x23 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_CSPPLMNModeBit +{ + INT8 mCSPPLMNModeBitEnabled; +}; + +// Structure to describe request TLV 0x24 for NASSetRegistrationEventReport() +struct sNASSetRegistrationEventReportRequest_RTREConfiguration +{ + INT8 mRTREConfigurationEnabled; +}; + +// Structure to describe request TLV 0x10 for NASGetSignalStrength() +struct sNASGetSignalStrengthRequest_RequestMask +{ + bool mQueryRSSI:1; + bool mQueryECIO:1; + bool mQueryIO:1; + bool mQuerySINR:1; + bool mQueryErrorRate:1; + bool mQueryRSRQ:1; + bool mQueryLTESNR:1; + bool mQueryLTERSRQ:1; + + // Padding out 8 bits + UINT8 mReserved1; +}; + +// Structure to describe response TLV 0x01 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_SignalStrength +{ + INT8 mSignalStrengthdBm; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe response TLV 0x10 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_SignalStrengthList +{ + UINT16 mNumberOfInfoInstances; + + struct sInfo + { + INT8 mSignalStrengthdBm; + eQMINASRadioInterfaces mRadioInterface; + }; + + // This array must be the size specified by mNumberOfInfoInstances + // sInfo mInfos[1]; +}; + +// Structure to describe response TLV 0x11 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_RSSIList +{ + UINT16 mNumberOfMeasurements; + + struct sMeasurement + { + UINT8 mRSSIDelta; + eQMINASRadioInterfaces mRadioInterface; + }; + + // This array must be the size specified by mNumberOfMeasurements + // sMeasurement mMeasurements[1]; +}; + +// Structure to describe response TLV 0x12 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_ECIOList +{ + UINT16 mNumberOfMeasurements; + + struct sMeasurement + { + UINT8 mECIO; + eQMINASRadioInterfaces mRadioInterface; + }; + + // This array must be the size specified by mNumberOfMeasurements + // sMeasurement mMeasurements[1]; +}; + +// Structure to describe response TLV 0x13 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_IO +{ + UINT32 mIO; +}; + +// Structure to describe response TLV 0x14 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_SINR +{ + eQMINASSINRLevels mSINR; +}; + +// Structure to describe response TLV 0x15 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_ErrorRateList +{ + UINT16 mNumberOfMeasurements; + + struct sMeasurement + { + UINT16 mErrorRate; + eQMINASRadioInterfaces mRadioInterface; + }; + + // This array must be the size specified by mNumberOfMeasurements + // sMeasurement mMeasurements[1]; +}; + +// Structure to describe response TLV 0x16 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_RSRQ +{ + INT8 mRSRQ; + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe response TLV 0x17 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_LTESNR +{ + INT16 mLTESNR; +}; + +// Structure to describe response TLV 0x18 for NASGetSignalStrength() +struct sNASGetSignalStrengthResponse_LTERSRQ +{ + INT16 mLTERSRP; +}; + +// Structure to describe request TLV 0x10 for NASPerformNetworkScan() +struct sNASPerformNetworkScanRequest_NetworkMask +{ + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + bool mTDSCDMA:1; + + // Padding out 4 bits + UINT8 mReserved1:4; +}; + +// Structure to describe response TLV 0x10 for NASPerformNetworkScan() +struct sNASPerformNetworkScanResponse_NetworkInfo +{ + UINT16 mNumberOfInfoInstances; + + struct sNetworkInfo + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + eQMINASInUseStates mInUseStatus:2; + eQMINASRoamingStates mRoamingStatus:2; + eQMINASForbiddenStates mForbiddenStatus:2; + eQMINASPreferredStates mPreferredStatus:2; + UINT8 mDescriptionLength; + + // This array must be the size specified by mDescriptionLength + // char mDescription[1]; + }; + + // This array must be the size specified by mNumberOfInfoInstances + // sNetworkInfo mNetworkInfos[1]; +}; + +// Structure to describe response TLV 0x11 for NASPerformNetworkScan() +struct sNASPerformNetworkScanResponse_NetworkRAT +{ + UINT16 mNumberOfInfoInstances; + + struct sInfo + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + eQMINASRadioAccessTechnologies mRadioAccessTechnology; + }; + + // This array must be the size specified by mNumberOfInfoInstances + // sInfo mInfos[1]; +}; + +// Structure to describe response TLV 0x12 for NASPerformNetworkScan() +struct sNASPerformNetworkScanResponse_PCSInfo +{ + UINT16 mPCSInfoCount; + + struct sPCSInfo + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + INT8 mMNCIncludesPCSDigit; + }; + + // This array must be the size specified by mPCSInfoCount + // sPCSInfo mPCSInfos[1]; +}; + +// Structure to describe request TLV 0x01 for NASInitiateNetworkRegister() +struct sNASInitiateNetworkRegisterRequest_Action +{ + eQMINASRegisterActions mRegisterAction; +}; + +// Structure to describe request TLV 0x10 for NASInitiateNetworkRegister() +struct sNASInitiateNetworkRegisterRequest_ManualInfo +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + eQMINASRadioAccessTechnologies mRadioAccessTechnology; +}; + +// Structure to describe request TLV 0x11 for NASInitiateNetworkRegister() +struct sNASInitiateNetworkRegisterRequest_ChangeDuration +{ + eQMINASChangeDuration mChangeDuration; +}; + +// Structure to describe request TLV 0x12 for NASInitiateNetworkRegister() +struct sNASInitiateNetworkRegisterRequest_PCSInfo +{ + INT8 mMNCIncludesPCSDigit; +}; + +// Structure to describe request TLV 0x10 for NASInitiateAttach() +struct sNASInitiateAttachRequest_Action +{ + eQMINASPSAttachActions mPSAttachAction; +}; + +// Structure to describe response TLV 0x01 for NASGetServingSystem() +struct sNASGetServingSystemResponse_ServingSystem +{ + eQMINASRegistrationStates mRegistrationState; + eQMINASCSPSAttachStates mCSAttachState; + eQMINASCSPSAttachStates mPSAttachState; + eQMINASRegisteredNetworks mRegisteredNetwork; + UINT8 mNumberOfRadioInterfacesInUse; + + // This array must be the size specified by mNumberOfRadioInterfacesInUse + // eQMINASRadioInterfaces mRadioInterface[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetServingSystem() +struct sNASGetServingSystemResponse_RoamingIndicator +{ + eQMINASRoamingIndicators mRoamingIndicator; +}; + +// Structure to describe response TLV 0x11 for NASGetServingSystem() +struct sNASGetServingSystemResponse_DataServices +{ + UINT8 mNumberOfDataCapabilities; + + // This array must be the size specified by mNumberOfDataCapabilities + // eQMINASDataServiceCapabilities2 mDataCapability[1]; +}; + +// Structure to describe response TLV 0x12 for NASGetServingSystem() +struct sNASGetServingSystemResponse_CurrentPLMN +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + UINT8 mDescriptionLength; + + // This array must be the size specified by mDescriptionLength + // char mDescription[1]; +}; + +// Structure to describe response TLV 0x13 for NASGetServingSystem() +struct sNASGetServingSystemResponse_SystemID +{ + UINT16 mSystemID; + UINT16 mNetworkID; +}; + +// Structure to describe response TLV 0x14 for NASGetServingSystem() +struct sNASGetServingSystemResponse_BaseStation +{ + UINT16 mBaseStationID; + INT32 mLatitude; + INT32 mLongitude; +}; + +// Structure to describe response TLV 0x15 for NASGetServingSystem() +struct sNASGetServingSystemResponse_RoamingList +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + eQMINASRadioInterfaces mRadioInterface; + eQMINASRoamingIndicators mRoamingIndicator; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x16 for NASGetServingSystem() +struct sNASGetServingSystemResponse_DefaultRoaming +{ + eQMINASRoamingIndicators mRoamingIndicator; +}; + +// Structure to describe response TLV 0x17 for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPP2TimeZone +{ + UINT8 mLeapSeconds; + INT8 mLocalTimeOffset; + INT8 mDaylightSavingsInEffect; +}; + +// Structure to describe response TLV 0x18 for NASGetServingSystem() +struct sNASGetServingSystemResponse_ProtocolRevision +{ + eQMINASRevision mProtocolRevision; +}; + +// Structure to describe response TLV 0x1A for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPPTimeZone +{ + INT8 m3GPPTimeZone; +}; + +// Structure to describe response TLV 0x1B for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPPDaylightSavingsAdjustment +{ + eQMINASDaylightSavingsAdjustment mDaylightSavingsAdjustment; +}; + +// Structure to describe response TLV 0x1C for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPPLocationAreaCode +{ + UINT16 mLocationAreaCode; +}; + +// Structure to describe response TLV 0x1D for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPPCellID +{ + UINT32 mCellID; +}; + +// Structure to describe response TLV 0x1E for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPP2ConcurrentService +{ + eQMINASConcurrentService mConcurrentService; +}; + +// Structure to describe response TLV 0x1F for NASGetServingSystem() +struct sNASGetServingSystemResponse_3GPP2PRLIndicator +{ + eQMINASPRLIndicator mPRLIndicator; +}; + +// Structure to describe response TLV 0x20 for NASGetServingSystem() +struct sNASGetServingSystemResponse_DualTransferModeIndication +{ + eQMINASDualTransferMode mDualTransferMode; +}; + +// Structure to describe response TLV 0x21 for NASGetServingSystem() +struct sNASGetServingSystemResponse_DetailedServiceInformation +{ + eQMINASServiceStatus mServiceStatus; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + eQMINASServiceStatus mCDMA1xEVDOServiceStatus; + eQMINASCDMA1xEVDOHybridInformation mCDMA1xEVDOHybridInformation; + eQMINASSystemForbidden mSystemForbidden; +}; + +// Structure to describe response TLV 0x22 for NASGetServingSystem() +struct sNASGetServingSystemResponse_CDMASystemInformation +{ + UINT16 mMobileCountryCode; + UINT8 mIMSI_11_12; +}; + +// Structure to describe response TLV 0x23 for NASGetServingSystem() +struct sNASGetServingSystemResponse_CDMA1xEVDOPersonality +{ + eQMINASCDMA1xEVDOPersonality mCDMA1xEVDOPersonality; +}; + +// Structure to describe response TLV 0x24 for NASGetServingSystem() +struct sNASGetServingSystemResponse_TrackingAreaCode +{ + UINT16 mTrackingAreaCode; +}; + +// Structure to describe response TLV 0x25 for NASGetServingSystem() +struct sNASGetServingSystemResponse_CallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe response TLV 0x26 for NASGetServingSystem() +struct sNASGetServingSystemResponse_UMTSPSC +{ + UINT16 mPrimaryScramblingCode; +}; + +// Structure to describe response TLV 0x27 for NASGetServingSystem() +struct sNASGetServingSystemResponse_PCSInfo +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + INT8 mMNCIncludesPCSDigit; +}; + +// Structure to describe response TLV 0x28 for NASGetServingSystem() +struct sNASGetServingSystemResponse_HSCallStatus +{ + eQMINASHighSpeedCallStatus mHighSpeedCallStatus; +}; + +// Structure to describe indication TLV 0x01 for NAS ServingSystemIndication +struct sNASServingSystemIndication_ServingSystem +{ + eQMINASRegistrationStates mRegistrationState; + eQMINASCSPSAttachStates mCSAttachState; + eQMINASCSPSAttachStates mPSAttachState; + eQMINASRegisteredNetworks mRegisteredNetwork; + UINT8 mNumberOfRadioInterfacesInUse; + + // This array must be the size specified by mNumberOfRadioInterfacesInUse + // eQMINASRadioInterfaces mRadioInterface[1]; +}; + +// Structure to describe indication TLV 0x10 for NAS ServingSystemIndication +struct sNASServingSystemIndication_RoamingIndicator +{ + eQMINASRoamingIndicators mRoamingIndicator; +}; + +// Structure to describe indication TLV 0x11 for NAS ServingSystemIndication +struct sNASServingSystemIndication_DataServices +{ + UINT8 mNumberOfDataCapabilities; + + // This array must be the size specified by mNumberOfDataCapabilities + // eQMINASDataServiceCapabilities2 mDataCapability[1]; +}; + +// Structure to describe indication TLV 0x12 for NAS ServingSystemIndication +struct sNASServingSystemIndication_CurrentPLMN +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + UINT8 mDescriptionLength; + + // This array must be the size specified by mDescriptionLength + // char mDescription[1]; +}; + +// Structure to describe indication TLV 0x13 for NAS ServingSystemIndication +struct sNASServingSystemIndication_SystemID +{ + UINT16 mSystemID; + UINT16 mNetworkID; +}; + +// Structure to describe indication TLV 0x14 for NAS ServingSystemIndication +struct sNASServingSystemIndication_BaseStation +{ + UINT16 mBaseStationID; + INT32 mLatitude; + INT32 mLongitude; +}; + +// Structure to describe indication TLV 0x15 for NAS ServingSystemIndication +struct sNASServingSystemIndication_RoamingList +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + eQMINASRadioInterfaces mRadioInterface; + eQMINASRoamingIndicators mRoamingIndicator; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x16 for NAS ServingSystemIndication +struct sNASServingSystemIndication_DefaultRoaming +{ + eQMINASRoamingIndicators mRoamingIndicator; +}; + +// Structure to describe indication TLV 0x17 for NAS ServingSystemIndication +struct sNASServingSystemIndication_TimeZone +{ + UINT8 mLeapSeconds; + INT8 mLocalTimeOffset; + INT8 mDaylightSavingsInEffect; +}; + +// Structure to describe indication TLV 0x18 for NAS ServingSystemIndication +struct sNASServingSystemIndication_ProtocolRevision +{ + eQMINASRevision mProtocolRevision; +}; + +// Structure to describe indication TLV 0x19 for NAS ServingSystemIndication +struct sNASServingSystemIndication_PLMNChange +{ + INT8 mPLMNChanged; +}; + +// Structure to describe indication TLV 0x1A for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPPTimeZone +{ + INT8 m3GPPTimeZone; +}; + +// Structure to describe indication TLV 0x1B for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPPDaylightSavingAdjustment +{ + eQMINASDaylightSavingsAdjustment mDaylightSavingsAdjustment; +}; + +// Structure to describe indication TLV 0x1C for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPPUniversalTimeAndZone +{ + UINT16 mYear; + UINT8 mMonth; + UINT8 mDay; + UINT8 mHour; + UINT8 mMinute; + UINT8 mSecond; + INT8 mTimeZoneOffset; +}; + +// Structure to describe indication TLV 0x1D for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPPLocationAreaCode +{ + UINT16 mLocationAreaCode; +}; + +// Structure to describe indication TLV 0x1E for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPPCellID +{ + UINT32 mCellID; +}; + +// Structure to describe indication TLV 0x1F for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPP2ConcurrentService +{ + eQMINASConcurrentService mConcurrentService; +}; + +// Structure to describe indication TLV 0x20 for NAS ServingSystemIndication +struct sNASServingSystemIndication_3GPP2PRLIndicator +{ + eQMINASPRLIndicator mPRLIndicator; +}; + +// Structure to describe indication TLV 0x21 for NAS ServingSystemIndication +struct sNASServingSystemIndication_DualTransferModeIndication +{ + eQMINASDualTransferMode mDualTransferMode; +}; + +// Structure to describe indication TLV 0x22 for NAS ServingSystemIndication +struct sNASServingSystemIndication_DetailedServiceInformation +{ + eQMINASServiceStatus mServiceStatus; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + eQMINASServiceStatus mCDMA1xEVDOServiceStatus; + eQMINASCDMA1xEVDOHybridInformation mCDMA1xEVDOHybridInformation; + eQMINASSystemForbidden mSystemForbidden; +}; + +// Structure to describe indication TLV 0x23 for NAS ServingSystemIndication +struct sNASServingSystemIndication_CDMASystemInformation +{ + UINT16 mMobileCountryCode; + UINT8 mIMSI_11_12; +}; + +// Structure to describe indication TLV 0x24 for NAS ServingSystemIndication +struct sNASServingSystemIndication_CDMA1xEVDOPersonality +{ + eQMINASCDMA1xEVDOPersonality mCDMA1xEVDOPersonality; +}; + +// Structure to describe indication TLV 0x25 for NAS ServingSystemIndication +struct sNASServingSystemIndication_TrackingAreaCode +{ + UINT16 mTrackingAreaCode; +}; + +// Structure to describe indication TLV 0x26 for NAS ServingSystemIndication +struct sNASServingSystemIndication_CallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe indication TLV 0x27 for NAS ServingSystemIndication +struct sNASServingSystemIndication_PLMNChangeStatus +{ + INT8 mNoPLMNChange; +}; + +// Structure to describe indication TLV 0x28 for NAS ServingSystemIndication +struct sNASServingSystemIndication_UMTSPSC +{ + UINT16 mPrimaryScramblingCode; +}; + +// Structure to describe indication TLV 0x29 for NAS ServingSystemIndication +struct sNASServingSystemIndication_PCSInfo +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + INT8 mMNCIncludesPCSDigit; +}; + +// Structure to describe indication TLV 0x2A for NAS ServingSystemIndication +struct sNASServingSystemIndication_HSCallStatus +{ + eQMINASHighSpeedCallStatus mHighSpeedCallStatus; +}; + +// Structure to describe response TLV 0x01 for NASGetHomeNetwork() +struct sNASGetHomeNetworkResponse_HomeNetwork +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + UINT8 mDescriptionLength; + + // This array must be the size specified by mDescriptionLength + // char mDescription[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetHomeNetwork() +struct sNASGetHomeNetworkResponse_HomeIDs +{ + UINT16 mSystemID; + UINT16 mNetworkID; +}; + +// Structure to describe response TLV 0x11 for NASGetHomeNetwork() +struct sNASGetHomeNetworkResponse_ExtendedHomeNetwork +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + eQMINASNetworkDescriptionDisplays mDisplayNetworkDescription; + eQMINASNetworkDescriptionEncodings mNetworkDescriptionEncoding; + UINT8 mNetworkDescriptionLength; + + // This array must be the size specified by mNetworkDescriptionLength + // UINT8 mNetworkDescription[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetPreferredNetworks() +struct sNASGetPreferredNetworksResponse_Networks +{ + UINT16 mNumberOfPreferredNetworks; + + struct sNetwork + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + + // Padding out 6 bits + UINT8 mReserved1:6; + + bool mGSMCompact:1; + bool mGSM:1; + + // Padding out 6 bits + UINT8 mReserved2:6; + + bool mLTE:1; + bool mUMTS:1; + }; + + // This array must be the size specified by mNumberOfPreferredNetworks + // sNetwork mNetworks[1]; +}; + +// Structure to describe response TLV 0x11 for NASGetPreferredNetworks() +struct sNASGetPreferredNetworksResponse_StaticNetworks +{ + UINT16 mNumberOfPreferredNetworks; + + struct sNetwork + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + + // Padding out 6 bits + UINT8 mReserved1:6; + + bool mGSMCompact:1; + bool mGSM:1; + + // Padding out 6 bits + UINT8 mReserved2:6; + + bool mLTE:1; + bool mUMTS:1; + }; + + // This array must be the size specified by mNumberOfPreferredNetworks + // sNetwork mNetworks[1]; +}; + +// Structure to describe request TLV 0x10 for NASSetPreferredNetworks() +struct sNASSetPreferredNetworksRequest_Networks +{ + UINT16 mNumberOfPreferredNetworks; + + struct sNetwork + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + + // Padding out 6 bits + UINT8 mReserved1:6; + + bool mGSMCompact:1; + bool mGSM:1; + + // Padding out 6 bits + UINT8 mReserved2:6; + + bool mLTE:1; + bool mUMTS:1; + }; + + // This array must be the size specified by mNumberOfPreferredNetworks + // sNetwork mNetworks[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetForbiddenNetworks() +struct sNASGetForbiddenNetworksResponse_Networks +{ + UINT16 mNumberOfForbiddenNetworks; + + struct sNetwork + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + }; + + // This array must be the size specified by mNumberOfForbiddenNetworks + // sNetwork mNetworks[1]; +}; + +// Structure to describe request TLV 0x10 for NASSetForbiddenNetworks() +struct sNASSetForbiddenNetworksRequest_Networks +{ + UINT16 mNumberOfForbiddenNetworks; + + struct sNetwork + { + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + }; + + // This array must be the size specified by mNumberOfForbiddenNetworks + // sNetwork mNetworks[1]; +}; + +// Structure to describe request TLV 0x01 for NASSetTechnologyPreference() +struct sNASSetTechnologyPreferenceRequest_Preference +{ + // mTechnology must be the first two bits of a UINT8 + // whose remaining bits are described in the optional + // structs following. + + // The following union is based on the value of mTechnology + union uValOfTechnology + { + // Always present + eQMINASTechPrefs mTechnology:2; + + // If the value of mTechnology == 1 + struct sTechnologyIs1 + { + // Padding out 2 bits + UINT8 mReserved1:2; + + UINT8 mAnalog:1; + UINT8 mDigital:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + }; + + sTechnologyIs1 mTechnologyIs1; + + // If the value of mTechnology == 2 + struct sTechnologyIs2 + { + // Padding out 2 bits + UINT8 mReserved3:2; + + UINT8 mGSM:1; + UINT8 mWCDMA:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved4:2; + }; + + sTechnologyIs2 mTechnologyIs2; + + // Padding out 8 bits + UINT8 mReserved5; + }; + + uValOfTechnology mValOfTechnology; + + // Padding out 8 bits + UINT8 mReserved6; + + eQMINASTechPrefDurations mDuration; +}; + +// Structure to describe response TLV 0x01 for NASGetTechnologyPreference() +struct sNASGetTechnologyPreferenceResponse_ActivePreference +{ + // mTechnology must be the first two bits of a UINT8 + // whose remaining bits are described in the optional + // structs following. + + // The following union is based on the value of mTechnology + union uValOfTechnology + { + // Always present + eQMINASTechPrefs mTechnology:2; + + // If the value of mTechnology == 1 + struct sTechnologyIs1 + { + // Padding out 2 bits + UINT8 mReserved1:2; + + UINT8 mAnalog:1; + UINT8 mDigital:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + }; + + sTechnologyIs1 mTechnologyIs1; + + // If the value of mTechnology == 2 + struct sTechnologyIs2 + { + // Padding out 2 bits + UINT8 mReserved3:2; + + UINT8 mGSM:1; + UINT8 mWCDMA:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved4:2; + }; + + sTechnologyIs2 mTechnologyIs2; + + // Padding out 8 bits + UINT8 mReserved5; + }; + + uValOfTechnology mValOfTechnology; + + // Padding out 8 bits + UINT8 mReserved6; + + eQMINASTechPrefDurations mDuration; +}; + +// Structure to describe response TLV 0x10 for NASGetTechnologyPreference() +struct sNASGetTechnologyPreferenceResponse_PersistentPreference +{ + // mTechnology must be the first two bits of a UINT8 + // whose remaining bits are described in the optional + // structs following. + + // The following union is based on the value of mTechnology + union uValOfTechnology + { + // Always present + eQMINASTechPrefs mTechnology:2; + + // If the value of mTechnology == 1 + struct sTechnologyIs1 + { + // Padding out 2 bits + UINT8 mReserved1:2; + + UINT8 mAnalog:1; + UINT8 mDigital:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + }; + + sTechnologyIs1 mTechnologyIs1; + + // If the value of mTechnology == 2 + struct sTechnologyIs2 + { + // Padding out 2 bits + UINT8 mReserved3:2; + + UINT8 mGSM:1; + UINT8 mWCDMA:1; + UINT8 mEVDO:1; + UINT8 mLTE:1; + + // Padding out 2 bits + UINT8 mReserved4:2; + }; + + sTechnologyIs2 mTechnologyIs2; + + // Padding out 8 bits + UINT8 mReserved5; + }; + + uValOfTechnology mValOfTechnology; + + // Padding out 8 bits + UINT8 mReserved6; +}; + +// Structure to describe response TLV 0x01 for NASGetACCOLC() +struct sNASGetACCOLCResponse_ACCOLC +{ + UINT8 mACCOLC; +}; + +// Structure to describe request TLV 0x01 for NASSetACCOLC() +struct sNASSetACCOLCRequest_ACCOLC +{ + char mSPC[6]; + UINT8 mACCOLC; +}; + +// Structure to describe indication TLV 0x01 for NAS GetSystemPreference +struct sNASGetSystemPreferenceIndication_Pref +{ + eQMINASSystemPreferences mSystemPreference; +}; + +// Structure to describe response TLV 0x11 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_SCI +{ + UINT8 mSlotCycleIndex; +}; + +// Structure to describe response TLV 0x12 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_SCM +{ + UINT8 mStationClassMark; +}; + +// Structure to describe response TLV 0x13 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_Registration +{ + INT8 mRegisterOnHomeSystem; + INT8 mRegisterOnForeignSystem; + INT8 mRegisterOnForeignNetwork; +}; + +// Structure to describe response TLV 0x14 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_CDMA1xEVDORevision +{ + INT8 mForceCDMA1xEVDORev0; +}; + +// Structure to describe response TLV 0x15 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_CDMA1xEVDOSCPCustom +{ + INT8 mCDMA1xEVDOSCPCustomConfig; + bool mSubtype2PhysicalLayer:1; + bool mEnhancedCCMAC:1; + bool mEnhancedACMAC:1; + bool mEnhancedFTCMAC:1; + bool mSubtype3RTCMAC:1; + bool mSubtype1RTCMAC:1; + bool mEnhancedIdle:1; + bool mGenericMultimodeCapableDiscPort:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; + + bool mGenericBroadcast:1; + + // Padding out 31 bits + UINT8 mReserved2:7; + UINT8 mReserved3[3]; + + bool mSNMultiflowPacketApplication:1; + bool mSNEnhancedMultiflowPacketApplication:1; + + // Padding out 30 bits + UINT8 mReserved4:6; + UINT8 mReserved5[3]; +}; + +// Structure to describe response TLV 0x16 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_Roaming +{ + eQMINASRoamingPreferences mRoamPreference; +}; + +// Structure to describe response TLV 0x17 for NASGetNetworkParameters() +struct sNASGetNetworkParametersResponse_ForceCDMA1xEVDOSCP +{ + eQMINASForceCDMA1xEVDOSCP mForceCDMA1xEVDOSCP; +}; + +// Structure to describe request TLV 0x10 for NASSetNetworkParameters() +struct sNASSetNetworkParametersRequest_SPC +{ + char mSPC[6]; +}; + +// Structure to describe request TLV 0x14 for NASSetNetworkParameters() +struct sNASSetNetworkParametersRequest_CDMA1xEVDORevision +{ + INT8 mForceCDMA1xEVDORev0; +}; + +// Structure to describe request TLV 0x15 for NASSetNetworkParameters() +struct sNASSetNetworkParametersRequest_CDMA1xEVDOSCPCustom +{ + INT8 mCDMA1xEVDOSCPCustomConfig; + bool mSubtype2PhysicalLayer:1; + bool mEnhancedCCMAC:1; + bool mEnhancedACMAC:1; + bool mEnhancedFTCMAC:1; + bool mSubtype3RTCMAC:1; + bool mSubtype1RTCMAC:1; + bool mEnhancedIdle:1; + bool mGenericMultimodeCapableDiscPort:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; + + bool mGenericBroadcast:1; + + // Padding out 31 bits + UINT8 mReserved2:7; + UINT8 mReserved3[3]; + + bool mSNMultiflowPacketApplication:1; + bool mSNEnhancedMultiflowPacketApplication:1; + + // Padding out 30 bits + UINT8 mReserved4:6; + UINT8 mReserved5[3]; +}; + +// Structure to describe request TLV 0x16 for NASSetNetworkParameters() +struct sNASSetNetworkParametersRequest_Roaming +{ + eQMINASRoamingPreferences mRoamPreference; +}; + +// Structure to describe response TLV 0x01 for NASGetRFInfo() +struct sNASGetRFInfoResponse_RFInfo +{ + UINT8 mNumberOfInstances; + + struct sInstance + { + eQMINASRadioInterfaces mRadioInterface; + eQMINASBandClasses mActiveBandClass; + UINT16 mActiveChannel; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x01 for NASGetANAAAAuthenticationStatus() +struct sNASGetANAAAAuthenticationStatusResponse_Status +{ + eQMINASANAAAAuthenticationStatus mANAAAAuthenticationStatus; +}; + +// Structure to describe request TLV 0x10 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_EmergencyMode +{ + INT8 mEmergencyModeOn; +}; + +// Structure to describe request TLV 0x11 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_Mode +{ + bool mCDMA1x:1; + bool mCDMA1xEVDO:1; + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + bool mTDSCDMA:1; + + // Padding out 10 bits + UINT8 mReserved1:2; + UINT8 mReserved2; +}; + +// Structure to describe request TLV 0x12 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_Band +{ + bool mBandClass0ASystem:1; + bool mBandClass0BSystem:1; + bool mBandClass1:1; + bool mBandClass2:1; + bool mBandClass3ASystem:1; + bool mBandClass4:1; + bool mBandClass5:1; + bool mGSMDCS:1; + bool mGSMPrimary:1; + bool mGSMExtended:1; + bool mBandClass6:1; + bool mBandClass7:1; + bool mBandClass8:1; + bool mBandClass9:1; + bool mBandClass10:1; + bool mBandClass11:1; + bool mGSM450:1; + bool mGSM480:1; + bool mGSM750:1; + bool mGSM850:1; + bool mGSMRailways:1; + bool mGSMPCS:1; + bool mWCDMA2100I:1; + bool mWCDMAPCS1900:1; + bool mWCDMADCS1800:1; + bool mWCDMA1700US:1; + bool mWCDMA850:1; + bool mWCDMA800:1; + bool mBandClass12:1; + bool mBandClass14:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mBandClass15:1; + + // Padding out 16 bits + UINT8 mReserved2[2]; + + bool mWCDMA2600:1; + bool mWCDMA900:1; + bool mWCDMA1700Japan:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + bool mBandClass16:1; + bool mBandClass17:1; + bool mBandClass18:1; + bool mBandClass19:1; + + // Padding out 4 bits + UINT8 mReserved4:4; +}; + +// Structure to describe request TLV 0x13 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_PRL +{ + eQMINASPRLPreferences mPRLPreference; +}; + +// Structure to describe request TLV 0x14 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_Roaming +{ + eQMINASRoamingPreferences2 mRoamingPreference; +}; + +// Structure to describe request TLV 0x15 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_LTEBand +{ + bool mEUTRABand1:1; + bool mEUTRABand2:1; + bool mEUTRABand3:1; + bool mEUTRABand4:1; + bool mEUTRABand5:1; + bool mEUTRABand6:1; + bool mEUTRABand7:1; + bool mEUTRABand8:1; + bool mEUTRABand9:1; + bool mEUTRABand10:1; + bool mEUTRABand11:1; + bool mEUTRABand12:1; + bool mEUTRABand13:1; + bool mEUTRABand14:1; + + // Padding out 2 bits + UINT8 mReserved1:2; + + bool mEUTRABand17:1; + bool mEUTRABand18:1; + bool mEUTRABand19:1; + bool mEUTRABand20:1; + bool mEUTRABand21:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mEUTRABand24:1; + bool mEUTRABand25:1; + + // Padding out 7 bits + UINT8 mReserved3:7; + + bool mEUTRABand33:1; + bool mEUTRABand34:1; + bool mEUTRABand35:1; + bool mEUTRABand36:1; + bool mEUTRABand37:1; + bool mEUTRABand38:1; + bool mEUTRABand39:1; + bool mEUTRABand40:1; + bool mEUTRABand41:1; + bool mEUTRABand42:1; + bool mEUTRABand43:1; + + // Padding out 21 bits + UINT8 mReserved4:5; + UINT8 mReserved5[2]; +}; + +// Structure to describe request TLV 0x16 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_NetworkSelection +{ + eQMINASNetworkSelection mNetworkSelection; + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; +}; + +// Structure to describe request TLV 0x17 for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_ChangeDuration +{ + eQMINASChangeDuration mChangeDuration; +}; + +// Structure to describe request TLV 0x1A for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_PCSInfo +{ + INT8 mMNCIncludesPCSDigit; +}; + +// Structure to describe request TLV 0x1B for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_Domain +{ + eQMINASServiceDomainPrefs mServiceDomainPreference; +}; + +// Structure to describe request TLV 0x1C for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_Acquisition +{ + eQMINASAcquisitionOrder mAcquisitionOrderPreference; +}; + +// Structure to describe request TLV 0x1D for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_TDSCDMABand +{ + bool mTDSCDMABandA:1; + bool mTDSCDMABandB:1; + bool mTDSCDMABandC:1; + bool mTDSCDMABandD:1; + bool mTDSCDMABandE:1; + bool mTDSCDMABandF:1; + + // Padding out 58 bits + UINT8 mReserved1:2; + UINT8 mReserved2[7]; +}; + +// Structure to describe request TLV 0x1E for NASSetSystemSelectionPref() +struct sNASSetSystemSelectionPrefRequest_AcquisitionOrder +{ + UINT8 mNumberOfRadioInterfaces; + + // This array must be the size specified by mNumberOfRadioInterfaces + // eQMINASRadioInterfaces mRadioInterface[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_EmergencyMode +{ + INT8 mEmergencyModeOn; +}; + +// Structure to describe response TLV 0x11 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_Mode +{ + bool mCDMA1x:1; + bool mCDMA1xEVDO:1; + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + bool mTDSCDMA:1; + + // Padding out 10 bits + UINT8 mReserved1:2; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x12 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_Band +{ + bool mBandClass0ASystem:1; + bool mBandClass0BSystem:1; + bool mBandClass1:1; + bool mBandClass2:1; + bool mBandClass3ASystem:1; + bool mBandClass4:1; + bool mBandClass5:1; + bool mGSMDCS:1; + bool mGSMPrimary:1; + bool mGSMExtended:1; + bool mBandClass6:1; + bool mBandClass7:1; + bool mBandClass8:1; + bool mBandClass9:1; + bool mBandClass10:1; + bool mBandClass11:1; + bool mGSM450:1; + bool mGSM480:1; + bool mGSM750:1; + bool mGSM850:1; + bool mGSMRailways:1; + bool mGSMPCS:1; + bool mWCDMA2100I:1; + bool mWCDMAPCS1900:1; + bool mWCDMADCS1800:1; + bool mWCDMA1700US:1; + bool mWCDMA850:1; + bool mWCDMA800:1; + bool mBandClass12:1; + bool mBandClass14:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mBandClass15:1; + + // Padding out 16 bits + UINT8 mReserved2[2]; + + bool mWCDMA2600:1; + bool mWCDMA900:1; + bool mWCDMA1700Japan:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + bool mBandClass16:1; + bool mBandClass17:1; + bool mBandClass18:1; + bool mBandClass19:1; + + // Padding out 4 bits + UINT8 mReserved4:4; +}; + +// Structure to describe response TLV 0x13 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_PRL +{ + eQMINASPRLPreferences mPRLPreference; +}; + +// Structure to describe response TLV 0x14 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_Roaming +{ + eQMINASRoamingPreferences2 mRoamingPreference; +}; + +// Structure to describe response TLV 0x15 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_LTEBand +{ + bool mEUTRABand1:1; + bool mEUTRABand2:1; + bool mEUTRABand3:1; + bool mEUTRABand4:1; + bool mEUTRABand5:1; + bool mEUTRABand6:1; + bool mEUTRABand7:1; + bool mEUTRABand8:1; + bool mEUTRABand9:1; + bool mEUTRABand10:1; + bool mEUTRABand11:1; + bool mEUTRABand12:1; + bool mEUTRABand13:1; + bool mEUTRABand14:1; + + // Padding out 2 bits + UINT8 mReserved1:2; + + bool mEUTRABand17:1; + bool mEUTRABand18:1; + bool mEUTRABand19:1; + bool mEUTRABand20:1; + bool mEUTRABand21:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mEUTRABand24:1; + bool mEUTRABand25:1; + + // Padding out 7 bits + UINT8 mReserved3:7; + + bool mEUTRABand33:1; + bool mEUTRABand34:1; + bool mEUTRABand35:1; + bool mEUTRABand36:1; + bool mEUTRABand37:1; + bool mEUTRABand38:1; + bool mEUTRABand39:1; + bool mEUTRABand40:1; + bool mEUTRABand41:1; + bool mEUTRABand42:1; + bool mEUTRABand43:1; + + // Padding out 21 bits + UINT8 mReserved4:5; + UINT8 mReserved5[2]; +}; + +// Structure to describe response TLV 0x16 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_NetworkSelection +{ + eQMINASNetworkSelection mNetworkSelection; +}; + +// Structure to describe response TLV 0x18 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_Domain +{ + eQMINASServiceDomainPrefs mServiceDomainPreference; +}; + +// Structure to describe response TLV 0x19 for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_Acquisition +{ + eQMINASAcquisitionOrder mAcquisitionOrderPreference; +}; + +// Structure to describe response TLV 0x1A for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_TDSCDMABand +{ + bool mTDSCDMABandA:1; + bool mTDSCDMABandB:1; + bool mTDSCDMABandC:1; + bool mTDSCDMABandD:1; + bool mTDSCDMABandE:1; + bool mTDSCDMABandF:1; + + // Padding out 58 bits + UINT8 mReserved1:2; + UINT8 mReserved2[7]; +}; + +// Structure to describe response TLV 0x1B for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_ManualPLMN +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + INT8 mMNCIncludesPCSDigit; +}; + +// Structure to describe response TLV 0x1C for NASGetSystemSelectionPref() +struct sNASGetSystemSelectionPrefResponse_AcquisitionOrder +{ + UINT8 mNumberOfRadioInterfaces; + + // This array must be the size specified by mNumberOfRadioInterfaces + // eQMINASRadioInterfaces mRadioInterface[1]; +}; + +// Structure to describe indication TLV 0x10 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_EmergencyMode +{ + INT8 mEmergencyModeOn; +}; + +// Structure to describe indication TLV 0x11 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_Mode +{ + bool mCDMA1x:1; + bool mCDMA1xEVDO:1; + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + bool mTDSCDMA:1; + + // Padding out 10 bits + UINT8 mReserved1:2; + UINT8 mReserved2; +}; + +// Structure to describe indication TLV 0x12 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_Band +{ + bool mBandClass0ASystem:1; + bool mBandClass0BSystem:1; + bool mBandClass1:1; + bool mBandClass2:1; + bool mBandClass3ASystem:1; + bool mBandClass4:1; + bool mBandClass5:1; + bool mGSMDCS:1; + bool mGSMPrimary:1; + bool mGSMExtended:1; + bool mBandClass6:1; + bool mBandClass7:1; + bool mBandClass8:1; + bool mBandClass9:1; + bool mBandClass10:1; + bool mBandClass11:1; + bool mGSM450:1; + bool mGSM480:1; + bool mGSM750:1; + bool mGSM850:1; + bool mGSMRailways:1; + bool mGSMPCS:1; + bool mWCDMA2100I:1; + bool mWCDMAPCS1900:1; + bool mWCDMADCS1800:1; + bool mWCDMA1700US:1; + bool mWCDMA850:1; + bool mWCDMA800:1; + bool mBandClass12:1; + bool mBandClass14:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mBandClass15:1; + + // Padding out 16 bits + UINT8 mReserved2[2]; + + bool mWCDMA2600:1; + bool mWCDMA900:1; + bool mWCDMA1700Japan:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + bool mBandClass16:1; + bool mBandClass17:1; + bool mBandClass18:1; + bool mBandClass19:1; + + // Padding out 4 bits + UINT8 mReserved4:4; +}; + +// Structure to describe indication TLV 0x13 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_PRL +{ + eQMINASPRLPreferences mPRLPreference; +}; + +// Structure to describe indication TLV 0x14 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_Roaming +{ + eQMINASRoamingPreferences2 mRoamingPreference; +}; + +// Structure to describe indication TLV 0x15 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_LTEBand +{ + bool mEUTRABand1:1; + bool mEUTRABand2:1; + bool mEUTRABand3:1; + bool mEUTRABand4:1; + bool mEUTRABand5:1; + bool mEUTRABand6:1; + bool mEUTRABand7:1; + bool mEUTRABand8:1; + bool mEUTRABand9:1; + bool mEUTRABand10:1; + bool mEUTRABand11:1; + bool mEUTRABand12:1; + bool mEUTRABand13:1; + bool mEUTRABand14:1; + + // Padding out 2 bits + UINT8 mReserved1:2; + + bool mEUTRABand17:1; + bool mEUTRABand18:1; + bool mEUTRABand19:1; + bool mEUTRABand20:1; + bool mEUTRABand21:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mEUTRABand24:1; + bool mEUTRABand25:1; + + // Padding out 7 bits + UINT8 mReserved3:7; + + bool mEUTRABand33:1; + bool mEUTRABand34:1; + bool mEUTRABand35:1; + bool mEUTRABand36:1; + bool mEUTRABand37:1; + bool mEUTRABand38:1; + bool mEUTRABand39:1; + bool mEUTRABand40:1; + bool mEUTRABand41:1; + bool mEUTRABand42:1; + bool mEUTRABand43:1; + + // Padding out 21 bits + UINT8 mReserved4:5; + UINT8 mReserved5[2]; +}; + +// Structure to describe indication TLV 0x16 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_NetworkSelection +{ + eQMINASNetworkSelection mNetworkSelection; +}; + +// Structure to describe indication TLV 0x18 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_Domain +{ + eQMINASServiceDomainPrefs mServiceDomainPreference; +}; + +// Structure to describe indication TLV 0x19 for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_Acquisition +{ + eQMINASAcquisitionOrder mAcquisitionOrderPreference; +}; + +// Structure to describe indication TLV 0x1A for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_TDSCDMABand +{ + bool mTDSCDMABandA:1; + bool mTDSCDMABandB:1; + bool mTDSCDMABandC:1; + bool mTDSCDMABandD:1; + bool mTDSCDMABandE:1; + bool mTDSCDMABandF:1; + + // Padding out 58 bits + UINT8 mReserved1:2; + UINT8 mReserved2[7]; +}; + +// Structure to describe indication TLV 0x1B for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_ManualPLMN +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + INT8 mMNCIncludesPCSDigit; +}; + +// Structure to describe indication TLV 0x1C for NAS SystemSelectionPrefIndication +struct sNASSystemSelectionPrefIndication_AcquisitionOrder +{ + UINT8 mNumberOfRadioInterfaces; + + // This array must be the size specified by mNumberOfRadioInterfaces + // eQMINASRadioInterfaces mRadioInterface[1]; +}; + +// Structure to describe request TLV 0x01 for NASSetDDTMPreference() +struct sNASSetDDTMPreferenceRequest_DDTM +{ + eQMINASDDTMPreferences mDDTMPreference; + bool mSuppressL2ACK:1; + bool mSuppress1xRegistrations:1; + bool mIgnoreServiceOptionPages:1; + bool mBlockMobileOriginatedSMSAndDBM:1; + + // Padding out 12 bits + UINT8 mReserved1:4; + UINT8 mReserved2; + + eQMINASServiceOptionActions mServiceOptionAction; + UINT8 mNumberOfInstances; + + // This array must be the size specified by mNumberOfInstances + // UINT16 mServiceOption[1]; +}; + +// Structure to describe response TLV 0x01 for NASGetDDTMPreference() +struct sNASGetDDTMPreferenceResponse_DDTM +{ + eQMINASDDTMPreferences mDDTMPreference; + bool mSuppressL2ACK:1; + bool mSuppress1xRegistrations:1; + bool mIgnoreServiceOptionPages:1; + bool mBlockMobileOriginatedSMSAndDBM:1; + + // Padding out 12 bits + UINT8 mReserved1:4; + UINT8 mReserved2; + + eQMINASServiceOptionActions mServiceOptionAction; + UINT8 mNumberOfInstances; + + // This array must be the size specified by mNumberOfInstances + // UINT16 mServiceOption[1]; +}; + +// Structure to describe indication TLV 0x01 for NAS DDTMPreferenceIndication +struct sNASDDTMPreferenceIndication_DDTM +{ + eQMINASDDTMPreferences mDDTMPreference; + bool mSuppressL2ACK:1; + bool mSuppress1xRegistrations:1; + bool mIgnoreServiceOptionPages:1; + bool mBlockMobileOriginatedSMSAndDBM:1; + + // Padding out 12 bits + UINT8 mReserved1:4; + UINT8 mReserved2; + + eQMINASServiceOptionActions mServiceOptionAction; + UINT8 mNumberOfInstances; + + // This array must be the size specified by mNumberOfInstances + // UINT16 mServiceOption[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetOperatorNameData() +struct sNASGetOperatorNameDataResponse_ServiceProviderName +{ + UINT8 mDisplayCondition; + UINT8 mSPNLength; + + // This array must be the size specified by mSPNLength + // UINT8 mSPN[1]; +}; + +// Structure to describe response TLV 0x11 for NASGetOperatorNameData() +struct sNASGetOperatorNameDataResponse_OperatorPLMNList +{ + UINT16 mPLMNListLength; + + struct sPLNM + { + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + UINT16 mLocationAreaCode1; + UINT16 mLocationAreaCode2; + UINT8 mPLMNNameRecordIdentifier; + }; + + // This array must be the size specified by mPLMNListLength + // sPLNM mPLNMs[1]; +}; + +// Structure to describe response TLV 0x12 for NASGetOperatorNameData() +struct sNASGetOperatorNameDataResponse_PLMNName +{ + UINT8 mPLMNCount; + + struct sPLMNName1 + { + eQMINASPLMNNameEncodingSchemes mPLMNShortEncoding; + eQMINASPLMNNameCountryInitials mPLMNShortCountryInitials; + eQMINASPLMNNameSpareBits mPLMNLongBits; + eQMINASPLMNNameSpareBits mPLMNSpareBits; + UINT8 mPLMNLongLength; + + // This array must be the size specified by mPLMNLongLength + // UINT8 mPLMNLong[1]; + }; + + struct sPLMNName2 + { + UINT8 mPLMNShortLength; + + // This array must be the size specified by mPLMNShortLength + // UINT8 mPLMNShort[1]; + }; + + struct sPLMNName + { + sPLMNName1 mPLMNName1; + sPLMNName2 mPLMNName2; + }; + + // This array must be the size specified by mPLMNCount + // sPLMNName mPLMNNames[1]; +}; + +// Structure to describe response TLV 0x13 for NASGetOperatorNameData() +struct sNASGetOperatorNameDataResponse_OperatorStringName +{ + // String is variable length, but must be size of the container + // char mPLMNOperatorName[1]; +}; + +// Structure to describe response TLV 0x14 for NASGetOperatorNameData() +struct sNASGetOperatorNameDataResponse_NITZInformation1 +{ + eQMINASPLMNNameEncodingSchemes mPLMNShortEncoding; + eQMINASPLMNNameCountryInitials mPLMNShortCountryInitials; + eQMINASPLMNNameSpareBits mPLMNLongBits; + eQMINASPLMNNameSpareBits mPLMNSpareBits; + UINT8 mPLMNLongLength; + + // This array must be the size specified by mPLMNLongLength + // UINT8 mPLMNLong[1]; +}; + +struct sNASGetOperatorNameDataResponse_NITZInformation2 +{ + UINT8 mPLMNShortLength; + + // This array must be the size specified by mPLMNShortLength + // UINT8 mPLMNShort[1]; +}; + +struct sNASGetOperatorNameDataResponse_NITZInformation +{ + sNASGetOperatorNameDataResponse_NITZInformation1 mNASGetOperatorNameDataResponse_NITZInformation1; + sNASGetOperatorNameDataResponse_NITZInformation2 mNASGetOperatorNameDataResponse_NITZInformation2; +}; + +// Structure to describe indication TLV 0x10 for NAS OperatorNameDataIndication +struct sNASOperatorNameDataIndication_ServiceProviderName +{ + UINT8 mDisplayCondition; + UINT8 mSPNLength; + + // This array must be the size specified by mSPNLength + // UINT8 mSPN[1]; +}; + +// Structure to describe indication TLV 0x11 for NAS OperatorNameDataIndication +struct sNASOperatorNameDataIndication_OperatorPLMNList +{ + UINT16 mPLMNListLength; + + struct sPLNM + { + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + UINT16 mLocationAreaCode1; + UINT16 mLocationAreaCode2; + UINT8 mPLMNNameRecordIdentifier; + }; + + // This array must be the size specified by mPLMNListLength + // sPLNM mPLNMs[1]; +}; + +// Structure to describe indication TLV 0x12 for NAS OperatorNameDataIndication +struct sNASOperatorNameDataIndication_PLMNName +{ + UINT8 mPLMNCount; + + struct sPLMNName1 + { + eQMINASPLMNNameEncodingSchemes mPLMNShortEncoding; + eQMINASPLMNNameCountryInitials mPLMNShortCountryInitials; + eQMINASPLMNNameSpareBits mPLMNLongBits; + eQMINASPLMNNameSpareBits mPLMNSpareBits; + UINT8 mPLMNLongLength; + + // This array must be the size specified by mPLMNLongLength + // UINT8 mPLMNLong[1]; + }; + + struct sPLMNName2 + { + UINT8 mPLMNShortLength; + + // This array must be the size specified by mPLMNShortLength + // UINT8 mPLMNShort[1]; + }; + + struct sPLMNName + { + sPLMNName1 mPLMNName1; + sPLMNName2 mPLMNName2; + }; + + // This array must be the size specified by mPLMNCount + // sPLMNName mPLMNNames[1]; +}; + +// Structure to describe indication TLV 0x13 for NAS OperatorNameDataIndication +struct sNASOperatorNameDataIndication_OperatorStringName +{ + // String is variable length, but must be size of the container + // char mPLMNOperatorName[1]; +}; + +// Structure to describe indication TLV 0x14 for NAS OperatorNameDataIndication +struct sNASOperatorNameDataIndication_NITZInformation1 +{ + eQMINASPLMNNameEncodingSchemes mPLMNShortEncoding; + eQMINASPLMNNameCountryInitials mPLMNShortCountryInitials; + eQMINASPLMNNameSpareBits mPLMNLongBits; + eQMINASPLMNNameSpareBits mPLMNSpareBits; + UINT8 mPLMNLongLength; + + // This array must be the size specified by mPLMNLongLength + // UINT8 mPLMNLong[1]; +}; + +struct sNASOperatorNameDataIndication_NITZInformation2 +{ + UINT8 mPLMNShortLength; + + // This array must be the size specified by mPLMNShortLength + // UINT8 mPLMNShort[1]; +}; + +struct sNASOperatorNameDataIndication_NITZInformation +{ + sNASOperatorNameDataIndication_NITZInformation1 mNASOperatorNameDataIndication_NITZInformation1; + sNASOperatorNameDataIndication_NITZInformation2 mNASOperatorNameDataIndication_NITZInformation2; +}; + +// Structure to describe response TLV 0x10 for NASGetCSPPLMNMode() +struct sNASGetCSPPLMNModeResponse_Mode +{ + INT8 mRestrictManualPLMNSelection; +}; + +// Structure to describe indication TLV 0x10 for NAS CSPPLMNModeIndication +struct sNASCSPPLMNModeIndication_Mode +{ + INT8 mRestrictManualPLMNSelection; +}; + +// Structure to describe request TLV 0x01 for NASUpdateAKEY() +struct sNASUpdateAKEYRequest_AKEY +{ + char mAKEY[26]; +}; + +// Structure to describe request TLV 0x01 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoRequest_NAMID +{ + UINT8 mNAMID; +}; + +// Structure to describe request TLV 0x10 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoRequest_InfoMask +{ + bool mNAMName:1; + bool mDirectoryNumber:1; + bool mHomeID:1; + bool mMINBasedIMSI:1; + bool mTrueIMSI:1; + bool mCDMAChannel:1; + bool mMobileDirectoryNumber:1; + + // Padding out 25 bits + UINT8 mReserved1:1; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x10 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_NAMName +{ + UINT8 mNAMNameLength; + + // This array must be the size specified by mNAMNameLength + // char mNAMName[1]; +}; + +// Structure to describe response TLV 0x11 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_DirectoryNumber +{ + UINT8 mDirectoryNumberLength; + + // This array must be the size specified by mDirectoryNumberLength + // char mDirectoryNumber[1]; +}; + +// Structure to describe response TLV 0x12 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_HomeID +{ + UINT8 mHomeIDCount; + + struct sHomeID + { + UINT16 mSystemID; + UINT16 mNetworkID; + }; + + // This array must be the size specified by mHomeIDCount + // sHomeID mHomeIDs[1]; +}; + +// Structure to describe response TLV 0x13 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_MINBasedIMSI +{ + char mMobileCountryCode[3]; + char mIMSI11_12[2]; + char mIMSIS1[7]; + char mIMSIS2[3]; + UINT8 mIMSIAddressNumber; +}; + +// Structure to describe response TLV 0x14 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_TrueIMSI +{ + char mMobileCountryCode[3]; + char mIMSI11_12[2]; + char mIMSIS1[7]; + char mIMSIS2[3]; + UINT8 mIMSIAddressNumber; +}; + +// Structure to describe response TLV 0x15 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_CDMAChannel +{ + UINT16 mAChannelForPrimaryCarrier; + UINT16 mBChannelForPrimaryCarrier; + UINT16 mAChannelForSecondaryCarrier; + UINT16 mBChannelForSecondaryCarrier; +}; + +// Structure to describe response TLV 0x16 for NASGet3GPP2SubscriptionInfo() +struct sNASGet3GPP2SubscriptionInfoResponse_MDN +{ + UINT8 mMobileDirectoryNumberLength; + + // This array must be the size specified by mMobileDirectoryNumberLength + // char mMobileDirectoryNumber[1]; +}; + +// Structure to describe request TLV 0x01 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_NAMID +{ + UINT8 mNAMID; +}; + +// Structure to describe request TLV 0x10 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_DirectoryNumber +{ + UINT8 mDirectoryNumberLength; + + // This array must be the size specified by mDirectoryNumberLength + // char mDirectoryNumber[1]; +}; + +// Structure to describe request TLV 0x11 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_HomeID +{ + UINT8 mHomeIDCount; + + struct sHomeID + { + UINT16 mSystemID; + UINT16 mNetworkID; + }; + + // This array must be the size specified by mHomeIDCount + // sHomeID mHomeIDs[1]; +}; + +// Structure to describe request TLV 0x12 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_MINBasedIMSI +{ + char mMobileCountryCode[3]; + char mIMSI11_12[2]; + char mIMSIS1[7]; + char mIMSIS2[3]; + UINT8 mIMSIAddressNumber; +}; + +// Structure to describe request TLV 0x13 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_TrueIMSI +{ + char mMobileCountryCode[3]; + char mIMSI11_12[2]; + char mIMSIS1[7]; + char mIMSIS2[3]; + UINT8 mIMSIAddressNumber; +}; + +// Structure to describe request TLV 0x14 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_CDMAChannel +{ + UINT16 mAChannelForPrimaryCarrier; + UINT16 mBChannelForPrimaryCarrier; + UINT16 mAChannelForSecondaryCarrier; + UINT16 mBChannelForSecondaryCarrier; +}; + +// Structure to describe request TLV 0x15 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_NAMName +{ + UINT8 mNAMNameLength; + + // This array must be the size specified by mNAMNameLength + // char mNAMName[1]; +}; + +// Structure to describe request TLV 0x16 for NASSet3GPP2SubscriptionInfo() +struct sNASSet3GPP2SubscriptionInfoRequest_MDN +{ + UINT8 mMobileDirectoryNumberLength; + + // This array must be the size specified by mMobileDirectoryNumberLength + // char mMobileDirectoryNumber[1]; +}; + +// Structure to describe response TLV 0x10 for NASGetMobileCAIRevision() +struct sNASGetMobileCAIRevisionResponse_CAIRevision +{ + eQMINASRevision mCAIRevision; +}; + +// Structure to describe response TLV 0x10 for NASGetRTREConfig() +struct sNASGetRTREConfigResponse_CurrentRTREConfig +{ + eQMINASRTREConfiguration mRTREConfiguration; +}; + +// Structure to describe response TLV 0x11 for NASGetRTREConfig() +struct sNASGetRTREConfigResponse_RTREConfigPreference +{ + eQMINASRTREConfiguration mRTREConfiguration; +}; + +// Structure to describe request TLV 0x01 for NASSetRTREConfig() +struct sNASSetRTREConfigRequest_RTREConfig +{ + eQMINASRTREConfiguration mRTREConfiguration; +}; + +// Structure to describe response TLV 0x10 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_GERANInfo +{ + UINT32 mCellID; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileCountryCode0:4; + UINT8 mMobileCountryCode1:4; + UINT8 mMobileCountryCode2:4; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileNetworkCode0:4; + UINT8 mMobileNetworkCode1:4; + UINT8 mMobileNetworkCode2:4; + + UINT16 mLocationAreaCode; + UINT16 mUTRAAbsoluteRFChannelNumber; + UINT8 mBCC:3; + UINT8 mNCC:3; + + // Padding out 2 bits + UINT8 mReserved1:2; + + UINT32 mTimingAdvance; + eQMINASRXLevel mRXLevel; + UINT8 mNMRCellCount; + + struct sNMRCell + { + UINT32 mCellID; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mPLMNMobileCountryCode0:4; + UINT8 mPLMNMobileCountryCode1:4; + UINT8 mPLMNMobileCountryCode2:4; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mPLMNMobileNetworkCode0:4; + UINT8 mPLMNMobileNetworkCode1:4; + UINT8 mPLMNMobileNetworkCode2:4; + + UINT16 mLocationAreaCode; + UINT16 mUTRAAbsoluteRFChannelNumber; + UINT8 mBaseStationIdentityCodeBCC:3; + UINT8 mBaseStationIdentityCodeNCC:3; + + // Padding out 2 bits + UINT8 mReserved2:2; + + eQMINASRXLevel mRXLevel; + }; + + // This array must be the size specified by mNMRCellCount + // sNMRCell mNMRCells[1]; +}; + +// Structure to describe response TLV 0x11 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_UMTSInfo1 +{ + UINT32 mCellID; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileCountryCode0:4; + UINT8 mMobileCountryCode1:4; + UINT8 mMobileCountryCode2:4; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileNetworkCode0:4; + UINT8 mMobileNetworkCode1:4; + UINT8 mMobileNetworkCode2:4; + + UINT16 mLocationAreaCode; + UINT16 mUTRAAbsoluteRFChannelNumber; + UINT16 mPrimaryScramblingCode; + INT16 mReceivedSignalCodePower; + UINT16 mECIO; + UINT8 mUTRAUMTSMonitoredCellCount; + + struct sUMTSMonitoredCell + { + UINT16 mUTRAAbsoluteRFChannelNumber; + UINT16 mPrimaryScramblingCode; + INT16 mReceivedSignalCodePower; + UINT16 mECIO; + }; + + // This array must be the size specified by mUTRAUMTSMonitoredCellCount + // sUMTSMonitoredCell mUMTSMonitoredCells[1]; +}; + +struct sNASGetCellLocationInfoResponse_UMTSInfo2 +{ + UINT8 mGERANNBRCellCount; + + struct sGERANNBRCell + { + UINT16 mAbsoluteRFChannelNumber; + UINT8 mNetworkColorCode; + UINT8 mBaseStationColorCode; + INT16 mRSSI; + }; + + // This array must be the size specified by mGERANNBRCellCount + // sGERANNBRCell mGERANNBRCells[1]; +}; + +struct sNASGetCellLocationInfoResponse_UMTSInfo +{ + sNASGetCellLocationInfoResponse_UMTSInfo1 mNASGetCellLocationInfoResponse_UMTSInfo1; + sNASGetCellLocationInfoResponse_UMTSInfo2 mNASGetCellLocationInfoResponse_UMTSInfo2; +}; + +// Structure to describe response TLV 0x12 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_CDMAInfo +{ + UINT16 mSystemID; + UINT16 mNetworkID; + UINT16 mBaseStationID; + UINT16 mReferencePN; + INT32 mLatitude; + INT32 mLongitude; +}; + +// Structure to describe response TLV 0x13 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_IntrafrequencyLTEInfo +{ + INT8 mUEInIdleMode; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileCountryCode0:4; + UINT8 mMobileCountryCode1:4; + UINT8 mMobileCountryCode2:4; + + // Bitfield arrays are not possible in c, unrolling the array + UINT8 mMobileNetworkCode0:4; + UINT8 mMobileNetworkCode1:4; + UINT8 mMobileNetworkCode2:4; + + UINT16 mTrackingAreaCode; + UINT32 mGlobalCellID; + UINT16 mEUTRAAbsoluteRFChannelNumber; + UINT16 mServingCellID; + UINT8 mCellReselectionPriority; + UINT8 mSNonIntraSearchThreshold; + UINT8 mServingCellLowThreshold; + UINT8 mSIntraSearchThreshold; + UINT8 mCellCount; + + struct sCell + { + UINT16 mPhysicalCellID; + INT16 mRSRQ; + INT16 mRSRP; + INT16 mRSSI; + INT16 mCellSelectionRXLevel; + }; + + // This array must be the size specified by mCellCount + // sCell mCells[1]; +}; + +// Structure to describe response TLV 0x14 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_InterfrequencyLTEInfo +{ + INT8 mUEInIdleMode; + UINT8 mFrequencyCount; + + struct sFrequency + { + UINT16 mEUTRAAbsoluteRFChannelNumber; + UINT8 mCellSelectionRXLevelLowThreshold; + UINT8 mCellSelectionRXLevelHighThreshold; + UINT8 mCellReselectionPriority; + UINT8 mCellCount; + + struct sCell + { + UINT16 mPhysicalCellID; + INT16 mRSRQ; + INT16 mRSRP; + INT16 mRSSI; + INT16 mCellSelectionRXLevel; + }; + + // This array must be the size specified by mCellCount + // sCell mCells[1]; + }; + + // This array must be the size specified by mFrequencyCount + // sFrequency mFrequencys[1]; +}; + +// Structure to describe response TLV 0x15 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_LTEInfoNeighboringGSM +{ + INT8 mUEInIdleMode; + UINT8 mFrequencyCount; + + struct sFrequency + { + UINT8 mCellReselectionPriority; + UINT8 mCellReselectionHighThreshold; + UINT8 mCellReselectionLowThreshold; + + // Bitfield arrays are not possible in c, unrolling the array + bool mNCCPermitted0:1; + bool mNCCPermitted1:1; + bool mNCCPermitted2:1; + bool mNCCPermitted3:1; + bool mNCCPermitted4:1; + bool mNCCPermitted5:1; + bool mNCCPermitted6:1; + bool mNCCPermitted7:1; + + UINT8 mCellCount; + + struct sCell + { + UINT16 mAbsoluteRFChannelNumber; + INT8 mBandIs1900; + INT8 mCellIDValid; + UINT8 mBCC:3; + UINT8 mNCC:3; + + // Padding out 2 bits + UINT8 mReserved1:2; + + INT16 mRSSI; + INT16 mCellSelectionRXLevel; + }; + + // This array must be the size specified by mCellCount + // sCell mCells[1]; + }; + + // This array must be the size specified by mFrequencyCount + // sFrequency mFrequencys[1]; +}; + +// Structure to describe response TLV 0x16 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_LTEInfoNeighboringWCDMA +{ + INT8 mUEInIdleMode; + UINT8 mFrequencyCount; + + struct sFrequency + { + UINT16 mUTRAAbsoluteRFChannelNumber; + UINT8 mCellReselectionPriority; + UINT8 mCellReselectionHighThreshold; + UINT8 mCellReselectionLowThreshold; + UINT8 mCellCount; + + struct sCell + { + UINT16 mPrimaryScramblingCode; + INT16 mCPICHRSCP; + INT16 mCPICHEcNo; + INT16 mCellSelectionRXLevel; + }; + + // This array must be the size specified by mCellCount + // sCell mCells[1]; + }; + + // This array must be the size specified by mFrequencyCount + // sFrequency mFrequencys[1]; +}; + +// Structure to describe response TLV 0x17 for NASGetCellLocationInfo() +struct sNASGetCellLocationInfoResponse_UMTSCellID +{ + UINT32 mCellID; +}; + +// Structure to describe request TLV 0x01 for NASGetPLMNName() +struct sNASGetPLMNNameRequest_PLMN +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; +}; + +// Structure to describe request TLV 0x10 for NASGetPLMNName() +struct sNASGetPLMNNameRequest_SupressSIMError +{ + INT8 mSIMInitNotChecked; +}; + +// Structure to describe response TLV 0x10 for NASGetPLMNName() +struct sNASGetPLMNNameResponse_Name1 +{ + eQMINASPLMNNameEncodingSchemes mSPNEncoding; + UINT8 mSPNLength; + + // This array must be the size specified by mSPNLength + // UINT8 mSPN[1]; +}; + +struct sNASGetPLMNNameResponse_Name2 +{ + eQMINASPLMNNameEncodingSchemes mPLMNShortEncoding; + eQMINASPLMNNameCountryInitials mPLMNShortCountryInitials; + eQMINASPLMNNameSpareBits mPLMNSpareBits; + UINT8 mPLMNShortLength; + + // This array must be the size specified by mPLMNShortLength + // UINT8 mPLMNShort[1]; +}; + +struct sNASGetPLMNNameResponse_Name3 +{ + eQMINASPLMNNameEncodingSchemes mPLMNLongEncoding; + eQMINASPLMNNameCountryInitials mPLMNLongCountryInitials; + eQMINASPLMNNameSpareBits mPLMNLongBits; + UINT8 mPLMNLongLength; + + // This array must be the size specified by mPLMNLongLength + // UINT8 mPLMNLong[1]; +}; + +struct sNASGetPLMNNameResponse_Name +{ + sNASGetPLMNNameResponse_Name1 mNASGetPLMNNameResponse_Name1; + sNASGetPLMNNameResponse_Name2 mNASGetPLMNNameResponse_Name2; + sNASGetPLMNNameResponse_Name3 mNASGetPLMNNameResponse_Name3; +}; + +// Structure to describe request TLV 0x01 for NASBindSubscription() +struct sNASBindSubscriptionRequest_SubscriptionType +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe indication TLV 0x10 for NAS ManagedRoamingIndication +struct sNASManagedRoamingIndication_RadioInterface +{ + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe indication TLV 0x10 for NAS DualStandbyPrefIndication +struct sNASDualStandbyPrefIndication_StandbyPreference +{ + eQMINASStandbyPreference mStandbyPreference; + eQMINASSubscriptionType mPrioritySubscription; + eQMINASSubscriptionType mActiveSubscription; + eQMINASSubscriptionType mDefaultDataSubscription; +}; + +// Structure to describe indication TLV 0x10 for NAS SubscriptionInfoIndication +struct sNASSubscriptionInfoIndication_PrioritySubscriptionInfo +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe indication TLV 0x11 for NAS SubscriptionInfoIndication +struct sNASSubscriptionInfoIndication_ActiveSubscriptionInfo +{ + eQMINASActiveSubscription mActiveSubscription; +}; + +// Structure to describe indication TLV 0x12 for NAS SubscriptionInfoIndication +struct sNASSubscriptionInfoIndication_DefaultDataSubscriptionInfo +{ + INT8 mDefaultDataSubscription; +}; + +// Structure to describe response TLV 0x10 for NASGetModePref() +struct sNASGetModePrefResponse_ModePreferenceForIDX0 +{ + bool mCDMA1x:1; + bool mCDMA1xEVDO:1; + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + bool mTDSCDMA:1; + + // Padding out 10 bits + UINT8 mReserved1:2; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x11 for NASGetModePref() +struct sNASGetModePrefResponse_ModePreferenceForIDX1 +{ + bool mCDMA1x:1; + bool mCDMA1xEVDO:1; + bool mGSM:1; + bool mUMTS:1; + bool mLTE:1; + bool mTDSCDMA:1; + + // Padding out 10 bits + UINT8 mReserved1:2; + UINT8 mReserved2; +}; + +// Structure to describe request TLV 0x10 for NASSetDualStandbyPreference() +struct sNASSetDualStandbyPreferenceRequest_StandbyPreference +{ + eQMINASStandbyPreference mStandbyPreference; +}; + +// Structure to describe request TLV 0x11 for NASSetDualStandbyPreference() +struct sNASSetDualStandbyPreferenceRequest_PrioritySubs +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe request TLV 0x12 for NASSetDualStandbyPreference() +struct sNASSetDualStandbyPreferenceRequest_DefaultDataSubs +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe indication TLV 0x01 for NAS NetworkTimeIndication +struct sNASNetworkTimeIndication_UniversalTime +{ + UINT16 mYear; + UINT8 mMonth; + UINT8 mDay; + UINT8 mHour; + UINT8 mMinute; + UINT8 mSecond; + eQMINASDayOfWeek mDayOfWeek; +}; + +// Structure to describe indication TLV 0x10 for NAS NetworkTimeIndication +struct sNASNetworkTimeIndication_TimeZone +{ + INT8 mTimeZoneOffset; +}; + +// Structure to describe indication TLV 0x11 for NAS NetworkTimeIndication +struct sNASNetworkTimeIndication_DaylightSavingAdjustment +{ + eQMINASDaylightSavingsAdjustment mDaylightSavingsAdjustment; +}; + +// Structure to describe indication TLV 0x12 for NAS NetworkTimeIndication +struct sNASNetworkTimeIndication_RadioInterface +{ + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe response TLV 0x10 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_CDMAServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe response TLV 0x11 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_CDMA1xEVDOServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe response TLV 0x12 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_GSMServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe response TLV 0x13 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_WCDMAServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe response TLV 0x14 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_LTEServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe response TLV 0x15 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_CDMASystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mSystemPRLMatchValid; + eQMINASPRLIndicator mSystemPRLMatch; + INT8 mPRevInUseValid; + eQMINASRevision mProtocolRevisionInUse; + INT8 mBaseStationPRevValid; + eQMINASRevision mBaseStationProtocolRevision; + INT8 mConcurrentServiceSupportedValid; + eQMINASConcurrentServiceSupported mConcurrentServiceSupported; + INT8 mCDMASystemIDValid; + UINT16 mSystemID; + UINT16 mNetworkID; + INT8 mBaseStationInfoValid; + UINT16 mBaseStationID; + INT32 mLatitude; + INT32 mLongitude; + INT8 mPacketZoneValid; + UINT16 mPacketZone; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; +}; + +// Structure to describe response TLV 0x16 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_CDMA1xEVDOSystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mSystemPRLMatchValid; + eQMINASPRLIndicator mSystemPRLMatch; + INT8 mCDMA1xEVDOPersonalityValid; + eQMINASCDMA1xEVDOPersonality mCDMA1xEVDOPersonality; + INT8 mCDMA1xEVDOActiveProtocolValid; + eQMINASCDMA1xEVDOActiveProtocol mCDMA1xEVDOActiveProtocol; + INT8 mSectorIDValid; + UINT8 mSectorID[16]; +}; + +// Structure to describe response TLV 0x17 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_GSMSystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mEGPRSSupportValid; + eQMINASEGPRSSupport mEGPRSSupport; + INT8 mDTMSupportValid; + eQMINASDTMSupport mDTMSupport; +}; + +// Structure to describe response TLV 0x18 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_WCDMASystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mHighSpeedCallStatusValid; + eQMINASHighSpeedCallStatus mHighSpeedCallStatus; + INT8 mHighSpeedServiceIndicationValid; + eQMINASHighSpeedCallStatus mHighSpeedServiceIndication; + INT8 mPrimaryScramblingCodeValue; + UINT16 mPrimaryScramblingCode; +}; + +// Structure to describe response TLV 0x19 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_LTESystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mTrackingAreaCodeValid; + UINT16 mTrackingAreaCode; +}; + +// Structure to describe response TLV 0x1A for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_MoreCDMASystemInfo +{ + UINT16 mGeoSystemIndex; + UINT16 mRegistrationPeriod; +}; + +// Structure to describe response TLV 0x1B for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_MoreCDMA1xEVDOSystemInfo +{ + UINT16 mGeoSystemIndex; +}; + +// Structure to describe response TLV 0x1C for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_MoreGSMSystemInfo +{ + UINT16 mGeoSystemIndex; + eQMINASCellBroadcastCaps mCellBroadcastCapability; +}; + +// Structure to describe response TLV 0x1D for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_MoreWCDMASystemInfo +{ + UINT16 mGeoSystemIndex; + eQMINASCellBroadcastCaps mCellBroadcastCapability; +}; + +// Structure to describe response TLV 0x1E for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_MoreLTESystemInfo +{ + UINT16 mGeoSystemIndex; +}; + +// Structure to describe response TLV 0x1F for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_GSMCallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe response TLV 0x20 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_WCDMACallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe response TLV 0x21 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_LTEVoice +{ + INT8 mLTEVoiceSupported; +}; + +// Structure to describe response TLV 0x22 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_GSMCipher +{ + eQMINASServiceDomains mCipheringOnServiceDomain; +}; + +// Structure to describe response TLV 0x23 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_WCDMACipher +{ + eQMINASServiceDomains mCipheringOnServiceDomain; +}; + +// Structure to describe response TLV 0x24 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_TDSCDMAServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe response TLV 0x25 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_TDSCDMASystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mHighSpeedCallStatusValid; + eQMINASHighSpeedCallStatus mHighSpeedCallStatus; + INT8 mHighSpeedServiceIndicationValid; + eQMINASHighSpeedCallStatus mHighSpeedServiceIndication; + INT8 mCellParameterIDValid; + UINT16 mCellParameterID; + INT8 mCellBroadcastCapabilityValid; + eQMINASCellBroadcastCaps2 mCellBroadcastCapability; + INT8 mCSBarringStatusValid; + eQMINASCallBarringStatus mCSCallBarringStatus; + INT8 mPSBarringStatusValid; + eQMINASCallBarringStatus mPSCallBarringStatus; + INT8 mCipheringValid; + eQMINASServiceDomains mCipheringOnServiceDomain; +}; + +// Structure to describe response TLV 0x26 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_EMBMSCoverage +{ + INT8 mEMBMSSupported; +}; + +// Structure to describe response TLV 0x27 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_SIMRejectInfo +{ + eQMINASSIMRejectStates mSIMRejectInfo; +}; + +// Structure to describe response TLV 0x28 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_WCDMAEUTRADetection +{ + eQMINASEUTRAStatus mEUTRADetectionStatus; +}; + +// Structure to describe response TLV 0x29 for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_LTEIMSVoice +{ + INT8 mIMSVoiceSupportAvailable; +}; + +// Structure to describe response TLV 0x2A for NASGetSystemInfo() +struct sNASGetSystemInfoResponse_LTEVoiceDomain +{ + eQMINASLTEVoiceDomains mLTEVoiceDomain; +}; + +// Structure to describe indication TLV 0x10 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_CDMAServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe indication TLV 0x11 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_CDMA1xEVDOServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe indication TLV 0x12 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_GSMServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe indication TLV 0x13 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_WCDMAServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe indication TLV 0x14 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_LTEServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe indication TLV 0x15 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_CDMASystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mSystemPRLMatchValid; + eQMINASPRLIndicator mSystemPRLMatch; + INT8 mPRevInUseValid; + eQMINASRevision mProtocolRevisionInUse; + INT8 mBaseStationPRevValid; + eQMINASRevision mBaseStationProtocolRevision; + INT8 mConcurrentServiceSupportedValid; + eQMINASConcurrentServiceSupported mConcurrentServiceSupported; + INT8 mCDMASystemIDValid; + UINT16 mSystemID; + UINT16 mNetworkID; + INT8 mBaseStationInfoValid; + UINT16 mBaseStationID; + INT32 mLatitude; + INT32 mLongitude; + INT8 mPacketZoneValid; + UINT16 mPacketZone; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; +}; + +// Structure to describe indication TLV 0x16 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_CDMA1xEVDOSystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mSystemPRLMatchValid; + eQMINASPRLIndicator mSystemPRLMatch; + INT8 mCDMA1xEVDOPersonalityValid; + eQMINASCDMA1xEVDOPersonality mCDMA1xEVDOPersonality; + INT8 mCDMA1xEVDOActiveProtocolValid; + eQMINASCDMA1xEVDOActiveProtocol mCDMA1xEVDOActiveProtocol; + INT8 mSectorIDValid; + UINT8 mSectorID[16]; +}; + +// Structure to describe indication TLV 0x17 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_GSMSystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mEGPRSSupportValid; + eQMINASEGPRSSupport mEGPRSSupport; + INT8 mDTMSupportValid; + eQMINASDTMSupport mDTMSupport; +}; + +// Structure to describe indication TLV 0x18 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_WCDMASystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mHighSpeedCallStatusValid; + eQMINASHighSpeedCallStatus mHighSpeedCallStatus; + INT8 mHighSpeedServiceIndicationValid; + eQMINASHighSpeedCallStatus mHighSpeedServiceIndication; + INT8 mPrimaryScramblingCodeValue; + UINT16 mPrimaryScramblingCode; +}; + +// Structure to describe indication TLV 0x19 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_LTESystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mTrackingAreaCodeValid; + UINT16 mTrackingAreaCode; +}; + +// Structure to describe indication TLV 0x1A for NAS SystemInfoIndication +struct sNASSystemInfoIndication_MoreCDMASystemInfo +{ + UINT16 mGeoSystemIndex; + UINT16 mRegistrationPeriod; +}; + +// Structure to describe indication TLV 0x1B for NAS SystemInfoIndication +struct sNASSystemInfoIndication_MoreCDMA1xEVDOSystemInfo +{ + UINT16 mGeoSystemIndex; +}; + +// Structure to describe indication TLV 0x1C for NAS SystemInfoIndication +struct sNASSystemInfoIndication_MoreGSMSystemInfo +{ + UINT16 mGeoSystemIndex; + eQMINASCellBroadcastCaps mCellBroadcastCapability; +}; + +// Structure to describe indication TLV 0x1D for NAS SystemInfoIndication +struct sNASSystemInfoIndication_MoreWCDMASystemInfo +{ + UINT16 mGeoSystemIndex; + eQMINASCellBroadcastCaps mCellBroadcastCapability; +}; + +// Structure to describe indication TLV 0x1E for NAS SystemInfoIndication +struct sNASSystemInfoIndication_MoreLTESystemInfo +{ + UINT16 mGeoSystemIndex; +}; + +// Structure to describe indication TLV 0x1F for NAS SystemInfoIndication +struct sNASSystemInfoIndication_GSMCallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe indication TLV 0x20 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_WCDMACallBarring +{ + eQMINASCallBarringStatus mCSCallBarringStatus; + eQMINASCallBarringStatus mPSCallBarringStatus; +}; + +// Structure to describe indication TLV 0x21 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_LTEVoice +{ + INT8 mLTEVoiceSupported; +}; + +// Structure to describe indication TLV 0x22 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_GSMCipher +{ + eQMINASServiceDomains mCipheringOnServiceDomain; +}; + +// Structure to describe indication TLV 0x23 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_WCDMACipher +{ + eQMINASServiceDomains mCipheringOnServiceDomain; +}; + +// Structure to describe indication TLV 0x24 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_NoPLMNChange +{ + INT8 mNoPLMNChange; +}; + +// Structure to describe indication TLV 0x25 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_TDSCDMAServiceStatusInfo +{ + eQMINASServiceStatus mServiceStatus; + eQMINASServiceStatus mTrueServiceStatus; + eQMINASPreferredDataBath mPreferredDataPath; +}; + +// Structure to describe indication TLV 0x26 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_TDSCDMASystemInfo +{ + INT8 mServiceDomainValid; + eQMINASSystemServiceCapabilities mServiceDomain; + INT8 mServiceCapabilityValid; + eQMINASSystemServiceCapabilities mSystemServiceCapabilities; + INT8 mRoamStatusValid; + eQMINASRoamStatus mRoamStatus; + INT8 mSystemForbiddenValid; + eQMINASSystemForbidden mSystemForbidden; + INT8 mLocationAreaCodeValid; + UINT16 mLocationAreaCode; + INT8 mCellIDValid; + UINT32 mCellID; + INT8 mRegistrationRejectInformationValid; + eQMINASSystemServiceCapabilities mRegistrationRejectServiceDomain; + UINT8 mRejectCause; + INT8 mNetworkIDValid; + char mMobileCountryCode[3]; + char mMobileNetworkCode[3]; + INT8 mHighSpeedCallStatusValid; + eQMINASHighSpeedCallStatus mHighSpeedCallStatus; + INT8 mHighSpeedServiceIndicationValid; + eQMINASHighSpeedCallStatus mHighSpeedServiceIndication; + INT8 mCellParameterIDValid; + UINT16 mCellParameterID; + INT8 mCellBroadcastCapabilityValid; + eQMINASCellBroadcastCaps2 mCellBroadcastCapability; + INT8 mCSBarringStatusValid; + eQMINASCallBarringStatus mCSCallBarringStatus; + INT8 mPSBarringStatusValid; + eQMINASCallBarringStatus mPSCallBarringStatus; + INT8 mCipheringValid; + eQMINASServiceDomains mCipheringOnServiceDomain; +}; + +// Structure to describe indication TLV 0x27 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_EMBMSCoverage +{ + INT8 mEMBMSSupported; +}; + +// Structure to describe indication TLV 0x28 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_SIMRejectInfo +{ + eQMINASSIMRejectStates mSIMRejectInfo; +}; + +// Structure to describe indication TLV 0x29 for NAS SystemInfoIndication +struct sNASSystemInfoIndication_WCDMAEUTRADetection +{ + eQMINASEUTRAStatus mEUTRADetectionStatus; +}; + +// Structure to describe indication TLV 0x2A for NAS SystemInfoIndication +struct sNASSystemInfoIndication_LTEIMSVoice +{ + INT8 mIMSVoiceSupportAvailable; +}; + +// Structure to describe indication TLV 0x2B for NAS SystemInfoIndication +struct sNASSystemInfoIndication_LTEVoiceDomain +{ + eQMINASLTEVoiceDomains mLTEVoiceDomain; +}; + +// Structure to describe response TLV 0x10 for NASGetSignalInfo() +struct sNASGetSignalInfoResponse_CDMASignalInfo +{ + INT8 mRSSI; + UINT16 mECIO; +}; + +// Structure to describe response TLV 0x11 for NASGetSignalInfo() +struct sNASGetSignalInfoResponse_CDMA1xEVDOSignalInfo +{ + INT8 mRSSI; + UINT16 mECIO; + eQMINASSINRLevels mSINR; + UINT32 mIO; +}; + +// Structure to describe response TLV 0x12 for NASGetSignalInfo() +struct sNASGetSignalInfoResponse_GSMSignalInfo +{ + INT8 mRSSI; +}; + +// Structure to describe response TLV 0x13 for NASGetSignalInfo() +struct sNASGetSignalInfoResponse_WCDMASignalInfo +{ + INT8 mRSSI; + UINT16 mECIO; +}; + +// Structure to describe response TLV 0x14 for NASGetSignalInfo() +struct sNASGetSignalInfoResponse_LTESignalInfo +{ + INT8 mRSSI; + INT8 mRSRQ; + INT16 mRSRP; + INT16 mSNR; +}; + +// Structure to describe response TLV 0x15 for NASGetSignalInfo() +struct sNASGetSignalInfoResponse_TDSCDMASignalInfo +{ + INT8 mPCCPCHRSCP; +}; + +// Structure to describe request TLV 0x10 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_RSSIThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT8 mThreshold[1]; +}; + +// Structure to describe request TLV 0x11 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_ECIOThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT16 mThreshold[1]; +}; + +// Structure to describe request TLV 0x12 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_CDMA1xEVDOSINRThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // UINT8 mThreshold[1]; +}; + +// Structure to describe request TLV 0x13 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_LTESINRThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT8 mThreshold[1]; +}; + +// Structure to describe request TLV 0x14 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_IOThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT32 mThreshold[1]; +}; + +// Structure to describe request TLV 0x15 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_RSRQThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT8 mThreshold[1]; +}; + +// Structure to describe request TLV 0x16 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_RSRPThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT16 mThreshold[1]; +}; + +// Structure to describe request TLV 0x17 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_LTEConfig +{ + eQMINASLTESignalRates mLTESignalCheckRate; + eQMINASLTESignalRates mLTESignalAveragingRate; +}; + +// Structure to describe request TLV 0x18 for NASConfigureSignalInfo() +struct sNASConfigureSignalInfoRequest_RSCPThresholdList +{ + UINT8 mThresholdCount; + + // This array must be the size specified by mThresholdCount + // INT8 mRSCPThreshold[1]; +}; + +// Structure to describe indication TLV 0x10 for NAS SignalInfoIndication +struct sNASSignalInfoIndication_CDMASignalInfo +{ + INT8 mRSSI; + UINT16 mECIO; +}; + +// Structure to describe indication TLV 0x11 for NAS SignalInfoIndication +struct sNASSignalInfoIndication_CDMA1xEVDOSignalInfo +{ + INT8 mRSSI; + UINT16 mECIO; + eQMINASSINRLevels mSINR; + UINT32 mIO; +}; + +// Structure to describe indication TLV 0x12 for NAS SignalInfoIndication +struct sNASSignalInfoIndication_GSMSignalInfo +{ + INT8 mRSSI; +}; + +// Structure to describe indication TLV 0x13 for NAS SignalInfoIndication +struct sNASSignalInfoIndication_WCDMASignalInfo +{ + INT8 mRSSI; + UINT16 mECIO; +}; + +// Structure to describe indication TLV 0x14 for NAS SignalInfoIndication +struct sNASSignalInfoIndication_LTESignalInfo +{ + INT8 mRSSI; + INT8 mRSRQ; + INT16 mRSRP; + INT16 mSNR; +}; + +// Structure to describe indication TLV 0x15 for NAS SignalInfoIndication +struct sNASSignalInfoIndication_TDSCDMASignalInfo +{ + INT8 mPCCPCHRSCP; +}; + +// Structure to describe response TLV 0x10 for NASGetErrorRate() +struct sNASGetErrorRateResponse_CDMAFrameErrorRate +{ + UINT16 mErrorRate; +}; + +// Structure to describe response TLV 0x11 for NASGetErrorRate() +struct sNASGetErrorRateResponse_CDMA1xEVDOPacketErrorRate +{ + UINT16 mErrorRate; +}; + +// Structure to describe response TLV 0x12 for NASGetErrorRate() +struct sNASGetErrorRateResponse_GSMBitErrorRate +{ + UINT8 mErrorRate; +}; + +// Structure to describe response TLV 0x13 for NASGetErrorRate() +struct sNASGetErrorRateResponse_WCDMABlockErrorRate +{ + UINT8 mErrorRate; +}; + +// Structure to describe response TLV 0x14 for NASGetErrorRate() +struct sNASGetErrorRateResponse_TDSCDMABlockErrorRate +{ + UINT8 mErrorRate; +}; + +// Structure to describe indication TLV 0x10 for NAS ErrorRateIndication +struct sNASErrorRateIndication_CDMAFrameErrorRate +{ + UINT16 mErrorRate; +}; + +// Structure to describe indication TLV 0x11 for NAS ErrorRateIndication +struct sNASErrorRateIndication_CDMA1xEVDOPacketErrorRate +{ + UINT16 mErrorRate; +}; + +// Structure to describe indication TLV 0x12 for NAS ErrorRateIndication +struct sNASErrorRateIndication_GSMBitErrorRate +{ + UINT8 mErrorRate; +}; + +// Structure to describe indication TLV 0x13 for NAS ErrorRateIndication +struct sNASErrorRateIndication_WCDMAFrameErrorRate +{ + UINT8 mErrorRate; +}; + +// Structure to describe indication TLV 0x14 for NAS ErrorRateIndication +struct sNASErrorRateIndication_TDSCDMABlockErrorRate +{ + UINT8 mErrorRate; +}; + +// Structure to describe indication TLV 0x01 for NAS EVDOSessionCloseIndication +struct sNASEVDOSessionCloseIndication_Reason +{ + eQMINASEVDOSessionCloseReasons mSessionCloseReason; +}; + +// Structure to describe indication TLV 0x01 for NAS EVDOUATIUpdateIndication +struct sNASEVDOUATIUpdateIndication_UATI +{ + UINT8 mUATI[16]; +}; + +// Structure to describe request TLV 0x01 for NASGetEVDOProtocolSubtype() +struct sNASGetEVDOProtocolSubtypeRequest_Protocol +{ + UINT32 mEVDOProtocol; +}; + +// Structure to describe response TLV 0x10 for NASGetEVDOProtocolSubtype() +struct sNASGetEVDOProtocolSubtypeResponse_Subtype +{ + UINT16 mEVDOProtocolSubtype; +}; + +// Structure to describe response TLV 0x10 for NASGetEVDOColorCode() +struct sNASGetEVDOColorCodeResponse_Value +{ + UINT8 mEVDOColorCode; +}; + +// Structure to describe response TLV 0x10 for NASGetAcquisitionSystemMode() +struct sNASGetAcquisitionSystemModeResponse_CDMA +{ + eQMINASRadioSystemModes mRadioSystemMode; +}; + +// Structure to describe response TLV 0x11 for NASGetAcquisitionSystemMode() +struct sNASGetAcquisitionSystemModeResponse_CDMA1xEVDO +{ + eQMINASRadioSystemModes mRadioSystemMode; +}; + +// Structure to describe response TLV 0x12 for NASGetAcquisitionSystemMode() +struct sNASGetAcquisitionSystemModeResponse_GSM +{ + eQMINASRadioSystemModes mRadioSystemMode; +}; + +// Structure to describe response TLV 0x13 for NASGetAcquisitionSystemMode() +struct sNASGetAcquisitionSystemModeResponse_UMTS +{ + eQMINASRadioSystemModes mRadioSystemMode; +}; + +// Structure to describe response TLV 0x14 for NASGetAcquisitionSystemMode() +struct sNASGetAcquisitionSystemModeResponse_LTE +{ + eQMINASRadioSystemModes mRadioSystemMode; +}; + +// Structure to describe response TLV 0x15 for NASGetAcquisitionSystemMode() +struct sNASGetAcquisitionSystemModeResponse_TDSCDMA +{ + eQMINASRadioSystemModes mRadioSystemMode; +}; + +// Structure to describe request TLV 0x01 for NASSetRXDiversity() +struct sNASSetRXDiversityRequest_Diversity +{ + eQMINASRadioInterfaces mRadioInterface; + bool mEnableRXChain0:1; + bool mEnableRXChain1:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x10 for NASGetRXTXInfo() +struct sNASGetRXTXInfoResponse_RX0Info +{ + INT8 mRadioTuned; + INT32 mRXPower; + INT32 mEcIo; + INT32 mRSCP; + INT32 mRSRP; + INT32 mPhase; +}; + +// Structure to describe response TLV 0x11 for NASGetRXTXInfo() +struct sNASGetRXTXInfoResponse_RX1Info +{ + INT8 mRadioTuned; + INT32 mRXPower; + INT32 mEcIo; + INT32 mRSCP; + INT32 mRSRP; + INT32 mPhase; +}; + +// Structure to describe response TLV 0x12 for NASGetRXTXInfo() +struct sNASGetRXTXInfoResponse_TXInfo +{ + INT8 mInTraffic; + INT32 mTXPower; +}; + +// Structure to describe request TLV 0x01 for NASUpdateAKEYExtended() +struct sNASUpdateAKEYExtendedRequest_AKEY +{ + char mSPC[6]; + char mAKEY[26]; +}; + +// Structure to describe response TLV 0x10 for NASGetDualStandbyPreference() +struct sNASGetDualStandbyPreferenceResponse_StandbyPreference +{ + eQMINASStandbyPreference mStandbyPreference; +}; + +// Structure to describe response TLV 0x11 for NASGetDualStandbyPreference() +struct sNASGetDualStandbyPreferenceResponse_PrioritySubs +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe response TLV 0x12 for NASGetDualStandbyPreference() +struct sNASGetDualStandbyPreferenceResponse_ActiveSubs +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe response TLV 0x13 for NASGetDualStandbyPreference() +struct sNASGetDualStandbyPreferenceResponse_DefaultDataSubs +{ + eQMINASSubscriptionType mSubscriptionType; +}; + +// Structure to describe request TLV 0x01 for NASBlockLTEPLMN() +struct sNASBlockLTEPLMNRequest_PLMN +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + INT8 mMNCIncludesPCSDigit; +}; + +// Structure to describe request TLV 0x10 for NASBlockLTEPLMN() +struct sNASBlockLTEPLMNRequest_AbsoluteTime +{ + UINT32 mBlockingIntervalInMilliseconds; +}; + +// Structure to describe request TLV 0x11 for NASBlockLTEPLMN() +struct sNASBlockLTEPLMNRequest_T3204Multiplier +{ + UINT32 mBlockingIntervalAsT3204Multiplier; +}; + +// Structure to describe request TLV 0x01 for NASUnblockLTEPLMN() +struct sNASUnblockLTEPLMNRequest_PLMN +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + INT8 mMNCIncludesPCSDigit; +}; + +// Structure to describe indication TLV 0x10 for NAS CurrentPLMNNameIndication +struct sNASCurrentPLMNNameIndication_PLMN +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; + INT8 mMNCIncludesPCSDigit; +}; + +// Structure to describe indication TLV 0x11 for NAS CurrentPLMNNameIndication +struct sNASCurrentPLMNNameIndication_SPN +{ + eQMINASPLMNNameEncodingSchemes mSPNEncoding; + UINT8 mSPNLength; + + // This array must be the size specified by mSPNLength + // UINT8 mSPN[1]; +}; + +// Structure to describe indication TLV 0x12 for NAS CurrentPLMNNameIndication +struct sNASCurrentPLMNNameIndication_ShortName +{ + eQMINASPLMNNameEncodingSchemes mPLMNShortEncoding; + eQMINASPLMNNameCountryInitials mPLMNShortCountryInitials; + eQMINASPLMNNameSpareBits mPLMNSpareBits; + UINT8 mPLMNShortLength; + + // This array must be the size specified by mPLMNShortLength + // UINT8 mPLMNShort[1]; +}; + +// Structure to describe indication TLV 0x13 for NAS CurrentPLMNNameIndication +struct sNASCurrentPLMNNameIndication_LongName +{ + eQMINASPLMNNameEncodingSchemes mPLMNLongEncoding; + eQMINASPLMNNameCountryInitials mPLMNLongCountryInitials; + eQMINASPLMNNameSpareBits mPLMNLongBits; + UINT8 mPLMNLongLength; + + // This array must be the size specified by mPLMNLongLength + // UINT8 mPLMNLong[1]; +}; + +// Structure to describe request TLV 0x01 for NASConfigureEMBMS() +struct sNASConfigureEMBMSRequest_Config +{ + INT8 mEMBMSEnabled; +}; + +// Structure to describe response TLV 0x10 for NASGetEMBMSStatus() +struct sNASGetEMBMSStatusResponse_Status +{ + INT8 mEMBMSEnabled; +}; + +// Structure to describe indication TLV 0x01 for NAS EMBMSStatusIndication +struct sNASEMBMSStatusIndication_Status +{ + INT8 mEMBMSEnabled; +}; + +// Structure to describe response TLV 0x10 for NASGetCDMAPositionInfo() +struct sNASGetCDMAPositionInfoResponse_Info +{ + INT8 mUEInIdleMode; + UINT8 mBaseStationCount; + + struct sBaseStation + { + eQMINASCDMAPilotTypes mPilotType; + UINT16 mSystemID; + UINT16 mNetworkID; + UINT16 mBaseStationID; + UINT16 mPilotPN; + UINT16 mPilotStrength; + INT32 mLatitude; + INT32 mLongitude; + UINT64 mGPSTimeInMilliseconds; + }; + + // This array must be the size specified by mBaseStationCount + // sBaseStation mBaseStations[1]; +}; + +// Structure to describe indication TLV 0x01 for NAS RFBandInfoIndication +struct sNASRFBandInfoIndication_BandInfo +{ + eQMINASRadioInterfaces mRadioInterface; + eQMINASBandClasses mActiveBandClass; + UINT16 mActiveChannel; +}; + +// Structure to describe indication TLV 0x01 for NAS NetworkRejectIndication +struct sNASNetworkRejectIndication_RadioInterface +{ + eQMINASRadioInterfaces mRadioInterface; +}; + +// Structure to describe indication TLV 0x03 for NAS NetworkRejectIndication +struct sNASNetworkRejectIndication_RejectCause +{ + UINT8 mRejectCause; +}; + +// Structure to describe response TLV 0x10 for NASGetManagedRoamingConfig() +struct sNASGetManagedRoamingConfigResponse_Config +{ + INT8 mManagedRoamingSupported; +}; + +// Structure to describe indication TLV 0x10 for NAS RTREConfigurationIndication +struct sNASRTREConfigurationIndication_CurrentConfig +{ + eQMINASRTREConfiguration mRTREConfiguration; +}; + +// Structure to describe indication TLV 0x11 for NAS RTREConfigurationIndication +struct sNASRTREConfigurationIndication_ConfigPreference +{ + eQMINASRTREConfiguration mRTREPreference; +}; + +// Structure to describe response TLV 0x10 for NASGetCentralizedEONSSupport() +struct sNASGetCentralizedEONSSupportResponse_Status +{ + INT8 mCentralizedEONSSupported; +}; + +// Structure to describe request TLV 0x10 for WMSSetEventReport() +struct sWMSSetEventReportRequest_NewMTMessageIndicator +{ + INT8 mReportNewMTMessages; +}; + +// Structure to describe indication TLV 0x10 for WMS EventReport +struct sWMSEventReportIndication_ReceivedMTMessage +{ + eQMIWMSStorageTypes mStorageType; + UINT32 mStorageIndex; +}; + +// Structure to describe indication TLV 0x11 for WMS EventReport +struct sWMSEventReportIndication_TransferRouteMTMessage +{ + INT8 mACKRequired; + UINT32 mTransactionID; + eQMIWMSMessageFormats mMessageFormat; + UINT16 mRawMessageLength; + + // This array must be the size specified by mRawMessageLength + // UINT8 mRawMessage[1]; +}; + +// Structure to describe indication TLV 0x12 for WMS EventReport +struct sWMSEventReportIndication_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe indication TLV 0x13 for WMS EventReport +struct sWMSEventReportIndication_ReceivedETWSMessage +{ + eQMIWMSNotificationType mNotificationType; + UINT16 mRawMessageLength; + + // This array must be the size specified by mRawMessageLength + // UINT8 mRawMessage[1]; +}; + +// Structure to describe indication TLV 0x14 for WMS EventReport +struct sWMSEventReportIndication_ReceivedETWSPLMNInfo +{ + UINT16 mMobileCountryCode; + UINT16 mMobileNetworkCode; +}; + +// Structure to describe indication TLV 0x15 for WMS EventReport +struct sWMSEventReportIndication_ReceivedSMSCAddress +{ + UINT8 mSMSCAddressLength; + + // This array must be the size specified by mSMSCAddressLength + // char mSMSCAddress[1]; +}; + +// Structure to describe indication TLV 0x16 for WMS EventReport +struct sWMSEventReportIndication_SMSOnIMS +{ + INT8 mMessageReceivedFromIMS; +}; + +// Structure to describe request TLV 0x01 for WMSRawSend() +struct sWMSRawSendRequest_MessageData +{ + eQMIWMSMessageFormats mMessageFormat; + UINT16 mRawMessageLength; + + // This array must be the size specified by mRawMessageLength + // UINT8 mRawMessage[1]; +}; + +// Structure to describe request TLV 0x10 for WMSRawSend() +struct sWMSRawSendRequest_ForceOnDC +{ + INT8 mForceSendOnDC; + eQMIWMSCDMAServiceOptions mServiceOption; +}; + +// Structure to describe request TLV 0x11 for WMSRawSend() +struct sWMSRawSendRequest_FollowOnDC +{ + INT8 mDoNotDisconnectDC; +}; + +// Structure to describe request TLV 0x12 for WMSRawSend() +struct sWMSRawSendRequest_LinkControl +{ + UINT8 mLinkTimerInSeconds; +}; + +// Structure to describe request TLV 0x13 for WMSRawSend() +struct sWMSRawSendRequest_SMSOnIMS +{ + INT8 mMessageToBeSentOnIMS; +}; + +// Structure to describe request TLV 0x14 for WMSRawSend() +struct sWMSRawSendRequest_RetryMessage +{ + INT8 mMessageIsARetry; +}; + +// Structure to describe request TLV 0x15 for WMSRawSend() +struct sWMSRawSendRequest_RetryMessageID +{ + UINT32 mMessageRetryID; +}; + +// Structure to describe response TLV 0x01 for WMSRawSend() +struct sWMSRawSendResponse_MessageID +{ + UINT16 mMessageID; +}; + +// Structure to describe response TLV 0x10 for WMSRawSend() +struct sWMSRawSendResponse_CauseCode +{ + UINT16 mCauseCode; +}; + +// Structure to describe response TLV 0x11 for WMSRawSend() +struct sWMSRawSendResponse_ErrorClass +{ + eQMIWMSErrorClasses mErrorClass; +}; + +// Structure to describe response TLV 0x12 for WMSRawSend() +struct sWMSRawSendResponse_CauseInfo +{ + UINT16 mGSMWCDMARPCause; + UINT8 mGSMWCDMATPCause; +}; + +// Structure to describe response TLV 0x13 for WMSRawSend() +struct sWMSRawSendResponse_MessageDeliveryFailureType +{ + eQMIWMSMessageDeliveryFailureType mMessageDeliveryFailureType; +}; + +// Structure to describe response TLV 0x14 for WMSRawSend() +struct sWMSRawSendResponse_MessageDeliveryFailureCause +{ + eQMIWMSDeliveryFailures mDeliveryFailureCause; +}; + +// Structure to describe response TLV 0x15 for WMSRawSend() +struct sWMSRawSendResponse_CallControlModifiedInfo +{ + UINT8 mAlphaIDLength; + + // This array must be the size specified by mAlphaIDLength + // UINT8 mAlphaID[1]; +}; + +// Structure to describe request TLV 0x01 for WMSRawWrite() +struct sWMSRawWriteRequest_MessageData +{ + eQMIWMSStorageTypes mStorageType; + eQMIWMSMessageFormats mMessageFormat; + UINT16 mRawMessageLength; + + // This array must be the size specified by mRawMessageLength + // UINT8 mRawMessage[1]; +}; + +// Structure to describe response TLV 0x01 for WMSRawWrite() +struct sWMSRawWriteResponse_MessageIndex +{ + UINT32 mStorageIndex; +}; + +// Structure to describe request TLV 0x01 for WMSRawRead() +struct sWMSRawReadRequest_MessageIndex +{ + eQMIWMSStorageTypes mStorageType; + UINT32 mStorageIndex; +}; + +// Structure to describe request TLV 0x10 for WMSRawRead() +struct sWMSRawReadRequest_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe request TLV 0x11 for WMSRawRead() +struct sWMSRawReadRequest_SMSOnIMS +{ + INT8 mMessageToBeReadFromIMS; +}; + +// Structure to describe response TLV 0x01 for WMSRawRead() +struct sWMSRawReadResponse_MessageData +{ + eQMIWMSMessageTags mMessageTag; + eQMIWMSMessageFormats mMessageFormat; + UINT16 mRawMessageLength; + + // This array must be the size specified by mRawMessageLength + // UINT8 mRawMessage[1]; +}; + +// Structure to describe request TLV 0x01 for WMSModifyTag() +struct sWMSModifyTagRequest_MessageTag +{ + eQMIWMSStorageTypes mStorageType; + UINT32 mStorageIndex; + eQMIWMSMessageTags mMessageTag; +}; + +// Structure to describe request TLV 0x10 for WMSModifyTag() +struct sWMSModifyTagRequest_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe request TLV 0x01 for WMSDelete() +struct sWMSDeleteRequest_MemoryStorage +{ + eQMIWMSStorageTypes mStorageType; +}; + +// Structure to describe request TLV 0x10 for WMSDelete() +struct sWMSDeleteRequest_MessageIndex +{ + UINT32 mStorageIndex; +}; + +// Structure to describe request TLV 0x11 for WMSDelete() +struct sWMSDeleteRequest_MessageTag +{ + eQMIWMSMessageTags mMessageTag; +}; + +// Structure to describe request TLV 0x12 for WMSDelete() +struct sWMSDeleteRequest_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe response TLV 0x01 for WMSGetMessageProtocol() +struct sWMSGetMessageProtocolResponse_MessageProtocol +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe request TLV 0x01 for WMSListMessages() +struct sWMSListMessagesRequest_MemoryStorage +{ + eQMIWMSStorageTypes mStorageType; +}; + +// Structure to describe request TLV 0x10 for WMSListMessages() +struct sWMSListMessagesRequest_MessageTag +{ + eQMIWMSMessageTags mMessageTag; +}; + +// Structure to describe request TLV 0x11 for WMSListMessages() +struct sWMSListMessagesRequest_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe response TLV 0x01 for WMSListMessages() +struct sWMSListMessagesResponse_MessageList +{ + UINT32 mNumberOfMessages; + + struct sMessage + { + UINT32 mStorageIndex; + eQMIWMSMessageTags mMessageTag; + }; + + // This array must be the size specified by mNumberOfMessages + // sMessage mMessages[1]; +}; + +// Structure to describe request TLV 0x01 for WMSSetRoutes() +struct sWMSSetRoutesRequest_RouteList +{ + UINT16 mNumberOfRoutes; + + struct sRoute + { + eQMIWMSMessageTypes mMessageType; + eQMIWMSMessageClasses mMessageClass; + eQMIWMSStorageTypes mStorageType; + eQMIWMSReceiptActions mReceiptAction; + }; + + // This array must be the size specified by mNumberOfRoutes + // sRoute mRoutes[1]; +}; + +// Structure to describe request TLV 0x10 for WMSSetRoutes() +struct sWMSSetRoutesRequest_TransferStatusReport +{ + INT8 mTransferStatusReports; +}; + +// Structure to describe response TLV 0x01 for WMSGetRoutes() +struct sWMSGetRoutesResponse_RouteList +{ + UINT16 mNumberOfRoutes; + + struct sRoute + { + eQMIWMSMessageTypes mMessageType; + eQMIWMSMessageClasses mMessageClass; + eQMIWMSStorageTypes mStorageType; + eQMIWMSRouteValues mRouteValue; + }; + + // This array must be the size specified by mNumberOfRoutes + // sRoute mRoutes[1]; +}; + +// Structure to describe response TLV 0x10 for WMSGetRoutes() +struct sWMSGetRoutesResponse_TransferStatusReport +{ + INT8 mTransferStatusReports; +}; + +// Structure to describe response TLV 0x01 for WMSGetSMSCAddress() +struct sWMSGetSMSCAddressResponse_Address +{ + char mSMSCAddressType[3]; + UINT8 mSMSCAddressLength; + + // This array must be the size specified by mSMSCAddressLength + // char mSMSCAddress[1]; +}; + +// Structure to describe request TLV 0x01 for WMSSetSMSCAddress() +struct sWMSSetSMSCAddressRequest_Address +{ + // String is variable length, but must be size of the container + // char mSMSCAddress[1]; +}; + +// Structure to describe request TLV 0x10 for WMSSetSMSCAddress() +struct sWMSSetSMSCAddressRequest_AddressType +{ + // String is variable length, but must be size of the container + // char mSMSCAddressType[1]; +}; + +// Structure to describe request TLV 0x01 for WMSGetStorageMaxSize() +struct sWMSGetStorageMaxSizeRequest_MemoryStorage +{ + eQMIWMSStorageTypes mStorageType; +}; + +// Structure to describe request TLV 0x10 for WMSGetStorageMaxSize() +struct sWMSGetStorageMaxSizeRequest_MessageMode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe response TLV 0x01 for WMSGetStorageMaxSize() +struct sWMSGetStorageMaxSizeResponse_MaxSize +{ + UINT32 mMaxStorageSizeInMessages; +}; + +// Structure to describe response TLV 0x10 for WMSGetStorageMaxSize() +struct sWMSGetStorageMaxSizeResponse_AvailableSize +{ + UINT32 mFreeStorageSizeInMessages; +}; + +// Structure to describe request TLV 0x01 for WMSSendACK() +struct sWMSSendACKRequest_ACK +{ + UINT32 mTransactionID; + eQMIWMSMessageProtocols mMode; + INT8 mProcessedSuccessfully; +}; + +// Structure to describe request TLV 0x10 for WMSSendACK() +struct sWMSSendACKRequest_3GPP2FailureInfo +{ + eQMIWMSErrorClasses2 mErrorClass; + UINT8 mTransportLayerStatus; +}; + +// Structure to describe request TLV 0x11 for WMSSendACK() +struct sWMSSendACKRequest_3GPPFailureInfo +{ + UINT8 mGSMWCDMARPCause; + UINT8 mGSMWCDMATPCause; +}; + +// Structure to describe request TLV 0x12 for WMSSendACK() +struct sWMSSendACKRequest_SMSOnIMS +{ + INT8 mACKToBeSentOnIMS; +}; + +// Structure to describe response TLV 0x10 for WMSSendACK() +struct sWMSSendACKResponse_ACKFailureCause +{ + eQMIWMSACKFailureCause mACKFailureCause; +}; + +// Structure to describe request TLV 0x01 for WMSSetRetryPeriod() +struct sWMSSetRetryPeriodRequest_Period +{ + UINT32 mRetryPeriodInSeconds; +}; + +// Structure to describe request TLV 0x01 for WMSSetRetryInterval() +struct sWMSSetRetryIntervalRequest_Interval +{ + UINT32 mRetryIntervalInSeconds; +}; + +// Structure to describe request TLV 0x01 for WMSSetDCDisconnectTimer() +struct sWMSSetDCDisconnectTimerRequest_Timer +{ + UINT32 mDCDisconnectTimerInSeconds; +}; + +// Structure to describe request TLV 0x01 for WMSSetMemoryStatus() +struct sWMSSetMemoryStatusRequest_Status +{ + INT8 mMemoryIsAvailable; +}; + +// Structure to describe request TLV 0x01 for WMSSetBroadcastActivation() +struct sWMSSetBroadcastActivationRequest_BCInfo +{ + eQMIWMSMessageProtocols mMode; + INT8 mActivateBroadcast; +}; + +// Structure to describe request TLV 0x01 for WMSSetBroadcastConfig() +struct sWMSSetBroadcastConfigRequest_Mode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe request TLV 0x10 for WMSSetBroadcastConfig() +struct sWMSSetBroadcastConfigRequest_3GPPInfo +{ + UINT16 mNumberOfInstances; + + struct sInstance + { + UINT16 mMessageIDStart; + UINT16 mMessageIDEnd; + INT8 mSelected; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe request TLV 0x11 for WMSSetBroadcastConfig() +struct sWMSSetBroadcastConfigRequest_3GPP2Info +{ + UINT16 mNumberOfInstances; + + struct sInstance + { + UINT16 mServiceCategory; + eQMIWMSLanguage mLanguage; + INT8 mSelected; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe request TLV 0x01 for WMSGetBroadcastConfig() +struct sWMSGetBroadcastConfigRequest_Mode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe response TLV 0x10 for WMSGetBroadcastConfig() +struct sWMSGetBroadcastConfigResponse_3GPPInfo +{ + INT8 mActivated; + UINT16 mNumberOfInstances; + + struct sInstance + { + UINT16 mMessageIDStart; + UINT16 mMessageIDEnd; + INT8 mSelected; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x11 for WMSGetBroadcastConfig() +struct sWMSGetBroadcastConfigResponse_3GPP2Info +{ + INT8 mActivated; + UINT16 mNumberOfInstances; + + struct sInstance + { + UINT16 mServiceCategory; + eQMIWMSLanguage mLanguage; + INT8 mSelected; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x01 for WMS MemoryFullIndication +struct sWMSMemoryFullIndication_Info +{ + eQMIWMSStorageTypes mStorageType; + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe response TLV 0x01 for WMSGetDomainPreference() +struct sWMSGetDomainPreferenceResponse_Pref +{ + eQMIWMSGSMWCDMADomains mDomainPreference; +}; + +// Structure to describe request TLV 0x01 for WMSSetDomainPreference() +struct sWMSSetDomainPreferenceRequest_Pref +{ + eQMIWMSGSMWCDMADomains mDomainPreference; +}; + +// Structure to describe request TLV 0x01 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreRequest_Info +{ + eQMIWMSStorageTypes mStorageType; + UINT32 mStorageIndex; + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe request TLV 0x10 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreRequest_SMSOnIMS +{ + INT8 mMessageToBeSentOnIMS; +}; + +// Structure to describe response TLV 0x10 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreResponse_MessageID +{ + UINT16 mMessageID; +}; + +// Structure to describe response TLV 0x11 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreResponse_CauseCode +{ + UINT16 mCauseCode; +}; + +// Structure to describe response TLV 0x12 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreResponse_ErrorClass +{ + eQMIWMSErrorClasses mErrorClass; +}; + +// Structure to describe response TLV 0x13 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreResponse_CauseInfo +{ + UINT16 mGSMWCDMARPCause; + UINT8 mGSMWCDMATPCause; +}; + +// Structure to describe response TLV 0x14 for WMSSendFromMemoryStore() +struct sWMSSendFromMemoryStoreResponse_MessageDeliveryFailureType +{ + eQMIWMSMessageDeliveryFailureType mMessageDeliveryFailureType; +}; + +// Structure to describe response TLV 0x01 for WMSGetWaitingMessage() +struct sWMSGetWaitingMessageResponse_WaitingMessageInfo +{ + UINT8 mNumberOfWaitingMessages; + eQMIWMSWaitingMessageType mWaitingMessageType; + INT8 mActiveIndication; + UINT8 mMessageCount; +}; + +// Structure to describe indication TLV 0x01 for WMS WaitingMessageIndication +struct sWMSWaitingMessageIndication_WaitingMessageInfo +{ + UINT8 mNumberOfWaitingMessages; + eQMIWMSWaitingMessageType mWaitingMessageType; + INT8 mActiveIndication; + UINT8 mMessageCount; +}; + +// Structure to describe request TLV 0x01 for WMSSetPrimaryClient() +struct sWMSSetPrimaryClientRequest_PrimaryClientInfo +{ + INT8 mPrimaryClient; +}; + +// Structure to describe indication TLV 0x01 for WMS SMSCAddressIndication +struct sWMSSMSCAddressIndication_Address +{ + char mSMSCAddressType[3]; + UINT8 mSMSCAddressLength; + + // This array must be the size specified by mSMSCAddressLength + // char mSMSCAddress[1]; +}; + +// Structure to describe request TLV 0x10 for WMSIndicatorRegistration() +struct sWMSIndicatorRegistrationRequest_TransportLayerInfoEvents +{ + INT8 mTransportLayerInfoEvents; +}; + +// Structure to describe request TLV 0x11 for WMSIndicatorRegistration() +struct sWMSIndicatorRegistrationRequest_NetworkRegistrationInfoEvents +{ + INT8 mNetworkRegistrationInfoEvents; +}; + +// Structure to describe request TLV 0x12 for WMSIndicatorRegistration() +struct sWMSIndicatorRegistrationRequest_CallStatusInfoEvents +{ + INT8 mCallStatusInfoEvents; +}; + +// Structure to describe request TLV 0x13 for WMSIndicatorRegistration() +struct sWMSIndicatorRegistrationRequest_ServiceReadyEvents +{ + INT8 mServiceReadyEvents; +}; + +// Structure to describe request TLV 0x14 for WMSIndicatorRegistration() +struct sWMSIndicatorRegistrationRequest_BroadcastConfigEvents +{ + INT8 mBroadcastConfigEvents; +}; + +// Structure to describe response TLV 0x10 for WMSGetTransportInfoLayer() +struct sWMSGetTransportInfoLayerResponse_TransportLayerRegistrationInfo +{ + INT8 mRegistered; +}; + +// Structure to describe response TLV 0x11 for WMSGetTransportLayerInfo() +struct sWMSGetTransportLayerInfoResponse_TransportLayerInfo +{ + eQMIWMSTransportType mTransportType; + eQMIWMSTransportCapability mTransportCapability; +}; + +// Structure to describe indication TLV 0x01 for WMS TransportLayerInfoIndication +struct sWMSTransportLayerInfoIndication_TransportLayerRegInfo +{ + INT8 mRegistered; +}; + +// Structure to describe indication TLV 0x10 for WMS TransportLayerInfoIndication +struct sWMSTransportLayerInfoIndication_TransportLayerInfo +{ + eQMIWMSTransportType mTransportType; + eQMIWMSTransportCapability mTransportCapability; +}; + +// Structure to describe response TLV 0x10 for WMSGetNetworkRegistrationInfo() +struct sWMSGetNetworkRegistrationInfoResponse_NetworkRegistrationInfo +{ + eQMIWMSNetworkRegistrationStatus mNetworkRegistrationStatus; +}; + +// Structure to describe indication TLV 0x01 for WMS NetworkRegistrationInfoIndication +struct sWMSNetworkRegistrationInfoIndication_NetworkRegistrationInfo +{ + eQMIWMSNetworkRegistrationStatus mNetworkRegistrationStatus; +}; + +// Structure to describe request TLV 0x01 for WMSBindSubscription() +struct sWMSBindSubscriptionRequest_SubscriptionType +{ + eQMIWMSSubscriptionType mSubscriptionType; +}; + +// Structure to describe response TLV 0x10 for WMSGetIndicatorRegistration() +struct sWMSGetIndicatorRegistrationResponse_TransportLayerInfoEvents +{ + INT8 mTransportLayerInfoEvents; +}; + +// Structure to describe response TLV 0x11 for WMSGetIndicatorRegistration() +struct sWMSGetIndicatorRegistrationResponse_NetworkRegistrationInfoEvents +{ + INT8 mNetworkRegistrationInfoEvents; +}; + +// Structure to describe response TLV 0x12 for WMSGetIndicatorRegistration() +struct sWMSGetIndicatorRegistrationResponse_CallStatusInfoEvents +{ + INT8 mCallStatusInfoEvents; +}; + +// Structure to describe response TLV 0x13 for WMSGetIndicatorRegistration() +struct sWMSGetIndicatorRegistrationResponse_ServiceReadyEvents +{ + INT8 mServiceReadyEvents; +}; + +// Structure to describe response TLV 0x14 for WMSGetIndicatorRegistration() +struct sWMSGetIndicatorRegistrationResponse_BroadcastConfigEvents +{ + INT8 mBroadcastConfigEvents; +}; + +// Structure to describe request TLV 0x01 for WMSGetSMSParameters() +struct sWMSGetSMSParametersRequest_MessageMode +{ + eQMIWMSSMSMessageMode mSMSMessageMode; +}; + +// Structure to describe response TLV 0x10 for WMSGetSMSParameters() +struct sWMSGetSMSParametersResponse_DestinationAddress +{ + UINT8 mDestinationAddressLength; + + // This array must be the size specified by mDestinationAddressLength + // UINT8 mDestinationAddress[1]; +}; + +// Structure to describe response TLV 0x11 for WMSGetSMSParameters() +struct sWMSGetSMSParametersResponse_ProtocolIdentifierData +{ + eQMIWMSProtocolIdentifierData mProtocolIdentifierData; +}; + +// Structure to describe response TLV 0x12 for WMSGetSMSParameters() +struct sWMSGetSMSParametersResponse_DataCodingScheme +{ + UINT8 mDataCodingScheme; +}; + +// Structure to describe response TLV 0x13 for WMSGetSMSParameters() +struct sWMSGetSMSParametersResponse_ValidityPeriod +{ + UINT8 mValidityPeriod; +}; + +// Structure to describe request TLV 0x01 for WMSSetSMSParameters() +struct sWMSSetSMSParametersRequest_MessageMode +{ + eQMIWMSSMSMessageMode mSMSMessageMode; +}; + +// Structure to describe request TLV 0x10 for WMSSetSMSParameters() +struct sWMSSetSMSParametersRequest_DestinationAddress +{ + UINT8 mDestinationAddressLength; + + // This array must be the size specified by mDestinationAddressLength + // UINT8 mDestinationAddress[1]; +}; + +// Structure to describe request TLV 0x11 for WMSSetSMSParameters() +struct sWMSSetSMSParametersRequest_ProtocolIdentifierData +{ + eQMIWMSProtocolIdentifierData mProtocolIdentifierData; +}; + +// Structure to describe request TLV 0x12 for WMSSetSMSParameters() +struct sWMSSetSMSParametersRequest_DataCodingScheme +{ + UINT8 mDataCodingScheme; +}; + +// Structure to describe request TLV 0x13 for WMSSetSMSParameters() +struct sWMSSetSMSParametersRequest_ValidityPeriod +{ + UINT8 mValidityPeriod; +}; + +// Structure to describe indication TLV 0x01 for WMS CallStatusIndication +struct sWMSCallStatusIndication_SMSCallStatusInfo +{ + eQMIWMSSMSCallStatus mSMSCallStatus; +}; + +// Structure to describe response TLV 0x10 for WMSGetDomainPreferenceConfig() +struct sWMSGetDomainPreferenceConfigResponse_LTEDomain +{ + eQMIWMSLTEDomains mLTEDomainPreference; +}; + +// Structure to describe response TLV 0x11 for WMSGetDomainPreferenceConfig() +struct sWMSGetDomainPreferenceConfigResponse_GWDomain +{ + eQMIWMSGSMWCDMADomains mDomainPreference; +}; + +// Structure to describe response TLV 0x10 for WMSSetDomainPreferenceConfig() +struct sWMSSetDomainPreferenceConfigResponse_LTEDomain +{ + eQMIWMSLTEDomains mLTEDomainPreference; +}; + +// Structure to describe response TLV 0x11 for WMSSetDomainPreferenceConfig() +struct sWMSSetDomainPreferenceConfigResponse_GWDomain +{ + eQMIWMSGSMWCDMADomains mDomainPreference; +}; + +// Structure to describe response TLV 0x10 for WMSSetDomainPreferenceConfig() +struct sWMSSetDomainPreferenceConfigResponse_LTEOutcome +{ + UINT16 mLTEDomainPreferenceOutcome; +}; + +// Structure to describe response TLV 0x11 for WMSSetDomainPreferenceConfig() +struct sWMSSetDomainPreferenceConfigResponse_GWOutcome +{ + UINT16 mGWDomainPreferenceOutcome; +}; + +// Structure to describe response TLV 0x10 for WMSGetRetryPeriod() +struct sWMSGetRetryPeriodResponse_RetryPeriod +{ + UINT32 mRetryPeriodInSeconds; +}; + +// Structure to describe response TLV 0x10 for WMSGetRetryInterval() +struct sWMSGetRetryIntervalResponse_RetryInterval +{ + UINT32 mRetryIntervalInSeconds; +}; + +// Structure to describe response TLV 0x10 for WMSGetDCDisconnectTimer() +struct sWMSGetDCDisconnectTimerResponse_DCDisconnectTimer +{ + UINT32 mDCDisconnectTimerInSeconds; +}; + +// Structure to describe response TLV 0x10 for WMSGetMemoryStatus() +struct sWMSGetMemoryStatusResponse_MemoryStatus +{ + INT8 mMemoryIsAvailable; +}; + +// Structure to describe response TLV 0x10 for WMSGetPrimaryClient() +struct sWMSGetPrimaryClientResponse_PrimaryClientInfo +{ + INT8 mPrimaryClient; +}; + +// Structure to describe response TLV 0x10 for WMSGetSubscriptionBinding() +struct sWMSGetSubscriptionBindingResponse_SubscriptionType +{ + eQMIWMSSubscriptionType mSubscriptionType; +}; + +// Structure to describe request TLV 0x01 for WMSAsyncRawSend() +struct sWMSAsyncRawSendRequest_MessageData +{ + eQMIWMSMessageFormats mMessageFormat; + UINT16 mRawMessageLength; + + // This array must be the size specified by mRawMessageLength + // UINT8 mRawMessage[1]; +}; + +// Structure to describe request TLV 0x10 for WMSAsyncRawSend() +struct sWMSAsyncRawSendRequest_ForceOnDC +{ + INT8 mForceSendOnDC; + eQMIWMSCDMAServiceOptions mServiceOption; +}; + +// Structure to describe request TLV 0x11 for WMSAsyncRawSend() +struct sWMSAsyncRawSendRequest_FollowOnDC +{ + INT8 mDoNotDisconnectDC; +}; + +// Structure to describe request TLV 0x12 for WMSAsyncRawSend() +struct sWMSAsyncRawSendRequest_LinkControl +{ + UINT8 mLinkTimerInSeconds; +}; + +// Structure to describe request TLV 0x13 for WMSAsyncRawSend() +struct sWMSAsyncRawSendRequest_SMSOnIMS +{ + INT8 mMessageToBeSentOnIMS; +}; + +// Structure to describe request TLV 0x14 for WMSAsyncRawSend() +struct sWMSAsyncRawSendRequest_RetryMessage +{ + INT8 mMessageIsARetry; +}; + +// Structure to describe request TLV 0x15 for WMSAsyncRawSend() +struct sWMSAsyncRawSendRequest_RetryMessageID +{ + UINT32 mMessageRetryID; +}; + +// Structure to describe request TLV 0x16 for WMSAsyncRawSend() +struct sWMSAsyncRawSendRequest_UserData +{ + UINT32 mUserData; +}; + +// Structure to describe indication TLV 0x01 for WMS AsyncRawSendIndication +struct sWMSAsyncRawSendIndication_Status +{ + eQMIErrors mQMIError; +}; + +// Structure to describe indication TLV 0x10 for WMS AsyncRawSendIndication +struct sWMSAsyncRawSendIndication_MessageID +{ + UINT16 mMessageID; +}; + +// Structure to describe indication TLV 0x11 for WMS AsyncRawSendIndication +struct sWMSAsyncRawSendIndication_CauseCode +{ + UINT16 mCauseCode; +}; + +// Structure to describe indication TLV 0x12 for WMS AsyncRawSendIndication +struct sWMSAsyncRawSendIndication_ErrorClass +{ + eQMIWMSErrorClasses mErrorClass; +}; + +// Structure to describe indication TLV 0x13 for WMS AsyncRawSendIndication +struct sWMSAsyncRawSendIndication_CauseInfo +{ + UINT16 mGSMWCDMARPCause; + UINT8 mGSMWCDMATPCause; +}; + +// Structure to describe indication TLV 0x14 for WMS AsyncRawSendIndication +struct sWMSAsyncRawSendIndication_MessageDeliveryFailureType +{ + eQMIWMSMessageDeliveryFailureType mMessageDeliveryFailureType; +}; + +// Structure to describe indication TLV 0x15 for WMS AsyncRawSendIndication +struct sWMSAsyncRawSendIndication_MessageDeliveryFailureCause +{ + eQMIWMSDeliveryFailures mDeliveryFailureCause; +}; + +// Structure to describe indication TLV 0x16 for WMS AsyncRawSendIndication +struct sWMSAsyncRawSendIndication_CallControlModifiedInfo +{ + UINT8 mAlphaIDLength; + + // This array must be the size specified by mAlphaIDLength + // UINT8 mAlphaID[1]; +}; + +// Structure to describe indication TLV 0x17 for WMS AsyncRawSendIndication +struct sWMSAsyncRawSendIndication_UserData +{ + UINT32 mUserData; +}; + +// Structure to describe request TLV 0x01 for WMSAsyncSendACK() +struct sWMSAsyncSendACKRequest_ACK +{ + UINT32 mTransactionID; + eQMIWMSMessageProtocols mMode; + INT8 mProcessedSuccessfully; +}; + +// Structure to describe request TLV 0x10 for WMSAysncSendACK() +struct sWMSAysncSendACKRequest_3GPP2FailureInfo +{ + eQMIWMSErrorClasses2 mErrorClass; + UINT8 mTransportLayerStatus; +}; + +// Structure to describe request TLV 0x11 for WMSAsyncSendACK() +struct sWMSAsyncSendACKRequest_3GPPFailureInfo +{ + UINT8 mGSMWCDMARPCause; + UINT8 mGSMWCDMATPCause; +}; + +// Structure to describe request TLV 0x12 for WMSAsyncSendACK() +struct sWMSAsyncSendACKRequest_SMSOnIMS +{ + INT8 mACKToBeSentOnIMS; +}; + +// Structure to describe request TLV 0x13 for WMSAsyncSendACK() +struct sWMSAsyncSendACKRequest_UserData +{ + UINT32 mUserData; +}; + +// Structure to describe indication TLV 0x01 for WMS AsyncSendACKIndication +struct sWMSAsyncSendACKIndication_Status +{ + eQMIErrors mQMIError; +}; + +// Structure to describe indication TLV 0x10 for WMS AsyncSendACKIndication +struct sWMSAsyncSendACKIndication_ACKFailureCause +{ + eQMIWMSACKFailureCause mACKFailureCause; +}; + +// Structure to describe indication TLV 0x11 for WMS AsyncSendACKIndication +struct sWMSAsyncSendACKIndication_UserData +{ + UINT32 mUserData; +}; + +// Structure to describe request TLV 0x01 for WMSAsyncSendFromMemoryStore() +struct sWMSAsyncSendFromMemoryStoreRequest_Info +{ + eQMIWMSStorageTypes mStorageType; + UINT32 mStorageIndex; + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe request TLV 0x10 for WMSAsyncSendFromMemoryStore() +struct sWMSAsyncSendFromMemoryStoreRequest_SMSOnIMS +{ + INT8 mMessageToBeSentOnIMS; +}; + +// Structure to describe request TLV 0x11 for WMSAsyncSendFromMemoryStore() +struct sWMSAsyncSendFromMemoryStoreRequest_UserData +{ + UINT32 mUserData; +}; + +// Structure to describe indication TLV 0x01 for WMS AsyncSendFromMemoryStoreIndication +struct sWMSAsyncSendFromMemoryStoreIndication_Status +{ + eQMIErrors mQMIError; +}; + +// Structure to describe indication TLV 0x10 for WMS AsyncSendFromMemoryStoreIndication +struct sWMSAsyncSendFromMemoryStoreIndication_MessageID +{ + UINT16 mMessageID; +}; + +// Structure to describe indication TLV 0x11 for WMS AsyncSendFromMemoryStoreIndication +struct sWMSAsyncSendFromMemoryStoreIndication_CauseCode +{ + UINT16 mCauseCode; +}; + +// Structure to describe indication TLV 0x12 for WMS AsyncSendFromMemoryStoreIndication +struct sWMSAsyncSendFromMemoryStoreIndication_ErrorClass +{ + eQMIWMSErrorClasses mErrorClass; +}; + +// Structure to describe indication TLV 0x13 for WMS AsyncSendFromMemoryStoreIndication +struct sWMSAsyncSendFromMemoryStoreIndication_CauseInfo +{ + UINT16 mGSMWCDMARPCause; + UINT8 mGSMWCDMATPCause; +}; + +// Structure to describe indication TLV 0x14 for WMS AsyncSendFromMemoryStoreIndication +struct sWMSAsyncSendFromMemoryStoreIndication_MessageDeliveryFailureType +{ + eQMIWMSMessageDeliveryFailureType mMessageDeliveryFailureType; +}; + +// Structure to describe indication TLV 0x15 for WMS AsyncSendFromMemoryStoreIndication +struct sWMSAsyncSendFromMemoryStoreIndication_MessageDeliveryFailureCause +{ + eQMIWMSDeliveryFailures mDeliveryFailureCause; +}; + +// Structure to describe indication TLV 0x16 for WMS AsyncSendFromMemoryStoreIndication +struct sWMSAsyncSendFromMemoryStoreIndication_CallControlModifiedInfo +{ + UINT8 mAlphaIDLength; + + // This array must be the size specified by mAlphaIDLength + // UINT8 mAlphaID[1]; +}; + +// Structure to describe indication TLV 0x17 for WMS AsyncSendFromMemoryStoreIndication +struct sWMSAsyncSendFromMemoryStoreIndication_UserData +{ + UINT32 mUserData; +}; + +// Structure to describe response TLV 0x10 for WMSGetServiceReadyStatus() +struct sWMSGetServiceReadyStatusResponse_ServiceReadyEvents +{ + INT8 mServiceReadyEvents; +}; + +// Structure to describe response TLV 0x11 for WMSGetServiceReadyStatus() +struct sWMSGetServiceReadyStatusResponse_ServiceReadyStatus +{ + eQMIWMSServiceReadyStatus mReadyStatus; +}; + +// Structure to describe indication TLV 0x01 for WMS ServiceReadyStatusIndication +struct sWMSServiceReadyStatusIndication_ServiceReadyStatus +{ + eQMIWMSServiceReadyStatus mReadyStatus; +}; + +// Structure to describe indication TLV 0x01 for WMS BroadcastConfigIndication +struct sWMSBroadcastConfigIndication_Mode +{ + eQMIWMSMessageProtocols mMode; +}; + +// Structure to describe indication TLV 0x10 for WMS BroadcastConfigIndication +struct sWMSBroadcastConfigIndication_3GPPInfo +{ + INT8 mActivated; + UINT16 mNumberOfInstances; + + struct sInstance + { + UINT16 mMessageIDStart; + UINT16 mMessageIDEnd; + INT8 mSelected; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x11 for WMS BroadcastConfigIndication +struct sWMSBroadcastConfigIndication_3GPP2Info +{ + INT8 mActivated; + UINT16 mNumberOfInstances; + + struct sInstance + { + UINT16 mServiceCategory; + eQMIWMSLanguage mLanguage; + INT8 mSelected; + }; + + // This array must be the size specified by mNumberOfInstances + // sInstance mInstances[1]; +}; + +// Structure to describe request TLV 0x10 for PDSSetEventReport() +struct sPDSSetEventReportRequest_NMEAIndicator +{ + INT8 mReportNMEASentences; +}; + +// Structure to describe request TLV 0x11 for PDSSetEventReport() +struct sPDSSetEventReportRequest_ModeIndicator +{ + INT8 mReportNMEASentencesPlusMode; +}; + +// Structure to describe request TLV 0x12 for PDSSetEventReport() +struct sPDSSetEventReportRequest_RawIndicator +{ + INT8 mReportRawPositionData; +}; + +// Structure to describe request TLV 0x13 for PDSSetEventReport() +struct sPDSSetEventReportRequest_XTRARequestIndicator +{ + INT8 mReportExternalXTRADataRequests; +}; + +// Structure to describe request TLV 0x14 for PDSSetEventReport() +struct sPDSSetEventReportRequest_TimeInjectionIndicator +{ + INT8 mReportExternalTimeInjections; +}; + +// Structure to describe request TLV 0x15 for PDSSetEventReport() +struct sPDSSetEventReportRequest_WiFiIndicator +{ + INT8 mReportExternalWiFiRequests; +}; + +// Structure to describe request TLV 0x16 for PDSSetEventReport() +struct sPDSSetEventReportRequest_SatelliteIndicator +{ + INT8 mReportSatelliteInfo; +}; + +// Structure to describe request TLV 0x17 for PDSSetEventReport() +struct sPDSSetEventReportRequest_VXNetworkIndicator +{ + INT8 mReportVXNetworkInitiatedPrompts; +}; + +// Structure to describe request TLV 0x18 for PDSSetEventReport() +struct sPDSSetEventReportRequest_SUPLNetworkIndicator +{ + INT8 mReportSUPLNetworkInitiatedPrompts; +}; + +// Structure to describe request TLV 0x19 for PDSSetEventReport() +struct sPDSSetEventReportRequest_UMTSCPNetworkIndicator +{ + INT8 mReportUMTSCPNetworkInitiatedPrompts; +}; + +// Structure to describe request TLV 0x1A for PDSSetEventReport() +struct sPDSSetEventReportRequest_PDSCommIndicator +{ + INT8 mReportPDSCommEvents; +}; + +// Structure to describe request TLV 0x1B for PDSSetEventReport() +struct sPDSSetEventReportRequest_AccelerometerDataIndicator +{ + INT8 mReportAccelerometerDataStatus; +}; + +// Structure to describe request TLV 0x1C for PDSSetEventReport() +struct sPDSSetEventReportRequest_GyroDataIndicator +{ + INT8 mReportGyroDataStatus; +}; + +// Structure to describe request TLV 0x1D for PDSSetEventReport() +struct sPDSSetEventReportRequest_TimeSyncIndication +{ + INT8 mReportTimeSyncRequest; +}; + +// Structure to describe request TLV 0x1E for PDSSetEventReport() +struct sPDSSetEventReportRequest_PositionReliablilityIndicator +{ + INT8 mReportPositionReliability; +}; + +// Structure to describe request TLV 0x1F for PDSSetEventReport() +struct sPDSSetEventReportRequest_SensorDataUsageIndicator +{ + INT8 mReportSensorDataUsage; +}; + +// Structure to describe request TLV 0x20 for PDSSetEventReport() +struct sPDSSetEventReportRequest_TimeSourceInformationIndicator +{ + INT8 mReportTimeSourceInformation; +}; + +// Structure to describe request TLV 0x21 for PDSSetEventReport() +struct sPDSSetEventReportRequest_HeadingUncertaintyIndicator +{ + INT8 mReportHeadingUncertaintyInformation; +}; + +// Structure to describe request TLV 0x22 for PDSSetEventReport() +struct sPDSSetEventReportRequest_NMEADebugStringIndicator +{ + INT8 mReportNMEADebugStrings; +}; + +// Structure to describe request TLV 0x23 for PDSSetEventReport() +struct sPDSSetEventReportRequest_ExternalXTRADataIndicator +{ + INT8 mReportExtendedXTRAData; +}; + +// Structure to describe request TLV 0x24 for PDSSetEventReport() +struct sPDSSetEventReportRequest_ServiceResetStatus +{ + INT8 mReportServiceResetStatus; +}; + +// Structure to describe indication TLV 0x10 for PDS EventReport +struct sPDSEventReportIndication_NMEASentence +{ + // String is variable length, but must be size of the container + // char mNMEASentence[1]; +}; + +// Structure to describe indication TLV 0x11 for PDS EventReport +struct sPDSEventReportIndication_NMEASentencePlusMode +{ + eQMIPDSNMEASentenceOperatingModes mNMEASentenceOperatingMode; + UINT16 mNMEASentenceLength; + + // This array must be the size specified by mNMEASentenceLength + // char mNMEASentence[1]; +}; + +// Structure to describe indication TLV 0x12 for PDS EventReport +struct sPDSEventReportIndication_PositionSessionStatus +{ + eQMIPDSSessionStatus mSessionStatus; +}; + +// Structure to describe indication TLV 0x13 for PDS EventReport +struct sPDSEventReportIndication_ParsedPositionData +{ + bool mTimestampCalendarValid:1; + bool mTimestampUTCValid:1; + bool mLeapSecondsValid:1; + bool mTimeUncertaintyValid:1; + bool mLatitudeValid:1; + bool mLongitudeValid:1; + bool mEllipsoidAltitudeValid:1; + bool mMeanSeaLevelAltitudeValid:1; + bool mHorizontalSpeedValid:1; + bool mVerticalSpeedValid:1; + bool mHeadingValid:1; + bool mHorizontalUncertaintyCircularValid:1; + bool mHorizontalUncertaintyEllipseSemiMajorValid:1; + bool mHorizontalUncertaintyEllipseSemiMinorValid:1; + bool mHorizontalUncertaintyEllipseOrientAzimuthValid:1; + bool mVerticalUncertaintyValid:1; + bool mHorizontalVelocityUncertaintyValid:1; + bool mVerticalVelocityUncertaintyValid:1; + bool mHorizontalConfidenceValid:1; + bool mPositionDOPValid:1; + bool mHorizontalDOPValid:1; + bool mVerticalDOPValid:1; + bool mOperatingModeUsedValid:1; + + // Padding out 9 bits + UINT8 mReserved1:1; + UINT8 mReserved2; + + UINT16 mCalendarYear; + eQMIPDSCalendarMonths mCalendarMonth; + eQMIPDSCalendarDays mCalendarDay; + UINT8 mCalendarDayOfMonth; + UINT8 mCalendarHour; + UINT8 mCalendarMinute; + UINT8 mCalendarSecond; + UINT16 mCalendarMillisecond; + UINT8 mCalendarLeapSeconds; + UINT64 mUTCTimestamp; + UINT32 mUTCTimestampUncertainty; + double mLatitude; + double mLongitude; + float mEllipsoidAltitude; + float mMeanSeaLevelAltitude; + float mHorizontalSpeed; + float mVerticalSpeed; + float mHeading; + float mHorizontalUncertaintyCircular; + float mHorizontalUncertaintyEllipseSemiMajor; + float mHorizontalUncertaintyEllipseSemiMinor; + float mHorizontalUncertaintyEllipseOrientAzimuth; + float mVerticalUncertainty; + float mHorizontalVelocityUncertainty; + float mVerticalVelocityUncertainty; + UINT8 mHorizontalConfidence; + float mPositionDOP; + float mHorizontalDOP; + float mVerticalDOP; + eQMIPDSNMEASentenceOperatingModes mOperatingMode; +}; + +// Structure to describe indication TLV 0x14 for PDS EventReport +struct sPDSEventReportIndication_ExternalXTRARequest +{ + UINT16 mMaximumFileSize; + UINT8 mURLRecordCount; + + struct sURL + { + UINT8 mURLLength; + + // This array must be the size specified by mURLLength + // char mURL[1]; + }; + + // This array must be the size specified by mURLRecordCount + // sURL mURLs[1]; +}; + +// Structure to describe indication TLV 0x15 for PDS EventReport +struct sPDSEventReportIndication_ExternalTimeInjectionRequest +{ + UINT32 mDelayThresholdMilliseconds; + UINT8 mURLRecordCount; + + struct sURL + { + UINT8 mURLLength; + + // This array must be the size specified by mURLLength + // char mURL[1]; + }; + + // This array must be the size specified by mURLRecordCount + // sURL mURLs[1]; +}; + +// Structure to describe indication TLV 0x16 for PDS EventReport +struct sPDSEventReportIndication_ExternalWiFiPositionRequest +{ + eQMIPDSWiFiRequestTypes mWiFiRequestType; + UINT16 mWiFiRequestTimeBetweenFixesMilliseconds; +}; + +// Structure to describe indication TLV 0x17 for PDS EventReport +struct sPDSEventReportIndication_SatelliteInfo +{ + bool mIonoValid:1; + bool mSatelliteCountValid:1; + bool mSatelliteListValid:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; + + INT8 mIonosphericCorrections; + UINT8 mSVRecordCount; + + struct sSV + { + bool mSystemValid:1; + bool mPRNValid:1; + bool mHealthStatusValid:1; + bool mProcessStatusValid:1; + bool mEphemerisStateValid:1; + bool mAlmanacStateValid:1; + bool mElevationValid:1; + bool mAzimuthValid:1; + bool mCN0Valid:1; + + // Padding out 23 bits + UINT8 mReserved3:7; + UINT8 mReserved4[2]; + + eQMIPDSSVSystems mSystem; + UINT8 mPRN; + eQMIPDSSVHealthStatus mHealthLevel; + eQMIPDSSVProcessingStatus mProcessingStatus; + eQMIPDSSVEphemerisStatus mEphemerisState; + eQMIPDSSVAlmanacStatus mAlmanacState; + INT32 mElevation; + UINT16 mAzimuth; + UINT16 mCN0; + }; + + // This array must be the size specified by mSVRecordCount + // sSV mSVs[1]; +}; + +// Structure to describe indication TLV 0x18 for PDS EventReport +struct sPDSEventReportIndication_VXNetworkInitiatedPrompt +{ + bool mPrivacyValid:1; + bool mQoSValid:1; + bool mCountValid:1; + bool mIntervalValid:1; + bool mModeValid:1; + bool mRequestorIDValid:1; + + // Padding out 26 bits + UINT8 mReserved1:2; + UINT8 mReserved2[3]; + + eQMIPDSPrivacyModes mPrivacy; + UINT8 mQoS; + UINT32 mPositionCount; + UINT32 mIntervalBetweenFixesSeconds; + eQMIPDSVXModes mMode; + eQMIPDSVXDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +// Structure to describe indication TLV 0x19 for PDS EventReport +struct sPDSEventReportIndication_SUPLNetworkInitiatedPrompt1 +{ + bool mPrivacyValid:1; + bool mINITHashValid:1; + bool mModeValid:1; + bool mSLPSessionIDValid:1; + bool mSLPServerIPv4AddressValid:1; + bool mSLPServerIPv6AddressValid:1; + bool mSLPServerURLAddressValid:1; + bool mDCSValid:1; + bool mRequestorIDValid:1; + bool mClientNameValid:1; + bool mQoPHorizontalAccuracyValid:1; + bool mQoPVerticalAccuracyValid:1; + bool mQoPMaxLocationAgeValid:1; + bool mQoPDelayValid:1; + + // Padding out 18 bits + UINT8 mReserved1:2; + UINT8 mReserved2[2]; + + eQMIPDSPrivacyModes mPrivacy; + UINT64 mINITHash; + eQMIPDSSUPLModes mMode; + UINT32 mSLPSessionID; + UINT32 mSLPServerIPv4Port; + UINT8 mSLPServerIPv4Address[4]; + UINT32 mSLPServerIPv6Port; + UINT8 mSLPServerIPv6Address[16]; + UINT8 mSLPServerURLLength; + + // This array must be the size specified by mSLPServerURLLength + // char mSLPServerURLAddress[1]; +}; + +struct sPDSEventReportIndication_SUPLNetworkInitiatedPrompt2 +{ + eQMIPDSSUPLDataCodingSchemes mRequestDCS; + eQMIPDSSUPLIDNameDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sPDSEventReportIndication_SUPLNetworkInitiatedPrompt3 +{ + eQMIPDSSUPLIDNameDataCodingSchemes mClientNameDCS; + UINT8 mClientNameLength; + + // This array must be the size specified by mClientNameLength + // UINT8 mClientName[1]; +}; + +struct sPDSEventReportIndication_SUPLNetworkInitiatedPrompt4 +{ + UINT8 mQoPHorizontalAccuracy; + UINT8 mQoPVerticalAccuracy; + UINT8 mQoPMaxLocationAge; + UINT8 mQoPDelay; +}; + +struct sPDSEventReportIndication_SUPLNetworkInitiatedPrompt +{ + sPDSEventReportIndication_SUPLNetworkInitiatedPrompt1 mPDSEventReportIndication_SUPLNetworkInitiatedPrompt1; + sPDSEventReportIndication_SUPLNetworkInitiatedPrompt2 mPDSEventReportIndication_SUPLNetworkInitiatedPrompt2; + sPDSEventReportIndication_SUPLNetworkInitiatedPrompt3 mPDSEventReportIndication_SUPLNetworkInitiatedPrompt3; + sPDSEventReportIndication_SUPLNetworkInitiatedPrompt4 mPDSEventReportIndication_SUPLNetworkInitiatedPrompt4; +}; + +// Structure to describe indication TLV 0x1A for PDS EventReport +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt1 +{ + bool mPrivacyValid:1; + bool mInvokeIDValid:1; + bool mNotificationTextValid:1; + bool mClientAddressValid:1; + bool mLocationTypeValid:1; + bool mRequestorIDValid:1; + bool mCodewordStringValid:1; + bool mServiceTypeIDValid:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; + + eQMIPDSPrivacyModes mPrivacy; + UINT8 mInvokeID; + eQMIPDSUMTSCPDataCodingSchemes mNotificationTextDCS; + UINT8 mNotificationTextLength; + + // This array must be the size specified by mNotificationTextLength + // UINT8 mNotificationText[1]; +}; + +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt2 +{ + UINT8 mClientAddressLength; + + // This array must be the size specified by mClientAddressLength + // char mClientAddress[1]; +}; + +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt3 +{ + eQMIPDSUMTSCPLocationTypes mLocationType; + eQMIPDSUMTSCPDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt4 +{ + eQMIPDSUMTSCPDataCodingSchemes mCodewordDCS; + UINT8 mCodewordLength; + + // This array must be the size specified by mCodewordLength + // UINT8 mCodeword[1]; +}; + +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt5 +{ + UINT8 mServiceTypeID; +}; + +struct sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt +{ + sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt1 mPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt1; + sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt2 mPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt2; + sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt3 mPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt3; + sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt4 mPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt4; + sPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt5 mPDSEventReportIndication_UMTSCPNetworkInitiatedPrompt5; +}; + +// Structure to describe indication TLV 0x1B for PDS EventReport +struct sPDSEventReportIndication_CommEvents +{ + eQMIPDSCommEventTypes mType; + eQMIPDSCommEventProtocols mProtocolDataType; +}; + +// Structure to describe indication TLV 0x1C for PDS EventReport +struct sPDSEventReportIndication_PositionSource +{ + bool mGPS:1; + bool mCellID:1; + bool mGlonass:1; + bool mNetwork:1; + bool mEPI:1; + + // Padding out 27 bits + UINT8 mReserved1:3; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x1D for PDS EventReport +struct sPDSEventReportIndication_AccelerometerStreamingStatus +{ + eQMIPDSStreamingStatus mAccelerometerStreamingStatus; +}; + +// Structure to describe indication TLV 0x1E for PDS EventReport +struct sPDSEventReportIndication_GyroStreamingStatus +{ + eQMIPDSStreamingStatus mGyroStreamingStatus; +}; + +// Structure to describe indication TLV 0x1F for PDS EventReport +struct sPDSEventReportIndication_TimeSyncRequest +{ + UINT32 mReferenceCounter; +}; + +// Structure to describe indication TLV 0x20 for PDS EventReport +struct sPDSEventReportIndication_PositionReliabilityCounter +{ + eQMIPDSReliabilityIndicator mReliabilityIndicatorHorizontal; + eQMIPDSReliabilityIndicator mReliabilityIndicatorVertical; +}; + +// Structure to describe indication TLV 0x21 for PDS EventReport +struct sPDSEventReportIndication_SensorDataUsage +{ + bool mAccelerometer:1; + bool mGyro:1; + + // Padding out 14 bits + UINT8 mReserved1:6; + UINT8 mReserved2; + + bool mHeadingAidedWithSensorData:1; + bool mSpeedAidedWithSensorData:1; + bool mPositionAidedWithSensorData:1; + bool mVelocityAidedWithSensorData:1; + + // Padding out 12 bits + UINT8 mReserved3:4; + UINT8 mReserved4; +}; + +// Structure to describe indication TLV 0x22 for PDS EventReport +struct sPDSEventReportIndication_TimeSourceInformation +{ + INT8 mTimeValid; + eQMIPDSTimeSource mTimeSource; + UINT32 mTimeUncertaintyMilliseconds; + UINT16 mGPSWeekNumber; + UINT32 mGPSTimeOfWeekMilliseconds; + UINT32 mReserved1; + UINT32 mReserved2; + UINT32 mReserved3; + UINT32 mReserved4; + UINT32 mReserved5; +}; + +// Structure to describe indication TLV 0x23 for PDS EventReport +struct sPDSEventReportIndication_EncryptedPositionInformation +{ + eQMIPDSEncryptionAlgorithm mEncryptionAlgorithm; + UINT8 mEncryptionDataLength; + + // This array must be the size specified by mEncryptionDataLength + // UINT8 mEncryptionData[1]; +}; + +// Structure to describe indication TLV 0x24 for PDS EventReport +struct sPDSEventReportIndication_HeadingUncertaintyInformation +{ + float mHeadingUncertainty; + float mGNSSHeadingUncertainty; + UINT32 mReserved1; + UINT32 mReserved2; +}; + +// Structure to describe indication TLV 0x25 for PDS EventReport +struct sPDSEventReportIndication_ProprietaryNMEADebugSentences +{ + // String is variable length, but must be size of the container + // char mNMEADebug[1]; +}; + +// Structure to describe indication TLV 0x26 for PDS EventReport +struct sPDSEventReportIndication_ExtendedExternalXTRADatabaseRequest +{ + UINT32 mMaximumFileSize; + UINT8 mURLCount; + UINT8 mURLLength; + + // This array must be the size specified by mURLLength + // char mURL[1]; +}; + +// Structure to describe indication TLV 0x27 for PDS EventReport +struct sPDSEventReportIndication_ServiceResetStatus +{ + eQMIPDSResetStates mServiceResetStatus; +}; + +// Structure to describe response TLV 0x01 for PDSGetServiceState() +struct sPDSGetServiceStateResponse_State +{ + INT8 mServiceEnabled; + eQMIPDSTrackingSessionStates mTrackingSessionState; +}; + +// Structure to describe indication TLV 0x01 for PDS ServiceStateIndication +struct sPDSServiceStateIndication_State +{ + INT8 mServiceEnabled; + eQMIPDSTrackingSessionStates mTrackingSessionState; +}; + +// Structure to describe request TLV 0x01 for PDSSetServiceState() +struct sPDSSetServiceStateRequest_State +{ + INT8 mServiceEnabled; +}; + +// Structure to describe request TLV 0x01 for PDSStartTrackingSession() +struct sPDSStartTrackingSessionRequest_Session +{ + eQMIPDSSessionControlTypes mSessionControl; + eQMIPDSSessionTypes mSessionType; + eQMIPDSOperationTypes mSessionOperation; + eQMIPDSServerOptions mServerOption; + UINT8 mTimeoutSeconds; + UINT32 mSessionFixRequests; + UINT32 mFixRequestIntervalSeconds; + UINT32 mDesiredAccuracyMeters; +}; + +// Structure to describe response TLV 0x01 for PDSGetTrackingSessionInfo() +struct sPDSGetTrackingSessionInfoResponse_Info +{ + eQMIPDSSessionControlTypes mSessionControl; + eQMIPDSSessionTypes mSessionType; + eQMIPDSOperationTypes mSessionOperation; + eQMIPDSServerOptions mServerOption; + UINT8 mTimeoutSeconds; + UINT32 mSessionFixRequests; + UINT32 mFixRequestIntervalSeconds; + UINT32 mDesiredAccuracyMeters; +}; + +// Structure to describe response TLV 0x01 for PDSGetNMEAConfig() +struct sPDSGetNMEAConfigResponse_Config +{ + bool mGPGGANMEASentences:1; + bool mGPRMCNMEASentences:1; + bool mGPGSVNMEASentences:1; + bool mGPGSANMEASentences:1; + bool mGPVTGNMEASentences:1; + bool mGLGSVNMEASentences:1; + bool mGNGSANMEASentences:1; + bool mGNGNSNMEASentences:1; + eQMIPDSOutputDevices mOutputDevice; + eQMIPDSNMEAReportingOptions mNMEAReporting; +}; + +// Structure to describe response TLV 0x10 for PDSGetNMEAConfig() +struct sPDSGetNMEAConfigResponse_AdditionalConfig +{ + bool mPQXFI:1; + bool mPSTIS:1; + + // Padding out 14 bits + UINT8 mReserved1:6; + UINT8 mReserved2; +}; + +// Structure to describe request TLV 0x01 for PDSSetNMEAConfig() +struct sPDSSetNMEAConfigRequest_Config +{ + bool mGPGGANMEASentences:1; + bool mGPRMCNMEASentences:1; + bool mGPGSVNMEASentences:1; + bool mGPGSANMEASentences:1; + bool mGPVTGNMEASentences:1; + bool mGLGSVNMEASentences:1; + bool mGNGSANMEASentences:1; + bool mGNGNSNMEASentences:1; + eQMIPDSOutputDevices mOutputDevice; + eQMIPDSNMEAReportingOptions mNMEAReporting; +}; + +// Structure to describe request TLV 0x10 for PDSSetNMEAConfig() +struct sPDSSetNMEAConfigRequest_AdditionalConfig +{ + bool mPQXFI:1; + bool mPSTIS:1; + + // Padding out 14 bits + UINT8 mReserved1:6; + UINT8 mReserved2; +}; + +// Structure to describe request TLV 0x01 for PDSInjectTimeReference() +struct sPDSInjectTimeReferenceRequest_Time +{ + UINT64 mSystemTimeMilliseconds; + UINT16 mSystemDiscontinuties; +}; + +// Structure to describe response TLV 0x01 for PDSGetDefaults() +struct sPDSGetDefaultsResponse_Defaults +{ + eQMIPDSOperationTypes mSessionOperation; + UINT8 mTimeoutSeconds; + UINT32 mFixRequestIntervalSeconds; + UINT32 mDesiredAccuracyMeters; +}; + +// Structure to describe request TLV 0x01 for PDSSetDefaults() +struct sPDSSetDefaultsRequest_Defaults +{ + eQMIPDSOperationTypes mSessionOperation; + UINT8 mTimeoutSeconds; + UINT32 mFixRequestIntervalSeconds; + UINT32 mDesiredAccuracyMeters; +}; + +// Structure to describe response TLV 0x10 for PDSGetXTRAParameters() +struct sPDSGetXTRAParametersResponse_Automatic +{ + INT8 mAutomaticDownloadEnabled; + UINT16 mDownloadIntervalInHours; +}; + +// Structure to describe response TLV 0x11 for PDSGetXTRAParameters() +struct sPDSGetXTRAParametersResponse_Medium +{ + UINT8 mMediumPreferences; + + // This array must be the size specified by mMediumPreferences + // eQMIPDSMediums mMediumPreference[1]; +}; + +// Structure to describe response TLV 0x12 for PDSGetXTRAParameters() +struct sPDSGetXTRAParametersResponse_Network +{ + eQMIPDSWWANNetworkPreferences mWWANNetworkPreference; +}; + +// Structure to describe response TLV 0x13 for PDSGetXTRAParameters() +struct sPDSGetXTRAParametersResponse_Validity +{ + UINT16 mValidPeriodGPSStartWeek; + UINT16 mValidPeriodGPSStartWeekOffsetInMinutes; + UINT16 mValidPeriodDurationInHours; +}; + +// Structure to describe response TLV 0x14 for PDSGetXTRAParameters() +struct sPDSGetXTRAParametersResponse_Embedded +{ + INT8 mEmbeddedXTRADataClientEnabled; + INT8 mEmbeddedXTRATimeClientEnabled; +}; + +// Structure to describe request TLV 0x10 for PDSSetXTRAParameters() +struct sPDSSetXTRAParametersRequest_Automatic +{ + INT8 mAutomaticDownloadEnabled; + UINT16 mDownloadIntervalInHours; +}; + +// Structure to describe request TLV 0x11 for PDSSetXTRAParameters() +struct sPDSSetXTRAParametersRequest_Medium +{ + UINT8 mMediumPreferences; + + // This array must be the size specified by mMediumPreferences + // eQMIPDSMediums mMediumPreference[1]; +}; + +// Structure to describe request TLV 0x12 for PDSSetXTRAParameters() +struct sPDSSetXTRAParametersRequest_Network +{ + eQMIPDSWWANNetworkPreferences mWWANNetworkPreference; +}; + +// Structure to describe request TLV 0x14 for PDSSetXTRAParameters() +struct sPDSSetXTRAParametersRequest_Embedded +{ + INT8 mEmbeddedXTRADataClientEnabled; + INT8 mEmbeddedXTRATimeClientEnabled; +}; + +// Structure to describe request TLV 0x12 for PDSGetAGPSConfig() +struct sPDSGetAGPSConfigRequest_NetworkMode +{ + eQMIPDSNetworkMode mNetworkMode; +}; + +// Structure to describe response TLV 0x10 for PDSGetAGPSConfig() +struct sPDSGetAGPSConfigResponse_ServerAddress +{ + UINT8 mServerAddress[4]; + UINT32 mServerPort; +}; + +// Structure to describe response TLV 0x11 for PDSGetAGPSConfig() +struct sPDSGetAGPSConfigResponse_ServerURL +{ + UINT8 mURLLength; + + // This array must be the size specified by mURLLength + // char mURL[1]; +}; + +// Structure to describe request TLV 0x10 for PDSSetAGPSConfig() +struct sPDSSetAGPSConfigRequest_Server +{ + UINT8 mServerAddress[4]; + UINT32 mServerPort; +}; + +// Structure to describe request TLV 0x11 for PDSSetAGPSConfig() +struct sPDSSetAGPSConfigRequest_ServerURL +{ + UINT8 mURLLength; + + // This array must be the size specified by mURLLength + // char mURL[1]; +}; + +// Structure to describe request TLV 0x12 for PDSSetAGPSConfig() +struct sPDSSetAGPSConfigRequest_NetworkMode +{ + eQMIPDSNetworkMode mNetworkMode; +}; + +// Structure to describe response TLV 0x01 for PDSGetServiceAutoTrackingState() +struct sPDSGetServiceAutoTrackingStateResponse_State +{ + INT8 mAutoTrackingEnabled; +}; + +// Structure to describe request TLV 0x01 for PDSSetServiceAutoTrackingState() +struct sPDSSetServiceAutoTrackingStateRequest_State +{ + INT8 mAutoTrackingEnabled; +}; + +// Structure to describe response TLV 0x01 for PDSGetCOMPortAutoTrackingConfig() +struct sPDSGetCOMPortAutoTrackingConfigResponse_Config +{ + INT8 mAutoTrackingEnabled; +}; + +// Structure to describe request TLV 0x01 for PDSSetCOMPortAutoTrackingConfig() +struct sPDSSetCOMPortAutoTrackingConfigRequest_Config +{ + INT8 mAutoTrackingEnabled; +}; + +// Structure to describe request TLV 0x10 for PDSResetPDSData() +struct sPDSResetPDSDataRequest_GPSData +{ + bool mResetEPH:1; + bool mResetALM:1; + bool mResetPOS:1; + bool mResetTIME:1; + bool mResetIONO:1; + bool mResetUTC:1; + bool mResetHEALTH:1; + bool mResetSVDIR:1; + bool mResetSVSTEER:1; + bool mResetSADATA:1; + bool mResetRTI:1; + bool mResetALMCORR:1; + bool mResetFREQBIASEST:1; + + // Padding out 19 bits + UINT8 mReserved1:3; + UINT8 mReserved2[2]; +}; + +// Structure to describe request TLV 0x11 for PDSResetPDSData() +struct sPDSResetPDSDataRequest_CellData +{ + bool mResetPOS:1; + bool mResetLATESTGPSPOS:1; + bool mResetOTAPOS:1; + bool mResetEXTREFPOS:1; + bool mResetTIMETAG:1; + bool mResetCELLID:1; + bool mResetCACHEDCELLID:1; + bool mResetLASTSRVCELL:1; + bool mResetCURSRVCELL:1; + bool mResetNEIGHBORINFO:1; + + // Padding out 22 bits + UINT8 mReserved1:6; + UINT8 mReserved2[2]; +}; + +// Structure to describe request TLV 0x10 for PDSSinglePositionFix() +struct sPDSSinglePositionFixRequest_Mode +{ + eQMIPDSOperationTypes mSessionOperation; +}; + +// Structure to describe request TLV 0x11 for PDSSinglePositionFix() +struct sPDSSinglePositionFixRequest_Timeout +{ + UINT8 mTimeoutSeconds; +}; + +// Structure to describe request TLV 0x12 for PDSSinglePositionFix() +struct sPDSSinglePositionFixRequest_Accuracy +{ + UINT32 mDesiredAccuracyMeters; +}; + +// Structure to describe response TLV 0x01 for PDSGetServiceVersion() +struct sPDSGetServiceVersionResponse_Version +{ + UINT8 mServiceMajorVersion; + UINT8 mServiceMinorVersion; +}; + +// Structure to describe request TLV 0x01 for PDSInjectXTRAData() +struct sPDSInjectXTRADataRequest_Data +{ + UINT8 mSequenceNumber; + UINT16 mTotalLength; + UINT16 mSequenceLength; + + // This array must be the size specified by mSequenceLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x10 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_Timestamp +{ + UINT64 mUTCTimestamp; +}; + +// Structure to describe request TLV 0x11 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_Latitude +{ + double mLatitude; +}; + +// Structure to describe request TLV 0x12 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_Longitude +{ + double mLongitude; +}; + +// Structure to describe request TLV 0x13 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_AltitudeEllipsoid +{ + float mEllipsoidAltitude; +}; + +// Structure to describe request TLV 0x14 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_AltitudeSeaLevel +{ + float mMeanSeaLevelAltitude; +}; + +// Structure to describe request TLV 0x15 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_HorizontalUncertainty +{ + float mHorizontalUncertaintyCircular; +}; + +// Structure to describe request TLV 0x16 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_VerticalUncertainty +{ + float mVerticalUncertainty; +}; + +// Structure to describe request TLV 0x17 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_HorizontalConfidence +{ + UINT8 mHorizontalConfidence; +}; + +// Structure to describe request TLV 0x18 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_VerticalConfidence +{ + UINT8 mVerticalConfidence; +}; + +// Structure to describe request TLV 0x19 for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_Source +{ + eQMIPDSInjectedPositionSources mSource; +}; + +// Structure to describe request TLV 0x1A for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_TimeType +{ + eQMIPDSTimeType mTimeType; +}; + +// Structure to describe request TLV 0x1B for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_PositionReliability +{ + eQMIPDSReliabilityIndicator mReliabilityIndicatorHorizontal; + eQMIPDSReliabilityIndicator mReliabilityIndicatorVertical; +}; + +// Structure to describe request TLV 0x1C for PDSInjectPositionData() +struct sPDSInjectPositionDataRequest_AltitudeInformation +{ + eQMIPDSAltitudeSource mAltitudeSource; + eQMIPDSSourceLinkage mSourceLinkage; + eQMIPDSUncertaintyCoverage mUncertaintyCoverage; +}; + +// Structure to describe request TLV 0x10 for PDSInjectWiFiPositionData() +struct sPDSInjectWiFiPositionDataRequest_Time +{ + UINT32 mWiFiTimeCounterMilliseconds; +}; + +// Structure to describe request TLV 0x11 for PDSInjectWiFiPositionData() +struct sPDSInjectWiFiPositionDataRequest_Position +{ + INT32 mWiFiLatitude; + INT32 mWiFiLongitude; + UINT16 mHEPEInMeters; + UINT8 mAPCount; + UINT8 mErrorCode; +}; + +// Structure to describe request TLV 0x12 for PDSInjectWiFiPositionData() +struct sPDSInjectWiFiPositionDataRequest_APInfo +{ + UINT8 mAPCount; + + struct sAP + { + UINT8 mMACAddress[6]; + UINT32 mRSSI; + UINT16 mBeaconChannel; + bool mUsedForPosition:1; + bool mHiddenSSID:1; + bool mEncryptionOn:1; + bool mInfrastructureMode:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + }; + + // This array must be the size specified by mAPCount + // sAP mAPs[1]; +}; + +// Structure to describe request TLV 0x13 for PDSInjectWiFiPositionData() +struct sPDSInjectWiFiPositionDataRequest_PositionReliability +{ + eQMIPDSReliabilityIndicator mReliabilityIndicatorHorizontal; +}; + +// Structure to describe response TLV 0x10 for PDSGetSBASConfig() +struct sPDSGetSBASConfigResponse_Config +{ + eQMIPDSSBASStates mState; +}; + +// Structure to describe request TLV 0x10 for PDSSetSBASConfig() +struct sPDSSetSBASConfigRequest_Config +{ + INT8 mEnableSBAS; +}; + +// Structure to describe request TLV 0x01 for PDSSendNetworkInitiatedResponse() +struct sPDSSendNetworkInitiatedResponseRequest_Action +{ + INT8 mAllowRequest; +}; + +// Structure to describe request TLV 0x10 for PDSSendNetworkInitiatedResponse() +struct sPDSSendNetworkInitiatedResponseRequest_VX +{ + bool mPrivacyValid:1; + bool mQoSValid:1; + bool mCountValid:1; + bool mIntervalValid:1; + bool mModeValid:1; + bool mRequestorIDValid:1; + + // Padding out 26 bits + UINT8 mReserved1:2; + UINT8 mReserved2[3]; + + eQMIPDSPrivacyModes mPrivacy; + UINT8 mQoS; + UINT32 mPositionCount; + UINT32 mIntervalBetweenFixesSeconds; + eQMIPDSVXModes mMode; + eQMIPDSVXDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +// Structure to describe request TLV 0x11 for PDSSendNetworkInitiatedResponse() +struct sPDSSendNetworkInitiatedResponseRequest_SUPL1 +{ + bool mPrivacyValid:1; + bool mINITHashValid:1; + bool mModeValid:1; + bool mSLPSessionIDValid:1; + bool mSLPServerIPv4AddressValid:1; + bool mSLPServerIPv6AddressValid:1; + bool mSLPServerURLAddressValid:1; + bool mDCSValid:1; + bool mRequestorIDValid:1; + bool mClientNameValid:1; + bool mQoPHorizontalAccuracyValid:1; + bool mQoPVerticalAccuracyValid:1; + bool mQoPMaxLocationAgeValid:1; + bool mQoPDelayValid:1; + + // Padding out 18 bits + UINT8 mReserved1:2; + UINT8 mReserved2[2]; + + eQMIPDSPrivacyModes mPrivacy; + UINT64 mINITHash; + eQMIPDSSUPLModes mMode; + UINT32 mSLPSessionID; + UINT32 mSLPServerIPv4Port; + UINT8 mSLPServerIPv4Address[4]; + UINT32 mSLPServerIPv6Port; + UINT8 mSLPServerIPv6Address[16]; + UINT8 mSLPServerURLLength; + + // This array must be the size specified by mSLPServerURLLength + // char mSLPServerURLAddress[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_SUPL2 +{ + eQMIPDSSUPLDataCodingSchemes mRequestDCS; + eQMIPDSSUPLIDNameDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_SUPL3 +{ + eQMIPDSSUPLIDNameDataCodingSchemes mClientNameDCS; + UINT8 mClientNameLength; + + // This array must be the size specified by mClientNameLength + // UINT8 mClientName[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_SUPL4 +{ + UINT8 mQoPHorizontalAccuracy; + UINT8 mQoPVerticalAccuracy; + UINT8 mQoPMaxLocationAge; + UINT8 mQoPDelay; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_SUPL +{ + sPDSSendNetworkInitiatedResponseRequest_SUPL1 mPDSSendNetworkInitiatedResponseRequest_SUPL1; + sPDSSendNetworkInitiatedResponseRequest_SUPL2 mPDSSendNetworkInitiatedResponseRequest_SUPL2; + sPDSSendNetworkInitiatedResponseRequest_SUPL3 mPDSSendNetworkInitiatedResponseRequest_SUPL3; + sPDSSendNetworkInitiatedResponseRequest_SUPL4 mPDSSendNetworkInitiatedResponseRequest_SUPL4; +}; + +// Structure to describe request TLV 0x12 for PDSSendNetworkInitiatedResponse() +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP1 +{ + bool mPrivacyValid:1; + bool mInvokeIDValid:1; + bool mNotificationTextValid:1; + bool mClientAddressValid:1; + bool mLocationTypeValid:1; + bool mRequestorIDValid:1; + bool mCodewordStringValid:1; + bool mServiceTypeIDValid:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; + + eQMIPDSPrivacyModes mPrivacy; + UINT8 mInvokeID; + eQMIPDSUMTSCPDataCodingSchemes mNotificationTextDCS; + UINT8 mNotificationTextLength; + + // This array must be the size specified by mNotificationTextLength + // UINT8 mNotificationText[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP2 +{ + UINT8 mClientAddressLength; + + // This array must be the size specified by mClientAddressLength + // char mClientAddress[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP3 +{ + eQMIPDSUMTSCPLocationTypes mLocationType; + eQMIPDSUMTSCPDataCodingSchemes mRequestorIDDCS; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP4 +{ + eQMIPDSUMTSCPDataCodingSchemes mCodewordDCS; + UINT8 mCodewordLength; + + // This array must be the size specified by mCodewordLength + // UINT8 mCodeword[1]; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP5 +{ + UINT8 mServiceTypeID; +}; + +struct sPDSSendNetworkInitiatedResponseRequest_UMTSCP +{ + sPDSSendNetworkInitiatedResponseRequest_UMTSCP1 mPDSSendNetworkInitiatedResponseRequest_UMTSCP1; + sPDSSendNetworkInitiatedResponseRequest_UMTSCP2 mPDSSendNetworkInitiatedResponseRequest_UMTSCP2; + sPDSSendNetworkInitiatedResponseRequest_UMTSCP3 mPDSSendNetworkInitiatedResponseRequest_UMTSCP3; + sPDSSendNetworkInitiatedResponseRequest_UMTSCP4 mPDSSendNetworkInitiatedResponseRequest_UMTSCP4; + sPDSSendNetworkInitiatedResponseRequest_UMTSCP5 mPDSSendNetworkInitiatedResponseRequest_UMTSCP5; +}; + +// Structure to describe request TLV 0x01 for PDSInjectAbsoluteTime() +struct sPDSInjectAbsoluteTimeRequest_Time +{ + UINT64 mTimestampMilliseconds; + UINT32 mTimeUncertaintyMilliseconds; + eQMIPDSTimeBases mTimeBase; + INT8 mForceAcceptance; +}; + +// Structure to describe request TLV 0x01 for PDSInjectEFSData() +struct sPDSInjectEFSDataRequest_DateFile1 +{ + UINT8 mFilenameLength; + + // This array must be the size specified by mFilenameLength + // char mFilename[1]; +}; + +struct sPDSInjectEFSDataRequest_DateFile2 +{ + eQMIPDSEFSFileOperations mFileOperation; + UINT32 mDataLength; + UINT8 mPartNumber; + UINT8 mTotalParts; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +struct sPDSInjectEFSDataRequest_DateFile +{ + sPDSInjectEFSDataRequest_DateFile1 mPDSInjectEFSDataRequest_DateFile1; + sPDSInjectEFSDataRequest_DateFile2 mPDSInjectEFSDataRequest_DateFile2; +}; + +// Structure to describe response TLV 0x10 for PDSGetDPOConfig() +struct sPDSGetDPOConfigResponse_Config +{ + INT8 mDataPowerOptimizationEnabled; +}; + +// Structure to describe request TLV 0x10 for PDSSetDPOConfig() +struct sPDSSetDPOConfigRequest_Config +{ + eQMIPDSConfig mConfiguration; +}; + +// Structure to describe response TLV 0x10 for PDSGetODPConfig() +struct sPDSGetODPConfigResponse_Config +{ + eQMIPDSODPStates mOnDemandPositioning; +}; + +// Structure to describe request TLV 0x10 for PDSSetODPConfig() +struct sPDSSetODPConfigRequest_Config +{ + eQMIPDSODPStates mOnDemandPositioning; +}; + +// Structure to describe response TLV 0x10 for PDSGetGPSState() +struct sPDSGetGPSStateResponse_State +{ + INT8 mEngineEnabled; + bool mPositionValid:1; + bool mAltitudeVerticalUncertaintyValid:1; + bool mTimeMillisecondsValid:1; + bool mTimeWeekNumberValid:1; + bool mTimeUncertaintyValid:1; + bool mIonoValid:1; + bool mGPSEphemerisValid:1; + bool mGPSAlmanacValid:1; + bool mGPSHealthValid:1; + bool mGPSVisibleSVsValid:1; + bool mGlonassEphemerisValid:1; + bool mGlonassAlmanacValid:1; + bool mGlonassHealthValid:1; + bool mGlonassVisibleSVsValid:1; + bool mSBASEphemerisValid:1; + bool mSBASAlmanacValid:1; + bool mSBASHealthValid:1; + bool mSBASVisibleSVsValid:1; + bool mXTRAInformationValid:1; + + // Padding out 5 bits + UINT8 mReserved1:5; + + double mLatitude; + double mLongitude; + float mHorizontalUncertaintyCircular; + float mEllipsoidAltitude; + float mVerticalUncertainty; + UINT32 mTimestampInTOWMilliseconds; + UINT16 mGPSWeekNumber; + UINT32 mTimeUncertaintyMilliseconds; + INT8 mIonoIsValid; + UINT32 mGPSEphemerisSVMask; + UINT32 mGPSAlmanacSVMask; + UINT32 mGPSHealthSVMask; + UINT32 mGPSVisibleSVMask; + UINT32 mGlonassEphemerisSVMask; + UINT32 mGlonassAlmanacSVMask; + UINT32 mGlonassHealthSVMask; + UINT32 mGlonassVisibleSVMask; + UINT32 mSBASEphemerisSVMask; + UINT32 mSBASAlmanacSVMask; + UINT32 mSBASHealthSVMask; + UINT32 mSBASVisibleSVMask; + UINT16 mXTRAGPSStartWeek; + UINT16 mXTRAGPSStartMinutes; + INT32 mElevation; +}; + +// Structure to describe request TLV 0x01 for PDSSetPPMEventReport() +struct sPDSSetPPMEventReportRequest_ReportPPMEvents +{ + INT8 mReportPPMEvents; +}; + +// Structure to describe request TLV 0x01 for PDSSetSPIStreamingReport() +struct sPDSSetSPIStreamingReportRequest_ReportEvents +{ + INT8 mReportSPIEvents; +}; + +// Structure to describe indication TLV 0x10 for PDS SetSPIStreamingReportIndication +struct sPDSSetSPIStreamingReportIndication_SPIStreamingRequest +{ + INT8 mStreamSPIStatus; +}; + +// Structure to describe request TLV 0x01 for PDSSetSPIStatus() +struct sPDSSetSPIStatusRequest_Status +{ + eQMIPDSSPIState mSPIState; + UINT8 mSPIConfidence; +}; + +// Structure to describe request TLV 0x01 for PDSSetPPMReportingState() +struct sPDSSetPPMReportingStateRequest_PPMReportingState +{ + eQMIPDSReportingState mReportingState; + UINT16 mReportingPeriodSeconds; +}; + +// Structure to describe indication TLV 0x10 for PDS SetPPMReportingStateIndication +struct sPDSSetPPMReportingStateIndication_PPMPageReport +{ + UINT32 mPageTimeMilliseconds; + UINT16 mPagePNOffset; + UINT8 mPageBandClass; + UINT16 mPageCDMAFrequency; + UINT16 mPageBaseID; + UINT16 mPageSystemID; + UINT16 mPageNetworkID; +}; + +// Structure to describe indication TLV 0x11 for PDS SetPPMReportingStateIndication +struct sPDSSetPPMReportingStateIndication_PPMMeasurementReport +{ + UINT32 mReferenceTimeMilliseconds; + UINT8 mReferenceBandClass; + UINT16 mReferenceCDMAFrequency; + UINT8 mReferenceTotalRXPower; + UINT16 mReferencePNOffset; + UINT8 mReferenceStrength; + UINT8 mReferenceRMSErrorPhase; + UINT8 mNumberOfPilots; + + struct sPilot + { + UINT16 mPilotPNOffset; + UINT8 mPilotStrength; + UINT8 mPilotRMSErrorPhase; + INT16 mPilotPhase; + }; + + // This array must be the size specified by mNumberOfPilots + // sPilot mPilots[1]; +}; + +// Structure to describe indication TLV 0x12 for PDS SetPPMReportingStateIndication +struct sPDSSetPPMReportingStateIndication_PPMSuspendReason +{ + eQMIPDSSuspendReason mSuspendReason; +}; + +// Structure to describe indication TLV 0x13 for PDS SetPPMReportingStateIndication +struct sPDSSetPPMReportingStateIndication_PPMStopReason +{ + eQMIPDSStopReason mStopReason; +}; + +// Structure to describe request TLV 0x01 for PDSForceReceiverOff() +struct sPDSForceReceiverOffRequest_ForceReceiverOff +{ + eQMIPDSForceReceiverOff mForceReceiverOff; +}; + +// Structure to describe response TLV 0x10 for PDSGetPositionMethodsState() +struct sPDSGetPositionMethodsStateResponse_XTRATime +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe response TLV 0x11 for PDSGetPositionMethodsState() +struct sPDSGetPositionMethodsStateResponse_XTRAData +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe response TLV 0x12 for PDSGetPositionMethodsState() +struct sPDSGetPositionMethodsStateResponse_WiFi +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe request TLV 0x10 for PDSSetPositionMethodsState() +struct sPDSSetPositionMethodsStateRequest_XTRATime +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe request TLV 0x11 for PDSSetPositionMethodsState() +struct sPDSSetPositionMethodsStateRequest_XTRAData +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe request TLV 0x12 for PDSSetPositionMethodsState() +struct sPDSSetPositionMethodsStateRequest_WiFi +{ + eQMIPDSMethodStates mMethodState; +}; + +// Structure to describe request TLV 0x10 for PDSInjectSensorData() +struct sPDSInjectSensorDataRequest_3AxisAccelerometerData +{ + UINT32 mSensorTimeOfFirstSampleMilliseconds; + bool mSignReversalRequired:1; + + // Padding out 7 bits + UINT8 mReserved1:7; + + UINT8 mNumberOfSamples; + + struct sSample + { + UINT16 mSampleTimeOffsetMilliseconds; + float mXAxisSample; + float mYAxisSample; + float mZAxisSample; + }; + + // This array must be the size specified by mNumberOfSamples + // sSample mSamples[1]; +}; + +// Structure to describe request TLV 0x11 for PDSInjectSensorData() +struct sPDSInjectSensorDataRequest_3AxisGyroData +{ + UINT32 mSensorTimeOfFirstSampleMilliseconds; + bool mSignReversalRequired:1; + + // Padding out 7 bits + UINT8 mReserved1:7; + + UINT8 mNumberOfSamples; + + struct sSample + { + UINT16 mSampleTimeOffsetMilliseconds; + float mXAxisSample; + float mYAxisSample; + float mZAxisSample; + }; + + // This array must be the size specified by mNumberOfSamples + // sSample mSamples[1]; +}; + +// Structure to describe response TLV 0x10 for PDSInjectSensorData() +struct sPDSInjectSensorDataResponse_AccelerometerSampleSetCount +{ + UINT8 mAccelerometerSampleSetCount; +}; + +// Structure to describe response TLV 0x11 for PDSInjectSensorData() +struct sPDSInjectSensorDataResponse_GyroSampleSetCount +{ + UINT8 mGyroSampleSetCount; +}; + +// Structure to describe request TLV 0x01 for PDSInjectTimeSyncData() +struct sPDSInjectTimeSyncDataRequest_TimeTag +{ + UINT32 mReferenceCounter; + UINT32 mSensorProcessorRXTimeMilliseconds; + UINT32 mSensorProcessorTXTimeMilliseconds; +}; + +// Structure to describe response TLV 0x10 for PDSGetSensorConfig() +struct sPDSGetSensorConfigResponse_CradleMountState +{ + eQMIPDSCradleMountState mCradleMountState; + UINT8 mCradleMountStateConfidence; +}; + +// Structure to describe response TLV 0x11 for PDSGetSensorConfig() +struct sPDSGetSensorConfigResponse_ExternalPowerSupplyState +{ + eQMIPDSExternalPowerState mExternalPowerSupplyState; +}; + +// Structure to describe request TLV 0x10 for PDSSetSensorConfig() +struct sPDSSetSensorConfigRequest_CradleMountState +{ + eQMIPDSCradleMountState mCradleMountState; + UINT8 mCradleMountStateConfidence; +}; + +// Structure to describe request TLV 0x11 for PDSSetSensorConfig() +struct sPDSSetSensorConfigRequest_ExternalPowerState +{ + eQMIPDSExternalPowerState mExternalPowerSupplyState; +}; + +// Structure to describe response TLV 0x10 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_GyroDataVariance +{ + float mGyroDataVariance; +}; + +// Structure to describe response TLV 0x11 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_GyroBiasRandomWalk +{ + float mGyroBiasRandomWalk; +}; + +// Structure to describe response TLV 0x12 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_VirtualGyroGravityAveragingLength +{ + UINT32 mVirtualGyroGravityAveragingLengthMilliseconds; +}; + +// Structure to describe response TLV 0x13 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_HeadingFilterMode +{ + INT8 mHeadingFilterMode; +}; + +// Structure to describe response TLV 0x14 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_VelocityConstraintVariance +{ + float mVelocityConstraintVariance; +}; + +// Structure to describe response TLV 0x15 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_PositioningMethod +{ + bool mSuppressInjectedPosition:1; + bool mReportUsingInstantaneousInformation:1; + bool mDisablePersistentMemoryStorage:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x16 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_VelocityRWSD +{ + float mVelocityRandomWalkSpectralDensity; +}; + +// Structure to describe response TLV 0x17 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_AccelerationRWSD +{ + float mAccelerationRandomWalkSpectralDensity; +}; + +// Structure to describe response TLV 0x18 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_AngleRWSD +{ + float mAngleRandomWalkSpectralDensity; +}; + +// Structure to describe response TLV 0x19 for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_RateRWSD +{ + float mRateRandomWalkSpectralDensity; +}; + +// Structure to describe response TLV 0x1A for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_SensorAlgorithmConfig +{ + bool mDisableINSPositioningFilter:1; + + // Padding out 31 bits + UINT8 mReserved1:7; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x1B for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_MaximumDeadReckoningTime +{ + UINT32 mMaximumDeadReckoningTimeSeconds; +}; + +// Structure to describe response TLV 0x1C for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_INSFilterLowThreshold +{ + UINT8 mINSFilterCrossCheckSigmaLowThreshold; +}; + +// Structure to describe response TLV 0x1D for PDSGetSensorNavigation() +struct sPDSGetSensorNavigationResponse_INSFilterHighThreshold +{ + UINT8 mINSFilterCrossCheckSigmaHighThreshold; +}; + +// Structure to describe request TLV 0x10 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_GyroDataVariance +{ + float mGyroDataVariance; +}; + +// Structure to describe request TLV 0x11 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_GyroBiasRandomWalk +{ + float mGyroBiasRandomWalk; +}; + +// Structure to describe request TLV 0x12 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_VirtualGyroCravityAveragingLength +{ + UINT32 mVirtualGyroGravityAveragingLengthMilliseconds; +}; + +// Structure to describe request TLV 0x13 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_HeadingFilterMode +{ + INT8 mHeadingFilterMode; +}; + +// Structure to describe request TLV 0x14 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_VelocityConstraintVariance +{ + float mVelocityConstraintVariance; +}; + +// Structure to describe request TLV 0x15 for PDSSetNavigationConfig() +struct sPDSSetNavigationConfigRequest_PositioningMethod +{ + bool mSuppressInjectedPosition:1; + bool mReportUsingInstantaneousInformation:1; + bool mDisablePersistentMemoryStorage:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x16 for PDSSetSensorNavigation() +struct sPDSSetSensorNavigationRequest_VelocityRWSD +{ + float mVelocityRandomWalkSpectralDensity; +}; + +// Structure to describe request TLV 0x17 for PDSSetSensorNavigation() +struct sPDSSetSensorNavigationRequest_AccelerationRWSD +{ + float mAccelerationRandomWalkSpectralDensity; +}; + +// Structure to describe request TLV 0x18 for PDSSetSensorNavigation() +struct sPDSSetSensorNavigationRequest_AngleRWSD +{ + float mAngleRandomWalkSpectralDensity; +}; + +// Structure to describe request TLV 0x19 for PDSSetSensorNavigation() +struct sPDSSetSensorNavigationRequest_RateRWSD +{ + float mRateRandomWalkSpectralDensity; +}; + +// Structure to describe request TLV 0x1A for PDSSetSensorNavigation() +struct sPDSSetSensorNavigationRequest_SensorAlgorithmConfig +{ + bool mDisableINSPositioningFilter:1; + + // Padding out 31 bits + UINT8 mReserved1:7; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x1B for PDSSetSensorNavigation() +struct sPDSSetSensorNavigationRequest_MaximumDeadReckoningTime +{ + UINT32 mMaximumDeadReckoningTimeSeconds; +}; + +// Structure to describe request TLV 0x1C for PDSSetSensorNavigation() +struct sPDSSetSensorNavigationRequest_INSFilterLowThreshold +{ + UINT8 mINSFilterCrossCheckSigmaLowThreshold; +}; + +// Structure to describe request TLV 0x1D for PDSSetSensorNavigation() +struct sPDSSetSensorNavigationRequest_INSFilterHighThreshold +{ + UINT8 mINSFilterCrossCheckSigmaHighThreshold; +}; + +// Structure to describe request TLV 0x10 for PDSSetWLANBlanking() +struct sPDSSetWLANBlankingRequest_BlankingEnable +{ + eQMIPDSBlankingEnable mBlankingEnable; +}; + +// Structure to describe request TLV 0x11 for PDSSetWLANBlanking() +struct sPDSSetWLANBlankingRequest_ActiveChannels +{ + bool mChannel1:1; + bool mChannel2:1; + bool mChannel3:1; + bool mChannel4:1; + bool mChannel5:1; + bool mChannel6:1; + bool mChannel7:1; + bool mChannel8:1; + bool mChannel9:1; + bool mChannel10:1; + bool mChannel11:1; + bool mChannel12:1; + bool mChannel13:1; + bool mChannel14:1; + + // Padding out 18 bits + UINT8 mReserved1:2; + UINT8 mReserved2[2]; +}; + +// Structure to describe request TLV 0x12 for PDSSetWLANBlanking() +struct sPDSSetWLANBlankingRequest_BluetoothJamming +{ + INT8 mBluetoothJammingActive; +}; + +// Structure to describe request TLV 0x13 for PDSSetWLANBlanking() +struct sPDSSetWLANBlankingRequest_IMDJamming +{ + eQMIPDSIMDJammingStates mSimulateIMDJamming; +}; + +// Structure to describe request TLV 0x14 for PDSSetWLANBlanking() +struct sPDSSetWLANBlankingRequest_JammingBands +{ + eQMIPDSIMDJammingBands mBandstoJam; +}; + +// Structure to describe request TLV 0x10 for PDSSetSecurityChallengeReport() +struct sPDSSetSecurityChallengeReportRequest_EnableSecurity +{ + eQMIPDSReportSecurityChallenge mReportSecurityChallenge; +}; + +// Structure to describe indication TLV 0x10 for PDS SetSecurityChallengeReportIndication +struct sPDSSetSecurityChallengeReportIndication_EnableSecurity +{ + eQMIPDSEncryptionAlgorithm mEncryptionAlgorithm; + UINT8 mEncryptionDataID; + UINT8 mEncryptionDataLength; + + // This array must be the size specified by mEncryptionDataLength + // UINT8 mEncryptionData[1]; +}; + +// Structure to describe request TLV 0x10 for PDSSetSecurityChallenge() +struct sPDSSetSecurityChallengeRequest_SecureHashAlgorithm +{ + UINT8 mEncryptionDataID; + UINT8 mEncryptionDataLength; + + // This array must be the size specified by mEncryptionDataLength + // UINT8 mEncryptionData[1]; +}; + +// Structure to describe response TLV 0x10 for PDSGetSecurityEncryptionConfig() +struct sPDSGetSecurityEncryptionConfigResponse_SecureClientTimestamp +{ + eQMIPDSEncryptionAlgorithm mEncryptionAlgorithm; + UINT64 mEncryptionTimestampMilliseconds; + UINT8 mEncryptionDataLength; + + // This array must be the size specified by mEncryptionDataLength + // UINT8 mEncryptionData[1]; +}; + +// Structure to describe request TLV 0x10 for PDSSetSecurityUpdateRate() +struct sPDSSetSecurityUpdateRateRequest_EnableSecurity +{ + UINT8 mUpdateRate; +}; + +// Structure to describe request TLV 0x10 for PDSSetCellDatabaseControl() +struct sPDSSetCellDatabaseControlRequest_Control +{ + bool mPositionInfoStorage:1; + bool mTimeInfoStorage:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x01 for PDSInjectMotionData() +struct sPDSInjectMotionDataRequest_MotionData +{ + eQMIPDSMotionStates mMotionState; + eQMIPDSMotionModes mMotionMode; + eQMIPDSMotionSubmodes mMotionSubmode; + float mStateProbability; + UINT16 mMotionDataAgeMilliseconds; + UINT16 mMotionDataTimoutMilliseconds; +}; + +// Structure to describe request TLV 0x01 for PDSSetGNSSEngineErrorRecoveryReport() +struct sPDSSetGNSSEngineErrorRecoveryReportRequest_Indicator +{ + INT8 mReportGNSSEngineErrorRecovery; +}; + +// Structure to describe indication TLV 0x01 for PDS GNSSEngineErrorRecoveryReport +struct sPDSGNSSEngineErrorRecoveryReportIndication_Reason +{ + eQMIPDSResetReasons mResetReason; +}; + +// Structure to describe indication TLV 0x10 for PDS GNSSEngineErrorRecoveryReport +struct sPDSGNSSEngineErrorRecoveryReportIndication_CurrentSystemTime +{ + UINT16 mGPSWeekNumber; + UINT32 mGPSTimeOfWeekMilliseconds; +}; + +// Structure to describe indication TLV 0x11 for PDS GNSSEngineErrorRecoveryReport +struct sPDSGNSSEngineErrorRecoveryReportIndication_ScanParameters +{ + eQMIPDSSVSystems mSystem; + UINT8 mPRN; + UINT16 mCN0; + UINT16 mSubMillisecondDifferenceMicroseconds; + INT16 mDopplerDifferenceHz; +}; + +// Structure to describe indication TLV 0x12 for PDS GNSSEngineErrorRecoveryReport +struct sPDSGNSSEngineErrorRecoveryReportIndication_ClockParameters +{ + eQMIPDSSVSystems mSystem; + eQMIPDSTimeSource mCurrentTimeSource; + eQMIPDSTimeSource mInjectedTimeSource; + UINT32 mTimeDifferenceMilliseconds; + UINT32 mTimeUncertaintyMicroseconds; +}; + +// Structure to describe indication TLV 0x13 for PDS GNSSEngineErrorRecoveryReport +struct sPDSGNSSEngineErrorRecoveryReportIndication_SubframeParameters +{ + UINT8 mPRN; + INT32 mGPSDataDemodulationINProgress; + UINT16 mObservedCycleSlips; + UINT16 mParityErrors; + UINT32 mGPSSubframeWordWithTimingError; +}; + +// Structure to describe indication TLV 0x14 for PDS GNSSEngineErrorRecoveryReport +struct sPDSGNSSEngineErrorRecoveryReportIndication_TimeParameters +{ + eQMIPDSSVSystems mSystem; + UINT8 mPRN; + UINT16 mGPSWeekNumber; + UINT32 mGPSTimeOfWeekMilliseconds; + UINT16 mGNSSNumberOfDays; + UINT32 mGNSSMilliseconds; + UINT32 mClockDifferenceMilliseconds; +}; + +// Structure to describe indication TLV 0x15 for PDS GNSSEngineErrorRecoveryReport +struct sPDSGNSSEngineErrorRecoveryReportIndication_MeasurementParameters +{ + eQMIPDSSVSystems mSystem; + UINT16 mGPSWeekNumber; + UINT32 mGPSTimeOfWeekMilliseconds; + UINT8 mObservedMeasurementInconsistencies; + UINT16 mObservationDuration; +}; + +// Structure to describe indication TLV 0x16 for PDS GNSSEngineErrorRecoveryReport +struct sPDSGNSSEngineErrorRecoveryReportIndication_RFParameters +{ + UINT32 mQualitySignalStrength; + UINT32 mResetSignalStrength; +}; + +// Structure to describe request TLV 0x10 for PDSInjectTestData() +struct sPDSInjectTestDataRequest_TimeUncertainty +{ + UINT32 mTimeUncertaintyMicroseconds; +}; + +// Structure to describe request TLV 0x11 for PDSInjectTestData() +struct sPDSInjectTestDataRequest_PositionUncertainty +{ + UINT32 mPositionUncertaintyCentimeters; +}; + +// Structure to describe request TLV 0x12 for PDSInjectTestData() +struct sPDSInjectTestDataRequest_TimeOffset +{ + UINT64 mTimeOffsetMicroseconds; +}; + +// Structure to describe request TLV 0x13 for PDSInjectTestData() +struct sPDSInjectTestDataRequest_PositionOffset +{ + UINT32 mPositionOffsetMeters; +}; + +// Structure to describe request TLV 0x01 for PDSSetGNSSRFConfig() +struct sPDSSetGNSSRFConfigRequest_PeakAntennaGain +{ + INT16 mPeakAntennaGain; +}; + +// Structure to describe request TLV 0x10 for PDSSetGNSSRFConfig() +struct sPDSSetGNSSRFConfigRequest_GPSRFLoss +{ + UINT16 mRFLoss; +}; + +// Structure to describe request TLV 0x11 for PDSSetGNSSRFConfig() +struct sPDSSetGNSSRFConfigRequest_GlonassRFLoss +{ + UINT16 mRFLossFrequency0; + UINT16 mRFLossFrequencyMinus7; + UINT16 mRFLossFrequencyPlus6; +}; + +// Structure to describe request TLV 0x10 for AUTHStartEAPSession() +struct sAUTHStartEAPSessionRequest_MethodMask +{ + bool mEAPSIM:1; + bool mEAPAKA:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x01 for AUTHSendEAPPacket() +struct sAUTHSendEAPPacketRequest_RequestPacket +{ + UINT8 mEAPRequestPacket[9999]; +}; + +// Structure to describe response TLV 0x01 for AUTHSendEAPPacket() +struct sAUTHSendEAPPacketResponse_ResponsePacket +{ + UINT8 mResponsePacket[9999]; +}; + +// Structure to describe indication TLV 0x01 for AUTH EAPSessionResultIndication +struct sAUTHEAPSessionResultIndication_Result +{ + eQMIAUTHEAPResult mResult; +}; + +// Structure to describe response TLV 0x01 for AUTHGetEAPSessionKeys() +struct sAUTHGetEAPSessionKeysResponse_SessionKeys +{ + UINT8 mSessionKeys[9999]; +}; + +// Structure to describe request TLV 0x01 for AUTHRunAKA() +struct sAUTHRunAKARequest_Version +{ + eQMIAUTHAKAVersion mAKAVersion; +}; + +// Structure to describe request TLV 0x10 for AUTHRunAKA() +struct sAUTHRunAKARequest_Parameters1 +{ + UINT8 mRandomChallengeLength; + + // This array must be the size specified by mRandomChallengeLength + // UINT8 mRandomChallenge[1]; +}; + +struct sAUTHRunAKARequest_Parameters2 +{ + UINT8 mAuthenticationTokenLength; + + // This array must be the size specified by mAuthenticationTokenLength + // UINT8 mAuthenticationToken[1]; +}; + +struct sAUTHRunAKARequest_Parameters +{ + sAUTHRunAKARequest_Parameters1 mAUTHRunAKARequest_Parameters1; + sAUTHRunAKARequest_Parameters2 mAUTHRunAKARequest_Parameters2; +}; + +// Structure to describe response TLV 0x01 for AUTHRunAKA() +struct sAUTHRunAKAResponse_Handle +{ + UINT32 mHandle; +}; + +// Structure to describe indication TLV 0x01 for AUTH AKAResultIndication +struct sAUTHAKAResultIndication_Result +{ + UINT32 mHandle; + eQMIAUTHAKAResult mResult; +}; + +// Structure to describe request TLV 0x10 for VoiceIndicationRegistration() +struct sVoiceIndicationRegistrationRequest_DTMF +{ + INT8 mEnableEvents; +}; + +// Structure to describe request TLV 0x11 for VoiceIndicationRegistration() +struct sVoiceIndicationRegistrationRequest_VoicePrivacy +{ + INT8 mEnableEvents; +}; + +// Structure to describe request TLV 0x12 for VoiceIndicationRegistration() +struct sVoiceIndicationRegistrationRequest_SupplementaryService +{ + INT8 mEnableEvents; +}; + +// Structure to describe request TLV 0x01 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_CallingNumber +{ + // String is variable length, but must be size of the container + // char mCallingNumber[1]; +}; + +// Structure to describe request TLV 0x10 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_CallType +{ + eQMIVoiceCallTypes mCallType; +}; + +// Structure to describe request TLV 0x11 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_CLIR +{ + eQMIVoiceCLIRTypes mCLIRType; +}; + +// Structure to describe request TLV 0x12 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_UUS +{ + eQMIVoiceUUSTypes mUUSType; + eQMIVoiceUUSDataCodingSchemes mUUSDCS; + UINT8 mUUSLength; + + // This array must be the size specified by mUUSLength + // UINT8 mUUSData[1]; +}; + +// Structure to describe request TLV 0x13 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_CUG +{ + UINT16 mCUGIndex; + INT8 mSuppressPreferentialCUG; + INT8 mSuppressOASubscription; +}; + +// Structure to describe request TLV 0x14 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_EmergencyCategory +{ + bool mPolice:1; + bool mAmbulance:1; + bool mFireBrigade:1; + bool mMarineGuard:1; + bool mMountainRescue:1; + bool mManualCall:1; + bool mAutomaticCall:1; + bool mReserved:1; +}; + +// Structure to describe request TLV 0x15 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_CalledPartySubaddress +{ + eQMIVoiceSubaddressTypes mSubaddressType; + eQMIVoiceEvenOddIndicators mAddressSignals; + UINT8 mSubaddressLength; + + // This array must be the size specified by mSubaddressLength + // UINT8 mSubaddress[1]; +}; + +// Structure to describe request TLV 0x16 for VoiceCallOriginate() +struct sVoiceCallOriginateRequest_ServiceType +{ + eQMIVoiceServiceTypes mServiceType; +}; + +// Structure to describe response TLV 0x10 for VoiceCallOriginate() +struct sVoiceCallOriginateResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x11 for VoiceCallOriginate() +struct sVoiceCallOriginateResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceCallOriginate() +struct sVoiceCallOriginateResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x13 for VoiceCallOriginate() +struct sVoiceCallOriginateResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceCallEnd() +struct sVoiceCallEndRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x10 for VoiceCallEnd() +struct sVoiceCallEndResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x01 for VoiceCallAnswer() +struct sVoiceCallAnswerRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x10 for VoiceCallAnswer() +struct sVoiceCallAnswerResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x01 for VoiceGetCallInfo() +struct sVoiceGetCallInfoRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_CallInfo +{ + UINT8 mCallID; + eQMIVoiceCallStates mCallState; + eQMIVoiceCallTypes mCallType; + eQMIVoiceCallDirections mDirection; + eQMIVoiceCallModes mMode; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_RemotePartyNumber +{ + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_ServiceOption +{ + UINT16 mServiceOption; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_VoicePrivacy +{ + eQMIVoicePrivacyLevels mVoicePrivacy; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_OTASPStatus +{ + eQMIVoiceOTASPStati mOTASPStatus; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_RemotePartyName +{ + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mCodingScheme; + UINT8 mCallerNameLength; + + // This array must be the size specified by mCallerNameLength + // UINT8 mCallerName[1]; +}; + +// Structure to describe response TLV 0x16 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_UUS +{ + eQMIVoiceUUSTypes mUUSType; + eQMIVoiceUUSDataCodingSchemes mUUSDCS; + UINT8 mUUSLength; + + // This array must be the size specified by mUUSLength + // UINT8 mUUSData[1]; +}; + +// Structure to describe response TLV 0x17 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_AlertingType +{ + eQMIVoiceAlertingTypes mAlertingType; +}; + +// Structure to describe response TLV 0x18 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x19 for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_ConnectedNumberInfo +{ + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe response TLV 0x1A for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_DiagnosticInfo +{ + UINT8 mDiagnosticInfoLength; + + // This array must be the size specified by mDiagnosticInfoLength + // UINT8 mDiagnosticInfo[1]; +}; + +// Structure to describe response TLV 0x1B for VoiceGetCallInfo() +struct sVoiceGetCallInfoResponse_AlertingPattern +{ + eQMIVoiceAlertingPatterns mAlertingPattern; +}; + +// Structure to describe indication TLV 0x10 for Voice OTASPIndication +struct sVoiceOTASPIndication_OTASPStatus +{ + UINT8 mCallID; + eQMIVoiceOTASPStati mOTASPStatus; +}; + +// Structure to describe indication TLV 0x01 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe indication TLV 0x10 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_Signal +{ + UINT8 mSignalType; + UINT8 mAlertPitch; + UINT8 mSignal; +}; + +// Structure to describe indication TLV 0x11 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CallerID +{ + UINT8 mPresentationIndicator; + UINT8 mCallerIDLength; + + // This array must be the size specified by mCallerIDLength + // char mCallerID[1]; +}; + +// Structure to describe indication TLV 0x12 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_Display +{ + // String is variable length, but must be size of the container + // char mDisplayBuffer[1]; +}; + +// Structure to describe indication TLV 0x13 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_ExtendedDisplay +{ + UINT8 mExtendedDisplayBuffer[182]; +}; + +// Structure to describe indication TLV 0x14 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CallerName +{ + // String is variable length, but must be size of the container + // char mCallerName[1]; +}; + +// Structure to describe indication TLV 0x15 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CallWaiting +{ + INT8 mNewCallWaiting; +}; + +// Structure to describe indication TLV 0x16 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_ConnectedNumberInfo +{ + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe indication TLV 0x17 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CallingPartyNumberInfo +{ + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe indication TLV 0x18 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CalledPartyNumberInfo +{ + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe indication TLV 0x19 for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_RedirectingNumberInfo +{ + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mRedirectReason; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe indication TLV 0x1A for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_CLIRCause +{ + eQMIVoiceCLIRCauses mCLIRCause; +}; + +// Structure to describe indication TLV 0x1B for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_NSSAudio +{ + UINT8 mUpLink; + UINT8 mDownLink; +}; + +// Structure to describe indication TLV 0x1C for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_NSSRelease +{ + eQMIVoiceNSSReleases mNSSRelease; +}; + +// Structure to describe indication TLV 0x1D for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_LineControlInfo +{ + INT8 mPolarityIncluded; + INT8 mToggleMode; + INT8 mReversePolarity; + UINT8 mPowerDenialTime; +}; + +// Structure to describe indication TLV 0x1E for Voice InfoRecordIndication +struct sVoiceInfoRecordIndication_ExtendedDisplayInfo +{ + UINT8 mDisplayType; + UINT8 mExtendedDisplayInfoLength; + + // This array must be the size specified by mExtendedDisplayInfoLength + // UINT8 mExtendedDisplayInfo[1]; +}; + +// Structure to describe request TLV 0x01 for VoiceSendFlash() +struct sVoiceSendFlashRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x10 for VoiceSendFlash() +struct sVoiceSendFlashRequest_Payload +{ + // String is variable length, but must be size of the container + // char mFlashPayload[1]; +}; + +// Structure to describe request TLV 0x11 for VoiceSendFlash() +struct sVoiceSendFlashRequest_Type +{ + eQMIVoiceFlashTypes mFlashType; +}; + +// Structure to describe response TLV 0x10 for VoiceSendFlash() +struct sVoiceSendFlashResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x01 for VoiceBurstDTMF() +struct sVoiceBurstDTMFRequest_Info +{ + UINT8 mCallID; + UINT8 mDTMFBufferLength; + + // This array must be the size specified by mDTMFBufferLength + // char mDTMFBuffer[1]; +}; + +// Structure to describe request TLV 0x10 for VoiceBurstDTMF() +struct sVoiceBurstDTMFRequest_Lengths +{ + eQMIVoicePulseWidths mDTMFPulseWidth; + eQMIVoiceInterdigitIntervals mDTMFInterdigitInterval; +}; + +// Structure to describe request TLV 0x01 for VoiceStartContinuousDTMF() +struct sVoiceStartContinuousDTMFRequest_Info +{ + UINT8 mCallID; + char mDTMFDigit; +}; + +// Structure to describe response TLV 0x10 for VoiceStartContinuous() +struct sVoiceStartContinuousResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x01 for VoiceStopContinuousDTMF() +struct sVoiceStopContinuousDTMFRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x10 for VoiceStopContinuous() +struct sVoiceStopContinuousResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe indication TLV 0x01 for Voice DTMFIndication +struct sVoiceDTMFIndication_DTMFInfo +{ + UINT8 mCallID; + eQMIVoiceDTMFEvents mDTMFEvent; + UINT8 mDTMFBufferLength; + + // This array must be the size specified by mDTMFBufferLength + // char mDTMFBuffer[1]; +}; + +// Structure to describe indication TLV 0x10 for Voice DTMFIndication +struct sVoiceDTMFIndication_Lengths +{ + eQMIVoicePulseWidths mDTMFPulseWidth; + eQMIVoiceInterdigitIntervals mDTMFInterdigitInterval; +}; + +// Structure to describe request TLV 0x01 for VoiceSetPreferredPrivacy() +struct sVoiceSetPreferredPrivacyRequest_Preference +{ + eQMIVoiceDTMFPrivacyLevels mPrivacyLevel; +}; + +// Structure to describe indication TLV 0x01 for Voice PrivacyIndication +struct sVoicePrivacyIndication_DTMFInfo +{ + UINT8 mCallID; + eQMIVoiceDTMFPrivacyLevels mPrivacyLevel; +}; + +// Structure to describe indication TLV 0x01 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_CallInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceCallStates mCallState; + eQMIVoiceCallTypes mCallType; + eQMIVoiceCallDirections mDirection; + eQMIVoiceCallModes mMode; + INT8 mMultiparty; + eQMIVoiceALSLineIndicators mALSLineIndicator; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x10 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_RemotePartyNumber +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x11 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_RemotePartyName +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mCodingScheme; + UINT8 mCallerNameLength; + + // This array must be the size specified by mCallerNameLength + // UINT8 mCallerName[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x12 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_AlertingType +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceAlertingTypes mAlertingType; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x13 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_ServiceOption +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT16 mServiceOption; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x14 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_CallEndReason +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mCallEndReason; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x15 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_AlphaID +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x16 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_ConnectedNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x17 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_DiagnosticInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mDiagnosticInfoLength; + + // This array must be the size specified by mDiagnosticInfoLength + // UINT8 mDiagnosticInfo[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x18 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_CalledPartyNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x19 for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_RedirectingNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe indication TLV 0x1A for Voice AllCallStatusIndication +struct sVoiceAllCallStatusIndication_AlertingPattern +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceAlertingPatterns mAlertingPattern; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x10 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_CallInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceCallStates mCallState; + eQMIVoiceCallTypes mCallType; + eQMIVoiceCallDirections mDirection; + eQMIVoiceCallModes mMode; + INT8 mMultiparty; + eQMIVoiceALSLineIndicators mALSLineIndicator; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x11 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_RemotePartyNumber +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_RemotePartyName +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mCodingScheme; + UINT8 mCallerNameLength; + + // This array must be the size specified by mCallerNameLength + // UINT8 mCallerName[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_AlertingType +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceAlertingTypes mAlertingType; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x14 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_UUS +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceUUSTypes mUUSType; + eQMIVoiceUUSDataCodingSchemes mUUSDCS; + UINT8 mUUSLength; + + // This array must be the size specified by mUUSLength + // UINT8 mUUSData[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x15 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_ServiceOption +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT16 mServiceOption; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x16 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_OTASPStatus +{ + eQMIVoiceOTASPStati mOTASPStatus; +}; + +// Structure to describe response TLV 0x17 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_VoicePrivacy +{ + eQMIVoicePrivacyLevels mVoicePrivacy; +}; + +// Structure to describe response TLV 0x18 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_CallEndReason +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mCallEndReason; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x19 for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_AlphaID +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x1A for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_ConnectedNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x1B for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_DiagnosticInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mDiagnosticInfoLength; + + // This array must be the size specified by mDiagnosticInfoLength + // UINT8 mDiagnosticInfo[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x1C for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_CalledPartyNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x1D for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_RedirectingNumberInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x1E for VoiceGetAllCallInfo() +struct sVoiceGetAllCallInfoResponse_AlertingPattern +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + UINT8 mCallID; + eQMIVoiceAlertingPatterns mAlertingPattern; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe request TLV 0x01 for VoiceManageCalls() +struct sVoiceManageCallsRequest_Info +{ + eQMIVoiceSupplementaryServiceCallTypes mSupplementaryServiceType; +}; + +// Structure to describe request TLV 0x10 for VoiceManageCalls() +struct sVoiceManageCallsRequest_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x10 for VoiceManageCalls() +struct sVoiceManageCallsResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe indication TLV 0x01 for Voice SupplementaryServiceIndication +struct sVoiceSupplementaryServiceIndication_Info +{ + UINT8 mCallID; + eQMIVoiceSupplementaryNotificationTypes mNotificationType; +}; + +// Structure to describe indication TLV 0x10 for Voice SupplementaryServiceIndication +struct sVoiceSupplementaryServiceIndication_CUG +{ + UINT16 mCUGIndex; +}; + +// Structure to describe indication TLV 0x11 for Voice SupplementaryServiceIndication +struct sVoiceSupplementaryServiceIndication_ECT +{ + eQMIVoiceECTCallStates mECTCallState; + eQMIVoicePresentationIndicators mPresentationIndicator; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe request TLV 0x01 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_Info +{ + eQMIVoiceSupplementaryServiceTypes mService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x10 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe request TLV 0x11 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_Password +{ + char mCallBarringPassword[4]; +}; + +// Structure to describe request TLV 0x12 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_Number +{ + // String is variable length, but must be size of the container + // char mCallForwardingNumber[1]; +}; + +// Structure to describe request TLV 0x13 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_Timer +{ + UINT8 mNoReplyTimerSeconds; +}; + +// Structure to describe request TLV 0x14 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceRequest_CallForwarding +{ + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; +}; + +// Structure to describe response TLV 0x10 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x11 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x13 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x14 for VoiceSetSupplementaryService() +struct sVoiceSetSupplementaryServiceResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x10 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingRequest_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingResponse_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCallWaitinge() +struct sVoiceGetCallWaitingeResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCallWaiting() +struct sVoiceGetCallWaitingResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceGetCallBarring() +struct sVoiceGetCallBarringRequest_Reason +{ + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x10 for VoiceGetCallBarring() +struct sVoiceGetCallBarringRequest_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCallBarring() +struct sVoiceGetCallBarringResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_Status +{ + INT8 mCLIPActive; + INT8 mCLIPProvisioned; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCLIP() +struct sVoiceGetCLIPResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_Status +{ + INT8 mCLIRActive; + eQMIVoiceProvisioningStates mCLIRProvisionStatus; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCLIR() +struct sVoiceGetCLIRResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingRequest_Reason +{ + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x10 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingRequest_ServiceClass +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_Info +{ + UINT8 mInstanceCount; + + struct sInstance1 + { + INT8 mServiceActive; + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + struct sInstance2 + { + UINT8 mNoReplyTimerSeconds; + }; + + struct sInstance + { + sInstance1 mInstance1; + sInstance2 mInstance2; + }; + + // This array must be the size specified by mInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe response TLV 0x16 for VoiceGetCallForwarding() +struct sVoiceGetCallForwardingResponse_ExtendedInfo +{ + UINT8 mCallInstanceCount; + + struct sInstance + { + INT8 mServiceActive; + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; + UINT8 mNoReplyTimerSeconds; + UINT8 mPresentationIndicator; + eQMIVoiceScreeningIndicators mScreeningIndicator; + eQMIVoiceNumberTypes mNumberType; + eQMIVoiceNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + // This array must be the size specified by mCallInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe request TLV 0x01 for VoiceSetCallBarringPassword() +struct sVoiceSetCallBarringPasswordRequest_Info +{ + eQMIVoiceSupplementaryServiceReasons mReason; + char mOldCallBarringPassword[4]; + char mNewCallBarringPassword[4]; + char mNewCallBarringPasswordRepeat[4]; +}; + +// Structure to describe response TLV 0x10 for VoiceSetCallBarring() +struct sVoiceSetCallBarringResponse_FailureCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x11 for VoiceSetCallBarring() +struct sVoiceSetCallBarringResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceSetCallBarring() +struct sVoiceSetCallBarringResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x13 for VoiceSetCallBarring() +struct sVoiceSetCallBarringResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x14 for VoiceSetCallBarring() +struct sVoiceSetCallBarringResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDRequest_Info +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe response TLV 0x10 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x11 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x12 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_Data +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceInitiateUSSD() +struct sVoiceInitiateUSSDResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceAnswerUSSD() +struct sVoiceAnswerUSSDRequest_Info +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe indication TLV 0x01 for Voice USSDIndication +struct sVoiceUSSDIndication_Type +{ + eQMIVoiceUSSDNotifcationTypes mNotificationType; +}; + +// Structure to describe indication TLV 0x10 for Voice USSDIndication +struct sVoiceUSSDIndication_Data +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe indication TLV 0x01 for Voice USSIndication +struct sVoiceUSSIndication_Info +{ + UINT8 mCallID; + eQMIVoiceUUSTypes mUUSType; + eQMIVoiceUUSDataCodingSchemes mUUSDCS; + UINT8 mUUSLength; + + // This array must be the size specified by mUUSLength + // UINT8 mUUSData[1]; +}; + +// Structure to describe request TLV 0x10 for VoiceSetConfig() +struct sVoiceSetConfigRequest_AutoAnswer +{ + INT8 mAutoAnswer; +}; + +// Structure to describe request TLV 0x11 for VoiceSetConfig() +struct sVoiceSetConfigRequest_AirTimer +{ + UINT8 mNAMID; + UINT32 mAirTimerMinutes; +}; + +// Structure to describe request TLV 0x12 for VoiceSetConfig() +struct sVoiceSetConfigRequest_RoamTimer +{ + UINT8 mNAMID; + UINT32 mRoamTimerMinutes; +}; + +// Structure to describe request TLV 0x13 for VoiceSetConfig() +struct sVoiceSetConfigRequest_TTYMode +{ + eQMIVoiceTTYModes mTTYMode; +}; + +// Structure to describe request TLV 0x14 for VoiceSetConfig() +struct sVoiceSetConfigRequest_PreferredVoiceSO +{ + UINT8 mNAMID; + INT8 mEVRCCapability; + eQMIVoiceServiceOptions mHomePageVoiceServiceOption; + eQMIVoiceServiceOptions mHomeOriginationVoiceServiceOption; + eQMIVoiceServiceOptions mRoamOriginationVoiceServiceOption; +}; + +// Structure to describe request TLV 0x15 for VoiceSetConfig() +struct sVoiceSetConfigRequest_PreferredVoiceDomain +{ + eQMIVoiceDomains mPreferredDomain; +}; + +// Structure to describe response TLV 0x10 for VoiceSetConfig() +struct sVoiceSetConfigResponse_AutoAnswer +{ + INT8 mWriteFailed; +}; + +// Structure to describe response TLV 0x11 for VoiceSetConfig() +struct sVoiceSetConfigResponse_AirTimer +{ + INT8 mWriteFailed; +}; + +// Structure to describe response TLV 0x12 for VoiceSetConfig() +struct sVoiceSetConfigResponse_RoamTimer +{ + INT8 mWriteFailed; +}; + +// Structure to describe response TLV 0x13 for VoiceSetConfig() +struct sVoiceSetConfigResponse_TTYMode +{ + INT8 mWriteFailed; +}; + +// Structure to describe response TLV 0x14 for VoiceSetConfig() +struct sVoiceSetConfigResponse_PreferredVoiceSO +{ + INT8 mWriteFailed; +}; + +// Structure to describe response TLV 0x15 for VoiceSetConfig() +struct sVoiceSetConfigResponse_PreferredVoiceDomain +{ + INT8 mWriteFailed; +}; + +// Structure to describe request TLV 0x10 for VoiceGetConfig() +struct sVoiceGetConfigRequest_AutoAnswer +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x11 for VoiceGetConfig() +struct sVoiceGetConfigRequest_AirTimer +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x12 for VoiceGetConfig() +struct sVoiceGetConfigRequest_RoamTimer +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x13 for VoiceGetConfig() +struct sVoiceGetConfigRequest_TTYMode +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x14 for VoiceGetConfig() +struct sVoiceGetConfigRequest_PreferredVoiceSO +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x15 for VoiceGetConfig() +struct sVoiceGetConfigRequest_AMRStatus +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x16 for VoiceGetConfig() +struct sVoiceGetConfigRequest_PreferredVoicePrivacy +{ + INT8 mInclude; +}; + +// Structure to describe request TLV 0x17 for VoiceGetConfig() +struct sVoiceGetConfigRequest_NAM +{ + UINT8 mNAMID; +}; + +// Structure to describe request TLV 0x18 for VoiceGetConfig() +struct sVoiceGetConfigRequest_VoiceDomain +{ + INT8 mInclude; +}; + +// Structure to describe response TLV 0x10 for VoiceGetConfig() +struct sVoiceGetConfigResponse_AutoAnswer +{ + INT8 mAutoAnswer; +}; + +// Structure to describe response TLV 0x11 for VoiceGetConfig() +struct sVoiceGetConfigResponse_AirTimer +{ + UINT8 mNAMID; + UINT32 mAirTimerMinutes; +}; + +// Structure to describe response TLV 0x12 for VoiceGetConfig() +struct sVoiceGetConfigResponse_RoamTimer +{ + UINT8 mNAMID; + UINT32 mRoamTimerMinutes; +}; + +// Structure to describe response TLV 0x13 for VoiceGetConfig() +struct sVoiceGetConfigResponse_TTYMode +{ + eQMIVoiceTTYModes mTTYMode; +}; + +// Structure to describe response TLV 0x14 for VoiceGetConfig() +struct sVoiceGetConfigResponse_PreferredVoiceSO +{ + UINT8 mNAMID; + INT8 mEVRCCapability; + eQMIVoiceServiceOptions mHomePageVoiceServiceOption; + eQMIVoiceServiceOptions mHomeOriginationVoiceServiceOption; + eQMIVoiceServiceOptions mRoamOriginationVoiceServiceOption; +}; + +// Structure to describe response TLV 0x15 for VoiceGetConfig() +struct sVoiceGetConfigResponse_AMRConfig +{ + INT8 mGSMAMR; + bool mWCDMAAMRWB:1; + bool mGSMHRAMR:1; + bool mGSMAMRWB:1; + bool mGSMAMRNB:1; + + // Padding out 4 bits + UINT8 mReserved1:4; +}; + +// Structure to describe response TLV 0x16 for VoiceGetConfig() +struct sVoiceGetConfigResponse_Privacy +{ + eQMIVoicePrivacyLevels mVoicePrivacy; +}; + +// Structure to describe response TLV 0x17 for VoiceGetConfig() +struct sVoiceGetConfigResponse_PreferredVoiceDomain +{ + eQMIVoiceDomains mPreferredDomain; +}; + +// Structure to describe request TLV 0x01 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Info +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryServiceRequest; + INT8 mModifiedByCallControl; +}; + +// Structure to describe request TLV 0x10 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Class +{ + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; +}; + +// Structure to describe request TLV 0x11 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Reason +{ + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x12 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Number +{ + // String is variable length, but must be size of the container + // char mCallForwardingNumber[1]; +}; + +// Structure to describe request TLV 0x13 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Timer +{ + UINT8 mNoReplyTimerSeconds; +}; + +// Structure to describe request TLV 0x14 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_USSData +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe request TLV 0x15 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x16 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe request TLV 0x17 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_Password +{ + char mCallBarringPassword[4]; +}; + +// Structure to describe request TLV 0x18 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_NewPassword +{ + char mNewCallBarringPassword[4]; + char mNewCallBarringPasswordRepeat[4]; +}; + +// Structure to describe request TLV 0x19 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_DataSource +{ + INT8 mResponseData; +}; + +// Structure to describe request TLV 0x1A for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe request TLV 0x1B for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_CallForwarding +{ + UINT8 mInstanceCount; + + struct sInstance1 + { + INT8 mServiceActive; + bool mSupplementaryServiceClassVoice:1; + bool mSupplementaryServiceClassData:1; + bool mSupplementaryServiceClassFax:1; + bool mSupplementaryServiceClassSMS:1; + bool mSupplementaryServiceClassDataCircuitSync:1; + bool mSupplementaryServiceClassDataCircuitAsync:1; + bool mSupplementaryServiceClassPacketAccess:1; + bool mSupplementaryServiceClassPadAccess:1; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + struct sInstance2 + { + UINT8 mNoReplyTimerSeconds; + }; + + struct sInstance + { + sInstance1 mInstance1; + sInstance2 mInstance2; + }; + + // This array must be the size specified by mInstanceCount + // sInstance mInstances[1]; +}; + +// Structure to describe request TLV 0x1C for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_CLIR +{ + INT8 mCLIRActive; + eQMIVoiceProvisioningStates mCLIRProvisionStatus; +}; + +// Structure to describe request TLV 0x1D for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_CLIP +{ + INT8 mCLIPActive; + INT8 mCLIPProvisioned; +}; + +// Structure to describe request TLV 0x1E for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_COLP +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe request TLV 0x1F for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_COLR +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe request TLV 0x20 for VoiceSupplementaryService() +struct sVoiceSupplementaryServiceRequestIndication_CNAP +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe request TLV 0x01 for VoiceAsyncInitiateUSSD() +struct sVoiceAsyncInitiateUSSDRequest_Info +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe indication TLV 0x10 for Voice USSDAsyncIndication +struct sVoiceUSSDAsyncIndication_Error +{ + eQMIErrors mQMIError; +}; + +// Structure to describe indication TLV 0x11 for Voice USSDAsyncIndication +struct sVoiceUSSDAsyncIndication_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe indication TLV 0x12 for Voice USSDAsyncIndication +struct sVoiceUSSDAsyncIndication_Info +{ + eQMIVoiceUSSDDataCodingSchemes mUSSDCS; + UINT8 mUSSLength; + + // This array must be the size specified by mUSSLength + // UINT8 mUSSData[1]; +}; + +// Structure to describe indication TLV 0x13 for Voice USSDAsyncIndication +struct sVoiceUSSDAsyncIndication_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe request TLV 0x01 for VoiceBindSubscription() +struct sVoiceBindSubscriptionRequest_Type +{ + eQMIVoiceSubscriptionTypes mSubscriptionType; +}; + +// Structure to describe request TLV 0x01 for VoiceALSSetLineSwitching() +struct sVoiceALSSetLineSwitchingRequest_Switching +{ + INT8 mLineSwitchingAllowed; +}; + +// Structure to describe request TLV 0x01 for VoiceALSSelectLine() +struct sVoiceALSSelectLineRequest_Line +{ + eQMIVoiceALSLines mLineValue; +}; + +// Structure to describe request TLV 0x01 for VoiceAOCSetACMMaximum() +struct sVoiceAOCSetACMMaximumRequest_ACMMax +{ + UINT32 mACMMaximum; +}; + +// Structure to describe request TLV 0x01 for VoiceAOCGetCallMeterInfo() +struct sVoiceAOCGetCallMeterInfoRequest_Mask +{ + bool mACM:1; + bool mACMMaximum:1; + bool mCCM:1; + + // Padding out 13 bits + UINT8 mReserved1:5; + UINT8 mReserved2; +}; + +// Structure to describe response TLV 0x10 for VoiceAOCGetCallMeterInfo() +struct sVoiceAOCGetCallMeterInfoResponse_ACM +{ + UINT32 mACM; +}; + +// Structure to describe response TLV 0x11 for VoiceAOCGetCallMeterInfo() +struct sVoiceAOCGetCallMeterInfoResponse_ACMMax +{ + UINT32 mACMMaximum; +}; + +// Structure to describe response TLV 0x12 for VoiceAOCGetCallMeterInfo() +struct sVoiceAOCGetCallMeterInfoResponse_CCM +{ + UINT32 mCCM; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_COLP +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCOLP() +struct sVoiceGetCOLPResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_COLR +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCOLR() +struct sVoiceGetCOLRResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe response TLV 0x10 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_CNAP +{ + INT8 mActive; + INT8 mProvisioned; +}; + +// Structure to describe response TLV 0x11 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_FailCause +{ + UINT16 mFailureCause; +}; + +// Structure to describe response TLV 0x12 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_AlphaID +{ + eQMIVoiceUSSDAlphaCodingSchemes mAlphaDCS; + UINT8 mAlphaLength; + + // This array must be the size specified by mAlphaLength + // UINT8 mAlphaData[1]; +}; + +// Structure to describe response TLV 0x13 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_CallControl +{ + eQMIVoiceCallControlResultTypes mCallControlResult; +}; + +// Structure to describe response TLV 0x14 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe response TLV 0x15 for VoiceGetCNAP() +struct sVoiceGetCNAPResponse_SupplementaryService +{ + eQMIVoiceSupplementaryServiceRequests mSupplementaryService; + eQMIVoiceSupplementaryServiceReasons mReason; +}; + +// Structure to describe request TLV 0x01 for VoiceManageIPCalls() +struct sVoiceManageIPCallsRequest_Info +{ + eQMIVoiceVoIPSUPSCallTypes mSupplementaryServiceType; +}; + +// Structure to describe response TLV 0x10 for VoiceManageIPCalls() +struct sVoiceManageIPCallsResponse_CallID +{ + UINT8 mCallID; +}; + +// Structure to describe request TLV 0x10 for CAT2SetEventReport() +struct sCAT2SetEventReportRequest_ReportMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + bool mRefresh:1; + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + bool mSetupEventBrowserTermination:1; + bool mProvideLocalInformationTime:1; + bool mActivate:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved2:6; +}; + +// Structure to describe request TLV 0x11 for CAT2SetEventReport() +struct sCAT2SetEventReportRequest_DecodeReportMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mSCWSEvent:1; + bool mActivate:1; + bool mSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved3:6; +}; + +// Structure to describe request TLV 0x12 for CAT2SetEventReport() +struct sCAT2SetEventReportRequest_Slot +{ + bool mSlot1:1; + bool mSlot2:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x10 for CAT2SetEventReport() +struct sCAT2SetEventReportResponse_RegStatusMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + bool mRefresh:1; + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + bool mSetupEventBrowserTermination:1; + bool mProvideLocalInformationTime:1; + bool mActivate:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved2:6; +}; + +// Structure to describe response TLV 0x11 for CAT2SetEventReport() +struct sCAT2SetEventReportResponse_DecodedRegStatusMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mSCWSEvent:1; + bool mActivate:1; + bool mSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved3:6; +}; + +// Structure to describe indication TLV 0x10 for CAT2 EventReport +struct sCAT2EventReportIndication_DisplayTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mDisplayTextCommand[1]; +}; + +// Structure to describe indication TLV 0x11 for CAT2 EventReport +struct sCAT2EventReportIndication_GetInkeyEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInkeyCommand[1]; +}; + +// Structure to describe indication TLV 0x12 for CAT2 EventReport +struct sCAT2EventReportIndication_GetInputEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInputCommand[1]; +}; + +// Structure to describe indication TLV 0x13 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupMenuEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupMenuCommand[1]; +}; + +// Structure to describe indication TLV 0x14 for CAT2 EventReport +struct sCAT2EventReportIndication_SelectItemEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSelectItemCommand[1]; +}; + +// Structure to describe indication TLV 0x15 for CAT2 EventReport +struct sCAT2EventReportIndication_AlphaIDAvailable +{ + eQMICATAlphaIDCommandType mAlphaIDCommandType; + UINT16 mAlphaIDLength; + + // This array must be the size specified by mAlphaIDLength + // UINT8 mAlphaID[1]; +}; + +// Structure to describe indication TLV 0x16 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupEventList +{ + bool mUserActivityNotify:1; + bool mIdleScreenAvailable:1; + bool mLanguageSelectionNotify:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x17 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupIdleModeTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupIdleModeTextCommand[1]; +}; + +// Structure to describe indication TLV 0x18 for CAT2 EventReport +struct sCAT2EventReportIndication_LanguageNotificationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLanguageNotificationCommand[1]; +}; + +// Structure to describe indication TLV 0x19 for CAT2 EventReport +struct sCAT2EventReportIndication_RefreshEvent +{ + UINT16 mRefreshMode; + eQMICATRefreshStage mRefreshStage; +}; + +// Structure to describe indication TLV 0x1A for CAT2 EventReport +struct sCAT2EventReportIndication_EndProactiveSession +{ + eQMICATProactiveSessionEndType mProactiveSessionEndType; +}; + +// Structure to describe indication TLV 0x1B for CAT2 EventReport +struct sCAT2EventReportIndication_DecodedHeaderID +{ + eQMICATCommandID mCommandID; + UINT32 mReferenceID; + UINT8 mCommandNumber; +}; + +// Structure to describe indication TLV 0x1C for CAT2 EventReport +struct sCAT2EventReportIndication_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x1D for CAT2 EventReport +struct sCAT2EventReportIndication_HighPriority +{ + eQMICATHighPriority mHighPriority; +}; + +// Structure to describe indication TLV 0x1E for CAT2 EventReport +struct sCAT2EventReportIndication_UserControl +{ + eQMICATUserControl mUserControl; +}; + +// Structure to describe indication TLV 0x1F for CAT2 EventReport +struct sCAT2EventReportIndication_Icon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x20 for CAT2 EventReport +struct sCAT2EventReportIndication_Duration +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe indication TLV 0x21 for CAT2 EventReport +struct sCAT2EventReportIndication_ResponseFormat +{ + eQMICATResponseFormat mResponseFormat; +}; + +// Structure to describe indication TLV 0x22 for CAT2 EventReport +struct sCAT2EventReportIndication_HelpAvailable +{ + eQMICATHelpAvailable mHelpAvailable; +}; + +// Structure to describe indication TLV 0x23 for CAT2 EventReport +struct sCAT2EventReportIndication_ResponsePackingFormat +{ + eQMICATResponsePackingFormat mResponsePackingFormat; +}; + +// Structure to describe indication TLV 0x24 for CAT2 EventReport +struct sCAT2EventReportIndication_ResponseLength +{ + UINT8 mMaximumUserInput; + UINT8 mMinimumUserInput; +}; + +// Structure to describe indication TLV 0x25 for CAT2 EventReport +struct sCAT2EventReportIndication_ShowUserInput +{ + eQMICATShowUserInput mShowUserInput; +}; + +// Structure to describe indication TLV 0x26 for CAT2 EventReport +struct sCAT2EventReportIndication_Tone +{ + eQMICATTone mTone; +}; + +// Structure to describe indication TLV 0x27 for CAT2 EventReport +struct sCAT2EventReportIndication_SoftkeySelection +{ + eQMICATSoftkeySelection mSoftkeySelection; +}; + +// Structure to describe indication TLV 0x28 for CAT2 EventReport +struct sCAT2EventReportIndication_Items +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe indication TLV 0x29 for CAT2 EventReport +struct sCAT2EventReportIndication_DefaultItem +{ + UINT8 mDefaultItem; +}; + +// Structure to describe indication TLV 0x2A for CAT2 EventReport +struct sCAT2EventReportIndication_NextActionIdentifier +{ + UINT8 mActionsLength; + + // This array must be the size specified by mActionsLength + // eQMICATNextAction mNextAction[1]; +}; + +// Structure to describe indication TLV 0x2B for CAT2 EventReport +struct sCAT2EventReportIndication_IconIDList +{ + eQMICATDisplayIconOnly mDisplayIconOnly; + UINT8 mItemsLength; + + struct sItem + { + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe indication TLV 0x2C for CAT2 EventReport +struct sCAT2EventReportIndication_Presentation +{ + eQMICATPresentation mPresentation; +}; + +// Structure to describe indication TLV 0x2D for CAT2 EventReport +struct sCAT2EventReportIndication_PackingRequired +{ + eQMICATPackingRequired mPackingRequired; +}; + +// Structure to describe indication TLV 0x2E for CAT2 EventReport +struct sCAT2EventReportIndication_SMSTPDU +{ + UINT8 mSMSTPDUDataLength; + + // This array must be the size specified by mSMSTPDUDataLength + // UINT8 mSMSTPDUData[1]; +}; + +// Structure to describe indication TLV 0x2F for CAT2 EventReport +struct sCAT2EventReportIndication_IsCDMASMS +{ + eQMICATIsCDMASMS mIsCDMASMS; +}; + +// Structure to describe indication TLV 0x30 for CAT2 EventReport +struct sCAT2EventReportIndication_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x31 for CAT2 EventReport +struct sCAT2EventReportIndication_CallSetupRequirement +{ + eQMICATCallSetupRequirement mCallSetupRequirement; +}; + +// Structure to describe indication TLV 0x32 for CAT2 EventReport +struct sCAT2EventReportIndication_Redial +{ + eQMICATRedialNecessary mRedialNecessary; + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe indication TLV 0x33 for CAT2 EventReport +struct sCAT2EventReportIndication_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe indication TLV 0x34 for CAT2 EventReport +struct sCAT2EventReportIndication_CapabilitiesConfiguration +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe indication TLV 0x35 for CAT2 EventReport +struct sCAT2EventReportIndication_DTMF +{ + UINT8 mDTMFDataLength; + + struct sDTMFData + { + UINT8 mDTMFData1:4; + UINT8 mDTMFData2:4; + }; + + // This array must be the size specified by mDTMFDataLength + // sDTMFData mDTMFDatas[1]; +}; + +// Structure to describe indication TLV 0x36 for CAT2 EventReport +struct sCAT2EventReportIndication_SpecificLanguageNotification +{ + eQMICATSpecificLanguageNotfication mSpecificLanguageNotification; +}; + +// Structure to describe indication TLV 0x37 for CAT2 EventReport +struct sCAT2EventReportIndication_Language +{ + char mLanguage[2]; +}; + +// Structure to describe indication TLV 0x38 for CAT2 EventReport +struct sCAT2EventReportIndication_LaunchMode +{ + eQMICATLaunchMode mLaunchMode; +}; + +// Structure to describe indication TLV 0x39 for CAT2 EventReport +struct sCAT2EventReportIndication_URL +{ + UINT8 mURLDataLength; + + // This array must be the size specified by mURLDataLength + // char mURLData[1]; +}; + +// Structure to describe indication TLV 0x3A for CAT2 EventReport +struct sCAT2EventReportIndication_BrowserID +{ + UINT8 mBrowserID; +}; + +// Structure to describe indication TLV 0x3B for CAT2 EventReport +struct sCAT2EventReportIndication_BearerList +{ + UINT8 mBearerListLength; + + // This array must be the size specified by mBearerListLength + // eQMICATBearer mBearerList[1]; +}; + +// Structure to describe indication TLV 0x3C for CAT2 EventReport +struct sCAT2EventReportIndication_ProvisioningFile +{ + UINT32 mNumberOfProvisioningFiles; + + struct sFile + { + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // char mPath[1]; + }; + + // This array must be the size specified by mNumberOfProvisioningFiles + // sFile mFiles[1]; +}; + +// Structure to describe indication TLV 0x3D for CAT2 EventReport +struct sCAT2EventReportIndication_USSDString +{ + eQMICATUSSDDataCodingScheme mOriginalDataCodingScheme; + eQMICATUSSDDataCodingScheme mDataCodingScheme; + UINT8 mUSSDTextLength; + + // This array must be the size specified by mUSSDTextLength + // UINT8 mUSSDText[1]; +}; + +// Structure to describe indication TLV 0x3E for CAT2 EventReport +struct sCAT2EventReportIndication_DefaultText +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x3F for CAT2 EventReport +struct sCAT2EventReportIndication_ImmediateResponseRequired +{ + eQMICATImmediateResponse mImmediateResponse; +}; + +// Structure to describe indication TLV 0x40 for CAT2 EventReport +struct sCAT2EventReportIndication_UserConfirmationAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x41 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupCallDisplayAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x42 for CAT2 EventReport +struct sCAT2EventReportIndication_UserConfirmationIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x43 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupCallDisplayIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x44 for CAT2 EventReport +struct sCAT2EventReportIndication_GatewayProxy +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x45 for CAT2 EventReport +struct sCAT2EventReportIndication_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x46 for CAT2 EventReport +struct sCAT2EventReportIndication_NotificationRequired +{ + eQMICATNotificationRequired mNotificationRequired; +}; + +// Structure to describe indication TLV 0x47 for CAT2 EventReport +struct sCAT2EventReportIndication_PlayToneEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mPlayToneCommand[1]; +}; + +// Structure to describe indication TLV 0x48 for CAT2 EventReport +struct sCAT2EventReportIndication_SetupCallEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupCallCommand[1]; +}; + +// Structure to describe indication TLV 0x49 for CAT2 EventReport +struct sCAT2EventReportIndication_SendDTMFEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDTMFCommand[1]; +}; + +// Structure to describe indication TLV 0x4A for CAT2 EventReport +struct sCAT2EventReportIndication_LaunchBrowserEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLaunchBrowserCommand[1]; +}; + +// Structure to describe indication TLV 0x4B for CAT2 EventReport +struct sCAT2EventReportIndication_SendSMSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSMSCommand[1]; +}; + +// Structure to describe indication TLV 0x4C for CAT2 EventReport +struct sCAT2EventReportIndication_SendSSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSSCommand[1]; +}; + +// Structure to describe indication TLV 0x4D for CAT2 EventReport +struct sCAT2EventReportIndication_SendUSSDEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendUSSDCommand[1]; +}; + +// Structure to describe indication TLV 0x4E for CAT2 EventReport +struct sCAT2EventReportIndication_ProvideLocalInformationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mProvideLocalInformationCommand[1]; +}; + +// Structure to describe indication TLV 0x4F for CAT2 EventReport +struct sCAT2EventReportIndication_SetupRawEventList +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupEventListCommand[1]; +}; + +// Structure to describe indication TLV 0x50 for CAT2 EventReport +struct sCAT2EventReportIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x51 for CAT2 EventReport +struct sCAT2EventReportIndication_OpenChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mOpenChannelCommand[1]; +}; + +// Structure to describe indication TLV 0x52 for CAT2 EventReport +struct sCAT2EventReportIndication_CloseChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mCloseChannelCommand[1]; +}; + +// Structure to describe indication TLV 0x53 for CAT2 EventReport +struct sCAT2EventReportIndication_SendDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDataCommand[1]; +}; + +// Structure to describe indication TLV 0x54 for CAT2 EventReport +struct sCAT2EventReportIndication_ReceiveDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mReceiveDataCommand[1]; +}; + +// Structure to describe indication TLV 0x55 for CAT2 EventReport +struct sCAT2EventReportIndication_OnDemmandLinkEstablish +{ + eQMICATOnDemandLinkEstablish mOnDemandLinkEstablish; +}; + +// Structure to describe indication TLV 0x56 for CAT2 EventReport +struct sCAT2EventReportIndication_CSDBearerDescription +{ + UINT8 mSpeed; + eQMICATCSDBearerName mCSDBearerName; + eQMICATConnectionElement mConnectionElement; +}; + +// Structure to describe indication TLV 0x57 for CAT2 EventReport +struct sCAT2EventReportIndication_GPRSBearerDescription +{ + UINT8 mPrecedenceClass; + UINT8 mDelayClass; + UINT8 mReliabilityClass; + UINT8 mPeakThroughput; + UINT8 mMeanThroughput; + eQMICATPacketDataProtocol mPacketDataProtocol; +}; + +// Structure to describe indication TLV 0x58 for CAT2 EventReport +struct sCAT2EventReportIndication_EUTRANExternalParameterBearerDescription +{ + eQMICATTrafficClass mTrafficClass; + UINT16 mMaxUploadBitrate; + UINT16 mMaxDownloadBitrate; + UINT16 mGuaranteedUploadBitrate; + UINT16 mGuaranteedDownloadBitrate; + eQMICATDeliveryOrder mDeliveryOrder; + UINT8 mMaxSDUSize; + UINT8 mMaxSDUErrorRatio; + UINT8 mResidualBitErrorRatio; + eQMICATDeliverErrorSDU mDeliverErrorSDU; + UINT8 mTransferDelay; + UINT8 mTrafficHandlingPRI; + eQMICATPDPType mPDPType; +}; + +// Structure to describe indication TLV 0x59 for CAT2 EventReport +struct sCAT2EventReportIndication_EUTRANExternalMappedUTRANBearerDescription +{ + UINT8 mQCI; + UINT8 mMaxUploadBitrate; + UINT8 mMaxDownloadBitrate; + UINT8 mGuaranteedUploadBitrate; + UINT8 mGuaranteedDownloadBitrate; + UINT8 mMaximumUploadBitrateExt; + UINT8 mMaximumDownloadBitrateExt; + UINT8 mGuaranteedUploadBitrateExt; + UINT8 mGuaranteedDownloadBitrateExt; + eQMICATPDPType mPDPType; +}; + +// Structure to describe indication TLV 0x5A for CAT2 EventReport +struct sCAT2EventReportIndication_BufferSize +{ + UINT16 mBufferSize; +}; + +// Structure to describe indication TLV 0x5B for CAT2 EventReport +struct sCAT2EventReportIndication_NetworkAccessName +{ + UINT8 mNetworkAccessNameLength; + + // This array must be the size specified by mNetworkAccessNameLength + // UINT8 mNetworkAccessName[1]; +}; + +// Structure to describe indication TLV 0x5C for CAT2 EventReport +struct sCAT2EventReportIndication_OtherAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x5D for CAT2 EventReport +struct sCAT2EventReportIndication_UserLogin +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x5E for CAT2 EventReport +struct sCAT2EventReportIndication_UserPassword +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x5F for CAT2 EventReport +struct sCAT2EventReportIndication_TransportLevel +{ + eQMICATTransportProtocol mTransportProtocol; + UINT16 mPortNumber; +}; + +// Structure to describe indication TLV 0x60 for CAT2 EventReport +struct sCAT2EventReportIndication_DataDestinationAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x61 for CAT2 EventReport +struct sCAT2EventReportIndication_ChannelDataLength +{ + UINT8 mChannelDataLength; +}; + +// Structure to describe indication TLV 0x62 for CAT2 EventReport +struct sCAT2EventReportIndication_SendDataImmediately +{ + eQMICATSendDataImmediately mSendDataImmediately; +}; + +// Structure to describe indication TLV 0x63 for CAT2 EventReport +struct sCAT2EventReportIndication_ChannelData +{ + UINT16 mChannelDataLength; + + // This array must be the size specified by mChannelDataLength + // UINT8 mChannelData[1]; +}; + +// Structure to describe indication TLV 0x64 for CAT2 EventReport +struct sCAT2EventReportIndication_ChannelID +{ + UINT8 mChannelID; +}; + +// Structure to describe indication TLV 0x65 for CAT2 EventReport +struct sCAT2EventReportIndication_ItemsWithDCS +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe indication TLV 0x66 for CAT2 EventReport +struct sCAT2EventReportIndication_Activate +{ + UINT32 mReferenceID; + UINT16 mActivateLength; + + // This array must be the size specified by mActivateLength + // UINT8 mActivate[1]; +}; + +// Structure to describe indication TLV 0x67 for CAT2 EventReport +struct sCAT2EventReportIndication_ActivateTarget +{ + eQMICATActivateTargets mActivateTarget; +}; + +// Structure to describe response TLV 0x01 for CAT2GetServiceState() +struct sCAT2GetServiceStateResponse_CATServiceState +{ + bool mCommonDisplayText:1; + bool mCommonGetInkey:1; + bool mCommonGetInput:1; + bool mCommonSetupMenu:1; + bool mCommonSelectItem:1; + bool mCommonSendSMSAlphaIdentifier:1; + bool mCommonSetupEventUserActivity:1; + bool mCommonSetupEventIdleScreenNotify:1; + bool mCommonSetupEventLanguageSelNotify:1; + bool mCommonSetupIdleModeText:1; + bool mCommonLanguageNotification:1; + bool mCommonRefresh:1; + bool mCommonEndProactiveSession:1; + bool mCommonPlayTone:1; + bool mCommonSetupCall:1; + bool mCommonSendDTMF:1; + bool mCommonLaunchBrowser:1; + bool mCommonSendSS:1; + bool mCommonSendUSSD:1; + bool mCommonProvideLocalInformationLanguage:1; + bool mCommonBearerIndependentProtocol:1; + bool mCommonSetupEventBrowserTermination:1; + bool mCommonProvideLocalInformationTime:1; + bool mCommonActivate:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mCommonSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved2:6; + + bool mControlDisplayText:1; + bool mControlGetInkey:1; + bool mControlGetInput:1; + bool mControlSetupMenu:1; + bool mControlSelectItem:1; + bool mControlSendSMSAlphaIdentifier:1; + bool mControlSetupEventUserActivity:1; + bool mControlSetupEventIdleScreenNotify:1; + bool mControlSetupEventLanguageSelNotify:1; + bool mControlSetupIdleModeText:1; + bool mControlLanguageNotification:1; + bool mControlRefresh:1; + bool mControlEndProactiveSession:1; + bool mControlPlayTone:1; + bool mControlSetupCall:1; + bool mControlSendDTMF:1; + bool mControlLaunchBrowser:1; + bool mControlSendSS:1; + bool mControlSendUSSD:1; + bool mControlProvideLocalInformationLanguage:1; + bool mControlBearerIndependentProtocol:1; + bool mControlSetupEventBrowserTermination:1; + bool mControlProvideLocalInformationTime:1; + bool mControlActivate:1; + + // Padding out 1 bits + UINT8 mReserved3:1; + + bool mControlSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved4:6; +}; + +// Structure to describe response TLV 0x10 for CAT2GetServiceState() +struct sCAT2GetServiceStateResponse_DecodedCATServiceState +{ + bool mCommonDisplayText:1; + bool mCommonGetInkey:1; + bool mCommonGetInput:1; + bool mCommonSetupMenu:1; + bool mCommonSelectItem:1; + bool mCommonSendSMSAlphaIdentifier:1; + bool mCommonSetupEventUserActivity:1; + bool mCommonSetupEventIdleScreenNotify:1; + bool mCommonSetupEventLanguageSelNotify:1; + bool mCommonSetupIdleModeText:1; + bool mCommonLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mCommonEndProactiveSession:1; + bool mCommonPlayTone:1; + bool mCommonSetupCall:1; + bool mCommonSendDTMF:1; + bool mCommonLaunchBrowser:1; + bool mCommonSendSS:1; + bool mCommonSendUSSD:1; + bool mCommonProvideLocalInformationLanguage:1; + bool mCommonBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mCommonSCWSEvent:1; + bool mCommonActivate:1; + bool mCommonSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved3:6; + + bool mControlDisplayText:1; + bool mControlGetInkey:1; + bool mControlGetInput:1; + bool mControlSetupMenu:1; + bool mControlSelectItem:1; + bool mControlSendSMSAlphaIdentifier:1; + bool mControlSetupEventUserActivity:1; + bool mControlSetupEventIdleScreenNotify:1; + bool mControlSetupEventLanguageSelNotify:1; + bool mControlSetupIdleModeText:1; + bool mControlLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved4:1; + + bool mControlEndProactiveSession:1; + bool mControlPlayTone:1; + bool mControlSetupCall:1; + bool mControlSendDTMF:1; + bool mControlLaunchBrowser:1; + bool mControlSendSS:1; + bool mControlSendUSSD:1; + bool mControlProvideLocalInformationLanguage:1; + bool mControlBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved5:2; + + bool mControlSCWSEvent:1; + bool mControlActivate:1; + bool mControlSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved6:6; +}; + +// Structure to describe request TLV 0x01 for CAT2SendTerminalResponse() +struct sCAT2SendTerminalResponseRequest_TerminalResponseType +{ + UINT32 mReferenceID; + UINT16 mTerminalResponseLength; + + // This array must be the size specified by mTerminalResponseLength + // UINT8 mTerminalResponse[1]; +}; + +// Structure to describe request TLV 0x10 for CAT2SendTerminalResponse() +struct sCAT2SendTerminalResponseRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe response TLV 0x10 for CAT2SendTerminal() +struct sCAT2SendTerminalResponseResponse_TRResponse +{ + UINT8 mSW1; + UINT8 mSW2; + UINT8 mTerminalResponseLength; + + // This array must be the size specified by mTerminalResponseLength + // UINT8 mTerminalResponseData[1]; +}; + +// Structure to describe request TLV 0x01 for CAT2EnvelopeCommand() +struct sCAT2EnvelopeCommandRequest_EnvelopeCommand +{ + eQMICATEnvelopeCommandType mEnvelopeCommandType; + UINT16 mEnvelopeLength; + + // This array must be the size specified by mEnvelopeLength + // UINT8 mEnvelopeData[1]; +}; + +// Structure to describe request TLV 0x10 for CAT2EnvelopeCommand() +struct sCAT2EnvelopeCommandRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe response TLV 0x10 for CAT2EnvelopeCommand() +struct sCAT2EnvelopeCommandResponse_RawResponse +{ + UINT8 mSW1; + UINT8 mSW2; + UINT8 mEnvelopeResponseLength; + + // This array must be the size specified by mEnvelopeResponseLength + // UINT8 mEnvelopeResponseData[1]; +}; + +// Structure to describe request TLV 0x01 for CAT2GetEventReport() +struct sCAT2GetEventReportRequest_CommandInput +{ + UINT32 mCommandID; + eQMICATCommandFormat mCommandFormat; +}; + +// Structure to describe response TLV 0x10 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DisplayTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mDisplayTextCommand[1]; +}; + +// Structure to describe response TLV 0x11 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_GetInkeyEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInkeyCommand[1]; +}; + +// Structure to describe response TLV 0x12 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_GetInputEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInputCommand[1]; +}; + +// Structure to describe response TLV 0x13 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupMenuEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupMenuCommand[1]; +}; + +// Structure to describe response TLV 0x14 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SelectItemEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSelectItemCommand[1]; +}; + +// Structure to describe response TLV 0x15 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_AlphaIDAvailable +{ + eQMICATAlphaIDCommandType mAlphaIDCommandType; + UINT16 mAlphaIDLength; + + // This array must be the size specified by mAlphaIDLength + // UINT8 mAlphaID[1]; +}; + +// Structure to describe response TLV 0x16 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupEventList +{ + bool mUserActivityNotify:1; + bool mIdleScreenAvailable:1; + bool mLanguageSelectionNotify:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x17 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupIdleModeTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupIdleModeTextCommand[1]; +}; + +// Structure to describe response TLV 0x18 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_LanguageNotificationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLanguageNotificationCommand[1]; +}; + +// Structure to describe response TLV 0x19 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_RefreshEvent +{ + UINT16 mRefreshMode; + eQMICATRefreshStage mRefreshStage; +}; + +// Structure to describe response TLV 0x1A for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_EndProactiveSession +{ + eQMICATProactiveSessionEndType mProactiveSessionEndType; +}; + +// Structure to describe response TLV 0x1B for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DecodedHeaderID +{ + eQMICATCommandID mCommandID; + UINT32 mReferenceID; + UINT8 mCommandNumber; +}; + +// Structure to describe response TLV 0x1C for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x1D for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_HighPriority +{ + eQMICATHighPriority mHighPriority; +}; + +// Structure to describe response TLV 0x1E for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_UserControl +{ + eQMICATUserControl mUserControl; +}; + +// Structure to describe response TLV 0x1F for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Icon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x20 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Duration +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe response TLV 0x21 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ResponseFormat +{ + eQMICATResponseFormat mResponseFormat; +}; + +// Structure to describe response TLV 0x22 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_HelpAvailable +{ + eQMICATHelpAvailable mHelpAvailable; +}; + +// Structure to describe response TLV 0x23 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ResponsePackingFormat +{ + eQMICATResponsePackingFormat mResponsePackingFormat; +}; + +// Structure to describe response TLV 0x24 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ResponseLength +{ + UINT8 mMaximumUserInput; + UINT8 mMinimumUserInput; +}; + +// Structure to describe response TLV 0x25 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ShowUserInput +{ + eQMICATShowUserInput mShowUserInput; +}; + +// Structure to describe response TLV 0x26 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Tone +{ + eQMICATTone mTone; +}; + +// Structure to describe response TLV 0x27 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SoftkeySelection +{ + eQMICATSoftkeySelection mSoftkeySelection; +}; + +// Structure to describe response TLV 0x28 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Items +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe response TLV 0x29 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DefaultItems +{ + UINT8 mDefaultItem; +}; + +// Structure to describe response TLV 0x2A for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_NextActionIdentifier +{ + UINT8 mActionsLength; + + // This array must be the size specified by mActionsLength + // eQMICATNextAction mNextAction[1]; +}; + +// Structure to describe response TLV 0x2B for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_IconIDList +{ + eQMICATDisplayIconOnly mDisplayIconOnly; + UINT8 mItemsLength; + + struct sItem + { + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe response TLV 0x2C for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Presentation +{ + eQMICATPresentation mPresentation; +}; + +// Structure to describe response TLV 0x2D for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_PackingRequired +{ + eQMICATPackingRequired mPackingRequired; +}; + +// Structure to describe response TLV 0x2E for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SMSTPDU +{ + UINT8 mSMSTPDUDataLength; + + // This array must be the size specified by mSMSTPDUDataLength + // UINT8 mSMSTPDUData[1]; +}; + +// Structure to describe response TLV 0x2F for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_IsCDMASMS +{ + eQMICATIsCDMASMS mIsCDMASMS; +}; + +// Structure to describe response TLV 0x30 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x31 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_CallSetupRequirement +{ + eQMICATCallSetupRequirement mCallSetupRequirement; +}; + +// Structure to describe response TLV 0x32 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Redial +{ + eQMICATRedialNecessary mRedialNecessary; + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe response TLV 0x33 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe response TLV 0x34 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_CapabilityConfiguration +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x35 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DTMF +{ + UINT8 mDTMFDataLength; + + struct sDTMFData + { + UINT8 mDTMFData1:4; + UINT8 mDTMFData2:4; + }; + + // This array must be the size specified by mDTMFDataLength + // sDTMFData mDTMFDatas[1]; +}; + +// Structure to describe response TLV 0x36 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SpecificLanguageNotification +{ + eQMICATSpecificLanguageNotfication mSpecificLanguageNotification; +}; + +// Structure to describe response TLV 0x37 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Language +{ + char mLanguage[2]; +}; + +// Structure to describe response TLV 0x38 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_LaunchMode +{ + eQMICATLaunchMode mLaunchMode; +}; + +// Structure to describe response TLV 0x39 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_URL +{ + UINT8 mURLDataLength; + + // This array must be the size specified by mURLDataLength + // char mURLData[1]; +}; + +// Structure to describe response TLV 0x3A for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_BrowserID +{ + UINT8 mBrowserID; +}; + +// Structure to describe response TLV 0x3B for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_BearerList +{ + UINT8 mBearerListLength; + + // This array must be the size specified by mBearerListLength + // eQMICATBearer mBearerList[1]; +}; + +// Structure to describe response TLV 0x3C for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ProvisioningFiles +{ + UINT32 mNumberOfProvisioningFiles; + + struct sFile + { + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // char mPath[1]; + }; + + // This array must be the size specified by mNumberOfProvisioningFiles + // sFile mFiles[1]; +}; + +// Structure to describe response TLV 0x3D for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_USSDString +{ + eQMICATUSSDDataCodingScheme mOriginalDataCodingScheme; + eQMICATUSSDDataCodingScheme mDataCodingScheme; + UINT8 mUSSDTextLength; + + // This array must be the size specified by mUSSDTextLength + // UINT8 mUSSDText[1]; +}; + +// Structure to describe response TLV 0x3E for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DefaultText +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x3F for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ImmediateResponseRequest +{ + eQMICATImmediateResponse mImmediateResponse; +}; + +// Structure to describe response TLV 0x40 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_UserConfirmationAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x41 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupCallDisplayAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x42 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_UserConfirmationIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x43 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupCallDisplayIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x44 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_GatewayProxy +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x45 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x46 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_NotificationRequired +{ + eQMICATNotificationRequired mNotificationRequired; +}; + +// Structure to describe response TLV 0x47 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_PlayToneEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mPlayToneCommand[1]; +}; + +// Structure to describe response TLV 0x48 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupCallEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupCallCommand[1]; +}; + +// Structure to describe response TLV 0x49 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendDTMFEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDTMFCommand[1]; +}; + +// Structure to describe response TLV 0x4A for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_LaunchBrowserEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLaunchBrowserCommand[1]; +}; + +// Structure to describe response TLV 0x4B for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendSMSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSMSCommand[1]; +}; + +// Structure to describe response TLV 0x4C for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendSSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSSCommand[1]; +}; + +// Structure to describe response TLV 0x4D for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendUSSDEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendUSSDCommand[1]; +}; + +// Structure to describe response TLV 0x4E for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ProvideLocalInformationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mProvideLocalInformationCommand[1]; +}; + +// Structure to describe response TLV 0x4F for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SetupEventListRawEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupEventListCommand[1]; +}; + +// Structure to describe response TLV 0x50 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe response TLV 0x51 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_OpenChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mOpenChannelCommand[1]; +}; + +// Structure to describe response TLV 0x52 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_CloseChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mCloseChannelCommand[1]; +}; + +// Structure to describe response TLV 0x53 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDataCommand[1]; +}; + +// Structure to describe response TLV 0x54 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ReceiveDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mReceiveDataCommand[1]; +}; + +// Structure to describe response TLV 0x55 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_OnDemandLinkEstablish +{ + eQMICATOnDemandLinkEstablish mOnDemandLinkEstablish; +}; + +// Structure to describe response TLV 0x56 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_CSDBearerDescription +{ + UINT8 mSpeed; + eQMICATCSDBearerName mCSDBearerName; + eQMICATConnectionElement mConnectionElement; +}; + +// Structure to describe response TLV 0x57 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_GPRSBearerDescription +{ + UINT8 mPrecedenceClass; + UINT8 mDelayClass; + UINT8 mReliabilityClass; + UINT8 mPeakThroughput; + UINT8 mMeanThroughput; + eQMICATPacketDataProtocol mPacketDataProtocol; +}; + +// Structure to describe response TLV 0x58 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_EUTRANExternalParameterBearerDescription +{ + eQMICATTrafficClass mTrafficClass; + UINT16 mMaxUploadBitrate; + UINT16 mMaxDownloadBitrate; + UINT16 mGuaranteedUploadBitrate; + UINT16 mGuaranteedDownloadBitrate; + eQMICATDeliveryOrder mDeliveryOrder; + UINT8 mMaxSDUSize; + UINT8 mMaxSDUErrorRatio; + UINT8 mResidualBitErrorRatio; + eQMICATDeliverErrorSDU mDeliverErrorSDU; + UINT8 mTransferDelay; + UINT8 mTrafficHandlingPRI; + eQMICATPDPType mPDPType; +}; + +// Structure to describe response TLV 0x59 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_EUTRANExternalMappedUTRANBearerDescription +{ + UINT8 mQCI; + UINT8 mMaxUploadBitrate; + UINT8 mMaxDownloadBitrate; + UINT8 mGuaranteedUploadBitrate; + UINT8 mGuaranteedDownloadBitrate; + UINT8 mMaximumUploadBitrateExt; + UINT8 mMaximumDownloadBitrateExt; + UINT8 mGuaranteedUploadBitrateExt; + UINT8 mGuaranteedDownloadBitrateExt; + eQMICATPDPType mPDPType; +}; + +// Structure to describe response TLV 0x5A for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_BufferSize +{ + UINT16 mBufferSize; +}; + +// Structure to describe response TLV 0x5B for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_NetworkAccessName +{ + UINT8 mNetworkAccessNameLength; + + // This array must be the size specified by mNetworkAccessNameLength + // UINT8 mNetworkAccessName[1]; +}; + +// Structure to describe response TLV 0x5C for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_OtherAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x5D for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_UserLogin +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x5E for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_UserPassword +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x5F for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_TransportLevel +{ + eQMICATTransportProtocol mTransportProtocol; + UINT16 mPortNumber; +}; + +// Structure to describe response TLV 0x60 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_DataDestinationAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x61 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ChannelDataLength +{ + UINT8 mChannelDataLength; +}; + +// Structure to describe response TLV 0x62 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_SendDataImmediately +{ + eQMICATSendDataImmediately mSendDataImmediately; +}; + +// Structure to describe response TLV 0x63 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ChannelData +{ + UINT16 mChannelDataLength; + + // This array must be the size specified by mChannelDataLength + // UINT8 mChannelData[1]; +}; + +// Structure to describe response TLV 0x64 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ChannelID +{ + UINT8 mChannelID; +}; + +// Structure to describe response TLV 0x65 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ItemsWithDCS +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe response TLV 0x66 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_Activate +{ + UINT32 mReferenceID; + UINT16 mActivateLength; + + // This array must be the size specified by mActivateLength + // UINT8 mActivate[1]; +}; + +// Structure to describe response TLV 0x67 for CAT2GetEventReport() +struct sCAT2GetEventReportResponse_ActivateTarget +{ + eQMICATActivateTargets mActivateTarget; +}; + +// Structure to describe request TLV 0x01 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_TerminalResponse +{ + UINT32 mReferenceID; + UINT8 mCommandNumber; + eQMICATResponseCommand mResponseCommand; + UINT8 mGeneralResult; + UINT8 mAdditionalInformationLength; + + // This array must be the size specified by mAdditionalInformationLength + // UINT8 mTerminalResponseAdditionalInformation[1]; +}; + +// Structure to describe request TLV 0x10 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x11 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_ItemIdentifier +{ + UINT8 mItemIdentifier; +}; + +// Structure to describe request TLV 0x12 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_GetInkeyExtraInfo +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x13 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_LanguageInfo +{ + char mLanguage[2]; +}; + +// Structure to describe request TLV 0x14 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x15 for CAT2SendDecodedTerminalResponse() +struct sCAT2SendDecodedTerminalResponseRequest_GetInkeyYesInput +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; + INT8 mGetInkeyYesInput; +}; + +// Structure to describe response TLV 0x10 for CAT2SendDecodedTerminal() +struct sCAT2SendDecodedTerminalResponseResponse_TRResponse +{ + UINT8 mSW1; + UINT8 mSW2; + UINT8 mTerminalResponseLength; + + // This array must be the size specified by mTerminalResponseLength + // UINT8 mTerminalResponseData[1]; +}; + +// Structure to describe request TLV 0x01 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_EnvelopeCommand +{ + eQMICATDecodedEnvelopeCommand mEnvelopeCommand; +}; + +// Structure to describe request TLV 0x10 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_ItemIdentifier +{ + UINT8 mItemIdentifier; +}; + +// Structure to describe request TLV 0x11 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_HelpRequest +{ + eQMICATHelpRequest mHelpRequest; +}; + +// Structure to describe request TLV 0x12 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_Language +{ + char mLanguage[2]; +}; + +// Structure to describe request TLV 0x13 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x14 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe request TLV 0x15 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe request TLV 0x16 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_CapabilityConfigParam1 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe request TLV 0x17 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_CapabilityConfigParam2 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe request TLV 0x18 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_USSDString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x19 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_PDPContextActivation +{ + UINT8 mPDPContextActivationDataLength; + + // This array must be the size specified by mPDPContextActivationDataLength + // UINT8 mPDPContextActivationData[1]; +}; + +// Structure to describe request TLV 0x1A for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_EPSPDNConnectActivation +{ + UINT8 mEPSPDNConnectActivationDataLength; + + // This array must be the size specified by mEPSPDNConnectActivationDataLength + // UINT8 mEPSPDNConnectActivationData[1]; +}; + +// Structure to describe request TLV 0x1B for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandRequest_BrowserTerminationCause +{ + eQMICATBrowserTerminationCauses mBrowserTerminationCause; +}; + +// Structure to describe response TLV 0x10 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_CallControlResult +{ + eQMICATCallControlResult mCallControlResult; +}; + +// Structure to describe response TLV 0x11 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x12 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe response TLV 0x13 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_CapabilityConfigParam1 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x14 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_CapabilityConfigParam2 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x15 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_USSDString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x16 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_PDPContextActivation +{ + UINT8 mPDPContextActivationDataLength; + + // This array must be the size specified by mPDPContextActivationDataLength + // UINT8 mPDPContextActivationData[1]; +}; + +// Structure to describe response TLV 0x17 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_EPSPDNConnectActivation +{ + UINT8 mEPSPDNConnectActivationDataLength; + + // This array must be the size specified by mEPSPDNConnectActivationDataLength + // UINT8 mEPSPDNConnectActivationData[1]; +}; + +// Structure to describe response TLV 0x18 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x19 for CAT2SendDecodedEnvelopeCommand() +struct sCAT2SendDecodedEnvelopeCommandResponse_BCRepeatIndicator +{ + eQMICATBearerCapabilityRepeatIndicator mBearerCapabilityRepeatIndicator; +}; + +// Structure to describe request TLV 0x10 for CAT2EventConfirmation() +struct sCAT2EventConfirmationRequest_UserConfirmed +{ + eQMICATUserConfirmed mUserConfirmed; +}; + +// Structure to describe request TLV 0x11 for CAT2EventConfirmation() +struct sCAT2EventConfirmationRequest_IconIsDisplayed +{ + eQMICATIconIsDisplayed mIconIsDisplayed; +}; + +// Structure to describe request TLV 0x12 for CAT2EventConfirmation() +struct sCAT2EventConfirmationRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2SCWSOpenChannel() +struct sCAT2SCWSOpenChannelRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CAT2SCWSOpenChannel() +struct sCAT2SCWSOpenChannelRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT2 SCWSOpenChannelIndication +struct sCAT2SCWSOpenChannelIndication_OpenChannelInformation +{ + UINT32 mChannelID; + UINT16 mPortNumber; + UINT16 mBufferSize; +}; + +// Structure to describe indication TLV 0x11 for CAT2 SCWSOpenChannelIndication +struct sCAT2SCWSOpenChannelIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2SCWSCloseChannel() +struct sCAT2SCWSCloseChannelRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CAT2SCWSCloseChannel() +struct sCAT2SCWSCloseChannelRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT2 SCWSCloseChannelIndication +struct sCAT2SCWSCloseChannelIndication_CloseChannelInfo +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe response TLV 0x11 for CAT2SCWSCloseChannel() +struct sCAT2SCWSCloseChannelResponse_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2SCWSSendData() +struct sCAT2SCWSSendDataRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATSendDataResult mDataSendResult; +}; + +// Structure to describe request TLV 0x10 for CAT2SCWSSendData() +struct sCAT2SCWSSendDataRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT2 SCWSSendDataIndication +struct sCAT2SCWSSendDataIndication_SendDataInfo +{ + UINT32 mChannelID; + UINT8 mTotalPackets; + UINT8 mCurrentPacket; + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe indication TLV 0x11 for CAT2 SCWSSendDataIndication +struct sCAT2SCWSSendDataIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2SCWSDataAvailable() +struct sCAT2SCWSDataAvailableRequest_RemainingData +{ + UINT32 mChannelID; + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x10 for CAT2SCWSDataAvailable() +struct sCAT2SCWSDataAvailableRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CAT2SCWSChannelStatus() +struct sCAT2SCWSChannelStatusRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CAT2SCWSChannelStatus() +struct sCAT2SCWSChannelStatusRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x10 for CAT2GetTerminalProfile() +struct sCAT2GetTerminalProfileRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe response TLV 0x10 for CAT2GetTerminalProfile() +struct sCAT2GetTerminalProfileResponse_RawData +{ + UINT8 mTerminalProfileLength; + + // This array must be the size specified by mTerminalProfileLength + // UINT8 mTerminalProfileData[1]; +}; + +// Structure to describe request TLV 0x01 for CAT2SetConfiguration() +struct sCAT2SetConfigurationRequest_Mode +{ + eQMICATConfigModes mConfigMode; +}; + +// Structure to describe request TLV 0x10 for CAT2SetConfiguration() +struct sCAT2SetConfigurationRequest_CustomData +{ + UINT8 mTerminalProfileLength; + + // This array must be the size specified by mTerminalProfileLength + // UINT8 mTerminalProfileData[1]; +}; + +// Structure to describe response TLV 0x10 for CAT2GetConfiguration() +struct sCAT2GetConfigurationResponse_Mode +{ + eQMICATConfigModes mConfigMode; +}; + +// Structure to describe response TLV 0x11 for CAT2GetConfiguration() +struct sCAT2GetConfigurationResponse_CustomData +{ + UINT8 mTerminalProfileLength; + + // This array must be the size specified by mTerminalProfileLength + // UINT8 mTerminalProfileData[1]; +}; + +// Structure to describe request TLV 0x01 for UIMReadTransparent() +struct sUIMReadTransparentRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x03 for UIMReadTransparent() +struct sUIMReadTransparentRequest_Buffer +{ + UINT16 mOffset; + UINT16 mLength; +}; + +// Structure to describe request TLV 0x10 for UIMReadTransparent() +struct sUIMReadTransparentRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe request TLV 0x11 for UIMReadTransparent() +struct sUIMReadTransparentRequest_Encryption +{ + INT8 mDataEncrypted; +}; + +// Structure to describe response TLV 0x10 for UIMReadTransparent() +struct sUIMReadTransparentResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMReadTransparent() +struct sUIMReadTransparentResponse_ReadResult +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe response TLV 0x12 for UIMReadTransparent() +struct sUIMReadTransparentResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x13 for UIMReadTransparent() +struct sUIMReadTransparentResponse_Encryption +{ + INT8 mDataEncrypted; +}; + +// Structure to describe response TLV 0x14 for UIMReadTransparent() +struct sUIMReadTransparentResponse_RequestedLength +{ + UINT16 mFileLength; +}; + +// Structure to describe indication TLV 0x01 for UIM ReadTransparentIndication +struct sUIMReadTransparentIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM ReadTransparentIndication +struct sUIMReadTransparentIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe indication TLV 0x11 for UIM ReadTransparentIndication +struct sUIMReadTransparentIndication_ReadResult +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe indication TLV 0x12 for UIM ReadTransparentIndication +struct sUIMReadTransparentIndication_Encryption +{ + INT8 mDataEncrypted; +}; + +// Structure to describe indication TLV 0x13 for UIM ReadTransparentIndication +struct sUIMReadTransparentIndication_RequestedLength +{ + UINT16 mFileLength; +}; + +// Structure to describe request TLV 0x01 for UIMReadRecord() +struct sUIMReadRecordRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x03 for UIMReadRecord() +struct sUIMReadRecordRequest_Record +{ + UINT16 mRecordNumber; + UINT16 mContentLength; +}; + +// Structure to describe request TLV 0x10 for UIMReadRecord() +struct sUIMReadRecordRequest_LastRecord +{ + UINT16 mRecordNumber; +}; + +// Structure to describe request TLV 0x11 for UIMReadRecord() +struct sUIMReadRecordRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMReadRecord() +struct sUIMReadRecordResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMReadRecord() +struct sUIMReadRecordResponse_ReadResult +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe response TLV 0x12 for UIMReadRecord() +struct sUIMReadRecordResponse_AdditionalReadResult +{ + UINT16 mContentLength; + + struct sRecord + { + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; + }; + + // This array is variable length based on the size of the container + // sRecord mRecords[1]; +}; + +// Structure to describe response TLV 0x13 for UIMReadRecord() +struct sUIMReadRecordResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM ReadRecordIndication +struct sUIMReadRecordIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM ReadRecordIndication +struct sUIMReadRecordIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe indication TLV 0x11 for UIM ReadRecordIndication +struct sUIMReadRecordIndication_ReadResult +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe indication TLV 0x12 for UIM ReadRecordIndication +struct sUIMReadRecordIndication_AdditionalReadResult +{ + UINT16 mContentLength; + + struct sRecord + { + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; + }; + + // This array is variable length based on the size of the container + // sRecord mRecords[1]; +}; + +// Structure to describe request TLV 0x01 for UIMWriteTransparent() +struct sUIMWriteTransparentRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x03 for UIMWriteTransparent() +struct sUIMWriteTransparentRequest_Buffer +{ + UINT16 mOffset; + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe request TLV 0x10 for UIMWriteTransparent() +struct sUIMWriteTransparentRequest_ResponseInIndicaiton +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMWriteTransparent() +struct sUIMWriteTransparentResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMWriteTransparent() +struct sUIMWriteTransparentResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM WriteTransparentIndication +struct sUIMWriteTransparentIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM WriteTransparentIndication +struct sUIMWriteTransparentIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe request TLV 0x01 for UIMWriteRecord() +struct sUIMWriteRecordRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x03 for UIMWriteRecord() +struct sUIMWriteRecordRequest_Record +{ + UINT16 mRecordNumber; + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe request TLV 0x10 for UIMWriteRecord() +struct sUIMWriteRecordRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMWriteRecord() +struct sUIMWriteRecordResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMWriteRecord() +struct sUIMWriteRecordResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM WriteRecordIndication +struct sUIMWriteRecordIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM WriteRecordIndication +struct sUIMWriteRecordIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe request TLV 0x01 for UIMGetFileAttributes() +struct sUIMGetFileAttributesRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMGetFileAttributes() +struct sUIMGetFileAttributesRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMGetFileAttributes() +struct sUIMGetFileAttributesResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMGetFileAttributes() +struct sUIMGetFileAttributesResponse_Attributes +{ + UINT16 mFileSize; + UINT16 mFileID; + eQMIUIMFileTypes mFileType; + UINT16 mRecordSize; + UINT16 mRecordCount; + eQMIUIMSecurityAttributes mReadSecurityAttributes; + bool mReadPIN1:1; + bool mReadPIN2:1; + bool mReadUPIN:1; + bool mReadADM:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + + eQMIUIMSecurityAttributes mWriteSecurityAttributes; + bool mWritePIN1:1; + bool mWritePIN2:1; + bool mWriteUPIN:1; + bool mWriteADM:1; + + // Padding out 4 bits + UINT8 mReserved2:4; + + eQMIUIMSecurityAttributes mIncreaseSecurityAttributes; + bool mIncreasePIN1:1; + bool mIncreasePIN2:1; + bool mIncreaseUPIN:1; + bool mIncreaseADM:1; + + // Padding out 4 bits + UINT8 mReserved3:4; + + eQMIUIMSecurityAttributes mDeactivateSecurityAttributes; + bool mDeactivatePIN1:1; + bool mDeactivatePIN2:1; + bool mDeactivateUPIN:1; + bool mDeactivateADM:1; + + // Padding out 4 bits + UINT8 mReserved4:4; + + eQMIUIMSecurityAttributes mActivateSecurityAttributes; + bool mActivatePIN1:1; + bool mActivatePIN2:1; + bool mActivateUPIN:1; + bool mActivateADM:1; + + // Padding out 4 bits + UINT8 mReserved5:4; + + UINT16 mValueLength; + + // This array must be the size specified by mValueLength + // UINT8 mValue[1]; +}; + +// Structure to describe response TLV 0x12 for UIMGetFileAttributes() +struct sUIMGetFileAttributesResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM GetFileAttributesIndication +struct sUIMGetFileAttributesIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM GetFileAttributesIndication +struct sUIMGetFileAttributesIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe indication TLV 0x11 for UIM GetFileAttributesIndication +struct sUIMGetFileAttributesIndication_FileAttributes +{ + UINT16 mFileSize; + UINT16 mFileID; + eQMIUIMFileTypes mFileType; + UINT16 mRecordSize; + UINT16 mRecordCount; + eQMIUIMSecurityAttributes mReadSecurityAttributes; + bool mReadPIN1:1; + bool mReadPIN2:1; + bool mReadUPIN:1; + bool mReadADM:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + + eQMIUIMSecurityAttributes mWriteSecurityAttributes; + bool mWritePIN1:1; + bool mWritePIN2:1; + bool mWriteUPIN:1; + bool mWriteADM:1; + + // Padding out 4 bits + UINT8 mReserved2:4; + + eQMIUIMSecurityAttributes mIncreaseSecurityAttributes; + bool mIncreasePIN1:1; + bool mIncreasePIN2:1; + bool mIncreaseUPIN:1; + bool mIncreaseADM:1; + + // Padding out 4 bits + UINT8 mReserved3:4; + + eQMIUIMSecurityAttributes mDeactivateSecurityAttributes; + bool mDeactivatePIN1:1; + bool mDeactivatePIN2:1; + bool mDeactivateUPIN:1; + bool mDeactivateADM:1; + + // Padding out 4 bits + UINT8 mReserved4:4; + + eQMIUIMSecurityAttributes mActivateSecurityAttributes; + bool mActivatePIN1:1; + bool mActivatePIN2:1; + bool mActivateUPIN:1; + bool mActivateADM:1; + + // Padding out 4 bits + UINT8 mReserved5:4; + + UINT16 mValueLength; + + // This array must be the size specified by mValueLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x01 for UIMSetPINProtection() +struct sUIMSetPINProtectionRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMSetPINProtection() +struct sUIMSetPINProtectionRequest_KeyReferenceID +{ + eQMIUIMKeyReferenceID mKeyReferenceID; +}; + +// Structure to describe request TLV 0x11 for UIMSetPINProtection() +struct sUIMSetPINProtectionRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMSetPINProtection() +struct sUIMSetPINProtectionResponse_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x11 for UIMSetPINProtection() +struct sUIMSetPINProtectionResponse_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe response TLV 0x12 for UIMSetPINProtection() +struct sUIMSetPINProtectionResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM SetPINProtectionIndication +struct sUIMSetPINProtectionIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM SetPINProtectionIndication +struct sUIMSetPINProtectionIndication_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x11 for UIM SetPINProtectionIndication +struct sUIMSetPINProtectionIndication_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x01 for UIMVerifyPIN() +struct sUIMVerifyPINRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMVerifyPIN() +struct sUIMVerifyPINRequest_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x11 for UIMVerifyPIN() +struct sUIMVerifyPINRequest_KeyReferenceID +{ + eQMIUIMKeyReferenceID mKeyReferenceID; +}; + +// Structure to describe request TLV 0x12 for UIMVerifyPIN() +struct sUIMVerifyPINRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMVerifyPIN() +struct sUIMVerifyPINResponse_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x11 for UIMVerifyPIN() +struct sUIMVerifyPINResponse_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe response TLV 0x12 for UIMVerifyPIN() +struct sUIMVerifyPINResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM VerifyPINIndication +struct sUIMVerifyPINIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM VerifyPINIndication +struct sUIMVerifyPINIndication_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x11 for UIM VerifyPINIndication +struct sUIMVerifyPINIndication_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x01 for UIMUnblockPIN() +struct sUIMUnblockPINRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMUnblockPIN() +struct sUIMUnblockPINRequest_KeyReferenceID +{ + eQMIUIMKeyReferenceID mKeyReferenceID; +}; + +// Structure to describe request TLV 0x11 for UIMUnblockPIN() +struct sUIMUnblockPINRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMUnblockPIN() +struct sUIMUnblockPINResponse_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x11 for UIMUnblockPIN() +struct sUIMUnblockPINResponse_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe response TLV 0x12 for UIMUnblockPIN() +struct sUIMUnblockPINResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM UnblockPINIndication +struct sUIMUnblockPINIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM UnblockPINIndication +struct sUIMUnblockPINIndication_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x11 for UIM UnblockPINIndication +struct sUIMUnblockPINIndication_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x01 for UIMChangePIN() +struct sUIMChangePINRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMChangePIN() +struct sUIMChangePINRequest_KeyReferenceID +{ + eQMIUIMKeyReferenceID mKeyReferenceID; +}; + +// Structure to describe request TLV 0x11 for UIMChangePIN() +struct sUIMChangePINRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMChangePIN() +struct sUIMChangePINResponse_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe response TLV 0x11 for UIMChangePIN() +struct sUIMChangePINResponse_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe response TLV 0x12 for UIMChangePIN() +struct sUIMChangePINResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM ChangePINIndication +struct sUIMChangePINIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM ChangePINIndication +struct sUIMChangePINIndication_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe indication TLV 0x11 for UIM ChangePINIndication +struct sUIMChangePINIndication_EncryptedPIN1 +{ + UINT8 mPINLength; + + // This array must be the size specified by mPINLength + // UINT8 mValue[1]; +}; + +// Structure to describe request TLV 0x01 for UIMDepersonalization() +struct sUIMDepersonalizationRequest_Info +{ + eQMIUIMPersonalizationFeatures mFeature; + eQMIUIMCKSessionOperations mOperation; + UINT8 mCKLength; + + // This array must be the size specified by mCKLength + // char mCKValue[1]; +}; + +// Structure to describe response TLV 0x10 for UIMDepersonalization() +struct sUIMDepersonalizationResponse_Retries +{ + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; +}; + +// Structure to describe request TLV 0x01 for UIMRefreshRegister() +struct sUIMRefreshRegisterRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x01 for UIMRefreshOK() +struct sUIMRefreshOKRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x01 for UIMRefreshComplete() +struct sUIMRefreshCompleteRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x01 for UIMGetLastRefreshEvent() +struct sUIMGetLastRefreshEventRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe response TLV 0x10 for UIMGetLastRefreshEvent() +struct sUIMGetLastRefreshEventResponse_RefreshEvent1 +{ + eQMIUIMRefreshStages mStage; + eQMIUIMRefreshModes mMode; + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +struct sUIMGetLastRefreshEventResponse_RefreshEvent2 +{ + UINT16 mFileCount; + + struct sFile + { + UINT16 mFileID; + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // UINT16 mPath[1]; + }; + + // This array must be the size specified by mFileCount + // sFile mFiles[1]; +}; + +struct sUIMGetLastRefreshEventResponse_RefreshEvent +{ + sUIMGetLastRefreshEventResponse_RefreshEvent1 mUIMGetLastRefreshEventResponse_RefreshEvent1; + sUIMGetLastRefreshEventResponse_RefreshEvent2 mUIMGetLastRefreshEventResponse_RefreshEvent2; +}; + +// Structure to describe request TLV 0x01 for UIMEventRegistration() +struct sUIMEventRegistrationRequest_Mask +{ + bool mCardStatus:1; + bool mSAPConnection:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x10 for UIMEventRegistration() +struct sUIMEventRegistrationResponse_Mask +{ + bool mCardStatus:1; + bool mSAPConnection:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x10 for UIMGetCardStatus() +struct sUIMGetCardStatusResponse_Status1 +{ + UINT8 mPrimaryGWSlot; + UINT8 mPrimaryGWApplication; + UINT8 mPrimary1XSlot; + UINT8 mPrimary1XApplication; + UINT8 mSecondaryGWSlot; + UINT8 mSecondaryGWApplication; + UINT8 mSecondary1XSlot; + UINT8 mSecondary1XApplication; + UINT8 mSlotsAvailable; + eQMIUIMCardStates mCardState; + eQMIUIMPINStates mUPINState; + UINT8 mRemainingUPINVerifyRetries; + UINT8 mRemainingUPINUnblockRetries; + eQMIUIMCardErrorCodes mCardErrorCode; + UINT8 mApplicationsAvailable; + eQMIUIMApplicationTypes mApplicationType; + eQMIUIMApplicationStates mApplicationState; + eQMIUIMPersonalizationStates mPersonalizationState; + eQMIUIMPersonalizationFeatures mPersonalizationFeature; + UINT8 mRemainingPersonalizationVerifyRetries; + UINT8 mRemainingPersonalizationUnblockRetries; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +struct sUIMGetCardStatusResponse_Status2 +{ + INT8 mUPINReplacesPIN1; + eQMIUIMPINStates mPIN1State; + UINT8 mRemainingPIN1VerifyRetries; + UINT8 mRemainingPIN1UnblockRetries; + eQMIUIMPINStates mPIN2State; + UINT8 mRemainingPIN2VerifyRetries; + UINT8 mRemainingPIN2UnblockRetries; +}; + +struct sUIMGetCardStatusResponse_Status +{ + sUIMGetCardStatusResponse_Status1 mUIMGetCardStatusResponse_Status1; + sUIMGetCardStatusResponse_Status2 mUIMGetCardStatusResponse_Status2; +}; + +// Structure to describe response TLV 0x11 for UIMGetCardStatus() +struct sUIMGetCardStatusResponse_HotSwapStatus +{ + UINT8 mHotSwapLength; + + // This array must be the size specified by mHotSwapLength + // eQMIUIMHotSwap mHotSwap[1]; +}; + +// Structure to describe request TLV 0x01 for UIMPowerDown() +struct sUIMPowerDownRequest_Slot +{ + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x01 for UIMPowerUp() +struct sUIMPowerUpRequest_Slot +{ + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x10 for UIMPowerUp() +struct sUIMPowerUpRequest_IgnoreHotSwapSwitch +{ + INT8 mIgnoreHotSwapSwitch; +}; + +// Structure to describe indication TLV 0x10 for UIM CardStatusIndication +struct sUIMCardStatusIndication_Status1 +{ + UINT8 mPrimaryGWSlot; + UINT8 mPrimaryGWApplication; + UINT8 mPrimary1XSlot; + UINT8 mPrimary1XApplication; + UINT8 mSecondaryGWSlot; + UINT8 mSecondaryGWApplication; + UINT8 mSecondary1XSlot; + UINT8 mSecondary1XApplication; + UINT8 mSlotsAvailable; + eQMIUIMCardStates mCardState; + eQMIUIMPINStates mUPINState; + UINT8 mRemainingUPINVerifyRetries; + UINT8 mRemainingUPINUnblockRetries; + eQMIUIMCardErrorCodes mCardErrorCode; + UINT8 mApplicationsAvailable; + eQMIUIMApplicationTypes mApplicationType; + eQMIUIMApplicationStates mApplicationState; + eQMIUIMPersonalizationStates mPersonalizationState; + eQMIUIMPersonalizationFeatures mPersonalizationFeature; + UINT8 mRemainingPersonalizationVerifyRetries; + UINT8 mRemainingPersonalizationUnblockRetries; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +struct sUIMCardStatusIndication_Status2 +{ + INT8 mUPINReplacesPIN1; + eQMIUIMPINStates mPIN1State; + UINT8 mRemainingPIN1VerifyRetries; + UINT8 mRemainingPIN1UnblockRetries; + eQMIUIMPINStates mPIN2State; + UINT8 mRemainingPIN2VerifyRetries; + UINT8 mRemainingPIN2UnblockRetries; +}; + +struct sUIMCardStatusIndication_Status +{ + sUIMCardStatusIndication_Status1 mUIMCardStatusIndication_Status1; + sUIMCardStatusIndication_Status2 mUIMCardStatusIndication_Status2; +}; + +// Structure to describe indication TLV 0x10 for UIM RefreshIndication +struct sUIMRefreshIndication_RefreshEvent1 +{ + eQMIUIMRefreshStages mStage; + eQMIUIMRefreshModes mMode; + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +struct sUIMRefreshIndication_RefreshEvent2 +{ + UINT16 mFileCount; + + struct sFile + { + UINT16 mFileID; + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // UINT16 mPath[1]; + }; + + // This array must be the size specified by mFileCount + // sFile mFiles[1]; +}; + +struct sUIMRefreshIndication_RefreshEvent +{ + sUIMRefreshIndication_RefreshEvent1 mUIMRefreshIndication_RefreshEvent1; + sUIMRefreshIndication_RefreshEvent2 mUIMRefreshIndication_RefreshEvent2; +}; + +// Structure to describe request TLV 0x01 for UIMAuthenticate() +struct sUIMAuthenticateRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMAuthenticate() +struct sUIMAuthenticateRequest_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe response TLV 0x10 for UIMAuthenticate() +struct sUIMAuthenticateResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x11 for UIMAuthenticate() +struct sUIMAuthenticateResponse_Data +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe response TLV 0x12 for UIMAuthenticate() +struct sUIMAuthenticateResponse_ResponseInIndication +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM AuthenticateIndication +struct sUIMAuthenticateIndication_OriginalToken +{ + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x10 for UIM AuthenticateIndication +struct sUIMAuthenticateIndication_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe indication TLV 0x11 for UIM AuthenticateIndication +struct sUIMAuthenticateIndication_Data +{ + UINT16 mContentLength; + + // This array must be the size specified by mContentLength + // UINT8 mContent[1]; +}; + +// Structure to describe request TLV 0x01 for UIMCloseSession() +struct sUIMCloseSessionRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x01 for UIMGetServiceStatus() +struct sUIMGetServiceStatusRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe response TLV 0x10 for UIMGetServiceStatus() +struct sUIMGetServiceStatusResponse_FDNStatus +{ + eQMIUIMFDNStatusValues mFDNStatus; +}; + +// Structure to describe response TLV 0x11 for UIMGetServiceStatus() +struct sUIMGetServiceStatusResponse_HiddenKeyStatus +{ + eQMIUIMHiddenKeyStatusValues mHiddenKeyStatus; +}; + +// Structure to describe response TLV 0x12 for UIMGetServiceStatus() +struct sUIMGetServiceStatusResponse_Index +{ + UINT8 mEFDIRIndex; +}; + +// Structure to describe response TLV 0x13 for UIMGetServiceStatus() +struct sUIMGetServiceStatusResponse_ESNStatus +{ + INT8 mESNChanged; +}; + +// Structure to describe request TLV 0x01 for UIMSetServiceStatus() +struct sUIMSetServiceStatusRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMSetServiceStatus() +struct sUIMSetServiceStatusRequest_FDNStatus +{ + INT8 mEnableFDN; +}; + +// Structure to describe request TLV 0x01 for UIMChangeProvisioningSession() +struct sUIMChangeProvisioningSessionRequest_SessionChange +{ + eQMIUIMSessionTypes mSessionType; + eQMIUIMCKSessionOperations mOperation; +}; + +// Structure to describe request TLV 0x10 for UIMChangeProvisioningSession() +struct sUIMChangeProvisioningSessionRequest_AppInfo +{ + eQMIUIMSlots mSlot; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x01 for UIMGetLabel() +struct sUIMGetLabelRequest_AppInfo +{ + eQMIUIMSlots mSlot; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe response TLV 0x10 for UIMGetLabel() +struct sUIMGetLabelResponse_AppLabel +{ + UINT8 mLabelLength; + + // This array must be the size specified by mLabelLength + // char mLabelValue[1]; +}; + +// Structure to describe request TLV 0x10 for UIMGetConfiguration() +struct sUIMGetConfigurationRequest_Mask +{ + bool mAutomaticSelection:1; + bool mPersonalizationStatus:1; + bool mHaltSubscription:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x10 for UIMGetConfiguration() +struct sUIMGetConfigurationResponse_AutoSelection +{ + INT8 mAutomaticProvisioningOn; +}; + +// Structure to describe response TLV 0x11 for UIMGetConfiguration() +struct sUIMGetConfigurationResponse_Personalization +{ + UINT8 mFeatureCount; + + struct sFeature + { + eQMIUIMPersonalizationFeatures mPersonalizationFeature; + UINT8 mRemainingVerifyRetries; + UINT8 mRemainingUnblockRetries; + }; + + // This array must be the size specified by mFeatureCount + // sFeature mFeatures[1]; +}; + +// Structure to describe response TLV 0x12 for UIMGetConfiguration() +struct sUIMGetConfigurationResponse_Subscription +{ + INT8 mPublishSubscription; +}; + +// Structure to describe request TLV 0x01 for UIMSendADPU() +struct sUIMSendADPURequest_Slot +{ + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x10 for UIMSendADPU() +struct sUIMSendADPURequest_LogicalChannel +{ + UINT8 mChannelID; +}; + +// Structure to describe request TLV 0x11 for UIMSendADPU() +struct sUIMSendADPURequest_IntermediateProcedureBytes +{ + eQMIUIMAPDUResponseStatus mIntermediateProcedureBytes; +}; + +// Structure to describe response TLV 0x10 for UIMSendADPU() +struct sUIMSendADPUResponse_APDUResponse +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe response TLV 0x11 for UIMSendADPU() +struct sUIMSendADPUResponse_LongAPDUResponse +{ + UINT16 mTotalLength; + UINT32 mIndicationToken; +}; + +// Structure to describe indication TLV 0x01 for UIM SendADPUIndication +struct sUIMSendADPUIndication_APDUResponseChunk +{ + UINT32 mIndicationToken; + UINT16 mTotalLength; + UINT16 mOffset; + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x01 for UIMSAPConnection() +struct sUIMSAPConnectionRequest_Slot +{ + eQMIUIMConnectOperations mOperation; + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x10 for UIMSAPConnection() +struct sUIMSAPConnectionRequest_DisconnectMode +{ + eQMIUIMDisonnectModes mDisconnectMode; +}; + +// Structure to describe request TLV 0x11 for UIMSAPConnection() +struct sUIMSAPConnectionRequest_IntermediateGetResponse +{ + INT8 mReturnIntermediateGetResponse; +}; + +// Structure to describe response TLV 0x10 for UIMSAPConnection() +struct sUIMSAPConnectionResponse_State +{ + eQMIUIMSAPStates mSAPState; +}; + +// Structure to describe request TLV 0x01 for UIMSAP() +struct sUIMSAPRequestRequest_Request +{ + eQMIUIMSAPRequests mSAPRequest; + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x10 for UIMSAP() +struct sUIMSAPRequestRequest_APDU +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe response TLV 0x10 for UIMSAPRequest() +struct sUIMSAPRequestResponse_ATR +{ + UINT8 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe response TLV 0x11 for UIMSAPRequest() +struct sUIMSAPRequestResponse_APDU +{ + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe response TLV 0x12 for UIMSAPRequest() +struct sUIMSAPRequestResponse_CardReaderStatus +{ + UINT8 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe indication TLV 0x10 for UIM SAPConnectionIndication +struct sUIMSAPConnectionIndication_CardStatus +{ + eQMIUIMSAPStates mSAPState; + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x01 for UIMLogicalChannel() +struct sUIMLogicalChannelRequest_Slot +{ + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x10 for UIMLogicalChannel() +struct sUIMLogicalChannelRequest_AID +{ + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x11 for UIMLogicalChannel() +struct sUIMLogicalChannelRequest_LogicalChannel +{ + UINT8 mChannelID; +}; + +// Structure to describe request TLV 0x12 for UIMLogicalChannel() +struct sUIMLogicalChannelRequest_FileControlInformation +{ + eQMIUIMFileControlInformation mFileControlInformation; +}; + +// Structure to describe response TLV 0x10 for UIMLogicalChannel() +struct sUIMLogicalChannelResponse_LogicalChannel +{ + UINT8 mChannelID; +}; + +// Structure to describe response TLV 0x11 for UIMLogicalChannel() +struct sUIMLogicalChannelResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x12 for UIMLogicalChannel() +struct sUIMLogicalChannelResponse_ResponseToSelectCommand +{ + UINT8 mResponseLength; + + // This array must be the size specified by mResponseLength + // UINT8 mResponse[1]; +}; + +// Structure to describe request TLV 0x01 for UIMSubscriptionOK() +struct sUIMSubscriptionOKRequest_SessionInfo +{ + eQMIUIMSessionTypes mSessionType; + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x10 for UIMSubscriptionOK() +struct sUIMSubscriptionOKRequest_EncryptedIMSI +{ + UINT8 mEncryptedIMSILength; + + // This array must be the size specified by mEncryptedIMSILength + // UINT8 mEncryptedIMSI[1]; +}; + +// Structure to describe request TLV 0x01 for UIMGetATR() +struct sUIMGetATRRequest_Slot +{ + eQMIUIMSlots mSlot; +}; + +// Structure to describe response TLV 0x10 for UIMGetATR() +struct sUIMGetATRResponse_ATRValue +{ + UINT8 mATRValueLength; + + // This array must be the size specified by mATRValueLength + // UINT8 mATRValue[1]; +}; + +// Structure to describe request TLV 0x01 for UIMOpenLogicalChannel() +struct sUIMOpenLogicalChannelRequest_Slot +{ + eQMIUIMSlots mSlot; +}; + +// Structure to describe request TLV 0x10 for UIMOpenLogicalChannel() +struct sUIMOpenLogicalChannelRequest_AID +{ + UINT8 mAIDLength; + + // This array must be the size specified by mAIDLength + // UINT8 mAID[1]; +}; + +// Structure to describe request TLV 0x11 for UIMOpenLogicalChannel() +struct sUIMOpenLogicalChannelRequest_FileControlInformation +{ + eQMIUIMFileControlInformation mFileControlInformation; +}; + +// Structure to describe response TLV 0x10 for UIMOpenLogicalChannel() +struct sUIMOpenLogicalChannelResponse_LogicalChannel +{ + UINT8 mChannelID; +}; + +// Structure to describe response TLV 0x11 for UIMOpenLogicalChannel() +struct sUIMOpenLogicalChannelResponse_CardResult +{ + UINT8 mSW1; + UINT8 mSW2; +}; + +// Structure to describe response TLV 0x12 for UIMOpenLogicalChannel() +struct sUIMOpenLogicalChannelResponse_ResponseToSelectCommand +{ + UINT8 mResponseLength; + + // This array must be the size specified by mResponseLength + // UINT8 mResponse[1]; +}; + +// Structure to describe request TLV 0x01 for PBMSetIndicationRegistrationState() +struct sPBMSetIndicationRegistrationStateRequest_Mask +{ + bool mRecordUpdate:1; + bool mPhonebookReady:1; + bool mEmergencyNumberList:1; + bool mHiddenRecordStatus:1; + bool mAASUpdate:1; + bool mGASUpdate:1; + + // Padding out 26 bits + UINT8 mReserved1:2; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x10 for PBMSetIndicationRegistrationState() +struct sPBMSetIndicationRegistrationStateResponse_Mask +{ + bool mRecordUpdate:1; + bool mPhonebookReady:1; + bool mEmergencyNumberList:1; + bool mHiddenRecordStatus:1; + bool mAASUpdate:1; + bool mGASUpdate:1; + + // Padding out 26 bits + UINT8 mReserved1:2; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x01 for PBMGetCapabilities() +struct sPBMGetCapabilitiesRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; +}; + +// Structure to describe response TLV 0x10 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_Basic +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordsUsed; + UINT16 mMaximumRecords; + UINT8 mMaximumNumberLength; + UINT8 mMaximumNameLength; +}; + +// Structure to describe response TLV 0x11 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_Group +{ + UINT8 mMaximumGroupsPossible; + UINT8 mMaximumGroupTagLength; +}; + +// Structure to describe response TLV 0x12 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_AdditionalNumber +{ + UINT8 mMaximumAdditionalNumbersPossible; + UINT8 mMaximumAdditionalNumberLength; + UINT8 mMaximumAdditionalNumberTagLength; +}; + +// Structure to describe response TLV 0x13 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_Email +{ + UINT8 mMaximumEmailsPossible; + UINT8 mMaximumEmailAddressLength; +}; + +// Structure to describe response TLV 0x14 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_SecondName +{ + UINT8 mMaximumSecondNameLength; +}; + +// Structure to describe response TLV 0x15 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_HiddenRecords +{ + INT8 mHiddenEntrySupported; +}; + +// Structure to describe response TLV 0x16 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_GAS +{ + UINT8 mMaximumGASStringLength; +}; + +// Structure to describe response TLV 0x17 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_AAS +{ + UINT8 mMaximumAASStringLength; +}; + +// Structure to describe response TLV 0x18 for PBMGetCapabilities() +struct sPBMGetCapabilitiesResponse_Protection +{ + eQMIPBMProtectionMethods mProtectionMethod; +}; + +// Structure to describe response TLV 0x10 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_Basic +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mNumberOfPhonebooks; + + struct sPhonebook + { + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordsUsed; + UINT16 mMaximumRecords; + UINT8 mMaximumNumberLength; + UINT8 mMaximumNameLength; + }; + + // This array must be the size specified by mNumberOfPhonebooks + // sPhonebook mPhonebooks[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x11 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_Group +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumGroupsPossible; + UINT8 mMaximumGroupTagLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x12 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_AdditionalNumber +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumAdditionalNumbersPossible; + UINT8 mMaximumAdditionalNumberLength; + UINT8 mMaximumAdditionalNumberTagLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x13 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_Email +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumEmailsPossible; + UINT8 mMaximumEmailAddressLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x14 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_SecondName +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumSecondNameLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x15 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_HiddenRecords +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + INT8 mHiddenEntrySupported; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x16 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_GAS +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumRecords; + UINT8 mRecordsUsed; + UINT8 mMaximumGASStringLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x17 for PBMGetAllCapabilities() +struct sPBMGetAllCapabilitiesResponse_AAS +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mMaximumRecords; + UINT8 mRecordsUsed; + UINT8 mMaximumAASStringLength; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe request TLV 0x01 for PBMReadRecords() +struct sPBMReadRecordsRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mStartingRecordID; + UINT16 mEndingRecordID; +}; + +// Structure to describe response TLV 0x10 for PBMReadRecords() +struct sPBMReadRecordsResponse_RecordsRead +{ + UINT16 mNumberOfRecords; +}; + +// Structure to describe indication TLV 0x01 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_Basic +{ + UINT16 mSequenceNumber; + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT8 mNumberOfRecords; + + struct sRecord1 + { + UINT16 mRecordID; + eQMIPBMNumberTypes mNumberType; + eQMIPBMNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + struct sRecord2 + { + UINT8 mNameLength; + + // This array must be the size (in BYTEs) specified by mNameLength + // wchar_t mName[1]; + }; + + struct sRecord + { + sRecord1 mRecord1; + sRecord2 mRecord2; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe indication TLV 0x10 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_SecondName +{ + UINT8 mNumberOfRecords; + + struct sRecord + { + UINT16 mRecordID; + UINT8 mSecondNameLength; + + // This array must be the size (in BYTEs) specified by mSecondNameLength + // wchar_t mSecondName[1]; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe indication TLV 0x11 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_AdditionalNumber +{ + UINT8 mNumberOfRecords; + + struct sRecord + { + UINT16 mRecordID; + UINT8 mAdditionalNumberCount; + + struct sAdditionalNumber1 + { + eQMIPBMNumberTypes mNumberType; + eQMIPBMNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + struct sAdditionalNumber2 + { + UINT8 mTagID; + }; + + struct sAdditionalNumber + { + sAdditionalNumber1 mAdditionalNumber1; + sAdditionalNumber2 mAdditionalNumber2; + }; + + // This array must be the size specified by mAdditionalNumberCount + // sAdditionalNumber mAdditionalNumbers[1]; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe indication TLV 0x12 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_Group +{ + UINT8 mNumberOfRecords; + + struct sRecord + { + UINT16 mRecordID; + UINT8 mGroupCount; + + // This array must be the size specified by mGroupCount + // UINT8 mGroupID[1]; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe indication TLV 0x13 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_Email +{ + UINT8 mNumberOfRecords; + + struct sRecord + { + UINT16 mRecordID; + UINT8 mEmailCount; + + struct sEmail + { + UINT8 mAddressLength; + + // This array must be the size (in BYTEs) specified by mAddressLength + // wchar_t mAddress[1]; + }; + + // This array must be the size specified by mEmailCount + // sEmail mEmails[1]; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe indication TLV 0x14 for PBM ReadRecordsIndication +struct sPBMReadRecordsIndication_Hidden +{ + UINT8 mNumberOfRecords; + + struct sRecord + { + UINT16 mRecordID; + INT8 mHidden; + }; + + // This array must be the size specified by mNumberOfRecords + // sRecord mRecords[1]; +}; + +// Structure to describe request TLV 0x01 for PBMWriteRecord() +struct sPBMWriteRecordRequest_Info1 +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordID; + eQMIPBMNumberTypes mNumberType; + eQMIPBMNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +struct sPBMWriteRecordRequest_Info2 +{ + UINT8 mNameLength; + + // This array must be the size (in BYTEs) specified by mNameLength + // wchar_t mName[1]; +}; + +struct sPBMWriteRecordRequest_Info +{ + sPBMWriteRecordRequest_Info1 mPBMWriteRecordRequest_Info1; + sPBMWriteRecordRequest_Info2 mPBMWriteRecordRequest_Info2; +}; + +// Structure to describe request TLV 0x10 for PBMWriteRecord() +struct sPBMWriteRecordRequest_SecondName +{ + UINT8 mNameLength; + + // This array must be the size (in BYTEs) specified by mNameLength + // wchar_t mName[1]; +}; + +// Structure to describe request TLV 0x11 for PBMWriteRecord() +struct sPBMWriteRecordRequest_AdditionalNumber +{ + UINT8 mAdditionalNumberCount; + + struct sAdditionalNumber1 + { + eQMIPBMNumberTypes mNumberType; + eQMIPBMNumberPlans mNumberPlan; + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; + }; + + struct sAdditionalNumber2 + { + UINT8 mTagID; + }; + + struct sAdditionalNumber + { + sAdditionalNumber1 mAdditionalNumber1; + sAdditionalNumber2 mAdditionalNumber2; + }; + + // This array must be the size specified by mAdditionalNumberCount + // sAdditionalNumber mAdditionalNumbers[1]; +}; + +// Structure to describe request TLV 0x12 for PBMWriteRecord() +struct sPBMWriteRecordRequest_Group +{ + UINT8 mGroupCount; + + // This array must be the size specified by mGroupCount + // UINT8 mGroupID[1]; +}; + +// Structure to describe request TLV 0x13 for PBMWriteRecord() +struct sPBMWriteRecordRequest_Email +{ + UINT8 mEmailCount; + + struct sEmail + { + UINT8 mAddressLength; + + // This array must be the size (in BYTEs) specified by mAddressLength + // wchar_t mAddress[1]; + }; + + // This array must be the size specified by mEmailCount + // sEmail mEmails[1]; +}; + +// Structure to describe request TLV 0x14 for PBMWriteRecord() +struct sPBMWriteRecordRequest_Hidden +{ + INT8 mHidden; +}; + +// Structure to describe response TLV 0x10 for PBMWriteRecord() +struct sPBMWriteRecordResponse_Info +{ + UINT16 mRecordID; +}; + +// Structure to describe request TLV 0x01 for PBMDeleteRecord() +struct sPBMDeleteRecordRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordID; +}; + +// Structure to describe response TLV 0x10 for PBMDeleteRecord() +struct sPBMDeleteRecordResponse_Info +{ + UINT16 mRecordID; +}; + +// Structure to describe request TLV 0x01 for PBMDeleteAllRecords() +struct sPBMDeleteAllRecordsRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; +}; + +// Structure to describe request TLV 0x01 for PBMSearchRecords() +struct sPBMSearchRecordsRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; +}; + +// Structure to describe request TLV 0x10 for PBMSearchRecords() +struct sPBMSearchRecordsRequest_Number +{ + UINT8 mNumberLength; + + // This array must be the size specified by mNumberLength + // char mNumber[1]; +}; + +// Structure to describe request TLV 0x11 for PBMSearchRecords() +struct sPBMSearchRecordsRequest_Name +{ + UINT8 mNameLength; + + // This array must be the size (in BYTEs) specified by mNameLength + // wchar_t mName[1]; +}; + +// Structure to describe response TLV 0x10 for PBMSearchRecords() +struct sPBMSearchRecordsResponse_List +{ + UINT16 mNumberOfRecordIDs; + + // This array must be the size specified by mNumberOfRecordIDs + // UINT16 mRecordID[1]; +}; + +// Structure to describe indication TLV 0x01 for PBM RecordUpdateIndication +struct sPBMRecordUpdateIndication_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + eQMIPBMOperations mOperation; + UINT16 mRecordID; +}; + +// Structure to describe indication TLV 0x01 for PBM RefreshIndication +struct sPBMRefreshIndication_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + eQMIPBMRefreshStatus mStatus; +}; + +// Structure to describe indication TLV 0x01 for PBM ReadyIndication +struct sPBMReadyIndication_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; +}; + +// Structure to describe indication TLV 0x01 for PBM EmergencyListIndication +struct sPBMEmergencyListIndication_HardCodedNumbers +{ + UINT8 mNumberCount; + + struct sNumber + { + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; +}; + +// Structure to describe indication TLV 0x10 for PBM EmergencyListIndication +struct sPBMEmergencyListIndication_NVNumbers +{ + UINT8 mNumberCount; + + struct sNumber + { + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; +}; + +// Structure to describe indication TLV 0x11 for PBM EmergencyListIndication +struct sPBMEmergencyListIndication_CardNumbers +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mNumberCount; + + struct sNumber + { + bool mPolice:1; + bool mAmbulance:1; + bool mFireBrigade:1; + bool mMarineGuard:1; + bool mMountainRescue:1; + bool mManualECall:1; + bool mAutomaticECall:1; + bool mSpare:1; + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe indication TLV 0x12 for PBM EmergencyListIndication +struct sPBMEmergencyListIndication_NetworkNumbers +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mNumberCount; + + struct sNumber + { + bool mPolice:1; + bool mAmbulance:1; + bool mFireBrigade:1; + bool mMarineGuard:1; + bool mMountainRescue:1; + bool mManualECall:1; + bool mAutomaticECall:1; + bool mSpare:1; + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe indication TLV 0x01 for PBM AllReadyIndication +struct sPBMAllReadyIndication_Info +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + bool mAbbreviatedDialingNumber:1; + bool mFixedDialingNumber:1; + bool mMobileSubscriberIntegratedServicesDigitalNetwork:1; + bool mMailBoxDialingNumber:1; + bool mServiceDialingNumber:1; + bool mBarredDialingNumber:1; + bool mLastNumberDialed:1; + bool mMailBoxNumber:1; + + // Padding out 8 bits + UINT8 mReserved1; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x10 for PBMGetEmergencyList() +struct sPBMGetEmergencyListResponse_HardCodedNumbers +{ + UINT8 mNumberCount; + + struct sNumber + { + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; +}; + +// Structure to describe response TLV 0x11 for PBMGetEmergencyList() +struct sPBMGetEmergencyListResponse_NVNumbers +{ + UINT8 mNumberCount; + + struct sNumber + { + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; +}; + +// Structure to describe response TLV 0x12 for PBMGetEmergencyList() +struct sPBMGetEmergencyListResponse_CardNumbers +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mNumberCount; + + struct sNumber + { + bool mPolice:1; + bool mAmbulance:1; + bool mFireBrigade:1; + bool mMarineGuard:1; + bool mMountainRescue:1; + bool mManualECall:1; + bool mAutomaticECall:1; + bool mSpare:1; + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x13 for PBMGetEmergencyList() +struct sPBMGetEmergencyListResponse_NetworkNumbers +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mNumberCount; + + struct sNumber + { + bool mPolice:1; + bool mAmbulance:1; + bool mFireBrigade:1; + bool mMarineGuard:1; + bool mMountainRescue:1; + bool mManualECall:1; + bool mAutomaticECall:1; + bool mSpare:1; + UINT8 mEmergencyNumberLength; + + // This array must be the size specified by mEmergencyNumberLength + // char mEmergencyNumber[1]; + }; + + // This array must be the size specified by mNumberCount + // sNumber mNumbers[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe response TLV 0x10 for PBMGetAllGroups() +struct sPBMGetAllGroupsResponse_Groups +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mGroupCount; + + struct sGroup + { + UINT8 mGroupID; + UINT8 mGroupNameLength; + + // This array must be the size (in BYTEs) specified by mGroupNameLength + // wchar_t mGroupName[1]; + }; + + // This array must be the size specified by mGroupCount + // sGroup mGroups[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe request TLV 0x01 for PBMSetGroupInfo() +struct sPBMSetGroupInfoRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMOperations mOperation; + UINT8 mGroupID; + UINT8 mGroupNameLength; + + // This array must be the size (in BYTEs) specified by mGroupNameLength + // wchar_t mGroupName[1]; +}; + +// Structure to describe response TLV 0x10 for PBMSetGroupInfo() +struct sPBMSetGroupInfoResponse_ID +{ + eQMIPBMSessionTypes mSessionType; + UINT8 mGroupID; +}; + +// Structure to describe request TLV 0x01 for PBMGetState() +struct sPBMGetStateRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; +}; + +// Structure to describe response TLV 0x10 for PBMGetStateInfo() +struct sPBMGetStateInfoResponse_State +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + eQMIPBMStates mState; +}; + +// Structure to describe request TLV 0x01 for PBMReadAllHiddenRecords() +struct sPBMReadAllHiddenRecordsRequest_Info +{ + eQMIPBMSessionTypes mSessionType; +}; + +// Structure to describe response TLV 0x10 for PBMReadAllHiddenRecords() +struct sPBMReadAllHiddenRecordsResponse_Records +{ + UINT16 mNumberOfRecords; +}; + +// Structure to describe indication TLV 0x01 for PBM HiddenRecordStatusIndication +struct sPBMHiddenRecordStatusIndication_Status +{ + eQMIPBMSessionTypes mSessionType; + INT8 mHiddenRecordsValid; +}; + +// Structure to describe request TLV 0x01 for PBMGetNextEmptyRecordID() +struct sPBMGetNextEmptyRecordIDRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordID; +}; + +// Structure to describe response TLV 0x10 for PBMGetNextEmptyRecordID() +struct sPBMGetNextEmptyRecordIDResponse_Info +{ + UINT16 mRecordID; +}; + +// Structure to describe request TLV 0x01 for PBMGetNextRecordID() +struct sPBMGetNextRecordIDRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMPhonebookTypes mPhonebookType; + UINT16 mRecordID; +}; + +// Structure to describe response TLV 0x10 for PBMGetNextRecordID() +struct sPBMGetNextRecordIDResponse_Info +{ + UINT16 mRecordID; +}; + +// Structure to describe response TLV 0x10 for PBMGetAASList() +struct sPBMGetAASListResponse_List +{ + UINT8 mNumberOfSessions; + + struct sSession + { + eQMIPBMSessionTypes mSessionType; + UINT8 mAASCount; + + struct sAAS + { + UINT8 mAASID; + UINT8 mAlphaStringLength; + + // This array must be the size (in BYTEs) specified by mAlphaStringLength + // wchar_t mAlphaString[1]; + }; + + // This array must be the size specified by mAASCount + // sAAS mAASs[1]; + }; + + // This array must be the size specified by mNumberOfSessions + // sSession mSessions[1]; +}; + +// Structure to describe request TLV 0x10 for PBMSetAAS() +struct sPBMSetAASRequest_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMAASOperations mOperation; + UINT8 mAASID; + UINT8 mAlphaStringLength; + + // This array must be the size (in BYTEs) specified by mAlphaStringLength + // wchar_t mAlphaString[1]; +}; + +// Structure to describe response TLV 0x10 for PBMSetAAS() +struct sPBMSetAASResponse_Info +{ + eQMIPBMSessionTypes mSessionType; + UINT8 mAASID; +}; + +// Structure to describe indication TLV 0x01 for PBM AASChangeIndication +struct sPBMAASChangeIndication_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMOperations mOperation; + UINT8 mAASID; + UINT8 mAlphaStringLength; + + // This array must be the size (in BYTEs) specified by mAlphaStringLength + // wchar_t mAlphaString[1]; +}; + +// Structure to describe indication TLV 0x01 for PBM GASChangeIndication +struct sPBMGASChangeIndication_Info +{ + eQMIPBMSessionTypes mSessionType; + eQMIPBMOperations mOperation; + UINT8 mGASID; + UINT8 mGroupNameLength; + + // This array must be the size (in BYTEs) specified by mGroupNameLength + // wchar_t mGroupName[1]; +}; + +// Structure to describe request TLV 0x10 for PBMBindSubscription() +struct sPBMBindSubscriptionRequest_Type +{ + eQMIPBMSubscriptionTypes mSubscriptionType; +}; + +// Structure to describe request TLV 0x10 for PBMGetSubscription() +struct sPBMGetSubscriptionRequest_Type +{ + eQMIPBMSubscriptionTypes mSubscriptionType; +}; + +// Structure to describe request TLV 0x01 for LOCClientRevision() +struct sLOCClientRevisionRequest_Revision +{ + UINT32 mRevision; +}; + +// Structure to describe request TLV 0x01 for LOCRegisterEvents() +struct sLOCRegisterEventsRequest_EventRegistrationMask +{ + bool mPositionReport:1; + bool mGNSSSatelliteInfo:1; + bool mNMEA:1; + bool mNINotifyVerifyRequest:1; + bool mInjectTimeRequest:1; + bool mInjectPredictedOrbitsRequest:1; + bool mInjectPositionRequest:1; + bool mEngineState:1; + bool mFixSessionState:1; + bool mWiFiRequest:1; + bool mSensorStreamingReadyStatus:1; + bool mTimeSyncRequest:1; + bool mSetSPIStreamingReport:1; + bool mLocationServerConnectionRequest:1; + bool mNIGeofenceNotification:1; + bool mGeofenceGeneralAlert:1; + bool mGeofenceBreachNotification:1; + + // Padding out 47 bits + UINT8 mReserved1:7; + UINT8 mReserved2[5]; +}; + +// Structure to describe request TLV 0x01 for LOCStart() +struct sLOCStartRequest_SessionID +{ + UINT8 mSessionID; +}; + +// Structure to describe request TLV 0x10 for LOCStart() +struct sLOCStartRequest_FixRecurrenceType +{ + eQMILOCFixRecurrenceType mFixRecurrenceType; +}; + +// Structure to describe request TLV 0x11 for LOCStart() +struct sLOCStartRequest_HorizontalAccuracy +{ + eQMILOCHorizontalAccuracy mHorizontalAccuracy; +}; + +// Structure to describe request TLV 0x12 for LOCStart() +struct sLOCStartRequest_EnableIntermediateReports +{ + eQMILOCIntermediateReportState mEnableIntermediateReports; +}; + +// Structure to describe request TLV 0x13 for LOCStart() +struct sLOCStartRequest_MinimumIntervalBetweenPositionReports +{ + UINT32 mMinimumTimeIntervalMilliseconds; +}; + +// Structure to describe request TLV 0x14 for LOCStart() +struct sLOCStartRequest_ApplicationID1 +{ + UINT8 mApplicationProviderLength; + + // This array must be the size specified by mApplicationProviderLength + // char mApplicationProvider[1]; +}; + +struct sLOCStartRequest_ApplicationID2 +{ + UINT8 mApplicationNameLength; + + // This array must be the size specified by mApplicationNameLength + // char mApplicationName[1]; +}; + +struct sLOCStartRequest_ApplicationID3 +{ + INT8 mApplicationVersionValid; + UINT8 mApplicationVersionLength; + + // This array must be the size specified by mApplicationVersionLength + // char mApplicationVersion[1]; +}; + +struct sLOCStartRequest_ApplicationID +{ + sLOCStartRequest_ApplicationID1 mLOCStartRequest_ApplicationID1; + sLOCStartRequest_ApplicationID2 mLOCStartRequest_ApplicationID2; + sLOCStartRequest_ApplicationID3 mLOCStartRequest_ApplicationID3; +}; + +// Structure to describe request TLV 0x01 for LOCStop() +struct sLOCStopRequest_SessionID +{ + UINT8 mSessionID; +}; + +// Structure to describe indication TLV 0x01 for LOC PositionReportIndication +struct sLOCPositionReportIndication_SessionStatus +{ + eQMILOCSessionStatus mSessionStatus; +}; + +// Structure to describe indication TLV 0x10 for LOC PositionReportIndication +struct sLOCPositionReportIndication_Latitude +{ + double mLatitudeDegrees; +}; + +// Structure to describe indication TLV 0x11 for LOC PositionReportIndication +struct sLOCPositionReportIndication_Longitude +{ + double mLongitudeDegrees; +}; + +// Structure to describe indication TLV 0x12 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalUncertaintyCircular +{ + float mHorizontalUncertaintyCircularMeters; +}; + +// Structure to describe indication TLV 0x13 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalUncertaintyEllipticalMinor +{ + float mHorizontalUncertaintyEllipticalMinorMeters; +}; + +// Structure to describe indication TLV 0x14 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalUncertaintyEllipticalMajor +{ + float mHorizontalUncertaintyEllipticalMajorMeters; +}; + +// Structure to describe indication TLV 0x15 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalUncertaintyEllipticalAzimuth +{ + float mHorizontalUncertaintyEllipticalAzimuthDecimalDegrees; +}; + +// Structure to describe indication TLV 0x16 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalConfidence +{ + UINT8 mHorizontalConfidencePercent; +}; + +// Structure to describe indication TLV 0x17 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalReliability +{ + eQMILOCReliability mHorizontalReliability; +}; + +// Structure to describe indication TLV 0x18 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HorizontalSpeed +{ + float mHorizontalSpeedMetersSecond; +}; + +// Structure to describe indication TLV 0x19 for LOC PositionReportIndication +struct sLOCPositionReportIndication_SpeedUncertainty +{ + float mSpeedUncertaintyMetersSecond; +}; + +// Structure to describe indication TLV 0x1A for LOC PositionReportIndication +struct sLOCPositionReportIndication_AltitudeFromEllipsoid +{ + float mAltitudeFromEllipsoidMeters; +}; + +// Structure to describe indication TLV 0x1B for LOC PositionReportIndication +struct sLOCPositionReportIndication_AltitudeFromSeaLevel +{ + float mAltitudeFromSeaLevelMeters; +}; + +// Structure to describe indication TLV 0x1C for LOC PositionReportIndication +struct sLOCPositionReportIndication_VerticalUncertainty +{ + float mVerticalUncertaintyMeters; +}; + +// Structure to describe indication TLV 0x1D for LOC PositionReportIndication +struct sLOCPositionReportIndication_VerticalConfidence +{ + UINT8 mVerticalConfidencePercent; +}; + +// Structure to describe indication TLV 0x1E for LOC PositionReportIndication +struct sLOCPositionReportIndication_VerticalReliability +{ + eQMILOCReliability mVerticalReliability; +}; + +// Structure to describe indication TLV 0x1F for LOC PositionReportIndication +struct sLOCPositionReportIndication_VerticalSpeed +{ + float mVerticalSpeedMetersSecond; +}; + +// Structure to describe indication TLV 0x20 for LOC PositionReportIndication +struct sLOCPositionReportIndication_Heading +{ + float mHeadingDegrees; +}; + +// Structure to describe indication TLV 0x21 for LOC PositionReportIndication +struct sLOCPositionReportIndication_HeadingUncertainty +{ + float mHeadingUncertaintyDegrees; +}; + +// Structure to describe indication TLV 0x22 for LOC PositionReportIndication +struct sLOCPositionReportIndication_MagneticDeviation +{ + float mMagneticDeviation; +}; + +// Structure to describe indication TLV 0x23 for LOC PositionReportIndication +struct sLOCPositionReportIndication_TechnologyUsed +{ + bool mSatellite:1; + bool mCellular:1; + bool mWiFi:1; + bool mSensors:1; + bool mReferenceLocation:1; + + // Padding out 27 bits + UINT8 mReserved1:3; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x24 for LOC PositionReportIndication +struct sLOCPositionReportIndication_DilutionOfPrecision +{ + float mPositionDilutionOfPrecision; + float mHorizontalDilutionOfPrecision; + float mVerticalDilutionOfPrecision; +}; + +// Structure to describe indication TLV 0x25 for LOC PositionReportIndication +struct sLOCPositionReportIndication_UTCTimestamp +{ + UINT64 mUTCTimestampMilliseconds; +}; + +// Structure to describe indication TLV 0x26 for LOC PositionReportIndication +struct sLOCPositionReportIndication_LeapSeconds +{ + UINT8 mLeapSeconds; +}; + +// Structure to describe indication TLV 0x27 for LOC PositionReportIndication +struct sLOCPositionReportIndication_GPSTime +{ + UINT16 mGPSWeeks; + UINT32 mGPSTimeOfWeekMilliseconds; +}; + +// Structure to describe indication TLV 0x28 for LOC PositionReportIndication +struct sLOCPositionReportIndication_TimeUncertainty +{ + float mTimeUncertaintyMilliseconds; +}; + +// Structure to describe indication TLV 0x29 for LOC PositionReportIndication +struct sLOCPositionReportIndication_TimeSource +{ + eQMILOCTimeSource mTimeSource; +}; + +// Structure to describe indication TLV 0x2A for LOC PositionReportIndication +struct sLOCPositionReportIndication_SensorDataUsage +{ + bool mAccelerometerUsed:1; + bool mGyroUsed:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; + + bool mAidedHeading:1; + bool mAidedSpeed:1; + bool mAidedPosition:1; + bool mAidedVelocity:1; + + // Padding out 28 bits + UINT8 mReserved3:4; + UINT8 mReserved4[3]; +}; + +// Structure to describe indication TLV 0x2B for LOC PositionReportIndication +struct sLOCPositionReportIndication_SessionFixCount +{ + UINT32 mSessionFixCount; +}; + +// Structure to describe indication TLV 0x2C for LOC PositionReportIndication +struct sLOCPositionReportIndication_SatellitesUsed +{ + UINT8 mSatellitesUsedCount; + + // This array must be the size specified by mSatellitesUsedCount + // UINT16 mSatellitesUsed[1]; +}; + +// Structure to describe indication TLV 0x01 for LOC GNSSSatelliteInfoIndication +struct sLOCGNSSSatelliteInfoIndication_AltitudeSource +{ + eQMILOCAltitudeAssumed mAltitudeAssumed; +}; + +// Structure to describe indication TLV 0x10 for LOC GNSSSatelliteInfoIndication +struct sLOCGNSSSatelliteInfoIndication_SatelliteInfo +{ + UINT8 mSatelliteInfoCount; + bool mValidSystem:1; + bool mValidGNSSSatelliteID:1; + bool mValidHealthStatus:1; + bool mValidProcessStatus:1; + bool mValidSatelliteInfoMask:1; + bool mValidElevation:1; + bool mValidAzimuth:1; + bool mValidSignalToNoiseRatio:1; + + // Padding out 24 bits + UINT8 mReserved1[3]; + + eQMILOCSystem mSystem; + UINT16 mGNSSSatelliteID; + eQMILOCHealthStatus mHealthStatus; + eQMILOCSatelliteStatus mSatelliteStatus; + bool mHasEphemeris:1; + bool mHasAlmanac:1; + + // Padding out 6 bits + UINT8 mReserved2:6; + + float mElevationDegrees; + float mAzimuthDegrees; + float mSignalToNoiseRatiodBHz; +}; + +// Structure to describe indication TLV 0x01 for LOC NMEAIndication +struct sLOCNMEAIndication_NMEAString +{ + // String is variable length, but must be size of the container + // char mNMEAString[1]; +}; + +// Structure to describe request TLV 0x01 for LOCNetworkInitiated() +struct sLOCNetworkInitiatedRequestIndication_NotificationType +{ + eQMILOCNotificationType mNotificationType; +}; + +// Structure to describe request TLV 0x10 for LOCNetworkInitiated() +struct sLOCNetworkInitiatedRequestIndication_VxRequest1 +{ + INT8 mPositionQoSIncluded; + UINT8 mPositionQoSTimeoutSeconds; + UINT32 mMaxNumberOfFixes; + UINT32 mTimeBetweenFixesSeconds; + eQMILOCPositionMode mPosistionMode; + eQMILOCEncodingScheme mEncodingScheme; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_VxRequest2 +{ + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCNetworkInitiatedRequestIndication_VxRequest +{ + sLOCNetworkInitiatedRequestIndication_VxRequest1 mLOCNetworkInitiatedRequestIndication_VxRequest1; + sLOCNetworkInitiatedRequestIndication_VxRequest2 mLOCNetworkInitiatedRequestIndication_VxRequest2; +}; + +// Structure to describe request TLV 0x11 for LOCNetworkInitiated() +struct sLOCNetworkInitiatedRequestIndication_SUPLRequest1 +{ + bool mValidServerInfo:1; + bool mValidSessionID:1; + bool mValidHash:1; + bool mValidPositionMethod:1; + bool mValidDataCodingScheme:1; + bool mValidRequestorID:1; + bool mValidClientName:1; + bool mValidQualityOfPosition:1; + bool mValidUserResponseTimer:1; + + // Padding out 23 bits + UINT8 mReserved1:7; + UINT8 mReserved2[2]; + + bool mIPv4:1; + bool mIPv6:1; + bool mURL:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + UINT32 mIPv4Address; + UINT16 mIPv4Port; + UINT8 mIPv6Address[16]; + UINT32 mIPv6Port; + UINT8 mURLAddressLength; + + // This array must be the size specified by mURLAddressLength + // char mURLAddress[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_SUPLRequest2 +{ + UINT8 mSUPLSessionID[4]; + UINT8 mSUPLHash[8]; + eQMILOCPosition mPositionMethod; + eQMILOCDataCodingScheme mDataCodingScheme; + eQMILOCFormatType mRequestorIDFormatType; + UINT8 mRequestorIDFormattedStringLength; + + // This array must be the size specified by mRequestorIDFormattedStringLength + // UINT8 mRequestorIDFormattedString[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_SUPLRequest3 +{ + eQMILOCFormatType mClientNameFormatType; + UINT8 mClientNameFormattedStringLength; + + // This array must be the size specified by mClientNameFormattedStringLength + // UINT8 mClientNameFormattedString[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_SUPLRequest4 +{ + bool mQoPHorizontalAccelerationValid:1; + bool mQoPVerticalAccelerationValid:1; + bool mQoPMaximumAge:1; + bool mQoPDelayValid:1; + + // Padding out 4 bits + UINT8 mReserved4:4; + + UINT8 mHorizontalAccuracyMeters; + UINT8 mVerticalAccuracyMeters; + UINT16 mMaximumLocationAgeSeconds; + UINT8 mDelaySeconds; + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCNetworkInitiatedRequestIndication_SUPLRequest +{ + sLOCNetworkInitiatedRequestIndication_SUPLRequest1 mLOCNetworkInitiatedRequestIndication_SUPLRequest1; + sLOCNetworkInitiatedRequestIndication_SUPLRequest2 mLOCNetworkInitiatedRequestIndication_SUPLRequest2; + sLOCNetworkInitiatedRequestIndication_SUPLRequest3 mLOCNetworkInitiatedRequestIndication_SUPLRequest3; + sLOCNetworkInitiatedRequestIndication_SUPLRequest4 mLOCNetworkInitiatedRequestIndication_SUPLRequest4; +}; + +// Structure to describe request TLV 0x12 for LOCNetworkInitiated() +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest1 +{ + bool mValidInvokeID:1; + bool mValidDataCodingScheme:1; + bool mValidNotificationText:1; + bool mValidClientAddress:1; + bool mValidLocationType:1; + bool mValidRequestorID:1; + bool mValidCodewordString:1; + bool mValidServiceTypeMask:1; + bool mValidUserResponseTImer:1; + + // Padding out 7 bits + UINT8 mReserved1:7; + + UINT8 mInvokeID; + eQMILOCDataCodingScheme mDataCodingScheme; + UINT8 mNotificationTextLength; + + // This array must be the size specified by mNotificationTextLength + // UINT8 mNotificationText[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest2 +{ + UINT8 mClientAddressLength; + + // This array must be the size specified by mClientAddressLength + // UINT8 mClientAddress[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest3 +{ + eQMILOCLocationType mLocationType; + eQMILOCDataCodingScheme mRequestorIDDataCodingScheme; + UINT8 mRequestorIDCodedStingLength; + + // This array must be the size specified by mRequestorIDCodedStingLength + // UINT8 mRequestorIDCodedString[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest4 +{ + eQMILOCDataCodingScheme mCodewordStringDataCodingScheme; + UINT8 mCodewordStringCodedStringLength; + + // This array must be the size specified by mCodewordStringCodedStringLength + // UINT8 mCodewordStringCodedString[1]; +}; + +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest5 +{ + UINT8 mServiceTypeID; + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest +{ + sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest1 mLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest1; + sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest2 mLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest2; + sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest3 mLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest3; + sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest4 mLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest4; + sLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest5 mLOCNetworkInitiatedRequestIndication_UMTSControlPlaneRequest5; +}; + +// Structure to describe request TLV 0x13 for LOCNetworkInitiated() +struct sLOCNetworkInitiatedRequestIndication_ServiceInteractionRequest +{ + INT8 mPositionQoSIncluded; + UINT8 mPositionQoSTimeoutSeconds; + UINT32 mMaxNumberOfFixes; + UINT32 mTimeBetweenFixesSeconds; + eQMILOCPositionMode mPosistionMode; + eQMILOCEncodingScheme mEncodingScheme; + UINT8 mRequestorIDLength; + UINT8 mRequestorID; + UINT16 mUserResponseTimerSeconds; + eQMILOCServiceInteractionType mServiceInteractionType; +}; + +// Structure to describe request TLV 0x14 for LOCNetworkInitiated() +struct sLOCNetworkInitiatedRequestIndication_SUPLVersion2Extension +{ + bool mWLAN:1; + bool mGSM:1; + bool mWCDMA:1; + bool mCDMA:1; + bool mHRDP:1; + bool mUMB:1; + bool mLTE:1; + bool mWIMAX:1; + bool mHISTORIC:1; + bool mNONSVRV:1; + + // Padding out 6 bits + UINT8 mReserved1:6; + + eQMILOCTriggerType mTriggerType; + bool mGPS:1; + bool mGLONASS:1; + bool mGALILEO:1; + bool mSBAS:1; + bool mQZSS:1; + bool mMODERNGPS:1; + + // Padding out 10 bits + UINT8 mReserved2:2; + UINT8 mReserved3; +}; + +// Structure to describe indication TLV 0x10 for LOC InjectTimeIndication +struct sLOCInjectTimeIndication_TimeServerInfo +{ + UINT32 mDelayThresholdMilliseconds; + UINT8 mServerListLength; + + struct sServer + { + UINT8 mServerURLLength; + + // This array must be the size specified by mServerURLLength + // char mServerURL[1]; + }; + + // This array must be the size specified by mServerListLength + // sServer mServers[1]; +}; + +// Structure to describe indication TLV 0x01 for LOC InjectPredictedOrbitsIndication +struct sLOCInjectPredictedOrbitsIndication_AllowedSize +{ + UINT32 mMaximumFileSizeBytes; + UINT32 mMaximumPartSizeBytes; +}; + +// Structure to describe indication TLV 0x10 for LOC InjectPredictedOrbitsIndication +struct sLOCInjectPredictedOrbitsIndication_ServerList +{ + UINT8 mServerListLength; + + struct sServer + { + UINT8 mServerURLLength; + + // This array must be the size specified by mServerURLLength + // char mServerURL[1]; + }; + + // This array must be the size specified by mServerListLength + // sServer mServers[1]; +}; + +// Structure to describe indication TLV 0x01 for LOC InjectPositionIndication +struct sLOCInjectPositionIndication_Latitude +{ + double mLatitudeDegrees; +}; + +// Structure to describe indication TLV 0x03 for LOC InjectPositionIndication +struct sLOCInjectPositionIndication_HorizontalUncertaintyCircular +{ + float mHorizontalUncertaintyCircularMeters; +}; + +// Structure to describe indication TLV 0x04 for LOC InjectPositionIndication +struct sLOCInjectPositionIndication_UTCTimestamp +{ + UINT64 mUTCTimestampMilliseconds; +}; + +// Structure to describe indication TLV 0x01 for LOC EngineStateIndication +struct sLOCEngineStateIndication_EngineState +{ + eQMILOCEngineState mEngineState; +}; + +// Structure to describe indication TLV 0x01 for LOC FixSessionStateIndication +struct sLOCFixSessionStateIndication_SessionState +{ + eQMILOCSessionState mSessionState; +}; + +// Structure to describe indication TLV 0x10 for LOC FixSessionStateIndication +struct sLOCFixSessionStateIndication_SessionID +{ + UINT8 mSessionID; +}; + +// Structure to describe request TLV 0x01 for LOCWiFi() +struct sLOCWiFiRequestIndication_RequestType +{ + eQMILOCRequestType mRequestType; +}; + +// Structure to describe request TLV 0x10 for LOCWiFi() +struct sLOCWiFiRequestIndication_TimeBetweenFixes +{ + UINT16 mTimeBetweenFixesMilliseconds; +}; + +// Structure to describe indication TLV 0x10 for LOC SensorStreamingReadyStatusIndication +struct sLOCSensorStreamingReadyStatusIndication_AccelerometerReady +{ + INT8 mReadyForInjection; + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe indication TLV 0x11 for LOC SensorStreamingReadyStatusIndication +struct sLOCSensorStreamingReadyStatusIndication_GyrometerReady +{ + INT8 mReadyForInjection; + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe request TLV 0x01 for LOCTimeSync() +struct sLOCTimeSyncRequestIndication_ReferenceCounter +{ + UINT32 mReferenceCounter; +}; + +// Structure to describe indication TLV 0x01 for LOC SetSPIStreamingReportIndication +struct sLOCSetSPIStreamingReportIndication_SPIRequests +{ + INT8 mEnableSPIRequests; +}; + +// Structure to describe request TLV 0x01 for LOCLocationServerConnection() +struct sLOCLocationServerConnectionRequestIndication_ConnectionHandle +{ + UINT32 mConnectionHandle; +}; + +// Structure to describe request TLV 0x03 for LOCLocationServerConnection() +struct sLOCLocationServerConnectionRequestIndication_WWANType +{ + eQMILOCWWANType mWWANType; +}; + +// Structure to describe indication TLV 0x10 for LOC GetServiceRevisionIndication +struct sLOCGetServiceRevisionIndication_GNSSMeasurementEngineFirmwareVersion +{ + // String is variable length, but must be size of the container + // char mFirmwareVersion[1]; +}; + +// Structure to describe indication TLV 0x11 for LOC GetServiceRevisionIndication +struct sLOCGetServiceRevisionIndication_GNSSHostedSoftwareVersion +{ + // String is variable length, but must be size of the container + // char mSoftwareVersion[1]; +}; + +// Structure to describe indication TLV 0x12 for LOC GetServiceRevisionIndication +struct sLOCGetServiceRevisionIndication_GNSSSoftwareVersion +{ + // String is variable length, but must be size of the container + // char mSoftwareVersion[1]; +}; + +// Structure to describe indication TLV 0x10 for LOC GetFixCriteriaIndication +struct sLOCGetFixCriteriaIndication_HorizontalAccuracy +{ + eQMILOCHorizontalAccuracy mHorizontalAccuracy; +}; + +// Structure to describe indication TLV 0x11 for LOC GetFixCriteriaIndication +struct sLOCGetFixCriteriaIndication_IntermediateFixes +{ + eQMILOCIntermediateReportState mEnableIntermediateReports; +}; + +// Structure to describe indication TLV 0x12 for LOC GetFixCriteriaIndication +struct sLOCGetFixCriteriaIndication_MinimumIntervalBetweenFixes +{ + UINT32 mMinimumTimeIntervalMilliseconds; +}; + +// Structure to describe indication TLV 0x13 for LOC GetFixCriteriaIndication +struct sLOCGetFixCriteriaIndication_ApplicationID1 +{ + UINT8 mApplicationProviderLength; + + // This array must be the size specified by mApplicationProviderLength + // char mApplicationProvider[1]; +}; + +struct sLOCGetFixCriteriaIndication_ApplicationID2 +{ + UINT8 mApplicationNameLength; + + // This array must be the size specified by mApplicationNameLength + // char mApplicationName[1]; +}; + +struct sLOCGetFixCriteriaIndication_ApplicationID3 +{ + INT8 mApplicationVersionValid; + UINT8 mApplicationVersionLength; + + // This array must be the size specified by mApplicationVersionLength + // char mApplicationVersion[1]; +}; + +struct sLOCGetFixCriteriaIndication_ApplicationID +{ + sLOCGetFixCriteriaIndication_ApplicationID1 mLOCGetFixCriteriaIndication_ApplicationID1; + sLOCGetFixCriteriaIndication_ApplicationID2 mLOCGetFixCriteriaIndication_ApplicationID2; + sLOCGetFixCriteriaIndication_ApplicationID3 mLOCGetFixCriteriaIndication_ApplicationID3; +}; + +// Structure to describe request TLV 0x01 for LOCProvideNIUserResponse() +struct sLOCProvideNIUserResponseRequest_UserResponse +{ + eQMILOCUserResponse mUserResponse; +}; + +// Structure to describe request TLV 0x10 for LOCProvideNIUserResponse() +struct sLOCProvideNIUserResponseRequest_VxRequest1 +{ + INT8 mPositionQoSIncluded; + UINT8 mPositionQoSTimeoutSeconds; + UINT32 mMaxNumberOfFixes; + UINT32 mTimeBetweenFixesSeconds; + eQMILOCPositionMode mPosistionMode; + eQMILOCEncodingScheme mEncodingScheme; + UINT8 mRequestorIDLength; + + // This array must be the size specified by mRequestorIDLength + // UINT8 mRequestorID[1]; +}; + +struct sLOCProvideNIUserResponseRequest_VxRequest2 +{ + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCProvideNIUserResponseRequest_VxRequest +{ + sLOCProvideNIUserResponseRequest_VxRequest1 mLOCProvideNIUserResponseRequest_VxRequest1; + sLOCProvideNIUserResponseRequest_VxRequest2 mLOCProvideNIUserResponseRequest_VxRequest2; +}; + +// Structure to describe request TLV 0x11 for LOCProvideNIUserResponse() +struct sLOCProvideNIUserResponseRequest_SUPLRequest1 +{ + bool mValidServerInfo:1; + bool mValidSessionID:1; + bool mValidHash:1; + bool mValidPositionMethod:1; + bool mValidDataCodingScheme:1; + bool mValidRequestorID:1; + bool mValidClientName:1; + bool mValidQualityOfPosition:1; + bool mValidUserResponseTimer:1; + + // Padding out 23 bits + UINT8 mReserved1:7; + UINT8 mReserved2[2]; + + bool mIPv4:1; + bool mIPv6:1; + bool mURL:1; + + // Padding out 5 bits + UINT8 mReserved3:5; + + UINT32 mIPv4Address; + UINT16 mIPv4Port; + UINT8 mIPv6Address[16]; + UINT32 mIPv6Port; + UINT8 mURLAddressLength; + + // This array must be the size specified by mURLAddressLength + // char mURLAddress[1]; +}; + +struct sLOCProvideNIUserResponseRequest_SUPLRequest2 +{ + UINT8 mSUPLSessionID[4]; + UINT8 mSUPLHash[8]; + eQMILOCPosition mPositionMethod; + eQMILOCDataCodingScheme mDataCodingScheme; + eQMILOCFormatType mRequestorIDFormatType; + UINT8 mRequestorIDFormattedStringLength; + + // This array must be the size specified by mRequestorIDFormattedStringLength + // UINT8 mRequestorIDFormattedString[1]; +}; + +struct sLOCProvideNIUserResponseRequest_SUPLRequest3 +{ + eQMILOCFormatType mClientNameFormatType; + UINT8 mClientNameFormattedStringLength; + + // This array must be the size specified by mClientNameFormattedStringLength + // UINT8 mClientNameFormattedString[1]; +}; + +struct sLOCProvideNIUserResponseRequest_SUPLRequest4 +{ + bool mQoPHorizontalAccelerationValid:1; + bool mQoPVerticalAccelerationValid:1; + bool mQoPMaximumAge:1; + bool mQoPDelayValid:1; + + // Padding out 4 bits + UINT8 mReserved4:4; + + UINT8 mHorizontalAccuracyMeters; + UINT8 mVerticalAccuracyMeters; + UINT16 mMaximumLocationAgeSeconds; + UINT8 mDelaySeconds; + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCProvideNIUserResponseRequest_SUPLRequest +{ + sLOCProvideNIUserResponseRequest_SUPLRequest1 mLOCProvideNIUserResponseRequest_SUPLRequest1; + sLOCProvideNIUserResponseRequest_SUPLRequest2 mLOCProvideNIUserResponseRequest_SUPLRequest2; + sLOCProvideNIUserResponseRequest_SUPLRequest3 mLOCProvideNIUserResponseRequest_SUPLRequest3; + sLOCProvideNIUserResponseRequest_SUPLRequest4 mLOCProvideNIUserResponseRequest_SUPLRequest4; +}; + +// Structure to describe request TLV 0x12 for LOCProvideNIUserResponse() +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest1 +{ + bool mValidInvokeID:1; + bool mValidDataCodingScheme:1; + bool mValidNotificationText:1; + bool mValidClientAddress:1; + bool mValidLocationType:1; + bool mValidRequestorID:1; + bool mValidCodewordString:1; + bool mValidServiceTypeMask:1; + bool mValidUserResponseTImer:1; + + // Padding out 7 bits + UINT8 mReserved1:7; + + UINT8 mInvokeID; + eQMILOCDataCodingScheme mDataCodingScheme; + UINT8 mNotificationTextLength; + + // This array must be the size specified by mNotificationTextLength + // UINT8 mNotificationText[1]; +}; + +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest2 +{ + UINT8 mClientAddressLength; + + // This array must be the size specified by mClientAddressLength + // UINT8 mClientAddress[1]; +}; + +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest3 +{ + eQMILOCLocationType mLocationType; + eQMILOCDataCodingScheme mRequestorIDDataCodingScheme; + UINT8 mRequestorIDCodedStingLength; + + // This array must be the size specified by mRequestorIDCodedStingLength + // UINT8 mRequestorIDCodedString[1]; +}; + +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest4 +{ + eQMILOCDataCodingScheme mCodewordStringDataCodingScheme; + UINT8 mCodewordStringCodedStringLength; + + // This array must be the size specified by mCodewordStringCodedStringLength + // UINT8 mCodewordStringCodedString[1]; +}; + +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest5 +{ + UINT8 mServiceTypeID; + UINT16 mUserResponseTimerSeconds; +}; + +struct sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest +{ + sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest1 mLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest1; + sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest2 mLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest2; + sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest3 mLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest3; + sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest4 mLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest4; + sLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest5 mLOCProvideNIUserResponseRequest_UMTSControlPlaneRequest5; +}; + +// Structure to describe request TLV 0x13 for LOCProvideNIUserResponse() +struct sLOCProvideNIUserResponseRequest_ServiceInteractionRequest +{ + INT8 mPositionQoSIncluded; + UINT8 mPositionQoSTimeoutSeconds; + UINT32 mMaxNumberOfFixes; + UINT32 mTimeBetweenFixesSeconds; + eQMILOCPositionMode mPosistionMode; + eQMILOCEncodingScheme mEncodingScheme; + UINT8 mRequestorIDLength; + UINT8 mRequestorID; + UINT16 mUserResponseTimerSeconds; + eQMILOCServiceInteractionType mServiceInteractionType; +}; + +// Structure to describe request TLV 0x14 for LOCProvideNIUserResponse() +struct sLOCProvideNIUserResponseRequest_SUPLVersion2Extension +{ + bool mWLAN:1; + bool mGSM:1; + bool mWCDMA:1; + bool mCDMA:1; + bool mHRDP:1; + bool mUMB:1; + bool mLTE:1; + bool mWIMAX:1; + bool mHISTORIC:1; + bool mNONSVRV:1; + + // Padding out 6 bits + UINT8 mReserved1:6; + + eQMILOCTriggerType mTriggerType; + bool mGPS:1; + bool mGLONASS:1; + bool mGALILEO:1; + bool mSBAS:1; + bool mQZSS:1; + bool mMODERNGPS:1; + + // Padding out 10 bits + UINT8 mReserved2:2; + UINT8 mReserved3; +}; + +// Structure to describe request TLV 0x01 for LOCInjectPredictedOrbitsData() +struct sLOCInjectPredictedOrbitsDataRequest_TotalSize +{ + UINT32 mTotalSize; +}; + +// Structure to describe request TLV 0x03 for LOCInjectPredictedOrbitsData() +struct sLOCInjectPredictedOrbitsDataRequest_PartNumber +{ + UINT16 mPartNumber; +}; + +// Structure to describe request TLV 0x04 for LOCInjectPredictedOrbitsData() +struct sLOCInjectPredictedOrbitsDataRequest_PartData +{ + UINT16 mPartDataLength; + + // This array must be the size specified by mPartDataLength + // UINT8 mPartData[1]; +}; + +// Structure to describe request TLV 0x10 for LOCInjectPredictedOrbitsData() +struct sLOCInjectPredictedOrbitsDataRequest_FormatType +{ + eQMILOCOrbitsFormatType mOrbitsFormatType; +}; + +// Structure to describe indication TLV 0x10 for LOC InjectPredictedOrbitsDataIndication +struct sLOCInjectPredictedOrbitsDataIndication_PartNumber +{ + UINT16 mPartNumber; +}; + +// Structure to describe indication TLV 0x10 for LOC GetPredictedOrbitsDataSourceIndication +struct sLOCGetPredictedOrbitsDataSourceIndication_AllowedSizes +{ + UINT32 mMaximumFileSizeBytes; + UINT32 mMaximumPartSizeBytes; +}; + +// Structure to describe indication TLV 0x11 for LOC GetPredictedOrbitsDataSourceIndication +struct sLOCGetPredictedOrbitsDataSourceIndication_ServerList +{ + UINT8 mServerListLength; + + struct sServer + { + UINT8 mServerURLLength; + + // This array must be the size specified by mServerURLLength + // char mServerURL[1]; + }; + + // This array must be the size specified by mServerListLength + // sServer mServers[1]; +}; + +// Structure to describe indication TLV 0x10 for LOC GetPredictedOrbitsDataValidityIndication +struct sLOCGetPredictedOrbitsDataValidityIndication_ValidityInfo +{ + UINT64 mStartTimeInUTC; + UINT16 mDurationHours; +}; + +// Structure to describe request TLV 0x01 for LOCInjectUTCTime() +struct sLOCInjectUTCTimeRequest_UTCTime +{ + UINT64 mUTCTimestampMilliseconds; +}; + +// Structure to describe request TLV 0x10 for LOCInjectPosition() +struct sLOCInjectPositionRequest_Latitude +{ + double mLatitudeDegrees; +}; + +// Structure to describe request TLV 0x11 for LOCInjectPosition() +struct sLOCInjectPositionRequest_Longitude +{ + double mLongitudeDegrees; +}; + +// Structure to describe request TLV 0x12 for LOCInjectPosition() +struct sLOCInjectPositionRequest_HorizontalUncertaintyCircular +{ + float mHorizontalUncertaintyCircularMeters; +}; + +// Structure to describe request TLV 0x13 for LOCInjectPosition() +struct sLOCInjectPositionRequest_HorizontalConfidence +{ + UINT8 mHorizontalConfidencePercent; +}; + +// Structure to describe request TLV 0x14 for LOCInjectPosition() +struct sLOCInjectPositionRequest_HorizontalReliability +{ + eQMILOCReliability mHorizontalReliability; +}; + +// Structure to describe request TLV 0x15 for LOCInjectPosition() +struct sLOCInjectPositionRequest_AltitudeFromEllipsoid +{ + float mAltitudeFromEllipsoidMeters; +}; + +// Structure to describe request TLV 0x16 for LOCInjectPosition() +struct sLOCInjectPositionRequest_AltitudeFromSeaLevel +{ + float mAltitudeFromSeaLevelMeters; +}; + +// Structure to describe request TLV 0x17 for LOCInjectPosition() +struct sLOCInjectPositionRequest_VerticalUncertainty +{ + float mVerticalUncertaintyMeters; +}; + +// Structure to describe request TLV 0x18 for LOCInjectPosition() +struct sLOCInjectPositionRequest_VerticalConfidence +{ + UINT8 mVerticalConfidencePercent; +}; + +// Structure to describe request TLV 0x19 for LOCInjectPosition() +struct sLOCInjectPositionRequest_VerticalReliability +{ + eQMILOCReliability mVerticalReliability; +}; + +// Structure to describe request TLV 0x1A for LOCInjectPosition() +struct sLOCInjectPositionRequest_AltitudeSource +{ + eQMILOCAltitudeSource mAltitudeSource; + eQMILOCLinkage mLinkage; + eQMILOCCoverage mCoverage; +}; + +// Structure to describe request TLV 0x1B for LOCInjectPosition() +struct sLOCInjectPositionRequest_UTCTimestamp +{ + UINT64 mUTCTimestampMilliseconds; +}; + +// Structure to describe request TLV 0x1C for LOCInjectPosition() +struct sLOCInjectPositionRequest_PositionAge +{ + UINT32 mAgeTimestampMilliseconds; +}; + +// Structure to describe request TLV 0x1D for LOCInjectPosition() +struct sLOCInjectPositionRequest_PositionSource +{ + eQMILOCPositionSource mPositionSource; +}; + +// Structure to describe request TLV 0x01 for LOCSetEngineLock() +struct sLOCSetEngineLockRequest_LockType +{ + eQMILOCLockType mLockType; +}; + +// Structure to describe indication TLV 0x10 for LOC GetEngineLockIndication +struct sLOCGetEngineLockIndication_LockType +{ + eQMILOCLockType mLockType; +}; + +// Structure to describe request TLV 0x01 for LOCSetSBASConfig() +struct sLOCSetSBASConfigRequest_SBASConfig +{ + INT8 mSBASEnabled; +}; + +// Structure to describe response TLV 0x10 for LOCGetSBASConfig() +struct sLOCGetSBASConfigResponse_SBASConfig +{ + INT8 mSBASEnabled; +}; + +// Structure to describe request TLV 0x01 for LOCSetNMEATypes() +struct sLOCSetNMEATypesRequest_SentenceTypes +{ + bool mGGASentence:1; + bool mRMCSentence:1; + bool mGSVSentence:1; + bool mGSASentence:1; + bool mVTGSentence:1; + bool mPQXFISentence:1; + bool mPSTISSentence:1; + + // Padding out 25 bits + UINT8 mReserved1:1; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x10 for LOC GetNMEATypesIndication +struct sLOCGetNMEATypesIndication_SentenceType +{ + bool mGGASentence:1; + bool mRMCSentence:1; + bool mGSVSentence:1; + bool mGSASentence:1; + bool mVTGSentence:1; + bool mPQXFISentence:1; + bool mPSTISSentence:1; + + // Padding out 25 bits + UINT8 mReserved1:1; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x01 for LOCSetLowPowerMode() +struct sLOCSetLowPowerModeRequest_EnableLPM +{ + INT8 mEnableLowPowerMode; +}; + +// Structure to describe indication TLV 0x10 for LOC GetLowPowerModeIndication +struct sLOCGetLowPowerModeIndication_EnableLPM +{ + INT8 mEnableLowPowerMode; +}; + +// Structure to describe request TLV 0x01 for LOCSetLocationServer() +struct sLOCSetLocationServerRequest_ServerType +{ + eQMILOCLocationServerType mServerType; +}; + +// Structure to describe request TLV 0x10 for LOCSetLocationServer() +struct sLOCSetLocationServerRequest_IPv4Address +{ + UINT32 mIPv4Address; + UINT16 mIPv4Port; +}; + +// Structure to describe request TLV 0x11 for LOCSetLocationServer() +struct sLOCSetLocationServerRequest_IPv6Address +{ + UINT8 mIPv6Address[16]; + UINT32 mIPv6Port; +}; + +// Structure to describe request TLV 0x12 for LOCSetLocationServer() +struct sLOCSetLocationServerRequest_URLAddress +{ + // String is variable length, but must be size of the container + // char mURLAddress[1]; +}; + +// Structure to describe request TLV 0x01 for LOCGetLocationServer() +struct sLOCGetLocationServerRequest_ServerType +{ + eQMILOCLocationServerType mServerType; +}; + +// Structure to describe request TLV 0x10 for LOCGetLocationServer() +struct sLOCGetLocationServerRequest_AddressType +{ + bool mIPv4:1; + bool mIPv6:1; + bool mURL:1; + + // Padding out 5 bits + UINT8 mReserved1:5; +}; + +// Structure to describe indication TLV 0x10 for LOC GetLocationServerIndication +struct sLOCGetLocationServerIndication_IPv4Address +{ + UINT32 mIPv4Address; + UINT16 mIPv4Port; +}; + +// Structure to describe indication TLV 0x11 for LOC GetLocationServerIndication +struct sLOCGetLocationServerIndication_IPv6Address +{ + UINT8 mIPv6Address[16]; + UINT32 mIPv6Port; +}; + +// Structure to describe indication TLV 0x12 for LOC GetLocationServerIndication +struct sLOCGetLocationServerIndication_URLAddress +{ + // String is variable length, but must be size of the container + // char mURLAddress[1]; +}; + +// Structure to describe request TLV 0x01 for LOCDeleteAssistData() +struct sLOCDeleteAssistDataRequest_DeleteAll +{ + INT8 mDeleteAll; +}; + +// Structure to describe request TLV 0x10 for LOCDeleteAssistData() +struct sLOCDeleteAssistDataRequest_DeleteSatelliteInfo +{ + UINT8 mSatelliteInfoCount; + + struct sSatelliteInfo + { + UINT16 mGNSSSatelliteID; + eQMILOCSystem mSystem; + bool mDeleteEphemeris:1; + bool mDeleteAlmanac:1; + + // Padding out 6 bits + UINT8 mReserved1:6; + }; + + // This array must be the size specified by mSatelliteInfoCount + // sSatelliteInfo mSatelliteInfos[1]; +}; + +// Structure to describe request TLV 0x11 for LOCDeleteAssistData() +struct sLOCDeleteAssistDataRequest_DeleteGNSData +{ + bool mDeleteGPSSatelliteDirectory:1; + bool mDeleteGPSSatelliteSteering:1; + bool mDeleteGPSTime:1; + bool mDeleteGPSAlmanacCorrection:1; + bool mDeleteGLOSatelliteDirectory:1; + bool mDeleteGLOSatelliteSteering:1; + bool mDeleteGLOTime:1; + bool mDeleteGLOAlmanacCorrection:1; + bool mDeleteSBASSatelliteDirectory:1; + bool mDeleteSBASSatelliteSteering:1; + bool mDeletePosition:1; + bool mDeleteTime:1; + bool mDeleteIONO:1; + bool mDeleteUTCTimestamp:1; + bool mDeleteHealth:1; + bool mDeleteSAData:1; + bool mDeleteRTI:1; + bool mDeleteSatelliteNoExist:1; + bool mDeleteFrequencyBiasEstimate:1; + + // Padding out 45 bits + UINT8 mReserved1:5; + UINT8 mReserved2[5]; +}; + +// Structure to describe request TLV 0x12 for LOCDeleteAssistData() +struct sLOCDeleteAssistDataRequest_DeleteCellDatabase +{ + bool mDeletePosition:1; + bool mDeleteLatestGPSPosition:1; + bool mDeleteOTAPosition:1; + bool mDeleteEXTReferencePosition:1; + bool mDeleteTimeTag:1; + bool mDeleteCellID:1; + bool mDeleteCachedCellID:1; + bool mDeleteLastServerCell:1; + bool mDeleteCurrentServerCell:1; + bool mDeleteNeighborInfo:1; + + // Padding out 22 bits + UINT8 mReserved1:6; + UINT8 mReserved2[2]; +}; + +// Structure to describe request TLV 0x13 for LOCDeleteAssistData() +struct sLOCDeleteAssistDataRequest_DeleteClockInfo +{ + bool mDeleteTimeEstimate:1; + bool mDeleteFrequencyEstimate:1; + bool mDeleteWeekNumber:1; + bool mDeleteRTCTime:1; + bool mDeleteTimeTransfer:1; + bool mDeleteGPSTimeEstimate:1; + bool mDeleteGLOTimeEstimate:1; + bool mDeleteGLODayNumber:1; + bool mDeleteGLOYearNumber:1; + bool mDeleteGLORFGroupDelay:1; + bool mDeleteDisableTT:1; + + // Padding out 21 bits + UINT8 mReserved1:5; + UINT8 mReserved2[2]; +}; + +// Structure to describe request TLV 0x01 for LOCSetXTRATSessionControl() +struct sLOCSetXTRATSessionControlRequest_EnableXTRAT +{ + INT8 mEnableXTRAT; +}; + +// Structure to describe indication TLV 0x10 for LOC GetXTRATSessionControlIndication +struct sLOCGetXTRATSessionControlIndication_EnableXTRAT +{ + INT8 mEnableXTRAT; +}; + +// Structure to describe request TLV 0x10 for LOCInjectWiFiPosition() +struct sLOCInjectWiFiPositionRequest_Time +{ + UINT32 mWiFiPositionTime; +}; + +// Structure to describe request TLV 0x11 for LOCInjectWiFiPosition() +struct sLOCInjectWiFiPositionRequest_WiFiPosition +{ + double mLatitudeDegrees; + double mLongitudeDegrees; + UINT16 mHEPEMeters; + UINT8 mNumberOfAccessPointsUsed; + eQMILOCWiFiFixErrorCode mFixErrorCode; +}; + +// Structure to describe request TLV 0x12 for LOCInjectWiFiPosition() +struct sLOCInjectWiFiPositionRequest_AccessPointInformation +{ + UINT8 mNumberOfAccessPoints; + + struct sAccessPointInfo + { + UINT8 mMACAddress[6]; + INT32 mRSSIdBm; + UINT16 mChannel; + bool mBeingUsed:1; + bool mHiddenSSID:1; + bool mPrivate:1; + bool mInfrastructureMode:1; + + // Padding out 4 bits + UINT8 mReserved1:4; + }; + + // This array must be the size specified by mNumberOfAccessPoints + // sAccessPointInfo mAccessPointInfos[1]; +}; + +// Structure to describe request TLV 0x13 for LOCInjectWiFiPosition() +struct sLOCInjectWiFiPositionRequest_HorizontalReliability +{ + eQMILOCReliability mHorizontalReliability; +}; + +// Structure to describe request TLV 0x01 for LOCProvideWiFiStatus() +struct sLOCProvideWiFiStatusRequest_WiFiStatus +{ + eQMILOCWiFiStatus mWiFiStatus; +}; + +// Structure to describe indication TLV 0x10 for LOC GetRegisteredEventsIndication +struct sLOCGetRegisteredEventsIndication_RegistrationMask +{ + bool mPositionReport:1; + bool mGNSSSatelliteInfo:1; + bool mNMEA:1; + bool mNINotifyVerifyRequest:1; + bool mInjectTimeRequest:1; + bool mInjectPredictedOrbitsRequest:1; + bool mInjectPositionRequest:1; + bool mEngineState:1; + bool mFixSessionState:1; + bool mWiFiRequest:1; + bool mSensorStreamingReadyStatus:1; + bool mTimeSyncRequest:1; + bool mSetSPIStreamingReport:1; + bool mLocationServerConnectionRequest:1; + bool mNIGeofenceNotification:1; + bool mGeofenceGeneralAlert:1; + bool mGeofenceBreachNotification:1; + + // Padding out 47 bits + UINT8 mReserved1:7; + UINT8 mReserved2[5]; +}; + +// Structure to describe request TLV 0x01 for LOCSetOperationMode() +struct sLOCSetOperationModeRequest_OperationMode +{ + eQMILOCOperationMode mOperationMode; +}; + +// Structure to describe indication TLV 0x10 for LOC GetOperationModeIndication +struct sLOCGetOperationModeIndication_OperationMode +{ + eQMILOCOperationMode mOperationMode; +}; + +// Structure to describe request TLV 0x01 for LOCSetSPIStatus() +struct sLOCSetSPIStatusRequest_StationaryStatus +{ + INT8 mDeviceIsStationary; +}; + +// Structure to describe request TLV 0x10 for LOCSetSPIStatus() +struct sLOCSetSPIStatusRequest_Confidence +{ + UINT8 mStationaryConfidence; +}; + +// Structure to describe request TLV 0x10 for LOCInjectSensorData() +struct sLOCInjectSensorDataRequest_OpaqueIdentifier +{ + UINT32 mOpaqueIdentifier; +}; + +// Structure to describe request TLV 0x11 for LOCInjectSensorData() +struct sLOCInjectSensorDataRequest_AccelerometerData +{ + UINT32 mTimeOfFirstSampleMilliseconds; + bool mSignReversal:1; + bool mSensorTimeIsModemTime:1; + + // Padding out 6 bits + UINT8 mReserved1:6; + + UINT8 mSensorDataLength; + + struct sSensorData + { + UINT16 mTimeOffsetMilliseconds; + float mXAxis; + float mYAxis; + float mZAxis; + }; + + // This array must be the size specified by mSensorDataLength + // sSensorData mSensorDatas[1]; +}; + +// Structure to describe request TLV 0x12 for LOCInjectSensorData() +struct sLOCInjectSensorDataRequest_GyrometerData +{ + UINT32 mTimeOfFirstSampleMilliseconds; + bool mSignReversal:1; + bool mSensorTimeIsModemTime:1; + + // Padding out 6 bits + UINT8 mReserved1:6; + + UINT8 mSensorDataLength; + + struct sSensorData + { + UINT16 mTimeOffsetMilliseconds; + float mXAxis; + float mYAxis; + float mZAxis; + }; + + // This array must be the size specified by mSensorDataLength + // sSensorData mSensorDatas[1]; +}; + +// Structure to describe indication TLV 0x10 for LOC InjectSensorDataIndication +struct sLOCInjectSensorDataIndication_OpaqueIdentifier +{ + UINT32 mOpaqueIdentifier; +}; + +// Structure to describe indication TLV 0x11 for LOC InjectSensorDataIndication +struct sLOCInjectSensorDataIndication_AccelerometerSampleAccepted +{ + INT8 mAccelerometerSampleAccepted; +}; + +// Structure to describe indication TLV 0x12 for LOC InjectSensorDataIndication +struct sLOCInjectSensorDataIndication_GyrometerSamplesAccepted +{ + INT8 mGyrometerSamplesAccepted; +}; + +// Structure to describe request TLV 0x01 for LOCInjectTimeSyncData() +struct sLOCInjectTimeSyncDataRequest_ReferenceCounter +{ + UINT32 mReferenceCounter; +}; + +// Structure to describe request TLV 0x03 for LOCInjectTimeSyncData() +struct sLOCInjectTimeSyncDataRequest_SensorTransmitTime +{ + UINT32 mProcessTXTimeMilliseconds; +}; + +// Structure to describe request TLV 0x01 for LOCSetCradleMountConfig() +struct sLOCSetCradleMountConfigRequest_State +{ + eQMILOCCradleMountState mCradleMountState; +}; + +// Structure to describe request TLV 0x10 for LOCSetCradleMountConfig() +struct sLOCSetCradleMountConfigRequest_Confidence +{ + UINT8 mCradleMountConfidence; +}; + +// Structure to describe indication TLV 0x10 for LOC GetCradleMountConfigIndication +struct sLOCGetCradleMountConfigIndication_State +{ + eQMILOCCradleMountState mCradleMountState; +}; + +// Structure to describe indication TLV 0x11 for LOC GetCradleMountConfigIndication +struct sLOCGetCradleMountConfigIndication_Confidence +{ + UINT8 mCradleMountConfidence; +}; + +// Structure to describe request TLV 0x01 for LOCSetExternalPowerConfig() +struct sLOCSetExternalPowerConfigRequest_PowerState +{ + eQMILOCPowerState mPowerState; +}; + +// Structure to describe indication TLV 0x10 for LOC GetExternalPowerConfigIndication +struct sLOCGetExternalPowerConfigIndication_PowerState +{ + eQMILOCPowerState mPowerState; +}; + +// Structure to describe request TLV 0x01 for LOCProvideConnectionStatus() +struct sLOCProvideConnectionStatusRequest_ConnectionHandle +{ + UINT32 mConnectionHandle; +}; + +// Structure to describe request TLV 0x03 for LOCProvideConnectionStatus() +struct sLOCProvideConnectionStatusRequest_ConnectionStatus +{ + eQMILOCConnectionStatus mConnectionStatus; +}; + +// Structure to describe request TLV 0x10 for LOCProvideConnectionStatus() +struct sLOCProvideConnectionStatusRequest_APNProfile +{ + eQMILOCPDNType mPDNType; + UINT8 mAPNNameLength; + + // This array must be the size specified by mAPNNameLength + // char mAPNName[1]; +}; + +// Structure to describe request TLV 0x10 for LOCSetProtocolConfigParameters() +struct sLOCSetProtocolConfigParametersRequest_SUPLSecurity +{ + INT8 mSUPLSecurityEnabled; +}; + +// Structure to describe request TLV 0x11 for LOCSetProtocolConfigParameters() +struct sLOCSetProtocolConfigParametersRequest_VXVersion +{ + eQMILOCVXVersion mVXVersion; +}; + +// Structure to describe request TLV 0x12 for LOCSetProtocolConfigParameters() +struct sLOCSetProtocolConfigParametersRequest_SUPLVersion +{ + eQMILOCSUPLVersion mSUPLVersion; +}; + +// Structure to describe request TLV 0x13 for LOCSetProtocolConfigParameters() +struct sLOCSetProtocolConfigParametersRequest_LPPConfiguration +{ + bool mEnableUserPlane:1; + bool mEnableControlPlane:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x10 for LOC SetProtocolConfigParametersIndication +struct sLOCSetProtocolConfigParametersIndication_FailedParameters +{ + bool mSUPLSecurity:1; + bool mVXVersion:1; + bool mSUPLVersion:1; + + // Padding out 61 bits + UINT8 mReserved1:5; + UINT8 mReserved2[7]; +}; + +// Structure to describe request TLV 0x01 for LOCGetProtocolConfigParameters() +struct sLOCGetProtocolConfigParametersRequest_ConfigParameters +{ + bool mSUPLSecurity:1; + bool mVXVersion:1; + bool mSUPLVersion:1; + + // Padding out 61 bits + UINT8 mReserved1:5; + UINT8 mReserved2[7]; +}; + +// Structure to describe indication TLV 0x10 for LOC GetProtocolConfigParametersIndication +struct sLOCGetProtocolConfigParametersIndication_SUPLSecurity +{ + INT8 mSUPLSecurityEnabled; +}; + +// Structure to describe indication TLV 0x11 for LOC GetProtocolConfigParametersIndication +struct sLOCGetProtocolConfigParametersIndication_VXVersion +{ + eQMILOCVXVersion mVXVersion; +}; + +// Structure to describe indication TLV 0x12 for LOC GetProtocolConfigParametersIndication +struct sLOCGetProtocolConfigParametersIndication_SUPLVersion +{ + eQMILOCSUPLVersion mSUPLVersion; +}; + +// Structure to describe indication TLV 0x13 for LOC GetProtocolConfigParametersIndication +struct sLOCGetProtocolConfigParametersIndication_LPPConfiguration +{ + bool mEnableUserPlane:1; + bool mEnableControlPlane:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x10 for LOCSetSensorControlConfig() +struct sLOCSetSensorControlConfigRequest_SensorUsage +{ + eQMILOCSensorUsage mSensorUsage; +}; + +// Structure to describe indication TLV 0x10 for LOC GetSensorControlConfigIndication +struct sLOCGetSensorControlConfigIndication_SensorUsage +{ + eQMILOCSensorUsage mSensorUsage; +}; + +// Structure to describe request TLV 0x10 for LOCSetSensorProperties() +struct sLOCSetSensorPropertiesRequest_GyroBiasVariance +{ + float mGyroBiasVariance; +}; + +// Structure to describe request TLV 0x11 for LOCSetSensorProperties() +struct sLOCSetSensorPropertiesRequest_VelocityRWSD +{ + float mVelocityRandomWalkSpectralDensity; +}; + +// Structure to describe request TLV 0x12 for LOCSetSensorProperties() +struct sLOCSetSensorPropertiesRequest_AccelerationRWSD +{ + float mAccelerationRandomWalkSpectralDensity; +}; + +// Structure to describe request TLV 0x13 for LOCSetSensorProperties() +struct sLOCSetSensorPropertiesRequest_AngleRWSD +{ + float mAngleRandomWalkSpectralDensity; +}; + +// Structure to describe request TLV 0x14 for LOCSetSensorProperties() +struct sLOCSetSensorPropertiesRequest_RateRWSD +{ + float mRateRandomWalkSpectralDensity; +}; + +// Structure to describe indication TLV 0x10 for LOC SetSensorPropertiesIndication +struct sLOCSetSensorPropertiesIndication_Failures +{ + bool mGyroBiasVariance:1; + bool mVelocityRandomWalkSpectralDensity:1; + bool mAccelerationRandomWalkSpectralDensity:1; + bool mAngleRandomWalkSpectralDensity:1; + bool mRateRandomWalkSpectralDensity:1; + + // Padding out 27 bits + UINT8 mReserved1:3; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x01 for LOCGetSensorProperties() +struct sLOCGetSensorPropertiesRequest_Properties +{ + bool mGyroBiasVariance:1; + bool mVelocityRandomWalkSpectralDensity:1; + bool mAccelerationRandomWalkSpectralDensity:1; + bool mAngleRandomWalkSpectralDensity:1; + bool mRateRandomWalkSpectralDensity:1; + + // Padding out 27 bits + UINT8 mReserved1:3; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x10 for LOC GetSensorPropertiesIndication +struct sLOCGetSensorPropertiesIndication_GyroBiasVariance +{ + float mGyroBiasVariance; +}; + +// Structure to describe indication TLV 0x11 for LOC GetSensorPropertiesIndication +struct sLOCGetSensorPropertiesIndication_VelocityRWSD +{ + float mVelocityRandomWalkSpectralDensity; +}; + +// Structure to describe indication TLV 0x12 for LOC GetSensorPropertiesIndication +struct sLOCGetSensorPropertiesIndication_AccelerationRWSD +{ + float mAccelerationRandomWalkSpectralDensity; +}; + +// Structure to describe indication TLV 0x13 for LOC GetSensorPropertiesIndication +struct sLOCGetSensorPropertiesIndication_AngleRWSD +{ + float mAngleRandomWalkSpectralDensity; +}; + +// Structure to describe indication TLV 0x14 for LOC GetSensorPropertiesIndication +struct sLOCGetSensorPropertiesIndication_RateRWSD +{ + float mRateRandomWalkSpectralDensity; +}; + +// Structure to describe request TLV 0x10 for LOCSetSensorPerformanceConfig() +struct sLOCSetSensorPerformanceConfigRequest_ControlMode +{ + eQMILOCControlMode mControlMode; +}; + +// Structure to describe request TLV 0x11 for LOCSetSensorPerformanceConfig() +struct sLOCSetSensorPerformanceConfigRequest_AccelerometerSampling +{ + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe request TLV 0x12 for LOCSetSensorPerformanceConfig() +struct sLOCSetSensorPerformanceConfigRequest_GyrometerSampling +{ + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe request TLV 0x13 for LOCSetSensorPerformanceConfig() +struct sLOCSetSensorPerformanceConfigRequest_AlgorithmConfig +{ + bool mDisableINSPositioningFilter:1; + + // Padding out 31 bits + UINT8 mReserved1:7; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x10 for LOC SetSensorPerformanceConfigIndication +struct sLOCSetSensorPerformanceConfigIndication_FailedConfiguration +{ + bool mPerformanceMode:1; + bool mAccelerometerSampling:1; + bool mGyrometerSampling:1; + bool mAlgorithmConfig:1; + + // Padding out 28 bits + UINT8 mReserved1:4; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x10 for LOC GetSensorPerformanceConfigIndication +struct sLOCGetSensorPerformanceConfigIndication_ControlMode +{ + eQMILOCControlMode mControlMode; +}; + +// Structure to describe indication TLV 0x11 for LOC GetSensorPerformanceConfigIndication +struct sLOCGetSensorPerformanceConfigIndication_AccelerometerSampling +{ + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe indication TLV 0x12 for LOC GetSensorPerformanceConfigIndication +struct sLOCGetSensorPerformanceConfigIndication_GyrometerSampling +{ + UINT16 mSamplesPerBatch; + UINT16 mBatchesPerSecond; +}; + +// Structure to describe indication TLV 0x13 for LOC GetSensorPerformanceConfigIndication +struct sLOCGetSensorPerformanceConfigIndication_AlgorithmConfig +{ + bool mDisableINSPositioningFilter:1; + + // Padding out 31 bits + UINT8 mReserved1:7; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x01 for LOCInjectSUPLCertificate() +struct sLOCInjectSUPLCertificateRequest_ID +{ + UINT8 mSUPLCertificateID; +}; + +// Structure to describe request TLV 0x10 for LOCDeleteSUPLCertificate() +struct sLOCDeleteSUPLCertificateRequest_ID +{ + UINT8 mSUPLCertificateID; +}; + +// Structure to describe request TLV 0x10 for LOCSetPositionEngineConfig() +struct sLOCSetPositionEngineConfigRequest_InjectedPosition +{ + INT8 mUseInjectedPositionInCalculations; +}; + +// Structure to describe request TLV 0x11 for LOCSetPositionEngineConfig() +struct sLOCSetPositionEngineConfigRequest_FilterSVUsage +{ + INT8 mFilterUsageOfSVs; +}; + +// Structure to describe request TLV 0x12 for LOCSetPositionEngineConfig() +struct sLOCSetPositionEngineConfigRequest_StoreAssistData +{ + INT8 mStoreAssistanceData; +}; + +// Structure to describe indication TLV 0x10 for LOC SetPositionEngineConfigIndication +struct sLOCSetPositionEngineConfigIndication_FailedParameters +{ + bool mInjectedPosition:1; + bool mFilterSVUsage:1; + bool mStoreAssistData:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x01 for LOCGetPositionEngineConfig() +struct sLOCGetPositionEngineConfigRequest_Parameters +{ + bool mInjectedPosition:1; + bool mFilterSVUsage:1; + bool mStoreAssistData:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x10 for LOC GetPositionEngineConfigIndication +struct sLOCGetPositionEngineConfigIndication_InjectedPosition +{ + INT8 mUseInjectedPositionInCalculations; +}; + +// Structure to describe indication TLV 0x11 for LOC GetPositionEngineConfigIndication +struct sLOCGetPositionEngineConfigIndication_FilterSVUsage +{ + INT8 mFilterUsageOfSVs; +}; + +// Structure to describe indication TLV 0x12 for LOC GetPositionEngineConfigIndication +struct sLOCGetPositionEngineConfigIndication_StoreAssistData +{ + INT8 mStoreAssistanceData; +}; + +// Structure to describe indication TLV 0x01 for LOC NetworkInitiatedGeofenceIndication +struct sLOCNetworkInitiatedGeofenceIndication_GeofenceID +{ + UINT32 mGeofenceID; +}; + +// Structure to describe indication TLV 0x01 for LOC EventGeofenceGeneralAlertIndication +struct sLOCEventGeofenceGeneralAlertIndication_GeofenceGeneralAlert +{ + eQMILOCGeofenceGeneralAlert mGeofenceGeneralAlert; +}; + +// Structure to describe indication TLV 0x01 for LOC EventGeofenceBreachIndication +struct sLOCEventGeofenceBreachIndication_GeofenceID +{ + UINT32 mGeofenceID; +}; + +// Structure to describe indication TLV 0x10 for LOC EventGeofenceBreachIndication +struct sLOCEventGeofenceBreachIndication_GeofencePosition +{ + UINT64 mUTCTimestampMilliseconds; + double mLatitudeDegrees; + double mLongitudeDegrees; + float mHorizontalUncertaintyEllipticalMinorMeters; + float mHorizontalUncertaintyEllipticalMajorMeters; + float mHorizontalUncertaintyEllipticalAzimuthDecimalDegrees; + INT8 mHorizontalSpeedValid; + float mHorizontalSpeedMetersSecond; + INT8 mAltitudeEllipsoidValid; + float mAltitudeFromEllipsoidMeters; + INT8 mVerticalUncertaintyValid; + float mVerticalUncertaintyMeters; + INT8 mVerticalSpeedValid; + float mVerticalSpeedMetersSecond; + INT8 mHeadingValid; + float mHeadingDegrees; +}; + +// Structure to describe request TLV 0x01 for LOCAddCircularGeofence() +struct sLOCAddCircularGeofenceRequest_TransactionID +{ + UINT32 mTransactionID; +}; + +// Structure to describe request TLV 0x03 for LOCAddCircularGeofence() +struct sLOCAddCircularGeofenceRequest_BreachEventMask +{ + bool mEnteringGeofence:1; + bool mLeavingGeofence:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe request TLV 0x04 for LOCAddCircularGeofence() +struct sLOCAddCircularGeofenceRequest_IncludePositionInBreachEvent +{ + INT8 mIncludePositionInBreachEvent; +}; + +// Structure to describe request TLV 0x10 for LOCAddCircularGeofence() +struct sLOCAddCircularGeofenceRequest_Responsiveness +{ + eQMILOCResponsiveness mResponsiveness; +}; + +// Structure to describe request TLV 0x11 for LOCAddCircularGeofence() +struct sLOCAddCircularGeofenceRequest_Confidence +{ + eQMILOCConfidence mConfidence; +}; + +// Structure to describe indication TLV 0x01 for LOC AddCircularGeofenceIndication +struct sLOCAddCircularGeofenceIndication_GeofenceStatus +{ + eQMILOCGeofenceStatus mGeofenceStatus; +}; + +// Structure to describe indication TLV 0x10 for LOC AddCircularGeofenceIndication +struct sLOCAddCircularGeofenceIndication_TransactionID +{ + UINT32 mTransactionID; +}; + +// Structure to describe indication TLV 0x11 for LOC AddCircularGeofenceIndication +struct sLOCAddCircularGeofenceIndication_GeofenceID +{ + UINT32 mGeofenceID; +}; + +// Structure to describe request TLV 0x01 for LOCDeleteGeofence() +struct sLOCDeleteGeofenceRequest_GeofenceID +{ + UINT32 mGeofenceID; +}; + +// Structure to describe indication TLV 0x01 for LOC DeleteGeofenceIndication +struct sLOCDeleteGeofenceIndication_GeofenceStatus +{ + eQMILOCGeofenceStatus mGeofenceStatus; +}; + +// Structure to describe indication TLV 0x10 for LOC DeleteGeofenceIndication +struct sLOCDeleteGeofenceIndication_GeofenceID +{ + UINT32 mGeofenceID; +}; + +// Structure to describe indication TLV 0x11 for LOC DeleteGeofenceIndication +struct sLOCDeleteGeofenceIndication_TransactionID +{ + UINT32 mTransactionID; +}; + +// Structure to describe request TLV 0x01 for LOCQueryGeofence() +struct sLOCQueryGeofenceRequest_GeofenceID +{ + UINT32 mGeofenceID; +}; + +// Structure to describe indication TLV 0x01 for LOC QueryGeofenceIndication +struct sLOCQueryGeofenceIndication_Status +{ + eQMILOCGeofenceStatus mGeofenceStatus; +}; + +// Structure to describe indication TLV 0x10 for LOC QueryGeofenceIndication +struct sLOCQueryGeofenceIndication_GeofenceID +{ + UINT32 mGeofenceID; +}; + +// Structure to describe indication TLV 0x11 for LOC QueryGeofenceIndication +struct sLOCQueryGeofenceIndication_TransactionID +{ + UINT32 mTransactionID; +}; + +// Structure to describe indication TLV 0x12 for LOC QueryGeofenceIndication +struct sLOCQueryGeofenceIndication_Origin +{ + eQMILOCGeofenceOrigin mGeofenceOrigin; +}; + +// Structure to describe indication TLV 0x13 for LOC QueryGeofenceIndication +struct sLOCQueryGeofenceIndication_PositionFromGeofence +{ + eQMILOCPositionFromGeofence mPositionFromGeofence; +}; + +// Structure to describe indication TLV 0x14 for LOC QueryGeofenceIndication +struct sLOCQueryGeofenceIndication_Parameters +{ + double mLatitudeDegrees; + double mLongitudeDegrees; + UINT32 mRadiusMeters; +}; + +// Structure to describe indication TLV 0x15 for LOC QueryGeofenceIndication +struct sLOCQueryGeofenceIndication_State +{ + eQMILOCGeofenceState mGeofenceState; +}; + +// Structure to describe request TLV 0x01 for LOCEditGeofence() +struct sLOCEditGeofenceRequest_GeofenceID +{ + UINT32 mGeofenceID; +}; + +// Structure to describe request TLV 0x10 for LOCEditGeofence() +struct sLOCEditGeofenceRequest_State +{ + eQMILOCGeofenceState mGeofenceState; +}; + +// Structure to describe request TLV 0x11 for LOCEditGeofence() +struct sLOCEditGeofenceRequest_BreachEventMask +{ + bool mEnteringGeofence:1; + bool mLeavingGeofence:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe indication TLV 0x01 for LOC EditGeofenceIndication +struct sLOCEditGeofenceIndication_Status +{ + eQMILOCGeofenceStatus mGeofenceStatus; +}; + +// Structure to describe indication TLV 0x10 for LOC EditGeofenceIndication +struct sLOCEditGeofenceIndication_GeofenceID +{ + UINT32 mGeofenceID; +}; + +// Structure to describe indication TLV 0x11 for LOC EditGeofenceIndication +struct sLOCEditGeofenceIndication_TransactionID +{ + UINT32 mTransactionID; +}; + +// Structure to describe indication TLV 0x12 for LOC EditGeofenceIndication +struct sLOCEditGeofenceIndication_FailedParameters +{ + bool mGeofenceState:1; + bool mBreachMask:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; +}; + +// Structure to describe request TLV 0x01 for LOCGetBestAvailablePosition() +struct sLOCGetBestAvailablePositionRequest_TransactionID +{ + UINT32 mTransactionID; +}; + +// Structure to describe indication TLV 0x01 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_Status +{ + eQMILOCGeofenceStatus mGeofenceStatus; +}; + +// Structure to describe indication TLV 0x10 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_TransactionID +{ + UINT32 mTransactionID; +}; + +// Structure to describe indication TLV 0x11 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_Latitude +{ + double mLatitudeDegrees; +}; + +// Structure to describe indication TLV 0x12 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_Longitude +{ + double mLongitudeDegrees; +}; + +// Structure to describe indication TLV 0x13 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_HorizontalUncertaintyCircular +{ + float mHorizontalUncertaintyCircularMeters; +}; + +// Structure to describe indication TLV 0x14 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_AltitudeFromEllipsoid +{ + float mAltitudeFromEllipsoidMeters; +}; + +// Structure to describe indication TLV 0x15 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_VerticalUncertainty +{ + float mVerticalUncertaintyMeters; +}; + +// Structure to describe indication TLV 0x16 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_UTCTimestamp +{ + UINT64 mUTCTimestampMilliseconds; +}; + +// Structure to describe indication TLV 0x17 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_TimeUncertainty +{ + float mTimeUncertaintyMilliseconds; +}; + +// Structure to describe indication TLV 0x18 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_HorizontalUncertaintyEllipticalMinor +{ + float mHorizontalUncertaintyEllipticalMinorMeters; +}; + +// Structure to describe indication TLV 0x19 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_HorizontalUncertaintyEllipticalMajor +{ + float mHorizontalUncertaintyEllipticalMajorMeters; +}; + +// Structure to describe indication TLV 0x1A for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_HorizontalUncertaintyEllipticalAzimuth +{ + float mHorizontalUncertaintyEllipticalAzimuthDecimalDegrees; +}; + +// Structure to describe indication TLV 0x1B for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_HorizontalConfidenceCircular +{ + UINT8 mHorizontalConfidencePercent; +}; + +// Structure to describe indication TLV 0x1C for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_HorizontalConfidenceElliptical +{ + UINT8 mHorizontalConfidencePercent; +}; + +// Structure to describe indication TLV 0x1D for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_HorizontalReliablility +{ + eQMILOCReliability mHorizontalReliability; +}; + +// Structure to describe indication TLV 0x1E for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_HorizontalSpeed +{ + float mHorizontalSpeedMetersSecond; +}; + +// Structure to describe indication TLV 0x1F for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_HorizontalSpeedUncertainty +{ + float mSpeedUncertaintyMetersSecond; +}; + +// Structure to describe indication TLV 0x20 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_AltitudeFromSeaLevel +{ + float mAltitudeFromSeaLevelMeters; +}; + +// Structure to describe indication TLV 0x21 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_VerticalConfidence +{ + UINT8 mVerticalConfidencePercent; +}; + +// Structure to describe indication TLV 0x22 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_VerticalReliability +{ + eQMILOCReliability mVerticalReliability; +}; + +// Structure to describe indication TLV 0x23 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_VerticalSpeed +{ + float mVerticalSpeedMetersSecond; +}; + +// Structure to describe indication TLV 0x24 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_VerticalSpeedUncertainty +{ + float mSpeedUncertaintyMetersSecond; +}; + +// Structure to describe indication TLV 0x25 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_Heading +{ + float mHeadingDegrees; +}; + +// Structure to describe indication TLV 0x26 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_HeadingUncertainty +{ + float mHeadingUncertaintyDegrees; +}; + +// Structure to describe indication TLV 0x27 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_MagneticDeviation +{ + float mMagneticDeviation; +}; + +// Structure to describe indication TLV 0x28 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_TechnologyUsed +{ + bool mSatellite:1; + bool mCellular:1; + bool mWiFi:1; + bool mSensors:1; + bool mReferenceLocation:1; + + // Padding out 27 bits + UINT8 mReserved1:3; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x29 for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_DilutionOfPrecision +{ + float mPositionDilutionOfPrecision; + float mHorizontalDilutionOfPrecision; + float mVerticalDilutionOfPrecision; +}; + +// Structure to describe indication TLV 0x2A for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_GPSTime +{ + UINT16 mGPSWeeks; + UINT32 mGPSTimeOfWeekMilliseconds; +}; + +// Structure to describe indication TLV 0x2B for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_TimeSource +{ + eQMILOCTimeSource mTimeSource; +}; + +// Structure to describe indication TLV 0x2C for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_SensorDataUsage +{ + bool mAccelerometerUsed:1; + bool mGyroUsed:1; + + // Padding out 30 bits + UINT8 mReserved1:6; + UINT8 mReserved2[3]; + + bool mAidedHeading:1; + bool mAidedSpeed:1; + bool mAidedPosition:1; + bool mAidedVelocity:1; + + // Padding out 28 bits + UINT8 mReserved3:4; + UINT8 mReserved4[3]; +}; + +// Structure to describe indication TLV 0x2D for LOC GetBestAvailablePositionIndication +struct sLOCGetBestAvailablePositionIndication_SatellitesUsed +{ + UINT8 mSatellitesUsedCount; + + // This array must be the size specified by mSatellitesUsedCount + // UINT16 mSatellitesUsed[1]; +}; + +// Structure to describe request TLV 0x10 for CATSetEventReport() +struct sCATSetEventReportRequest_ReportMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + bool mRefresh:1; + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + bool mSetupEventBrowserTermination:1; + bool mProvideLocalInformationTime:1; + bool mActivate:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved2:6; +}; + +// Structure to describe request TLV 0x11 for CATSetEventReport() +struct sCATSetEventReportRequest_DecodeReportMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mSCWSEvent:1; + bool mActivate:1; + bool mSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved3:6; +}; + +// Structure to describe request TLV 0x12 for CATSetEventReport() +struct sCATSetEventReportRequest_Slot +{ + bool mSlot1:1; + bool mSlot2:1; + + // Padding out 6 bits + UINT8 mReserved1:6; +}; + +// Structure to describe response TLV 0x10 for CATSetEventReport() +struct sCATSetEventReportResponse_RegStatusMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + bool mRefresh:1; + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + bool mSetupEventBrowserTermination:1; + bool mProvideLocalInformationTime:1; + bool mActivate:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved2:6; +}; + +// Structure to describe response TLV 0x11 for CATSetEventReport() +struct sCATSetEventReportResponse_DecodedRegStatusMask +{ + bool mDisplayText:1; + bool mGetInkey:1; + bool mGetInput:1; + bool mSetupMenu:1; + bool mSelectItem:1; + bool mSendSMSAlphaIdentifier:1; + bool mSetupEventUserActivity:1; + bool mSetupEventIdleScreenNotify:1; + bool mSetupEventLanguageSelNotify:1; + bool mSetupIdleModeText:1; + bool mLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mEndProactiveSession:1; + bool mPlayTone:1; + bool mSetupCall:1; + bool mSendDTMF:1; + bool mLaunchBrowser:1; + bool mSendSS:1; + bool mSendUSSD:1; + bool mProvideLocalInformationLanguage:1; + bool mBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mSCWSEvent:1; + bool mActivate:1; + bool mSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved3:6; +}; + +// Structure to describe indication TLV 0x10 for CAT EventReport +struct sCATEventReportIndication_DisplayTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mDisplayTextCommand[1]; +}; + +// Structure to describe indication TLV 0x11 for CAT EventReport +struct sCATEventReportIndication_GetInkeyEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInkeyCommand[1]; +}; + +// Structure to describe indication TLV 0x12 for CAT EventReport +struct sCATEventReportIndication_GetInputEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInputCommand[1]; +}; + +// Structure to describe indication TLV 0x13 for CAT EventReport +struct sCATEventReportIndication_SetupMenuEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupMenuCommand[1]; +}; + +// Structure to describe indication TLV 0x14 for CAT EventReport +struct sCATEventReportIndication_SelectItemEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSelectItemCommand[1]; +}; + +// Structure to describe indication TLV 0x15 for CAT EventReport +struct sCATEventReportIndication_AlphaIDAvailable +{ + eQMICATAlphaIDCommandType mAlphaIDCommandType; + UINT16 mAlphaIDLength; + + // This array must be the size specified by mAlphaIDLength + // UINT8 mAlphaID[1]; +}; + +// Structure to describe indication TLV 0x16 for CAT EventReport +struct sCATEventReportIndication_SetupEventList +{ + bool mUserActivityNotify:1; + bool mIdleScreenAvailable:1; + bool mLanguageSelectionNotify:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe indication TLV 0x17 for CAT EventReport +struct sCATEventReportIndication_SetupIdleModeTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupIdleModeTextCommand[1]; +}; + +// Structure to describe indication TLV 0x18 for CAT EventReport +struct sCATEventReportIndication_LanguageNotificationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLanguageNotificationCommand[1]; +}; + +// Structure to describe indication TLV 0x19 for CAT EventReport +struct sCATEventReportIndication_RefreshEvent +{ + UINT16 mRefreshMode; + eQMICATRefreshStage mRefreshStage; +}; + +// Structure to describe indication TLV 0x1A for CAT EventReport +struct sCATEventReportIndication_EndProactiveSession +{ + eQMICATProactiveSessionEndType mProactiveSessionEndType; +}; + +// Structure to describe indication TLV 0x1B for CAT EventReport +struct sCATEventReportIndication_DecodedHeaderID +{ + eQMICATCommandID mCommandID; + UINT32 mReferenceID; + UINT8 mCommandNumber; +}; + +// Structure to describe indication TLV 0x1C for CAT EventReport +struct sCATEventReportIndication_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x1D for CAT EventReport +struct sCATEventReportIndication_HighPriority +{ + eQMICATHighPriority mHighPriority; +}; + +// Structure to describe indication TLV 0x1E for CAT EventReport +struct sCATEventReportIndication_UserControl +{ + eQMICATUserControl mUserControl; +}; + +// Structure to describe indication TLV 0x1F for CAT EventReport +struct sCATEventReportIndication_Icon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x20 for CAT EventReport +struct sCATEventReportIndication_Duration +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe indication TLV 0x21 for CAT EventReport +struct sCATEventReportIndication_ResponseFormat +{ + eQMICATResponseFormat mResponseFormat; +}; + +// Structure to describe indication TLV 0x22 for CAT EventReport +struct sCATEventReportIndication_HelpAvailable +{ + eQMICATHelpAvailable mHelpAvailable; +}; + +// Structure to describe indication TLV 0x23 for CAT EventReport +struct sCATEventReportIndication_ResponsePackingFormat +{ + eQMICATResponsePackingFormat mResponsePackingFormat; +}; + +// Structure to describe indication TLV 0x24 for CAT EventReport +struct sCATEventReportIndication_ResponseLength +{ + UINT8 mMaximumUserInput; + UINT8 mMinimumUserInput; +}; + +// Structure to describe indication TLV 0x25 for CAT EventReport +struct sCATEventReportIndication_ShowUserInput +{ + eQMICATShowUserInput mShowUserInput; +}; + +// Structure to describe indication TLV 0x26 for CAT EventReport +struct sCATEventReportIndication_Tone +{ + eQMICATTone mTone; +}; + +// Structure to describe indication TLV 0x27 for CAT EventReport +struct sCATEventReportIndication_SoftkeySelection +{ + eQMICATSoftkeySelection mSoftkeySelection; +}; + +// Structure to describe indication TLV 0x28 for CAT EventReport +struct sCATEventReportIndication_Items +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe indication TLV 0x29 for CAT EventReport +struct sCATEventReportIndication_DefaultItem +{ + UINT8 mDefaultItem; +}; + +// Structure to describe indication TLV 0x2A for CAT EventReport +struct sCATEventReportIndication_NextActionIdentifier +{ + UINT8 mActionsLength; + + // This array must be the size specified by mActionsLength + // eQMICATNextAction mNextAction[1]; +}; + +// Structure to describe indication TLV 0x2B for CAT EventReport +struct sCATEventReportIndication_IconIDList +{ + eQMICATDisplayIconOnly mDisplayIconOnly; + UINT8 mItemsLength; + + struct sItem + { + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe indication TLV 0x2C for CAT EventReport +struct sCATEventReportIndication_Presentation +{ + eQMICATPresentation mPresentation; +}; + +// Structure to describe indication TLV 0x2D for CAT EventReport +struct sCATEventReportIndication_PackingRequired +{ + eQMICATPackingRequired mPackingRequired; +}; + +// Structure to describe indication TLV 0x2E for CAT EventReport +struct sCATEventReportIndication_SMSTPDU +{ + UINT8 mSMSTPDUDataLength; + + // This array must be the size specified by mSMSTPDUDataLength + // UINT8 mSMSTPDUData[1]; +}; + +// Structure to describe indication TLV 0x2F for CAT EventReport +struct sCATEventReportIndication_IsCDMASMS +{ + eQMICATIsCDMASMS mIsCDMASMS; +}; + +// Structure to describe indication TLV 0x30 for CAT EventReport +struct sCATEventReportIndication_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x31 for CAT EventReport +struct sCATEventReportIndication_CallSetupRequirement +{ + eQMICATCallSetupRequirement mCallSetupRequirement; +}; + +// Structure to describe indication TLV 0x32 for CAT EventReport +struct sCATEventReportIndication_Redial +{ + eQMICATRedialNecessary mRedialNecessary; + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe indication TLV 0x33 for CAT EventReport +struct sCATEventReportIndication_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe indication TLV 0x34 for CAT EventReport +struct sCATEventReportIndication_CapabilitiesConfiguration +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe indication TLV 0x35 for CAT EventReport +struct sCATEventReportIndication_DTMF +{ + UINT8 mDTMFDataLength; + + struct sDTMFData + { + UINT8 mDTMFData1:4; + UINT8 mDTMFData2:4; + }; + + // This array must be the size specified by mDTMFDataLength + // sDTMFData mDTMFDatas[1]; +}; + +// Structure to describe indication TLV 0x36 for CAT EventReport +struct sCATEventReportIndication_SpecificLanguageNotification +{ + eQMICATSpecificLanguageNotfication mSpecificLanguageNotification; +}; + +// Structure to describe indication TLV 0x37 for CAT EventReport +struct sCATEventReportIndication_Language +{ + char mLanguage[2]; +}; + +// Structure to describe indication TLV 0x38 for CAT EventReport +struct sCATEventReportIndication_LaunchMode +{ + eQMICATLaunchMode mLaunchMode; +}; + +// Structure to describe indication TLV 0x39 for CAT EventReport +struct sCATEventReportIndication_URL +{ + UINT8 mURLDataLength; + + // This array must be the size specified by mURLDataLength + // char mURLData[1]; +}; + +// Structure to describe indication TLV 0x3A for CAT EventReport +struct sCATEventReportIndication_BrowserID +{ + UINT8 mBrowserID; +}; + +// Structure to describe indication TLV 0x3B for CAT EventReport +struct sCATEventReportIndication_BearerList +{ + UINT8 mBearerListLength; + + // This array must be the size specified by mBearerListLength + // eQMICATBearer mBearerList[1]; +}; + +// Structure to describe indication TLV 0x3C for CAT EventReport +struct sCATEventReportIndication_ProvisioningFile +{ + UINT32 mNumberOfProvisioningFiles; + + struct sFile + { + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // char mPath[1]; + }; + + // This array must be the size specified by mNumberOfProvisioningFiles + // sFile mFiles[1]; +}; + +// Structure to describe indication TLV 0x3D for CAT EventReport +struct sCATEventReportIndication_USSDString +{ + eQMICATUSSDDataCodingScheme mOriginalDataCodingScheme; + eQMICATUSSDDataCodingScheme mDataCodingScheme; + UINT8 mUSSDTextLength; + + // This array must be the size specified by mUSSDTextLength + // UINT8 mUSSDText[1]; +}; + +// Structure to describe indication TLV 0x3E for CAT EventReport +struct sCATEventReportIndication_DefaultText +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x3F for CAT EventReport +struct sCATEventReportIndication_ImmediateResponseRequired +{ + eQMICATImmediateResponse mImmediateResponse; +}; + +// Structure to describe indication TLV 0x40 for CAT EventReport +struct sCATEventReportIndication_UserConfirmationAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x41 for CAT EventReport +struct sCATEventReportIndication_SetupCallDisplayAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x42 for CAT EventReport +struct sCATEventReportIndication_UserConfirmationIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x43 for CAT EventReport +struct sCATEventReportIndication_SetupCallDisplayIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe indication TLV 0x44 for CAT EventReport +struct sCATEventReportIndication_GatewayProxy +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x45 for CAT EventReport +struct sCATEventReportIndication_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x46 for CAT EventReport +struct sCATEventReportIndication_NotificationRequired +{ + eQMICATNotificationRequired mNotificationRequired; +}; + +// Structure to describe indication TLV 0x47 for CAT EventReport +struct sCATEventReportIndication_PlayToneEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mPlayToneCommand[1]; +}; + +// Structure to describe indication TLV 0x48 for CAT EventReport +struct sCATEventReportIndication_SetupCallEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupCallCommand[1]; +}; + +// Structure to describe indication TLV 0x49 for CAT EventReport +struct sCATEventReportIndication_SendDTMFEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDTMFCommand[1]; +}; + +// Structure to describe indication TLV 0x4A for CAT EventReport +struct sCATEventReportIndication_LaunchBrowserEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLaunchBrowserCommand[1]; +}; + +// Structure to describe indication TLV 0x4B for CAT EventReport +struct sCATEventReportIndication_SendSMSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSMSCommand[1]; +}; + +// Structure to describe indication TLV 0x4C for CAT EventReport +struct sCATEventReportIndication_SendSSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSSCommand[1]; +}; + +// Structure to describe indication TLV 0x4D for CAT EventReport +struct sCATEventReportIndication_SendUSSDEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendUSSDCommand[1]; +}; + +// Structure to describe indication TLV 0x4E for CAT EventReport +struct sCATEventReportIndication_ProvideLocalInformationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mProvideLocalInformationCommand[1]; +}; + +// Structure to describe indication TLV 0x4F for CAT EventReport +struct sCATEventReportIndication_SetupRawEventList +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupEventListCommand[1]; +}; + +// Structure to describe indication TLV 0x50 for CAT EventReport +struct sCATEventReportIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x51 for CAT EventReport +struct sCATEventReportIndication_OpenChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mOpenChannelCommand[1]; +}; + +// Structure to describe indication TLV 0x52 for CAT EventReport +struct sCATEventReportIndication_CloseChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mCloseChannelCommand[1]; +}; + +// Structure to describe indication TLV 0x53 for CAT EventReport +struct sCATEventReportIndication_SendDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDataCommand[1]; +}; + +// Structure to describe indication TLV 0x54 for CAT EventReport +struct sCATEventReportIndication_ReceiveDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mReceiveDataCommand[1]; +}; + +// Structure to describe indication TLV 0x55 for CAT EventReport +struct sCATEventReportIndication_OnDemmandLinkEstablish +{ + eQMICATOnDemandLinkEstablish mOnDemandLinkEstablish; +}; + +// Structure to describe indication TLV 0x56 for CAT EventReport +struct sCATEventReportIndication_CSDBearerDescription +{ + UINT8 mSpeed; + eQMICATCSDBearerName mCSDBearerName; + eQMICATConnectionElement mConnectionElement; +}; + +// Structure to describe indication TLV 0x57 for CAT EventReport +struct sCATEventReportIndication_GPRSBearerDescription +{ + UINT8 mPrecedenceClass; + UINT8 mDelayClass; + UINT8 mReliabilityClass; + UINT8 mPeakThroughput; + UINT8 mMeanThroughput; + eQMICATPacketDataProtocol mPacketDataProtocol; +}; + +// Structure to describe indication TLV 0x58 for CAT EventReport +struct sCATEventReportIndication_EUTRANExternalParameterBearerDescription +{ + eQMICATTrafficClass mTrafficClass; + UINT16 mMaxUploadBitrate; + UINT16 mMaxDownloadBitrate; + UINT16 mGuaranteedUploadBitrate; + UINT16 mGuaranteedDownloadBitrate; + eQMICATDeliveryOrder mDeliveryOrder; + UINT8 mMaxSDUSize; + UINT8 mMaxSDUErrorRatio; + UINT8 mResidualBitErrorRatio; + eQMICATDeliverErrorSDU mDeliverErrorSDU; + UINT8 mTransferDelay; + UINT8 mTrafficHandlingPRI; + eQMICATPDPType mPDPType; +}; + +// Structure to describe indication TLV 0x59 for CAT EventReport +struct sCATEventReportIndication_EUTRANExternalMappedUTRANBearerDescription +{ + UINT8 mQCI; + UINT8 mMaxUploadBitrate; + UINT8 mMaxDownloadBitrate; + UINT8 mGuaranteedUploadBitrate; + UINT8 mGuaranteedDownloadBitrate; + UINT8 mMaximumUploadBitrateExt; + UINT8 mMaximumDownloadBitrateExt; + UINT8 mGuaranteedUploadBitrateExt; + UINT8 mGuaranteedDownloadBitrateExt; + eQMICATPDPType mPDPType; +}; + +// Structure to describe indication TLV 0x5A for CAT EventReport +struct sCATEventReportIndication_BufferSize +{ + UINT16 mBufferSize; +}; + +// Structure to describe indication TLV 0x5B for CAT EventReport +struct sCATEventReportIndication_NetworkAccessName +{ + UINT8 mNetworkAccessNameLength; + + // This array must be the size specified by mNetworkAccessNameLength + // UINT8 mNetworkAccessName[1]; +}; + +// Structure to describe indication TLV 0x5C for CAT EventReport +struct sCATEventReportIndication_OtherAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x5D for CAT EventReport +struct sCATEventReportIndication_UserLogin +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x5E for CAT EventReport +struct sCATEventReportIndication_UserPassword +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe indication TLV 0x5F for CAT EventReport +struct sCATEventReportIndication_TransportLevel +{ + eQMICATTransportProtocol mTransportProtocol; + UINT16 mPortNumber; +}; + +// Structure to describe indication TLV 0x60 for CAT EventReport +struct sCATEventReportIndication_DataDestinationAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe indication TLV 0x61 for CAT EventReport +struct sCATEventReportIndication_ChannelDataLength +{ + UINT8 mChannelDataLength; +}; + +// Structure to describe indication TLV 0x62 for CAT EventReport +struct sCATEventReportIndication_SendDataImmediately +{ + eQMICATSendDataImmediately mSendDataImmediately; +}; + +// Structure to describe indication TLV 0x63 for CAT EventReport +struct sCATEventReportIndication_ChannelData +{ + UINT16 mChannelDataLength; + + // This array must be the size specified by mChannelDataLength + // UINT8 mChannelData[1]; +}; + +// Structure to describe indication TLV 0x64 for CAT EventReport +struct sCATEventReportIndication_ChannelID +{ + UINT8 mChannelID; +}; + +// Structure to describe indication TLV 0x65 for CAT EventReport +struct sCATEventReportIndication_ItemsWithDCS +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe indication TLV 0x66 for CAT EventReport +struct sCATEventReportIndication_Activate +{ + UINT32 mReferenceID; + UINT16 mActivateLength; + + // This array must be the size specified by mActivateLength + // UINT8 mActivate[1]; +}; + +// Structure to describe indication TLV 0x67 for CAT EventReport +struct sCATEventReportIndication_ActivateTarget +{ + eQMICATActivateTargets mActivateTarget; +}; + +// Structure to describe response TLV 0x01 for CATGetServiceState() +struct sCATGetServiceStateResponse_CATServiceState +{ + bool mCommonDisplayText:1; + bool mCommonGetInkey:1; + bool mCommonGetInput:1; + bool mCommonSetupMenu:1; + bool mCommonSelectItem:1; + bool mCommonSendSMSAlphaIdentifier:1; + bool mCommonSetupEventUserActivity:1; + bool mCommonSetupEventIdleScreenNotify:1; + bool mCommonSetupEventLanguageSelNotify:1; + bool mCommonSetupIdleModeText:1; + bool mCommonLanguageNotification:1; + bool mCommonRefresh:1; + bool mCommonEndProactiveSession:1; + bool mCommonPlayTone:1; + bool mCommonSetupCall:1; + bool mCommonSendDTMF:1; + bool mCommonLaunchBrowser:1; + bool mCommonSendSS:1; + bool mCommonSendUSSD:1; + bool mCommonProvideLocalInformationLanguage:1; + bool mCommonBearerIndependentProtocol:1; + bool mCommonSetupEventBrowserTermination:1; + bool mCommonProvideLocalInformationTime:1; + bool mCommonActivate:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mCommonSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved2:6; + + bool mControlDisplayText:1; + bool mControlGetInkey:1; + bool mControlGetInput:1; + bool mControlSetupMenu:1; + bool mControlSelectItem:1; + bool mControlSendSMSAlphaIdentifier:1; + bool mControlSetupEventUserActivity:1; + bool mControlSetupEventIdleScreenNotify:1; + bool mControlSetupEventLanguageSelNotify:1; + bool mControlSetupIdleModeText:1; + bool mControlLanguageNotification:1; + bool mControlRefresh:1; + bool mControlEndProactiveSession:1; + bool mControlPlayTone:1; + bool mControlSetupCall:1; + bool mControlSendDTMF:1; + bool mControlLaunchBrowser:1; + bool mControlSendSS:1; + bool mControlSendUSSD:1; + bool mControlProvideLocalInformationLanguage:1; + bool mControlBearerIndependentProtocol:1; + bool mControlSetupEventBrowserTermination:1; + bool mControlProvideLocalInformationTime:1; + bool mControlActivate:1; + + // Padding out 1 bits + UINT8 mReserved3:1; + + bool mControlSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved4:6; +}; + +// Structure to describe response TLV 0x10 for CATGetServiceState() +struct sCATGetServiceStateResponse_DecodedCATServiceState +{ + bool mCommonDisplayText:1; + bool mCommonGetInkey:1; + bool mCommonGetInput:1; + bool mCommonSetupMenu:1; + bool mCommonSelectItem:1; + bool mCommonSendSMSAlphaIdentifier:1; + bool mCommonSetupEventUserActivity:1; + bool mCommonSetupEventIdleScreenNotify:1; + bool mCommonSetupEventLanguageSelNotify:1; + bool mCommonSetupIdleModeText:1; + bool mCommonLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved1:1; + + bool mCommonEndProactiveSession:1; + bool mCommonPlayTone:1; + bool mCommonSetupCall:1; + bool mCommonSendDTMF:1; + bool mCommonLaunchBrowser:1; + bool mCommonSendSS:1; + bool mCommonSendUSSD:1; + bool mCommonProvideLocalInformationLanguage:1; + bool mCommonBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved2:2; + + bool mCommonSCWSEvent:1; + bool mCommonActivate:1; + bool mCommonSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved3:6; + + bool mControlDisplayText:1; + bool mControlGetInkey:1; + bool mControlGetInput:1; + bool mControlSetupMenu:1; + bool mControlSelectItem:1; + bool mControlSendSMSAlphaIdentifier:1; + bool mControlSetupEventUserActivity:1; + bool mControlSetupEventIdleScreenNotify:1; + bool mControlSetupEventLanguageSelNotify:1; + bool mControlSetupIdleModeText:1; + bool mControlLanguageNotification:1; + + // Padding out 1 bits + UINT8 mReserved4:1; + + bool mControlEndProactiveSession:1; + bool mControlPlayTone:1; + bool mControlSetupCall:1; + bool mControlSendDTMF:1; + bool mControlLaunchBrowser:1; + bool mControlSendSS:1; + bool mControlSendUSSD:1; + bool mControlProvideLocalInformationLanguage:1; + bool mControlBearerIndependentProtocol:1; + + // Padding out 2 bits + UINT8 mReserved5:2; + + bool mControlSCWSEvent:1; + bool mControlActivate:1; + bool mControlSetupEventHCIConnectivity:1; + + // Padding out 6 bits + UINT8 mReserved6:6; +}; + +// Structure to describe request TLV 0x01 for CATSendTerminalResponse() +struct sCATSendTerminalResponseRequest_TerminalResponseType +{ + UINT32 mReferenceID; + UINT16 mTerminalResponseLength; + + // This array must be the size specified by mTerminalResponseLength + // UINT8 mTerminalResponse[1]; +}; + +// Structure to describe request TLV 0x10 for CATSendTerminalResponse() +struct sCATSendTerminalResponseRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe response TLV 0x10 for CATSendTerminal() +struct sCATSendTerminalResponseResponse_TRResponse +{ + UINT8 mSW1; + UINT8 mSW2; + UINT8 mTerminalResponseLength; + + // This array must be the size specified by mTerminalResponseLength + // UINT8 mTerminalResponseData[1]; +}; + +// Structure to describe request TLV 0x01 for CATEnvelopeCommand() +struct sCATEnvelopeCommandRequest_EnvelopeCommand +{ + eQMICATEnvelopeCommandType mEnvelopeCommandType; + UINT16 mEnvelopeLength; + + // This array must be the size specified by mEnvelopeLength + // UINT8 mEnvelopeData[1]; +}; + +// Structure to describe request TLV 0x10 for CATEnvelopeCommand() +struct sCATEnvelopeCommandRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe response TLV 0x10 for CATEnvelopeCommand() +struct sCATEnvelopeCommandResponse_RawResponse +{ + UINT8 mSW1; + UINT8 mSW2; + UINT8 mEnvelopeResponseLength; + + // This array must be the size specified by mEnvelopeResponseLength + // UINT8 mEnvelopeResponseData[1]; +}; + +// Structure to describe request TLV 0x01 for CATGetEventReport() +struct sCATGetEventReportRequest_CommandInput +{ + UINT32 mCommandID; + eQMICATCommandFormat mCommandFormat; +}; + +// Structure to describe response TLV 0x10 for CATGetEventReport() +struct sCATGetEventReportResponse_DisplayTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mDisplayTextCommand[1]; +}; + +// Structure to describe response TLV 0x11 for CATGetEventReport() +struct sCATGetEventReportResponse_GetInkeyEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInkeyCommand[1]; +}; + +// Structure to describe response TLV 0x12 for CATGetEventReport() +struct sCATGetEventReportResponse_GetInputEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mGetInputCommand[1]; +}; + +// Structure to describe response TLV 0x13 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupMenuEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupMenuCommand[1]; +}; + +// Structure to describe response TLV 0x14 for CATGetEventReport() +struct sCATGetEventReportResponse_SelectItemEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSelectItemCommand[1]; +}; + +// Structure to describe response TLV 0x15 for CATGetEventReport() +struct sCATGetEventReportResponse_AlphaIDAvailable +{ + eQMICATAlphaIDCommandType mAlphaIDCommandType; + UINT16 mAlphaIDLength; + + // This array must be the size specified by mAlphaIDLength + // UINT8 mAlphaID[1]; +}; + +// Structure to describe response TLV 0x16 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupEventList +{ + bool mUserActivityNotify:1; + bool mIdleScreenAvailable:1; + bool mLanguageSelectionNotify:1; + + // Padding out 29 bits + UINT8 mReserved1:5; + UINT8 mReserved2[3]; +}; + +// Structure to describe response TLV 0x17 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupIdleModeTextEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupIdleModeTextCommand[1]; +}; + +// Structure to describe response TLV 0x18 for CATGetEventReport() +struct sCATGetEventReportResponse_LanguageNotificationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLanguageNotificationCommand[1]; +}; + +// Structure to describe response TLV 0x19 for CATGetEventReport() +struct sCATGetEventReportResponse_RefreshEvent +{ + UINT16 mRefreshMode; + eQMICATRefreshStage mRefreshStage; +}; + +// Structure to describe response TLV 0x1A for CATGetEventReport() +struct sCATGetEventReportResponse_EndProactiveSession +{ + eQMICATProactiveSessionEndType mProactiveSessionEndType; +}; + +// Structure to describe response TLV 0x1B for CATGetEventReport() +struct sCATGetEventReportResponse_DecodedHeaderID +{ + eQMICATCommandID mCommandID; + UINT32 mReferenceID; + UINT8 mCommandNumber; +}; + +// Structure to describe response TLV 0x1C for CATGetEventReport() +struct sCATGetEventReportResponse_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x1D for CATGetEventReport() +struct sCATGetEventReportResponse_HighPriority +{ + eQMICATHighPriority mHighPriority; +}; + +// Structure to describe response TLV 0x1E for CATGetEventReport() +struct sCATGetEventReportResponse_UserControl +{ + eQMICATUserControl mUserControl; +}; + +// Structure to describe response TLV 0x1F for CATGetEventReport() +struct sCATGetEventReportResponse_Icon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x20 for CATGetEventReport() +struct sCATGetEventReportResponse_Duration +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe response TLV 0x21 for CATGetEventReport() +struct sCATGetEventReportResponse_ResponseFormat +{ + eQMICATResponseFormat mResponseFormat; +}; + +// Structure to describe response TLV 0x22 for CATGetEventReport() +struct sCATGetEventReportResponse_HelpAvailable +{ + eQMICATHelpAvailable mHelpAvailable; +}; + +// Structure to describe response TLV 0x23 for CATGetEventReport() +struct sCATGetEventReportResponse_ResponsePackingFormat +{ + eQMICATResponsePackingFormat mResponsePackingFormat; +}; + +// Structure to describe response TLV 0x24 for CATGetEventReport() +struct sCATGetEventReportResponse_ResponseLength +{ + UINT8 mMaximumUserInput; + UINT8 mMinimumUserInput; +}; + +// Structure to describe response TLV 0x25 for CATGetEventReport() +struct sCATGetEventReportResponse_ShowUserInput +{ + eQMICATShowUserInput mShowUserInput; +}; + +// Structure to describe response TLV 0x26 for CATGetEventReport() +struct sCATGetEventReportResponse_Tone +{ + eQMICATTone mTone; +}; + +// Structure to describe response TLV 0x27 for CATGetEventReport() +struct sCATGetEventReportResponse_SoftkeySelection +{ + eQMICATSoftkeySelection mSoftkeySelection; +}; + +// Structure to describe response TLV 0x28 for CATGetEventReport() +struct sCATGetEventReportResponse_Items +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe response TLV 0x29 for CATGetEventReport() +struct sCATGetEventReportResponse_DefaultItems +{ + UINT8 mDefaultItem; +}; + +// Structure to describe response TLV 0x2A for CATGetEventReport() +struct sCATGetEventReportResponse_NextActionIdentifier +{ + UINT8 mActionsLength; + + // This array must be the size specified by mActionsLength + // eQMICATNextAction mNextAction[1]; +}; + +// Structure to describe response TLV 0x2B for CATGetEventReport() +struct sCATGetEventReportResponse_IconIDList +{ + eQMICATDisplayIconOnly mDisplayIconOnly; + UINT8 mItemsLength; + + struct sItem + { + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe response TLV 0x2C for CATGetEventReport() +struct sCATGetEventReportResponse_Presentation +{ + eQMICATPresentation mPresentation; +}; + +// Structure to describe response TLV 0x2D for CATGetEventReport() +struct sCATGetEventReportResponse_PackingRequired +{ + eQMICATPackingRequired mPackingRequired; +}; + +// Structure to describe response TLV 0x2E for CATGetEventReport() +struct sCATGetEventReportResponse_SMSTPDU +{ + UINT8 mSMSTPDUDataLength; + + // This array must be the size specified by mSMSTPDUDataLength + // UINT8 mSMSTPDUData[1]; +}; + +// Structure to describe response TLV 0x2F for CATGetEventReport() +struct sCATGetEventReportResponse_IsCDMASMS +{ + eQMICATIsCDMASMS mIsCDMASMS; +}; + +// Structure to describe response TLV 0x30 for CATGetEventReport() +struct sCATGetEventReportResponse_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x31 for CATGetEventReport() +struct sCATGetEventReportResponse_CallSetupRequirement +{ + eQMICATCallSetupRequirement mCallSetupRequirement; +}; + +// Structure to describe response TLV 0x32 for CATGetEventReport() +struct sCATGetEventReportResponse_Redial +{ + eQMICATRedialNecessary mRedialNecessary; + eQMICATTimeUnits mUnits; + UINT8 mInterval; +}; + +// Structure to describe response TLV 0x33 for CATGetEventReport() +struct sCATGetEventReportResponse_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe response TLV 0x34 for CATGetEventReport() +struct sCATGetEventReportResponse_CapabilityConfiguration +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x35 for CATGetEventReport() +struct sCATGetEventReportResponse_DTMF +{ + UINT8 mDTMFDataLength; + + struct sDTMFData + { + UINT8 mDTMFData1:4; + UINT8 mDTMFData2:4; + }; + + // This array must be the size specified by mDTMFDataLength + // sDTMFData mDTMFDatas[1]; +}; + +// Structure to describe response TLV 0x36 for CATGetEventReport() +struct sCATGetEventReportResponse_SpecificLanguageNotification +{ + eQMICATSpecificLanguageNotfication mSpecificLanguageNotification; +}; + +// Structure to describe response TLV 0x37 for CATGetEventReport() +struct sCATGetEventReportResponse_Language +{ + char mLanguage[2]; +}; + +// Structure to describe response TLV 0x38 for CATGetEventReport() +struct sCATGetEventReportResponse_LaunchMode +{ + eQMICATLaunchMode mLaunchMode; +}; + +// Structure to describe response TLV 0x39 for CATGetEventReport() +struct sCATGetEventReportResponse_URL +{ + UINT8 mURLDataLength; + + // This array must be the size specified by mURLDataLength + // char mURLData[1]; +}; + +// Structure to describe response TLV 0x3A for CATGetEventReport() +struct sCATGetEventReportResponse_BrowserID +{ + UINT8 mBrowserID; +}; + +// Structure to describe response TLV 0x3B for CATGetEventReport() +struct sCATGetEventReportResponse_BearerList +{ + UINT8 mBearerListLength; + + // This array must be the size specified by mBearerListLength + // eQMICATBearer mBearerList[1]; +}; + +// Structure to describe response TLV 0x3C for CATGetEventReport() +struct sCATGetEventReportResponse_ProvisioningFiles +{ + UINT32 mNumberOfProvisioningFiles; + + struct sFile + { + UINT8 mPathLength; + + // This array must be the size specified by mPathLength + // char mPath[1]; + }; + + // This array must be the size specified by mNumberOfProvisioningFiles + // sFile mFiles[1]; +}; + +// Structure to describe response TLV 0x3D for CATGetEventReport() +struct sCATGetEventReportResponse_USSDString +{ + eQMICATUSSDDataCodingScheme mOriginalDataCodingScheme; + eQMICATUSSDDataCodingScheme mDataCodingScheme; + UINT8 mUSSDTextLength; + + // This array must be the size specified by mUSSDTextLength + // UINT8 mUSSDText[1]; +}; + +// Structure to describe response TLV 0x3E for CATGetEventReport() +struct sCATGetEventReportResponse_DefaultText +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x3F for CATGetEventReport() +struct sCATGetEventReportResponse_ImmediateResponseRequest +{ + eQMICATImmediateResponse mImmediateResponse; +}; + +// Structure to describe response TLV 0x40 for CATGetEventReport() +struct sCATGetEventReportResponse_UserConfirmationAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x41 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupCallDisplayAlpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x42 for CATGetEventReport() +struct sCATGetEventReportResponse_UserConfirmationIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x43 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupCallDisplayIcon +{ + eQMICATIconQualifier mIconQualifier; + UINT8 mHeight; + UINT8 mWidth; + eQMICATImageCodingScheme mImageCodingScheme; + UINT8 mRecordNumber; + UINT16 mIconDataLength; + + // This array must be the size specified by mIconDataLength + // UINT8 mIconData[1]; +}; + +// Structure to describe response TLV 0x44 for CATGetEventReport() +struct sCATGetEventReportResponse_GatewayProxy +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x45 for CATGetEventReport() +struct sCATGetEventReportResponse_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x46 for CATGetEventReport() +struct sCATGetEventReportResponse_NotificationRequired +{ + eQMICATNotificationRequired mNotificationRequired; +}; + +// Structure to describe response TLV 0x47 for CATGetEventReport() +struct sCATGetEventReportResponse_PlayToneEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mPlayToneCommand[1]; +}; + +// Structure to describe response TLV 0x48 for CATGetEventReport() +struct sCATGetEventReportResponse_SetupCallEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupCallCommand[1]; +}; + +// Structure to describe response TLV 0x49 for CATGetEventReport() +struct sCATGetEventReportResponse_SendDTMFEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDTMFCommand[1]; +}; + +// Structure to describe response TLV 0x4A for CATGetEventReport() +struct sCATGetEventReportResponse_LaunchBrowserEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mLaunchBrowserCommand[1]; +}; + +// Structure to describe response TLV 0x4B for CATGetEventReport() +struct sCATGetEventReportResponse_SendSMSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSMSCommand[1]; +}; + +// Structure to describe response TLV 0x4C for CATGetEventReport() +struct sCATGetEventReportResponse_SendSSEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendSSCommand[1]; +}; + +// Structure to describe response TLV 0x4D for CATGetEventReport() +struct sCATGetEventReportResponse_SendUSSDEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendUSSDCommand[1]; +}; + +// Structure to describe response TLV 0x4E for CATGetEventReport() +struct sCATGetEventReportResponse_ProvideLocalInformationEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mProvideLocalInformationCommand[1]; +}; + +// Structure to describe response TLV 0x4F for CATGetEventReport() +struct sCATGetEventReportResponse_SetupEventListRawEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSetupEventListCommand[1]; +}; + +// Structure to describe response TLV 0x50 for CATGetEventReport() +struct sCATGetEventReportResponse_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe response TLV 0x51 for CATGetEventReport() +struct sCATGetEventReportResponse_OpenChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mOpenChannelCommand[1]; +}; + +// Structure to describe response TLV 0x52 for CATGetEventReport() +struct sCATGetEventReportResponse_CloseChannelEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mCloseChannelCommand[1]; +}; + +// Structure to describe response TLV 0x53 for CATGetEventReport() +struct sCATGetEventReportResponse_SendDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mSendDataCommand[1]; +}; + +// Structure to describe response TLV 0x54 for CATGetEventReport() +struct sCATGetEventReportResponse_ReceiveDataEvent +{ + UINT32 mReferenceID; + UINT16 mCommandLength; + + // This array must be the size specified by mCommandLength + // UINT8 mReceiveDataCommand[1]; +}; + +// Structure to describe response TLV 0x55 for CATGetEventReport() +struct sCATGetEventReportResponse_OnDemandLinkEstablish +{ + eQMICATOnDemandLinkEstablish mOnDemandLinkEstablish; +}; + +// Structure to describe response TLV 0x56 for CATGetEventReport() +struct sCATGetEventReportResponse_CSDBearerDescription +{ + UINT8 mSpeed; + eQMICATCSDBearerName mCSDBearerName; + eQMICATConnectionElement mConnectionElement; +}; + +// Structure to describe response TLV 0x57 for CATGetEventReport() +struct sCATGetEventReportResponse_GPRSBearerDescription +{ + UINT8 mPrecedenceClass; + UINT8 mDelayClass; + UINT8 mReliabilityClass; + UINT8 mPeakThroughput; + UINT8 mMeanThroughput; + eQMICATPacketDataProtocol mPacketDataProtocol; +}; + +// Structure to describe response TLV 0x58 for CATGetEventReport() +struct sCATGetEventReportResponse_EUTRANExternalParameterBearerDescription +{ + eQMICATTrafficClass mTrafficClass; + UINT16 mMaxUploadBitrate; + UINT16 mMaxDownloadBitrate; + UINT16 mGuaranteedUploadBitrate; + UINT16 mGuaranteedDownloadBitrate; + eQMICATDeliveryOrder mDeliveryOrder; + UINT8 mMaxSDUSize; + UINT8 mMaxSDUErrorRatio; + UINT8 mResidualBitErrorRatio; + eQMICATDeliverErrorSDU mDeliverErrorSDU; + UINT8 mTransferDelay; + UINT8 mTrafficHandlingPRI; + eQMICATPDPType mPDPType; +}; + +// Structure to describe response TLV 0x59 for CATGetEventReport() +struct sCATGetEventReportResponse_EUTRANExternalMappedUTRANBearerDescription +{ + UINT8 mQCI; + UINT8 mMaxUploadBitrate; + UINT8 mMaxDownloadBitrate; + UINT8 mGuaranteedUploadBitrate; + UINT8 mGuaranteedDownloadBitrate; + UINT8 mMaximumUploadBitrateExt; + UINT8 mMaximumDownloadBitrateExt; + UINT8 mGuaranteedUploadBitrateExt; + UINT8 mGuaranteedDownloadBitrateExt; + eQMICATPDPType mPDPType; +}; + +// Structure to describe response TLV 0x5A for CATGetEventReport() +struct sCATGetEventReportResponse_BufferSize +{ + UINT16 mBufferSize; +}; + +// Structure to describe response TLV 0x5B for CATGetEventReport() +struct sCATGetEventReportResponse_NetworkAccessName +{ + UINT8 mNetworkAccessNameLength; + + // This array must be the size specified by mNetworkAccessNameLength + // UINT8 mNetworkAccessName[1]; +}; + +// Structure to describe response TLV 0x5C for CATGetEventReport() +struct sCATGetEventReportResponse_OtherAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x5D for CATGetEventReport() +struct sCATGetEventReportResponse_UserLogin +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x5E for CATGetEventReport() +struct sCATGetEventReportResponse_UserPassword +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x5F for CATGetEventReport() +struct sCATGetEventReportResponse_TransportLevel +{ + eQMICATTransportProtocol mTransportProtocol; + UINT16 mPortNumber; +}; + +// Structure to describe response TLV 0x60 for CATGetEventReport() +struct sCATGetEventReportResponse_DataDestinationAddress +{ + eQMICATAddressType mAddressType; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x61 for CATGetEventReport() +struct sCATGetEventReportResponse_ChannelDataLength +{ + UINT8 mChannelDataLength; +}; + +// Structure to describe response TLV 0x62 for CATGetEventReport() +struct sCATGetEventReportResponse_SendDataImmediately +{ + eQMICATSendDataImmediately mSendDataImmediately; +}; + +// Structure to describe response TLV 0x63 for CATGetEventReport() +struct sCATGetEventReportResponse_ChannelData +{ + UINT16 mChannelDataLength; + + // This array must be the size specified by mChannelDataLength + // UINT8 mChannelData[1]; +}; + +// Structure to describe response TLV 0x64 for CATGetEventReport() +struct sCATGetEventReportResponse_ChannelID +{ + UINT8 mChannelID; +}; + +// Structure to describe response TLV 0x65 for CATGetEventReport() +struct sCATGetEventReportResponse_ItemsWithDCS +{ + UINT8 mItemsLength; + + struct sItem + { + UINT8 mItemID; + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mItemTextLength; + + // This array must be the size specified by mItemTextLength + // UINT8 mItemText[1]; + }; + + // This array must be the size specified by mItemsLength + // sItem mItems[1]; +}; + +// Structure to describe response TLV 0x66 for CATGetEventReport() +struct sCATGetEventReportResponse_Activate +{ + UINT32 mReferenceID; + UINT16 mActivateLength; + + // This array must be the size specified by mActivateLength + // UINT8 mActivate[1]; +}; + +// Structure to describe response TLV 0x67 for CATGetEventReport() +struct sCATGetEventReportResponse_ActivateTarget +{ + eQMICATActivateTargets mActivateTarget; +}; + +// Structure to describe request TLV 0x01 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_TerminalResponse +{ + UINT32 mReferenceID; + UINT8 mCommandNumber; + eQMICATResponseCommand mResponseCommand; + UINT8 mGeneralResult; + UINT8 mAdditionalInformationLength; + + // This array must be the size specified by mAdditionalInformationLength + // UINT8 mTerminalResponseAdditionalInformation[1]; +}; + +// Structure to describe request TLV 0x10 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_TextString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x11 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_ItemIdentifier +{ + UINT8 mItemIdentifier; +}; + +// Structure to describe request TLV 0x12 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_GetInkeyExtraInfo +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x13 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_LanguageInfo +{ + char mLanguage[2]; +}; + +// Structure to describe request TLV 0x14 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x15 for CATSendDecodedTerminalResponse() +struct sCATSendDecodedTerminalResponseRequest_GetInkeyYesInput +{ + eQMICATTimeUnits mUnits; + UINT8 mInterval; + INT8 mGetInkeyYesInput; +}; + +// Structure to describe response TLV 0x10 for CATSendDecodedTerminal() +struct sCATSendDecodedTerminalResponseResponse_TRResponse +{ + UINT8 mSW1; + UINT8 mSW2; + UINT8 mTerminalResponseLength; + + // This array must be the size specified by mTerminalResponseLength + // UINT8 mTerminalResponseData[1]; +}; + +// Structure to describe request TLV 0x01 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_EnvelopeCommand +{ + eQMICATDecodedEnvelopeCommand mEnvelopeCommand; +}; + +// Structure to describe request TLV 0x10 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_ItemIdentifier +{ + UINT8 mItemIdentifier; +}; + +// Structure to describe request TLV 0x11 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_HelpRequest +{ + eQMICATHelpRequest mHelpRequest; +}; + +// Structure to describe request TLV 0x12 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_Language +{ + char mLanguage[2]; +}; + +// Structure to describe request TLV 0x13 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x14 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe request TLV 0x15 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe request TLV 0x16 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_CapabilityConfigParam1 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe request TLV 0x17 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_CapabilityConfigParam2 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe request TLV 0x18 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_USSDString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe request TLV 0x19 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_PDPContextActivation +{ + UINT8 mPDPContextActivationDataLength; + + // This array must be the size specified by mPDPContextActivationDataLength + // UINT8 mPDPContextActivationData[1]; +}; + +// Structure to describe request TLV 0x1A for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_EPSPDNConnectActivation +{ + UINT8 mEPSPDNConnectActivationDataLength; + + // This array must be the size specified by mEPSPDNConnectActivationDataLength + // UINT8 mEPSPDNConnectActivationData[1]; +}; + +// Structure to describe request TLV 0x1B for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandRequest_BrowserTerminationCause +{ + eQMICATBrowserTerminationCauses mBrowserTerminationCause; +}; + +// Structure to describe response TLV 0x10 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_CallControlResult +{ + eQMICATCallControlResult mCallControlResult; +}; + +// Structure to describe response TLV 0x11 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_Address +{ + eQMICATAddressTON mAddressTON; + eQMICATAddressNPI mAddressNPI; + UINT8 mAddressDataLength; + + // This array must be the size specified by mAddressDataLength + // char mAddressData[1]; +}; + +// Structure to describe response TLV 0x12 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_Subaddress +{ + UINT8 mSubaddressDataLength; + + struct sSubaddressData + { + UINT8 mSubaddressData1:4; + UINT8 mSubaddressData2:4; + }; + + // This array must be the size specified by mSubaddressDataLength + // sSubaddressData mSubaddressDatas[1]; +}; + +// Structure to describe response TLV 0x13 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_CapabilityConfigParam1 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x14 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_CapabilityConfigParam2 +{ + UINT8 mCapabilitesConfigurationLength; + + // This array must be the size specified by mCapabilitesConfigurationLength + // UINT8 mCapabilitiesConfiguration[1]; +}; + +// Structure to describe response TLV 0x15 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_USSDString +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x16 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_PDPContextActivation +{ + UINT8 mPDPContextActivationDataLength; + + // This array must be the size specified by mPDPContextActivationDataLength + // UINT8 mPDPContextActivationData[1]; +}; + +// Structure to describe response TLV 0x17 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_EPSPDNConnectActivation +{ + UINT8 mEPSPDNConnectActivationDataLength; + + // This array must be the size specified by mEPSPDNConnectActivationDataLength + // UINT8 mEPSPDNConnectActivationData[1]; +}; + +// Structure to describe response TLV 0x18 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_Alpha +{ + eQMICATDataCodingScheme mDataCodingScheme; + UINT8 mTextDataLength; + + // This array must be the size specified by mTextDataLength + // UINT8 mTextData[1]; +}; + +// Structure to describe response TLV 0x19 for CATSendDecodedEnvelopeCommand() +struct sCATSendDecodedEnvelopeCommandResponse_BCRepeatIndicator +{ + eQMICATBearerCapabilityRepeatIndicator mBearerCapabilityRepeatIndicator; +}; + +// Structure to describe request TLV 0x10 for CATEventConfirmation() +struct sCATEventConfirmationRequest_UserConfirmed +{ + eQMICATUserConfirmed mUserConfirmed; +}; + +// Structure to describe request TLV 0x11 for CATEventConfirmation() +struct sCATEventConfirmationRequest_IconIsDisplayed +{ + eQMICATIconIsDisplayed mIconIsDisplayed; +}; + +// Structure to describe request TLV 0x12 for CATEventConfirmation() +struct sCATEventConfirmationRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATSCWSOpenChannel() +struct sCATSCWSOpenChannelRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CATSCWSOpenChannel() +struct sCATSCWSOpenChannelRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT SCWSOpenChannelIndication +struct sCATSCWSOpenChannelIndication_OpenChannelInformation +{ + UINT32 mChannelID; + UINT16 mPortNumber; + UINT16 mBufferSize; +}; + +// Structure to describe indication TLV 0x11 for CAT SCWSOpenChannelIndication +struct sCATSCWSOpenChannelIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATSCWSCloseChannel() +struct sCATSCWSCloseChannelRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CATSCWSCloseChannel() +struct sCATSCWSCloseChannelRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT SCWSCloseChannelIndication +struct sCATSCWSCloseChannelIndication_CloseChannelInfo +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe response TLV 0x11 for CATSCWSCloseChannel() +struct sCATSCWSCloseChannelResponse_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATSCWSSendData() +struct sCATSCWSSendDataRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATSendDataResult mDataSendResult; +}; + +// Structure to describe request TLV 0x10 for CATSCWSSendData() +struct sCATSCWSSendDataRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe indication TLV 0x10 for CAT SCWSSendDataIndication +struct sCATSCWSSendDataIndication_SendDataInfo +{ + UINT32 mChannelID; + UINT8 mTotalPackets; + UINT8 mCurrentPacket; + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe indication TLV 0x11 for CAT SCWSSendDataIndication +struct sCATSCWSSendDataIndication_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATSCWSDataAvailable() +struct sCATSCWSDataAvailableRequest_RemainingData +{ + UINT32 mChannelID; + UINT16 mDataLength; + + // This array must be the size specified by mDataLength + // UINT8 mData[1]; +}; + +// Structure to describe request TLV 0x10 for CATSCWSDataAvailable() +struct sCATSCWSDataAvailableRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x01 for CATSCWSChannelStatus() +struct sCATSCWSChannelStatusRequest_ChannelStatus +{ + UINT32 mChannelID; + eQMICATChannelState mChannelState; +}; + +// Structure to describe request TLV 0x10 for CATSCWSChannelStatus() +struct sCATSCWSChannelStatusRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe request TLV 0x10 for CATGetTerminalProfile() +struct sCATGetTerminalProfileRequest_Slot +{ + eQMICATSlot mSlot; +}; + +// Structure to describe response TLV 0x10 for CATGetTerminalProfile() +struct sCATGetTerminalProfileResponse_RawData +{ + UINT8 mTerminalProfileLength; + + // This array must be the size specified by mTerminalProfileLength + // UINT8 mTerminalProfileData[1]; +}; + +// Structure to describe request TLV 0x01 for CATSetConfiguration() +struct sCATSetConfigurationRequest_Mode +{ + eQMICATConfigModes mConfigMode; +}; + +// Structure to describe request TLV 0x10 for CATSetConfiguration() +struct sCATSetConfigurationRequest_CustomData +{ + UINT8 mTerminalProfileLength; + + // This array must be the size specified by mTerminalProfileLength + // UINT8 mTerminalProfileData[1]; +}; + +// Structure to describe response TLV 0x10 for CATGetConfiguration() +struct sCATGetConfigurationResponse_Mode +{ + eQMICATConfigModes mConfigMode; +}; + +// Structure to describe response TLV 0x11 for CATGetConfiguration() +struct sCATGetConfigurationResponse_CustomData +{ + UINT8 mTerminalProfileLength; + + // This array must be the size specified by mTerminalProfileLength + // UINT8 mTerminalProfileData[1]; +}; + +// Structure to describe response TLV 0x10 for RMSGetSMSWake() +struct sRMSGetSMSWakeResponse_State +{ + INT8 mSMSWakeEnabled; +}; + +// Structure to describe request TLV 0x11 for RMSGetSMSWake() +struct sRMSGetSMSWakeRequest_Mask +{ + UINT32 mMask; +}; + +// Structure to describe request TLV 0x10 for RMSSetSMSWake() +struct sRMSSetSMSWakeRequest_State +{ + INT8 mSMSWakeEnabled; +}; + +// Structure to describe request TLV 0x11 for RMSSetSMSWake() +struct sRMSSetSMSWakeRequest_Mask +{ + UINT32 mMask; +}; + +// Structure to describe request TLV 0x10 for OMASetEventReport() +struct sOMASetEventReportRequest_NIA +{ + INT8 mReportNetworkInitiatedAlerts; +}; + +// Structure to describe request TLV 0x11 for OMASetEventReport() +struct sOMASetEventReportRequest_Status +{ + INT8 mReportSessionStatus; +}; + +// Structure to describe indication TLV 0x10 for OMA EventReport +struct sOMAEventReportIndication_NIA +{ + eQMIOMASessionTypes mSessionType; + UINT16 mSessionID; +}; + +// Structure to describe indication TLV 0x11 for OMA EventReport +struct sOMAEventReportIndication_Status +{ + eQMIOMASessionStates mSessionState; +}; + +// Structure to describe indication TLV 0x12 for OMA EventReport +struct sOMAEventReportIndication_Failure +{ + eQMIOMASessionFailureReasons mSessionFailure; +}; + +// Structure to describe request TLV 0x10 for OMAStartSession() +struct sOMAStartSessionRequest_Type +{ + eQMIOMASessionTypes mSessionType; +}; + +// Structure to describe response TLV 0x10 for OMAGetSessionInfo() +struct sOMAGetSessionInfoResponse_Info +{ + eQMIOMASessionStates mSessionState; + eQMIOMASessionTypes mSessionType; +}; + +// Structure to describe response TLV 0x11 for OMAGetSessionInfo() +struct sOMAGetSessionInfoResponse_Failure +{ + eQMIOMASessionFailureReasons mSessionFailure; +}; + +// Structure to describe response TLV 0x12 for OMAGetSessionInfo() +struct sOMAGetSessionInfoResponse_Retry +{ + UINT8 mRetryCount; + UINT16 mRetryPauseTimer; + UINT16 mRemainingTime; +}; + +// Structure to describe response TLV 0x13 for OMAGetSessionInfo() +struct sOMAGetSessionInfoResponse_NIA +{ + eQMIOMASessionTypes mSessionType; + UINT16 mSessionID; +}; + +// Structure to describe request TLV 0x10 for OMASendSelection() +struct sOMASendSelectionRequest_Type +{ + eQMIOMASelections mSelection; + UINT16 mSessionID; +}; + +// Structure to describe response TLV 0x10 for OMAGetFeatures() +struct sOMAGetFeaturesResponse_Provisioning +{ + INT8 mDeviceProvisioningServiceUpdateEnabled; +}; + +// Structure to describe response TLV 0x11 for OMAGetFeatures() +struct sOMAGetFeaturesResponse_PRLUpdate +{ + INT8 mPRLServiceUpdateEnabled; +}; + +// Structure to describe response TLV 0x12 for OMAGetFeatures() +struct sOMAGetFeaturesResponse_HFAFeature +{ + INT8 mHFAFeatureEnabled; +}; + +// Structure to describe response TLV 0x13 for OMAGetFeatures() +struct sOMAGetFeaturesResponse_HFADoneState +{ + eQMIOMAHFADoneStates mHFAFeatureDoneState; +}; + +// Structure to describe request TLV 0x10 for OMASetFeatures() +struct sOMASetFeaturesRequest_Provisioning +{ + INT8 mDeviceProvisioningServiceUpdateEnabled; +}; + +// Structure to describe request TLV 0x11 for OMASetFeatures() +struct sOMASetFeaturesRequest_PRLUpdate +{ + INT8 mPRLServiceUpdateEnabled; +}; + +// Structure to describe request TLV 0x12 for OMASetFeatures() +struct sOMASetFeaturesRequest_HFAFeature +{ + INT8 mHFAFeatureEnabled; +}; + + +#pragma pack( pop ) diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp new file mode 100755 index 0000000..b7af336 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp @@ -0,0 +1,19515 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtExports.cpp + +DESCRIPTION: + QUALCOMM Gobi Connection Management API exports + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiConnectionMgmt.h" + +/*=========================================================================*/ +// Exported Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GobiConnect + +DESCRIPTION: + This function connects the CM API library to the specified Gobi + device + +PARAMETERS: + pQMIFile [ I ] - Device interface to connect to + pServicesCount [I/O] - Upon input the number of QMI services to connect to, + upon output the number of QMI services successfully + connected to + pServices [I/O] - Upon input the array of QMI service IDs to connect + to, upon output the array of QMI service IDs + successfully connected to + pHandle [ O ] - The returned Gobi interface handle + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiConnect( + LPCSTR pInterface, + ULONG * pServicesCount, + ULONG * pServices, + GOBIHANDLE * pHandle ) +{ + // Validate arguments + if ( (pInterface == 0) + || (pServicesCount == 0) + || (*pServicesCount == 0) + || (pServices == 0) + || (pHandle == 0) ) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + GOBIHANDLE handle = gDLL.CreateAPI(); + if (handle == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcCount = *pServicesCount; + *pServicesCount = 0; + *pHandle = 0; + + std::set inSvcs; + std::set outSvcs; + + ULONG s = 0; + for (s = 0; s < svcCount; s++) + { + inSvcs.insert( (eQMIService)pServices[s] ); + } + + outSvcs = pAPI->Connect( pInterface, inSvcs ); + + ULONG outSvcsCount = (ULONG)outSvcs.size(); + if (outSvcsCount > svcCount) + { + outSvcsCount = svcCount; + } + + if (outSvcsCount == 0) + { + ULONG rc = (ULONG)pAPI->GetCorrectedLastError(); + pAPI = 0; + + gDLL.DeleteAPI( handle ); + return rc; + } + + std::set ::const_iterator pOutSvc = outSvcs.begin(); + for (s = 0; s < svcCount; s++) + { + pServices[s] = UCHAR_MAX; + if (s < outSvcsCount) + { + pServices[s] = (ULONG)*pOutSvc++; + } + } + + *pHandle = handle; + *pServicesCount = outSvcsCount; + + return (ULONG)eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GobiCancel + +DESCRIPTION: + This function cancels the most recent outstanding request for the + specified QMI service + +PARAMETERS: + handle [ I ] - Gobi interface handle + svcID [ I ] - Service whose outstanding request is to be cancelled + pTXID [ O ] - QMI transaction ID of outstanding request + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiCancel( + GOBIHANDLE handle, + ULONG svcID, + ULONG * pTXID ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->CancelSend( svcID, pTXID ); +} + +/*=========================================================================== +METHOD: + GobiDisconnect + +DESCRIPTION: + This function disconnects the CM API library from the currently + connected Gobi device + +PARAMETERS: + handle [ I ] - Gobi interface handle + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiDisconnect( GOBIHANDLE handle ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + bool bDisco = pAPI->Disconnect(); + if (bDisco == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + return (ULONG)eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetGenericCallback + +DESCRIPTION: + This function enables/disables a generic callback + +PARAMETERS: + handle [ I ] - Gobi interface handle + svcID [ I ] - Service ID to monitor + msgID [ I ] - Message ID to look for + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG SetGenericCallback( + GOBIHANDLE handle, + ULONG svcID, + ULONG msgID, + tFNGenericCallback pCallback ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetGenericCallback( svcID, + msgID, + pCallback, + handle ); +} + +/*=========================================================================== +METHOD: + WDSReset + +DESCRIPTION: + The function sends 'WDS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetEventReport + +DESCRIPTION: + The function sends 'WDS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSAbort + +DESCRIPTION: + The function sends 'WDS/Abort Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSAbort( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 2; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetIndication + +DESCRIPTION: + The function sends 'WDS/Set Indication Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetIndication( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 3; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSStartNetworkInterface + +DESCRIPTION: + The function sends 'WDS/Start Network Interface Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSStartNetworkInterface( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSStopNetworkInterface + +DESCRIPTION: + The function sends 'WDS/Stop Network Interface Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSStopNetworkInterface( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetPacketServiceStatus + +DESCRIPTION: + The function sends 'WDS/Get Packet Service Status Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPacketServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetChannelRates + +DESCRIPTION: + The function sends 'WDS/Get Channel Rates Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetChannelRates( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetPacketStatistics + +DESCRIPTION: + The function sends 'WDS/Get Packet Statistics Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPacketStatistics( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGoDormant + +DESCRIPTION: + The function sends 'WDS/Go Dormant Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGoDormant( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGoActive + +DESCRIPTION: + The function sends 'WDS/Go Active Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGoActive( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSCreateProfile + +DESCRIPTION: + The function sends 'WDS/Create Profile Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSCreateProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSModifyProfile + +DESCRIPTION: + The function sends 'WDS/Modify Profile Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSModifyProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSDeleteProfile + +DESCRIPTION: + The function sends 'WDS/Delete Profile Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSDeleteProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetProfileList + +DESCRIPTION: + The function sends 'WDS/Get Profile List Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetProfileList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetProfileSettings + +DESCRIPTION: + The function sends 'WDS/Get Profile Settings Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetProfileSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDefaultSettings + +DESCRIPTION: + The function sends 'WDS/Get Default Settings Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDefaultSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCurrentSettings + +DESCRIPTION: + The function sends 'WDS/Get Current Settings Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCurrentSettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetMIPMode + +DESCRIPTION: + The function sends 'WDS/Set MIP Mode Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetMIPMode + +DESCRIPTION: + The function sends 'WDS/Get MIP Mode Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDormancy + +DESCRIPTION: + The function sends 'WDS/Get Dormancy Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDormancy( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetAutoconnectSetting + +DESCRIPTION: + The function sends 'WDS/Get Autoconnect Setting Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetAutoconnectSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDataSessionDuration + +DESCRIPTION: + The function sends 'WDS/Get Data Session Duration Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDataSessionDuration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetModemStatus + +DESCRIPTION: + The function sends 'WDS/Get Modem Status Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetModemStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDataBearerTechnology + +DESCRIPTION: + The function sends 'WDS/Get Data Bearer Technology Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDataBearerTechnology( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetModemInfo + +DESCRIPTION: + The function sends 'WDS/Get Modem Info Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetModemInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetActiveMIPProfile + +DESCRIPTION: + The function sends 'WDS/Get Active MIP Profile Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetActiveMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetActiveMIPProfile + +DESCRIPTION: + The function sends 'WDS/Set Active MIP Profile Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetActiveMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetMIPProfile + +DESCRIPTION: + The function sends 'WDS/Get MIP Profile Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 62; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetMIPProfile + +DESCRIPTION: + The function sends 'WDS/Set MIP Profile Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetMIPParameters + +DESCRIPTION: + The function sends 'WDS/Get MIP Parameters Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetMIPParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetMIPParameters + +DESCRIPTION: + The function sends 'WDS/Set MIP Parameters Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetMIPParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetLastMIPStatus + +DESCRIPTION: + The function sends 'WDS/Get Last MIP Status Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetLastMIPStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetANAAAAuthenticationStatus + +DESCRIPTION: + The function sends 'WDS/Get AN-AAA Authentication Status Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetANAAAAuthenticationStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCurrentDataBearerTechnology + +DESCRIPTION: + The function sends 'WDS/Get Current Data Bearer Technology Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCurrentDataBearerTechnology( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCallList + +DESCRIPTION: + The function sends 'WDS/Get Call List Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCallRecord + +DESCRIPTION: + The function sends 'WDS/Get Call Record Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 70; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSClearCallList + +DESCRIPTION: + The function sends 'WDS/Clear Call List Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSClearCallList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 71; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCallListMaxSize + +DESCRIPTION: + The function sends 'WDS/Get Call List Max Size Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallListMaxSize( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 72; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDefaultProfileNumber + +DESCRIPTION: + The function sends 'WDS/Get Default Profile Number Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDefaultProfileNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 73; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetDefaultProfileNumber + +DESCRIPTION: + The function sends 'WDS/Set Default Profile Number Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDefaultProfileNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 74; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSResetProfile + +DESCRIPTION: + The function sends 'WDS/Reset Profile Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSResetProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 75; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSResetProfileParamToInvalid + +DESCRIPTION: + The function sends 'WDS/Reset Profile Param To Invalid Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSResetProfileParamToInvalid( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 76; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetIPFamilyPreference + +DESCRIPTION: + The function sends 'WDS/Set IP Family Preference Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetIPFamilyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 77; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetFMCTunnelParameters + +DESCRIPTION: + The function sends 'WDS/Set FMC Tunnel Parameters Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetFMCTunnelParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 78; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSClearFMCTunnelParameters + +DESCRIPTION: + The function sends 'WDS/Clear FMC Tunnel Parameters Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSClearFMCTunnelParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 79; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetFMCTunnelParameters + +DESCRIPTION: + The function sends 'WDS/Get FMC Tunnel Parameters Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetFMCTunnelParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 80; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetAutoconnectSetting + +DESCRIPTION: + The function sends 'WDS/Set Autoconnect Setting Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetAutoconnectSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 81; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDNSSetting + +DESCRIPTION: + The function sends 'WDS/Get DNS Setting Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDNSSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 82; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetDNSSetting + +DESCRIPTION: + The function sends 'WDS/Set DNS Setting Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDNSSetting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 83; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCDMAPreDormancySettings + +DESCRIPTION: + The function sends 'WDS/Get CDMA Pre-Dormancy Settings Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCDMAPreDormancySettings( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 84; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetCAMTimer + +DESCRIPTION: + The function sends 'WDS/Set CAM Timer Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetCAMTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 85; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCAMTimer + +DESCRIPTION: + The function sends 'WDS/Get CAM Timer Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCAMTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 86; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetSCRM + +DESCRIPTION: + The function sends 'WDS/Set SCRM Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetSCRM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 87; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetSCRM + +DESCRIPTION: + The function sends 'WDS/Get SCRM Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetSCRM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 88; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetRDUD + +DESCRIPTION: + The function sends 'WDS/Set RDUD Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetRDUD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 89; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetRDUD + +DESCRIPTION: + The function sends 'WDS/Get RDUD Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetRDUD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 90; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetSIPMIPCallType + +DESCRIPTION: + The function sends 'WDS/Get SIP/MIP Call Type Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetSIPMIPCallType( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 91; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetEVDOPageMonitorPeriod + +DESCRIPTION: + The function sends 'WDS/Set EV-DO Page Monitor Period Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEVDOPageMonitorPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 92; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetEVDOLongSleep + +DESCRIPTION: + The function sends 'WDS/Set EV-DO Long Sleep Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetEVDOLongSleep( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 93; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetEVDOPageMonitorPeriod + +DESCRIPTION: + The function sends 'WDS/Get EV-DO Page Monitor Period Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetEVDOPageMonitorPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 94; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCallThrottleInfo + +DESCRIPTION: + The function sends 'WDS/Get Call Throttle Info Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCallThrottleInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 95; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetNSAPI + +DESCRIPTION: + The function sends 'WDS/Get NSAPI Request' (0x0060) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetNSAPI( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 96; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetDUNCallControlPreference + +DESCRIPTION: + The function sends 'WDS/Set DUN Call Control Preference Request' (0x0061) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDUNCallControlPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 97; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetDUNCallControlInfo + +DESCRIPTION: + The function sends 'WDS/Get DUN Call Control Info Request' (0x0062) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetDUNCallControlInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 98; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSSetDUNCallControlEventReport + +DESCRIPTION: + The function sends 'WDS/Set DUN Call Control Event Report Request' (0x0063) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSSetDUNCallControlEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 99; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSPendingDUNCallControl + +DESCRIPTION: + The function sends 'WDS/Pending DUN Call Control Request' (0x0064) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSPendingDUNCallControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 100; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSEMBMSTMGIActivate + +DESCRIPTION: + The function sends 'WDS/EMBMS TMGI Activate Request' (0x0065) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSEMBMSTMGIActivate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 101; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSEMBMSTMGIDeactivate + +DESCRIPTION: + The function sends 'WDS/EMBMS TMGI Deactivate Request' (0x0066) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSEMBMSTMGIDeactivate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 102; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSEMBMSTMGIListQuery + +DESCRIPTION: + The function sends 'WDS/EMBMS TMGI List Query Request' (0x0067) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSEMBMSTMGIListQuery( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 103; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetPreferredDataSystem + +DESCRIPTION: + The function sends 'WDS/Get Preferred Data System Request' (0x0069) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPreferredDataSystem( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 105; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetLastDataCallStatus + +DESCRIPTION: + The function sends 'WDS/Get Last Data Call Status Request' (0x006A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetLastDataCallStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 106; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetCurrentDataSystems + +DESCRIPTION: + The function sends 'WDS/Get Current Data Systems Request' (0x006B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetCurrentDataSystems( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 107; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetPDNThrottleInfo + +DESCRIPTION: + The function sends 'WDS/Get PDN Throttle Info Request' (0x006C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetPDNThrottleInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 108; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetLTEAttachParameters + +DESCRIPTION: + The function sends 'WDS/Get LTE Attach Parameters Request' (0x0085) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetLTEAttachParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 133; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSResetPacketStatistics + +DESCRIPTION: + The function sends 'WDS/Reset Packet Statistics Request' (0x0086) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSResetPacketStatistics( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 134; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WDSGetFlowControlStatus + +DESCRIPTION: + The function sends 'WDS/Get Flow Control Status Request' (0x0087) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WDSGetFlowControlStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 1; + ULONG msgID = 135; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSReset + +DESCRIPTION: + The function sends 'DMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetEventReport + +DESCRIPTION: + The function sends 'DMS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceCapabilities + +DESCRIPTION: + The function sends 'DMS/Get Device Capabilities Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceManfacturer + +DESCRIPTION: + The function sends 'DMS/Get Device Manfacturer Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceManfacturer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceModel + +DESCRIPTION: + The function sends 'DMS/Get Device Model Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceModel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceRevision + +DESCRIPTION: + The function sends 'DMS/Get Device Revision Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceVoiceNumber + +DESCRIPTION: + The function sends 'DMS/Get Device Voice Number Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceVoiceNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetDeviceSerialNumbers + +DESCRIPTION: + The function sends 'DMS/Get Device Serial Numbers Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetDeviceSerialNumbers( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetPowerState + +DESCRIPTION: + The function sends 'DMS/Get Power State Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetPowerState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMSetPINProtection + +DESCRIPTION: + The function sends 'DMS/UIM Set PIN Protection Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMSetPINProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMVerifyPIN + +DESCRIPTION: + The function sends 'DMS/UIM Verify PIN Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMVerifyPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMUnblockPIN + +DESCRIPTION: + The function sends 'DMS/UIM Unblock PIN Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMUnblockPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMChangePIN + +DESCRIPTION: + The function sends 'DMS/UIM Change PIN Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMChangePIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMGetPINStatus + +DESCRIPTION: + The function sends 'DMS/UIM Get PIN Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetPINStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetHardwareRevision + +DESCRIPTION: + The function sends 'DMS/Get Hardware Revision Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetHardwareRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetOperatingMode + +DESCRIPTION: + The function sends 'DMS/Get Operating Mode Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetOperatingMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetOperatingMode + +DESCRIPTION: + The function sends 'DMS/Set Operating Mode Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetOperatingMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetTimestamp + +DESCRIPTION: + The function sends 'DMS/Get Timestamp Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetTimestamp( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetPRLVersion + +DESCRIPTION: + The function sends 'DMS/Get PRL Version Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetPRLVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetActivationState + +DESCRIPTION: + The function sends 'DMS/Get Activation State Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetActivationState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSActivateAutomatic + +DESCRIPTION: + The function sends 'DMS/Activate Automatic Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSActivateAutomatic( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 50; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSActivateManual + +DESCRIPTION: + The function sends 'DMS/Activate Manual Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSActivateManual( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetLockState + +DESCRIPTION: + The function sends 'DMS/Get Lock State Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetLockState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetLockState + +DESCRIPTION: + The function sends 'DMS/Set Lock State Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetLockState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetLockCode + +DESCRIPTION: + The function sends 'DMS/Set Lock Code Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetLockCode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSReadUserData + +DESCRIPTION: + The function sends 'DMS/Read User Data Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReadUserData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSWriteUserData + +DESCRIPTION: + The function sends 'DMS/Write User Data Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSWriteUserData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSReadERIData + +DESCRIPTION: + The function sends 'DMS/Read ERI Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSReadERIData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSResetFactoryDefaults + +DESCRIPTION: + The function sends 'DMS/Reset Factory Defaults Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSResetFactoryDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSValidateSPC + +DESCRIPTION: + The function sends 'DMS/Validate SPC Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSValidateSPC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMGetICCID + +DESCRIPTION: + The function sends 'DMS/UIM Get ICCID Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetICCID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMGetHostLockID + +DESCRIPTION: + The function sends 'DMS/UIM Get Host Lock ID Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetHostLockID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMGetControlKeyStatus + +DESCRIPTION: + The function sends 'DMS/UIM Get Control Key Status Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMGetControlKeyStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMSetControlKeyProtection + +DESCRIPTION: + The function sends 'DMS/UIM Set Control Key Protection Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMSetControlKeyProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSUIMUnblockControlKey + +DESCRIPTION: + The function sends 'DMS/UIM Unblock Control Key Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSUIMUnblockControlKey( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetIMSI + +DESCRIPTION: + The function sends 'DMS/Get IMSI Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetIMSI( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetUIMState + +DESCRIPTION: + The function sends 'DMS/Get UIM State Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetUIMState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetBandCapabilities + +DESCRIPTION: + The function sends 'DMS/Get Band Capabilities Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetBandCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetFactorySerialNumber + +DESCRIPTION: + The function sends 'DMS/Get Factory Serial Number Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetFactorySerialNumber( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 70; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetDeviceTime + +DESCRIPTION: + The function sends 'DMS/Set Device Time Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetDeviceTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 75; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetSoftwareVersion + +DESCRIPTION: + The function sends 'DMS/Get Software Version Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetSoftwareVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 81; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSSetSPC + +DESCRIPTION: + The function sends 'DMS/Set SPC Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSSetSPC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 82; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + DMSGetCurrentPRLInfo + +DESCRIPTION: + The function sends 'DMS/Get Current PRL Info Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DMSGetCurrentPRLInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 2; + ULONG msgID = 83; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASReset + +DESCRIPTION: + The function sends 'NAS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASAbort + +DESCRIPTION: + The function sends 'NAS/Abort Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASAbort( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetEventReport + +DESCRIPTION: + The function sends 'NAS/Set Event Report Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 2; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetRegistrationEventReport + +DESCRIPTION: + The function sends 'NAS/Set Registration Event Report Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRegistrationEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 3; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetSignalStrength + +DESCRIPTION: + The function sends 'NAS/Get Signal Strength Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSignalStrength( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASPerformNetworkScan + +DESCRIPTION: + The function sends 'NAS/Perform Network Scan Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASPerformNetworkScan( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASInitiateNetworkRegister + +DESCRIPTION: + The function sends 'NAS/Initiate Network Register Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASInitiateNetworkRegister( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASInitiateAttach + +DESCRIPTION: + The function sends 'NAS/Initiate Attach Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASInitiateAttach( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetServingSystem + +DESCRIPTION: + The function sends 'NAS/Get Serving System Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetServingSystem( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetHomeNetwork + +DESCRIPTION: + The function sends 'NAS/Get Home Network Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetHomeNetwork( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetPreferredNetworks + +DESCRIPTION: + The function sends 'NAS/Get Preferred Networks Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetPreferredNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetPreferredNetworks + +DESCRIPTION: + The function sends 'NAS/Set Preferred Networks Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetPreferredNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetForbiddenNetworks + +DESCRIPTION: + The function sends 'NAS/Get Forbidden Networks Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetForbiddenNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetForbiddenNetworks + +DESCRIPTION: + The function sends 'NAS/Set Forbidden Networks Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetForbiddenNetworks( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetTechnologyPreference + +DESCRIPTION: + The function sends 'NAS/Set Technology Preference Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetTechnologyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetTechnologyPreference + +DESCRIPTION: + The function sends 'NAS/Get Technology Preference Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetTechnologyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetACCOLC + +DESCRIPTION: + The function sends 'NAS/Get ACCOLC Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetACCOLC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetACCOLC + +DESCRIPTION: + The function sends 'NAS/Set ACCOLC Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetACCOLC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetSystemPreference + +DESCRIPTION: + The function sends 'NAS/Get System Preference' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetNetworkParameters + +DESCRIPTION: + The function sends 'NAS/Get Network Parameters Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetNetworkParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetNetworkParameters + +DESCRIPTION: + The function sends 'NAS/Set Network Parameters Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetNetworkParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetRFInfo + +DESCRIPTION: + The function sends 'NAS/Get RF Info Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRFInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetANAAAAuthenticationStatus + +DESCRIPTION: + The function sends 'NAS/Get AN-AAA Authentication Status Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetANAAAAuthenticationStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 50; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetSystemSelectionPref + +DESCRIPTION: + The function sends 'NAS/Set System Selection Pref Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetSystemSelectionPref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetSystemSelectionPref + +DESCRIPTION: + The function sends 'NAS/Get System Selection Pref Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemSelectionPref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetDDTMPreference + +DESCRIPTION: + The function sends 'NAS/Set DDTM Preference Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetDDTMPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetDDTMPreference + +DESCRIPTION: + The function sends 'NAS/Get DDTM Preference Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetDDTMPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetOperatorNameData + +DESCRIPTION: + The function sends 'NAS/Get Operator Name Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetOperatorNameData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetCSPPLMNMode + +DESCRIPTION: + The function sends 'NAS/Get CSP PLMN Mode Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCSPPLMNMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASUpdateAKEY + +DESCRIPTION: + The function sends 'NAS/Update AKEY Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASUpdateAKEY( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGet3GPP2SubscriptionInfo + +DESCRIPTION: + The function sends 'NAS/Get 3GPP2 Subscription Info Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGet3GPP2SubscriptionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 62; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSet3GPP2SubscriptionInfo + +DESCRIPTION: + The function sends 'NAS/Set 3GPP2 Subscription Info Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSet3GPP2SubscriptionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetMobileCAIRevision + +DESCRIPTION: + The function sends 'NAS/Get Mobile CAI Revision Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetMobileCAIRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetRTREConfig + +DESCRIPTION: + The function sends 'NAS/Get RTRE Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRTREConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetRTREConfig + +DESCRIPTION: + The function sends 'NAS/Set RTRE Config Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRTREConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetCellLocationInfo + +DESCRIPTION: + The function sends 'NAS/Get Cell Location Info Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCellLocationInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetPLMNName + +DESCRIPTION: + The function sends 'NAS/Get PLMN Name Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetPLMNName( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASBindSubscription + +DESCRIPTION: + The function sends 'NAS/Bind Subscription Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetModePref + +DESCRIPTION: + The function sends 'NAS/Get Mode Pref Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetModePref( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 73; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetDualStandbyPreference + +DESCRIPTION: + The function sends 'NAS/Set Dual Standby Preference Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetDualStandbyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 75; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetSystemInfo + +DESCRIPTION: + The function sends 'NAS/Get System Info Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSystemInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 77; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetSignalInfo + +DESCRIPTION: + The function sends 'NAS/Get Signal Info Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetSignalInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 79; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASConfigureSignalInfo + +DESCRIPTION: + The function sends 'NAS/Configure Signal Info Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASConfigureSignalInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 80; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetErrorRate + +DESCRIPTION: + The function sends 'NAS/Get Error Rate Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetErrorRate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 82; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetEVDOProtocolSubtype + +DESCRIPTION: + The function sends 'NAS/Get EV-DO Protocol Subtype Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetEVDOProtocolSubtype( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 86; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetEVDOColorCode + +DESCRIPTION: + The function sends 'NAS/Get EV-DO Color Code Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetEVDOColorCode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 87; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetAcquisitionSystemMode + +DESCRIPTION: + The function sends 'NAS/Get Acquisition System Mode Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetAcquisitionSystemMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 88; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASSetRXDiversity + +DESCRIPTION: + The function sends 'NAS/Set RX Diversity Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASSetRXDiversity( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 89; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetRXTXInfo + +DESCRIPTION: + The function sends 'NAS/Get RX/TX Info Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetRXTXInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 90; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASUpdateAKEYExtended + +DESCRIPTION: + The function sends 'NAS/Update A-KEY Extended Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASUpdateAKEYExtended( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 91; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetDualStandbyPreference + +DESCRIPTION: + The function sends 'NAS/Get Dual Standby Preference Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetDualStandbyPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 92; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASDetachLTE + +DESCRIPTION: + The function sends 'NAS/Detach LTE Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASDetachLTE( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 93; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASBlockLTEPLMN + +DESCRIPTION: + The function sends 'NAS/Block LTE PLMN Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASBlockLTEPLMN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 94; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASUnblockLTEPLMN + +DESCRIPTION: + The function sends 'NAS/Unblock LTE PLMN Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASUnblockLTEPLMN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 95; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASResetLTEPLMNBlock + +DESCRIPTION: + The function sends 'NAS/Reset LTE PLMN Block Request' (0x0060) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASResetLTEPLMNBlock( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 96; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASConfigureEMBMS + +DESCRIPTION: + The function sends 'NAS/Configure EMBMS Request' (0x0062) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASConfigureEMBMS( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 98; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetEMBMSStatus + +DESCRIPTION: + The function sends 'NAS/Get EMBMS Status Request' (0x0063) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetEMBMSStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 99; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetCDMAPositionInfo + +DESCRIPTION: + The function sends 'NAS/Get CDMA Position Info Request' (0x0065) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCDMAPositionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 101; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASForceNetworkSearch + +DESCRIPTION: + The function sends 'NAS/Force Network Search Request' (0x0067) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASForceNetworkSearch( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 103; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetManagedRoamingConfig + +DESCRIPTION: + The function sends 'NAS/Get Managed Roaming Config Request' (0x0069) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetManagedRoamingConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 105; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + NASGetCentralizedEONSSupport + +DESCRIPTION: + The function sends 'NAS/Get Centralized EONS Support Request' (0x006B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG NASGetCentralizedEONSSupport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 3; + ULONG msgID = 107; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSReset + +DESCRIPTION: + The function sends 'WMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetEventReport + +DESCRIPTION: + The function sends 'WMS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSRawSend + +DESCRIPTION: + The function sends 'WMS/Raw Send Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawSend( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSRawWrite + +DESCRIPTION: + The function sends 'WMS/Raw Write Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawWrite( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSRawRead + +DESCRIPTION: + The function sends 'WMS/Raw Read Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSRawRead( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSModifyTag + +DESCRIPTION: + The function sends 'WMS/Modify Tag Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSModifyTag( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSDelete + +DESCRIPTION: + The function sends 'WMS/Delete Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSDelete( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetMessageProtocol + +DESCRIPTION: + The function sends 'WMS/Get Message Protocol Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetMessageProtocol( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSListMessages + +DESCRIPTION: + The function sends 'WMS/List Messages Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSListMessages( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetRoutes + +DESCRIPTION: + The function sends 'WMS/Set Routes Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRoutes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 50; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetRoutes + +DESCRIPTION: + The function sends 'WMS/Get Routes Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetRoutes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetSMSCAddress + +DESCRIPTION: + The function sends 'WMS/Get SMSC Address Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetSMSCAddress( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetSMSCAddress + +DESCRIPTION: + The function sends 'WMS/Set SMSC Address Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetSMSCAddress( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetStorageMaxSize + +DESCRIPTION: + The function sends 'WMS/Get Storage Max Size Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetStorageMaxSize( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSendACK + +DESCRIPTION: + The function sends 'WMS/Send ACK Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSendACK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetRetryPeriod + +DESCRIPTION: + The function sends 'WMS/Set Retry Period Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRetryPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetRetryInterval + +DESCRIPTION: + The function sends 'WMS/Set Retry Interval Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetRetryInterval( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetDCDisconnectTimer + +DESCRIPTION: + The function sends 'WMS/Set DC Disconnect Timer Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetDCDisconnectTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetMemoryStatus + +DESCRIPTION: + The function sends 'WMS/Set Memory Status Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetMemoryStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetBroadcastActivation + +DESCRIPTION: + The function sends 'WMS/Set Broadcast Activation Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetBroadcastActivation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetBroadcastConfig + +DESCRIPTION: + The function sends 'WMS/Set Broadcast Config Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetBroadcastConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetBroadcastConfig + +DESCRIPTION: + The function sends 'WMS/Get Broadcast Config Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetBroadcastConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 62; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetDomainPreference + +DESCRIPTION: + The function sends 'WMS/Get Domain Preference Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetDomainPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetDomainPreference + +DESCRIPTION: + The function sends 'WMS/Set Domain Preference Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetDomainPreference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSendFromMemoryStore + +DESCRIPTION: + The function sends 'WMS/Send From Memory Store Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSendFromMemoryStore( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetWaitingMessage + +DESCRIPTION: + The function sends 'WMS/Get Waiting Message Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetWaitingMessage( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetPrimaryClient + +DESCRIPTION: + The function sends 'WMS/Set Primary Client Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetPrimaryClient( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSIndicatorRegistration + +DESCRIPTION: + The function sends 'WMS/Indicator Registration Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSIndicatorRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 71; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetTransportLayerInfo + +DESCRIPTION: + The function sends 'WMS/Get Transport Layer Info Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetTransportLayerInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 72; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetNetworkRegistrationInfo + +DESCRIPTION: + The function sends 'WMS/Get Network Registration Info Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetNetworkRegistrationInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 74; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSBindSubscription + +DESCRIPTION: + The function sends 'WMS/Bind Subscription Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 76; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetIndicatorRegistration + +DESCRIPTION: + The function sends 'WMS/Get Indicator Registration Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetIndicatorRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 77; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetSMSParameters + +DESCRIPTION: + The function sends 'WMS/Get SMS Parameters Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetSMSParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 78; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetSMSParameters + +DESCRIPTION: + The function sends 'WMS/Set SMS Parameters Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetSMSParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 79; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetDomainPreferenceConfig + +DESCRIPTION: + The function sends 'WMS/Get Domain Preference Config Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetDomainPreferenceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 81; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSSetDomainPreferenceConfig + +DESCRIPTION: + The function sends 'WMS/Set Domain Preference Config Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSSetDomainPreferenceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 82; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetRetryPeriod + +DESCRIPTION: + The function sends 'WMS/Get Retry Period Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetRetryPeriod( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 83; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetRetryInterval + +DESCRIPTION: + The function sends 'WMS/Get Retry Interval Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetRetryInterval( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 84; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetDCDisconnectTimer + +DESCRIPTION: + The function sends 'WMS/Get DC Disconnect Timer Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetDCDisconnectTimer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 85; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetMemoryStatus + +DESCRIPTION: + The function sends 'WMS/Get Memory Status Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetMemoryStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 86; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetPrimaryClient + +DESCRIPTION: + The function sends 'WMS/Get Primary Client Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetPrimaryClient( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 87; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetSubscriptionBinding + +DESCRIPTION: + The function sends 'WMS/Get Subscription Binding Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetSubscriptionBinding( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 88; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSAsyncRawSend + +DESCRIPTION: + The function sends 'WMS/Async Raw Send Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSAsyncRawSend( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 89; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSAsyncSendACK + +DESCRIPTION: + The function sends 'WMS/Async Send ACK Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSAsyncSendACK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 90; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSAsyncSendFromMemoryStore + +DESCRIPTION: + The function sends 'WMS/Async Send From Memory Store Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSAsyncSendFromMemoryStore( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 91; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + WMSGetServiceReadyStatus + +DESCRIPTION: + The function sends 'WMS/Get Service Ready Status Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WMSGetServiceReadyStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 5; + ULONG msgID = 92; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSReset + +DESCRIPTION: + The function sends 'PDS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetEventReport + +DESCRIPTION: + The function sends 'PDS/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetServiceState + +DESCRIPTION: + The function sends 'PDS/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetServiceState + +DESCRIPTION: + The function sends 'PDS/Set Service State Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSStartTrackingSession + +DESCRIPTION: + The function sends 'PDS/Start Tracking Session Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSStartTrackingSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetTrackingSessionInfo + +DESCRIPTION: + The function sends 'PDS/Get Tracking Session Info Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetTrackingSessionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSFixPosition + +DESCRIPTION: + The function sends 'PDS/Fix Position Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSFixPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSEndTrackingSession + +DESCRIPTION: + The function sends 'PDS/End Tracking Session Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSEndTrackingSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetNMEAConfig + +DESCRIPTION: + The function sends 'PDS/Get NMEA Config Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetNMEAConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetNMEAConfig + +DESCRIPTION: + The function sends 'PDS/Set NMEA Config Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetNMEAConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectTimeReference + +DESCRIPTION: + The function sends 'PDS/Inject Time Reference Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeReference( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetDefaults + +DESCRIPTION: + The function sends 'PDS/Get Defaults Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetDefaults + +DESCRIPTION: + The function sends 'PDS/Set Defaults Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetDefaults( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetXTRAParameters + +DESCRIPTION: + The function sends 'PDS/Get XTRA Parameters Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetXTRAParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetXTRAParameters + +DESCRIPTION: + The function sends 'PDS/Set XTRA Parameters Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetXTRAParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSForceXTRADownload + +DESCRIPTION: + The function sends 'PDS/Force XTRA Download Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSForceXTRADownload( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetAGPSConfig + +DESCRIPTION: + The function sends 'PDS/Get AGPS Config Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetAGPSConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetAGPSConfig + +DESCRIPTION: + The function sends 'PDS/Set AGPS Config Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetAGPSConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetServiceAutoTrackingState + +DESCRIPTION: + The function sends 'PDS/Get Service Auto-Tracking State Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceAutoTrackingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetServiceAutoTrackingState + +DESCRIPTION: + The function sends 'PDS/Set Service Auto-Tracking State Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetServiceAutoTrackingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetCOMPortAutoTrackingConfig + +DESCRIPTION: + The function sends 'PDS/Get COM Port Auto-Tracking Config Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetCOMPortAutoTrackingConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 50; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetCOMPortAutoTrackingConfig + +DESCRIPTION: + The function sends 'PDS/Set COM Port Auto-Tracking Config Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetCOMPortAutoTrackingConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSResetPDSData + +DESCRIPTION: + The function sends 'PDS/Reset PDS Data Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSResetPDSData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSinglePositionFix + +DESCRIPTION: + The function sends 'PDS/Single Position Fix Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSinglePositionFix( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetServiceVersion + +DESCRIPTION: + The function sends 'PDS/Get Service Version Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetServiceVersion( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectXTRAData + +DESCRIPTION: + The function sends 'PDS/Inject XTRA Data Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectXTRAData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectPositionData + +DESCRIPTION: + The function sends 'PDS/Inject Position Data Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectPositionData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectWiFiPositionData + +DESCRIPTION: + The function sends 'PDS/Inject Wi-Fi Position Data Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectWiFiPositionData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetSBASConfig + +DESCRIPTION: + The function sends 'PDS/Get SBAS Config Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSBASConfig + +DESCRIPTION: + The function sends 'PDS/Set SBAS Config Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSendNetworkInitiatedResponse + +DESCRIPTION: + The function sends 'PDS/Send Network Initiated Response Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSendNetworkInitiatedResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectAbsoluteTime + +DESCRIPTION: + The function sends 'PDS/Inject Absolute Time Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectAbsoluteTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectEFSData + +DESCRIPTION: + The function sends 'PDS/Inject EFS Data Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectEFSData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 62; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetDPOConfig + +DESCRIPTION: + The function sends 'PDS/Get DPO Config Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetDPOConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetDPOConfig + +DESCRIPTION: + The function sends 'PDS/Set DPO Config Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetDPOConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetODPConfig + +DESCRIPTION: + The function sends 'PDS/Get ODP Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetODPConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetODPConfig + +DESCRIPTION: + The function sends 'PDS/Set ODP Config Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetODPConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSCancelSinglePositionFix + +DESCRIPTION: + The function sends 'PDS/Cancel Single Position Fix Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSCancelSinglePositionFix( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetGPSState + +DESCRIPTION: + The function sends 'PDS/Get GPS State Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetGPSState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetPPMEventReport + +DESCRIPTION: + The function sends 'PDS/Set PPM Event Report Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPPMEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSPIStreamingReport + +DESCRIPTION: + The function sends 'PDS/Set SPI Streaming Report Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSPIStreamingReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 70; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSPIStatus + +DESCRIPTION: + The function sends 'PDS/Set SPI Status Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSPIStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 71; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetPPMReportingState + +DESCRIPTION: + The function sends 'PDS/Set PPM Reporting State Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPPMReportingState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 72; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSForceReceiverOff + +DESCRIPTION: + The function sends 'PDS/Force Receiver Off Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSForceReceiverOff( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 73; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetPositionMethodsState + +DESCRIPTION: + The function sends 'PDS/Get Position Methods State Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetPositionMethodsState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 80; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetPositionMethodsState + +DESCRIPTION: + The function sends 'PDS/Set Position Methods State Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetPositionMethodsState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 81; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectSensorData + +DESCRIPTION: + The function sends 'PDS/Inject Sensor Data Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectSensorData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 82; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectTimeSyncData + +DESCRIPTION: + The function sends 'PDS/Inject Time Sync Data Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeSyncData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 83; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetSensorConfig + +DESCRIPTION: + The function sends 'PDS/Get Sensor Config Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSensorConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 84; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSensorConfig + +DESCRIPTION: + The function sends 'PDS/Set Sensor Config Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSensorConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 85; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetSensorNavigation + +DESCRIPTION: + The function sends 'PDS/Get Sensor Navigation Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSensorNavigation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 86; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetNavigationConfig + +DESCRIPTION: + The function sends 'PDS/Set Navigation Config Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetNavigationConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 87; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetWLANBlanking + +DESCRIPTION: + The function sends 'PDS/Set WLAN Blanking Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetWLANBlanking( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 90; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSecurityChallengeReport + +DESCRIPTION: + The function sends 'PDS/Set Security Challenge Report Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityChallengeReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 91; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSecurityChallenge + +DESCRIPTION: + The function sends 'PDS/Set Security Challenge Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityChallenge( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 92; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSGetSecurityEncryptionConfig + +DESCRIPTION: + The function sends 'PDS/Get Security Encryption Config Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSGetSecurityEncryptionConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 93; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetSecurityUpdateRate + +DESCRIPTION: + The function sends 'PDS/Set Security Update Rate Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetSecurityUpdateRate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 94; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetCellDatabaseControl + +DESCRIPTION: + The function sends 'PDS/Set Cell Database Control Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetCellDatabaseControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 95; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectMotionData + +DESCRIPTION: + The function sends 'PDS/Inject Motion Data Request' (0x0061) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectMotionData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 97; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetGNSSEngineErrorRecoveryReport + +DESCRIPTION: + The function sends 'PDS/Set GNSS Engine Error Recovery Report Request' (0x0062) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetGNSSEngineErrorRecoveryReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 98; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSResetLocationService + +DESCRIPTION: + The function sends 'PDS/Reset Location Service Request' (0x0063) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSResetLocationService( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 99; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSInjectTestData + +DESCRIPTION: + The function sends 'PDS/Inject Test Data Request' (0x0064) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTestData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 100; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PDSSetGNSSRFConfig + +DESCRIPTION: + The function sends 'PDS/Set GNSS RF Config Request' (0x0065) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSSetGNSSRFConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 6; + ULONG msgID = 101; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + AUTHStartEAPSession + +DESCRIPTION: + The function sends 'AUTH/Start EAP Session Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHStartEAPSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 7; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + AUTHSendEAPPacket + +DESCRIPTION: + The function sends 'AUTH/Send EAP Packet Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHSendEAPPacket( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 7; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + AUTHGetEAPSessionKeys + +DESCRIPTION: + The function sends 'AUTH/Get EAP Session Keys Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHGetEAPSessionKeys( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 7; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + AUTHEndEAPSession + +DESCRIPTION: + The function sends 'AUTH/End EAP Session Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHEndEAPSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 7; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + AUTHRunAKA + +DESCRIPTION: + The function sends 'AUTH/Run AKA Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AUTHRunAKA( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 7; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceIndicationRegistration + +DESCRIPTION: + The function sends 'Voice/Indication Registration Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceIndicationRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 3; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceCallOriginate + +DESCRIPTION: + The function sends 'Voice/Call Originate Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallOriginate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceCallEnd + +DESCRIPTION: + The function sends 'Voice/Call End Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallEnd( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceCallAnswer + +DESCRIPTION: + The function sends 'Voice/Call Answer Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCallAnswer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCallInfo + +DESCRIPTION: + The function sends 'Voice/Get Call Info Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceSendFlash + +DESCRIPTION: + The function sends 'Voice/Send Flash Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSendFlash( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceBurstDTMF + +DESCRIPTION: + The function sends 'Voice/Burst DTMF Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceBurstDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceStartContinuousDTMF + +DESCRIPTION: + The function sends 'Voice/Start Continuous DTMF Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceStartContinuousDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceStopContinuousDTMF + +DESCRIPTION: + The function sends 'Voice/Stop Continuous DTMF Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceStopContinuousDTMF( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceSetPreferredPrivacy + +DESCRIPTION: + The function sends 'Voice/Set Preferred Privacy Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetPreferredPrivacy( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetAllCallInfo + +DESCRIPTION: + The function sends 'Voice/Get All Call Info Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetAllCallInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceManageCalls + +DESCRIPTION: + The function sends 'Voice/Manage Calls Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceManageCalls( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceSetSupplementaryService + +DESCRIPTION: + The function sends 'Voice/Set Supplementary Service Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetSupplementaryService( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCallWaiting + +DESCRIPTION: + The function sends 'Voice/Get Call Waiting Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallWaiting( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCallBarring + +DESCRIPTION: + The function sends 'Voice/Get Call Barring Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallBarring( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCLIP + +DESCRIPTION: + The function sends 'Voice/Get CLIP Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCLIP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCLIR + +DESCRIPTION: + The function sends 'Voice/Get CLIR Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCLIR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCallForwarding + +DESCRIPTION: + The function sends 'Voice/Get Call Forwarding Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCallForwarding( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceSetCallBarringPassword + +DESCRIPTION: + The function sends 'Voice/Set Call Barring Password Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetCallBarringPassword( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceInitiateUSSD + +DESCRIPTION: + The function sends 'Voice/Initiate USSD Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceInitiateUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceAnswerUSSD + +DESCRIPTION: + The function sends 'Voice/Answer USSD Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAnswerUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceCancelUSSD + +DESCRIPTION: + The function sends 'Voice/Cancel USSD Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceCancelUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceSetConfig + +DESCRIPTION: + The function sends 'Voice/Set Config Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceSetConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetConfig + +DESCRIPTION: + The function sends 'Voice/Get Config Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceAsyncInitiateUSSD + +DESCRIPTION: + The function sends 'Voice/Async Initiate USSD Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAsyncInitiateUSSD( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceBindSubscription + +DESCRIPTION: + The function sends 'Voice/Bind Subscription Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceALSSetLineSwitching + +DESCRIPTION: + The function sends 'Voice/ALS Set Line Switching Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceALSSetLineSwitching( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceALSSelectLine + +DESCRIPTION: + The function sends 'Voice/ALS Select Line Request' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceALSSelectLine( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 70; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceAOCResetACM + +DESCRIPTION: + The function sends 'Voice/AOC Reset ACM Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCResetACM( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 71; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceAOCSetACMMaximum + +DESCRIPTION: + The function sends 'Voice/AOC Set ACM Maximum Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCSetACMMaximum( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 72; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceAOCGetCallMeterInfo + +DESCRIPTION: + The function sends 'Voice/AOC Get Call Meter Info Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceAOCGetCallMeterInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 73; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCOLP + +DESCRIPTION: + The function sends 'Voice/Get COLP Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCOLP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 75; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCOLR + +DESCRIPTION: + The function sends 'Voice/Get COLR Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCOLR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 76; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceGetCNAP + +DESCRIPTION: + The function sends 'Voice/Get CNAP Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceGetCNAP( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 77; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + VoiceManageIPCalls + +DESCRIPTION: + The function sends 'Voice/Manage IP Calls Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG VoiceManageIPCalls( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 9; + ULONG msgID = 78; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2Reset + +DESCRIPTION: + The function sends 'CAT2/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2Reset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SetEventReport + +DESCRIPTION: + The function sends 'CAT2/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2GetServiceState + +DESCRIPTION: + The function sends 'CAT2/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SendTerminalResponse + +DESCRIPTION: + The function sends 'CAT2/Send Terminal Response Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2EnvelopeCommand + +DESCRIPTION: + The function sends 'CAT2/Envelope Command Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2EnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2GetEventReport + +DESCRIPTION: + The function sends 'CAT2/Get Event Report Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SendDecodedTerminalResponse + +DESCRIPTION: + The function sends 'CAT2/Send Decoded Terminal Response Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendDecodedTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SendDecodedEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT2/Send Decoded Envelope Command Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SendDecodedEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2EventConfirmation + +DESCRIPTION: + The function sends 'CAT2/Event Confirmation Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2EventConfirmation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SCWSOpenChannel + +DESCRIPTION: + The function sends 'CAT2/SCWS Open Channel Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSOpenChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SCWSCloseChannel + +DESCRIPTION: + The function sends 'CAT2/SCWS Close Channel Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSCloseChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SCWSSendData + +DESCRIPTION: + The function sends 'CAT2/SCWS Send Data Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSSendData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SCWSDataAvailable + +DESCRIPTION: + The function sends 'CAT2/SCWS Data Available Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSDataAvailable( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SCWSChannelStatus + +DESCRIPTION: + The function sends 'CAT2/SCWS Channel Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SCWSChannelStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2GetTerminalProfile + +DESCRIPTION: + The function sends 'CAT2/Get Terminal Profile Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetTerminalProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2SetConfiguration + +DESCRIPTION: + The function sends 'CAT2/Set Configuration Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2SetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CAT2GetConfiguration + +DESCRIPTION: + The function sends 'CAT2/Get Configuration Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CAT2GetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 10; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMReset + +DESCRIPTION: + The function sends 'UIM/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMReadTransparent + +DESCRIPTION: + The function sends 'UIM/Read Transparent Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReadTransparent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMReadRecord + +DESCRIPTION: + The function sends 'UIM/Read Record Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMReadRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMWriteTransparent + +DESCRIPTION: + The function sends 'UIM/Write Transparent Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMWriteTransparent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMWriteRecord + +DESCRIPTION: + The function sends 'UIM/Write Record Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMWriteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetFileAttributes + +DESCRIPTION: + The function sends 'UIM/Get File Attributes Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetFileAttributes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSetPINProtection + +DESCRIPTION: + The function sends 'UIM/Set PIN Protection Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetPINProtection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMVerifyPIN + +DESCRIPTION: + The function sends 'UIM/Verify PIN Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMVerifyPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMUnblockPIN + +DESCRIPTION: + The function sends 'UIM/Unblock PIN Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockPIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMChangePIN + +DESCRIPTION: + The function sends 'UIM/Change PIN Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangePIN( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMDepersonalization + +DESCRIPTION: + The function sends 'UIM/Depersonalization Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMDepersonalization( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMRefreshRegister + +DESCRIPTION: + The function sends 'UIM/Refresh Register Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshRegister( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMRefreshOK + +DESCRIPTION: + The function sends 'UIM/Refresh OK Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshOK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMRefreshComplete + +DESCRIPTION: + The function sends 'UIM/Refresh Complete Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMRefreshComplete( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetLastRefreshEvent + +DESCRIPTION: + The function sends 'UIM/Get Last Refresh Event Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetLastRefreshEvent( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMEventRegistration + +DESCRIPTION: + The function sends 'UIM/Event Registration Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMEventRegistration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetCardStatus + +DESCRIPTION: + The function sends 'UIM/Get Card Status Request' (0x002F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetCardStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 47; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMPowerDown + +DESCRIPTION: + The function sends 'UIM/Power Down Request' (0x0030) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMPowerDown( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 48; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMPowerUp + +DESCRIPTION: + The function sends 'UIM/Power Up Request' (0x0031) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMPowerUp( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 49; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMAuthenticate + +DESCRIPTION: + The function sends 'UIM/Authenticate Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMAuthenticate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMCloseSession + +DESCRIPTION: + The function sends 'UIM/Close Session Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMCloseSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetServiceStatus + +DESCRIPTION: + The function sends 'UIM/Get Service Status Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSetServiceStatus + +DESCRIPTION: + The function sends 'UIM/Set Service Status Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetServiceStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMChangeProvisioningSession + +DESCRIPTION: + The function sends 'UIM/Change Provisioning Session Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangeProvisioningSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetLabel + +DESCRIPTION: + The function sends 'UIM/Get Label Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetLabel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetConfiguration + +DESCRIPTION: + The function sends 'UIM/Get Configuration Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSendADPU + +DESCRIPTION: + The function sends 'UIM/Send ADPU Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSendADPU( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSAPConnection + +DESCRIPTION: + The function sends 'UIM/SAP Connection Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSAPConnection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSAPRequest + +DESCRIPTION: + The function sends 'UIM/SAP Request Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSAPRequest( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMLogicalChannel + +DESCRIPTION: + The function sends 'UIM/Logical Channel Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMLogicalChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMSubscriptionOK + +DESCRIPTION: + The function sends 'UIM/Subscription OK Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSubscriptionOK( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMGetATR + +DESCRIPTION: + The function sends 'UIM/Get ATR Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetATR( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + UIMOpenLogicalChannel + +DESCRIPTION: + The function sends 'UIM/Open Logical Channel Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMOpenLogicalChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 11; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMSetIndicationRegistrationState + +DESCRIPTION: + The function sends 'PBM/Set Indication Registration State Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetIndicationRegistrationState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetCapabilities + +DESCRIPTION: + The function sends 'PBM/Get Capabilities Request' (0x0002) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 2; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetAllCapabilities + +DESCRIPTION: + The function sends 'PBM/Get All Capabilities Request' (0x0003) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAllCapabilities( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 3; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMReadRecords + +DESCRIPTION: + The function sends 'PBM/Read Records Request' (0x0004) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMReadRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 4; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMWriteRecord + +DESCRIPTION: + The function sends 'PBM/Write Record Request' (0x0005) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMWriteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 5; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMDeleteRecord + +DESCRIPTION: + The function sends 'PBM/Delete Record Request' (0x0006) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMDeleteRecord( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 6; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMDeleteAllRecords + +DESCRIPTION: + The function sends 'PBM/Delete All Records Request' (0x0007) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMDeleteAllRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 7; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMSearchRecords + +DESCRIPTION: + The function sends 'PBM/Search Records Request' (0x0008) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSearchRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 8; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetEmergencyList + +DESCRIPTION: + The function sends 'PBM/Get Emergency List Request' (0x000E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetEmergencyList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 14; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetAllGroups + +DESCRIPTION: + The function sends 'PBM/Get All Groups Request' (0x000F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAllGroups( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 15; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMSetGroupInfo + +DESCRIPTION: + The function sends 'PBM/Set Group Info Request' (0x0010) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetGroupInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 16; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetState + +DESCRIPTION: + The function sends 'PBM/Get State Request' (0x0011) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 17; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMReadAllHiddenRecords + +DESCRIPTION: + The function sends 'PBM/Read All Hidden Records Request' (0x0012) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMReadAllHiddenRecords( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 18; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetNextEmptyRecordID + +DESCRIPTION: + The function sends 'PBM/Get Next Empty Record ID Request' (0x0014) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetNextEmptyRecordID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 20; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetNextRecordID + +DESCRIPTION: + The function sends 'PBM/Get Next Record ID Request' (0x0015) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetNextRecordID( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 21; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetAASList + +DESCRIPTION: + The function sends 'PBM/Get AAS List Request' (0x0016) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetAASList( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 22; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMSetAAS + +DESCRIPTION: + The function sends 'PBM/Set AAS Request' (0x0017) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMSetAAS( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 23; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMBindSubscription + +DESCRIPTION: + The function sends 'PBM/Bind Subscription Request' (0x001A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMBindSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 26; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + PBMGetSubscription + +DESCRIPTION: + The function sends 'PBM/Get Subscription Request' (0x001B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PBMGetSubscription( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 12; + ULONG msgID = 27; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCClientRevision + +DESCRIPTION: + The function sends 'LOC/Client Revision Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCClientRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCRegisterEvents + +DESCRIPTION: + The function sends 'LOC/Register Events Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCRegisterEvents( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCStart + +DESCRIPTION: + The function sends 'LOC/Start Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCStart( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCStop + +DESCRIPTION: + The function sends 'LOC/Stop Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCStop( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetServiceRevision + +DESCRIPTION: + The function sends 'LOC/Get Service Revision Request' (0x0032) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetServiceRevision( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 50; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetFixCriteria + +DESCRIPTION: + The function sends 'LOC/Get Fix Criteria Request' (0x0033) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetFixCriteria( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 51; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCProvideNIUserResponse + +DESCRIPTION: + The function sends 'LOC/Provide NI User Response Request' (0x0034) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideNIUserResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 52; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectPredictedOrbitsData + +DESCRIPTION: + The function sends 'LOC/Inject Predicted Orbits Data Request' (0x0035) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectPredictedOrbitsData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 53; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetPredictedOrbitsDataSource + +DESCRIPTION: + The function sends 'LOC/Get Predicted Orbits Data Source Request' (0x0036) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetPredictedOrbitsDataSource( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 54; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetPredictedOrbitsDataValidity + +DESCRIPTION: + The function sends 'LOC/Get Predicted Orbits Data Validity Request' (0x0037) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetPredictedOrbitsDataValidity( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 55; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectUTCTime + +DESCRIPTION: + The function sends 'LOC/Inject UTC Time Request' (0x0038) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectUTCTime( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 56; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectPosition + +DESCRIPTION: + The function sends 'LOC/Inject Position Request' (0x0039) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 57; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetEngineLock + +DESCRIPTION: + The function sends 'LOC/Set Engine Lock Request' (0x003A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetEngineLock( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 58; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetEngineLock + +DESCRIPTION: + The function sends 'LOC/Get Engine Lock Request' (0x003B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetEngineLock( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 59; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetSBASConfig + +DESCRIPTION: + The function sends 'LOC/Set SBAS Config Request' (0x003C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 60; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetSBASConfig + +DESCRIPTION: + The function sends 'LOC/Get SBAS Config Request' (0x003D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSBASConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 61; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetNMEATypes + +DESCRIPTION: + The function sends 'LOC/Set NMEA Types Request' (0x003E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetNMEATypes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 62; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetNMEATypes + +DESCRIPTION: + The function sends 'LOC/Get NMEA Types Request' (0x003F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetNMEATypes( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 63; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetLowPowerMode + +DESCRIPTION: + The function sends 'LOC/Set Low Power Mode Request' (0x0040) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetLowPowerMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 64; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetLowPowerMode + +DESCRIPTION: + The function sends 'LOC/Get Low Power Mode Request' (0x0041) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetLowPowerMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 65; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetLocationServer + +DESCRIPTION: + The function sends 'LOC/Set Location Server Request' (0x0042) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetLocationServer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 66; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetLocationServer + +DESCRIPTION: + The function sends 'LOC/Get Location Server Request' (0x0043) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetLocationServer( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 67; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCDeleteAssistData + +DESCRIPTION: + The function sends 'LOC/Delete Assist Data Request' (0x0044) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCDeleteAssistData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 68; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetXTRATSessionControl + +DESCRIPTION: + The function sends 'LOC/Set XTRA-T Session Control Request' (0x0045) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetXTRATSessionControl( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 69; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOC + +DESCRIPTION: + The function sends 'LOC' (0x0046) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOC( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 70; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectWiFiPosition + +DESCRIPTION: + The function sends 'LOC/Inject Wi-Fi Position Request' (0x0047) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectWiFiPosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 71; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCProvideWiFiStatus + +DESCRIPTION: + The function sends 'LOC/Provide Wi-Fi Status Request' (0x0048) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideWiFiStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 72; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetRegisteredEvents + +DESCRIPTION: + The function sends 'LOC/Get Registered Events Request' (0x0049) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetRegisteredEvents( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 73; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetOperationMode + +DESCRIPTION: + The function sends 'LOC/Set Operation Mode Request' (0x004A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetOperationMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 74; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetOperationMode + +DESCRIPTION: + The function sends 'LOC/Get Operation Mode Request' (0x004B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetOperationMode( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 75; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetSPIStatus + +DESCRIPTION: + The function sends 'LOC/Set SPI Status Request' (0x004C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSPIStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 76; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectSensorData + +DESCRIPTION: + The function sends 'LOC/Inject Sensor Data Request' (0x004D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectSensorData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 77; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectTimeSyncData + +DESCRIPTION: + The function sends 'LOC/Inject Time Sync Data Request' (0x004E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectTimeSyncData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 78; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetCradleMountConfig + +DESCRIPTION: + The function sends 'LOC/Set Cradle Mount Config Request' (0x004F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetCradleMountConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 79; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetCradleMountConfig + +DESCRIPTION: + The function sends 'LOC/Get Cradle Mount Config Request' (0x0050) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetCradleMountConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 80; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetExternalPowerConfig + +DESCRIPTION: + The function sends 'LOC/Set External Power Config Request' (0x0051) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetExternalPowerConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 81; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetExternalPowerConfig + +DESCRIPTION: + The function sends 'LOC/Get External Power Config Request' (0x0052) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetExternalPowerConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 82; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCProvideConnectionStatus + +DESCRIPTION: + The function sends 'LOC/Provide Connection Status Request' (0x0053) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCProvideConnectionStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 83; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetProtocolConfigParameters + +DESCRIPTION: + The function sends 'LOC/Set Protocol Config Parameters Request' (0x0054) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetProtocolConfigParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 84; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetProtocolConfigParameters + +DESCRIPTION: + The function sends 'LOC/Get Protocol Config Parameters Request' (0x0055) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetProtocolConfigParameters( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 85; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetSensorControlConfig + +DESCRIPTION: + The function sends 'LOC/Set Sensor Control Config Request' (0x0056) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorControlConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 86; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetSensorControlConfig + +DESCRIPTION: + The function sends 'LOC/Get Sensor Control Config Request' (0x0057) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorControlConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 87; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetSensorProperties + +DESCRIPTION: + The function sends 'LOC/Set Sensor Properties Request' (0x0058) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorProperties( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 88; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetSensorProperties + +DESCRIPTION: + The function sends 'LOC/Get Sensor Properties Request' (0x0059) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorProperties( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 89; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetSensorPerformanceConfig + +DESCRIPTION: + The function sends 'LOC/Set Sensor Performance Config Request' (0x005A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetSensorPerformanceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 90; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetSensorPerformanceConfig + +DESCRIPTION: + The function sends 'LOC/Get Sensor Performance Config Request' (0x005B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetSensorPerformanceConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 91; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCInjectSUPLCertificate + +DESCRIPTION: + The function sends 'LOC/Inject SUPL Certificate Request' (0x005C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCInjectSUPLCertificate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 92; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCDeleteSUPLCertificate + +DESCRIPTION: + The function sends 'LOC/Delete SUPL Certificate Request' (0x005D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCDeleteSUPLCertificate( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 93; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCSetPositionEngineConfig + +DESCRIPTION: + The function sends 'LOC/Set Position Engine Config Request' (0x005E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCSetPositionEngineConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 94; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetPositionEngineConfig + +DESCRIPTION: + The function sends 'LOC/Get Position Engine Config Request' (0x005F) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetPositionEngineConfig( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 95; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCAddCircularGeofence + +DESCRIPTION: + The function sends 'LOC/Add Circular Geofence Request' (0x0063) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCAddCircularGeofence( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 99; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCDeleteGeofence + +DESCRIPTION: + The function sends 'LOC/Delete Geofence Request' (0x0064) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCDeleteGeofence( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 100; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCQueryGeofence + +DESCRIPTION: + The function sends 'LOC/Query Geofence Request' (0x0065) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCQueryGeofence( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 101; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCEditGeofence + +DESCRIPTION: + The function sends 'LOC/Edit Geofence Request' (0x0066) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCEditGeofence( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 102; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + LOCGetBestAvailablePosition + +DESCRIPTION: + The function sends 'LOC/Get Best Available Position Request' (0x0067) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG LOCGetBestAvailablePosition( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 18; + ULONG msgID = 103; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATReset + +DESCRIPTION: + The function sends 'CAT/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSetEventReport + +DESCRIPTION: + The function sends 'CAT/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATGetServiceState + +DESCRIPTION: + The function sends 'CAT/Get Service State Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetServiceState( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSendTerminalResponse + +DESCRIPTION: + The function sends 'CAT/Send Terminal Response Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT/Envelope Command Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATGetEventReport + +DESCRIPTION: + The function sends 'CAT/Get Event Report Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSendDecodedTerminalResponse + +DESCRIPTION: + The function sends 'CAT/Send Decoded Terminal Response Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendDecodedTerminalResponse( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSendDecodedEnvelopeCommand + +DESCRIPTION: + The function sends 'CAT/Send Decoded Envelope Command Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendDecodedEnvelopeCommand( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATEventConfirmation + +DESCRIPTION: + The function sends 'CAT/Event Confirmation Request' (0x0026) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATEventConfirmation( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 38; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSCWSOpenChannel + +DESCRIPTION: + The function sends 'CAT/SCWS Open Channel Request' (0x0027) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSOpenChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 39; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSCWSCloseChannel + +DESCRIPTION: + The function sends 'CAT/SCWS Close Channel Request' (0x0028) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSCloseChannel( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 40; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSCWSSendData + +DESCRIPTION: + The function sends 'CAT/SCWS Send Data Request' (0x0029) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSSendData( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 41; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSCWSDataAvailable + +DESCRIPTION: + The function sends 'CAT/SCWS Data Available Request' (0x002A) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSDataAvailable( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 42; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSCWSChannelStatus + +DESCRIPTION: + The function sends 'CAT/SCWS Channel Status Request' (0x002B) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSCWSChannelStatus( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 43; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATGetTerminalProfile + +DESCRIPTION: + The function sends 'CAT/Get Terminal Profile Request' (0x002C) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetTerminalProfile( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 44; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATSetConfiguration + +DESCRIPTION: + The function sends 'CAT/Set Configuration Request' (0x002D) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 45; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + CATGetConfiguration + +DESCRIPTION: + The function sends 'CAT/Get Configuration Request' (0x002E) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATGetConfiguration( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 224; + ULONG msgID = 46; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + RMSReset + +DESCRIPTION: + The function sends 'RMS/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 225; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + RMSGetSMSWake + +DESCRIPTION: + The function sends 'RMS/Get SMS Wake Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSGetSMSWake( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 225; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + RMSSetSMSWake + +DESCRIPTION: + The function sends 'RMS/Set SMS Wake Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG RMSSetSMSWake( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 225; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMAReset + +DESCRIPTION: + The function sends 'OMA/Reset Request' (0x0000) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAReset( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 0; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMASetEventReport + +DESCRIPTION: + The function sends 'OMA/Set Event Report Request' (0x0001) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASetEventReport( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 1; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMAStartSession + +DESCRIPTION: + The function sends 'OMA/Start Session Request' (0x0020) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAStartSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 32; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMACancelSession + +DESCRIPTION: + The function sends 'OMA/Cancel Session Request' (0x0021) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMACancelSession( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 33; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMAGetSessionInfo + +DESCRIPTION: + The function sends 'OMA/Get Session Info Request' (0x0022) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAGetSessionInfo( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 34; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMASendSelection + +DESCRIPTION: + The function sends 'OMA/Send Selection Request' (0x0023) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASendSelection( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 35; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMAGetFeatures + +DESCRIPTION: + The function sends 'OMA/Get Features Request' (0x0024) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Reserved for future use (set to 0) + pIn [ I ] - Reserved for future use (set to 0) + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMAGetFeatures( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 36; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + +/*=========================================================================== +METHOD: + OMASetFeatures + +DESCRIPTION: + The function sends 'OMA/Set Features Request' (0x0025) + and returns the response + +PARAMETERS: + handle [ I ] - Gobi interface handle + to [ I ] - Timeout for transaction (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMASetFeatures( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + cGobiConnectionMgmt * pAPI = gDLL.GetAPI( handle ); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG svcID = 226; + ULONG msgID = 37; + return pAPI->Send( svcID, msgID, to, inLen, pIn, pOutLen, pOut ); +} + diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMCallback.cpp b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMCallback.cpp new file mode 100755 index 0000000..a2173f7 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMCallback.cpp @@ -0,0 +1,309 @@ +/*=========================================================================== +FILE: + GobiCMCallback.cpp + +DESCRIPTION: + Contains the implementation of each Gobi CM callback function. + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "SampleCM.h" +#include "GobiCMCallback.h" +#include + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + WDSEventReportCallback (Free Method) + +DESCRIPTION: + Function called by WDS event report callback + +PARAMETERS: + svcID [ I ] - QMI service ID + msgID [ I ] - QMI message ID + handle [ I ] - Handle to Gobi API connection + outLen [ I ] - Length of indication buffer + pOut [ I ] - Indication buffer + +RETURN VALUE: + None +===========================================================================*/ +void WDSEventReportCallback( + ULONG svcID, + ULONG msgID, + GOBIHANDLE /* handle */, + ULONG outLen, + const BYTE * pOut ) +{ + if (gpCM == 0 || svcID != 1 || msgID != 1) + { + return; + } + + std::map tlvs = GetTLVs( &pOut[0], outLen ); + std::map ::const_iterator pIter = tlvs.find( 0x17 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pTmp = pIter->second; + if (pTmp->mLength >= sizeof (sWDSEventReportIndication_DataBearerTechnology)) + { + pTmp++; + const sWDSEventReportIndication_DataBearerTechnology * pDBT = + (const sWDSEventReportIndication_DataBearerTechnology *)pTmp; + + gpCM->OnDataBearerCBNotification( pDBT->mDataBearerTechnology ); + } + } + + ULONGLONG txTotalBytes = ULLONG_MAX; + ULONGLONG rxTotalBytes = ULLONG_MAX; + + pIter = tlvs.find( 0x19 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pTmp = pIter->second; + if (pTmp->mLength >= sizeof (sWDSEventReportIndication_TXBytes)) + { + pTmp++; + const sWDSEventReportIndication_TXBytes * pTX = + (const sWDSEventReportIndication_TXBytes *)pTmp; + + txTotalBytes = pTX->mTXByteTotal; + } + } + + pIter = tlvs.find( 0x1A ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pTmp = pIter->second; + if (pTmp->mLength >= sizeof (sWDSEventReportIndication_RXBytes)) + { + pTmp++; + const sWDSEventReportIndication_RXBytes * pRX = + (const sWDSEventReportIndication_RXBytes *)pTmp; + + rxTotalBytes = pRX->mRXByteTotal; + } + } + + if (txTotalBytes != ULLONG_MAX || rxTotalBytes != ULLONG_MAX) + { + gpCM->OnByteTotalsNotification( rxTotalBytes, txTotalBytes ); + } +} + +/*=========================================================================== +METHOD: + WDSSessionStateCallback (Free Method) + +DESCRIPTION: + Function called by WDS packet service status callback + +PARAMETERS: + svcID [ I ] - QMI service ID + msgID [ I ] - QMI message ID + handle [ I ] - Handle to Gobi API connection + outLen [ I ] - Length of indication buffer + pOut [ I ] - Indication buffer + +RETURN VALUE: + None +===========================================================================*/ +void WDSSessionStateCallback( + ULONG svcID, + ULONG msgID, + GOBIHANDLE /* handle */, + ULONG outLen, + const BYTE * pOut ) +{ + if (gpCM == 0 || svcID != 1 || msgID != 34) + { + return; + } + + ULONG state = ULONG_MAX; + + std::map tlvs = GetTLVs( &pOut[0], outLen ); + std::map ::const_iterator pIter = tlvs.find( 0x01 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pTmp = pIter->second; + if (pTmp->mLength >= sizeof (sWDSPacketServiceStatusReportIndication_Status)) + { + pTmp++; + const sWDSPacketServiceStatusReportIndication_Status * pState = + (const sWDSPacketServiceStatusReportIndication_Status *)pTmp; + + state = pState->mConnectionStatus; + } + } + + if (state != ULONG_MAX) + { + gpCM->OnSessionStateCBNotification( state ); + } +} + +/*=========================================================================== +METHOD: + NASEventReportCallback (Free Method) + +DESCRIPTION: + Function called by NAS event report callback + +PARAMETERS: + svcID [ I ] - QMI service ID + msgID [ I ] - QMI message ID + handle [ I ] - Handle to Gobi API connection + outLen [ I ] - Length of indication buffer + pOut [ I ] - Indication buffer + +RETURN VALUE: + None +===========================================================================*/ +void NASEventReportCallback( + ULONG svcID, + ULONG msgID, + GOBIHANDLE /* handle */, + ULONG outLen, + const BYTE * pOut ) +{ + if (gpCM == 0 || svcID != 3 || msgID != 2) + { + return; + } + + std::map tlvs = GetTLVs( &pOut[0], outLen ); + std::map ::const_iterator pIter = tlvs.find( 0x10 ); + if (pIter == tlvs.end()) + { + return; + } + + const sQMIRawContentHeader * pTmp = pIter->second; + if (pTmp->mLength >= sizeof (sNASEventReportIndication_SignalStrength)) + { + pTmp++; + const sNASEventReportIndication_SignalStrength * pSS = + (const sNASEventReportIndication_SignalStrength *)pTmp; + + gpCM->OnSignalStrengthCBNotificaion( pSS->mSignalStrengthdBm, + pSS->mRadioInterface ); + } +} + +/*=========================================================================== +METHOD: + NASServingSystemCallback (Free Method) + +DESCRIPTION: + Function called by NAS serving system callback + +PARAMETERS: + svcID [ I ] - QMI service ID + msgID [ I ] - QMI message ID + handle [ I ] - Handle to Gobi API connection + outLen [ I ] - Length of indication buffer + pOut [ I ] - Indication buffer + +RETURN VALUE: + None +===========================================================================*/ +void NASServingSystemCallback( + ULONG svcID, + ULONG msgID, + GOBIHANDLE /* handle */, + ULONG outLen, + const BYTE * pOut ) +{ + if (gpCM == 0 || svcID != 3 || msgID != 36) + { + return; + } + + std::map tlvs = GetTLVs( &pOut[0], outLen ); + std::map ::const_iterator pIter = tlvs.find( 0x10 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pTmp = pIter->second; + if (pTmp->mLength >= sizeof (sNASServingSystemIndication_RoamingIndicator)) + { + pTmp++; + const sNASServingSystemIndication_RoamingIndicator * pRI = + (const sNASServingSystemIndication_RoamingIndicator *)pTmp; + + BYTE roam = pRI->mRoamingIndicator; + if (roam == 0xFF) + { + gpCM->SetRoam( "Unknown" ); + } + else + { + std::ostringstream roamStr; + roamStr << roam; + gpCM->SetRoam( roamStr.str() ); + } + } + } + + pIter = tlvs.find( 0x11 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pTmp = pIter->second; + ULONG tlvLen = (ULONG)pTmp->mLength; + ULONG dsLen = (ULONG)sizeof( sNASServingSystemIndication_DataServices ); + if (tlvLen < dsLen) + { + return; + } + + pTmp++; + const sNASServingSystemIndication_DataServices * pDS = + (const sNASServingSystemIndication_DataServices *)pTmp; + + ULONG dcCount = (ULONG)pDS->mNumberOfDataCapabilities; + ULONG dcSz = (ULONG)sizeof( eQMINASDataServiceCapabilities2 ); + dsLen += dcCount * dcSz; + if (tlvLen < dsLen) + { + return; + } + + pDS++; + gpCM->OnDataCapsNotification( dcCount, + (eQMINASDataServiceCapabilities2 *)pDS ); + } +} diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMCallback.h b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMCallback.h new file mode 100755 index 0000000..02ecd76 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMCallback.h @@ -0,0 +1,83 @@ +/*=========================================================================== +FILE: + GobiCMCallback.h + +DESCRIPTION: + Contains the declaration of each Gobi CM callback function, + structures needed for these callbacks and message IDs for + each callback + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiCMDLL.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// WDS event report callback +void WDSEventReportCallback( + ULONG svcID, + ULONG msgID, + GOBIHANDLE handle, + ULONG outLen, + const BYTE * pOut ); + +// WDS packet service status callback +void WDSSessionStateCallback( + ULONG svcID, + ULONG msgID, + GOBIHANDLE handle, + ULONG outLen, + const BYTE * pOut ); + +// NAS event report callback +void NASEventReportCallback( + ULONG svcID, + ULONG msgID, + GOBIHANDLE handle, + ULONG outLen, + const BYTE * pOut ); + +// NAS serving system callback +void NASServingSystemCallback( + ULONG svcID, + ULONG msgID, + GOBIHANDLE handle, + ULONG outLen, + const BYTE * pOut ); + diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMDLL.cpp b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMDLL.cpp new file mode 100755 index 0000000..19ab254 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMDLL.cpp @@ -0,0 +1,1239 @@ +/*=========================================================================== +FILE: + GobiCMDLL.cpp + +DESCRIPTION: + Simple class to load and interface to the Gobi CM DLL + +PUBLIC CLASSES AND METHODS: + cGobiCMDLL + This class loads the Gobi CM DLL and then interfaces to it + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiCMDLL.h" +#include "GobiConnectionMgmtAPIStructs.h" +#include "Gobi3000Translation.h" +#include + +/*=========================================================================*/ +// cGobiCMDLL Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetString (Internal Method) + +DESCRIPTION: + Call a Gobi CM API function that returns a string + +PARAMETERS: + mpFnString [ I ] - Gobi CM API function pointer + tlvID [ I ] - ID of response TLV that contains the string + strSz [ I ] - Max string size (including NULL terminator) + pStr [ O ] - Buffer to hold the string + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetString( + tFNGobiInputOutput mpFnString, + BYTE tlvID, + BYTE strSz, + CHAR * pStr ) +{ + // Assume failure + if (strSz > 0 && pStr != 0) + { + pStr[0] = 0; + } + + // Query for string? + ULONG status = eGOBI_ERR_GENERAL; + if (mpFnString == 0 || mhGobi == 0) + { + return status; + } + + ULONG lo = 1024; + BYTE rsp[1024] = { 0 }; + status = mpFnString( mhGobi, 2000, 0, 0, &lo, &rsp[0] ); + if (status != 0) + { + return status; + } + + std::map tlvs = GetTLVs( &rsp[0], lo ); + std::map ::const_iterator pIter = tlvs.find( tlvID ); + if (pIter == tlvs.end()) + { + return eGOBI_ERR_GENERAL; + } + + const sQMIRawContentHeader * pTmp = pIter->second; + ULONG strLen = (ULONG)pTmp->mLength; + pTmp++; + + if (strLen != 0 && strSz > 0 && pStr != 0) + { + ULONG needLen = strLen; + if (needLen + 1 > strSz) + { + needLen = strSz - 1; + } + + memcpy( pStr, pTmp, needLen ); + pStr[needLen] = 0; + } + + return status; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Calls GobiConnect + +PARAMETERS: + pInterface [ I ] - Interace to connect to + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::Connect( LPCSTR pInterface ) +{ + // Connect to WDS, DMS, and NAS services + ULONG svc[3] = { 1, 2, 3 }; + ULONG svcCount = 3; + GOBIHANDLE handle = 0; + ULONG status = GobiConnect( pInterface, &svcCount, &svc[0], &handle ); + if (status == 0) + { + if (svcCount == 3) + { + mhGobi = handle; + } + else + { + // We require WDS, DMS, and NAS services + Disconnect(); + status = eGOBI_ERR_GENERAL; + } + } + + return status; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Calls GobiDisconnect + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::Disconnect() +{ + if (mhGobi == 0) + { + return eGOBI_ERR_GENERAL; + } + + return GobiDisconnect( mhGobi ); +} + +/*=========================================================================== +ETHOD: + StartDataSession (Public Method) + +DESCRIPTION: + Calls WDSStartNetworkInterface + +PARAMETERS: + pAPN [ I ] - Access point name + pUser [ I ] - Username + pPwd [ I ] - Password + pSessionID [ O ] - Session ID + pFailureCode [ O ] - Failure code (if present) + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::StartDataSession( + LPCSTR pAPN, + LPCSTR pUser, + LPCSTR pPwd, + ULONG * pSessionID, + ULONG * pFailureCode ) +{ + // Assume failure + if (pSessionID != 0) + { + *pSessionID = 0xFFFFFFFF; + } + + // Start a data session? + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + UINT8 req[1024] = { 0 }; + UINT8 * pData = (UINT8 *)&req[0]; + + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)pData; + pTLV->mTypeID = 0x16; + pTLV->mLength + = (UINT16)sizeof( sWDSStartNetworkInterfaceRequest_Authentication ); + pData += sizeof( sQMIRawContentHeader ); + + sWDSStartNetworkInterfaceRequest_Authentication * pAuth = + (sWDSStartNetworkInterfaceRequest_Authentication *)pData; + pAuth->mEnablePAP = 1; + pAuth->mEnableCHAP = 1; + pData += sizeof( sWDSStartNetworkInterfaceRequest_Authentication ); + + if (pAPN != 0 && pAPN[0] != 0) + { + size_t len = strnlen( pAPN, 256 ); + + pTLV = (sQMIRawContentHeader *)pData; + pTLV->mTypeID = 0x14; + pTLV->mLength = (UINT16)len; + pData += sizeof( sQMIRawContentHeader ); + + memcpy( pData, pAPN, len ); + pData += len; + } + + if (pUser != 0 && pUser[0] != 0) + { + size_t len = strnlen( pUser, 256 ); + + pTLV = (sQMIRawContentHeader *)pData; + pTLV->mTypeID = 0x17; + pTLV->mLength = (UINT16)len; + pData += sizeof( sQMIRawContentHeader ); + + memcpy( pData, pUser, len ); + pData += len; + } + + if (pPwd != 0 && pPwd[0] != 0) + { + size_t len = strnlen( pPwd, 256 ); + + pTLV = (sQMIRawContentHeader *)pData; + pTLV->mTypeID = 0x18; + pTLV->mLength = (UINT16)len; + pData += sizeof( sQMIRawContentHeader ); + + memcpy( pData, pPwd, len ); + pData += len; + } + + ULONG li = (ULONG)pData - (ULONG)&req[0]; + ULONG lo = 1024; + BYTE rsp[1024] = { 0 }; + status = WDSStartNetworkInterface( mhGobi, 300000, li, &req[0], &lo, &rsp[0] ); + + // On success pSessionID is valid, on failure pFailureCode is valid + ULONG status2 = ParseStartDataSession( lo, &rsp[0], pSessionID, pFailureCode ); + + if (status == eGOBI_ERR_NONE) + { + return status2; + } + + return status; +} + +/*=========================================================================== +METHOD: + CancelDataSession (Public Method) + +DESCRIPTION: + Calls GobiCancel/WDSAbort + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::CancelDataSession() +{ + // Cancel outstanding API request? + if (mhGobi == 0) + { + return eGOBI_ERR_GENERAL; + } + + // Cancel the request with the API + ULONG svcID = 1; + ULONG txID = 0xFFFFFFFF; + ULONG status = GobiCancel( mhGobi, svcID, &txID ); + if (status != 0 || txID == 0xFFFFFFFF) + { + return eGOBI_ERR_GENERAL; + } + + UINT8 req[256] = { 0 }; + UINT8 * pData = (UINT8 *)&req[0]; + + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)pData; + pTLV->mTypeID = 0x01; + pTLV->mLength = (UINT16)sizeof( sWDSAbortRequest_TransactionID ); + pData += sizeof( sQMIRawContentHeader ); + + sWDSAbortRequest_TransactionID * pID = + (sWDSAbortRequest_TransactionID *)pData; + pID->mTransactionID = (UINT16)txID; + pData += sizeof( sWDSAbortRequest_TransactionID ); + + // Cancel the request with the device + ULONG li = (ULONG)pData - (ULONG)&req[0]; + status = WDSAbort( mhGobi, 2000, li, &req[0], 0, 0 ); + return status; +} + +/*=========================================================================== +METHOD: + StopDataSession (Public Method) + +DESCRIPTION: + Calls WDSStopNetworkInterface + +PARAMETERS: + sessionID [ I ] - Session ID + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::StopDataSession( ULONG sessionID ) +{ + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + UINT8 req[256] = { 0 }; + ULONG li = 256; + + status = PackStopDataSession( &li, &req[0], sessionID ); + if (status != 0) + { + return status; + } + + // Stop data session + status = WDSStopNetworkInterface( mhGobi, 2000, li, &req[0], 0, 0 ); + return status; +} + +/*=========================================================================== +METHOD: + GetSessionState (Public Method) + +DESCRIPTION: + Calls WDSGetPacketServiceStatus + +PARAMETERS: + pSessionState [ O ] - Current session state + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetSessionState( ULONG * pSessionState ) +{ + // Assume failure + if (pSessionState != 0) + { + *pSessionState = 0xFFFFFFFF; + } + + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + ULONG lo = 1024; + BYTE rsp[1024] = { 0 }; + status = WDSGetPacketServiceStatus( mhGobi, 2000, 0, 0, &lo, &rsp[0] ); + if (status != 0) + { + return status; + } + + status = ParseGetSessionState( lo, &rsp[0], pSessionState ); + return status; +} + +/*=========================================================================== +METHOD: + GetSessionDuration (Public Method) + +DESCRIPTION: + Calls WDSGetDataSessionDuration + +PARAMETERS: + pSessionDuration [ O ] - Session duration + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetSessionDuration( ULONGLONG * pSessionDuration ) +{ + // Assume failure + if (pSessionDuration != 0) + { + *pSessionDuration = 0xFFFFFFFF; + } + + // Query for session duration + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + ULONG lo = 1024; + BYTE rsp[1024] = { 0 }; + status = WDSGetDataSessionDuration( mhGobi, 2000, 0, 0, &lo, &rsp[0] ); + if (status != 0) + { + return status; + } + + status = ParseGetSessionDuration( lo, &rsp[0], pSessionDuration ); + return status; +} + +/*=========================================================================== +METHOD: + GetDataBearerTechnology (Public Method) + +DESCRIPTION: + Calls WDSGetDataBearerTechnology + +PARAMETERS: + pDataBearerTech [ O ] - Data bearer technology + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetDataBearerTechnology( ULONG * pDataBearerTech ) +{ + // Assume failure + if (pDataBearerTech != 0) + { + *pDataBearerTech = 0xFFFFFFFF; + } + + // Query for data bearer duration? + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + ULONG lo = 1024; + BYTE rsp[1024] = { 0 }; + status = WDSGetDataBearerTechnology( mhGobi, 2000, 0, 0, &lo, &rsp[0] ); + if (status != 0) + { + return status; + } + + status = ParseGetDataBearerTechnology( lo, &rsp[0], pDataBearerTech ); + return status; +} + +/*=========================================================================== +METHOD: + GetConnectionRate (Public Method) + +DESCRIPTION: + Calls WDSGetChannelRates + +PARAMETERS: + pCurTX [ O ] - Current TX rate + pCurRX [ O ] - Current RX rate + pMaxTX [ O ] - Max TX rate + pMaxRX [ O ] - Max RX rate + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetConnectionRate( + ULONG * pCurTX, + ULONG * pCurRX, + ULONG * pMaxTX, + ULONG * pMaxRX ) +{ + // Assume failure + pCurTX != 0 ? *pCurTX = 0xFFFFFFFF : 0; + pCurRX != 0 ? *pCurRX = 0xFFFFFFFF : 0; + pMaxTX != 0 ? *pMaxTX = 0xFFFFFFFF : 0; + pMaxRX != 0 ? *pMaxRX = 0xFFFFFFFF : 0; + + // Query for rates? + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + ULONG lo = 1024; + BYTE rsp[1024] = { 0 }; + status = WDSGetChannelRates( mhGobi, 2000, 0, 0, &lo, &rsp[0] ); + if (status != 0) + { + return status; + } + + status = ParseGetConnectionRate( lo, + &rsp[0], + pCurTX, + pCurRX, + pMaxTX, + pMaxRX ); + return status; +} + +/*=========================================================================== +METHOD: + GetFirmwareRevision (Public Method) + +DESCRIPTION: + Calls DMSGetDeviceRevision + +PARAMETERS: + strSz [ I ] - Maximum number of characters + pStr [ O ] - Firmware revision string + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetFirmwareRevision( + BYTE strSz, + CHAR * pStr ) +{ + return GetString( DMSGetDeviceRevision, 0x01, strSz, pStr ); +} + +/*=========================================================================== +METHOD: + GetManufacturer (Public Method) + +DESCRIPTION: + Calls DMSGetDeviceManfacturer + +PARAMETERS: + strSz [ I ] - Maximum string size + pStr [ O ] - Manufacturer string + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetManufacturer( + BYTE strSz, + CHAR * pStr ) +{ + return GetString( DMSGetDeviceManfacturer, 0x01, strSz, pStr ); +} + +/*=========================================================================== +METHOD: + GetModelID (Public Method) + +DESCRIPTION: + Calls GetModelID + +PARAMETERS: + strSz [ I ] - Max string size + pStr [ O ] - Model ID string + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetModelID( + BYTE strSz, + CHAR * pStr ) +{ + return GetString( DMSGetDeviceModel, 0x01, strSz, pStr ); +} + +/*=========================================================================== +METHOD: + GetHardwareRevision (Public Method) + +DESCRIPTION: + Calls DMSGetHardwareRevision + +PARAMETERS: + strSz [ I ] - Max size of string + pStr [ O ] - Hardware revision string + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetHardwareRevision( + BYTE strSz, + CHAR * pStr ) +{ + return GetString( DMSGetHardwareRevision, 0x01, strSz, pStr ); +} + +/*=========================================================================== +METHOD: + GetVoiceNumber (Public Method) + +DESCRIPTION: + Calls GetVoiceNumber + +PARAMETERS: + voiceSz [ I ] - Max characters in voice string + pVoiceStr [ O ] - Voice number string + minSz [ I ] - Max characters in MIN string + pMINStr [ O ] - MIN string + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetVoiceNumber( + BYTE voiceSz, + CHAR * pVoiceStr, + BYTE minSz, + CHAR * pMINStr ) +{ + // Assume failure + if (voiceSz > 0 && pVoiceStr != 0) + { + pVoiceStr[0] = 0; + } + + if (minSz > 0 && pMINStr != 0) + { + pMINStr[0] = 0; + } + + // Query for voice numbers? + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + ULONG lo = 1024; + BYTE rsp[1024] = { 0 }; + status = DMSGetDeviceVoiceNumber( mhGobi, 2000, 0, 0, &lo, &rsp[0] ); + if (status != 0) + { + return status; + } + + status = ParseGetVoiceNumber( lo, + &rsp[0], + voiceSz, + pVoiceStr, + minSz, + pMINStr ); + return status; +} + +/*=========================================================================== +METHOD: + GetSerialNumbers (Public Method) + +DESCRIPTION: + Calls DMSGetDeviceSerialNumbers + +PARAMETERS: + esnSz [ I ] - ESN size + pESNStr [ O ] - ESN string + imeiSz [ I ] - IMEI size + pIMEIStr [ O ] - IMSI string + meidSz [ I ] - MEID size + pMEIDStr [ O ] - MEID string + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetSerialNumbers( + BYTE esnSz, + CHAR * pESNStr, + BYTE imeiSz, + CHAR * pIMEIStr, + BYTE meidSz, + CHAR * pMEIDStr ) +{ + // Assume failure + if (esnSz > 0 && pESNStr != 0) + { + pESNStr[0] = 0; + } + + if (imeiSz > 0 && pIMEIStr != 0) + { + pIMEIStr[0] = 0; + } + + if (meidSz > 0 && pMEIDStr != 0) + { + pMEIDStr[0] = 0; + } + + // Query for serial numbers? + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + ULONG lo = 1024; + BYTE rsp[1024] = { 0 }; + status = DMSGetDeviceSerialNumbers( mhGobi, 2000, 0, 0, &lo, &rsp[0] ); + if (status != 0) + { + return status; + } + + status = ParseGetSerialNumbers( lo, + &rsp[0], + esnSz, + pESNStr, + imeiSz, + pIMEIStr, + meidSz, + pMEIDStr ); + return status; +} + +/*=========================================================================== +METHOD: + GetIMSI (Public Method) + +DESCRIPTION: + Get IMSI + +PARAMETERS: + imsiSz [ I ] - IMSI size + pIMSIStr [ O ] - IMSI string + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetIMSI( + BYTE imsiSz, + CHAR * pIMSIStr ) +{ + return GetString( DMSGetDeviceVoiceNumber, 0x11, imsiSz, pIMSIStr ); +} + +/*=========================================================================== +METHOD: + GetSignalStrengths (Public Method) + +DESCRIPTION: + Calls NASGetSignalStrength + +PARAMETERS: + pSigStrengths [ O ] - Received signal strength + pRadioInterfaces [ O ] - Radio interface technology + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetSignalStrengths( + INT8 * pSigStrengths, + ULONG * pRadioInterfaces ) +{ + // Assume failure + for (ULONG s = 0; s < MAX_SIGNALS; s++) + { + pSigStrengths[s] = 0; + pRadioInterfaces[s] = 0xFFFFFFFF; + } + + // Query for signal strengths? + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + ULONG lo = 1024; + BYTE rsp[1024] = { 0 }; + status = NASGetSignalStrength( mhGobi, 2000, 0, 0, &lo, &rsp[0] ); + if (status != 0) + { + return status; + } + + status = ParseGetSignalStrength( lo, + &rsp[0], + pSigStrengths, + pRadioInterfaces ); + return status; +} + +/*=========================================================================== +METHOD: + GetServingNetwork (Public Method) + +DESCRIPTION: + Calls NASGetServingSystem + +PARAMETERS: + pDataCapabilities [ O ] - Data capabilities + pMCC [ O ] - Mobile country code + pMNC [ O ] - Mobile network code + nameSize [ I ] - Network name max size + pName [ O ] - Network name + pSID [ O ] - System ID + pNID [ O ] - Network ID + pRoam [ O ] - Roaming indicator + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetServingNetwork( + ULONG * pDataCapabilities, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID, + ULONG * pRoam ) +{ + // Assume failure + for (ULONG d = 0; d < MAX_DATA_CAPABILITIES; d++) + { + pDataCapabilities[d] = 0xFFFFFFFF; + } + + if (nameSize > 0 && pName != 0) + { + pName[0] = 0; + } + + pMCC != 0 ? *pMCC = 0xFFFF : 0; + pMNC != 0 ? *pMNC = 0xFFFF : 0; + pRoam != 0 ? *pRoam = 0xFFFFFFFF : 0; + pSID != 0 ? *pSID = 0xFFFF : 0; + pNID != 0 ? *pNID = 0xFFFF : 0; + + // Query for serving system? + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + ULONG lo = 8096; + BYTE rsp[8096] = { 0 }; + status = NASGetServingSystem( mhGobi, 2000, 0, 0, &lo, &rsp[0] ); + if (status != 0) + { + return status; + } + + std::map tlvs = GetTLVs( &rsp[0], lo ); + std::map ::const_iterator pIter = tlvs.find( 0x11 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pTmp = pIter->second; + ULONG tlvLen = (ULONG)pTmp->mLength; + ULONG dsLen = (ULONG)sizeof( sNASGetServingSystemResponse_DataServices ); + if (tlvLen < dsLen) + { + return eGOBI_ERR_GENERAL; + } + + pTmp++; + const sNASGetServingSystemResponse_DataServices * pDS = + (const sNASGetServingSystemResponse_DataServices *)pTmp; + + ULONG dcCount = (ULONG)pDS->mNumberOfDataCapabilities; + ULONG dcSz = (ULONG)sizeof( eQMINASDataServiceCapabilities2 ); + dsLen += dcCount * dcSz; + if (tlvLen < dsLen) + { + return eGOBI_ERR_GENERAL; + } + + pDS++; + eQMINASDataServiceCapabilities2 * pCap = (eQMINASDataServiceCapabilities2 *)pDS; + if (dcCount > MAX_DATA_CAPABILITIES) + { + dcCount = MAX_DATA_CAPABILITIES; + } + + for (ULONG i = 0; i < dcCount; i++) + { + pDataCapabilities[i] = (ULONG)*pCap++; + } + } + + pIter = tlvs.find( 0x12 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pTmp = pIter->second; + ULONG tlvLen = (ULONG)pTmp->mLength; + ULONG plmnLen = (ULONG)sizeof( sNASGetServingSystemResponse_CurrentPLMN ); + if (tlvLen < plmnLen) + { + return eGOBI_ERR_GENERAL; + } + + pTmp++; + const sNASGetServingSystemResponse_CurrentPLMN * pPLMN = + (const sNASGetServingSystemResponse_CurrentPLMN *)pTmp; + + ULONG strLen = (ULONG)pPLMN->mDescriptionLength; + plmnLen += strLen; + if (tlvLen < plmnLen) + { + return eGOBI_ERR_GENERAL; + } + + pMCC != 0 ? *pMCC = (ULONG)pPLMN->mMobileCountryCode : 0; + pMNC != 0 ? *pMNC = (ULONG)pPLMN->mMobileNetworkCode : 0; + pPLMN++; + + if (strLen != 0 && nameSize > 0 && pName != 0) + { + ULONG needLen = strLen; + if (needLen + 1 > nameSize) + { + needLen = nameSize - 1; + } + + memcpy( pName, pPLMN, needLen ); + pName[needLen] = 0; + } + } + + pIter = tlvs.find( 0x13 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pTmp = pIter->second; + ULONG tlvLen = (ULONG)pTmp->mLength; + ULONG sysLen = (ULONG)sizeof( sNASGetServingSystemResponse_SystemID ); + if (tlvLen < sysLen) + { + return eGOBI_ERR_GENERAL; + } + + pTmp++; + const sNASGetServingSystemResponse_SystemID * pSys = + (const sNASGetServingSystemResponse_SystemID *)pTmp; + + pSID != 0 ? *pSID = (ULONG)pSys->mSystemID : 0; + pNID != 0 ? *pNID = (ULONG)pSys->mNetworkID : 0; + } + + pIter = tlvs.find( 0x16 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pTmp = pIter->second; + ULONG tlvLen = (ULONG)pTmp->mLength; + ULONG roamLen = (ULONG)sizeof( sNASGetServingSystemResponse_DefaultRoaming ); + if (tlvLen < roamLen) + { + return eGOBI_ERR_GENERAL; + } + + pTmp++; + const sNASGetServingSystemResponse_DefaultRoaming * pDR = + (const sNASGetServingSystemResponse_DefaultRoaming *)pTmp; + + pRoam != 0 ? *pRoam = (ULONG)pDR->mRoamingIndicator : 0; + } + + return status; +} + +/*=========================================================================== +METHOD: + GetHomeNetwork (Public Method) + +DESCRIPTION: + Calls NASGetHomeNetwork + +PARAMETERS: + pHomeMCC [ O ] - Mobile country code + pHomeMNC [ O ] - Mobile network code + homeNameSize [ I ] - Max name size + pHomeName [ O ] - Home network name + pSID [ O ] - System ID + pNID [ O ] - Network ID + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::GetHomeNetwork( + WORD * pHomeMCC, + WORD * pHomeMNC, + BYTE homeNameSize, + CHAR * pHomeName, + WORD * pSID, + WORD * pNID ) +{ + // Assume failure + if (homeNameSize > 0 && pHomeName != 0) + { + pHomeName[0] = 0; + } + + pHomeMCC != 0 ? *pHomeMCC = 0xFFFF : 0; + pHomeMNC != 0 ? *pHomeMNC = 0xFFFF : 0; + pSID != 0 ? *pSID = 0xFFFF : 0; + pNID != 0 ? *pNID = 0xFFFF : 0; + + // Query for home system? + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + ULONG lo = 8096; + BYTE rsp[8096] = { 0 }; + status = NASGetHomeNetwork( mhGobi, 2000, 0, 0, &lo, &rsp[0] ); + if (status != 0) + { + return status; + } + + status = ParseGetHomeNetwork( lo, + &rsp[0], + pHomeMCC, + pHomeMNC, + homeNameSize, + pHomeName, + pSID, + pNID ); + return status; +} + +/*=========================================================================== +METHOD: + SetWDSEventReportCB (Public Method) + +DESCRIPTION: + Calls WDSSetEventReport/SetGenericCallback + +PARAMETERS: + pCallback [ I ] - Callback function pointer + interval [ I ] - Interval (in seconds) for transfer statistics + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::SetWDSEventReportCB( + tFNGenericCallback pCallback, + BYTE interval ) +{ + // Set WDS event callback? + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + // Configure the QMI service + UINT8 req[1024] = { 0 }; + UINT8 * pData = (UINT8 *)&req[0]; + + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)pData; + pTLV->mTypeID = 0x11; + pTLV->mLength = (UINT16)sizeof( sWDSSetEventReportRequest_TransferStatisticsIndicator ); + pData += sizeof( sQMIRawContentHeader ); + + sWDSSetEventReportRequest_TransferStatisticsIndicator * pTS = + (sWDSSetEventReportRequest_TransferStatisticsIndicator *)pData; + pTS->mTransferStatisticsIntervalSeconds = interval; + pTS->mReportTXPacketSuccesses = 0; + pTS->mReportRXPacketSuccesses = 0; + pTS->mReportTXPacketErrors = 0; + pTS->mReportRXPacketErrors = 0; + pTS->mReportTXOverflows = 0; + pTS->mReportRXOverflows = 0; + pTS->mTXByteTotal = 1; + pTS->mRXByteTotal = 1; + pData += sizeof( sWDSSetEventReportRequest_TransferStatisticsIndicator ); + + pTLV = (sQMIRawContentHeader *)pData; + pTLV->mTypeID = 0x12; + pTLV->mLength = (UINT16)sizeof( sWDSSetEventReportRequest_DataBearerTechnologyIndicator ); + pData += sizeof( sQMIRawContentHeader ); + + sWDSSetEventReportRequest_DataBearerTechnologyIndicator * pTI = + (sWDSSetEventReportRequest_DataBearerTechnologyIndicator *)pData; + pTI->mReportDataBearerTechnology = 1; + pData += sizeof( sWDSSetEventReportRequest_DataBearerTechnologyIndicator ); + + ULONG li = (ULONG)pData - (ULONG)&req[0]; + status = WDSSetEventReport( mhGobi, 2000, li, &req[0], 0, 0 ); + if (status != 0) + { + return status; + } + + // Configure the callback with the API + status = SetGenericCallback( mhGobi, 1, 1, pCallback ); + return status; +} + +/*=========================================================================== +METHOD: + SetWDSSessionStateCB (Public Method) + +DESCRIPTION: + Calls SetGenericCallback + +PARAMETERS: + pCallback [ I ] - Callback function pointer + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::SetWDSSessionStateCB( tFNGenericCallback pCallback ) +{ + // Set WDS packet service status callback? + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + // Configure the callback with the API + status = SetGenericCallback( mhGobi, 1, 34, pCallback ); + return status; +} + +/*=========================================================================== +METHOD: + SetNASEventReportCB (Public Method) + +DESCRIPTION: + Calls NASSetEventReport/SetGenericCallback + +PARAMETERS: + pCallback [ I ] - Callback function pointer + thresholdsSize [ I ] - Threshold size + pThresholds [ I ] - Array of thresholds + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::SetNASEventReportCB( + tFNGenericCallback pCallback, + BYTE thresholdsSize, + INT8 * pThresholds ) +{ + // Set NAS event report callback request? + ULONG status = eGOBI_ERR_GENERAL; + if ( (mhGobi == 0) + || (thresholdsSize > 0 && pThresholds == 0) ) + { + return status; + } + + // Configure the QMI service + UINT8 req[1024] = { 0 }; + UINT8 * pData = (UINT8 *)&req[0]; + + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)pData; + pTLV->mTypeID = 0x10; + pTLV->mLength = (UINT16)sizeof( sNASSetEventReportRequest_SignalIndicator ); + pTLV->mLength += (UINT16)thresholdsSize; + pData += sizeof( sQMIRawContentHeader ); + + sNASSetEventReportRequest_SignalIndicator * pSI = + (sNASSetEventReportRequest_SignalIndicator *)pData; + pSI->mReportSignalStrength = 1; + pSI->mNumberOfThresholds = thresholdsSize; + pData += sizeof( sNASSetEventReportRequest_SignalIndicator ); + + for (UINT8 i = 0; i < thresholdsSize; i++) + { + INT8 * pThresh = (INT8 *)pData; + *pThresh = pThresholds[i]; + pData++; + } + + ULONG li = (ULONG)pData - (ULONG)&req[0]; + status = NASSetEventReport( mhGobi, 2000, li, &req[0], 0, 0 ); + if (status != 0) + { + return status; + } + + // Configure the callback with the API + status = SetGenericCallback( mhGobi, 3, 2, pCallback ); + return status; +} + +/*=========================================================================== +METHOD: + SetNASServingSystemCB (Public Method) + +DESCRIPTION: + Calls SetGenericCallback + +PARAMETERS: + pCallback [ I ] - Callback function pointer + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cGobiCMDLL::SetNASServingSystemCB( tFNGenericCallback pCallback ) +{ + // Set NAS serving system request? + ULONG status = eGOBI_ERR_GENERAL; + if (mhGobi == 0) + { + return status; + } + + // Configure the callback with the API + status = SetGenericCallback( mhGobi, 3, 36, pCallback ); + return status; +} diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMDLL.h b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMDLL.h new file mode 100755 index 0000000..8641061 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/GobiCMDLL.h @@ -0,0 +1,266 @@ +/*=========================================================================== +FILE: + GobiCMDLL.h + +DESCRIPTION: + Simple class to load and interface to the Gobi CM DLL + +PUBLIC CLASSES AND METHODS: + cGobiCMDLL + This class loads the Gobi CM DLL and then interfaces to it + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiConnectionMgmtAPI.h" +#include "GobiConnectionMgmtAPIStructs.h" +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +// Handle to Gobi API +typedef ULONG_PTR GOBIHANDLE; + +// The maximum number of signals +const ULONG MAX_SIGNALS = 12; + +// The maximum number of data capabilities +const ULONG MAX_DATA_CAPABILITIES = 12; + +// Gobi input/output function pointer +typedef ULONG (* tFNGobiInputOutput)( + GOBIHANDLE handle, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetTLVs (Internal Method) + +DESCRIPTION: + Convert response buffer to a TLV map + +PARAMETERS: + pRsp [ I ] - The response buffer + rspSz [ I ] - The size of the above buffer + +RETURN VALUE: + std::map +===========================================================================*/ +inline std::map GetTLVs( + const UINT8 * pRsp, + ULONG rspSz ) +{ + std::map retMap; + + ULONG dataProcessed = 0; + const UINT8 * pData = &pRsp[0]; + while (dataProcessed < rspSz) + { + dataProcessed += (ULONG)sizeof( sQMIRawContentHeader ); + if (dataProcessed > rspSz) + { + break; + } + + const sQMIRawContentHeader * pTLV = (const sQMIRawContentHeader *)pData; + dataProcessed += (ULONG)pTLV->mLength; + if (dataProcessed > rspSz) + { + break; + } + + retMap[pTLV->mTypeID] = pTLV; + pData = &pRsp[dataProcessed]; + } + + return retMap; +}; + +/*=========================================================================*/ +// Class cGobiCMDLL +/*=========================================================================*/ +class cGobiCMDLL +{ + public: + // Constructor + cGobiCMDLL() + : mhGobi( 0 ) + { } + + // Destructor + ~cGobiCMDLL() + { } + + // Connect + ULONG Connect( LPCSTR pInterface ); + + // Disconnect + ULONG Disconnect(); + + // Start data session + ULONG StartDataSession( + LPCSTR pAPN, + LPCSTR pUser, + LPCSTR pPwd, + ULONG * pSessionID, + ULONG * pFailureCode ); + + // Cancel data session + ULONG CancelDataSession(); + + // Stop data session + ULONG StopDataSession( ULONG sessionID ); + + // Get session state + ULONG GetSessionState( ULONG * pSessionState ); + + // Get session duration + ULONG GetSessionDuration( ULONGLONG * pSessionDuration ); + + // Get data bearer technology + ULONG GetDataBearerTechnology( ULONG * pDataBearerTech ); + + // Get connection rate + ULONG GetConnectionRate( + ULONG * pCurTX, + ULONG * pCurRX, + ULONG * pMaxTX, + ULONG * pMaxRX ); + + // Get firmware revision + ULONG GetFirmwareRevision( + BYTE strSz, + CHAR * pStr ); + + // Get manufacturer + ULONG GetManufacturer( + BYTE strSz, + CHAR * pStr ); + + // Get model ID + ULONG GetModelID( + BYTE strSz, + CHAR * pStr ); + + // Get hardware revision + ULONG GetHardwareRevision( + BYTE strSz, + CHAR * pStr ); + + // Get voice number + ULONG GetVoiceNumber( + BYTE voiceSz, + CHAR * pVoiceStr, + BYTE minSz, + CHAR * pMINStr ); + + // Get serial numbers + ULONG GetSerialNumbers( + BYTE esnSz, + CHAR * pESNStr, + BYTE imeiSz, + CHAR * pIMEIStr, + BYTE meidSz, + CHAR * pMEIDStr ); + + // Get IMSI + ULONG GetIMSI( + BYTE imsiSz, + CHAR * pIMSIStr ); + + // Get signal strengths + ULONG GetSignalStrengths( + INT8 * pSigStrengths, + ULONG * pRadioInterfaces ); + + // Get serving network + ULONG GetServingNetwork( + ULONG * pDataCapabilities, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID, + ULONG * pRoam ); + + // Get home network + ULONG GetHomeNetwork( + WORD * pHomeMCC, + WORD * pHomeMNC, + BYTE homeNameSize, + CHAR * pHomeName, + WORD * pSID, + WORD * pNID ); + + // Set WDS event report callback + ULONG SetWDSEventReportCB( + tFNGenericCallback pCallback, + BYTE interval ); + + // Set WDS packet service status callback + ULONG SetWDSSessionStateCB( tFNGenericCallback pCallback ); + + // Set NAS event report callback + ULONG SetNASEventReportCB( + tFNGenericCallback pCallback, + BYTE thresholdsSize, + INT8 * pThresholds ); + + // Set NAS serving system callback + ULONG SetNASServingSystemCB( tFNGenericCallback pCallback ); + + protected: + + // Call a Gobi CM API function that returns a string + ULONG GetString( + tFNGobiInputOutput mpFnString, + BYTE tlvID, + BYTE strSz, + CHAR * pStr ); + + /* Handle to Gobi API */ + GOBIHANDLE mhGobi; +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/QTSampleCM.cpp b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/QTSampleCM.cpp new file mode 100755 index 0000000..076a0cf --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/QTSampleCM.cpp @@ -0,0 +1,316 @@ +/*=========================================================================== +FILE: + QTSampleCM.cpp + +DESCRIPTION: + QT implementation of the Sample CM + +PUBLIC CLASSES AND METHODS: + cQTSampleCM + QT implementation of the Sample CM + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "QTSampleCM.h" + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + AsyncConnectThread (Free Method) + +DESCRIPTION: + Start a data session + +PARAMETERS: + pData [ I ] - cQTSampleCM object + +RETURN VALUE: + void * - always NULL +===========================================================================*/ +void * AsyncConnectThread( void * pData ) +{ + cQTSampleCM * pCM = (cQTSampleCM*)pData; + if (pCM == NULL) + { + return NULL; + } + + // Open the dialog window, disable the info and connection stats buttons + pCM->mView.rootContext()->setContextProperty( "dialogText", + "Connecting, please wait..." ); + pCM->mView.rootContext()->setContextProperty( "windowState", + "connectingDialog" ); + + ULONG failureCode = 0xFFFFFFFF; + ULONG rc = pCM->OnStartDataSession( &failureCode ); + if (rc != eGOBI_ERR_NONE) + { + std::ostringstream error; + error << "Failed to connect, error " << rc; + + TRACE( "rc %lu, failure code %lu", rc, failureCode ); + + // Show failure code, if present + if (rc == 1014 && failureCode != 0xFFFFFFFF) + { + error << "\nCall failure reason " << failureCode; + } + + pCM->mView.rootContext()->setContextProperty( "dialogText", + error.str().c_str() ); + + pCM->SetConnectButtonText( "Connect" ); + } + else + { + pCM->mView.rootContext()->setContextProperty( "dialogText", "Success!" ); + + // Connect button should be updated by state change indication + } + + // Leave the dialog up for 2s + sleep( 2 ); + + pCM->mView.rootContext()->setContextProperty( "windowState", "" ); + + return NULL; +} + +/*=========================================================================== +METHOD: + OnInfosButton (Free Method) + +DESCRIPTION: + Move to the info stats page + +PARAMETERS: + pCM [ I ] - cQTSampleCM object + +RETURN VALUE: + QVariant - always 0 +===========================================================================*/ +QVariant OnInfosButton( cQTSampleCM * pCM ) +{ + pCM->mView.rootContext()->setContextProperty( "windowState", "infos" ); + + return 0; +} + +/*=========================================================================== +METHOD: + OnConnectionsButton (Free Method) + +DESCRIPTION: + Move to the connection stats page + +PARAMETERS: + pCM [ I ] - cQTSampleCM object + +RETURN VALUE: + QVariant - always 0 +===========================================================================*/ +QVariant OnConnectionsButton( cQTSampleCM * pCM ) +{ + // "" is the default state (connection stats page) + pCM->mView.rootContext()->setContextProperty( "windowState", "" ); + + return 0; +} + +/*=========================================================================== +METHOD: + OnConnectButton (Free Method) + +DESCRIPTION: + Start, cancel, or disconnect from a data session + + NOTE: The UI is not updated until this function returns, so the connection + will be established asynchronously + +PARAMETERS: + pCM [ I ] - cQTSampleCM object + +RETURN VALUE: + QVariant - always 0 +===========================================================================*/ +QVariant OnConnectButton( cQTSampleCM * pCM ) +{ + // Double check if there a device connected + if (pCM->mDeviceID.size() == 0 + || pCM->mConnectButtonText.compare( "No Device" ) == 0) + { + TRACE( "No Device" ); + return 0; + } + + // Start a connection + if (pCM->mConnectButtonText.compare( "Connect" ) == 0) + { + pCM->SetConnectButtonText( "Cancel" ); + + // Create a detached thread to start the connection asynchronously + pthread_attr_t attributes; + pthread_attr_init( &attributes ); + pthread_attr_setdetachstate( &attributes, PTHREAD_CREATE_DETACHED ); + + pthread_create( &pCM->mAsyncConnectThreadID, + &attributes, + AsyncConnectThread, + pCM ); + } + else if (pCM->mConnectButtonText.compare( "Cancel" ) == 0) + { + pCM->OnCancelDataSession(); + + pCM->SetConnectButtonText( "Connect" ); + } + else if (pCM->mConnectButtonText.compare( "Disconnect" ) == 0) + { + pCM->OnStopDataSession(); + + pCM->SetConnectButtonText( "Connect" ); + } + else + { + // Externally connected, etc + TRACE( "Unknown connect button state %s", + pCM->mConnectButtonText.c_str() ); + } + + return 0; +} + +/*=========================================================================*/ +// cQTSampleCM Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + Init (Public Method) + +DESCRIPTION: + Initialize GUI + +RETURN VALUE: + bool +===========================================================================*/ +bool cQTSampleCM::Init() +{ + // Use the current screen orientation + mView.setOrientation( QmlApplicationViewer::ScreenOrientationAuto ); + + // The buttons + mView.rootContext()->setContextProperty( "connectButton", + &mConnectButton ); + mView.rootContext()->setContextProperty( "infosButton", + &mInfosButton ); + mView.rootContext()->setContextProperty( "connectionsButton", + &mConnectionsButton ); + + // The input fields + mView.rootContext()->setContextProperty( "apnNameText", &mAPNText ); + mView.rootContext()->setContextProperty( "usernameText", &mUsernameText ); + mView.rootContext()->setContextProperty( "passwordText", &mPasswordText ); + + // Default button value + SetConnectButtonText( "No Device" ); + + // Default state + mView.rootContext()->setContextProperty( "windowState", "" ); + mView.rootContext()->setContextProperty( "dialogText", "" ); + + bool bRC = cSampleCM::Init(); + + mView.setMainQmlFile( "qml/GobiSampleCM/main.qml" ); + mView.show(); + + return bRC; +} + +/*=========================================================================== +METHOD: + Run (Public Method) + +DESCRIPTION: + Run the GUI (blocks until exit) + +RETURN VALUE: + bool +===========================================================================*/ +int cQTSampleCM::Run() +{ + return mApp.exec(); +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Calls GobiDisconnect + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cQTSampleCM::Disconnect() +{ + SetConnectButtonText( "No device" ); + + return cSampleCM::Disconnect(); +} + +/*=========================================================================== +ETHOD: + OnStartDataSession (Public Method) + +DESCRIPTION: + Updates apn, username, and password input field values before starting + a data session + +PARAMETERS: + pFailureCode [ O ] - Call failure code, if provided + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cQTSampleCM::OnStartDataSession( ULONG * pFailureCode ) +{ + // Grab the APN, username, and password + mAPN = mAPNText.getText().toUtf8().constData(); + mUsername = mUsernameText.getText().toUtf8().constData(); + mPassword = mPasswordText.getText().toUtf8().constData(); + + return cSampleCM::OnStartDataSession( pFailureCode ); +} diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/QTSampleCM.h b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/QTSampleCM.h new file mode 100755 index 0000000..935cf4f --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/QTSampleCM.h @@ -0,0 +1,459 @@ +/*=========================================================================== +FILE: + QTSampleCM.h + +DESCRIPTION: + QT implementation of the Sample CM + +PUBLIC CLASSES AND METHODS: + cButton + Generic clickable button for QT + cTextInput + Generic text input field for QT + cQTSampleCM + QT implementation of the Sample CM + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include +#include "qmlapplicationviewer.h" +#include +#include + +#include "SampleCM.h" + +// Prototypes +class cQTSampleCM; +void * AsyncConnectThread( void * pData ); +QVariant OnInfosButton( cQTSampleCM * pCM ); +QVariant OnConnectionsButton( cQTSampleCM * pCM ); +QVariant OnConnectButton( cQTSampleCM * pCM ); + +/*=========================================================================*/ +// Class cButton +// Generic clickable button for QT +/*=========================================================================*/ +class cButton : public QObject +{ + Q_OBJECT + +public: + + // Constructor + cButton( cQTSampleCM * pCM, + QVariant (*pOnClick)( cQTSampleCM * ) ) + { + mpCM = pCM; + mpOnClick = pOnClick; + } + +public slots: + + // Function to be run on a click event + QVariant Click() + { + if (mpOnClick != 0) + { + return mpOnClick( mpCM ); + } + + return ""; + } + +protected: + + /* The main object */ + cQTSampleCM * mpCM; + + /* Function to run when clicked */ + QVariant (* mpOnClick)( cQTSampleCM * ); +}; + +/*=========================================================================*/ +// cTextInput +// Generic text input field for QT +/*=========================================================================*/ +class cTextInput : public QObject +{ + Q_OBJECT + Q_PROPERTY( QString text READ getText WRITE setText ) + +public slots: + + // Get the value + QString getText() const + { + return mText; + } + + // Set the value + void setText( const QString & text ) + { + mText = text; + } + +private: + + /* The text */ + QString mText; +}; + +/*=========================================================================*/ +// Class cQTSampleCM +/*=========================================================================*/ +class cQTSampleCM : public cSampleCM +{ + public: + // Constructor + cQTSampleCM( int argc, char ** argv ) + : mApp( argc, argv ), + mConnectButtonText( "No Device" ), + mConnectButton( this, OnConnectButton ), + mInfosButton( this, OnInfosButton ), + mConnectionsButton( this, OnConnectionsButton ) + { } + + // Initialize UI, begin waiting for devices + bool Init(); + + // Run the GUI (blocks until exit) + int Run(); + + // Disconnect + ULONG Disconnect(); + + // Process a start data session request + ULONG OnStartDataSession( ULONG * pFailureCode ); + + // Set mState and the connection button + void SetState( const std::string & state ) + { + cSampleCM::SetState( state ); + + // Update the connection button as well + switch (mSessionState) + { + case eQMIConnectionStatus_Disconnected: + { + SetConnectButtonText( "Connect" ); + + if (mInitialState != eQMIConnectionStatus_Disconnected + && mInitialState != eQMIConnectionStatus_Suspended) + { + // Clear the initial state + mInitialState = eQMIConnectionStatus_Disconnected; + } + } + break; + + case eQMIConnectionStatus_Connected: + { + if (mInitialState != eQMIConnectionStatus_Disconnected + && mInitialState != eQMIConnectionStatus_Suspended) + { + SetConnectButtonText( "External Con" ); + } + else + { + SetConnectButtonText( "Disconnect" ); + } + } + break; + + case eQMIConnectionStatus_Authenticating: + { + if (mInitialState != eQMIConnectionStatus_Disconnected + && mInitialState != eQMIConnectionStatus_Suspended) + { + SetConnectButtonText( "Ext Connecting" ); + } + else + { + SetConnectButtonText( "Cancel" ); + } + } + break; + + case eQMIConnectionStatus_Suspended: + default: + break; + } + + // No more than 12 characters + if (mState.size() > 12) + { + mState.resize( 12 ); + } + + // Note: "state" is already a property, can't duplicate + // using "status" instead + mView.rootContext()->setContextProperty( "status", mState.c_str() ); + } + + // Set mRSSI + void SetRSSI( const std::string & rssi ) + { + cSampleCM::SetRSSI( rssi ); + + mView.rootContext()->setContextProperty( "rssi", mRSSI.c_str() ); + } + + // Set mTech + void SetTech( const std::string & tech ) + { + cSampleCM::SetTech( tech ); + + // No more than 12 characters + if (mTech.size() > 12) + { + mTech.resize( 12 ); + } + + mView.rootContext()->setContextProperty( "tech", mTech.c_str() ); + } + + // Set mRx + void SetRx( const std::string & rx ) + { + cSampleCM::SetRx( rx ); + + mView.rootContext()->setContextProperty( "rx", mRx.c_str() ); + } + + // Set mTx + void SetTx( const std::string & tx ) + { + cSampleCM::SetTx( tx ); + + mView.rootContext()->setContextProperty( "tx", mTx.c_str() ); + } + + // Set mMaxRx + void SetMaxRx( const std::string & maxRx ) + { + cSampleCM::SetMaxRx( maxRx ); + + mView.rootContext()->setContextProperty( "maxRx", mMaxRx.c_str() ); + } + + // Set mMaxTx + void SetMaxTx( const std::string & maxTx ) + { + cSampleCM::SetMaxTx( maxTx ); + + mView.rootContext()->setContextProperty( "maxTx", mMaxTx.c_str() ); + } + + // Set mRoam + void SetRoam( const std::string & roam ) + { + cSampleCM::SetRoam( roam ); + + mView.rootContext()->setContextProperty( "roam", mRoam.c_str() ); + } + + // Set mDuration + void SetDuration( const std::string & duration ) + { + cSampleCM::SetDuration( duration ); + + mView.rootContext()->setContextProperty( "duration", mDuration.c_str() ); + } + + // Set mLifeDuration + void SetLifeDuration( const std::string & lifeDuration ) + { + cSampleCM::SetLifeDuration( lifeDuration ); + + mView.rootContext()->setContextProperty( "lifeDuration", mLifeDuration.c_str() ); + } + + // Set mLifeRx + void SetLifeRx( const std::string & lifeRx ) + { + cSampleCM::SetLifeRx( lifeRx ); + + mView.rootContext()->setContextProperty( "lifeRx", mLifeRx.c_str() ); + } + + // Set mLifeTx + void SetLifeTx( const std::string & lifeTx ) + { + cSampleCM::SetLifeTx( lifeTx ); + + mView.rootContext()->setContextProperty( "lifeTx", mLifeTx.c_str() ); + } + + // Set mManufact + void SetManufact( const std::string & manufact ) + { + cSampleCM::SetManufact( manufact ); + + mView.rootContext()->setContextProperty( "manufact", mManufact.c_str() ); + } + + // Set mModel + void SetModel( const std::string & model ) + { + cSampleCM::SetModel( model ); + + // No more than 20 characters + if (mModel.size() > 20) + { + mModel.resize( 20 ); + } + + mView.rootContext()->setContextProperty( "model", mModel.c_str() ); + } + + // Set mHardware + void SetHardware( const std::string & hardware ) + { + cSampleCM::SetHardware( hardware ); + + mView.rootContext()->setContextProperty( "hardware", mHardware.c_str() ); + } + + // Set mFirmware + void SetFirmware( const std::string & firmware ) + { + cSampleCM::SetFirmware( firmware ); + + // No more than 20 characters + if (mFirmware.size() > 20) + { + mFirmware.resize( 20 ); + } + + mView.rootContext()->setContextProperty( "firmware", mFirmware.c_str() ); + } + + // Set mMDN + void SetMDN( const std::string & mdn ) + { + cSampleCM::SetMDN( mdn ); + + mView.rootContext()->setContextProperty( "mdn", mMDN.c_str() ); + } + + // Set mMIN + void SetMIN( const std::string & min ) + { + cSampleCM::SetMIN( min ); + + mView.rootContext()->setContextProperty( "min", mMIN.c_str() ); + } + + // Set mESN + void SetESN( const std::string & esn ) + { + cSampleCM::SetESN( esn ); + + mView.rootContext()->setContextProperty( "esn", mESN.c_str() ); + } + + // Set mMEID + void SetMEID( const std::string & meid ) + { + cSampleCM::SetMEID( meid ); + + mView.rootContext()->setContextProperty( "meid", mMEID.c_str() ); + } + + // Set mIMEI + void SetIMEI( const std::string & imei ) + { + cSampleCM::SetIMEI( imei ); + + mView.rootContext()->setContextProperty( "imei", mIMEI.c_str() ); + } + + // Set mIMSI + void SetIMSI( const std::string & imsi ) + { + cSampleCM::SetIMSI( imsi ); + + mView.rootContext()->setContextProperty( "imsi", mIMSI.c_str() ); + } + + // Set mConnectButtonText + void SetConnectButtonText( const std::string & connectButtonText ) + { + mConnectButtonText = connectButtonText; + + mView.rootContext()->setContextProperty( "connectButtonText", + connectButtonText.c_str() ); + } + + protected: + + /* QApplication object */ + QApplication mApp; + + /* QmlApplicationViewer object */ + QmlApplicationViewer mView; + + /* APN text input field */ + cTextInput mAPNText; + + /* Username text input field */ + cTextInput mUsernameText; + + /* Password text input field */ + cTextInput mPasswordText; + + /* "Connect" button's text */ + std::string mConnectButtonText; + + /* "Connect" button */ + cButton mConnectButton; + + /* "Info Stats" button */ + cButton mInfosButton; + + /* "Connection Stats" button */ + cButton mConnectionsButton; + + /* Async connection thread ID */ + pthread_t mAsyncConnectThreadID; + + // Friend functions + friend void * AsyncConnectThread( void * pData ); + friend QVariant OnInfosButton( cQTSampleCM * pCM ); + friend QVariant OnConnectionsButton( cQTSampleCM * pCM ); + friend QVariant OnConnectButton( cQTSampleCM * pCM ); +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/SampleCM.cpp b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/SampleCM.cpp new file mode 100755 index 0000000..95597bd --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/SampleCM.cpp @@ -0,0 +1,1735 @@ +/*=========================================================================== +FILE: + SampleCM.cpp + +DESCRIPTION: + Generic class to act as Sample CM interface + +PUBLIC CLASSES AND METHODS: + cSampleCM + Generic class to act as Sample CM interface + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "SampleCM.h" +#include "GobiCMDLL.h" +#include "GobiCMCallback.h" +#include "GobiConnectionMgmtAPIStructs.h" + +#include +#include +#include +#include +#include + +// Global pointer for callbacks to reference +class cSampleCM * gpCM; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetTickCount (Free Method) + +DESCRIPTION: + Provide a number for sequencing reference, similar to the windows + ::GetTickCount(). + + NOTE: This number is based on the time since epoc, not + uptime. + +PARAMETERS: + +RETURN VALUE: + ULONGLONG - Number of milliseconds system has been up +===========================================================================*/ +ULONGLONG GetTickCount() +{ + timespec curtime; + clock_gettime( CLOCK_REALTIME, &curtime ); + + ULONGLONG outtime = curtime.tv_sec * 1000LL; + outtime += curtime.tv_nsec / 1000000LL; + + return outtime; +} + +/*=========================================================================== +METHOD: + DeviceDetectionThread (Free Method) + +DESCRIPTION: + Scans for and detects devices + +PARAMETERS: + pData [ I ] - cSampleCM object + +RETURN VALUE: + void * - always NULL +===========================================================================*/ +void * DeviceDetectionThread( void * pData ) +{ + cSampleCM * pCM = (cSampleCM *)pData; + if (pCM == NULL) + { + return NULL; + } + + // Get inotify handle + int inotify = inotify_init(); + if (inotify == -1) + { + TRACE( "inotify_init failed\n" ); + return NULL; + } + + // Start a watch on the /dev directory + int inotifyFlags = IN_CREATE | IN_MODIFY | IN_DELETE; + int watchD = inotify_add_watch( inotify, "/dev/", inotifyFlags ); + if (watchD == -1) + { + TRACE( "inotify_add_watch failed\n" ); + close( inotify ); + return NULL; + } + + // Does a device already exist? + dirent ** ppDevFiles; + + // Yes, scandir really takes a triple pointer for its second param + int numDevs = scandir( "/dev/", &ppDevFiles, NULL, NULL ); + for (int i = 0; i < numDevs; i++) + { + std::string deviceID = "/dev/"; + deviceID += ppDevFiles[i]->d_name; + free( ppDevFiles[i] ); + + if (deviceID.find( "qcqmi" ) != std::string::npos) + { + pCM->Connect( deviceID.c_str() ); + break; + } + } + + // Cleanup from scandir + if (numDevs != -1) + { + free( ppDevFiles ); + } + else + { + TRACE( "Scandir failed\n" ); + } + + // Begin async reading + fd_set inputSet, outputSet; + FD_ZERO( &inputSet ); + FD_SET( pCM->mDeviceDetectionStopPipe[READING], &inputSet ); + FD_SET( inotify, &inputSet ); + int largestFD = std::max( pCM->mDeviceDetectionStopPipe[READING], inotify ); + + while (true) + { + // No FD_COPY() available in android + memcpy( &outputSet, &inputSet, sizeof( fd_set ) ); + + // Wait for data on either the inotify or the stop pipe + int status = select( largestFD + 1, &outputSet, NULL, NULL, NULL ); + if (status <= 0) + { + break; + } + else if (FD_ISSET( pCM->mDeviceDetectionStopPipe[READING], &outputSet ) == true) + { + // Time to close + break; + } + else if (FD_ISSET( inotify, &outputSet ) == true) + { + // Perform a read + BYTE buffer[1024] = { 0 }; + int rc = read( inotify, &buffer[0], 1024 ); + if (rc < (int)sizeof( inotify_event )) + { + continue; + } + + // Typecast the buffer to an inotify event + struct inotify_event * pIEvent = (struct inotify_event *)&buffer[0]; + + // Check the length of the name + if (pIEvent->len < 5) + { + continue; + } + + // Is this a matching device? + if (strncmp( pIEvent->name, "qcqmi", 5 ) != 0) + { + continue; + } + + std::string deviceID = "/dev/"; + deviceID += pIEvent->name; + + if (pIEvent->mask & IN_CREATE + || pIEvent->mask & IN_MODIFY) + { + pCM->Connect( deviceID.c_str() ); + } + + if (pIEvent->mask & IN_DELETE) + { + // Was it the connected device which was removed? + if (pCM->mDeviceID.compare( deviceID ) == 0) + { + pCM->Disconnect(); + } + } + } + } + + // Cleanup + inotify_rm_watch( inotify, watchD ); + close( inotify ); + + return NULL; +} + +/*=========================================================================== +METHOD: + UpdateNetworkInfoThread (Free Method) + +DESCRIPTION: + Updates the network stats every 1s (while device is present) + +PARAMETERS: + pData [ I ] - cSampleCM object + +RETURN VALUE: + void * - always NULL +===========================================================================*/ +void * UpdateNetworkInfoThread( void * pData ) +{ + cSampleCM * pCM = (cSampleCM*)pData; + if (pCM == NULL) + { + return NULL; + } + + // Update once + pCM->CheckConnectedStats(); + + int rc; + do + { + // Update rates and times every 1s + pCM->UpdateRateDisplay(); + pCM->UpdateTimeDisplay(); + + DWORD temp; + rc = pCM->mUpdateNetworkInfoEvent.Wait( 1000, temp ); + + } while (rc == ETIME); + + return NULL; +} + +/*=========================================================================== +METHOD: + ParseStats (Free Method) + +DESCRIPTION: + Parse the stats file and obtain the TX/RX bytes and connection duration + + NOTE: The stats text file consists of one line in the following format: + Total RX Bytes; Total TX Bytes; Total Duration + +PARAMETERS: + line [ I ] - Line to parse + lifeTotalRX [ O ] - Total RX bytes + lifeTotalTX [ O ] - Total TX bytes + lifeTotalDuration [ O ] - Total connection duration + +RETURN VALUE: + bool +===========================================================================*/ +bool ParseStats( + std::istringstream & line, + ULONGLONG & lifeTotalRX, + ULONGLONG & lifeTotalTX, + ULONGLONG & lifeTotalDuration ) +{ + + ULONGLONG temp1, temp2, temp3; + char c1, c2; + + // Attempt to parse into temp variables, skipping whitespace + line >> std::skipws >> temp1 >> c1 >> temp2 >> c2 >> temp3; + + // Was parsing successful? + if (line.fail() == true) + { + TRACE( "failed to parse stats file\n" ); + return false; + } + else + { + TRACE( "read %llu, %llu, %llu", temp1, temp2, temp3 ); + lifeTotalRX = temp1; + lifeTotalTX = temp2; + lifeTotalDuration = temp3; + + return true; + } +} + +/*=========================================================================*/ +// cSampleCM Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + ~cSampleCM (Public Method) + +DESCRIPTION: + Destructor - Stops the data session, + Stops device detection thread, + Writes stats to file + +RETURN VALUE: + None +===========================================================================*/ +cSampleCM::~cSampleCM() +{ + // These functions will most likely fail. That's ok. + OnCancelDataSession(); + OnStopDataSession(); + + Disconnect(); + + // Close device detection thread, if open + if (mDeviceDetectionStopPipe[WRITING] != -1) + { + if (mDeviceDetectionThreadID != 0) + { + BYTE byte = 1; + write( mDeviceDetectionStopPipe[WRITING], &byte, 1 ); + + pthread_join( mDeviceDetectionThreadID, NULL ); + + mDeviceDetectionThreadID = 0; + } + + close( mDeviceDetectionStopPipe[WRITING] ); + close( mDeviceDetectionStopPipe[READING] ); + mDeviceDetectionStopPipe[READING] = -1; + mDeviceDetectionStopPipe[WRITING] = -1; + } + + // Write stats to file + std::string config = getenv( "HOME" ); + config += "/.GobiSampleCMStats.txt"; + + int flags = O_CREAT | O_TRUNC | O_WRONLY; + mode_t mode = S_IRUSR | S_IWUSR; + int statsFile = open( config.c_str(), flags, mode ); + if (statsFile < 0) + { + TRACE( "Unable to create stats file\n" ); + } + else + { + std::ostringstream out; + out << mLifeTotalRX << "; " + << mLifeTotalTX << "; " + << mLifeTotalDuration; + + int rc = write( statsFile, out.str().c_str(), out.str().size() ); + if (rc < 0) + { + TRACE( "Unable to write stats to file\n" ); + } + + close( statsFile ); + } +} + +/*=========================================================================== +METHOD: + Init (Public Method) + +DESCRIPTION: + Initialize GUI, begin waiting for devices + +RETURN VALUE: + bool +===========================================================================*/ +bool cSampleCM::Init() +{ + Disconnect(); + + // Read in the stats file + std::string config = getenv( "HOME" ); + config += "/.GobiSampleCMStats.txt"; + + int statsFile = open( config.c_str(), O_RDONLY ); + if (statsFile < 0) + { + // Non-fatal error + TRACE( "Unable to open config file %s", config.c_str() ); + } + else + { + CHAR buf[100]; + int len = read( statsFile, &buf[0], 100 ); + if (len < 0) + { + // Non-fatal error + TRACE( "failed to read from file\n" ); + } + else + { + std::string asString( &buf[0], len ); + std::istringstream line( asString ); + + ULONGLONG lrx, ltx, ld; + if (ParseStats( line, lrx, ltx, ld ) == true) + { + mLifeTotalRX = lrx; + mLifeTotalTX = ltx; + mLifeTotalDuration = ld; + } + } + + close( statsFile ); + } + + // Life totals will just be zeros if the file was not present + std::ostringstream tmp; + tmp << mLifeTotalRX; + SetLifeRx( tmp.str() ); + + tmp.str( "" ); + tmp << mLifeTotalTX; + SetLifeTx( tmp.str() ); + + tmp.str( "" ); + tmp << std::setfill( '0' ) << std::setw( 2 ) << (mLifeTotalDuration / 3600) % 60 + << std::setw( 1 ) << ":" + << std::setfill( '0' ) << std::setw( 2 ) << (mLifeTotalDuration / 60) % 60 + << std::setw( 1 ) << ":" + << std::setfill( '0' ) << std::setw( 2 ) << mLifeTotalDuration % 60; + SetLifeDuration( tmp.str() ); + + // Set the global pointer, used by callbacks + gpCM = this; + + // Initialize command pipe + int ret = pipe( mDeviceDetectionStopPipe ); + if (ret != 0) + { + // Should never happen, but just in case... + return false; + } + + // Begin scanning for devices + ret = pthread_create( &mDeviceDetectionThreadID, + 0, + DeviceDetectionThread, + this ); + if (ret != 0) + { + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Initializes the Gobi API to the current device + +PARAMETERS: + pInterface [ I ] - Interace to connect to + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cSampleCM::Connect( LPCSTR pInterface ) +{ + // Are we already connected to a device? + if (mDeviceID.size() != 0) + { + return eGOBI_ERR_MULTIPLE_DEVICES; + } + + // Connect to the device + ULONG rc = mGobi.Connect( pInterface ); + if (rc != eGOBI_ERR_NONE) + { + TRACE( "GobiConnect error %lu\n", rc ); + return rc; + } + + UpdateDeviceInfo(); + UpdateConnectionInfo(); + + // Any connection at this point is an external connection + UpdateSessionState( true, mSessionState ); + + // Success + mDeviceID = pInterface; + return rc; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Calls GobiDisconnect + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cSampleCM::Disconnect() +{ + // Stop a data session, if present + OnCancelDataSession(); + OnStopDataSession(); + + mGobi.Disconnect(); + + // Reset state + mSessionID = 0xFFFFFFFF; + mInitialState = 0xFFFFFFFF; + mDataBearerTech = 0; + + // Store life total + mLifeTotalDuration += mTotalDuration; + + // Reset all totals + mStartTime = 0; + mPreviousRX = 0; + mPreviousTX = 0; + mTotalRX = 0; + mTotalTX = 0; + mTotalDuration = 0; + + SetState( "No Device" ); + SetRSSI( "Unknown" ); + SetTech( "Unknown" ); + SetRx( "Unknown" ); + SetTx( "Unknown" ); + SetMaxRx( "Unknown" ); + SetMaxTx( "Unknown" ); + SetRoam( "Unknown" ); + SetDuration( "Unknown" ); + SetLifeDuration( "Unknown" ); + SetLifeRx( "Unknown" ); + SetLifeTx( "Unknown" ); + SetManufact( "Unknown" ); + SetModel( "Unknown" ); + SetHardware( "Unknown" ); + SetFirmware( "Unknown" ); + SetMDN( "Unknown" ); + SetMIN( "Unknown" ); + SetESN( "Unknown" ); + SetMEID( "Unknown" ); + SetIMEI( "Unknown" ); + SetIMSI( "Unknown" ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +ETHOD: + OnStartDataSession (Public Method) + +DESCRIPTION: + Starts a data session + +PARAMETERS: + pFailureCode [ O ] - Call failure code, if provided + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cSampleCM::OnStartDataSession( ULONG * pFailureCode ) +{ + mbInitiatedStartDataSession = true; + + // Use provided values, if not empty strings + LPCSTR pAPN = (mAPN.size() == 0) ? 0 : mAPN.c_str(); + LPCSTR pUsername = (mUsername.size() == 0) ? 0 : mUsername.c_str(); + LPCSTR pPassword = (mPassword.size() == 0) ? 0 : mPassword.c_str(); + + ULONG rc = mGobi.StartDataSession( pAPN, + pUsername, + pPassword, + &mSessionID, + pFailureCode ); + if (rc == eGOBI_ERR_NONE) + { + mPreviousRX = 0; + mPreviousTX = 0; + mTotalRX = 0; + mTotalTX = 0; + mTotalDuration = 0; + mStartTime = GetTickCount(); + } + else + { + mbInitiatedStartDataSession = false; + } + + return rc; +} + +/*=========================================================================== +METHOD: + CancelDataSession (Public Method) + +DESCRIPTION: + Cancels an in progress data session request + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cSampleCM::OnCancelDataSession() +{ + return mGobi.CancelDataSession(); +} + +/*=========================================================================== +METHOD: + OnStopDataSession (Public Method) + +DESCRIPTION: + Calls WDSStopNetworkInterface + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cSampleCM::OnStopDataSession() +{ + if (mSessionID == 0xFFFFFFFF) + { + return eGOBI_ERR_GENERAL; + } + + mbInitiatedStopDataSession = true; + mDataBearerTech = 0; + + ULONG rc = mGobi.StopDataSession( mSessionID ); + mSessionID = 0xFFFFFFFF; + + return rc; +} + +/*=========================================================================== +METHOD: + OnSignalStrengthCBNotification (Internal Method) + +DESCRIPTION: + Handle signal strength callback notification + +PARAMETERS: + signalStr [ I ] - Signal strength + radioInterface [ I ] - Radio interface +===========================================================================*/ +void cSampleCM::OnSignalStrengthCBNotificaion( + INT8 signalStr, + ULONG radioInterface ) +{ + // Update mServiceSignals + mServiceSignals[radioInterface] = signalStr; + + if (mSessionState == eQMIConnectionStatus_Connected) + { + mDataBearerTech = 0; + } + + UpdateSignalAndTech(); +} + +/*=========================================================================== +METHOD: + OnSessionStateCBNotification (Internal Method) + +DESCRIPTION: + Handle session state callback notification + +PARAMETERS: + state [ I ] - Session state +===========================================================================*/ +void cSampleCM::OnSessionStateCBNotification( ULONG state ) +{ + // Was the state change triggered externally? + bool bStateChangeExternal = false; + + // Save session state + if (state == eQMIConnectionStatus_Connected) + { + // Started externally + if (mbInitiatedStartDataSession == false) + { + bStateChangeExternal = true; + mStartTime = GetTickCount(); + } + } + else + { + mDataBearerTech = 0; + + // Stopped externally + if (mbInitiatedStopDataSession == false) + { + // Store all life total variables + mLifeTotalDuration += mTotalDuration; + + // Reset all totals + bStateChangeExternal = true; + mStartTime = 0; + mPreviousRX = 0; + mPreviousTX = 0; + mTotalRX = 0; + mTotalTX = 0; + mTotalDuration = 0; + } + } + + // Update the session state + UpdateSessionState( bStateChangeExternal, state ); + + // Update the signal strength and technology + UpdateSignalAndTech(); + + // Reset to false + mbInitiatedStartDataSession = false; + mbInitiatedStopDataSession = false; +} + +/*=========================================================================== +METHOD: + OnDataBearerCBNotification (Internal Method) + +DESCRIPTION: + Handle data bearer callback notification + +PARAMETERS: + dataBearerTech [ I ] - Data bearer technology +===========================================================================*/ +void cSampleCM::OnDataBearerCBNotification( ULONG dataBearerTech ) +{ + if (dataBearerTech != eQMIDataBearerTechnologies_Unknown) + { + mDataBearerTech = dataBearerTech; + UpdateSignalAndTech(); + } +} + +/*=========================================================================== +METHOD: + OnDataCapsNotification (Internal Method) + +DESCRIPTION: + Handle data capabilities callback notification + +PARAMETERS: + numDataCaps [ I ] - Number of data capabilities + pDataCaps [ I ] - Data Capabilites +===========================================================================*/ +void cSampleCM::OnDataCapsNotification( + ULONG numDataCaps, + eQMINASDataServiceCapabilities2 * pDataCaps ) +{ + // Clear saved data capabilities in order to update + mDataCapabilities.clear(); + + // Populate list with new capabilities + for (ULONG c = 0; c < numDataCaps; c++) + { + ULONG dataCaps = pDataCaps[c]; + if ( (dataCaps != 0xFFFFFFFF) + && (dataCaps != 0) ) + { + mDataCapabilities.push_back( pDataCaps[c] ); + } + } + + UpdateSignalAndTech(); +} + +/*=========================================================================== +METHOD: + OnByteTotalsNotification (Internal Method) + +DESCRIPTION: + Handle byte totals callback notification + +PARAMETERS: + rx [ I ] - received bytes + tx [ I ] - transmitted bytes +===========================================================================*/ +void cSampleCM::OnByteTotalsNotification( ULONGLONG rx, ULONGLONG tx ) +{ + mTotalTX = tx; + mTotalRX = rx; +} + +/*=========================================================================== +METHOD: + UpdateSignalAndTech (Public Method) + +DESCRIPTION: + Update the signal strength and technology display +===========================================================================*/ +void cSampleCM::UpdateSignalAndTech() +{ + std::string radioStr = "Unknown"; + std::string ssStr = "Unknown"; + ULONG radioVal = eQMINASRadioInterfaces_NoneNoService; + + // If connected, use data bearer + if (mDataBearerTech != 0) + { + switch (mDataBearerTech) + { + case eQMIDataBearerTechnologies_CDMA20001x: + radioStr = "CDMA 1xRTT"; + radioVal = eQMINASRadioInterfaces_CDMA20001x; + break; + + case eQMIDataBearerTechnologies_CDMA20001xEVDORev0: + radioStr = "CDMA 1xEVDO Rev 0"; + radioVal = eQMINASRadioInterfaces_CDMA2000HRPD; + break; + + case eQMIDataBearerTechnologies_GPRS: + radioStr = "GRPS"; + radioVal = eQMINASRadioInterfaces_GSM; + break; + + case eQMIDataBearerTechnologies_WCDMA: + radioStr = "WCDMA"; + radioVal = eQMINASRadioInterfaces_UMTS; + break; + + case eQMIDataBearerTechnologies_CDMA20001xEVDORevA: + radioStr = "CDMA 1xEVDO Rev A"; + radioVal = eQMINASRadioInterfaces_CDMA2000HRPD; + break; + + case eQMIDataBearerTechnologies_EGPRS: + radioStr = "EDGE"; + radioVal = eQMINASRadioInterfaces_GSM; + break; + + case eQMIDataBearerTechnologies_HSDPAWCDMA: + radioStr = "HSDPA DL, WCDMA UL"; + radioVal = eQMINASRadioInterfaces_UMTS; + break; + + case eQMIDataBearerTechnologies_WCDMAHSUPA: + radioStr = "WCDMA DL, HSUPA UL"; + radioVal = eQMINASRadioInterfaces_UMTS; + break; + + case eQMIDataBearerTechnologies_HSDPAHSUPA: + radioStr = "HSDPA DL, HSUPA UL"; + radioVal = eQMINASRadioInterfaces_UMTS; + break; + + case eQMIDataBearerTechnologies_LTE: + radioStr = "LTE"; + radioVal = eQMINASRadioInterfaces_LTE; + break; + + case eQMIDataBearerTechnologies_CDMA2000EHRPD: + radioStr = "CDMA 1xEVDO eHRPD"; + radioVal = eQMINASRadioInterfaces_CDMA2000HRPD; + break; + + case eQMIDataBearerTechnologies_HSDPAPlusWCDMA: + radioStr = "HSDPA+ DL, WCDMA UL"; + radioVal = eQMINASRadioInterfaces_UMTS; + break; + + case eQMIDataBearerTechnologies_HSDPAPlusHSUPA: + radioStr = "HSDPA+ DL, HSUPA UL"; + radioVal = eQMINASRadioInterfaces_UMTS; + break; + + case eQMIDataBearerTechnologies_DualCellHSDPAPlusWCDMA: + radioStr = "Dual Cell HSDPA+ DL, WCDMA UL"; + radioVal = eQMINASRadioInterfaces_UMTS; + break; + + case eQMIDataBearerTechnologies_DualCellHSDPAPlusHSUPA: + radioStr = "Dual Cell HSDPA+ DL, HSUPA UL"; + radioVal = eQMINASRadioInterfaces_UMTS; + break; + } + + if ( (radioVal != eQMINASRadioInterfaces_NoneNoService) + && (mServiceSignals.find( radioVal ) != mServiceSignals.end()) + && (mServiceSignals[radioVal] != SCHAR_MAX) ) + { + std::ostringstream temp; + temp << (INT)mServiceSignals[radioVal]; + ssStr = temp.str(); + } + } + else + { + // When not connected we have to pick the most preferred data capability + eQMINASDataServiceCapabilities2 mostPreferredCap + = (eQMINASDataServiceCapabilities2)0xff; + std::list ::const_iterator pIter; + std::list ::const_iterator pDataCapsItr; + + pIter = mPreferredServices.begin(); + + bool bDone = false; + while ( (pIter != mPreferredServices.end()) + && (bDone != true) ) + { + pDataCapsItr = mDataCapabilities.begin(); + while (pDataCapsItr != mDataCapabilities.end()) + { + if (*pIter == *pDataCapsItr) + { + mostPreferredCap = (eQMINASDataServiceCapabilities2)*pIter; + bDone = true; + break; + } + + pDataCapsItr++; + } + + pIter++; + } + + // Determine the best radio interface reported + eQMINASRadioInterfaces preferredRadioIf; + preferredRadioIf = eQMINASRadioInterfaces_NoneNoService; + + if (mServiceSignals.find( eQMINASRadioInterfaces_LTE ) != mServiceSignals.end()) + { + preferredRadioIf = eQMINASRadioInterfaces_LTE; + } + else if (mServiceSignals.find( eQMINASRadioInterfaces_CDMA2000HRPD ) != mServiceSignals.end()) + { + preferredRadioIf = eQMINASRadioInterfaces_CDMA2000HRPD; + } + else if (mServiceSignals.find( eQMINASRadioInterfaces_CDMA20001x ) != mServiceSignals.end()) + { + preferredRadioIf = eQMINASRadioInterfaces_CDMA20001x; + } + else if (mServiceSignals.find( eQMINASRadioInterfaces_UMTS ) != mServiceSignals.end()) + { + preferredRadioIf = eQMINASRadioInterfaces_UMTS; + } + else if (mServiceSignals.find( eQMINASRadioInterfaces_GSM ) != mServiceSignals.end()) + { + preferredRadioIf = eQMINASRadioInterfaces_GSM; + } + + radioStr = "Unknown"; + ssStr = "Unknown"; + radioVal = eQMINASRadioInterfaces_NoneNoService; + + // Determine sig strength and radio interface to display based on + // most preferred data capabilities + switch (preferredRadioIf) + { + case eQMINASRadioInterfaces_CDMA2000HRPD: + radioStr = "CDMA 1xEVDO"; + if ( (mostPreferredCap == eQMINASDataServiceCapabilities2_CDMA1xEVDORevB) + || (mostPreferredCap == eQMINASDataServiceCapabilities2_CDMA1xEVDORevA) + || (mostPreferredCap == eQMINASDataServiceCapabilities2_CDMA1xEVDORev0) ) + { + radioVal = eQMINASRadioInterfaces_CDMA2000HRPD; + if ( (mServiceSignals.find( radioVal ) != mServiceSignals.end()) + && (mServiceSignals[radioVal] != SCHAR_MAX) ) + { + std::ostringstream temp; + temp << (INT)mServiceSignals[radioVal]; + ssStr = temp.str(); + } + } + break; + + case eQMINASRadioInterfaces_CDMA20001x: + radioStr = "CDMA 1xRTT"; + if (mostPreferredCap == eQMINASDataServiceCapabilities2_CDMA) + { + radioVal = eQMINASRadioInterfaces_CDMA20001x; + if ( (mServiceSignals.find( radioVal ) != mServiceSignals.end()) + && (mServiceSignals[radioVal] != SCHAR_MAX) ) + { + std::ostringstream temp; + temp << (INT)mServiceSignals[radioVal]; + ssStr = temp.str(); + } + } + break; + + case eQMINASRadioInterfaces_UMTS: + radioStr = "WCDMA"; + if ( (mostPreferredCap == eQMINASDataServiceCapabilities2_DCHSDPAPlus) + || (mostPreferredCap == eQMINASDataServiceCapabilities2_HSDPAPlus) + || (mostPreferredCap == eQMINASDataServiceCapabilities2_HSDPA) + || (mostPreferredCap == eQMINASDataServiceCapabilities2_HSUPA) + || (mostPreferredCap == eQMINASDataServiceCapabilities2_WCDMA) ) + { + radioVal = eQMINASRadioInterfaces_UMTS; + if ( (mServiceSignals.find( radioVal ) != mServiceSignals.end()) + && (mServiceSignals[radioVal] != SCHAR_MAX) ) + { + std::ostringstream temp; + temp << (INT)mServiceSignals[radioVal]; + ssStr = temp.str(); + } + } + break; + + case eQMINASRadioInterfaces_GSM: + radioStr = "GSM"; + if ( (mostPreferredCap == eQMINASDataServiceCapabilities2_GPRS) + || (mostPreferredCap == eQMINASDataServiceCapabilities2_EGPRS) + || (mostPreferredCap == eQMINASDataServiceCapabilities2_GSM) ) + { + radioVal = eQMINASRadioInterfaces_GSM; + if ( (mServiceSignals.find( radioVal ) != mServiceSignals.end()) + && (mServiceSignals[radioVal] != SCHAR_MAX) ) + { + std::ostringstream temp; + temp << (INT)mServiceSignals[radioVal]; + ssStr = temp.str(); + } + } + break; + + case eQMINASRadioInterfaces_LTE: + radioStr = "LTE"; + if (mostPreferredCap == eQMINASDataServiceCapabilities2_LTE) + { + radioVal = eQMINASRadioInterfaces_LTE; + if ( (mServiceSignals.find( radioVal ) != mServiceSignals.end()) + && (mServiceSignals[radioVal] != SCHAR_MAX) ) + { + std::ostringstream temp; + temp << (INT)mServiceSignals[radioVal]; + ssStr = temp.str(); + } + } + break; + + case eQMINASRadioInterfaces_NoneNoService: + if ( (mServiceSignals.find( eQMINASRadioInterfaces_CDMA2000HRPD ) != mServiceSignals.end()) + && (mServiceSignals[eQMINASRadioInterfaces_CDMA2000HRPD] != SCHAR_MAX) ) + { + radioStr = "CDMA 1xEVDO"; + std::ostringstream temp; + temp << (INT)mServiceSignals[eQMINASRadioInterfaces_CDMA2000HRPD]; + ssStr = temp.str(); + } + else if ( (mServiceSignals.find( eQMINASRadioInterfaces_CDMA20001x ) != mServiceSignals.end()) + && (mServiceSignals[eQMINASRadioInterfaces_CDMA20001x] != SCHAR_MAX) ) + { + radioStr = "CDMA 1xRTT"; + std::ostringstream temp; + temp << (INT)mServiceSignals[eQMINASRadioInterfaces_CDMA20001x]; + ssStr = temp.str(); + } + else if ( (mServiceSignals.find( eQMINASRadioInterfaces_UMTS ) != mServiceSignals.end()) + && (mServiceSignals[eQMINASRadioInterfaces_UMTS] != SCHAR_MAX) ) + { + radioStr = "WCDMA"; + std::ostringstream temp; + temp << (INT)mServiceSignals[eQMINASRadioInterfaces_UMTS]; + ssStr = temp.str(); + } + else if ( (mServiceSignals.find( eQMINASRadioInterfaces_GSM ) != mServiceSignals.end()) + && (mServiceSignals[eQMINASRadioInterfaces_GSM] != SCHAR_MAX) ) + { + radioStr = "GSM"; + std::ostringstream temp; + temp << (INT)mServiceSignals[eQMINASRadioInterfaces_GSM]; + ssStr = temp.str(); + } + else if ( (mServiceSignals.find( eQMINASRadioInterfaces_LTE ) != mServiceSignals.end()) + && (mServiceSignals[eQMINASRadioInterfaces_LTE] != SCHAR_MAX) ) + { + radioStr = "LTE"; + std::ostringstream temp; + temp << (INT)mServiceSignals[eQMINASRadioInterfaces_LTE]; + ssStr = temp.str(); + } + break; + + default: + radioStr = "Unknown"; + ssStr = "Unknown"; + } + } + + SetRSSI( ssStr ); + SetTech( radioStr ); +} + +/*=========================================================================== +METHOD: + UpdateSessionState (Public Method) + +DESCRIPTION: + Update the session state display + Start/stop UpdateNetworkInfo thread + +PARAMETERS: + bExternal [ I ] - Was the state change triggered externally + state [ I ] - State of session + +RETURN VALUE: + None +===========================================================================*/ +void cSampleCM::UpdateSessionState( + bool bExternal, + ULONG state ) +{ + mSessionState = state; + + if (bExternal == true) + { + mInitialState = state; + } + + LPCSTR pState = "Unknown"; + switch (state) + { + // Disconnected + case 1: + { + pState = "Disconnected"; + + // Stop the network info thread, if running + if (mUpdateNetworkInfoThreadID != 0) + { + mUpdateNetworkInfoEvent.Set( 0 ); + + pthread_join( mUpdateNetworkInfoThreadID, NULL ); + mUpdateNetworkInfoThreadID = 0; + + mLifeTotalDuration += mTotalDuration; + } + + // Reset all totals + mPreviousRX = 0; + mPreviousTX = 0; + mTotalRX = 0; + mTotalTX = 0; + mTotalDuration = 0; + mStartTime = 0; + + UpdateRateDisplay(); + UpdateTimeDisplay(); + } + break; + + // Connected + case 2: + { + if (bExternal == true) + { + pState = "External Con"; + } + else + { + pState = "Connected"; + } + + // Start the network info thread, if not running + if (mUpdateNetworkInfoThreadID == 0) + { + // Begin updating network info + int rc = pthread_create( &mUpdateNetworkInfoThreadID, + 0, + UpdateNetworkInfoThread, + this ); + if (rc != 0) + { + TRACE( "error starting network info thread\n" ); + } + } + } + break; + + // Suspended + case 3: + pState = "Suspended"; + break; + + // Connecting + case 4: + if (bExternal == true) + { + pState = "Ext Connecting"; + } + else + { + pState = "Connecting"; + } + break; + } + + SetState( pState ); +} + +/*=========================================================================== +METHOD: + UpdateRateDisplay (Public Method) + +DESCRIPTION: + Calculate and update the tx, rx rates being displayed + +PARAMETERS: + None + +RETURN VALUE: + None +===========================================================================*/ +void cSampleCM::UpdateRateDisplay() +{ + // Update TX/RX Bytes + ULONGLONG deltaRX = 0; + ULONGLONG deltaTX = 0; + + // Only update rates if connected + if (mSessionState == eQMIConnectionStatus_Connected) + { + // First time through, don't use the deltas + if (mTotalRX != 0) + { + deltaRX = mTotalRX - mPreviousRX; + } + + if (mTotalTX != 0) + { + deltaTX = mTotalTX - mPreviousTX; + } + + // Update life total byte variables + mLifeTotalRX += deltaRX; + mLifeTotalTX += deltaTX; + + mPreviousRX = mTotalRX; + mPreviousTX = mTotalTX; + } + + std::ostringstream tmp; + tmp << deltaRX; + SetRx( tmp.str() ); + + tmp.str( "" ); + tmp << deltaTX; + SetTx( tmp.str() ); + + tmp.str( "" ); + tmp << mLifeTotalRX; + SetLifeRx( tmp.str() ); + + tmp.str( "" ); + tmp << mLifeTotalTX; + SetLifeTx( tmp.str() ); +} + +/*=========================================================================== +METHOD: + UpdateTimeDisplay (Public Method) + +DESCRIPTION: + Calculate and update the connection time being displayed + +PARAMETERS: + None + +RETURN VALUE: + None +===========================================================================*/ +void cSampleCM::UpdateTimeDisplay() +{ + DWORD elapsedTime = 0; + DWORD lifeTotalTime = 0; + + // Update session duration + if ( (mSessionState == eQMIConnectionStatus_Connected) + && (mStartTime != 0) ) + { + // Convert ms to seconds + mTotalDuration = (GetTickCount() - mStartTime) / 1000; + elapsedTime = (DWORD)mTotalDuration; + lifeTotalTime = (DWORD)(mLifeTotalDuration + mTotalDuration); + } + else + { + elapsedTime = 0; + lifeTotalTime = (DWORD)mLifeTotalDuration; + } + + std::ostringstream timeStr; + + // Format both into hh:mm:ss + // "%02d:%02d:%02d" + timeStr << std::setfill( '0' ) << std::setw( 2 ) << (elapsedTime / 3600) % 60 + << std::setw( 1 ) << ":" + << std::setfill( '0' ) << std::setw( 2 ) << (elapsedTime / 60) % 60 + << std::setw( 1 ) << ":" + << std::setfill( '0' ) << std::setw( 2 ) << elapsedTime % 60; + SetDuration( timeStr.str() ); + + timeStr.str( "" ); + timeStr << std::setfill( '0' ) << std::setw( 2 ) << (lifeTotalTime / 3600) % 60 + << std::setw( 1 ) << ":" + << std::setfill( '0' ) << std::setw( 2 ) << (lifeTotalTime / 60) % 60 + << std::setw( 1 ) << ":" + << std::setfill( '0' ) << std::setw( 2 ) << lifeTotalTime % 60; + SetLifeDuration( timeStr.str() ); +} + +/*=========================================================================== +METHOD: + CheckConnectedStats (Public Method) + +DESCRIPTION: + Check stats which are only valid during a connection +===========================================================================*/ +void cSampleCM::CheckConnectedStats() +{ + ULONG rc = mGobi.GetDataBearerTechnology( &mDataBearerTech ); + if (rc != eGOBI_ERR_NONE || mDataBearerTech == ULONG_MAX) + { + TRACE( "GetDataBearerTechnology error %lu\n", rc ); + return; + } + + ULONGLONG duration; + rc = mGobi.GetSessionDuration( &duration ); + if (rc != eGOBI_ERR_NONE) + { + TRACE( "GetSessionDuration error %lu\n", rc ); + return; + } + + mStartTime = GetTickCount() - duration; + + UpdateSignalAndTech(); +} + +/*=========================================================================== +METHOD: + UpdateDeviceInfo (Public Method) + +DESCRIPTION: + Update the device info stats +===========================================================================*/ +void cSampleCM::UpdateDeviceInfo() +{ + ULONG status = 0; + + BYTE strSz1 = 255; + BYTE strSz2 = 255; + BYTE strSz3 = 255; + CHAR str1[255]; + CHAR str2[255]; + CHAR str3[255]; + str1[0] = 0; + str2[0] = 0; + str3[0] = 0; + + // Get manufacturer + status = mGobi.GetManufacturer( strSz1, str1 ); + if (status != 0) + { + TRACE( "GetManufacturer() = %lu\n", status ); + return; + } + + if (str1[0] != 0) + { + SetManufact( &str1[0] ); + } + + // Get model ID + str1[0] = 0; + status = mGobi.GetModelID( strSz1, str1 ); + if (status != 0) + { + TRACE( "GetModelID() = %lu\n", status ); + return; + } + + if (str1[0] != 0) + { + std::ostringstream tmp; + if (strncmp( "88", &str1[0], 2 ) == 0) + { + tmp << "Gobi MDM-1000"; + } + else if (strncmp( "12", &str1[0], 2 ) == 0) + { + tmp << "Gobi MDM-2000"; + } + else + { + tmp << "Unknown (" << &str1[0] << ")"; + } + + SetModel( tmp.str() ); + } + + // Get firmware revision + str1[0] = 0; + status = mGobi.GetFirmwareRevision( strSz1, str1 ); + if (status != 0) + { + TRACE( "GetFirmwareRevision() = %lu\n", status ); + return; + } + + if (str1[0] != 0) + { + SetFirmware( &str1[0] ); + } + + // Get hardware revision + str1[0] = 0; + status = mGobi.GetHardwareRevision( strSz1, str1 ); + if (status != 0) + { + TRACE( "GetHardwareRevision() = %lu\n", status ); + return; + } + + if (str1[0] != 0) + { + SetHardware( &str1[0] ); + } + + // Get MDN/MIN + str1[0] = 0; + str2[0] = 0; + status = mGobi.GetVoiceNumber( strSz1, str1, strSz2, str2 ); + if (status != 0) + { + if (status == 1016) + { + // Not provisioned + SetMDN( "Not provisioned" ); + SetMIN( "Not provisioned" ); + } + else + { + TRACE( "GetVoiceNumber() = %lu\n", status ); + return; + } + } + + if (str1[0] != 0) + { + SetMDN( &str1[0] ); + } + + if (str2[0] != 0) + { + SetMIN( &str2[0] ); + } + + // Get ESN/IMEI/MEID + str1[0] = 0; + str2[0] = 0; + str3[0] = 0; + status = mGobi.GetSerialNumbers( strSz1, + str1, + strSz2, + str2, + strSz3, + str3 ); + if (status != 0) + { + if (status == 1016) + { + // Not provisioned + SetESN( "Not provisioned" ); + SetIMEI( "Not provisioned" ); + SetMEID( "Not provisioned" ); + } + else + { + TRACE( "GetSerialNumbers() = %lu\n", status ); + return; + } + } + + if (str1[0] != 0) + { + SetESN( &str1[0] ); + } + + if (str2[0] != 0) + { + SetIMEI( &str2[0] ); + } + + if (str3[0] != 0) + { + SetMEID( &str3[0] ); + } + + // Get IMSI + str1[0] = 0; + status = mGobi.GetIMSI( strSz1, str1 ); + if (status != 0) + { + if (status == 1016) + { + // Not provisioned + SetIMSI( "Not provisioned" ); + } + else + { + TRACE( "GetIMSI() = %lu\n", status ); + return; + } + } + + if (str1[0] != 0) + { + SetIMSI( &str1[0] ); + } +} + +/*=========================================================================== +METHOD: + UpdateConnectionInfo (Public Method) + +DESCRIPTION: + Update the connection info stats +===========================================================================*/ +void cSampleCM::UpdateConnectionInfo() +{ + // Re-usable buffer + std::ostringstream tmp; + + // Get session state + ULONG rc = mGobi.GetSessionState( &mSessionState ); + if (rc != eGOBI_ERR_NONE || mSessionState == ULONG_MAX) + { + TRACE( "GetSessionState error %lu\n", rc ); + return; + } + + UpdateSessionState( mSessionID != 0xFFFFFFFF, mSessionState ); + + // If connected, refresh data bearer technology and session duration + if (mSessionState == eQMIConnectionStatus_Connected) + { + CheckConnectedStats(); + } + + INT8 signalStrengths[MAX_SIGNALS]; + ULONG radioInterfaces[MAX_SIGNALS]; + + // Get the signal strengths + rc = mGobi.GetSignalStrengths( &signalStrengths[0], + &radioInterfaces[0] ); + if (rc != eGOBI_ERR_NONE && rc != eGOBI_ERR_NO_SIGNAL) + { + TRACE( "GetSignalStrengths error %lu\n", rc ); + return; + } + + // Map signal strengths to RadioIf types + for (ULONG s = 0; s < MAX_SIGNALS; s++) + { + INT8 signal = signalStrengths[s]; + + switch (radioInterfaces[s]) + { + case eQMINASRadioInterfaces_NoneNoService: + mServiceSignals[eQMINASRadioInterfaces_NoneNoService] = signal; + break; + + case eQMINASRadioInterfaces_CDMA20001x: + mServiceSignals[eQMINASRadioInterfaces_CDMA20001x] = signal; + break; + + case eQMINASRadioInterfaces_CDMA2000HRPD: + mServiceSignals[eQMINASRadioInterfaces_CDMA2000HRPD] = signal; + break; + + case eQMINASRadioInterfaces_AMPS: + mServiceSignals[eQMINASRadioInterfaces_AMPS] = signal; + break; + + case eQMINASRadioInterfaces_GSM: + mServiceSignals[eQMINASRadioInterfaces_GSM] = signal; + break; + + case eQMINASRadioInterfaces_UMTS: + mServiceSignals[eQMINASRadioInterfaces_UMTS] = signal; + break; + + case eQMINASRadioInterfaces_LTE: + mServiceSignals[eQMINASRadioInterfaces_LTE] = signal; + break; + } + } + + ULONG curTX = 0; + ULONG curRX = 0; + ULONG maxTX = 0; + ULONG maxRX = 0; + + // Get the connection rate + rc = mGobi.GetConnectionRate( &curTX, &curRX, &maxTX, &maxRX ); + if (rc != 0) + { + TRACE( "GetConnectionRate error %lu\n", rc ); + return; + } + + // Store the max data rates + tmp.str( "" ); + tmp << maxRX; + SetMaxRx( tmp.str() ); + + tmp.str( "" ); + tmp << maxTX; + SetMaxTx( tmp.str() ); + + + + ULONG dataCapabilities[MAX_DATA_CAPABILITIES]; + WORD srvMCC = 0; + WORD srvMNC = 0; + BYTE srvNameSize = 255; + CHAR srvName[255]; + srvName[0] = 0; + WORD sid = 0; + WORD nid = 0; + ULONG roam = 0; + + // Get the serving network info + rc = mGobi.GetServingNetwork( &dataCapabilities[0], + &srvMCC, + &srvMNC, + srvNameSize, + &srvName[0], + &sid, + &nid, + &roam ); + if (rc != 0) + { + TRACE( "GetServingNetwork error %lu\n", rc ); + return; + } + + // Store data capabilities + for (ULONG c = 0; c < MAX_DATA_CAPABILITIES; c++) + { + if ( (dataCapabilities[c] != ULONG_MAX) + && (dataCapabilities[c] != 0) ) + { + mDataCapabilities.push_back( dataCapabilities[c] ); + } + } + + if (roam == 0xFFFFFFFF) + { + SetRoam( "Unknown" ); + } + else + { + tmp.str( "" ); + tmp << roam; + SetRoam( tmp.str() ); + } + + // Update the signal strength and technology fields + if (mSessionState != eQMIConnectionStatus_Connected) + { + mDataBearerTech = 0; + } + + UpdateSignalAndTech(); + + // Setup callbacks + rc = mGobi.SetWDSEventReportCB( WDSEventReportCallback, 1 ); + if (rc != eGOBI_ERR_NONE) + { + TRACE( "SetWDSEventReportCB error %lu\n", rc ); + return; + } + + rc = mGobi.SetWDSSessionStateCB( WDSSessionStateCallback ); + if (rc != eGOBI_ERR_NONE) + { + TRACE( "SetWDSSessionStateCB error %lu\n", rc ); + return; + } + + BYTE thresSz = 5; + INT8 thres[5] = {-90, -85, -80, -75, -70}; + rc = mGobi.SetNASEventReportCB( NASEventReportCallback, + thresSz, + &thres[0] ); + if (rc != eGOBI_ERR_NONE) + { + TRACE( "SetNASEventReportCB error %lu\n", rc ); + return; + } + + rc = mGobi.SetNASServingSystemCB( NASServingSystemCallback ); + if (rc != eGOBI_ERR_NONE) + { + TRACE( "SetNASServingSystemCB error %lu\n", rc ); + return; + } +} diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/SampleCM.h b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/SampleCM.h new file mode 100755 index 0000000..87ec14a --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/SampleCM.h @@ -0,0 +1,398 @@ +/*=========================================================================== +FILE: + SampleCM.h + +DESCRIPTION: + Generic class to act as Sample CM interface + +PUBLIC CLASSES AND METHODS: + cSampleCM + Generic class to act as Sample CM interface + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiCMDLL.h" +#include "Event.h" + +#include +#include +#include + +// Prototypes +void * DeviceDetectionThread( void * pData ); +void * UpdateNetworkInfo( void * pData ); + +// A global pointer to the CM, used by the callbacks +extern class cSampleCM * gpCM; + +/*=========================================================================*/ +// Class cSampleCM +/*=========================================================================*/ +class cSampleCM +{ + public: + // Constructor + cSampleCM() + : mDeviceID(), + mSessionState( 0 ), + mSessionID( 0xFFFFFFFF ), + mInitialState( 0xFFFFFFFF ), + mStartTime( 0 ), + mPreviousRX( 0 ), + mPreviousTX( 0 ), + mTotalRX( 0 ), + mTotalTX( 0 ), + mLifeTotalRX( 0 ), + mLifeTotalTX( 0 ), + mCurrentDuration( 0 ), + mTotalDuration( 0 ), + mLifeTotalDuration( 0 ), + mbInitiatedStartDataSession( false ), + mbInitiatedStopDataSession( false ), + mDataBearerTech( eQMIDataBearerTechnologies_Unknown ), + mDeviceDetectionThreadID( 0 ), + mUpdateNetworkInfoThreadID( 0 ) + { + mDeviceDetectionStopPipe[READING] = -1; + mDeviceDetectionStopPipe[WRITING] = -1; + + // Create an ordered list of service preferences + mPreferredServices.push_back( eQMINASDataServiceCapabilities2_CDMA1xEVDORevB ); + mPreferredServices.push_back( eQMINASDataServiceCapabilities2_CDMA1xEVDORevA ); + mPreferredServices.push_back( eQMINASDataServiceCapabilities2_CDMA1xEVDORev0 ); + mPreferredServices.push_back( eQMINASDataServiceCapabilities2_CDMA ); + mPreferredServices.push_back( eQMINASDataServiceCapabilities2_DCHSDPAPlus ); + mPreferredServices.push_back( eQMINASDataServiceCapabilities2_HSDPAPlus ); + mPreferredServices.push_back( eQMINASDataServiceCapabilities2_HSDPA ); + mPreferredServices.push_back( eQMINASDataServiceCapabilities2_WCDMA ); + mPreferredServices.push_back( eQMINASDataServiceCapabilities2_EGPRS ); + mPreferredServices.push_back( eQMINASDataServiceCapabilities2_GPRS ); + mPreferredServices.push_back( eQMINASDataServiceCapabilities2_GSM ); + } + + // Destructor + ~cSampleCM(); + + // Initialize UI, begin waiting for devices + virtual bool Init(); + + // Connect to a device and send initial callback registrations + virtual ULONG Connect( LPCSTR pInterface ); + + // Disconnect from a device and set members as "Unknown" + virtual ULONG Disconnect(); + + // Process a start data session request + virtual ULONG OnStartDataSession( ULONG * pFailureCode ); + + // Process a cancel data session request + virtual ULONG OnCancelDataSession(); + + // Process a stop data session request + virtual ULONG OnStopDataSession(); + + // Set mState + virtual void SetState( const std::string & state ) + { + mState = state; + } + + // Set mRSSI + virtual void SetRSSI( const std::string & rssi ) + { + mRSSI = rssi; + } + + // Set mTech + virtual void SetTech( const std::string & tech ) + { + mTech = tech; + } + + // Set mRx + virtual void SetRx( const std::string & rx ) + { + mRx = rx; + } + + // Set mTx + virtual void SetTx( const std::string & tx ) + { + mTx = tx; + } + + // Set mMaxRx + virtual void SetMaxRx( const std::string & maxRx ) + { + mMaxRx = maxRx; + } + + // Set mMaxTx + virtual void SetMaxTx( const std::string & maxTx ) + { + mMaxTx = maxTx; + } + + // Set mRoam + virtual void SetRoam( const std::string & roam ) + { + mRoam = roam; + } + + // Set mDuration + virtual void SetDuration( const std::string & duration ) + { + mDuration = duration; + } + + // Set mLifeDuration + virtual void SetLifeDuration( const std::string & lifeDuration ) + { + mLifeDuration = lifeDuration; + } + + // Set mLifeRx + virtual void SetLifeRx( const std::string & lifeRx ) + { + mLifeRx = lifeRx; + } + + // Set mLifeTx + virtual void SetLifeTx( const std::string & lifeTx ) + { + mLifeTx = lifeTx; + } + + // Set mManufact + virtual void SetManufact( const std::string & manufact ) + { + mManufact = manufact; + } + + // Set mModel + virtual void SetModel( const std::string & model ) + { + mModel = model; + } + + // Set mHardware + virtual void SetHardware( const std::string & hardware ) + { + mHardware = hardware; + } + + // Set mFirmware + virtual void SetFirmware( const std::string & firmware ) + { + mFirmware = firmware; + } + + // Set mMDN + virtual void SetMDN( const std::string & mdn ) + { + mMDN = mdn; + } + + // Set mMIN + virtual void SetMIN( const std::string & min ) + { + mMIN = min; + } + + // Set mESN + virtual void SetESN( const std::string & esn ) + { + mESN = esn; + } + + // Set mMEID + virtual void SetMEID( const std::string & meid ) + { + mMEID = meid; + } + + // Set mIMEI + virtual void SetIMEI( const std::string & imei ) + { + mIMEI = imei; + } + + // Set mIMSI + virtual void SetIMSI( const std::string & imsi ) + { + mIMSI = imsi; + } + + // Handle signal strength callback notification + void OnSignalStrengthCBNotificaion( + INT8 signalStr, + ULONG radioInterface ); + + // Handle session state callback notification + void OnSessionStateCBNotification( ULONG state ); + + // Handle data bearer callback notification + void OnDataBearerCBNotification( ULONG dataBearerTech ); + + // Handle data capabilities callback notification + void OnDataCapsNotification( + ULONG numDataCaps, + eQMINASDataServiceCapabilities2 * pDataCaps ); + + // Handle byte totals callback notification + void OnByteTotalsNotification( ULONGLONG rx, ULONGLONG tx ); + + // Update the signal strength and technology + void UpdateSignalAndTech(); + + // Update the session state + void UpdateSessionState( + bool bExternal, + ULONG state ); + + // Calculate and update the connection time being displayed + void UpdateTimeDisplay(); + + // Calculate and update the tx and rx rates being displayed + void UpdateRateDisplay(); + + // Check data bearer and duration, which are only available while + // connected + void CheckConnectedStats(); + + // Update the device info stats + void UpdateDeviceInfo(); + + // Update the Connection Stats + void UpdateConnectionInfo(); + + protected: + + /* Class for interfacing with Gobi API */ + cGobiCMDLL mGobi; + + /* Connected device's ID */ + std::string mDeviceID; + + /* All the display elements */ + std::string mState; + std::string mRSSI; + std::string mTech; + std::string mRx; + std::string mTx; + std::string mMaxRx; + std::string mMaxTx; + std::string mRoam; + std::string mDuration; + std::string mLifeDuration; + std::string mLifeRx; + std::string mLifeTx; + std::string mManufact; + std::string mModel; + std::string mHardware; + std::string mFirmware; + std::string mMDN; + std::string mMIN; + std::string mESN; + std::string mMEID; + std::string mIMEI; + std::string mIMSI; + + /* All the input elements */ + std::string mAPN; + std::string mUsername; + std::string mPassword; + + /* Session state */ + ULONG mSessionState; + + /* Data session ID */ + ULONG mSessionID; + + /* Initial state, used to determine if the connection + was initiated internally or externally */ + ULONG mInitialState; + + /* Preferred service order */ + std::list mPreferredServices; + + /* Stores the time that connection was started */ + ULONGLONG mStartTime; + + /* Stores the connection rates updated by callbacks */ + ULONGLONG mPreviousRX; + ULONGLONG mPreviousTX; + ULONGLONG mTotalRX; + ULONGLONG mTotalTX; + ULONGLONG mLifeTotalRX; + ULONGLONG mLifeTotalTX; + + // Current and total durations + ULONGLONG mCurrentDuration; + ULONGLONG mTotalDuration; + ULONGLONG mLifeTotalDuration; + + /* Did we initiate a start data session? */ + bool mbInitiatedStartDataSession; + + /* Did we initiate a stop data session? */ + bool mbInitiatedStopDataSession; + + /* Current signal map */ + std::map mServiceSignals; + + /* Current data bearer technology */ + ULONG mDataBearerTech; + + /* Current data capabilities */ + std::list mDataCapabilities; + + /* Handle to the device detection thread */ + pthread_t mDeviceDetectionThreadID; + int mDeviceDetectionStopPipe[2]; + + // Device detection "thread" + friend void * DeviceDetectionThread( void * pData ); + + /* Handle to the UpdateNetworkInfo thread */ + pthread_t mUpdateNetworkInfoThreadID; + cEvent mUpdateNetworkInfoEvent; + + // Async Network info updater + friend void * UpdateNetworkInfoThread( void * pData ); +}; diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/Connect.png b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/Connect.png new file mode 100755 index 0000000..d8f9c3a Binary files /dev/null and b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/Connect.png differ diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/Info.png b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/Info.png new file mode 100755 index 0000000..436939c Binary files /dev/null and b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/Info.png differ diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/main.qml b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/main.qml new file mode 100755 index 0000000..70308ba --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/assets/qml/GobiSampleCM/main.qml @@ -0,0 +1,823 @@ +/*=========================================================================== +FILE: + main.qml + +DESCRIPTION: + Graphic meta description for Gobi Sample CM + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +import QtQuick 1.0 + +Rectangle +{ + id: mainWindow + width: 360 + height: 360 + color: "#000000" + state: windowState + + // This window is not stretched to fullscreen + // which is what we want to demonstrate for now + Rectangle + { + width: 360 + height: 360 + color: "#ffffff" + + // The box on the left hand side of the screen + Rectangle + { + x: 15 + y: 15 + width: 80 + height: 330 + color: "#ffffff" + anchors.left: parent.left + anchors.leftMargin: 15 + anchors.verticalCenter: parent.verticalCenter + border.width: 2 + border.color: "#000000" + + // The connection stats button + Rectangle + { + id: connectIcon + width: 60 + height: 70 + color: "#ffffff" + anchors.top: parent.top + anchors.topMargin: 10 + anchors.horizontalCenter: parent.horizontalCenter + + Image + { + width: 50 + height: 50 + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: 5 + source: "Connect.png" + } + + Text + { + text: "Connection" + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + horizontalAlignment: Text.AlignHCenter + font.pixelSize: 9 + } + + MouseArea + { + id: connectionsButtonArea + anchors.fill: parent + onClicked: + { + connectionsButton.Click() + } + } + } + + // The info stats button + Rectangle + { + id: infoIcon + x: 10 + y: 90 + width: 60 + height: 70 + color: "#ffffff" + anchors.horizontalCenter: parent.horizontalCenter + + Image + { + width: 50 + height: 50 + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: 5 + source: "Info.png" + } + + Text + { + text: "Information" + font.pixelSize: 9 + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + horizontalAlignment: Text.AlignHCenter + } + + MouseArea + { + id: infosButtonArea + anchors.fill: parent + onClicked: + { + infosButton.Click() + } + } + } + } + + // The "connect" button + Rectangle + { + id: connectionButtonID + x: 240 + y: 10 + width: 100 + height: 30 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + + Text + { + text: connectButtonText + font.pixelSize: 16 + anchors.fill: parent + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + + MouseArea + { + anchors.fill: parent + onClicked: + { + connectButton.Click() + } + } + } + } + + // Map a property ID to its human readable text + function getName( propID ) + { + if (propID == "status") + { + return "State" + } + + if (propID == "rssi") + { + return "RSSI (db)" + } + + if (propID == "tech") + { + return "Technology" + } + + if (propID == "rx") + { + return "Current RX Rate (bps)" + } + + if (propID == "tx") + { + return "Current TX Rate (bps)" + } + + if (propID == "maxRx") + { + return "Maximum RX Rate (bps)" + } + + if (propID == "maxTx") + { + return "Maximum TX Rate (bps)" + } + + if (propID == "roam") + { + return "Roaming Indicator" + } + + if (propID == "duration") + { + return "Connection Duration" + } + + if (propID == "lifeDuration") + { + return "Life Total Connection Duration" + } + + if (propID == "lifeRx") + { + return "Life Total RX Bytes" + } + + if (propID == "lifeTx") + { + return "Life Total TX Bytes" + } + + if (propID == "manufact") + { + return "Manufacturer" + } + + if (propID == "model") + { + return "Model ID" + } + + if (propID == "hardware") + { + return "Hardware Revision" + } + + if (propID == "firmware") + { + return "Firmware Revision" + } + + if (propID == "mdn") + { + return "MDN" + } + + if (propID == "min") + { + return "MIN" + } + + if (propID == "esn") + { + return "ESN" + } + + if (propID == "meid") + { + return "MEID" + } + + if (propID == "imei") + { + return "IMEI" + } + + if (propID == "imsi") + { + return "IMSI" + } + + return "Bad PropID" + } + + // Map a property ID to its variable + function getValue( propID ) + { + if (propID == "status") + { + return status + } + + if (propID == "rssi") + { + return rssi + } + + if (propID == "tech") + { + return tech + } + + if (propID == "rx") + { + return rx + } + + if (propID == "tx") + { + return tx + } + + if (propID == "maxRx") + { + return maxRx + } + + if (propID == "maxTx") + { + return maxTx + } + + if (propID == "roam") + { + return roam + } + + if (propID == "duration") + { + return duration + } + + if (propID == "lifeDuration") + { + return lifeDuration + } + + if (propID == "lifeRx") + { + return lifeRx + } + + if (propID == "lifeTx") + { + return lifeTx + } + + if (propID == "manufact") + { + return manufact + } + + if (propID == "model") + { + return model + } + + if (propID == "hardware") + { + return hardware + } + + if (propID == "firmware") + { + return firmware + } + + if (propID == "mdn") + { + return mdn + } + + if (propID == "min") + { + return min + } + + if (propID == "esn") + { + return esn + } + + if (propID == "meid") + { + return meid + } + + if (propID == "imei") + { + return imei + } + + if (propID == "imsi") + { + return imsi + } + + return "Bad PropID" + } + + // Connection statistics list + Rectangle + { + id: connectionStatistics + x: 110 + y: 50 + width: 230 + height: 180 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + + ListView + { + anchors.fill: parent + delegate: Item + { + x: 5 + height: 15 + Row + { + id: connectionStatistic + spacing: 10 + + // PropID is a unique identification string + // used to generate a human readable string and + // link to variable + property string propID: "unknown" + + Text + { + text: getName( propID ) + width: 150 + font.pixelSize: 10 + horizontalAlignment: Text.AlignLeft + font.bold: true + } + + Text + { + text: getValue( propID ) + width: 80 + font.pixelSize: 10 + horizontalAlignment: Text.AlignLeft + } + } + } + + model: ListModel + { + id: connectionStats + ListElement { propID: "status" } + ListElement { propID: "rssi" } + ListElement { propID: "tech" } + ListElement { propID: "rx" } + ListElement { propID: "tx" } + ListElement { propID: "maxRx" } + ListElement { propID: "maxTx" } + ListElement { propID: "roam" } + ListElement { propID: "duration" } + ListElement { propID: "lifeDuration" } + ListElement { propID: "lifeRx" } + ListElement { propID: "lifeTx" } + } + } + } + + // Info statistics list + Rectangle + { + id: infos + x: 110 + y: 50 + width: 230 + height: 180 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + visible: false + + ListView + { + anchors.fill: parent + delegate: Item + { + x: 5 + height: 15 + Row + { + id: info + spacing: 10 + + // PropID is a unique identification string + // used to generate a human readable string and + // link to variable + property string propID: "unknown" + + Text + { + text: getName( propID ) + width: 100 + font.pixelSize: 10 + horizontalAlignment: Text.AlignLeft + font.bold: true + } + + Text + { + text: getValue( propID ) + width: 120 + font.pixelSize: 10 + horizontalAlignment: Text.AlignLeft + } + } + } + + model: ListModel + { + ListElement { propID: "manufact" } + ListElement { propID: "model" } + ListElement { propID: "hardware" } + ListElement { propID: "firmware" } + ListElement { propID: "mdn" } + ListElement { propID: "min" } + ListElement { propID: "esn" } + ListElement { propID: "meid" } + ListElement { propID: "imei" } + ListElement { propID: "imsi" } + } + } + } + + // The close button + Rectangle + { + x: 280 + y: 315 + width: 60 + height: 30 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + + Text + { + anchors.fill: parent + text: "Close" + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + font.pixelSize: 16 + } + + MouseArea + { + anchors.fill: parent + onClicked: + { + Qt.quit(); + } + } + } + + Text + { + id: apnTextID + x: 110 + y: 246 + width: 73 + height: 20 + text: "APN" + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignRight + font.pixelSize: 12 + } + + Text + { + id: usernameTextID + x: 110 + y: 266 + width: 73 + height: 20 + text: "Username" + font.pixelSize: 12 + horizontalAlignment: Text.AlignRight + verticalAlignment: Text.AlignVCenter + } + + Text + { + id: passwordTextID + x: 110 + y: 286 + width: 73 + height: 20 + text: "Password" + font.pixelSize: 12 + horizontalAlignment: Text.AlignRight + verticalAlignment: Text.AlignVCenter + } + + // The APN text box + Rectangle + { + id: apnTextBoxID + x: 190 + y: 246 + width: 150 + height: 20 + color: "#ffffff" + border.width: 2 + border.color: "#000000" + + TextInput + { + anchors.fill: parent + id: apnName + font.pixelSize: 12 + } + + Binding + { + target: apnNameText + property: "text" + value: apnName.text + } + } + + // The Username text box + Rectangle + { + id: usernameTextBoxID + x: 190 + y: 266 + width: 150 + height: 20 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + + TextInput + { + anchors.fill: parent + id: username + font.pixelSize: 12 + } + + Binding + { + target: usernameText + property: "text" + value: username.text + } + } + + // Password text box + Rectangle + { + id: passwordTextBoxID + x: 190 + y: 286 + width: 150 + height: 20 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + + TextInput + { + anchors.fill: parent + id: password + font.pixelSize: 12 + } + + Binding + { + target: passwordText + property: "text" + value: password.text + } + } + + // Dialog window to be shown + Rectangle + { + id: connectingDialog + x: 55 + y: 105 + width: 250 + height: 150 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + z: 1 + visible: false + + Text + { + id: connectingDialogText + text: dialogText + horizontalAlignment: Text.AlignHCenter + anchors.top: parent.top + anchors.topMargin: 30 + anchors.horizontalCenter: parent.horizontalCenter + font.pixelSize: 12 + } + } + + // State transitions + states: + [ + // Info state, shown when info button is clicked + State + { + name: "infos" + + PropertyChanges + { + target: connectionButtonID + visible: false + } + + PropertyChanges + { + target: apnTextID + visible: false + } + + PropertyChanges + { + target: usernameTextID + visible: false + } + + PropertyChanges + { + target: passwordTextID + visible: false + } + + PropertyChanges + { + target: apnTextBoxID + visible: false + } + + PropertyChanges + { + target: usernameTextBoxID + visible: false + } + + PropertyChanges + { + target: passwordTextBoxID + visible: false + } + + PropertyChanges + { + target: connectionStatistics + visible: false + } + + PropertyChanges + { + target: infos + visible: true + } + + PropertyChanges + { + target: connectingDialog + visible: false + } + }, + + // Connecting Dialog state, shown when connecting + State + { + name: "connectingDialog" + + PropertyChanges + { + target: connectingDialog + visible: true + } + + // Disable the "info stats" button while the connection dialog is up + PropertyChanges + { + target: infosButtonArea + visible: false + } + + // Disable the "connection stats" button while the connection + // dialog is up + PropertyChanges + { + target: connectionsButtonArea + visible: false + } + } + ] +} + + diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/res/drawable/icon.png b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/res/drawable/icon.png new file mode 100755 index 0000000..59ae147 Binary files /dev/null and b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/res/drawable/icon.png differ diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/res/drawable/logo.png b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/res/drawable/logo.png new file mode 100755 index 0000000..8366c4f Binary files /dev/null and b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/android/res/drawable/logo.png differ diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/main.cpp b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/main.cpp new file mode 100755 index 0000000..893dedd --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/main.cpp @@ -0,0 +1,45 @@ +/*=========================================================================== +FILE: + main.cpp + +DESCRIPTION: + Entry point to the Gobi Sample CM + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +#include "QTSampleCM.h" + +Q_DECL_EXPORT int main( int argc, char ** argv ) +{ + cQTSampleCM cm( argc, argv ); + cm.Init(); + + // This function blocks until the app closes + return cm.Run(); +} diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/Connect.png b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/Connect.png new file mode 100755 index 0000000..d8f9c3a Binary files /dev/null and b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/Connect.png differ diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/Info.png b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/Info.png new file mode 100755 index 0000000..436939c Binary files /dev/null and b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/Info.png differ diff --git a/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/main.qml b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/main.qml new file mode 100755 index 0000000..70308ba --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/GobiSampleCM/qml/GobiSampleCM/main.qml @@ -0,0 +1,823 @@ +/*=========================================================================== +FILE: + main.qml + +DESCRIPTION: + Graphic meta description for Gobi Sample CM + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +import QtQuick 1.0 + +Rectangle +{ + id: mainWindow + width: 360 + height: 360 + color: "#000000" + state: windowState + + // This window is not stretched to fullscreen + // which is what we want to demonstrate for now + Rectangle + { + width: 360 + height: 360 + color: "#ffffff" + + // The box on the left hand side of the screen + Rectangle + { + x: 15 + y: 15 + width: 80 + height: 330 + color: "#ffffff" + anchors.left: parent.left + anchors.leftMargin: 15 + anchors.verticalCenter: parent.verticalCenter + border.width: 2 + border.color: "#000000" + + // The connection stats button + Rectangle + { + id: connectIcon + width: 60 + height: 70 + color: "#ffffff" + anchors.top: parent.top + anchors.topMargin: 10 + anchors.horizontalCenter: parent.horizontalCenter + + Image + { + width: 50 + height: 50 + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: 5 + source: "Connect.png" + } + + Text + { + text: "Connection" + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + horizontalAlignment: Text.AlignHCenter + font.pixelSize: 9 + } + + MouseArea + { + id: connectionsButtonArea + anchors.fill: parent + onClicked: + { + connectionsButton.Click() + } + } + } + + // The info stats button + Rectangle + { + id: infoIcon + x: 10 + y: 90 + width: 60 + height: 70 + color: "#ffffff" + anchors.horizontalCenter: parent.horizontalCenter + + Image + { + width: 50 + height: 50 + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: 5 + source: "Info.png" + } + + Text + { + text: "Information" + font.pixelSize: 9 + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + horizontalAlignment: Text.AlignHCenter + } + + MouseArea + { + id: infosButtonArea + anchors.fill: parent + onClicked: + { + infosButton.Click() + } + } + } + } + + // The "connect" button + Rectangle + { + id: connectionButtonID + x: 240 + y: 10 + width: 100 + height: 30 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + + Text + { + text: connectButtonText + font.pixelSize: 16 + anchors.fill: parent + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + + MouseArea + { + anchors.fill: parent + onClicked: + { + connectButton.Click() + } + } + } + } + + // Map a property ID to its human readable text + function getName( propID ) + { + if (propID == "status") + { + return "State" + } + + if (propID == "rssi") + { + return "RSSI (db)" + } + + if (propID == "tech") + { + return "Technology" + } + + if (propID == "rx") + { + return "Current RX Rate (bps)" + } + + if (propID == "tx") + { + return "Current TX Rate (bps)" + } + + if (propID == "maxRx") + { + return "Maximum RX Rate (bps)" + } + + if (propID == "maxTx") + { + return "Maximum TX Rate (bps)" + } + + if (propID == "roam") + { + return "Roaming Indicator" + } + + if (propID == "duration") + { + return "Connection Duration" + } + + if (propID == "lifeDuration") + { + return "Life Total Connection Duration" + } + + if (propID == "lifeRx") + { + return "Life Total RX Bytes" + } + + if (propID == "lifeTx") + { + return "Life Total TX Bytes" + } + + if (propID == "manufact") + { + return "Manufacturer" + } + + if (propID == "model") + { + return "Model ID" + } + + if (propID == "hardware") + { + return "Hardware Revision" + } + + if (propID == "firmware") + { + return "Firmware Revision" + } + + if (propID == "mdn") + { + return "MDN" + } + + if (propID == "min") + { + return "MIN" + } + + if (propID == "esn") + { + return "ESN" + } + + if (propID == "meid") + { + return "MEID" + } + + if (propID == "imei") + { + return "IMEI" + } + + if (propID == "imsi") + { + return "IMSI" + } + + return "Bad PropID" + } + + // Map a property ID to its variable + function getValue( propID ) + { + if (propID == "status") + { + return status + } + + if (propID == "rssi") + { + return rssi + } + + if (propID == "tech") + { + return tech + } + + if (propID == "rx") + { + return rx + } + + if (propID == "tx") + { + return tx + } + + if (propID == "maxRx") + { + return maxRx + } + + if (propID == "maxTx") + { + return maxTx + } + + if (propID == "roam") + { + return roam + } + + if (propID == "duration") + { + return duration + } + + if (propID == "lifeDuration") + { + return lifeDuration + } + + if (propID == "lifeRx") + { + return lifeRx + } + + if (propID == "lifeTx") + { + return lifeTx + } + + if (propID == "manufact") + { + return manufact + } + + if (propID == "model") + { + return model + } + + if (propID == "hardware") + { + return hardware + } + + if (propID == "firmware") + { + return firmware + } + + if (propID == "mdn") + { + return mdn + } + + if (propID == "min") + { + return min + } + + if (propID == "esn") + { + return esn + } + + if (propID == "meid") + { + return meid + } + + if (propID == "imei") + { + return imei + } + + if (propID == "imsi") + { + return imsi + } + + return "Bad PropID" + } + + // Connection statistics list + Rectangle + { + id: connectionStatistics + x: 110 + y: 50 + width: 230 + height: 180 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + + ListView + { + anchors.fill: parent + delegate: Item + { + x: 5 + height: 15 + Row + { + id: connectionStatistic + spacing: 10 + + // PropID is a unique identification string + // used to generate a human readable string and + // link to variable + property string propID: "unknown" + + Text + { + text: getName( propID ) + width: 150 + font.pixelSize: 10 + horizontalAlignment: Text.AlignLeft + font.bold: true + } + + Text + { + text: getValue( propID ) + width: 80 + font.pixelSize: 10 + horizontalAlignment: Text.AlignLeft + } + } + } + + model: ListModel + { + id: connectionStats + ListElement { propID: "status" } + ListElement { propID: "rssi" } + ListElement { propID: "tech" } + ListElement { propID: "rx" } + ListElement { propID: "tx" } + ListElement { propID: "maxRx" } + ListElement { propID: "maxTx" } + ListElement { propID: "roam" } + ListElement { propID: "duration" } + ListElement { propID: "lifeDuration" } + ListElement { propID: "lifeRx" } + ListElement { propID: "lifeTx" } + } + } + } + + // Info statistics list + Rectangle + { + id: infos + x: 110 + y: 50 + width: 230 + height: 180 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + visible: false + + ListView + { + anchors.fill: parent + delegate: Item + { + x: 5 + height: 15 + Row + { + id: info + spacing: 10 + + // PropID is a unique identification string + // used to generate a human readable string and + // link to variable + property string propID: "unknown" + + Text + { + text: getName( propID ) + width: 100 + font.pixelSize: 10 + horizontalAlignment: Text.AlignLeft + font.bold: true + } + + Text + { + text: getValue( propID ) + width: 120 + font.pixelSize: 10 + horizontalAlignment: Text.AlignLeft + } + } + } + + model: ListModel + { + ListElement { propID: "manufact" } + ListElement { propID: "model" } + ListElement { propID: "hardware" } + ListElement { propID: "firmware" } + ListElement { propID: "mdn" } + ListElement { propID: "min" } + ListElement { propID: "esn" } + ListElement { propID: "meid" } + ListElement { propID: "imei" } + ListElement { propID: "imsi" } + } + } + } + + // The close button + Rectangle + { + x: 280 + y: 315 + width: 60 + height: 30 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + + Text + { + anchors.fill: parent + text: "Close" + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + font.pixelSize: 16 + } + + MouseArea + { + anchors.fill: parent + onClicked: + { + Qt.quit(); + } + } + } + + Text + { + id: apnTextID + x: 110 + y: 246 + width: 73 + height: 20 + text: "APN" + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignRight + font.pixelSize: 12 + } + + Text + { + id: usernameTextID + x: 110 + y: 266 + width: 73 + height: 20 + text: "Username" + font.pixelSize: 12 + horizontalAlignment: Text.AlignRight + verticalAlignment: Text.AlignVCenter + } + + Text + { + id: passwordTextID + x: 110 + y: 286 + width: 73 + height: 20 + text: "Password" + font.pixelSize: 12 + horizontalAlignment: Text.AlignRight + verticalAlignment: Text.AlignVCenter + } + + // The APN text box + Rectangle + { + id: apnTextBoxID + x: 190 + y: 246 + width: 150 + height: 20 + color: "#ffffff" + border.width: 2 + border.color: "#000000" + + TextInput + { + anchors.fill: parent + id: apnName + font.pixelSize: 12 + } + + Binding + { + target: apnNameText + property: "text" + value: apnName.text + } + } + + // The Username text box + Rectangle + { + id: usernameTextBoxID + x: 190 + y: 266 + width: 150 + height: 20 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + + TextInput + { + anchors.fill: parent + id: username + font.pixelSize: 12 + } + + Binding + { + target: usernameText + property: "text" + value: username.text + } + } + + // Password text box + Rectangle + { + id: passwordTextBoxID + x: 190 + y: 286 + width: 150 + height: 20 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + + TextInput + { + anchors.fill: parent + id: password + font.pixelSize: 12 + } + + Binding + { + target: passwordText + property: "text" + value: password.text + } + } + + // Dialog window to be shown + Rectangle + { + id: connectingDialog + x: 55 + y: 105 + width: 250 + height: 150 + color: "#ffffff" + border.color: "#000000" + border.width: 2 + z: 1 + visible: false + + Text + { + id: connectingDialogText + text: dialogText + horizontalAlignment: Text.AlignHCenter + anchors.top: parent.top + anchors.topMargin: 30 + anchors.horizontalCenter: parent.horizontalCenter + font.pixelSize: 12 + } + } + + // State transitions + states: + [ + // Info state, shown when info button is clicked + State + { + name: "infos" + + PropertyChanges + { + target: connectionButtonID + visible: false + } + + PropertyChanges + { + target: apnTextID + visible: false + } + + PropertyChanges + { + target: usernameTextID + visible: false + } + + PropertyChanges + { + target: passwordTextID + visible: false + } + + PropertyChanges + { + target: apnTextBoxID + visible: false + } + + PropertyChanges + { + target: usernameTextBoxID + visible: false + } + + PropertyChanges + { + target: passwordTextBoxID + visible: false + } + + PropertyChanges + { + target: connectionStatistics + visible: false + } + + PropertyChanges + { + target: infos + visible: true + } + + PropertyChanges + { + target: connectingDialog + visible: false + } + }, + + // Connecting Dialog state, shown when connecting + State + { + name: "connectingDialog" + + PropertyChanges + { + target: connectingDialog + visible: true + } + + // Disable the "info stats" button while the connection dialog is up + PropertyChanges + { + target: infosButtonArea + visible: false + } + + // Disable the "connection stats" button while the connection + // dialog is up + PropertyChanges + { + target: connectionsButtonArea + visible: false + } + } + ] +} + + diff --git a/gobi-api/Gobi_2012-06-18-1054/Readme.txt b/gobi-api/Gobi_2012-06-18-1054/Readme.txt new file mode 100755 index 0000000..41a4e2b --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Readme.txt @@ -0,0 +1,69 @@ +Gobi Extensible API 2012-06-18-1054 + +This readme covers important information concerning +the Gobi Extensible API. + +Table of Contents + +1. What's new in this release +2. Known issues +3. Build steps + +------------------------------------------------------------------------------- + +1. WHAT'S NEW + +This Release (Gobi Extensible API 2012-06-18-1054) +a. Added support for SMD devices +b. Updated API reflect the following QMI ICDs: + AUTH ICD Rev. B (80-VB816-21) + CAT ICD Rev. L (80-VB816-11) + DMS ICD Rev. N (80-VB816-4) + LOC ICD Rev. F (80-VB816-17) + NAS ICD Rev. YA (80-VB816-6) + PBM ICD Rev. H (80-VB816-15) + PDS ICD Rev. N (80-VB816-8) + UIM ICD Rev. V (80-VB816-12) + Voice ICD Rev. L (80-VB816-10) + WDS ICD Rev. YA (80-VB816-5) + WMS ICD Rev. H (80-VB816-9) + Addendum ICD Rev. C (80-VK268-3) + +Prior Release (Gobi Extensible API 2012-01-12-1106) +a. Addition of Gobi Sample CM (documentation is on QDevNet - + the use of this me be subject to additional license terms) +b. Updated API reflect the following QMI ICDs: + AUTH ICD Rev. B (80-VB816-21) + CAT ICD Rev. J (80-VB816-11) + DMS ICD Rev. K (80-VB816-4) + LOC ICD Rev. D (80-VB816-17) + NAS ICD Rev. W (80-VB816-6) + PBM ICD Rev. F (80-VB816-15) + PDS 1 ICD Rev. J (80-VB816-8) + PDS 2 ICD Rev. D (80-VB816-14) + UIM ICD Rev. T (80-VB816-12) + Voice ICD Rev. J (80-VB816-10) + WDS ICD Rev. U (80-VB816-5) + WMS ICD Rev. F (80-VB816-9) + +Prior Release (Gobi Extensible API 2011-12-15-0819) +a. Initial beta code release + +------------------------------------------------------------------------------- + +2. KNOWN ISSUES + +No known issues. + +------------------------------------------------------------------------------- + +3. BUILD STEPS + +a. Start in the 'GobiConnectionMgmt' folder +b. For Android, run: + make Android ANDROID_PATH= + For x86, run: + make + +------------------------------------------------------------------------------- + diff --git a/gobi-api/Gobi_2012-06-18-1054/Shared/GobiError.h b/gobi-api/Gobi_2012-06-18-1054/Shared/GobiError.h new file mode 100755 index 0000000..53d5602 --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Shared/GobiError.h @@ -0,0 +1,137 @@ +/*=========================================================================== +FILE: + GobiError.h + +DESCRIPTION: + QUALCOMM Gobi Errors + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "QMIEnum.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// eGobiError Enumeration +// Gobi API Error Enumeration +/*=========================================================================*/ +enum eGobiError +{ + eGOBI_ERR_ENUM_BEGIN = -1, + + eGOBI_ERR_NONE, // 00 Success + eGOBI_ERR_GENERAL, // 01 General error + eGOBI_ERR_INTERNAL, // 02 Internal error + eGOBI_ERR_MEMORY, // 03 Memory error + eGOBI_ERR_INVALID_ARG, // 04 Invalid argument + eGOBI_ERR_BUFFER_SZ, // 05 Buffer too small + eGOBI_ERR_NO_DEVICE, // 06 Unable to detect device + eGOBI_ERR_INVALID_DEVID, // 07 Invalid device ID + eGOBI_ERR_NO_CONNECTION, // 08 No connection to device + eGOBI_ERR_IFACE, // 09 Unable to obtain required interace + eGOBI_ERR_CONNECT, // 10 Unable to connect to interface + eGOBI_ERR_REQ_SCHEDULE, // 11 Unable to schedule request + eGOBI_ERR_REQUEST, // 12 Error sending request + eGOBI_ERR_RESPONSE, // 13 Error receiving response + eGOBI_ERR_REQUEST_TO, // 14 Timeout while sending request + eGOBI_ERR_RESPONSE_TO, // 15 Timeout while receiving response + eGOBI_ERR_MALFORMED_RSP, // 16 Malformed response received + eGOBI_ERR_INVALID_RSP, // 17 Invalid/error response received + eGOBI_ERR_INVALID_FILE, // 18 Invalid file path + eGOBI_ERR_FILE_OPEN, // 19 Unable to open file + eGOBI_ERR_FILE_COPY, // 20 Unable to copy file + eGOBI_ERR_QDL_SCM, // 21 Unable to open service control mgr + eGOBI_ERR_NO_QDL_SVC, // 22 Unable to detect QDL service + eGOBI_ERR_NO_QDL_SVC_INFO, // 23 Unable to obtain QDL service info + eGOBI_ERR_NO_QDL_SVC_PATH, // 24 Unable to locate QSL service + eGOBI_ERR_QDL_SVC_CFG, // 25 Unable to reconfigure QDL service + eGOBI_ERR_QDL_SVC_IFACE, // 26 Unable to interface to QDL service + eGOBI_ERR_OFFLINE, // 27 Unable to set device offline + eGOBI_ERR_RESET, // 28 Unable to reset device + eGOBI_ERR_NO_SIGNAL, // 29 No available signal + eGOBI_ERR_MULTIPLE_DEVICES, // 30 Multiple devices detected + eGOBI_ERR_DRIVER, // 31 Error interfacing to driver + eGOBI_ERR_NO_CANCELABLE_OP, // 32 No cancelable operation is pending + eGOBI_ERR_CANCEL_OP, // 33 Error canceling outstanding operation + eGOBI_ERR_QDL_CRC, // 34 QDL image data CRC error + eGOBI_ERR_QDL_PARSING, // 35 QDL image data parsing error + eGOBI_ERR_QDL_AUTH, // 36 QDL image authentication error + eGOBI_ERR_QDL_WRITE, // 37 QDL image write error + eGOBI_ERR_QDL_OPEN_SIZE, // 38 QDL image size error + eGOBI_ERR_QDL_OPEN_TYPE, // 39 QDL image type error + eGOBI_ERR_QDL_OPEN_PROT, // 40 QDL memory protection error + eGOBI_ERR_QDL_OPEN_SKIP, // 41 QDL image not required + eGOBI_ERR_QDL_ERR_GENERAL, // 42 QDL general error + eGOBI_ERR_QDL_BAR_MODE, // 43 QDL BAR mode error + + eGOBI_ERR_ENUM_END, + + // Offset from which mapped QMI error codes start from (see eQMIErrorCode) + eGOBI_ERR_QMI_OFFSET = 1000, +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eGobiError validity check + +PARAMETERS: + ec [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eGobiError ec ) +{ + bool retVal = false; + if (ec > eGOBI_ERR_ENUM_BEGIN && ec < eGOBI_ERR_ENUM_END) + { + retVal = true; + } + + if (ec >= eGOBI_ERR_QMI_OFFSET) + { + ULONG tmp = (ULONG)ec - (ULONG)eGOBI_ERR_QMI_OFFSET; + retVal = ::IsValid( (eQMIErrorCode)tmp ); + } + + return retVal; +}; \ No newline at end of file diff --git a/gobi-api/Gobi_2012-06-18-1054/Shared/GobiQMICore.cpp b/gobi-api/Gobi_2012-06-18-1054/Shared/GobiQMICore.cpp new file mode 100755 index 0000000..136976f --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Shared/GobiQMICore.cpp @@ -0,0 +1,531 @@ +/*=========================================================================== +FILE: + GobiQMICore.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" +#include "ProtocolNotification.h" + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiQMICore (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiQMICore::cGobiQMICore() + : mLastError( eGOBI_ERR_NONE ) +{ + mInterface[0] = 0; +} + +/*=========================================================================== +METHOD: + ~cGobiQMICore (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + BOOL +===========================================================================*/ +cGobiQMICore::~cGobiQMICore() +{ + Cleanup(); +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Initialize() +{ + return true; +} + +/*=========================================================================== +METHOD: + Cleanup (Public Method) + +DESCRIPTION: + Cleanup the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Cleanup() +{ + Disconnect(); + return true; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified Gobi device + +PARAMETERS: + pQMIFile [ I ] - Gobi device interface to connect to + services [ I ] - QMI services to connect to + +RETURN VALUE: + std::set - Services successfuly configured +===========================================================================*/ +std::set cGobiQMICore::Connect( + LPCSTR pInterface, + std::set & services ) +{ + // The services we successfully connected to + std::set retServices; + + // Clear last error recorded + ClearLastError(); + + size_t ifaceLen = strnlen( pInterface, MAX_PATH ) + 1; + if (ifaceLen >= (size_t)MAX_PATH) + { + mLastError = eGOBI_ERR_INVALID_ARG; + return retServices; + } + + // Allocate configured QMI servers + std::set ::const_iterator pIter = services.begin(); + while (pIter != services.end()) + { + cQMIProtocolServer * pSvr = 0; + pSvr = new cQMIProtocolServer( *pIter, 8192, 512 ); + if (pSvr != 0) + { + // Initialize server (we don't care about the return code + // since the following Connect() call will fail if we are + // unable to initialize the server) + pSvr->Initialize(); + + bool bRC = pSvr->Connect( pInterface ); + if (bRC == true) + { + sServerInfo si( pSvr ); + std::pair entry( *pIter, si ); + mServers.insert( entry ); + + retServices.insert( *pIter ); + } + } + + pIter++; + } + + // All servers fail? + if (retServices.size() == 0) + { + // Yes, disconnect them all + Disconnect(); + + // ... and set the error code + mLastError = eGOBI_ERR_CONNECT; + } + + memcpy( mInterface, pInterface, ifaceLen ); + return retServices; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the currently connected Gobi device + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Disconnect() +{ + // Clear last error recorded + ClearLastError(); + + // Clear device interface + mInterface[0] = 0; + + // Assume failure + bool bRC = false; + if (mServers.size() == 0) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return bRC; + } + + // Disconnect/clean-up all configured QMI servers + std::map ::iterator pIter; + pIter = mServers.begin(); + + while (pIter != mServers.end()) + { + sServerInfo & si = pIter->second; + cQMIProtocolServer * pSvr = si.mpServer; + if (pSvr != 0) + { + pSvr->Disconnect(); + pSvr->Exit(); + + delete pSvr; + } + + si.mLogsProcessed = 0; + pIter++; + } + + mServers.clear(); + + bRC = true; + return bRC; +} + +/*=========================================================================== +METHOD: + Send (Public Method) + +DESCRIPTION: + Send a request using the specified QMI protocol server and wait for (and + then return) the response + +PARAMETERS: + svcID [ I ] - QMI service type + msgID [ I ] - QMI message ID + to [ I ] - Timeout value (in milliseconds) + inLen [ I ] - Length of input buffer + pIn [ I ] - Input buffer + pOutLen [I/O] - Upon input the maximum number of BYTEs pOut can + contain, upon output the number of BYTEs copied + to pOut + pOut [ O ] - Output buffer + +RETURN VALUE: + eGobiError - The result +===========================================================================*/ +eGobiError cGobiQMICore::Send( + ULONG svcID, + ULONG msgID, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ) +{ + // Clear last error recorded + ClearLastError(); + + if (msgID > 0xffff) + { + mLastError = eGOBI_ERR_INVALID_ARG; + return mLastError; + } + + sSharedBuffer * pRequest = 0; + pRequest = sQMIServiceBuffer::BuildBuffer( (eQMIService)svcID, + (WORD)msgID, + false, + false, + pIn, + inLen ); + + if (pRequest == 0) + { + mLastError = eGOBI_ERR_MEMORY; + return mLastError; + } + + // We use the event based notification approach + cSyncQueue evts( 12, true ); + cProtocolQueueNotification pn( &evts ); + + // Build the request object + sProtocolRequest req( pRequest, 0, to, 1, 1, &pn ); + if (to == 0) + { + mLastError = eGOBI_ERR_INTERNAL; + return mLastError; + } + + // Grab the server + std::map ::iterator pSvrIter; + pSvrIter = mServers.find( (eQMIService)svcID ); + if (pSvrIter == mServers.end()) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return mLastError; + } + + sServerInfo & si = pSvrIter->second; + cQMIProtocolServer * pSvr = si.mpServer; + if (pSvr == 0 || pSvr->IsConnected() == false) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return mLastError; + } + + // Grab the log from the server + const cProtocolLog & protocolLog = pSvr->GetLog(); + + // Schedule the request + ULONG reqID = pSvr->AddRequest( req ); + if (reqID == INVALID_REQUEST_ID) + { + mLastError = eGOBI_ERR_REQ_SCHEDULE; + return mLastError; + } + + // Store for external cancel + si.mRequestID = reqID; + + bool bReq = false; + bool bExit = false; + DWORD idx; + + // Returned response + sProtocolBuffer rsp; + + // Process up to the indicated timeout + cEvent & sigEvt = evts.GetSignalEvent(); + while (bExit == false) + { + int wc = sigEvt.Wait( to, idx ); + if (wc == ETIME) + { + if (bReq == true) + { + mLastError = eGOBI_ERR_RESPONSE_TO; + } + else + { + mLastError = eGOBI_ERR_REQUEST_TO; + } + break; + } + else if (wc != 0) + { + mLastError = eGOBI_ERR_INTERNAL; + break; + } + + sProtocolNotificationEvent evt; + bool bEvt = evts.GetElement( idx, evt ); + if (bEvt == false) + { + mLastError = eGOBI_ERR_INTERNAL; + bExit = true; + break; + } + + switch (evt.mEventType) + { + case ePROTOCOL_EVT_REQ_ERR: + mLastError = eGOBI_ERR_REQUEST; + bExit = true; + break; + + case ePROTOCOL_EVT_RSP_ERR: + mLastError = eGOBI_ERR_RESPONSE; + bExit = true; + break; + + case ePROTOCOL_EVT_REQ_SENT: + { + // Grab the as-sent request + DWORD id = evt.mParam2; + sProtocolBuffer tmpReq = protocolLog.GetBuffer( id ); + sSharedBuffer * pTmpRequest = tmpReq.GetSharedBuffer(); + if (pTmpRequest != 0) + { + // Grab the transaction ID + sQMIServiceBuffer actualReq( pTmpRequest ); + si.mRequestTXID = actualReq.GetTransactionID(); + } + + bReq = true; + } + break; + + case ePROTOCOL_EVT_RSP_RECV: + // Success! + rsp = protocolLog.GetBuffer( evt.mParam2 ); + bExit = true; + break; + } + } + + if ( (mLastError == eGOBI_ERR_INTERNAL) + || (mLastError == eGOBI_ERR_REQUEST_TO) + || (mLastError == eGOBI_ERR_RESPONSE_TO) ) + { + // Remove the request as our protocol notification object is + // about to go out of scope and hence be destroyed + pSvr->RemoveRequest( reqID ); + } + + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + mLastError = eGOBI_ERR_MALFORMED_RSP; + return mLastError; + } + + // Caller might not be interested in actual output (beyond error code) + ULONG maxSz = 0; + if (pOutLen != 0) + { + maxSz = *pOutLen; + } + + if (maxSz > 0) + { + // TLV 2 is always present + ULONG needSz = 0; + const BYTE * pData = (const BYTE *)qmiRsp.GetRawContents( needSz ); + if (needSz == 0 || pData == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pOutLen = needSz; + if (needSz > maxSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( pOut, pData, needSz ); + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + mLastError = eGOBI_ERR_MALFORMED_RSP; + return mLastError; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Success! + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + CancelSend (Public Method) + +DESCRIPTION: + Cancel the most recent in-progress Send() based operation + +PARAMETERS: + svcID [ I ] - Service whose outstanding request is to be cancelled + pTXID [ O ] - QMI transaction ID of outstanding request + +RETURN VALUE: + eGobiError - The result +===========================================================================*/ +eGobiError cGobiQMICore::CancelSend( + ULONG svcID, + ULONG * pTXID ) +{ + // Grab the server + std::map ::iterator pSvrIter; + pSvrIter = mServers.find( (eQMIService)svcID ); + if (pSvrIter == mServers.end()) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return mLastError; + } + + sServerInfo & si = pSvrIter->second; + cQMIProtocolServer * pSvr = si.mpServer; + if (pSvr == 0) + { + return eGOBI_ERR_INTERNAL; + } + + if (si.mRequestID == 0xffffffff) + { + return eGOBI_ERR_NO_CANCELABLE_OP; + } + + bool bRemove = pSvr->RemoveRequest( si.mRequestID ); + if (bRemove == false) + { + return eGOBI_ERR_CANCEL_OP; + } + + if (pTXID != 0) + { + *pTXID = si.mRequestTXID; + } + + return eGOBI_ERR_NONE; +} + + + diff --git a/gobi-api/Gobi_2012-06-18-1054/Shared/GobiQMICore.h b/gobi-api/Gobi_2012-06-18-1054/Shared/GobiQMICore.h new file mode 100755 index 0000000..5a20c0e --- /dev/null +++ b/gobi-api/Gobi_2012-06-18-1054/Shared/GobiQMICore.h @@ -0,0 +1,192 @@ +/*=========================================================================== +FILE: + GobiQMICore.h + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2012, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "QMIProtocolServer.h" +#include "SyncQueue.h" +#include "GobiError.h" + +/*=========================================================================*/ +// Class cGobiQMICore +/*=========================================================================*/ +class cGobiQMICore +{ + public: + // Constructor + cGobiQMICore(); + + // Destructor + virtual ~cGobiQMICore(); + + // Initialize the object + virtual bool Initialize(); + + // Cleanup the object + virtual bool Cleanup(); + + // (Inline) Return the server as determined by the service type + cQMIProtocolServer * GetServer( eQMIService svc ) + { + cQMIProtocolServer * pSvr = 0; + + std::map ::const_iterator pIter; + pIter = mServers.find( svc ); + + if (pIter != mServers.end()) + { + const sServerInfo & si = pIter->second; + pSvr = si.mpServer; + } + + return pSvr; + }; + + // (Inline) Clear last error recorded + void ClearLastError() + { + mLastError = eGOBI_ERR_NONE; + }; + + // (Inline) Get last error recorded + eGobiError GetLastError() + { + return mLastError; + }; + + // (Inline) Return the last recorded error (if this happens to indicate + // that no error occurred then return eGOBI_ERR_INTERNAL) + eGobiError GetCorrectedLastError() + { + eGobiError ec = GetLastError(); + if (ec == eGOBI_ERR_NONE) + { + ec = eGOBI_ERR_INTERNAL; + } + + return ec; + }; + + // (Inline) Return the correct QMI error (if this happens to indicate + // that no error occurred then return the mapped eQMI_ERR_INTERNAL + // value) + eGobiError GetCorrectedQMIError( ULONG qmiErrorCode ) + { + ULONG ec = (ULONG)eQMI_ERR_INTERNAL + (ULONG)eGOBI_ERR_QMI_OFFSET; + if (qmiErrorCode != (ULONG)eQMI_ERR_NONE) + { + ec = qmiErrorCode + (ULONG)eGOBI_ERR_QMI_OFFSET; + } + + return (eGobiError)ec; + }; + + // Connect to the specified Gobi device interface + virtual std::set Connect( + LPCSTR pInterface, + std::set & services ); + + // Disconnect from the currently connected device interface + virtual bool Disconnect(); + + // Send a request using the specified QMI protocol server and wait + // for (and then return) the response + eGobiError Send( + ULONG svcID, + ULONG msgID, + ULONG to, + ULONG inLen, + const BYTE * pIn, + ULONG * pOutLen, + BYTE * pOut ); + + // Cancel the most recent in-progress Send() based operation + eGobiError CancelSend( + ULONG svcID, + ULONG * pTXID ); + + protected: + /* Device interface */ + CHAR mInterface[MAX_PATH]; + + /* QMI protocol server/protocol server log count */ + struct sServerInfo + { + public: + // Constructor (default) + sServerInfo() + : mpServer( 0 ), + mLogsProcessed( 0 ), + mRequestID( 0xffffffff ), + mRequestTXID( 0xffffffff ) + { }; + + // Constructor (parameterized) + sServerInfo( cQMIProtocolServer * pServer ) + : mpServer( pServer ), + mLogsProcessed( 0 ), + mRequestID( 0xffffffff ), + mRequestTXID( 0xffffffff ) + { }; + + /* Protocol server */ + cQMIProtocolServer * mpServer; + + /* Protocol server logs processed */ + ULONG mLogsProcessed; + + /* Last scheduled request ID */ + ULONG mRequestID; + + /* Last schedule request QMI transaction ID */ + ULONG mRequestTXID; + }; + + /* QMI protocol servers */ + std::map mServers; + + /* Last error recorded */ + eGobiError mLastError; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/COPYING b/gobi-api/fixed-GobiAPI-1.0.40/COPYING new file mode 100644 index 0000000..1a73aa4 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/COPYING @@ -0,0 +1,27 @@ +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/BitPacker.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/BitPacker.cpp new file mode 100755 index 0000000..818b2e5 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/BitPacker.cpp @@ -0,0 +1,555 @@ +/*=========================================================================== +FILE: + BitPacker.cpp + +DESCRIPTION: + Implementation of cBitPacker class + +PUBLIC CLASSES AND METHODS: + cBitPacker + This class packs bits into a buffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- + +#include "StdAfx.h" +#include "BitPacker.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + SetUnsignedVal (Public Method) + +DESCRIPTION: + Set an unsigned value in the bit source (writing least significant + bits first) + +PARAMETERS: + pData [ O ] - Data buffer to write to + currentOffset [I/O] - Current bit offset into above buffer + maxOffset [ I ] - Maximum bit offset into above buffer + numBits [ I ] - Number of bits to write + dataIn [ I ] - Input value to write + bLSB [ I ] - Pack LSB -> MSB? + +RETURN VALUE: + DWORD +===========================================================================*/ +template +DWORD SetUnsignedVal( + BYTE * pData, + ULONG & currentOffset, + ULONG maxOffset, + ULONG numBits, + T dataIn, + bool bLSB = true ) +{ + ASSERT( pData != 0 ); + + // Number of bits in the passed in type + const ULONG TYPE_BIT_COUNT = (ULONG)(sizeof( T ) * BITS_PER_BYTE); + ASSERT( numBits > 0 && numBits <= TYPE_BIT_COUNT); + + // Requesting too much? + if (currentOffset < maxOffset) + { + ULONG bitsToGo = maxOffset - currentOffset; + if (bitsToGo < numBits) + { + return ERROR_NOT_ENOUGH_MEMORY; + } + } + else if (currentOffset == maxOffset) + { + // Silly rabbit, don't bother to call us if you don't want any bits! + return ERROR_INVALID_PARAMETER; + } + else + { + return ERROR_NOT_ENOUGH_MEMORY; + } + + // Advance to first valid byte + pData += (currentOffset / BITS_PER_BYTE); + + // Since we don't really care about performance for bit packing + // (we do not anticipate this being called as frequently as bit + // parsing) we always use the generic approach + + // Reduce input to a bit array + BYTE bits[MAX_TYPE_BITS]; + + ULONG bitsExtracted = 0; + while (bitsExtracted < numBits) + { + if (bLSB == true) + { + BYTE bit = (BYTE)(dataIn & (T)1); + bits[bitsExtracted++] = bit; + } + else + { + BYTE bit = (BYTE)(dataIn & (T)1); + bits[numBits - ++bitsExtracted] = bit; + } + + dataIn >>= 1; + } + + + // Store current offset + ULONG offset = currentOffset; + + // Add in each bit - one at a time + bitsExtracted = 0; + while (bitsExtracted != numBits) + { + // How many bits are left in the current byte? + ULONG bitsLeft = BITS_PER_BYTE - (offset % BITS_PER_BYTE); + + // Shift input bit over to desired destination + BYTE tmp = bits[bitsExtracted++]; + + if (bLSB == true) + { + tmp <<= (BITS_PER_BYTE - bitsLeft); + } + else + { + tmp <<= bitsLeft - 1; + } + + *pData |= tmp; + + // Advance to next byte in buffer? + offset++; + if (offset % BITS_PER_BYTE == 0) + { + pData++; + } + } + + currentOffset += numBits; + return NO_ERROR; +} + +/*=========================================================================*/ +// cBitPacker Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cBitPacker (Public Method) + +DESCRIPTION: + Constructor (default) + +RETURN VALUE: + None +===========================================================================*/ +cBitPacker::cBitPacker() + : mpData( 0 ), + mOffset( 0 ), + mMaxAttainedOffset( 0 ), + mMaxOffset( 0 ), + mbLSB( true ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + cBitPacker (Public Method) + +DESCRIPTION: + Constructor (from a buffer) + +PARAMETERS: + pData [ I ] - Data buffer + dataBitSize [ I ] - Size of above data buffer (in bits) + +RETURN VALUE: + None +===========================================================================*/ +cBitPacker::cBitPacker( + BYTE * pData, + ULONG dataBitSize ) + : mpData( 0 ), + mOffset( 0 ), + mMaxAttainedOffset( 0 ), + mMaxOffset( 0 ), + mbLSB( true ) +{ + SetData( pData, dataBitSize ); +} + +/*=========================================================================== +METHOD: + ~cBitPacker (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cBitPacker::~cBitPacker() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a CHAR (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + CHAR dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a SHORT (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + SHORT dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a LONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + LONG dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a LONGLONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + LONGLONG dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a UCHAR (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + UCHAR dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a USHORT (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + USHORT dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a ULONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + ULONG dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Write 'numBits' from a ULONGLONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to write + dataIn [ I ] - Value to write + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitPacker::Set( + ULONG numBits, + ULONGLONG dataIn ) +{ + DWORD rc = SetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataIn, + mbLSB ); + + if (rc == NO_ERROR && mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + + return rc; +} + +/*=========================================================================== +METHOD: + ReleaseData (Public Method) + +DESCRIPTION: + Release the data being parsed + +RETURN VALUE: + None +===========================================================================*/ +void cBitPacker::ReleaseData() +{ + // Clear out current buffer + mpData = 0; + mOffset = 0; + mMaxAttainedOffset = 0; + mMaxOffset = 0; +}; + +/*=========================================================================== +METHOD: + SetData (Public Method) + +DESCRIPTION: + Set the data being parsed + +PARAMETERS: + pData [ I ] - Data buffer + dataBitSize [ I ] - Size of above data buffer (in bits) + +RETURN VALUE: + None +===========================================================================*/ +void cBitPacker::SetData( + BYTE * pData, + ULONG dataBitSize ) +{ + // Release current buffer + ReleaseData(); + + // Anything to parse? + if (pData != 0) + { + // Yes + mpData = pData; + mMaxOffset = dataBitSize; + } + else + { + // No + ASSERT( mpData != 0 ); + } +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/BitPacker.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/BitPacker.h new file mode 100755 index 0000000..34363d7 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/BitPacker.h @@ -0,0 +1,183 @@ +/*=========================================================================== +FILE: + BitPacker.h + +DESCRIPTION: + Declaration of cBitPacker class + +PUBLIC CLASSES AND METHODS: + cBitPacker + This class packs bits into a buffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +#include "BitParser.h" + + +/*=========================================================================*/ +// Class cBitPacker +// +// Class to assist in parsing a buffer into bit/byte specified fields +/*=========================================================================*/ +class cBitPacker +{ + public: + // Constructor (default) + cBitPacker(); + + // Constructor (from a buffer) + cBitPacker( + BYTE * pData, + ULONG dataBitSize ); + + // Destructor + ~cBitPacker(); + + // (Inline) Returns the number of bits left in the buffer (from the + // current working bit offset) + ULONG GetNumBitsLeft() const + { + return (mMaxOffset - mOffset); + }; + + // (Inline) Returns the number of bits in the buffer that have been + // written (essentially the current working bit offset) + ULONG GetNumBitsWritten() const + { + return (mOffset); + }; + + // (Inline) Returns the number of bits in the buffer that have been + // written (essentially the maximum value the working bit offset + // attained up to now) + ULONG GetTotalBitsWritten() const + { + return mMaxAttainedOffset; + }; + + // (Inline) Set current working bit offset + void SetOffset( ULONG offset ) + { + mOffset = offset; + if (mOffset > mMaxOffset) + { + mOffset = mMaxOffset; + } + + if (mOffset > mMaxAttainedOffset) + { + mMaxAttainedOffset = mOffset; + } + }; + + // (Inline) Are we parsing LSB -> MSB (the default)? + bool GetLSBMode() + { + return mbLSB; + }; + + // (Inline) Parse LSB -> MSB (if true) or MSB -> LSB + void SetLSBMode( bool bLSB ) + { + mbLSB = bLSB; + }; + + // Write 'numBits' from a CHAR (advances offset) + DWORD Set( + ULONG numBits, + CHAR dataIn ); + + // Write 'numBits' from a SHORT (advances offset) + DWORD Set( + ULONG numBits, + SHORT dataIn ); + + // Write 'numBits' from a LONG (advances offset) + DWORD Set( + ULONG numBits, + LONG dataIn ); + + // Write 'numBits' from a LONGLONG (advances offset) + DWORD Set( + ULONG numBits, + LONGLONG dataIn ); + + // Write 'numBits' from a UCHAR (advances offset) + DWORD Set( + ULONG numBits, + UCHAR dataIn ); + + // Write 'numBits' from a USHORT (advances offset) + DWORD Set( + ULONG numBits, + USHORT dataIn ); + + // Write 'numBits' from a ULONG (advances offset) + DWORD Set( + ULONG numBits, + ULONG dataIn ); + + // Write 'numBits' from a ULONGLONG (advances offset) + DWORD Set( + ULONG numBits, + ULONGLONG dataIn ); + + // Release the data being parsed + void ReleaseData(); + + // Set the data being parsed + void SetData( + BYTE * pData, + ULONG dataBitSize ); + + protected: + /* Data buffer */ + BYTE * mpData; + + /* Current bit-specified offset */ + ULONG mOffset; + + /* Maximum value the above bit offset attained */ + ULONG mMaxAttainedOffset; + + /* Maximum bit-specified offset */ + ULONG mMaxOffset; + + /* Are we parsing LSB -> MSB (the default)? */ + bool mbLSB; + +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/BitParser.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/BitParser.cpp new file mode 100755 index 0000000..a5a638e --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/BitParser.cpp @@ -0,0 +1,578 @@ +/*=========================================================================== +FILE: + BitParser.cpp + +DESCRIPTION: + Implementation of cBitParser class + +PUBLIC CLASSES AND METHODS: + cBitParser + This class extracts bits from a buffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- + +#include "StdAfx.h" +#include "BitParser.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +static BYTE MASK[BITS_PER_BYTE + 1] = +{ + 0x00, + 0x01, + 0x03, + 0x07, + 0x0F, + 0x1F, + 0x3F, + 0x7F, + 0xFF +}; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetUnsignedVal (Public Method) + +DESCRIPTION: + Get an unsigned value from the bit source (reading least significant + bits first) + +PARAMETERS: + pData [ I ] - Data buffer + currentOffset [I/O] - Current bit offset into above buffer + maxOffset [ I ] - Maximum bit offset into above buffer + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + bLSB [ I ] - Parse LSB -> MSB? + +RETURN VALUE: + DWORD +===========================================================================*/ +template +DWORD GetUnsignedVal( + const BYTE * pData, + ULONG & currentOffset, + ULONG maxOffset, + ULONG numBits, + T & dataOut, + bool bLSB = true ) +{ + ASSERT( pData != 0 ); + + // Number of bits in the passed in type + const ULONG TYPE_BIT_COUNT = (ULONG)(sizeof( T ) * BITS_PER_BYTE); + + // Bad parameters? + if (numBits == 0 || numBits > TYPE_BIT_COUNT || numBits > MAX_TYPE_BITS) + { + return ERROR_INVALID_PARAMETER; + } + + // Requesting too much? + if (currentOffset < maxOffset) + { + ULONG bitsToGo = maxOffset - currentOffset; + if (bitsToGo < numBits) + { + return ERROR_NOT_ENOUGH_MEMORY; + } + } + else + { + // No bits left! + return ERROR_NOT_ENOUGH_MEMORY; + } + + // Advance to first valid bit + pData += (currentOffset / BITS_PER_BYTE); + + // Number of bits left in current byte + ULONG bitsLeft = BITS_PER_BYTE - (currentOffset % BITS_PER_BYTE); + + if (bLSB == true) + { + // Extracting native types on byte boundaries? + if (numBits == TYPE_BIT_COUNT && bitsLeft == BITS_PER_BYTE) + { + // Yes, a simple cast will suffice + dataOut = *((T *)pData); + + currentOffset += numBits; + return NO_ERROR; + } + + // Extracting some small number of bits? + if (numBits <= bitsLeft) + { + // Yes, simply shift back to origin and AND with correct mask + BYTE tmp = *pData; + tmp >>= (BITS_PER_BYTE - bitsLeft); + tmp &= MASK[numBits]; + + dataOut = (T)tmp; + + currentOffset += numBits; + return NO_ERROR; + } + } + + // Not either of the simple cases - extract the relevant bits + // and then build the output + + // Extract bits + BYTE bits[MAX_TYPE_BITS]; + ULONG bitsExtracted = 0; + + while (bitsExtracted < numBits) + { + BYTE bit = *pData; + + if (bLSB == true) + { + bit <<= (bitsLeft - 1); + bit >>= (BITS_PER_BYTE - 1); + bits[bitsExtracted++] = bit; + } + else + { + bit >>= (bitsLeft - 1); + bit &= 0x01; + bits[numBits - ++bitsExtracted] = bit; + } + + bitsLeft--; + if (bitsLeft == 0) + { + pData++; + bitsLeft = BITS_PER_BYTE; + } + } + + // Reassemble to form output value + dataOut = 0; + T tmp = 0; + + for (ULONG b = 0; b < numBits; b++) + { + tmp = bits[b]; + tmp <<= b; + + dataOut |= tmp; + } + + currentOffset += numBits; + return NO_ERROR; +} + +/*=========================================================================== +METHOD: + GetSignedVal (Public Method) + +DESCRIPTION: + Get an signed value from the bit source (reading least significant + bits first), just gets the equivalent unsigned representation and + then sign-extends as necessary + +PARAMETERS: + pData [ I ] - Data buffer + currentOffset [I/O] - Current bit offset into above buffer + maxOffset [ I ] - Maximum bit offset into above buffer + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + bLSB [ I ] - Parse LSB -> MSB? + +RETURN VALUE: + DWORD +===========================================================================*/ +template +DWORD GetSignedVal( + const BYTE * pData, + ULONG & currentOffset, + ULONG maxOffset, + ULONG numBits, + T & dataOut, + bool bLSB = true ) +{ + DWORD rc = GetUnsignedVal( pData, + currentOffset, + maxOffset, + numBits, + dataOut, + bLSB ); + + if (rc == NO_ERROR) + { + // If the highest-order bit is one, we must sign-extend + bool bSignExtend = (numBits < (sizeof( T ) * BITS_PER_BYTE)) + && ((dataOut >> (numBits - 1)) & 1) == 1; + + if (bSignExtend == true) + { + T mask = (T)((~0) << numBits); + dataOut |= mask; + } + } + + return rc; +} + +/*=========================================================================*/ +// cBitParser Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cBitParser (Public Method) + +DESCRIPTION: + Constructor (default) + +RETURN VALUE: + None +===========================================================================*/ +cBitParser::cBitParser() + : mpData( 0 ), + mOffset( 0 ), + mMaxOffset( 0 ), + mbLSB( true ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + cBitParser (Public Method) + +DESCRIPTION: + Constructor (from a buffer) + +PARAMETERS: + pData [ I ] - Data buffer + dataBitSize [ I ] - Size of above data buffer (in bits) + +RETURN VALUE: + None +===========================================================================*/ +cBitParser::cBitParser( + const BYTE * pData, + ULONG dataBitSize ) + : mpData( 0 ), + mOffset( 0 ), + mMaxOffset( 0 ), + mbLSB( true ) +{ + SetData( pData, dataBitSize ); +} + +/*=========================================================================== +METHOD: + cBitParser (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cBitParser::~cBitParser() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a CHAR (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + CHAR & dataOut ) +{ + return GetSignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a SHORT (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + SHORT & dataOut ) +{ + return GetSignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a LONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + LONG & dataOut ) +{ + return GetSignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a LONGLONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + LONGLONG & dataOut ) +{ + return GetSignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a UCHAR (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + UCHAR & dataOut ) +{ + return GetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a USHORT (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + USHORT & dataOut ) +{ + return GetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a ULONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + ULONG & dataOut ) +{ + return GetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + Get (Public Method) + +DESCRIPTION: + Return 'numBits' as a ULONGLONG (advances offset) + +PARAMETERS: + numBits [ I ] - Number of bits to process + dataOut [ O ] - Processed value + +RETURN VALUE: + DWORD +===========================================================================*/ +DWORD cBitParser::Get( + ULONG numBits, + ULONGLONG & dataOut ) +{ + return GetUnsignedVal( mpData, + mOffset, + mMaxOffset, + numBits, + dataOut, + mbLSB ); +} + +/*=========================================================================== +METHOD: + ReleaseData (Public Method) + +DESCRIPTION: + Release the data being parsed + +RETURN VALUE: + None +===========================================================================*/ +void cBitParser::ReleaseData() +{ + // Clear out current buffer + mpData = 0; + mOffset = 0; + mMaxOffset = 0; +}; + +/*=========================================================================== +METHOD: + SetData (Public Method) + +DESCRIPTION: + Set the data being parsed + +PARAMETERS: + pData [ I ] - Data buffer + dataBitSize [ I ] - Size of above data buffer (in bits) + +RETURN VALUE: + None +===========================================================================*/ +void cBitParser::SetData( + const BYTE * pData, + ULONG dataBitSize ) +{ + // Release current buffer + ReleaseData(); + + // Anything to parse? + if (pData != 0) + { + // Yes + mpData = pData; + mMaxOffset = dataBitSize; + } + else + { + // No + ASSERT( mpData != 0 ); + } +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/BitParser.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/BitParser.h new file mode 100755 index 0000000..8f8a686 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/BitParser.h @@ -0,0 +1,198 @@ +/*=========================================================================== +FILE: + BitParser.h + +DESCRIPTION: + Declaration of cBitParser class + +PUBLIC CLASSES AND METHODS: + cBitParser + This class extracts bits from a buffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Number of bits in a byte +const ULONG BITS_PER_BYTE = 8; + +// Maximum number of bits we will parse for any supported type +const ULONG MAX_TYPE_BITS = (ULONG)sizeof(ULONGLONG) * BITS_PER_BYTE; + +/*=========================================================================== +METHOD: + ByteSwap (Inline Public Method) + +DESCRIPTION: + Changes little-endian values to big-endian, and vice versa + +PARAMETERS: + data [ I ] - Data being byte-swapped + +RETURN VALUE: + None +===========================================================================*/ +template +void ByteSwap( T & data ) +{ + // Just reverse the order of the bytes + PBYTE pL; + PBYTE pR; + + for (pL = (PBYTE)&data, pR = pL + sizeof( T ) - 1; pL < pR; ++pL, --pR) + { + *pL = *pL ^ *pR; + *pR = *pL ^ *pR; + *pL = *pL ^ *pR; + } +}; + +/*=========================================================================*/ +// Class cBitParser +// +// Class to assist in parsing a buffer into bit/byte specified fields +/*=========================================================================*/ +class cBitParser +{ + public: + // Constructor (default) + cBitParser(); + + // Constructor (from a buffer) + cBitParser( + const BYTE * pData, + ULONG dataBitSize ); + + // Destructor + ~cBitParser(); + + // (Inline) Returns the number of bits left in the buffer (from the + // current working bit offset) + ULONG GetNumBitsLeft() const + { + return (mMaxOffset - mOffset); + }; + + // (Inline) Returns the number of bits in the buffer that have been + // processed (essentially the current working bit offset) + ULONG GetNumBitsParsed() const + { + return (mOffset); + }; + + // (Inline) Set current working bit offset + void SetOffset( ULONG offset ) + { + mOffset = offset; + if (mOffset > mMaxOffset) + { + mOffset = mMaxOffset; + } + }; + + // (Inline) Are we parsing LSB -> MSB (the default)? + bool GetLSBMode() + { + return mbLSB; + }; + + // (Inline) Parse LSB -> MSB (if true) or MSB -> LSB + void SetLSBMode( bool bLSB ) + { + mbLSB = bLSB; + }; + + // Return 'numBits' as a CHAR (advances offset) + DWORD Get( + ULONG numBits, + CHAR & dataOut ); + + // Return 'numBits' as a SHORT (advances offset) + DWORD Get( + ULONG numBits, + SHORT & dataOut ); + + // Return 'numBits' as a LONG (advances offset) + DWORD Get( + ULONG numBits, + LONG & dataOut ); + + // Return 'numBits' as a LONGLONG (advances offset) + DWORD Get( + ULONG numBits, + LONGLONG & dataOut ); + + // Return 'numBits' as a UCHAR (advances offset) + DWORD Get( + ULONG numBits, + UCHAR & dataOut ); + + // Return 'numBits' as a USHORT (advances offset) + DWORD Get( + ULONG numBits, + USHORT & dataOut ); + + // Return 'numBits' as a ULONG (advances offset) + DWORD Get( + ULONG numBits, + ULONG & dataOut ); + + // Return 'numBits' as a ULONGLONG (advances offset) + DWORD Get( + ULONG numBits, + ULONGLONG & dataOut ); + + // Release the data being parsed + void ReleaseData(); + + // Set the data being parsed + void SetData( + const BYTE * pData, + ULONG dataBitSize ); + + protected: + /* Data buffer */ + const BYTE * mpData; + + /* Current bit-specified offset */ + ULONG mOffset; + + /* Maximum bit-specified offset */ + ULONG mMaxOffset; + + /* Are we parsing LSB -> MSB (the default)? */ + bool mbLSB; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/CRC.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/CRC.cpp new file mode 100755 index 0000000..d900ee7 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/CRC.cpp @@ -0,0 +1,180 @@ +/*=========================================================================== +FILE: + CRC.cpp + +DESCRIPTION: + 16-bit LSB CRC computation/verification + +PUBLIC CLASSES AND METHODS: + SetCRC() + CheckCRC() + CalculateCRC() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//----------------------------------------------------------------------------- +// Include Files +//----------------------------------------------------------------------------- +#include "StdAfx.h" +#include "CRC.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// CRC intermediates +static USHORT CRCTable[CRC_TABLE_SIZE] = +{ + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 +}; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + SetCRC (Free Method) + +DESCRIPTION: + Calculate and append a 16-bit CRC to given data + +PARAMETERS: + pData [ I ] - The data buffer + dataLen [ I ] - The length of the above buffer + +RETURN VALUE: + None +===========================================================================*/ +void SetCRC( + PBYTE pData, + ULONG dataLen ) +{ + // Calculate CRC + USHORT CRC = CalculateCRC( pData, dataLen * 8 ); + + // Add CRC to data + pData[dataLen] = (BYTE)(CRC & 0x00ff); + pData[dataLen + 1] = (BYTE)(CRC >> 8); +} + +/*=========================================================================== +METHOD: + CheckCRC (Free Method) + +DESCRIPTION: + Check the CRC validity of the given data + +PARAMETERS: + pData [ I ] - The data buffer + dataLen [ I ] - The length of the above buffer + +RETURN VALUE: + bool: + true - CRC checks out OK + false - CRC doesn't cut the mustard +===========================================================================*/ +bool CheckCRC( + const BYTE * pData, + ULONG dataLen ) +{ + // There must be data + ASSERT( pData != 0 ); + ASSERT( dataLen > 0 ); + + // Calculate CRC + USHORT CRC = CalculateCRC( pData, dataLen * 8 ); + + return (CRC == CRC_16_L_OK ? true : false); +} + + +/*=========================================================================== +METHOD: + CalculateCRC (Free Method) + +DESCRIPTION: + Calculate a 16-bit CRC value + +PARAMETERS: + pBuf [ I ] - The data buffer + bitLen [ I ] - The length of the above buffer (in bits) + +RETURN VALUE: + USHORT: The 16-bit calculated CRC +===========================================================================*/ +USHORT CalculateCRC( + const BYTE * pBuf, + ULONG bitLen ) +{ + // Remainders are not allowed + ASSERT( bitLen % 8 == 0 ); + + // There must be a buffer + ASSERT( pBuf != 0 ); + + USHORT CRC; + for (CRC = CRC_16_L_SEED; bitLen >= 8; bitLen -= 8, pBuf++) + { + CRC = CRCTable[(CRC ^ *pBuf) & 0x00ff] ^ (CRC >> 8); + } + + return ~CRC; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/CRC.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/CRC.h new file mode 100755 index 0000000..ed26e76 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/CRC.h @@ -0,0 +1,75 @@ +/*=========================================================================== +FILE: + CRC.h + +DESCRIPTION: + 16-bit LSB CRC computation/verification + +PUBLIC CLASSES AND METHODS: + SetCRC() + CheckCRC() + CalculateCRC() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +const USHORT CRC_16_L_POLYNOMIAL = 0x8408; +const USHORT CRC_16_L_SEED = 0xFFFF; +const USHORT CRC_16_L_OK = 0x0F47; +const USHORT CRC_TABLE_SIZE = 256; +const USHORT CRC_SIZE = 2; + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +// Calculate and append a 16-bit CRC to given data, the calculated CRC +// value stored at pData[dataLen] & pData[dataLen + 1] +void SetCRC( + PBYTE pData, + ULONG dataLen ); + +// Check a CRC value for the given data, dataLen includes the 2 byte CRC +// value at the end of the buffer +bool CheckCRC( + const BYTE * pData, + ULONG dataLen ); + +// Calculate a CRC value for the given data +USHORT CalculateCRC( + const BYTE * pBuf, + ULONG bitLen ); + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/Comm.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/Comm.cpp new file mode 100755 index 0000000..062dafb --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/Comm.cpp @@ -0,0 +1,551 @@ +/*=========================================================================== +FILE: + Comm.cpp + +DESCRIPTION: + Implementation of cComm class + +PUBLIC CLASSES AND METHODS: + cComm + This class wraps low level port communications + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "Comm.h" +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + RxCompletionRoutine (Free Method) + +DESCRIPTION: + Completion routine for receive operation, exercises current receive + callback object + +PARAMETERS: + returnSignal [ I/O ] Asynchronus signal event + (contains pointer to cCOMM object) + +RETURN VALUE: + None +===========================================================================*/ +VOID RxCompletionRoutine( sigval returnSignal ) +{ + cComm * pComm = (cComm *)returnSignal.sival_ptr; + + if (pComm == NULL || pComm->IsValid() == false) + { + return; + } + + cIOCallback * pCallback = pComm->mpRxCallback; + if (pCallback == 0) + { + // aio_cancel is broken if file pointer is bad + // Notify cComm::CancelIO() manually + TRACE( "%s manual notification %d\n", __func__, pComm->mPort ); + pComm->mReadCanceled.Set( 1 ); + + return; + } + + pComm->mpRxCallback = 0; + if (pCallback != (cIOCallback *)1) + { + int nEC = aio_error( &pComm->mReadIO ); + int nBytesTransfered = aio_return( &pComm->mReadIO ); + + pCallback->IOComplete( nEC, nBytesTransfered ); + } +} + +/*=========================================================================*/ +// cComm Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cComm (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cComm::cComm() + : mPortName( "" ), + mPort( INVALID_HANDLE_VALUE ), + mpRxCallback( 0 ), + mbCancelWrite( false ), + mReadCanceled() +{ + memset( &mReadIO, 0, sizeof( aiocb) ); + + mReadIO.aio_sigevent.sigev_value.sival_ptr = this; +} + +/*=========================================================================== +METHOD: + ~cComm (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cComm::~cComm() +{ + // Disconnect from current port + Disconnect(); + + mReadIO.aio_sigevent.sigev_value.sival_ptr = NULL; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + Bool +===========================================================================*/ +bool cComm::IsValid() +{ + return (mReadIO.aio_sigevent.sigev_value.sival_ptr == this); +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified port + +PARAMETERS: + pPort [ I ] - Name of port to open (IE: /dev/qcqmi0) + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::Connect( LPCSTR pPort ) +{ + if (IsValid() == false || pPort == 0 || pPort[0] == 0) + { + return false; + } + + if (mPort != INVALID_HANDLE_VALUE) + { + Disconnect(); + } + + // Opening the com port + mPort = open( pPort, O_RDWR ); + if (mPort == INVALID_HANDLE_VALUE) + { + return false; + } + + // Clear any contents + tcdrain( mPort ); + + mReadCanceled.Clear(); + + // Save port name + mPortName = pPort; + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + RunIOCTL (Public Method) + +DESCRIPTION: + Run an IOCTL on the open file handle + +PARAMETERS: + ioctlReq [ I ] - ioctl request value + pData [I/O] - input or output specific to ioctl request value + +RETURN VALUE: + int - ioctl return value (0 for success) +===========================================================================*/ +int cComm::RunIOCTL( + UINT ioctlReq, + void * pData ) +{ + if (mPort == INVALID_HANDLE_VALUE) + { + TRACE( "Invalid file handle\n" ); + return -EBADFD; + } + + return ioctl( mPort, ioctlReq, pData ); +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the current port + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::Disconnect() +{ + // Assume success + bool bRC = true; + + if (mPort != INVALID_HANDLE_VALUE) + { + int nClose = close( mPort ); + if (nClose == -1) + { + bRC = false; + } + + mPort = INVALID_HANDLE_VALUE; + } + + mPortName.clear(); + return bRC; +} + +/*=========================================================================== +METHOD: + ConfigureSettings (Public Method) + +DESCRIPTION: + Configure the port with the passed in parameters + +PARAMETERS: + pSettings [ I ] - Desired port settings + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::ConfigureSettings( termios * pSettings ) +{ + if (mPort == INVALID_HANDLE_VALUE || pSettings == 0) + { + return false; + } + + tcflush( mPort, TCIOFLUSH ); + int nRC = tcsetattr( mPort, TCSANOW, pSettings ); + if (nRC == -1) + { + return false; + } + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + GetSettings (Public Method) + +DESCRIPTION: + Return the current port settings + +PARAMETERS: + pSettings [ I ] - Current port settings + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::GetSettings( termios * pSettings ) +{ + if (mPort == INVALID_HANDLE_VALUE || pSettings == 0) + { + return false; + } + + // Get the COM port settings + int nRC = tcgetattr( mPort, pSettings ); + if (nRC == -1) + { + return false; + } + + // Success! + return true; +} + +/*=========================================================================== +METHOD: + CancelIO (Public Method) + +DESCRIPTION: + Cancel any in-progress I/O + +PARAMETERS: + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelIO() +{ + if (mPort == INVALID_HANDLE_VALUE) + { + return false; + } + + bool bRxCancel = CancelRx(); + bool bTxCancel = CancelTx(); + + return (bRxCancel && bTxCancel); +} + +/*=========================================================================== +METHOD: + CancelRx (Public Method) + +DESCRIPTION: + Cancel any in-progress receive operation + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelRx() +{ + if (mPort == INVALID_HANDLE_VALUE || mpRxCallback == 0) + { + return false; + } + + int nReadRC = aio_cancel( mPort, &mReadIO ); + mpRxCallback = 0; + + if (nReadRC == -1 && errno == EBADF) + { + // aio_cancel is broken if file pointer is bad + // wait for completion + TRACE( "cComm::CancelRx manual wait %d\n", mPort ); + + DWORD nTemp; + if (mReadCanceled.Wait( INFINITE, nTemp ) == 0) + { + return true; + } + + // Timeout or some other failure + return false; + } + + return (nReadRC == AIO_CANCELED); +} + +/*=========================================================================== +METHOD: + CancelTx (Public Method) + +DESCRIPTION: + Cancel any in-progress transmit operation + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::CancelTx() +{ + if (mPort == INVALID_HANDLE_VALUE) + { + return false; + } + + mbCancelWrite = true; + + return true; +} + +/*=========================================================================== +METHOD: + RxData (Public Method) + +DESCRIPTION: + Receive data + +PARAMETERS: + pBuf [ I ] - Buffer to contain received data + bufSz [ I ] - Amount of data to be received + pCallback [ I ] - Callback object to be exercised when the + operation completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::RxData( + BYTE * pBuf, + ULONG bufSz, + cIOCallback * pCallback ) +{ + if (IsValid() == false || mpRxCallback != 0) + { + return false; + } + + if (pCallback == 0) + { + // Not interested in being notified, but we still need a value + // for this so that only one outstanding I/O operation is active + // at any given point in time + mpRxCallback = (cIOCallback * )1; + } + else + { + mpRxCallback = pCallback; + } + + mReadIO.aio_fildes = mPort; + mReadIO.aio_buf = pBuf; + mReadIO.aio_nbytes = bufSz; + mReadIO.aio_sigevent.sigev_notify = SIGEV_THREAD; + mReadIO.aio_sigevent.sigev_notify_function = RxCompletionRoutine; + mReadIO.aio_sigevent.sigev_value.sival_ptr = this; + mReadIO.aio_offset = 0; + + int nRet = aio_read( &mReadIO ); + if (nRet != 0) + { + TRACE( "cComm::RxData() = %d, %s\n", nRet, strerror( errno ) ); + errno = 0; + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + TxData (Public Method) + +DESCRIPTION: + Transmit data + +PARAMETERS: + pBuf [ I ] - Data to be transmitted + bufSz [ I ] - Amount of data to be transmitted + +RETURN VALUE: + bool +===========================================================================*/ +bool cComm::TxData( + const BYTE * pBuf, + ULONG bufSz ) +{ + if (IsValid() == false) + { + return false; + } + +#ifdef DEBUG + ULONGLONG nStart = GetTickCount(); +#endif + + // Allow ourselves to be interupted + mbCancelWrite = false; + + // This seems a bit pointless, but we're still going verify + // the device is ready for writing, and give it up to + // (1000 + num bytes) MS to be ready (in 100 MS chunks) + + struct timeval TimeOut; + fd_set set; + + int nReady = 0; + int nCount = 0; + + while ( nReady == 0 ) + { + if (mbCancelWrite == true) + { + TRACE( "cComm::TxData() write canceled before device was ready\n" ); + return false; + } + + if (nCount >= (1000 + bufSz) / 100) + { + // Timeout is expired + break; + } + + FD_ZERO( &set ); + FD_SET( mPort, &set ); + TimeOut.tv_sec = 0; + TimeOut.tv_usec = 100000; + nReady = select( mPort + 1, NULL, &set, NULL, &TimeOut ); + + nCount++; + } + + if (nReady <= 0) + { + TRACE( "cComm::TxData() Unable to get device ready for" + " Write, error %d: %s\n", + nReady, + strerror( nReady) ); + return false; + } + + int nRet = write( mPort, pBuf, bufSz ); + if (nRet != bufSz) + { + TRACE( "cComm::TxData() write returned %d instead of %lu\n", + nRet, + bufSz ); + return false; + } + +#ifdef DEBUG + TRACE( "Write of %lu bytes took %llu miliseconds\n", bufSz, GetTickCount() - nStart ); +#endif + + return true; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/Comm.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/Comm.h new file mode 100755 index 0000000..1f09fe9 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/Comm.h @@ -0,0 +1,153 @@ +/*=========================================================================== +FILE: + Comm.h + +DESCRIPTION: + Declaration of cComm class + +PUBLIC CLASSES AND METHODS: + cComm + This class wraps low level port communications + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Event.h" + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// Class cIOCallback +/*=========================================================================*/ +class cIOCallback +{ + public: + // (Inline) Constructor + cIOCallback() { }; + + // (Inline) Destructor + virtual ~cIOCallback() { }; + + // The I/O has been completed, process the results + virtual void IOComplete( + DWORD status, + DWORD bytesTransferred ) = 0; +}; + +/*=========================================================================*/ +// Class cComm +/*=========================================================================*/ +class cComm +{ + public: + // Constructor + cComm(); + + // Destructor + virtual ~cComm(); + + // Is this object valid? + virtual bool IsValid(); + + // Connect to the specified port + virtual bool Connect( LPCSTR pPort ); + + // Run an IOCTL on the open file handle + int RunIOCTL( + UINT ioctlReq, + void * pData ); + + // Disconnect from the current port + virtual bool Disconnect(); + + // Configure the port with the passed in parameters + bool ConfigureSettings( termios * pSettings ); + + // Return the current port settings + bool GetSettings( termios * pSettings ); + + // Cancel any in-progress I/O + bool CancelIO(); + + // Cancel any in-progress receive operation + bool CancelRx(); + + // Cancel any in-progress transmit operation + bool CancelTx(); + + // Receive data + virtual bool RxData( + BYTE * pBuf, + ULONG bufSz, + cIOCallback * pCallback ); + + // Transmit data + virtual bool TxData( + const BYTE * pBuf, + ULONG bufSz ); + + // (Inline) Return current port name + virtual std::string GetPortName() const + { + return mPortName; + }; + + // Are we currently connected to a port? + bool IsConnected() + { + return (mPort != INVALID_HANDLE_VALUE); + }; + + protected: + /* Name of current port */ + std::string mPortName; + + /* Handle to COM port */ + int mPort; + + // Read IO settings + aiocb mReadIO; + + /* Read callbacks */ + cIOCallback * mpRxCallback; + + // Cancel the write request? + bool mbCancelWrite; + + // Read callback cancelation notification + cEvent mReadCanceled; + + // Rx completion routine is allowed complete access + friend VOID RxCompletionRoutine( sigval returnSignal ); +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreDatabase.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreDatabase.cpp new file mode 100755 index 0000000..e9bf5e4 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreDatabase.cpp @@ -0,0 +1,3187 @@ +/*=========================================================================== +FILE: + CoreDatabase.cpp + +DESCRIPTION: + Implementation of cCoreDatabase class + +PUBLIC CLASSES AND METHODS: + cCoreDatabase + This class represents the run-time (read only) version of the + core library database + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" + +#include "CoreDatabase.h" +#include "DB2NavTree.h" + +#include "CoreUtilities.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Uncomment out to enable database load/save timing through cCoreDatabase +// #define TIME_DB 1 + +// Database table file names +LPCSTR DB2_FILE_PROTOCOL_FIELD = "Field.txt"; +LPCSTR DB2_FILE_PROTOCOL_STRUCT = "Struct.txt"; +LPCSTR DB2_FILE_PROTOCOL_ENTITY = "Entity.txt"; +LPCSTR DB2_FILE_ENUM_MAIN = "Enum.txt"; +LPCSTR DB2_FILE_ENUM_ENTRY = "EnumEntry.txt"; + +// Database table file names +LPCSTR DB2_TABLE_PROTOCOL_FIELD = "Field"; +LPCSTR DB2_TABLE_PROTOCOL_STRUCT = "Struct"; +LPCSTR DB2_TABLE_PROTOCOL_ENTITY = "Entity"; +LPCSTR DB2_TABLE_ENUM_MAIN = "Enum"; +LPCSTR DB2_TABLE_ENUM_ENTRY = "Enum Entry"; + +// An empty (but not NULL) string +LPCSTR EMPTY_STRING = ""; + +// Value seperator for database text +LPCSTR DB2_VALUE_SEP = "^"; + +// Sub-value (i.e. within a particular value) seperator for database text +LPCSTR DB2_SUBVAL_SEP = ","; + +// Maximum amount of recursion allowed in protocol entity structure processing +const ULONG MAX_NESTING_LEVEL = 32; + +// The default logger (for backwards compatibility) +cDB2TraceLog gDB2DefaultLog; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + CopyQuotedString (Public Method) + +DESCRIPTION: + Convert a string (in quotes) to a string (minus) quotes and copy + into an allocated buffer + +PARAMETERS: + pString [ I ] - The string being de-quoted/copied + +RETURN VALUE: + LPSTR: The copy (returns 0 upon error) +===========================================================================*/ +LPCSTR CopyQuotedString( LPSTR pString ) +{ + // Get string length + ULONG len = (ULONG)strlen( pString ); + + // Adjust to remove trailing spaces + while (len > 0 && pString[len - 1] == ' ') + { + pString[len - 1] = 0; + len--; + } + + // Long enough (and quoted?) + if ( (len >= 2) + && (pString[0] == '\"') + && (pString[len - 1] == '\"') ) + { + if (len == 2) + { + return EMPTY_STRING; + } + else + { + // Attempt to allocate a copy + LPSTR pRet = new char[len - 1]; + if (pRet != 0) + { + ULONG bytes = (len - 2) * sizeof( char ); + memcpy( (PVOID)pRet, (LPCVOID)&pString[1], (SIZE_T)bytes ); + pRet[len - 2] = 0; + + return pRet; + } + } + } + + return 0; +} + +/*=========================================================================*/ +// sDB2ProtocolEntity Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2ProtocolEntity::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: Type + // 1: "Key" + // 2: "Name" + // 3: Struct ID + // 4: Format specifier ID (optional) + // 5: Internal only flag (optional) + // 6: Extended format specifier ID (optional) + const ULONG NUM_REQ_VALS = 4; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[2] ); + if (pCopy != 0) + { + mpName = pCopy; + mType = (eDB2EntityType)strtol( tokens[0], 0, 10 ); + + // Convert key/populate ID + mID.push_back( (ULONG)mType ); + CSVStringToContainer( DB2_SUBVAL_SEP, tokens[1], mID, false ); + + mStructID = strtol( tokens[3], 0, 10 ); + + // Format specifier? + if (toks > NUM_REQ_VALS) + { + mFormatID = strtol( tokens[NUM_REQ_VALS], 0, 10 ); + } + + // Internal only flag? + if (toks > NUM_REQ_VALS + 1) + { + mbInternal = (strtoul( tokens[NUM_REQ_VALS + 1], 0, 10 ) != 0); + } + + // Extended format specifier ID? + if (toks > NUM_REQ_VALS + 2) + { + mFormatExID = strtol( tokens[NUM_REQ_VALS + 2], 0, 10 ); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2ProtocolEntity::IsValid() const +{ + // The type has to be valid + if (::IsValid( mType ) == false) + { + return false; + } + + // The ID must consists of at least two entries + if (mID.size() < 2) + { + return false; + } + + // The first entry in the ID has to be the type + if (mID[0] != (ULONG)mType) + { + return false; + } + + // The structure ID has to be >= -1) + if (mStructID < -1) + { + return false; + } + + // The format specifier has to be >= -1) + if (mFormatID < -1) + { + return false; + } + + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// sDB2Fragment Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: ID + // 1: Order + // 2: Type + // 3: Val + // 4: "Name" + // 5: Offset + // 6: Mod Type + // 7: "Mod Value" + const ULONG NUM_REQ_VALS = 8; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from modifier value and copy + LPCSTR pVal = CopyQuotedString( tokens[7] ); + if (pVal != 0) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[4] ); + if (pCopy != 0) + { + mStructID = strtoul( tokens[0], 0, 10 ); + mFragmentOrder = strtoul( tokens[1], 0, 10 ); + mFragmentValue = strtoul( tokens[3], 0, 10 ); + mFragmentOffset = strtol( tokens[5], 0, 10 ); + mFragmentType = (eDB2FragmentType)strtol( tokens[2], 0, 10 ); + mModifierType = (eDB2ModifierType)strtol( tokens[6], 0, 10 );; + mpModifierValue = pVal; + mpName = pCopy; + + bRC = IsValid(); + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::IsValid() const +{ + // The fragment type has to be valid + if (::IsValid( mFragmentType ) == false) + { + return false; + } + + // The modifier type has to be valid + if (::IsValid( mModifierType ) == false) + { + return false; + } + + // There has to be a name (possibly empty) + if (mpName == 0) + { + return false; + } + + // There has to be a modifier value (possibly empty) + if (mpModifierValue == 0) + { + return false; + } + + // Directives can only be given for the first fragment + if ( (mFragmentType == eDB2_FRAGMENT_MSB_2_LSB) + || (mFragmentType == eDB2_FRAGMENT_LSB_2_MSB) ) + { + if (mFragmentOrder > 0) + { + return false; + } + } + + // Validate modifier + switch (mModifierType) + { + case eDB2_MOD_NONE: + if (mpModifierValue != 0 && mpModifierValue[0] != 0) + { + // Modifier string needs to be empty + return false; + } + break; + + case eDB2_MOD_CONSTANT_ARRAY: + case eDB2_MOD_VARIABLE_ARRAY: + case eDB2_MOD_OPTIONAL: + case eDB2_MOD_VARIABLE_ARRAY2: + case eDB2_MOD_VARIABLE_ARRAY3: + if (mpModifierValue == 0 || mpModifierValue[0] == 0) + { + // Needs to be a modifier string + return false; + } + break; + + case eDB2_MOD_VARIABLE_STRING1: + case eDB2_MOD_VARIABLE_STRING2: + case eDB2_MOD_VARIABLE_STRING3: + if (mpModifierValue == 0 || mpModifierValue[0] == 0) + { + // Needs to be a modifier string + return false; + } + + if (mFragmentType != eDB2_FRAGMENT_FIELD) + { + // Only valid when modifying fields (strings) + return false; + } + break; + + } + + if (mFragmentType == eDB2_FRAGMENT_CONSTANT_PAD && mFragmentValue == 0) + { + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + BuildCondition (Static Public Method) + +DESCRIPTION: + Build a simple condition string + +PARAMETERS: + id [ I ] - Field ID + op [ I ] - Operator + val [ I ] - Value (or field ID) + bF2F [ I ] - Field to field expression? + +RETURN VALUE: + std::string +===========================================================================*/ +std::string sDB2Fragment::BuildCondition( + ULONG id, + eDB2Operator op, + LONGLONG val, + bool bF2F ) +{ + std::ostringstream tmp; + + if (::IsValid( op ) == true) + { + if (bF2F == false) + { + switch (op) + { + case eDB2_OP_LT: + tmp << (UINT)id << " " << "<" << val; + break; + + case eDB2_OP_LTE: + tmp << (UINT)id << " " << "<=" << val; + break; + + case eDB2_OP_EQ: + tmp << (UINT)id << " " << "=" << val; + break; + + case eDB2_OP_NEQ: + tmp << (UINT)id << " " << "!=" << val; + break; + + case eDB2_OP_GTE: + tmp << (UINT)id << " " << ">=" << val; + break; + + case eDB2_OP_GT: + tmp << (UINT)id << " " << ">" << val; + break; + + case eDB2_OP_DIV: + tmp << (UINT)id << " " << "%" << val; + break; + + case eDB2_OP_NDIV: + tmp << (UINT)id << " " << "!%" << val; + break; + } + } + else + { + switch (op) + { + case eDB2_OP_LT: + tmp << (UINT)id << " " << "f<" << val; + break; + + case eDB2_OP_LTE: + tmp << (UINT)id << " " << "f<=" << val; + break; + + case eDB2_OP_EQ: + tmp << (UINT)id << " " << "f=" << val; + break; + + case eDB2_OP_NEQ: + tmp << (UINT)id << " " << "f!=" << val; + break; + + case eDB2_OP_GTE: + tmp << (UINT)id << " " << "f>=" << val; + break; + + case eDB2_OP_GT: + tmp << (UINT)id << " " << "f>" << val; + break; + + case eDB2_OP_DIV: + tmp << (UINT)id << " " << "f%" << val; + break; + + case eDB2_OP_NDIV: + tmp << (UINT)id << " " << "f!%" << val; + break; + } + } + } + + std::string retStr = tmp.str(); + + return retStr; +} + +/*=========================================================================== +METHOD: + EvaluateCondition (Static Public Method) + +DESCRIPTION: + Evaluate a simple condition + +PARAMETERS: + valA [ I ] - Left value + op [ I ] - Operator + valB [ I ] - Right value + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::EvaluateCondition( + LONGLONG valA, + eDB2Operator op, + LONGLONG valB ) +{ + bool bOK = false; + if (::IsValid( op ) == true) + { + switch (op) + { + case eDB2_OP_LT: + bOK = (valA < valB); + break; + + case eDB2_OP_LTE: + bOK = (valA <= valB); + break; + + case eDB2_OP_EQ: + bOK = (valA == valB); + break; + + case eDB2_OP_NEQ: + bOK = (valA != valB); + break; + + case eDB2_OP_GTE: + bOK = (valA >= valB); + break; + + case eDB2_OP_GT: + bOK = (valA > valB); + break; + + case eDB2_OP_DIV: + bOK = ((valA % valB) == 0); + break; + + case eDB2_OP_NDIV: + bOK = ((valA % valB) != 0); + break; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ParseCondition (Static Public Method) + +DESCRIPTION: + Parse a simple condition + +PARAMETERS: + pCondition [ I ] - Condition string + id [ O ] - Field ID + op [ O ] - Operator + val [ O ] - Value (or field ID) + bF2F [ O ] - Field to field expression? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::ParseCondition( + LPCSTR pCondition, + ULONG & id, + eDB2Operator & op, + LONGLONG & val, + bool & bF2F ) +{ + // Assume error + bool bOK = false; + + // Even a condition to start with? + if (pCondition == 0 || pCondition == EMPTY_STRING) + { + return bOK; + } + + // Parse condition to tokens (field ID operator value) + int nSize = strlen( pCondition ) + 1; + + char * pCopy = new char[ nSize ]; + if (pCopy == NULL) + { + return false; + } + + memcpy( pCopy, pCondition, nSize ); + + std::vector tokens; + ParseTokens( " ", pCopy, tokens ); + + if (tokens.size() == 3) + { + // Covert first token to field ID + ULONG fieldID = strtoul( tokens[0], 0, 10 ); + + // Grab the value for the given field ID + LONGLONG fieldVal = 0; + bOK = StringToLONGLONG( tokens[2], 0, fieldVal ); + if (bOK == true) + { + std::string opStr = tokens[1]; + + // std::string version of Trim() + int nFirst = opStr.find_first_not_of( ' ' ); + int nLast = opStr.find_last_not_of( ' ' ); + if (nFirst == -1 || nLast == -1) + { + // Something went horribly wrong, empty string or all spaces + delete [] pCopy; + return false; + } + + opStr = opStr.substr( nFirst, nLast - nFirst + 1 ); + + // std::string version of MakeLower() + transform( opStr.begin(), opStr.end(), opStr.begin(), tolower ); + + bF2F = false; + if (opStr == "<") + { + op = eDB2_OP_LT; + } + else if (opStr == "<=") + { + op = eDB2_OP_LTE; + } + else if (opStr == "=") + { + op = eDB2_OP_EQ; + } + else if (opStr == "!=") + { + op = eDB2_OP_NEQ; + } + else if (opStr == ">=") + { + op = eDB2_OP_GTE; + } + else if (opStr == ">") + { + op = eDB2_OP_GT; + } + else if (opStr == "%") + { + op = eDB2_OP_DIV; + } + else if (opStr == "!%") + { + op = eDB2_OP_NDIV; + } + else if (opStr == "f<") + { + bF2F = true; + op = eDB2_OP_LT; + } + else if (opStr == "f<=") + { + bF2F = true; + op = eDB2_OP_LTE; + } + else if (opStr == "f=") + { + bF2F = true; + op = eDB2_OP_EQ; + } + else if (opStr == "f!=") + { + bF2F = true; + op = eDB2_OP_NEQ; + } + else if (opStr == "f>=") + { + bF2F = true; + op = eDB2_OP_GTE; + } + else if (opStr == "f>") + { + bF2F = true; + op = eDB2_OP_GT; + } + else if (opStr == "f%") + { + bF2F = true; + op = eDB2_OP_DIV; + } + else if (opStr == "f!%") + { + bF2F = true; + op = eDB2_OP_NDIV; + } + else + { + bOK = false; + } + + if (bOK == true) + { + id = fieldID; + val = fieldVal; + } + } + } + + delete [] pCopy; + + return bOK; +} + +/*=========================================================================== +METHOD: + BuildExpression (Static Public Method) + +DESCRIPTION: + Build a simple expression string + +PARAMETERS: + id [ I ] - Field ID + op [ I ] - Operator + val [ I ] - Value (or field ID) + bF2F [ I ] - Field to field expression? + +RETURN VALUE: + std::string +===========================================================================*/ +std::string sDB2Fragment::BuildExpression( + ULONG id, + eDB2ExpOperator op, + LONGLONG val, + bool bF2F ) +{ + std::ostringstream tmp; + + if (::IsValid( op ) == true) + { + if (bF2F == false) + { + switch (op) + { + case eDB2_EXPOP_ADD: + tmp << (UINT)id << " " << "+" << val; + break; + + case eDB2_EXPOP_SUB: + tmp << (UINT)id << " " << "-" << val; + break; + + case eDB2_EXPOP_MUL: + tmp << (UINT)id << " " << "*" << val; + break; + + case eDB2_EXPOP_DIV: + tmp << (UINT)id << " " << "/" << val; + break; + + case eDB2_EXPOP_REM: + tmp << (UINT)id << " " << "%" << val; + break; + + case eDB2_EXPOP_MIN: + tmp << (UINT)id << " " << "min" << val; + break; + + case eDB2_EXPOP_MAX: + tmp << (UINT)id << " " << "max" << val; + break; + } + } + else + { + switch (op) + { + case eDB2_EXPOP_ADD: + tmp << (UINT)id << " " << "f+" << val; + break; + + case eDB2_EXPOP_SUB: + tmp << (UINT)id << " " << "f-" << val; + break; + + case eDB2_EXPOP_MUL: + tmp << (UINT)id << " " << "f*" << val; + break; + + case eDB2_EXPOP_DIV: + tmp << (UINT)id << " " << "f/" << val; + break; + + case eDB2_EXPOP_REM: + tmp << (UINT)id << " " << "f%" << val; + break; + + case eDB2_EXPOP_MIN: + tmp << (UINT)id << " " << "fmin" << val; + break; + + case eDB2_EXPOP_MAX: + tmp << (UINT)id << " " << "fmax" << val; + break; + } + } + } + + std::string retStr = tmp.str(); + + return retStr; +} + +/*=========================================================================== +METHOD: + EvaluateExpression (Static Public Method) + +DESCRIPTION: + Evaluate a simple expression + +PARAMETERS: + valA [ I ] - Left value + op [ I ] - Operator + valB [ I ] - Right value + res [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::EvaluateExpression( + LONGLONG valA, + eDB2ExpOperator op, + LONGLONG valB, + LONGLONG & res ) +{ + bool bOK = false; + if (::IsValid( op ) == true) + { + bOK = true; + switch (op) + { + case eDB2_EXPOP_ADD: + res = valA + valB; + break; + + case eDB2_EXPOP_SUB: + res = valA - valB; + break; + + case eDB2_EXPOP_MUL: + res = valA * valB; + break; + + case eDB2_EXPOP_DIV: + res = valA / valB; + break; + + case eDB2_EXPOP_REM: + res = valA % valB; + break; + + case eDB2_EXPOP_MIN: + res = valA; + if (valA > valB) + { + res = valB; + } + break; + + case eDB2_EXPOP_MAX: + res = valA; + if (valA < valB) + { + res = valB; + } + break; + + default: + bOK = false; + break; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ParseExpression (Static Public Method) + +DESCRIPTION: + Parse a simple expression + +PARAMETERS: + pExpr [ I ] - Expression string + id [ O ] - Field ID + op [ O ] - Operator + val [ O ] - Value (or Field ID) + bF2F [ O ] - Field to field expression? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Fragment::ParseExpression( + LPCSTR pExpr, + ULONG & id, + eDB2ExpOperator & op, + LONGLONG & val, + bool & bF2F ) +{ + // Assume error + bool bOK = false; + + // Even a condition to start with? + if (pExpr == 0 || pExpr == EMPTY_STRING) + { + return bOK; + } + + // Parse condition to tokens (field ID operator value) + int nSize = strlen( pExpr ) + 1; + + char * pCopy = new char[ nSize ]; + if (pCopy == NULL) + { + return false; + } + + memcpy( pCopy, pExpr, nSize ); + + std::vector tokens; + ParseTokens( " ", pCopy, tokens ); + + if (tokens.size() == 3) + { + // Covert first token to field ID + ULONG fieldID = strtoul( tokens[0], 0, 10 ); + + // Grab the value for the given field ID + LONGLONG fieldVal = 0; + bOK = StringToLONGLONG( tokens[2], 0, fieldVal ); + if (bOK == true) + { + std::string opStr = tokens[1]; + + // std::string version of Trim() + int nFirst = opStr.find_first_not_of( ' ' ); + int nLast = opStr.find_last_not_of( ' ' ); + if (nFirst == -1 || nLast == -1) + { + // Something went horribly wrong, empty string or all spaces + delete [] pCopy; + return false; + } + + opStr = opStr.substr( nFirst, nLast - nFirst + 1 ); + + // std::string version of MakeLower() + transform( opStr.begin(), opStr.end(), opStr.begin(), tolower ); + + bF2F = false; + if (opStr == "+") + { + op = eDB2_EXPOP_ADD; + } + else if (opStr == "-") + { + op = eDB2_EXPOP_SUB; + } + else if (opStr == "*") + { + op = eDB2_EXPOP_MUL; + } + else if (opStr == "/") + { + op = eDB2_EXPOP_DIV; + } + else if (opStr == "%") + { + op = eDB2_EXPOP_REM; + } + else if (opStr == "min") + { + op = eDB2_EXPOP_MIN; + } + else if (opStr == "max") + { + op = eDB2_EXPOP_MAX; + } + else if (opStr == "f+") + { + bF2F = true; + op = eDB2_EXPOP_ADD; + } + else if (opStr == "f-") + { + bF2F = true; + op = eDB2_EXPOP_SUB; + } + else if (opStr == "f*") + { + bF2F = true; + op = eDB2_EXPOP_MUL; + } + else if (opStr == "f/") + { + bF2F = true; + op = eDB2_EXPOP_DIV; + } + else if (opStr == "f%") + { + bF2F = true; + op = eDB2_EXPOP_REM; + } + else if (opStr == "fmin") + { + bF2F = true; + op = eDB2_EXPOP_MIN; + } + else if (opStr == "fmax") + { + bF2F = true; + op = eDB2_EXPOP_MAX; + } + else + { + bOK = false; + } + + if (bOK == true) + { + id = fieldID; + val = fieldVal; + } + } + } + + delete [] pCopy; + return bOK; +} + +/*=========================================================================*/ +// sDB2Field Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Field::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: ID + // 1: "Name" + // 2: Size + // 3: Field type + // 4: Field type value + // 5: Hexadecimal + // 6: Description ID (optional) + // 7: Internal only flag (optional) + const ULONG NUM_REQ_VALS = 6; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[1] ); + if (pCopy != 0) + { + mID = strtoul( tokens[0], 0, 10 ); + mSize = strtoul( tokens[2], 0, 10 ); + mpName = pCopy; + mType = (eDB2FieldType)strtol( tokens[3], 0, 10 ); + mTypeVal = strtoul( tokens[4], 0, 10 ); + mbHex = (strtoul( tokens[5], 0, 10 ) != 0); + + // Description ID? + if (toks > NUM_REQ_VALS) + { + mDescriptionID = strtol( tokens[NUM_REQ_VALS], 0, 10 ); + } + + // Internal only flag? + if (toks > NUM_REQ_VALS + 1) + { + mbInternal = (strtoul( tokens[NUM_REQ_VALS + 1], 0, 10 ) != 0); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Field::IsValid() const +{ + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + // The field type must be valid + if (::IsValid( mType ) == false) + { + return false; + } + + // For validating size + ULONG minSz = 1; + ULONG maxSz = 8; + ULONG modVal = 0; + + // What type of field is this? + if (mType == eDB2_FIELD_STD) + { + eDB2StdFieldType ft = (eDB2StdFieldType)mTypeVal; + if (::IsValid( ft ) == false) + { + return false; + } + + switch (ft) + { + case eDB2_FIELD_STDTYPE_BOOL: + maxSz = 64; + break; + + case eDB2_FIELD_STDTYPE_INT16: + case eDB2_FIELD_STDTYPE_UINT16: + maxSz = 16; + break; + + case eDB2_FIELD_STDTYPE_INT32: + case eDB2_FIELD_STDTYPE_UINT32: + case eDB2_FIELD_STDTYPE_FLOAT32: + maxSz = 32; + break; + + case eDB2_FIELD_STDTYPE_INT64: + case eDB2_FIELD_STDTYPE_UINT64: + case eDB2_FIELD_STDTYPE_FLOAT64: + maxSz = 64; + break; + + case eDB2_FIELD_STDTYPE_STRING_A: + case eDB2_FIELD_STDTYPE_STRING_U8: + // One character, no maximum + minSz = 8; + maxSz = 0; + modVal = 8; + break; + + case eDB2_FIELD_STDTYPE_STRING_U: + // One UNICODE character, no maximum + minSz = 16; + maxSz = 0; + modVal = 16; + break; + + case eDB2_FIELD_STDTYPE_STRING_ANT: + case eDB2_FIELD_STDTYPE_STRING_UNT: + case eDB2_FIELD_STDTYPE_STRING_U8NT: + // Size needs to be specified as 0 + minSz = maxSz = 0; + break; + } + } + else + { + // Enum must be between 1 - 32 bits in size + maxSz = 32; + } + + if (mSize < minSz) + { + return false; + } + + if (maxSz != 0 && mSize > maxSz) + { + return false; + } + + if (modVal != 0 && (mSize % modVal) != 0) + { + return false; + } + + if (mDescriptionID < -1) + { + return false; + } + + // The name must be valid + std::string name = mpName; + if (name.find( DB2_VALUE_SEP ) != -1 || name.find( DB2_SUBVAL_SEP ) != -1) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// sDB2Category Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Category::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: ID + // 1: "Name" + // 2: Description ID + // 3: Parent ID + const ULONG NUM_REQ_VALS = 4; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[1] ); + if (pCopy != 0) + { + mID = strtoul( tokens[0], 0, 10 ); + mParentID = strtol( tokens[3], 0, 10 ); + mpName = pCopy; + + // Old format used to be a description string, so + // first check for quotes + if (tokens[2][0] != '\"') + { + mDescriptionID = strtol( tokens[2], 0, 10 ); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Category::IsValid() const +{ + // The parent ID has to be greater than or equal to -1 + if (mParentID < -1) + { + return false; + } + + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + if (mDescriptionID < -1) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// sDB2NVItem Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2NVItem::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: NV Item number + // 1: "Name" + // 2: "Categories" + // 3: Description ID + const ULONG NUM_REQ_VALS = 4; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[1] ); + if (pCopy != 0) + { + CSVStringToContainer( DB2_SUBVAL_SEP, tokens[2], mCategoryIDs ); + + mItem = strtoul( tokens[0], 0, 10 ); + mpName = pCopy; + + // Old format used to be a description string, so + // first check for quotes + if (tokens[3][0] != '\"') + { + mDescriptionID = strtol( tokens[3], 0, 10 ); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2NVItem::IsValid() const +{ + // There has to be at least one category ID + ULONG cats = (ULONG)mCategoryIDs.size(); + if (cats < 1) + { + return false; + } + + // The category IDs have to be greater than or equal to -1 + std::set ::const_iterator pIter = mCategoryIDs.begin(); + while (pIter != mCategoryIDs.end()) + { + if (*pIter++ < -1) + { + return false; + } + } + + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + if (mDescriptionID < -1) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// sDB2Enum Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Enum::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: ID + // 1: "Name" + // 2: Description ID + // 3: Internal? + const ULONG NUM_REQ_VALS = 4; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[1] ); + if (pCopy != 0) + { + mID = strtoul( tokens[0], 0, 10 ); + mbInternal = (strtoul( tokens[3], 0, 10 ) != 0); + mpName = pCopy; + + // Old format used to be a description string, so + // first check for quotes + if (tokens[2][0] != '\"') + { + mDescriptionID = strtol( tokens[2], 0, 10 ); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2Enum::IsValid() const +{ + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + if (mDescriptionID < -1) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// sDB2EnumEntry Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FromString (Public Method) + +DESCRIPTION: + Populate this object from a string + +PARAMETERS: + pStr [ I ] - String to populate object from + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2EnumEntry::FromString( LPSTR pStr ) +{ + bool bRC = false; + + // Should be + // 0: ID + // 1: Value + // 2: "Name" + // 3: Description ID (optional) + const ULONG NUM_REQ_VALS = 3; + + std::vector tokens; + ParseTokens( DB2_VALUE_SEP, pStr, tokens ); + + ULONG toks = (ULONG)tokens.size(); + if (toks >= NUM_REQ_VALS) + { + // Remove quotes from name string and copy + LPCSTR pCopy = CopyQuotedString( tokens[2] ); + if (pCopy != 0) + { + mID = strtoul( tokens[0], 0, 10 ); + mpName = pCopy; + + // Enum entries are signed by definition, but can be entered + // in hexadecimal as they may be unsigned in practice + LONG val = -1; + StringToLONG( tokens[1], 0, val ); + mValue = (INT)val; + + // Determine hexadecimal flag by performing case-insensitve comparison + // of the value string's first two characters with "0x" + mbHex = (strncmp( tokens[1], "0x", 2 ) == 0); + + // Description ID? + if (toks > NUM_REQ_VALS) + { + mDescriptionID = strtol( tokens[NUM_REQ_VALS], 0, 10 ); + } + + bRC = IsValid(); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsValid (Public Method) + +DESCRIPTION: + Is this object valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sDB2EnumEntry::IsValid() const +{ + // There has to be a non-empty name + if (mpName == 0 || mpName[0] == 0) + { + return false; + } + + if (mDescriptionID < -1) + { + return false; + } + + return true; +} + +/*=========================================================================*/ +// cCoreDatabase Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cCoreDatabase (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cCoreDatabase::cCoreDatabase() + : mpLog( &gDB2DefaultLog ) +{ + // Nothing to do - database empty, call Initialize() +} + +/*=========================================================================== +METHOD: + ~cCoreDatabase (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cCoreDatabase::~cCoreDatabase() +{ + Exit(); +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Version to Load from file + Initialize the database - this must be done once (and only once) + prior to the database being accessed + +PARAMETERS + pBasePath [ I ] - Base path to database files + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::Initialize( LPCSTR pBasePath ) +{ + bool bRC = true; + + // Cleanup the last database (if necessary) + Exit(); + + bRC &= LoadEnumTables( pBasePath ); + bRC &= LoadStructureTables( pBasePath ); + + // Build the modifier tables + bRC &= BuildModifierTables(); + + return bRC; +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Version to Load from internal pointers + Initialize the database - this must be done once (and only once) + prior to the database being accessed + +PARAMETERS + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::Initialize() +{ + bool bRC = true; + + // Cleanup the last database (if necessary) + Exit(); + + bRC &= LoadEnumTables(); + bRC &= LoadStructureTables(); + + // Build the modifier tables + bRC &= BuildModifierTables(); + + return bRC; +} + +/*=========================================================================== +METHOD: + Exit (Public Method) + +DESCRIPTION: + Exit (cleanup) the database + +RETURN VALUE: + None +===========================================================================*/ +void cCoreDatabase::Exit() +{ + FreeDB2Table( mEntityFields ); + FreeDB2Table( mEntityStructs ); + FreeDB2Table( mProtocolEntities ); + + FreeDB2Table( mEnumNameMap ); + FreeDB2Table( mEnumEntryMap ); + + tDB2EntityNavMap::iterator pIter = mEntityNavMap.begin(); + while (pIter != mEntityNavMap.end()) + { + cDB2NavTree * pNav = pIter->second; + if (pNav != 0) + { + delete pNav; + } + + pIter++; + } + + mEntityNavMap.clear(); +} + +/*=========================================================================== +METHOD: + GetEntityNavTree (Public Method) + +DESCRIPTION: + Get the entity navigation tree for the given protocol entity, if none + exists one will be built and returned + +PARAMETERS + key [ I ] - Protocol entity key + +RETURN VALUE: + const cDB2NavTree * (0 upon error) +===========================================================================*/ +const cDB2NavTree * cCoreDatabase::GetEntityNavTree( + const std::vector & key ) const +{ + // Look up entity definition (to find DB string address) + sDB2ProtocolEntity tmpEntity; + bool bFound = FindEntity( key, tmpEntity ); + + // Did we find it? + if (bFound == false) + { + // No matching definition in database + return 0; + } + + // Obtain the canonical key and use it to look up the nav tree + tDB2EntityNavMap::const_iterator pIter = mEntityNavMap.find( key ); + if (pIter != mEntityNavMap.end()) + { + return pIter->second; + } + + // None found, go ahead and build one + cDB2NavTree * pNavTree = new cDB2NavTree( *this ); + if (pNavTree != 0) + { + bool bOK = pNavTree->BuildTree( key ); + if (bOK == true) + { + // Store it and return it to the user + std::pair , cDB2NavTree *> e( key, pNavTree ); + mEntityNavMap.insert( e ); + } + else + { + delete pNavTree; + pNavTree = 0; + } + } + + return pNavTree; +} + +/*=========================================================================== +METHOD: + FindEntity (Public Method) + +DESCRIPTION: + Find the protocol entity with the specified extended ID + +PARAMETERS + key [ I ] - Protocol entity key to find + entity [ O ] - Protocol entity (if found) + +RETURN VALUE: + bool - Success? +===========================================================================*/ +bool cCoreDatabase::FindEntity( + const std::vector & key, + sDB2ProtocolEntity & entity ) const +{ + // Assume failure + bool bFound = false; + + tDB2EntityMap::const_iterator pEntity = mProtocolEntities.find( key ); + if (pEntity != mProtocolEntities.end()) + { + entity = pEntity->second; + bFound = true; + } + + return bFound; +} + +/*=========================================================================== +METHOD: + FindEntity (Public Method) + +DESCRIPTION: + Find the protocol entity with the specified name + +PARAMETERS + pEntityName [ I ] - Protocol entity name to find + entity [ O ] - Protocol entity (if found) + +RETURN VALUE: + bool - Success? +===========================================================================*/ +bool cCoreDatabase::FindEntity( + LPCSTR pEntityName, + sDB2ProtocolEntity & entity ) const +{ + // Assume failure + bool bFound = false; + if (pEntityName != 0 && pEntityName[0] != 0) + { + tDB2EntityNameMap::const_iterator pIter = mEntityNames.find( pEntityName ); + if (pIter != mEntityNames.end()) + { + const std::vector & key = pIter->second; + bFound = FindEntity( key, entity ); + } + } + + return bFound; +} + +/*=========================================================================== +METHOD: + MapEntityNameToID (Public Method) + +DESCRIPTION: + Map a protocol entity name to an ID + +PARAMETERS + pName [ I ] - Protocol entity name + key [ O ] - Upon success, the ID corresponding to protocol entity + +RETURN VALUE: + bool - Success? +===========================================================================*/ +bool cCoreDatabase::MapEntityNameToID( + LPCSTR pName, + std::vector & key ) const +{ + // Assume failure + bool bOK = false; + + if (pName != 0 && pName[0] != 0) + { + std::string tmp = pName; + + // std::string version of Trim() + int nFirst = tmp.find_first_not_of( ' ' ); + int nLast = tmp.find_last_not_of( ' ' ); + if (nFirst == -1 || nLast == -1) + { + // Something went wrong, empty string or all spaces + return false; + } + + tmp = tmp.substr( nFirst, nLast - nFirst + 1 ); + + + tDB2EntityNameMap::const_iterator pIter = mEntityNames.find( tmp.c_str() ); + if (pIter != mEntityNames.end()) + { + key = pIter->second; + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + MapEnumToString (Public Method) + +DESCRIPTION: + Map the given enum value (specified by enum ID, and enum value) to + the enum value name string + +PARAMETERS + enumID [ I ] - ID of the enumeration + enumVal [ I ] - Enum value to map + bSimpleErrFmt [ I ] - If the eunum value cannot be mapped to a string + what should this method return? + + If 'true' then just the value as a string + If 'false' then the enum ID, value, and 'Unknown' + + bHex [ I ] - Hexadecimal output on mapping error? + +RETURN VALUE: + std::string - The enum name (or error string if enum value is not found) +===========================================================================*/ +std::string cCoreDatabase::MapEnumToString( + ULONG enumID, + int enumVal, + bool bSimpleErrFmt, + bool bHex ) const +{ + std::string retStr = ""; + + // Form the lookup key + std::pair key( enumID, enumVal ); + + // Look up the enum value descriptor + tDB2EnumEntryMap::const_iterator pVals = mEnumEntryMap.find( key ); + if (pVals != mEnumEntryMap.end()) + { + const sDB2EnumEntry & entry = pVals->second; + retStr = entry.mpName; + } + + // No string? + if (retStr.size() <= 0) + { + std::ostringstream tmp; + + if (bSimpleErrFmt == false) + { + tmp << "Unknown [" << (UINT)enumID << "/"; + } + + if (bHex == true) + { + tmp << std::ios_base::hex << std::ios_base::uppercase + << std::ios_base::showbase << enumVal; + } + else + { + tmp << enumVal; + } + + retStr = tmp.str(); + } + + return retStr; +} + +/*=========================================================================== +METHOD: + MapEnumToString (Public Method) + +DESCRIPTION: + Map the given enum value (specified by enum name, and enum value) to + the enum value name string + +PARAMETERS + pEnumName [ I ] - Name of the enumeration + enumVal [ I ] - Enum value to map + bSimpleErrFmt [ I ] - If the eunum value cannot be mapped to a string + what should this method return? + + If 'true' then just the value as a string + If 'false' then the enum ID, value, and 'Unknown' + + bHex [ I ] - Hexadecimal output on mapping error? + +RETURN VALUE: + std::string - The enum name (or error string if enum value is not found) +===========================================================================*/ +std::string cCoreDatabase::MapEnumToString( + LPCSTR pEnumName, + int enumVal, + bool bSimpleErrFmt, + bool bHex ) const +{ + std::string retStr = ""; + + tDB2EnumMap::const_iterator pEnumMapIter = mEnumMap.find( pEnumName ); + if (pEnumMapIter != mEnumMap.end()) + { + const std::map & entries = pEnumMapIter->second.second; + std::map ::const_iterator pEntry; + + pEntry = entries.find( enumVal ); + if (pEntry != entries.end()) + { + retStr = pEntry->second; + } + } + + // No string? + if (retStr.size() <= 0) + { + std::ostringstream tmp; + + if (bSimpleErrFmt == false) + { + if (pEnumName == 0) + { + pEnumName = "?"; + } + + tmp << "Unknown [" << pEnumName << "/"; + } + + if (bHex == true) + { + tmp << std::ios_base::hex << std::ios_base::uppercase + << std::ios_base::showbase << enumVal; + } + else + { + tmp << enumVal; + } + + retStr = tmp.str(); + } + + return retStr; +} + +/*=========================================================================== +METHOD: + AssembleEnumMap (Internal Method) + +DESCRIPTION: + Assemble the internal enum map from the enum and enum entry tables + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::AssembleEnumMap() +{ + bool bOK = true; + + // Empty it out first + mEnumMap.clear(); + + tDB2EnumEntryMap::const_iterator pEntry = mEnumEntryMap.begin(); + if (pEntry == mEnumEntryMap.end()) + { + return bOK; + } + + // Set initial enum ID + ULONG currentID = pEntry->second.mID; + + std::map entries; + while (pEntry != mEnumEntryMap.end()) + { + const sDB2EnumEntry & entry = pEntry->second; + pEntry++; + + if (entry.IsValid() == false) + { + continue; + } + + if (currentID != entry.mID) + { + if (entries.size() > 0) + { + // Look up the enum name + tDB2EnumNameMap::const_iterator pEnum; + pEnum = mEnumNameMap.find( currentID ); + + if (pEnum != mEnumNameMap.end()) + { + const sDB2Enum & dbEnum = pEnum->second; + if (mEnumMap.find( dbEnum.mpName ) == mEnumMap.end()) + { + tDB2EnumMapPair tmp( dbEnum.mID, entries ); + mEnumMap[dbEnum.mpName] = tmp; + } + else + { + // Hmm, duplicate enum names discovered + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_ENUM_MAIN + << "] Duplicate enum (by name) detected \'" + << dbEnum.mpName << "\'"; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + } + else + { + // Hmm, missing enum ID discovered + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_ENUM_MAIN + << "] Missing enum ID detected " + << currentID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + + // Clear out enum entries for next pass and add this entry + entries.clear(); + entries[entry.mValue] = entry.mpName; + + // Adjust current enum ID + currentID = entry.mID; + } + } + else + { + if (entries.find( entry.mValue ) == entries.end()) + { + entries[entry.mValue] = entry.mpName; + } + else + { + // Hmm, duplicate enum entry values discovered + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_ENUM_ENTRY + << "] Duplicate enum entries detected \'" + << entry.mpName << "\', " << entry.mValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + } + } + + // Add in the last enum + if (mEnumEntryMap.size() > 0 && entries.size() > 0) + { + // Look up the enum name + tDB2EnumNameMap::const_iterator pEnum; + pEnum = mEnumNameMap.find( currentID ); + + if (pEnum != mEnumNameMap.end()) + { + const sDB2Enum & dbEnum = pEnum->second; + if (mEnumMap.find( dbEnum.mpName ) == mEnumMap.end()) + { + tDB2EnumMapPair tmp( dbEnum.mID, entries ); + mEnumMap[dbEnum.mpName] = tmp; + } + else + { + // Hmm, duplicate enum names discovered + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_ENUM_MAIN + << "] Duplicate enum (by name) detected \'" + << dbEnum.mpName << "\'"; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + } + else + { + // Hmm, missing enum ID discovered + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_ENUM_MAIN + << "] Missing enum ID detected " << currentID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + AssembleEntityNameMap (Internal Method) + +DESCRIPTION: + Assemble the internal protocol entity name map + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::AssembleEntityNameMap() +{ + // Assume success + bool bOK = true; + + // Empty it out first + mEntityNames.clear(); + + // Go through and build the event name table + tDB2EntityMap::const_iterator pIter = mProtocolEntities.begin(); + while (pIter != mProtocolEntities.end()) + { + const sDB2ProtocolEntity & obj = pIter->second; + pIter++; + + if (obj.IsValid() == false) + { + continue; + } + + tDB2EntityNameMap::const_iterator pNames; + pNames = mEntityNames.find( obj.mpName ); + if (pNames == mEntityNames.end()) + { + mEntityNames[obj.mpName] = obj.GetKey(); + } + else + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_ENTITY + << "] Duplicate protocol entity (by name) detected \'" + << obj.mpName << "\'"; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + BuildModifierTables (Internal Method) + +DESCRIPTION: + Build the parsed fragment modifier maps, i.e. convert the modifier + text string to something more useful by database clients + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::BuildModifierTables() +{ + // Assume success + bool bOK = true; + + // Parse all fragment modifiers + tDB2FragmentMap::const_iterator pFragIter = mEntityStructs.begin(); + while (pFragIter != mEntityStructs.end()) + { + // Grab new fragment + const sDB2Fragment & frag = pFragIter->second; + pFragIter++; + + // Skip invalid/unmodified fragments + if ( (frag.IsValid() == false) + || (frag.mpModifierValue == 0) + || (frag.mpModifierValue == EMPTY_STRING) ) + { + continue; + } + + switch (frag.mModifierType) + { + case eDB2_MOD_CONSTANT_ARRAY: + case eDB2_MOD_VARIABLE_ARRAY: + case eDB2_MOD_VARIABLE_STRING1: + case eDB2_MOD_VARIABLE_STRING2: + case eDB2_MOD_VARIABLE_STRING3: + { + ULONG val = strtoul( frag.mpModifierValue, 0, 0 ); + mArray1ModMap[frag.mpModifierValue] = val; + } + break; + + case eDB2_MOD_VARIABLE_ARRAY2: + { + // Parse modifier to tokens (start stop) + int nSize = strlen( frag.mpModifierValue ) + 1; + + char * pCopy = new char[ nSize ]; + if (pCopy == NULL) + { + return false; + } + + memcpy( pCopy, frag.mpModifierValue, nSize ); + + std::vector indices; + CSVStringToContainer( " ", pCopy, indices ); + + delete [] pCopy; + if (indices.size() == 2) + { + std::pair val; + val.first = indices[0]; + val.second = indices[1]; + mArray2ModMap[frag.mpModifierValue] = val; + } + } + break; + + case eDB2_MOD_OPTIONAL: + { + sDB2SimpleCondition con; + + // Parse condition to tokens (field ID operator value) + bool bRC = sDB2Fragment::ParseCondition( frag.mpModifierValue, + con.mID, + con.mOperator, + con.mValue, + con.mbF2F ); + + if (bRC == true) + { + mOptionalModMap[frag.mpModifierValue] = con; + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY3: + { + sDB2SimpleExpression exp; + + // Parse condition to tokens (field ID operator value) + bool bRC = sDB2Fragment::ParseExpression( frag.mpModifierValue, + exp.mID, + exp.mOperator, + exp.mValue, + exp.mbF2F ); + + if (bRC == true) + { + mExpressionModMap[frag.mpModifierValue] = exp; + } + } + break; + } + } + + return bOK; +} + + +/*=========================================================================== +METHOD: + CheckAndSetBasePath (Internal Method) + +DESCRIPTION: + Check and set the passed in path to something that is useful + +PARAMETERS + pBasePath [ I ] - Base path + +RETURN VALUE: + std::string - The enum name (or error string if enum value is not found) +===========================================================================*/ +std::string cCoreDatabase::CheckAndSetBasePath( LPCSTR pBasePath ) const +{ + std::string basePath = "."; + if (pBasePath != 0 && pBasePath[0] != 0) + { + struct stat fileInfo; + if (stat( pBasePath, &fileInfo ) == 0) + { + if (S_ISDIR( fileInfo.st_mode ) == true) + { + // It's a directory + basePath = pBasePath; + } + } + } + + return basePath; +} + +/*=========================================================================== +METHOD: + LoadStructureTables (Internal Method) + +DESCRIPTION: + Load all tables related to structure (entity, struct, field, format spec) + +PARAMETERS + pBasePath [ I ] - Base path to database files + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::LoadStructureTables( LPCSTR pBasePath ) +{ + bool bRC = true; + + std::string basePath = CheckAndSetBasePath( pBasePath ); + basePath += "/"; + + std::string fn = basePath; + fn += DB2_FILE_PROTOCOL_FIELD; + bRC &= LoadDB2Table( (LPCSTR)fn.c_str(), + mEntityFields, + false, + DB2_TABLE_PROTOCOL_FIELD, + *mpLog ); + + fn = basePath; + fn += DB2_FILE_PROTOCOL_STRUCT; + bRC &= LoadDB2Table( (LPCSTR)fn.c_str(), + mEntityStructs, + false, + DB2_TABLE_PROTOCOL_STRUCT, + *mpLog ); + + fn = basePath; + fn += DB2_FILE_PROTOCOL_ENTITY; + bRC &= LoadDB2Table( (LPCSTR)fn.c_str(), + mProtocolEntities, + false, + DB2_TABLE_PROTOCOL_ENTITY, + *mpLog ); + + // Validate protocol entities + bRC &= ValidateStructures(); + + // Build internal protocol entity name map + bRC &= AssembleEntityNameMap(); + + return bRC; +} + +/*=========================================================================== +METHOD: + LoadStructureTables (Internal Method) + +DESCRIPTION: + Load all tables related to structure (entity, struct, field) + +PARAMETERS + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::LoadStructureTables() +{ + bool bRC = true; + + // Calculate sizes + int nFieldSize = (const char*)&_binary_QMI_Field_txt_end - + (const char*)&_binary_QMI_Field_txt_start; + int nStructSize = (const char*)&_binary_QMI_Struct_txt_end - + (const char*)&_binary_QMI_Struct_txt_start; + int nEntitySize = (const char*)&_binary_QMI_Entity_txt_end - + (const char*)&_binary_QMI_Entity_txt_start; + + bRC &= LoadDB2Table( (const char*)&_binary_QMI_Field_txt_start, + nFieldSize, + mEntityFields, + false, + DB2_TABLE_PROTOCOL_FIELD, + *mpLog ); + + bRC &= LoadDB2Table( (const char*)&_binary_QMI_Struct_txt_start, + nStructSize, + mEntityStructs, + false, + DB2_TABLE_PROTOCOL_STRUCT, + *mpLog ); + + bRC &= LoadDB2Table( (const char*)&_binary_QMI_Entity_txt_start, + nEntitySize, + mProtocolEntities, + false, + DB2_TABLE_PROTOCOL_ENTITY, + *mpLog ); + + // Validate protocol entities + bRC &= ValidateStructures(); + + // Build internal protocol entity name map + bRC &= AssembleEntityNameMap(); + + return bRC; +} + +/*=========================================================================== +METHOD: + LoadEnumTables (Internal Method) + +DESCRIPTION: + Load all enumeration tables + +PARAMETERS + pBasePath [ I ] - Base path to database files + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::LoadEnumTables( LPCSTR pBasePath ) +{ + bool bRC = true; + + std::string basePath = CheckAndSetBasePath( pBasePath ); + basePath += "/"; + + + std::string fn = basePath; + fn += DB2_FILE_ENUM_MAIN; + bRC &= LoadDB2Table( (LPCSTR)fn.c_str(), + mEnumNameMap, + false, + DB2_TABLE_ENUM_MAIN, + *mpLog ); + + fn = basePath; + fn += DB2_FILE_ENUM_ENTRY; + bRC &= LoadDB2Table( (LPCSTR)fn.c_str(), + mEnumEntryMap, + false, + DB2_TABLE_ENUM_ENTRY, + *mpLog ); + + // Build the enum map + bRC &= AssembleEnumMap(); + + return bRC; +} + +/*=========================================================================== +METHOD: + LoadEnumTables (Internal Method) + +DESCRIPTION: + Load all enumeration tables + +PARAMETERS + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::LoadEnumTables() +{ + bool bRC = true; + // Calculate sizes + int nEnumSize = (const char*)&_binary_QMI_Enum_txt_end - + (const char*)&_binary_QMI_Enum_txt_start; + int nEnumEntrySize = (const char*)&_binary_QMI_EnumEntry_txt_end - + (const char*)&_binary_QMI_EnumEntry_txt_start; + + bRC &= LoadDB2Table( (const char*)&_binary_QMI_Enum_txt_start, + nEnumSize, + mEnumNameMap, + false, + DB2_TABLE_ENUM_MAIN, + *mpLog ); + + bRC &= LoadDB2Table( (const char*)&_binary_QMI_EnumEntry_txt_start, + nEnumEntrySize, + mEnumEntryMap, + false, + DB2_TABLE_ENUM_ENTRY, + *mpLog ); + + // Build the enum map + bRC &= AssembleEnumMap(); + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateStructures (Internal Method) + +DESCRIPTION: + Validate (and attempt repair of) structure related tables + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateStructures() +{ + // Assume success + bool bRC = true; + + tDB2EntityMap::iterator pEntity = mProtocolEntities.begin(); + while (pEntity != mProtocolEntities.end()) + { + sDB2ProtocolEntity & entity = pEntity->second; + + // Structure ID given? + if (entity.mStructID != -1) + { + // Yes, validate individual structure + std::set fields; + bool bValid = ValidateStructure( (ULONG)entity.mStructID, fields, 0 ); + + // Not valid? + if (bValid == false) + { + // Invalid structure, reset to none + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid struct, ID " << entity.mStructID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + entity.mStructID = -1; + + // We found at least one bad structure + bRC = false; + } + } + + pEntity++; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateStructure (Internal Method) + +DESCRIPTION: + Validate a single structure + +PARAMETERS: + structID [ I ] - ID of structure being evaluated + fields [I/O] - List of 'known' field IDs + depth [I/O] - Recursion depth + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateStructure( + ULONG structID, + std::set & fields, + ULONG depth ) +{ + // Assume success + bool bRC = true; + + // Reached our limit? + if (depth++ >= MAX_NESTING_LEVEL) + { + // Invalid structure + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Max depth exceeded, possible loop, struct ID " << structID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + return false; + } + + // Grab first fragment of structure + std::pair id( structID, 0 ); + tDB2FragmentMap::const_iterator pFrag = mEntityStructs.find( id ); + + // Did we find the first fragment? + if (pFrag == mEntityStructs.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Missing initial fragment, struct ID " << structID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + + // Iterate over each fragment in the structure + while (pFrag != mEntityStructs.end() && pFrag->second.mStructID == structID) + { + // Grab fragment + const sDB2Fragment & frag = pFrag->second; + + // Variable array or optional fragment? + if ( (frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY) + || (frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY2) ) + { + bRC = ValidateArraySpecifier( frag, fields ); + } + else if (frag.mModifierType == eDB2_MOD_OPTIONAL) + { + bRC = ValidateOptionalSpecifier( frag, fields ); + } + else if (frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY3) + { + bRC = ValidateExpressionSpecifier( frag, fields ); + } + else if ( (frag.mModifierType == eDB2_MOD_VARIABLE_STRING1) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING2) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING3) ) + { + bRC = ValidateArraySpecifier( frag, fields ); + if (bRC == true) + { + // The field being modified has to be a fixed length string + ULONG fieldID = frag.mFragmentValue; + tDB2FieldMap::const_iterator pIter = mEntityFields.find( fieldID ); + if (pIter != mEntityFields.end()) + { + bool bString = false; + + const sDB2Field & ft = pIter->second; + if (ft.mType == eDB2_FIELD_STD) + { + if ( (ft.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_A) + || (ft.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_U) + || (ft.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_U8) ) + { + if ( (ft.mTypeVal != (ULONG)eDB2_FIELD_STDTYPE_STRING_U8) + || (frag.mModifierType != eDB2_MOD_VARIABLE_STRING3) ) + { + // Not the invalid combination of character length and + // varaible length characters + bString = true; + } + } + } + + if (bString == false) + { + // Not a string so why the string modifier? + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid string modifier, struct ID " << structID + << ", ID " << fieldID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + } + } + + if (bRC == true) + { + // What type of fragment is this? + switch (frag.mFragmentType) + { + case eDB2_FRAGMENT_FIELD: + { + ULONG fieldID = frag.mFragmentValue; + bRC = ValidateField( structID, fieldID, fields ); + } + break; + + case eDB2_FRAGMENT_VARIABLE_PAD_BITS: + case eDB2_FRAGMENT_VARIABLE_PAD_BYTES: + { + // Does this field exist in the entity? + ULONG fieldID = frag.mFragmentValue; + if (fields.find( fieldID ) == fields.end()) + { + // No + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid pad, struct ID " << structID + << ", ID " << fieldID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + break; + + case eDB2_FRAGMENT_STRUCT: + { + // Grab structure ID and recurse + ULONG structID = frag.mFragmentValue; + bRC = ValidateStructure( structID, fields, depth ); + } + break; + + default: + break; + } + } + + // Did an error occur? + if (bRC == false) + { + break; + } + + pFrag++; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateField (Internal Method) + +DESCRIPTION: + Validate a single field + +PARAMETERS: + structID [ I ] - ID of referencing structure + fieldID [ I ] - ID of field being evaluated + fields [I/O] - List of 'known' field IDs + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateField( + ULONG structID, + ULONG fieldID, + std::set & fields ) +{ + // Assume success + bool bRC = true; + + tDB2FieldMap::const_iterator pIter = mEntityFields.find( fieldID ); + if (pIter == mEntityFields.end()) + { + // No + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid field, struct ID " << structID + << ", ID " << fieldID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + else + { + // Mark field as part of this structure + fields.insert( fieldID ); + + // Is this field an enumeration? + const sDB2Field & theField = pIter->second; + if ( (theField.mType == eDB2_FIELD_ENUM_UNSIGNED) + || (theField.mType == eDB2_FIELD_ENUM_SIGNED) ) + { + // Yes, check that the enum exists + if (mEnumNameMap.find( theField.mTypeVal ) == mEnumNameMap.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_FIELD + << "] Invalid enumeration ID, field ID " << fieldID + << ", enum ID " << theField.mTypeVal; + + mpLog->Log( tmp.str(), eDB2_STATUS_WARNING ); + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateArraySpecifier (Internal Method) + +DESCRIPTION: + Validate an array specifier + +PARAMETERS: + frag [ I ] - Fragment containing array specifier + fields [ I ] - List of 'known' field IDs + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateArraySpecifier( + const sDB2Fragment & frag, + const std::set & fields ) +{ + // Assume success + bool bRC = true; + + // Even an array specifier to start with? + if (frag.mpModifierValue == 0 || frag.mpModifierValue == EMPTY_STRING) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Missing array specifier, struct ID " << frag.mStructID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + else if ( (frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING1) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING2) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING3) ) + { + ULONG id = strtoul( frag.mpModifierValue, 0, 0 ); + if (fields.find( id ) == fields.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid modifier specifier, struct ID " << frag.mStructID + << ", ID " << id; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + else if (frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY2) + { + // Parse condition to tokens (start stop) + int nSize = strlen( frag.mpModifierValue ) + 1; + + char * pCopy = new char[ nSize ]; + if (pCopy == NULL) + { + return false; + } + + memcpy( pCopy, frag.mpModifierValue, nSize ); + + std::vector indices; + CSVStringToContainer( " ", pCopy, indices ); + + delete [] pCopy; + if (indices.size() != 2) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid array specifier, struct ID " << frag.mStructID + << ", " << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + else + { + ULONG sID = indices[0]; + ULONG eID = indices[1]; + + if ( (fields.find( sID ) == fields.end()) + || (fields.find( eID ) == fields.end()) ) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid array specifier, struct ID " << frag.mStructID + << ", IDs " << sID << " " << eID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + } + else + { + ASSERT( 0 ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateOptionalSpecifier (Internal Method) + +DESCRIPTION: + Validate a simple optional fragment specifier + +PARAMETERS: + frag [ I ] - Fragment containing optional fragment specifier + fields [ I ] - List of 'known' field IDs + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateOptionalSpecifier( + const sDB2Fragment & frag, + const std::set & fields ) +{ + // Assume success + bool bRC = true; + + ASSERT( frag.mModifierType == eDB2_MOD_OPTIONAL ); + + // Even an optional specifier to start with? + if (frag.mpModifierValue == 0 || frag.mpModifierValue == EMPTY_STRING) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Missing optional specifier, struct ID " << frag.mStructID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + return false; + } + + ULONG conID; + eDB2Operator conOp; + LONGLONG conVal; + bool bF2F; + + // Parse condition + LPCSTR pCon = frag.mpModifierValue; + bRC = sDB2Fragment::ParseCondition( pCon, conID, conOp, conVal, bF2F ); + if (bRC == true) + { + // Does the given field ID exist as part of this entity? + if (fields.find( conID ) == fields.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", unknown field ID " << conID << "/" << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + + if (bF2F == true) + { + // Does the given field ID exist as part of this entity? + if (fields.find( (ULONG)conVal ) == fields.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", unknown field ID " << (ULONG)conVal + << "/" << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + } + else + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", " << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ValidateExpressionSpecifier (Internal Method) + +DESCRIPTION: + Validate a simple expression fragment specifier + +PARAMETERS: + frag [ I ] - Fragment containing expression fragment specifier + fields [ I ] - List of 'known' field IDs + +RETURN VALUE: + bool +===========================================================================*/ +bool cCoreDatabase::ValidateExpressionSpecifier( + const sDB2Fragment & frag, + const std::set & fields ) +{ + // Assume success + bool bRC = true; + + ASSERT( frag.mModifierType == eDB2_MOD_VARIABLE_ARRAY3 ); + + // Even an expression specifier to start with? + if (frag.mpModifierValue == 0 || frag.mpModifierValue == EMPTY_STRING) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Missing array specifier, struct ID " << frag.mStructID; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + return false; + } + + ULONG exprID; + eDB2ExpOperator exprOp; + LONGLONG exprVal; + bool bF2F; + + // Parse expression + LPCSTR pExpr = frag.mpModifierValue; + bRC = sDB2Fragment::ParseExpression( pExpr, exprID, exprOp, exprVal, bF2F ); + if (bRC == true) + { + // Does the given field ID exist as part of this entity? + if (fields.find( exprID ) == fields.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", unknown field ID " << exprID + << "/" << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + + if (bF2F == true) + { + // Does the given field ID exist as part of this entity? + if (fields.find( (ULONG)exprVal ) == fields.end()) + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", unknown field ID " << (ULONG)exprID + << "/" << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + + bRC = false; + } + } + } + else + { + std::ostringstream tmp; + tmp << "DB [" << DB2_TABLE_PROTOCOL_STRUCT + << "] Invalid optional specifier, struct ID " << frag.mStructID + << ", " << frag.mpModifierValue; + + mpLog->Log( tmp.str(), eDB2_STATUS_ERROR ); + } + + return bRC; +} + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreDatabase.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreDatabase.h new file mode 100755 index 0000000..c4c47e2 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreDatabase.h @@ -0,0 +1,2127 @@ +/*=========================================================================== +FILE: + CoreDatabase.h + +DESCRIPTION: + Declaration of cCoreDatabase class + +PUBLIC CLASSES AND METHODS: + cCoreDatabase + This class represents the run-time (read only) version of the + core library database + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include +#include +#include +#include + +#include "DB2TextFile.h" + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +class cDB2NavTree; + +//--------------------------------------------------------------------------- +// Prototypes +//--------------------------------------------------------------------------- + +// Convert a string (in quotes) to a string (minus) quotes and copy into +// an allocated buffer +LPCSTR CopyQuotedString( LPSTR pString ); + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// An empty (but not NULL) string +extern LPCSTR EMPTY_STRING; + +// Value seperator for database text +extern LPCSTR DB2_VALUE_SEP; + +// Sub-value (i.e. within a particular value) seperator for database text +extern LPCSTR DB2_SUBVAL_SEP; + +// Database table file names +extern LPCSTR DB2_FILE_PROTOCOL_FIELD; +extern LPCSTR DB2_FILE_PROTOCOL_STRUCT; +extern LPCSTR DB2_FILE_PROTOCOL_ENTITY; +extern LPCSTR DB2_FILE_ENUM_MAIN; +extern LPCSTR DB2_FILE_ENUM_ENTRY; + +// Database start pointers +extern const int _binary_QMI_Field_txt_start; +extern const int _binary_QMI_Struct_txt_start; +extern const int _binary_QMI_Entity_txt_start; +extern const int _binary_QMI_Enum_txt_start; +extern const int _binary_QMI_EnumEntry_txt_start; + +// Database end pointers +extern const int _binary_QMI_Field_txt_end; +extern const int _binary_QMI_Struct_txt_end; +extern const int _binary_QMI_Entity_txt_end; +extern const int _binary_QMI_Enum_txt_end; +extern const int _binary_QMI_EnumEntry_txt_end; + + +// Status levels for DB2 logging +enum eDB2StatusLevel +{ + eDB2_STATUS_BEGIN = -1, + + eDB2_STATUS_INFO, // Informational string + eDB2_STATUS_WARNING, // Warning string + eDB2_STATUS_ERROR, // Error string + + eDB2_STATUS_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2StatusLevel validity check + +PARAMETERS: + lvl [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2StatusLevel lvl ) +{ + bool retVal = false; + if (lvl > eDB2_STATUS_BEGIN && lvl < eDB2_STATUS_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// Class cDB2StatusLog +// +// Class that defines status logging interface for DB2 initialization +// and exit related information +/*=========================================================================*/ +class cDB2StatusLog +{ + public: + // Log an error string + virtual void Log( + LPCSTR pLog, + eDB2StatusLevel lvl = eDB2_STATUS_ERROR ) = 0; + + // Log an error string + virtual void Log( + const std::string & log, + eDB2StatusLevel lvl = eDB2_STATUS_ERROR ) = 0; +}; + +/*=========================================================================*/ +// Class cDB2TraceLog +// Default error logging interface for DB2 initialization and exit +// related information - sends output to TRACE +/*=========================================================================*/ +class cDB2TraceLog : public cDB2StatusLog +{ + public: + // (Inline) Constructor + cDB2TraceLog() { }; + + // (Inline) Destructor + ~cDB2TraceLog() { }; + + + // (Inline) Log an error string + virtual void Log( + LPCSTR pLog, + eDB2StatusLevel lvl = eDB2_STATUS_ERROR ) + { + if (pLog != 0 && pLog[0] != 0) + { + std::string formatString = "[0x%02X] "; + formatString += pLog; + formatString += '\n'; + + //Note: TRACE is just an alias for printf if DEBUG is used + TRACE( formatString.c_str(), lvl ); + } + }; + + // (Inline) Log an error string + virtual void Log( + const std::string & log, + eDB2StatusLevel lvl = eDB2_STATUS_ERROR ) + { + if (log.size() > 0) + { + Log( log.c_str(), lvl ); + } + }; + +}; + +// The default logger (for backwards compatibility) +extern cDB2TraceLog gDB2DefaultLog; + + +/*=========================================================================== +METHOD: + LoadDB2Table (Free Public Method) + +DESCRIPTION: + Load a database table + +PARAMETERS: + pFile [ I ] - The file to load the table from + cont [I/0] - The current/resulting database table + bDuplicatesOK [ I ] - Duplicate keys acceptable? + pName [ I ] - Name (for error reporting) + log [I/O] - Where to log errors + +RETURN VALUE: + bool +===========================================================================*/ +template +bool LoadDB2Table( + LPCSTR pFile, + Container & cont, + bool bDuplicatesOK = false, + LPCSTR pName = 0, + cDB2StatusLog & log = gDB2DefaultLog ) +{ + // Assume success + bool bRC = true; + // Sanity check error reporting name + if (pName == 0 || pName[0] == 0) + { + pName = "?"; + } + + // Sanity check file name + if (pFile == 0 || pFile[0] == 0) + { + // Bad file + std::ostringstream tmp; + tmp << "DB [" << pName << "] Invalid file name"; + + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + return false; + } + + ULONG lineNum = 0; + + // Attempt to open the file + cDB2TextFile inFile( pFile ); + if (inFile.IsValid() == true) + { + std::string line; + while (inFile.ReadLine( line ) == true) + { + std::string lineCopy = line; + + int nLineSize = lineCopy.size(); + LPSTR pLine = new CHAR[ nLineSize + 1 ]; + if (pLine == NULL) + { + return false; + } + + memcpy( pLine, line.c_str(), nLineSize ); + + // Enforce null terminator + pLine[ nLineSize ] = 0; + + typename Container::mapped_type theType; + bool bOK = theType.FromString( pLine ); + if (bOK == true) + { + // Grab key + typename Container::key_type theKey = theType.GetKey(); + + // Key already exists? + typename Container::iterator pIter; + pIter = cont.find( theKey ); + + if (pIter != cont.end() && bDuplicatesOK == false) + { + // The key already exists which indicates a (recoverable) error + std::ostringstream tmp; + tmp << "DB [" << pName << "] Duplicate key, line " + << lineNum << " (" << line.c_str() << ")"; + + log.Log( tmp.str(), eDB2_STATUS_WARNING ); + + // Free the current object + pIter->second.FreeAllocatedStrings(); + + // ... and then replace it + pIter->second = theType; + } + else + { + typename Container::value_type entry( theKey, theType ); + cont.insert( entry ); + } + } + else if (lineCopy.size() > 0) + { + // Error parsing line + std::ostringstream tmp; + tmp << "DB [" << pName << "] Parsing error, line " + << lineNum << " (" << line.c_str() << ")"; + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + theType.FreeAllocatedStrings(); + bRC = false; + } + delete [] pLine; + lineNum++; + } + } + else + { +#ifdef DEBUG + // Could not open the file + std::ostringstream tmp; + tmp << "DB [" << pName << "] Error opening file"; + + log.Log( tmp.str(), eDB2_STATUS_WARNING ); +#endif + + bRC = false; + } + + return bRC; +}; + +/*=========================================================================== +METHOD: + LoadDB2Table (Free Public Method) + +DESCRIPTION: + Load a database table + +PARAMETERS: + pStart [ I ] - Start location of database + nSize [ I ] - Size of database + cont [I/0] - The current/resulting database table + bDuplicatesOK [ I ] - Duplicate keys acceptable? + pName [ I ] - Name (for error reporting) + log [I/O] - Where to log errors + +RETURN VALUE: + bool +===========================================================================*/ +template +bool LoadDB2Table( + const char * pStart, + const int nSize, + Container & cont, + bool bDuplicatesOK = false, + LPCSTR pName = 0, + cDB2StatusLog & log = gDB2DefaultLog ) +{ + // Assume success + bool bRC = true; + + // Sanity check error reporting name + if (pName == 0 || pName[0] == 0) + { + pName = "?"; + } + + ULONG lineNum = 0; + + // Attempt to open the file + cDB2TextFile inFile( pStart, nSize ); + if (inFile.IsValid() == true) + { + std::string line; + while (inFile.ReadLine( line ) == true) + { + std::string lineCopy = line; + + int nLineSize = lineCopy.size(); + LPSTR pLine = new CHAR[ nLineSize + 1 ]; + if (pLine == NULL) + { + return false; + } + + memcpy( pLine, lineCopy.c_str(), nLineSize ); + + // Enforce null terminator + pLine[ nLineSize ] = 0; + + typename Container::mapped_type theType; + bool bOK = theType.FromString( pLine ); + if (bOK == true) + { + // Grab key + typename Container::key_type theKey = theType.GetKey(); + + // Key already exists? + typename Container::iterator pIter; + pIter = cont.find( theKey ); + + if (pIter != cont.end() && bDuplicatesOK == false) + { + // The key already exists which indicates a (recoverable) error + std::ostringstream tmp; + tmp << "DB [" << pName << "] Duplicate key, line " + << lineNum << " (" << line.c_str() << ")"; + + log.Log( tmp.str(), eDB2_STATUS_WARNING ); + + // Free the current object + pIter->second.FreeAllocatedStrings(); + + // ... and then replace it + pIter->second = theType; + } + else + { + typename Container::value_type entry( theKey, theType ); + cont.insert( entry ); + } + } + else if (lineCopy.size() > 0) + { + // Error parsing line + std::ostringstream tmp; + tmp << "DB [" << pName << "] Parsing error, line " + << lineNum << " (" << line.c_str() << ")"; + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + theType.FreeAllocatedStrings(); + bRC = false; + } + + delete [] pLine; + lineNum++; + } + } + else + { +#ifdef DEBUG + // Could not open the file + std::ostringstream tmp; + tmp << "DB [" << pName << "] Error opening file"; + + log.Log( tmp.str(), eDB2_STATUS_WARNING ); +#endif + + bRC = false; + } + + return bRC; +}; + +/*=========================================================================== +METHOD: + FreeDB2Table (Free Public Method) + +DESCRIPTION: + Free up the string allocations in a database table, emptying the + table in the process + +PARAMETERS: + cont [ I ] - The database table + +RETURN VALUE: + None +===========================================================================*/ +template +void FreeDB2Table( Container & cont ) +{ + typename Container::iterator pIter = cont.begin(); + while (pIter != cont.end()) + { + typename Container::mapped_type & theType = pIter->second; + theType.FreeAllocatedStrings(); + + pIter++; + } + + cont.clear(); +}; + +/*=========================================================================*/ +// eDB2EntityType Enumeration +// +// Database protocol entity header/payload type enumeration +/*=========================================================================*/ +enum eDB2EntityType +{ + eDB2_ET_ENUM_BEGIN = -1, + + eDB2_ET_DIAG_REQ, // 0 Synchronous request + eDB2_ET_DIAG_RSP, // 1 Synchronous response + eDB2_ET_DIAG_SUBSYS_REQ, // 2 Synchronous subsystem dispatch request + eDB2_ET_DIAG_SUBSYS_RSP, // 3 Synchronous subsystem dispatch response + eDB2_ET_DIAG_EVENT, // 4 Asynchronous event + eDB2_ET_DIAG_LOG, // 5 Asynchronous log + eDB2_ET_DIAG_NV_ITEM, // 6 NVRAM item read/write + eDB2_ET_RESERVED7, // 7 Reserved + eDB2_ET_RESERVED8, // 8 Reserved + eDB2_ET_DIAG_SUBSYS2_REQ, // 9 Sync subsystem V2 dispatch request + eDB2_ET_DIAG_SUBSYS2_RSP, // 10 Sync subsystem V2 dispatch response + eDB2_ET_DIAG_SUBSYS2_ASYNC, // 11 Async subsystem V2 dispatch response + + eDB2_ET_QMI_BEGIN = 29, // 29 Start of QMI section + + eDB2_ET_QMI_CTL_REQ, // 30 QMI CTL request + eDB2_ET_QMI_CTL_RSP, // 31 QMI CTL response + eDB2_ET_QMI_CTL_IND, // 32 QMI CTL indication + eDB2_ET_QMI_WDS_REQ, // 33 QMI WDS request + eDB2_ET_QMI_WDS_RSP, // 34 QMI WDS response + eDB2_ET_QMI_WDS_IND, // 35 QMI WDS indication + eDB2_ET_QMI_DMS_REQ, // 36 QMI DMS request + eDB2_ET_QMI_DMS_RSP, // 37 QMI DMS response + eDB2_ET_QMI_DMS_IND, // 38 QMI DMS indication + eDB2_ET_QMI_NAS_REQ, // 39 QMI NAS request + eDB2_ET_QMI_NAS_RSP, // 40 QMI NAS response + eDB2_ET_QMI_NAS_IND, // 41 QMI NAS indication + eDB2_ET_QMI_QOS_REQ, // 42 QMI QOS request + eDB2_ET_QMI_QOS_RSP, // 43 QMI QOS response + eDB2_ET_QMI_QOS_IND, // 44 QMI QOS indication + eDB2_ET_QMI_WMS_REQ, // 45 QMI WMS request + eDB2_ET_QMI_WMS_RSP, // 46 QMI WMS response + eDB2_ET_QMI_WMS_IND, // 47 QMI WMS indication + eDB2_ET_QMI_PDS_REQ, // 48 QMI PDS request + eDB2_ET_QMI_PDS_RSP, // 49 QMI PDS response + eDB2_ET_QMI_PDS_IND, // 50 QMI PDS indication + eDB2_ET_QMI_AUTH_REQ, // 51 QMI AUTH request + eDB2_ET_QMI_AUTH_RSP, // 52 QMI AUTH response + eDB2_ET_QMI_AUTH_IND, // 53 QMI AUTH indication + eDB2_ET_QMI_CAT_REQ, // 54 QMI CAT request + eDB2_ET_QMI_CAT_RSP, // 55 QMI CAT response + eDB2_ET_QMI_CAT_IND, // 56 QMI CAT indication + eDB2_ET_QMI_RMS_REQ, // 57 QMI RMS request + eDB2_ET_QMI_RMS_RSP, // 58 QMI RMS response + eDB2_ET_QMI_RMS_IND, // 59 QMI RMS indication + eDB2_ET_QMI_OMA_REQ, // 60 QMI OMA request + eDB2_ET_QMI_OMA_RSP, // 61 QMI OMA response + eDB2_ET_QMI_OMA_IND, // 62 QMI OMA indication + eDB2_ET_QMI_VOICE_REQ, // 63 QMI voice request + eDB2_ET_QMI_VOICE_RSP, // 64 QMI voice response + eDB2_ET_QMI_VOICE_IND, // 65 QMI voice indication + + eDB2_ET_QMI_END, // 63 End of QMI section + + eDB2_ET_ENUM_END + +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2EntityType validity check + +PARAMETERS: + et [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2EntityType et ) +{ + bool retVal = false; + if ( (et > eDB2_ET_ENUM_BEGIN && et <= eDB2_ET_DIAG_SUBSYS2_ASYNC) + || (et > eDB2_ET_QMI_BEGIN && et < eDB2_ET_QMI_END) ) + + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsDiagEntityType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the DIAG protocol? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsDiagEntityType( eDB2EntityType entityType ) +{ + bool retVal = false; + if (entityType == eDB2_ET_DIAG_REQ + || entityType == eDB2_ET_DIAG_RSP + || entityType == eDB2_ET_DIAG_SUBSYS_REQ + || entityType == eDB2_ET_DIAG_SUBSYS_RSP + || entityType == eDB2_ET_DIAG_EVENT + || entityType == eDB2_ET_DIAG_LOG + || entityType == eDB2_ET_DIAG_NV_ITEM + || entityType == eDB2_ET_DIAG_SUBSYS2_REQ + || entityType == eDB2_ET_DIAG_SUBSYS2_RSP + || entityType == eDB2_ET_DIAG_SUBSYS2_ASYNC) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsDiagEntityRequestType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the DIAG protocol and if so + does it represent a request? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsDiagEntityRequestType( eDB2EntityType entityType ) +{ + bool retVal = false; + if (entityType == eDB2_ET_DIAG_REQ + || entityType == eDB2_ET_DIAG_SUBSYS_REQ + || entityType == eDB2_ET_DIAG_SUBSYS2_REQ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsDiagEntityResponseType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the DIAG protocol and if so + does it represent a response? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsDiagEntityResponseType( eDB2EntityType entityType ) +{ + bool retVal = false; + if (entityType == eDB2_ET_DIAG_RSP + || entityType == eDB2_ET_DIAG_SUBSYS_RSP + || entityType == eDB2_ET_DIAG_SUBSYS2_RSP) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsDiagEntityAsyncType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the DIAG protocol and if so + does it represent asynchronous incoming data? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsDiagEntityAsyncType( eDB2EntityType entityType ) +{ + bool retVal = false; + if (entityType == eDB2_ET_DIAG_EVENT + || entityType == eDB2_ET_DIAG_LOG + || entityType == eDB2_ET_DIAG_SUBSYS2_ASYNC) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIEntityType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the QMI protocol? + +PARAMETERS: + et [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIEntityType( eDB2EntityType et ) +{ + bool retVal = false; + if (et > eDB2_ET_QMI_BEGIN && et < eDB2_ET_QMI_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIEntityRequestType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the QMI protocol and if so + does it represent a request? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIEntityRequestType( eDB2EntityType entityType ) +{ + bool retVal = false; + + // One QMI service is always a triplet of REQ/RSP/IND + DWORD baseVal = (DWORD)eDB2_ET_QMI_BEGIN + 1; + if ((DWORD)entityType % baseVal == 0) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIEntityResponseType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the QMI protocol and if so + does it represent a response? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIEntityResponseType( eDB2EntityType entityType ) +{ + bool retVal = false; + + // One QMI service is always a triplet of REQ/RSP/IND + DWORD baseVal = (DWORD)eDB2_ET_QMI_BEGIN + 1; + if ((DWORD)entityType % baseVal == 1) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIEntityIndicationType (Inline Method) + +DESCRIPTION: + Does the eDB2EntityType value represent the QMI protocol and if so + does it represent an indication? + +PARAMETERS: + entityType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIEntityIndicationType( eDB2EntityType entityType ) +{ + bool retVal = false; + + // One QMI service is always a triplet of REQ/RSP/IND + DWORD baseVal = (DWORD)eDB2_ET_QMI_BEGIN + 1; + if ((DWORD)entityType % baseVal == 2) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2FragmentType Enumeration +// +// Database fragment type enumeration - determines in what table +// (or manner) the fragment is described +/*=========================================================================*/ +enum eDB2FragmentType +{ + eDB2_FRAGMENT_TYPE_ENUM_BEGIN = -1, + + eDB2_FRAGMENT_FIELD, // 0 Simple field fragment + eDB2_FRAGMENT_STRUCT, // 1 Structure fragment + eDB2_FRAGMENT_CONSTANT_PAD, // 2 Pad fragment, fixed length (bits) + eDB2_FRAGMENT_VARIABLE_PAD_BITS, // 3 Pad fragment, variable (bits) + eDB2_FRAGMENT_VARIABLE_PAD_BYTES, // 4 Pad fragment, variable (bytes) + eDB2_FRAGMENT_FULL_BYTE_PAD, // 5 Pad fragment, pad to a full byte + eDB2_FRAGMENT_MSB_2_LSB, // 6 Switch to MSB -> LSB order + eDB2_FRAGMENT_LSB_2_MSB, // 7 Switch to LSB -> MSB order + + eDB2_FRAGMENT_TYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2FragmentType validity check + +PARAMETERS: + fragType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2FragmentType fragType ) +{ + bool retVal = false; + if (fragType > eDB2_FRAGMENT_TYPE_ENUM_BEGIN + && fragType < eDB2_FRAGMENT_TYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2ModifierType Enumeration +// +// Database fragment modifier type enumeration - determines how a +// fragment is modified/used +/*=========================================================================*/ +enum eDB2ModifierType +{ + eDB2_MOD_TYPE_ENUM_BEGIN = -1, + + eDB2_MOD_NONE, // 0 Modifier is not used + eDB2_MOD_CONSTANT_ARRAY, // 1 Constant (elements) array + eDB2_MOD_VARIABLE_ARRAY, // 2 Variable (elements) array + eDB2_MOD_OBSOLETE_3, // 3 Constant (bits) array [OBS] + eDB2_MOD_OBSOLETE_4, // 4 Variable (bits) array [OBS] + eDB2_MOD_OPTIONAL, // 5 Fragment is optional + eDB2_MOD_VARIABLE_ARRAY2, // 6 Variable (elements) array, start/stop given + eDB2_MOD_VARIABLE_ARRAY3, // 7 Variable (elements) array, simple expression + eDB2_MOD_VARIABLE_STRING1, // 8 Variable length string (bit length) + eDB2_MOD_VARIABLE_STRING2, // 9 Variable length string (byte length) + eDB2_MOD_VARIABLE_STRING3, // 10 Variable length string (character length) + + eDB2_MOD_TYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + ModifiedToArray (Inline Method) + +DESCRIPTION: + Does this modifier indicate an array? + +PARAMETERS: + modType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool ModifiedToArray( eDB2ModifierType modType ) +{ + bool bRC = false; + if ( (modType == eDB2_MOD_CONSTANT_ARRAY) + || (modType == eDB2_MOD_VARIABLE_ARRAY) + || (modType == eDB2_MOD_VARIABLE_ARRAY2) + || (modType == eDB2_MOD_VARIABLE_ARRAY3) ) + { + bRC = true; + } + + return bRC; +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2ModifierType validity check + +PARAMETERS: + modType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2ModifierType modType ) +{ + bool retVal = false; + if (modType > eDB2_MOD_TYPE_ENUM_BEGIN + && modType < eDB2_MOD_TYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2FieldType Enumeration +// +// Database field type enumeration - determines whether the field in +// question is a standard type or an enumeration +/*=========================================================================*/ +enum eDB2FieldType +{ + eDB2_FIELD_TYPE_ENUM_BEGIN = -1, + + eDB2_FIELD_STD, // 0 Field is a standard type (see below) + eDB2_FIELD_ENUM_UNSIGNED, // 1 Field is an unsigned enumerated type + eDB2_FIELD_ENUM_SIGNED, // 2 Field is a signed enumerated type + + eDB2_FIELD_TYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2FieldType validity check + +PARAMETERS: + fieldType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2FieldType fieldType ) +{ + bool retVal = false; + if (fieldType > eDB2_FIELD_TYPE_ENUM_BEGIN + && fieldType < eDB2_FIELD_TYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2StdFieldType Enumeration +// +// Database standard field type enumeration +/*=========================================================================*/ +enum eDB2StdFieldType +{ + eDB2_FIELD_STDTYPE_ENUM_BEGIN = -1, + + eDB2_FIELD_STDTYPE_BOOL, // 0 Field is a boolean (0/1, false/true) + eDB2_FIELD_STDTYPE_INT8, // 1 Field is 8-bit signed integer + eDB2_FIELD_STDTYPE_UINT8, // 2 Field is 8-bit unsigned integer + eDB2_FIELD_STDTYPE_INT16, // 3 Field is 16-bit signed integer + eDB2_FIELD_STDTYPE_UINT16, // 4 Field is 16-bit unsigned integer + eDB2_FIELD_STDTYPE_INT32, // 5 Field is 32-bit signed integer + eDB2_FIELD_STDTYPE_UINT32, // 6 Field is 32-bit unsigned integer + eDB2_FIELD_STDTYPE_INT64, // 7 Field is 64-bit signed integer + eDB2_FIELD_STDTYPE_UINT64, // 8 Field is 64-bit unsigned integer + eDB2_FIELD_STDTYPE_STRING_A, // 9 ANSI fixed length string + eDB2_FIELD_STDTYPE_STRING_U, // 10 UNICODE fixed length string + eDB2_FIELD_STDTYPE_STRING_ANT, // 11 ANSI NULL terminated string + eDB2_FIELD_STDTYPE_STRING_UNT, // 12 UNICODE NULL terminated string + eDB2_FIELD_STDTYPE_FLOAT32, // 13 Field is 32-bit floating point value + eDB2_FIELD_STDTYPE_FLOAT64, // 14 Field is 64-bit floating point value + eDB2_FIELD_STDTYPE_STRING_U8, // 15 UTF-8 encoded fixed length string + eDB2_FIELD_STDTYPE_STRING_U8NT, // 16 UTF-8 encoded NULL terminated string + + eDB2_FIELD_STDTYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2StdFieldType validity check + +PARAMETERS: + fieldType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2StdFieldType fieldType ) +{ + bool retVal = false; + if (fieldType > eDB2_FIELD_STDTYPE_ENUM_BEGIN + && fieldType < eDB2_FIELD_STDTYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2Operator Enumeration +// +// Database conditional fragment operator type enumeration +/*=========================================================================*/ +enum eDB2Operator +{ + eDB2_OP_TYPE_ENUM_BEGIN = -1, + + eDB2_OP_LT, + eDB2_OP_LTE, + eDB2_OP_EQ, + eDB2_OP_NEQ, + eDB2_OP_GTE, + eDB2_OP_GT, + eDB2_OP_DIV, + eDB2_OP_NDIV, + + eDB2_OP_TYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2Operator validity check + +PARAMETERS: + op [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2Operator op ) +{ + bool retVal = false; + if (op > eDB2_OP_TYPE_ENUM_BEGIN + && op < eDB2_OP_TYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eDB2ExpOperator Enumeration +// +// Database simple expression operator type enumeration +/*=========================================================================*/ +enum eDB2ExpOperator +{ + eDB2_EXPOP_TYPE_ENUM_BEGIN = -1, + + eDB2_EXPOP_ADD, + eDB2_EXPOP_SUB, + eDB2_EXPOP_MUL, + eDB2_EXPOP_DIV, + eDB2_EXPOP_REM, + eDB2_EXPOP_MIN, + eDB2_EXPOP_MAX, + + eDB2_EXPOP_TYPE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eDB2ExpOperator validity check + +PARAMETERS: + op [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eDB2ExpOperator op ) +{ + bool retVal = false; + if (op > eDB2_EXPOP_TYPE_ENUM_BEGIN + && op < eDB2_EXPOP_TYPE_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// Struct sDB2ProtocolEntity +// +// Structure that defines the schema for the protocol entity table +/*=========================================================================*/ +struct sDB2ProtocolEntity +{ + public: + // (Inline) Default constructor + sDB2ProtocolEntity() + : mType( eDB2_ET_ENUM_BEGIN ), + mStructID( -1 ), + mFormatID( -1 ), + mbInternal( false ), + mFormatExID( -1 ), + mpName( EMPTY_STRING ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + std::vector GetKey() const + { + return mID; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Type of protocol entity 'header/payload' */ + eDB2EntityType mType; + + /* Multi-value ID (includes above type) */ + std::vector mID; + + /* Associated structure ID (-1 = no structure) */ + int mStructID; + + /* Associated format specifier (-1 = none) */ + int mFormatID; + + /* Is this protocol entity internal only? */ + bool mbInternal; + + /* Associated extended format specifier (-1 = none) */ + int mFormatExID; + + /* Name of protocol entity */ + LPCSTR mpName; +}; + +/*=========================================================================*/ +// Struct sDB2Fragment +// +// Structure that defines the schema for the protocol structure table +/*=========================================================================*/ +struct sDB2Fragment +{ + public: + // (Inline) Default constructor + sDB2Fragment() + : mStructID( 0 ), + mFragmentOrder( 0 ), + mFragmentOffset( 0 ), + mFragmentType( eDB2_FRAGMENT_TYPE_ENUM_BEGIN ), + mFragmentValue( 0 ), + mModifierType( eDB2_MOD_TYPE_ENUM_BEGIN ), + mpModifierValue( EMPTY_STRING ), + mpName( EMPTY_STRING ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + + if (mpModifierValue != 0 && mpModifierValue != EMPTY_STRING) + { + delete [] mpModifierValue; + mpModifierValue = 0; + } + }; + + // (Inline) Return object key + std::pair GetKey() const + { + std::pair key( mStructID, mFragmentOrder ); + return key; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + // Build a simple condition string + static std::string BuildCondition( + ULONG id, + eDB2Operator op, + LONGLONG val, + bool bF2F ); + + // Evaluate a simple condition + static bool EvaluateCondition( + LONGLONG valA, + eDB2Operator op, + LONGLONG valB ); + + // Parse a simple condition + static bool ParseCondition( + LPCSTR pCondition, + ULONG & id, + eDB2Operator & op, + LONGLONG & val, + bool & bF2F ); + + // Build a simple expression string + static std::string BuildExpression( + ULONG id, + eDB2ExpOperator op, + LONGLONG val, + bool bF2F ); + + // Evaluate a simple expression + static bool EvaluateExpression( + LONGLONG valA, + eDB2ExpOperator op, + LONGLONG valB, + LONGLONG & res ); + + // Parse a simple expression + static bool ParseExpression( + LPCSTR pExpr, + ULONG & id, + eDB2ExpOperator & op, + LONGLONG & val, + bool & bF2F ); + + /* Enclosing structure ID */ + ULONG mStructID; + + /* Order of fragment within structure */ + ULONG mFragmentOrder; + + /* Offset (in bits) of fragment from beginning of enclosing structure */ + int mFragmentOffset; + + /* Fragment type, how to interpret the following fragment value */ + eDB2FragmentType mFragmentType; + + /* Fragment Value */ + ULONG mFragmentValue; + + /* Modifier type, how to interpret the following modifier value */ + eDB2ModifierType mModifierType; + + /* Modifier value */ + LPCSTR mpModifierValue; + + /* Fragment Name */ + LPCSTR mpName; +}; + +/*=========================================================================*/ +// Struct sDB2Field +// +// Structure that defines the schema for the protocol field table +/*=========================================================================*/ +struct sDB2Field +{ + public: + // (Inline) Default constructor + sDB2Field() + : mID( 0 ), + mSize( 0 ), + mType( eDB2_FIELD_TYPE_ENUM_BEGIN ), + mTypeVal( 0 ), + mbHex( false ), + mbInternal( false ), + mDescriptionID( -1 ), + mpName( EMPTY_STRING ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if ( (mpName != 0) + && (mpName != EMPTY_STRING) ) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + ULONG GetKey() const + { + return mID; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Field ID */ + ULONG mID; + + /* Size of field (in bits, maximum is 64 bits for integral types) */ + ULONG mSize; + + /* Field type */ + eDB2FieldType mType; + + /* Actual field type (eDB2StdFieldType or enum ID) */ + ULONG mTypeVal; + + /* Display integral fields as hexadecimal? */ + bool mbHex; + + /* Is this field internal only? */ + bool mbInternal; + + /* Description of field */ + int mDescriptionID; + + /* Field name */ + LPCSTR mpName; +}; + +/*=========================================================================*/ +// Struct sDB2Category +// +// Structure that defines the generic category table schema, gives +// category ID, category name, category description, and parent +// category relationship (specified as a category ID into the very +// same table) +/*=========================================================================*/ +struct sDB2Category +{ + public: + // (Inline) Default constructor + sDB2Category() + : mID( 0 ), + mParentID( -1 ), + mpName( EMPTY_STRING ), + mDescriptionID( -1 ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + ULONG GetKey() const + { + return mID; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Category ID */ + ULONG mID; + + /* Category ID of parent, -1 implies no parent/category is at root */ + int mParentID; + + /* Category display name */ + LPCSTR mpName; + + /* Description of category */ + int mDescriptionID; +}; + + +/*=========================================================================== +METHOD: + ValidateDB2Categories (Public Method) + +DESCRIPTION: + Validate the relationship between a pair of DB category/reference tables + + NOTE: Discovered problems will be repaired, i.e. bogus/problematic + category IDs are reset to -1 + +PARAMETERS: + catMap [ I ] - The category table + refMap [ I ] - The reference table + pName [ I ] - Table name (for error reporting) + log [ I ] - Error log + +RETURN VALUE: + bool +===========================================================================*/ +template +bool ValidateDB2Categories( + std::map & catMap, + std::map & refMap, + LPCSTR pName, + cDB2StatusLog & log = gDB2DefaultLog ) +{ + // Assume success + bool bRC = true; + std::string err; + + // Sanity check table name + if (pName == 0 || pName[0] == 0) + { + pName = "?"; + } + + // First validate/repair category map; stage 1: bad parent IDs + std::map ::iterator pCats = catMap.begin(); + while (pCats != catMap.end()) + { + sDB2Category & cat = pCats->second; + pCats++; + + if (cat.IsValid() == false) + { + continue; + } + + // The parent ID must be -1 or exist in the category map + if (cat.mParentID != -1) + { + if (catMap.find( cat.mParentID ) == catMap.end()) + { + // Unable to locate parent category + std::ostringstream tmp; + tmp << "DB [" << pName << "] Missing ID, parent ID " + << cat.mParentID; + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + cat.mParentID = -1; + bRC = false; + } + } + } + + // Validate/repair category map; stage 2: loop detection + pCats = catMap.begin(); + while (pCats != catMap.end()) + { + std::set catsVisited; + sDB2Category & cat = pCats->second; + + // Itererate up through parents + int parentID = cat.mParentID; + while (parentID != -1) + { + // Have we already been here? + if (catsVisited.find( parentID ) == catsVisited.end()) + { + // Nope, add ID and go on to the next one + catsVisited.insert( parentID ); + + std::map ::iterator pParent; + pParent = catMap.find( parentID ); + + parentID = pParent->second.mParentID; + } + else + { + // Yes, we are caught in a loop + std::ostringstream tmp; + tmp << "DB [" << pName << "] Loop in category, parent ID " + << cat.mParentID; + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + cat.mParentID = -1; + bRC = false; + + break; + } + } + + pCats++; + } + + // Validate that each reference references valid category IDs + typename std::map ::iterator pTypes = refMap.begin(); + while (pTypes != refMap.end()) + { + NamedType & theType = pTypes->second; + std::set cats = theType.mCategoryIDs; + + std::set ::iterator pRefCats = cats.begin(); + while (pRefCats != cats.end()) + { + if (*pRefCats != -1) + { + pCats = catMap.find( *pRefCats ); + if (pCats == catMap.end()) + { + // Unable to locate category + std::ostringstream tmp; + tmp << "DB [" << pName << "] Missing ID, category ID " + << *pRefCats << ", reference " << theType.mpName; + + log.Log( tmp.str(), eDB2_STATUS_ERROR ); + + *pRefCats = -1; + bRC = false; + } + } + + pRefCats++; + } + + pTypes++; + } + + return bRC; +}; + +/*=========================================================================*/ +// Struct sDB2NVItem +// +// NVRAM item structure for database schema +/*=========================================================================*/ +struct sDB2NVItem +{ + public: + // (Inline) Default constructor + sDB2NVItem() + : mItem( 0 ), + mpName( EMPTY_STRING ), + mDescriptionID( -1 ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + ULONG GetKey() const + { + return mItem; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Category IDs (indices into NV items category table) */ + std::set mCategoryIDs; + + /* Item number */ + ULONG mItem; + + /* NV item display name */ + LPCSTR mpName; + + /* Description of NV item */ + int mDescriptionID; +}; + +/*=========================================================================*/ +// Struct sDB2Enum +// +// Structure that defines the schema for the enum table +/*=========================================================================*/ +struct sDB2Enum +{ + public: + // (Inline) Default constructor + sDB2Enum() + : mID( 0 ), + mbInternal( false ), + mpName( EMPTY_STRING ), + mDescriptionID( -1 ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + ULONG GetKey() const + { + return mID; + }; + + // Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Enum ID */ + ULONG mID; + + /* Is this enum used internally? */ + bool mbInternal; + + /* Description of enum */ + int mDescriptionID; + + /* Name of enum */ + LPCSTR mpName; +}; + +/*=========================================================================*/ +// Struct sDB2EnumEntry +// +// Structure that defines the schema for the enum entry table +/*=========================================================================*/ +struct sDB2EnumEntry +{ + public: + // (Inline) Default constructor + sDB2EnumEntry() + : mID( 0 ), + mValue( -1 ), + mbHex( false ), + mpName( EMPTY_STRING ), + mDescriptionID( -1 ) + { }; + + // (Inline) Free up our allocated strings + void FreeAllocatedStrings() + { + if (mpName != 0 && mpName != EMPTY_STRING) + { + delete [] mpName; + mpName = 0; + } + }; + + // (Inline) Return object key + std::pair GetKey() const + { + std::pair key( mID, mValue ); + return key; + }; + + // (Inline) Populate this object from a string + bool FromString( LPSTR pStr ); + + // Is this object valid? + bool IsValid() const; + + /* Enum ID */ + ULONG mID; + + /* Enum entry value */ + int mValue; + + /* Hexadecimal flag */ + bool mbHex; + + /* Enum value name */ + LPCSTR mpName; + + /* Description of enum value */ + int mDescriptionID; +}; + +/*=========================================================================*/ +// Struct sDB2SimpleCondition +// +// Structure that defines a (parsed) simple condition modifier +/*=========================================================================*/ +struct sDB2SimpleCondition +{ + public: + // (Inline) Default constructor + sDB2SimpleCondition() + : mID( 0 ), + mOperator( eDB2_OP_TYPE_ENUM_BEGIN ), + mValue( 0 ), + mbF2F( false ) + { }; + + // (Inline) Is this object valid? + bool IsValid() const + { + return ::IsValid( mOperator ); + }; + + /* ID of field whose value is to be used */ + ULONG mID; + + /* Operator to be used */ + eDB2Operator mOperator; + + /* Value (or field ID) to compare against */ + LONGLONG mValue; + + /* Field to field expression? */ + bool mbF2F; +}; + +/*=========================================================================*/ +// Struct sDB2SimpleExpression +// +// Structure that defines a (parsed) simple expression +/*=========================================================================*/ +struct sDB2SimpleExpression +{ + public: + // (Inline) Default constructor + sDB2SimpleExpression() + : mID( 0 ), + mOperator( eDB2_EXPOP_TYPE_ENUM_BEGIN ), + mValue( 0 ), + mbF2F( false ) + { }; + + // (Inline) Is this object valid? + bool IsValid() const + { + return (::IsValid( mOperator ) && mValue != 0); + }; + + /* ID of field whose value is to be used */ + ULONG mID; + + /* Operator to be used */ + eDB2ExpOperator mOperator; + + /* Value (or field ID) to compare against */ + LONGLONG mValue; + + /* Field to field expression? */ + bool mbF2F; +}; + +/*=========================================================================*/ +// Struct sLPCSTRCmp +// +// Structure that defines the '<' operator for string comparison +/*=========================================================================*/ +struct sLPCSTRCmp +{ + public: + // (Inline) Is A < B? + bool operator () ( + LPCSTR pStrA, + LPCSTR pStrB ) const + { + bool bLess = false; + if (pStrA != 0 && pStrB != 0) + { + bLess = (strcmp( pStrA, pStrB ) < 0); + } + + return bLess; + }; +}; + +/*=========================================================================*/ +// Case insensitive compare function +/*=========================================================================*/ +inline bool InsensitiveCompare( CHAR first, CHAR second ) +{ + return tolower( first ) < tolower( second ); +} + +/*=========================================================================*/ +// Struct sLPCSTRCmpI +// +// Structure that defines the '<' operator for string comparison +// (case insensitive version) +/*=========================================================================*/ +struct sLPCSTRCmpI +{ + public: + // (Inline) Is A < B? + bool operator () ( + LPCSTR pStrA, + LPCSTR pStrB ) const + { + bool bLess = false; + if (pStrA != 0 && pStrB != 0) + { + // Is there a simpler stl function for this? + bLess = std::lexicographical_compare( pStrA, + pStrA + + strlen( pStrA ), + pStrB, + pStrB + + strlen( pStrB ), + InsensitiveCompare ); + } + + return bLess; + }; +}; + +//--------------------------------------------------------------------------- +// Typedefs +//--------------------------------------------------------------------------- + +// The protocol entity table expressed as a type +typedef std::multimap , sDB2ProtocolEntity> tDB2EntityMap; + +// Protocol entity entity name to ID (reverse) table +typedef std::map , sLPCSTRCmpI> tDB2EntityNameMap; + +// The struct table expressed as a type +typedef std::map , sDB2Fragment> tDB2FragmentMap; + +// The field table expressed as a type +typedef std::map tDB2FieldMap; + +// A generic category table expressed as a type +typedef std::map tDB2CategoryMap; + +// NV item table expressed as a map type +typedef std::map tDB2NVMap; + +// Enum table expressed as a map type +typedef std::map tDB2EnumNameMap; + +// Enum entry table expressed as a map type +typedef std::map , sDB2EnumEntry> tDB2EnumEntryMap; + +// The built enumeration map +typedef std::pair < ULONG, std::map > tDB2EnumMapPair; +typedef std::map tDB2EnumMap; + +// Parsed fragment modifier map - optional fragment +typedef std::map tDB2OptionalModMap; + +// Parsed fragment modifier map - simple expression based sizes +typedef std::map tDB2ExpressionModMap; + +// Parsed fragment modifier map - element count specified arrays +typedef std::map tDB2Array1ModMap; + +// Parsed fragment modifier map - start/stop index specified arrays +typedef std::map > tDB2Array2ModMap; + +// A protocol entity navigation map expressed as a type +typedef std::map , cDB2NavTree *> tDB2EntityNavMap; + + + +/*=========================================================================*/ +// Class cCoreDatabase +/*=========================================================================*/ +class cCoreDatabase +{ + public: + // Constructor + cCoreDatabase(); + + // Destructor + virtual ~cCoreDatabase(); + + // Initialize the database - must be done once (and only once) prior + // to any database object access + virtual bool Initialize( LPCSTR pBasePath ); + virtual bool Initialize(); + + // Exit (cleanup) the database + virtual void Exit(); + + // Get the entity navigation tree for the given protocol entity, if + // none exists one will be built and returned + const cDB2NavTree * GetEntityNavTree( + const std::vector & key ) const; + + // Find the protocol entity with the specified key + bool FindEntity( + const std::vector & key, + sDB2ProtocolEntity & entity ) const; + + // Find the protocol entity with the specified name + bool FindEntity( + LPCSTR pEntityName, + sDB2ProtocolEntity & entity ) const; + + // Map a protocol entity name to an ID + bool MapEntityNameToID( + LPCSTR pName, + std::vector & key ) const; + + // Map the given enum value (specified by enum ID, and enum value) + // to the enum value name string + std::string MapEnumToString( + ULONG enumID, + int enumVal, + bool bSimpleErrFmt = false, + bool bHex = false ) const; + + // Map the given enum value (specified by enum name, and enum value) + // to the enum value name string + std::string MapEnumToString( + LPCSTR pEnumName, + int enumVal, + bool bSimpleErrFmt = false, + bool bHex = false ) const; + + // (Inline) Set status log (object must exist for the duration of + // the DB or at least until being reset) + void SetLog( cDB2StatusLog * pLog ) + { + if (pLog != 0) + { + mpLog = pLog; + } + }; + + // (Inline) Return protocol entities + const tDB2EntityMap & GetProtocolEntities() const + { + return mProtocolEntities; + }; + + // (Inline) Return protocol entity names + const tDB2EntityNameMap & GetProtocolEntityNames() const + { + return mEntityNames; + }; + + // (Inline) Return protocol structures + const tDB2FragmentMap & GetProtocolStructs() const + { + return mEntityStructs; + }; + + // (Inline) Return protocol fields + const tDB2FieldMap & GetProtocolFields() const + { + return mEntityFields; + }; + + // (Inline) Return assembled enumeration map + const tDB2EnumMap & GetEnums() const + { + return mEnumMap; + }; + + // (Inline) Return raw enumeration map + const tDB2EnumNameMap & GetRawEnums() const + { + return mEnumNameMap; + }; + + // (Inline) Return raw enumeration entry map + const tDB2EnumEntryMap & GetRawEnumEntries() const + { + return mEnumEntryMap; + }; + + // (Inline) Return parsed fragment modifier map - optional + const tDB2OptionalModMap & GetOptionalMods() const + { + return mOptionalModMap; + }; + + // (Inline) Return parsed fragment modifier map - expressions + const tDB2ExpressionModMap & GetExpressionMods() const + { + return mExpressionModMap; + }; + + // (Inline) Return parsed fragment modifier map - element + // count specified arrays + const tDB2Array1ModMap & GetArray1Mods() const + { + return mArray1ModMap; + }; + + // (Inline) Return parsed fragment modifier map - start/stop + // index specified arrays + const tDB2Array2ModMap & GetArray2Mods() const + { + return mArray2ModMap; + }; + + protected: + // Assemble the internal enum map + bool AssembleEnumMap(); + + // Assemble the internal protocol entity name map + bool AssembleEntityNameMap(); + + // Build the modifier tables + bool BuildModifierTables(); + + // Check and set the passed in path to something that is useful + std::string CheckAndSetBasePath( LPCSTR pBasePath ) const; + + // Load all tables related to structure (entity, struct, field) + bool LoadStructureTables( LPCSTR pBasePath ); + bool LoadStructureTables(); + + // Load all enumeration related tables + bool LoadEnumTables( LPCSTR pBasePath ); + bool LoadEnumTables(); + + // Validate (and attempt repair of) structure related tables + bool ValidateStructures(); + + // Validate a single structure + bool ValidateStructure( + ULONG structID, + std::set & fields, + ULONG depth ); + + // Validate a single field + bool ValidateField( + ULONG structID, + ULONG fieldID, + std::set & fields ); + + // Validate an array specifier + bool ValidateArraySpecifier( + const sDB2Fragment & frag, + const std::set & fields ); + + // Validate a simple optional fragment specifier + bool ValidateOptionalSpecifier( + const sDB2Fragment & frag, + const std::set & fields ); + + // Validate a simple expression fragment specifier + bool ValidateExpressionSpecifier( + const sDB2Fragment & frag, + const std::set & fields ); + + /* Status log */ + cDB2StatusLog * mpLog; + + /* Protocol entity table, referenced by multi-value key */ + tDB2EntityMap mProtocolEntities; + + /* Protocol entity keys, referenced by indexed by entity name */ + tDB2EntityNameMap mEntityNames; + + /* The on-demand Protocol entity navigation map */ + mutable tDB2EntityNavMap mEntityNavMap; + + /* Protocol entity struct table, indexed by struct ID & fragment order */ + tDB2FragmentMap mEntityStructs; + + /* Protocol entity field table, indexed by field ID */ + tDB2FieldMap mEntityFields; + + /* Enum map, indexed by enum ID */ + tDB2EnumNameMap mEnumNameMap; + + /* Enum entry map, indexed by enum ID/value pair */ + tDB2EnumEntryMap mEnumEntryMap; + + /* The assembled enum map */ + tDB2EnumMap mEnumMap; + + /* Parsed fragment modifier map - optional fragments */ + tDB2OptionalModMap mOptionalModMap; + + /* Parsed fragment modifier map - expression fragments */ + tDB2ExpressionModMap mExpressionModMap; + + /* Parsed fragment modifier map - element count specified arrays */ + tDB2Array1ModMap mArray1ModMap; + + /* Parsed fragment modifier map - start/stop index specified arrays */ + tDB2Array2ModMap mArray2ModMap; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreUtilities.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreUtilities.cpp new file mode 100755 index 0000000..64b5423 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreUtilities.cpp @@ -0,0 +1,1751 @@ +/*=========================================================================== +FILE: + CoreUtilities.cpp + +DESCRIPTION: + Collection of various utility methods + +PUBLIC CLASSES AND METHODS: + StringToLONG + StringToULONG + StringToLONGLONG + StringToULONGLONG + + ParseTokens() + ParseCommandLine() + ParseFormatSpecifier() + + FromString( CHAR ) + FromString( UCHAR ) + FromString( SHORT ) + FromString( USHORT ) + FromString( int ) + FromString( UINT ) + FromString( LONG ) + FromString( ULONG ) + FromString( LONGLONG ) + FromString( ULONGLONG ) + + ToString( CHAR ) + ToString( UCHAR ) + ToString( SHORT ) + ToString( USHORT ) + ToString( int ) + ToString( UINT ) + ToString( LONG ) + ToString( ULONG ) + ToString( LONGLONG ) + ToString( ULONGLONG ) + + ContainerToCSVString() + CSVStringToContainer() + CSVStringToValidatedContainer() + + SetDiff() + SetIntersection() + SetUnion() + + GetProgramPath() + EnumerateFolders() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "CoreUtilities.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Format specifier states +enum eFormatState +{ + eFMT_STATE_NORMAL, // [0] Normal state; outputting literal characters + eFMT_STATE_PERCENT, // [1] Just read '%' + eFMT_STATE_FLAG, // [2] Just read flag character + eFMT_STATE_WIDTH, // [3] Just read width specifier + eFMT_STATE_DOT, // [4] Just read '.' + eFMT_STATE_PRECIS, // [5] Just read precision specifier + eFMT_STATE_SIZE, // [6] Just read size specifier + eFMT_STATE_TYPE, // [7] Just read type specifier + eFMT_STATE_INVALID, // [8] Invalid format + + eFMT_STATES // [9] Number of format states +}; + +// Format specifier character classes +enum eFormatCharClass +{ + eFMT_CH_CLASS_OTHER, // [0] Character with no special meaning + eFMT_CH_CLASS_PERCENT, // [1] '%' + eFMT_CH_CLASS_DOT, // [2] '.' + eFMT_CH_CLASS_STAR, // [3] '*' + eFMT_CH_CLASS_ZERO, // [4] '0' + eFMT_CH_CLASS_DIGIT, // [5] '1'..'9' + eFMT_CH_CLASS_FLAG, // [6] ' ', '+', '-', '#' + eFMT_CH_CLASS_SIZE, // [7] 'h', 'l', 'L', 'N', 'F', 'w' + eFMT_CH_CLASS_TYPE // [8] Type specifying character +}; + +// Lookup table for determining class of a character (lower nibble) +// and next format specifier state (upper nibble) +const UCHAR gLookupTable[] = +{ + 0x06, // ' ', FLAG + 0x80, // '!', OTHER + 0x80, // '"', OTHER + 0x86, // '#', FLAG + 0x80, // '$', OTHER + 0x81, // '%', PERCENT + 0x80, // '&', OTHER + 0x00, // ''', OTHER + 0x00, // '(', OTHER + 0x10, // ')', OTHER + 0x03, // '*', STAR + 0x86, // '+', FLAG + 0x80, // ',', OTHER + 0x86, // '-', FLAG + 0x82, // '.', DOT + 0x80, // '/', OTHER + 0x14, // '0', ZERO + 0x05, // '1', DIGIT + 0x05, // '2', DIGIT + 0x45, // '3', DIGIT + 0x45, // '4', DIGIT + 0x45, // '5', DIGIT + 0x85, // '6', DIGIT + 0x85, // '7', DIGIT + 0x85, // '8', DIGIT + 0x05, // '9', DIGIT + 0x00, // :!', OTHER + 0x00, // ';', OTHER + 0x30, // '<', OTHER + 0x30, // '=', OTHER + 0x80, // '>', OTHER + 0x50, // '?', OTHER + 0x80, // '@', OTHER + 0x80, // 'A', OTHER + 0x00, // 'B', OTHER + 0x08, // 'C', TYPE + 0x00, // 'D', OTHER + 0x28, // 'E', TYPE + 0x27, // 'F', SIZE + 0x38, // 'G', TYPE + 0x50, // 'H', OTHER + 0x57, // 'I', SIZE + 0x80, // 'J', OTHER + 0x00, // 'K', OTHER + 0x07, // 'L', SIZE + 0x00, // 'M', OTHER + 0x37, // 'N', SIZE + 0x30, // 'O', OTHER + 0x30, // 'P', OTHER + 0x50, // 'Q', OTHER + 0x50, // 'R', OTHER + 0x88, // 'S', TYPE + 0x00, // 'T', OTHER + 0x00, // 'U', OTHER + 0x00, // 'V', OTHER + 0x20, // 'W', OTHER + 0x28, // 'X', TYPE + 0x80, // 'Y', OTHER + 0x88, // 'Z', TYPE + 0x80, // '[', OTHER + 0x80, // '\', OTHER + 0x00, // ']', OTHER + 0x00, // '^', OTHER + 0x00, // '-', OTHER + 0x60, // '`', OTHER + 0x60, // 'a', OTHER + 0x60, // 'b', OTHER + 0x68, // 'c', TYPE + 0x68, // 'd', TYPE + 0x68, // 'e', TYPE + 0x08, // 'f', TYPE + 0x08, // 'g', TYPE + 0x07, // 'h', SIZE + 0x78, // 'i', TYPE + 0x70, // 'j', OTHER + 0x70, // 'k', OTHER + 0x77, // 'l', SIZE + 0x70, // 'm', OTHER + 0x70, // 'n', OTHER + 0x08, // 'o', TYPE + 0x08, // 'p', TYPE + 0x00, // 'q', OTHER + 0x00, // 'r', OTHER + 0x08, // 's', TYPE + 0x00, // 't', OTHER + 0x08, // 'u', TYPE + 0x00, // 'v', OTHER + 0x07, // 'w', SIZE + 0x08 // 'x', TYPE +}; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + IsWhitespace (Private Free Method) + +DESCRIPTION: + Is this whitespace? + +PARAMETERS: + pStr [ I ] - The string + +RETURN VALUE: + bool +===========================================================================*/ +static bool IsWhitespace( LPCSTR pStr ) +{ + bool bWS = false; + + int c = (int)*pStr; + if (isspace( c )) + { + bWS = true; + } + + return bWS; +} + +/*=========================================================================== +METHOD: + IsHexadecimalString (Private Free Method) + +DESCRIPTION: + Is this a hexadecimal digits string? + +PARAMETERS: + pStr [ I ] - The string + +RETURN VALUE: + bool +===========================================================================*/ +static bool IsHexadecimalString( LPCSTR pStr ) +{ + // Assume not + bool bHex = false; + + // Skip whitespace + LPCSTR pTmp = pStr; + while (IsWhitespace( pTmp ) == true) + { + pTmp++; + } + + // Skip leading +/- + CHAR ch = *pTmp; + if (ch == '+' || ch == '-') + { + pTmp++; + } + + if (*pTmp == '0') + { + pTmp++; + if (*pTmp == 'x' || *pTmp == 'X') + { + bHex = true; + } + } + + return bHex; +} + +/*=========================================================================== +METHOD: + IsNegativeString (Private Free Method) + +DESCRIPTION: + Is this a string starting with a negative sign? + +PARAMETERS: + pStr [ I ] - The string + +RETURN VALUE: + bool +===========================================================================*/ +static bool IsNegativeString( LPCSTR pStr ) +{ + // Assume not + bool bNeg = false; + + // Skip whitespace + LPCSTR pTmp = pStr; + while (IsWhitespace( pTmp ) == true) + { + pTmp++; + } + + CHAR ch = *pTmp; + if (ch == '-') + { + bNeg = true; + } + + return bNeg; +} + +/*=========================================================================== +METHOD: + StringToLONG (Free Method) + +DESCRIPTION: + Replacement/front end for strtol + + NOTE: strtol does not correctly handle a negative integer + when specified in hexadecimal, so we have to check for that + first + +PARAMETERS: + pStr [ I ] - The string + base [ I ] - Base for conversion + val [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool StringToLONG( + LPCSTR pStr, + int base, + LONG & val ) +{ + // Assume failure + bool bOK = false; + if (pStr == 0 || *pStr == 0) + { + return bOK; + } + + // Hexadecimal? + if (base == 16 || (base == 0 && IsHexadecimalString( pStr ) == true)) + { + // No negative hexadecimal strings allowed + if (IsNegativeString( pStr ) == false) + { + // Reset error + errno = 0; + + // Use the unsigned version, then cast + LPSTR pEnd = (LPSTR)pStr; + ULONG tmpVal = strtoul( pStr, &pEnd, base ); + if (tmpVal != ULONG_MAX || errno != ERANGE) + { + // Where did we end? + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = (LONG)tmpVal; + bOK = true; + } + } + } + } + else + { + // Proceed as normal + LPSTR pEnd = (LPSTR)pStr; + LONG tmpVal = strtol( pStr, &pEnd, base ); + if ((tmpVal != LONG_MAX && tmpVal != LONG_MIN) || errno != ERANGE) + { + // Where did we end? + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = tmpVal; + bOK = true; + } + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + StringToULONG (Free Method) + +DESCRIPTION: + Replacement/front end for strtoul + +PARAMETERS: + pStr [ I ] - The string + base [ I ] - Base for conversion + val [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool StringToULONG( + LPCSTR pStr, + int base, + ULONG & val ) +{ + // Assume failure + bool bOK = false; + if (pStr == 0 || *pStr == 0) + { + return bOK; + } + + // No negative strings allowed + if (IsNegativeString( pStr ) == true) + { + return bOK; + } + + // Reset error + errno = 0; + + LPSTR pEnd = (LPSTR)pStr; + ULONG tmpVal = strtoul( pStr, &pEnd, base ); + if (tmpVal != ULONG_MAX || errno != ERANGE) + { + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = tmpVal; + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + StringToLONGLONG (Free Method) + +DESCRIPTION: + Replacement/front end for strtoll + + NOTE: strtoll does not correctly handle a negative integer + when specified in hexadecimal, so we have to check for that + first + +PARAMETERS: + pStr [ I ] - The string + base [ I ] - Base for conversion + val [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool StringToLONGLONG( + LPCSTR pStr, + int base, + LONGLONG & val ) +{ + // Assume failure + bool bOK = false; + if (pStr == 0 || *pStr == 0) + { + return bOK; + } + + if (base == 16 || (base == 0 && IsHexadecimalString( pStr ) == true)) + { + // No negative hexadecimal strings allowed + if (IsNegativeString( pStr ) == false) + { + // Reset error + errno = 0; + + // Use the unsigned version, then cast + LPSTR pEnd = (LPSTR)pStr; + ULONGLONG tmpVal = strtoull( pStr, &pEnd, base ); + if (tmpVal != ULLONG_MAX || errno != ERANGE) + { + // Where did we end? + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = (LONGLONG)tmpVal; + bOK = true; + } + } + } + } + else + { + // Proceed as normal + LPSTR pEnd = (LPSTR)pStr; + LONGLONG tmpVal = strtoll( pStr, &pEnd, base ); + if ((tmpVal != LLONG_MAX && tmpVal != LLONG_MIN) || errno != ERANGE) + { + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = tmpVal; + bOK = true; + } + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + StringToULONGLONG (Free Method) + +DESCRIPTION: + Replacement/front end for strtouill + +PARAMETERS: + pStr [ I ] - The string + base [ I ] - Base for conversion + val [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool StringToULONGLONG( + LPCSTR pStr, + int base, + ULONGLONG & val ) +{ + // Assume failure + bool bOK = false; + if (pStr == 0 || *pStr == 0) + { + return bOK; + } + + // No negative strings allowed + if (IsNegativeString( pStr ) == true) + { + return bOK; + } + + // Reset error + errno = 0; + + LPSTR pEnd = (LPSTR)pStr; + ULONGLONG tmpVal = strtoull( pStr, &pEnd, base ); + if (tmpVal != ULLONG_MAX || errno != ERANGE) + { + if (pEnd != pStr && (*pEnd == 0 || IsWhitespace( pEnd ) == true)) + { + // Success! + val = tmpVal; + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ParseCommandLine (Free Method) + +DESCRIPTION: + Parse a command line to tokens (a command line is a string of + space delimited values where a value that contains space is + enclosed in text) + +PARAMETERS: + commandLine [ I ] - The characters separating tokens + tokens [ O ] - The resultant vector of tokens + +RETURN VALUE: + None +===========================================================================*/ +void ParseCommandLine( + std::string commandLine, + std::vector & tokens ) +{ + ULONG count = (ULONG)commandLine.size(); + + for (ULONG nEndToken = 0; nEndToken < count;) + { + // Skip leading spaces + int nStartToken = commandLine.find_first_not_of( " ", nEndToken ); + if (nStartToken == -1) + { + // All that is left is spaces + return; + } + + int stringLength = 0; + + // In Quotes? If so ignore spaces until next quote + if (commandLine[ nStartToken ] == '\"') + { + nStartToken++; + nEndToken = commandLine.find( '\"', nStartToken ); + if (nEndToken == -1) + { + // Unable to find trailing quote, fail + return; + } + stringLength = nEndToken - nStartToken; + nEndToken++; + } + else + { + nEndToken = commandLine.find( ' ', nStartToken ); + if (nEndToken == -1) + { + // Unable to find trailing space, use end + nEndToken = commandLine.size(); + } + + stringLength = nEndToken - nStartToken; + } + + std::string newToken = commandLine.substr( nStartToken, stringLength ); + tokens.push_back( newToken ); + } +} + +/*=========================================================================== +METHOD: + ParseTokens (Free Method) + +DESCRIPTION: + Parse a line into individual tokens + + NOTE: No attempt is made to handle accidental separators, i.e. searching + for ',' on 'foo, bar, "foo, bar"' will return four tokens, not three so + pick something like '^' instead of ','! + +PARAMETERS: + pSeparator [ I ] - The characters separating tokens + pLine [ I ] - The string being parsed + tokens [ O ] - The resultant vector of tokens + +RETURN VALUE: + None +===========================================================================*/ +void ParseTokens( + LPCSTR pSeparator, + LPSTR pLine, + std::vector & tokens ) +{ + if (pSeparator != 0 && pSeparator[0] != 0 && pLine != 0 && pLine[0] != 0) + { + LPSTR pToken = strtok( pLine, pSeparator ); + while (pToken != 0) + { + // Store token + tokens.push_back( pToken ); + + // Get next token: + pToken = strtok( 0, pSeparator ); + } + } +} + +/*=========================================================================== +METHOD: + ParseFormatSpecifier (Free Method) + +DESCRIPTION: + Parse a format specifier into individual format type tokens + +PARAMETERS: + pFmt [ I ] - The format specifier (must be NULL terminated) + fmtLen [ I ] - Length of above format specifier + fmtTypes [ O ] - The individual format type tokens ('d', 'u', 'us' etc.) + +RETURN VALUE: + bool - Valid format specifier? +===========================================================================*/ +bool ParseFormatSpecifier( + LPCSTR pFmt, + ULONG fmtLen, + std::vector & fmtTypes ) +{ + // Assume failure + bool bOK = false; + + // Make sure string is NULL terminated + CHAR ch; + ULONG chars = 0; + while (chars < fmtLen) + { + if (pFmt[chars] == '\0') + { + break; + } + else + { + chars++; + } + } + + if (pFmt[chars] != '\0') + { + return bOK; + } + + // Extract individual format type tokens + eFormatState state = eFMT_STATE_NORMAL; + eFormatCharClass cc = eFMT_CH_CLASS_OTHER; + while ((ch = *pFmt++) != '\0' && state != eFMT_STATE_INVALID) + { + // Find character class + cc = eFMT_CH_CLASS_OTHER; + if (ch >= ' ' && ch <= 'x') + { + cc = (eFormatCharClass)(gLookupTable[ch - ' '] & 0xF); + } + + // Find next state + state = (eFormatState)(gLookupTable[cc * eFMT_STATES + (state)] >> 4); + switch (state) + { + case eFMT_STATE_NORMAL: + NORMAL_STATE: + break; + + case eFMT_STATE_PERCENT: + case eFMT_STATE_FLAG: + case eFMT_STATE_DOT: + break; + + case eFMT_STATE_WIDTH: + case eFMT_STATE_PRECIS: + if (ch == '*') + { + fmtTypes.push_back( ch ); + } + break; + + case eFMT_STATE_SIZE: + switch (ch) + { + case 'l': + if (*pFmt == 'l') + { + ++pFmt; + } + break; + + case 'I': + if ( (*pFmt == '6') && (*(pFmt + 1) == '4') ) + { + pFmt += 2; + } + else if ( (*pFmt == '3') && (*(pFmt + 1) == '2') ) + { + pFmt += 2; + } + else if ( (*pFmt == 'd') + || (*pFmt == 'i') + || (*pFmt == 'o') + || (*pFmt == 'u') + || (*pFmt == 'x') + || (*pFmt == 'X') ) + { + // Nothing further needed + } + else + { + state = eFMT_STATE_NORMAL; + goto NORMAL_STATE; + } + break; + + case 'h': + case 'w': + break; + } + break; + + case eFMT_STATE_TYPE: + fmtTypes.push_back( ch ); + break; + } + } + + bOK = (state == eFMT_STATE_NORMAL || state == eFMT_STATE_TYPE); + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + CHAR & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + LONG val = LONG_MAX; + bOK = StringToLONG( pStr, 0, val ); + if (bOK == true) + { + // Reset status + bOK = false; + + // Was this provided as a hexadecimal string? + if (IsHexadecimalString( pStr ) == true) + { + // Yes, the return value is a LONG, so check against + // the maximum range for a UCHAR, before casting to + // a CHAR (to pick sign back up) + if (val <= UCHAR_MAX) + { + // Success! + theType = (CHAR)val; + bOK = true; + } + } + else if (val >= SCHAR_MIN && val <= SCHAR_MAX) + { + // Success! + theType = (CHAR)val; + bOK = true; + } + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + UCHAR & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + ULONG val = ULONG_MAX; + bOK = StringToULONG( pStr, 0, val ); + if (bOK == true && val <= UCHAR_MAX) + { + // Success! + theType = (UCHAR)val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + SHORT & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + LONG val = LONG_MAX; + bOK = StringToLONG( pStr, 0, val ); + if (bOK == true) + { + // Reset status + bOK = false; + + // Was this provided as a hexadecimal string? + if (IsHexadecimalString( pStr ) == true) + { + // Yes, the return value is a LONG, so check against + // the maximum range for a USHORT, before casting to + // a SHORT (to pick sign back up) + if (val <= USHRT_MAX) + { + // Success! + theType = (SHORT)val; + bOK = true; + } + } + else if (val >= SHRT_MIN && val <= SHRT_MAX) + { + // Success! + theType = (SHORT)val; + bOK = true; + } + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + USHORT & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + ULONG val = ULONG_MAX; + bOK = StringToULONG( pStr, 0, val ); + if (bOK == true && val <= USHRT_MAX) + { + // Success! + theType = (USHORT)val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + int & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + LONG val = LONG_MAX; + bOK = StringToLONG( pStr, 0, val ); + if (bOK == true && (val >= INT_MIN && val <= INT_MAX)) + { + // Success! + theType = (int)val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + UINT & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + ULONG val = ULONG_MAX; + bOK = StringToULONG( pStr, 0, val ); + if (bOK == true && val <= UINT_MAX) + { + // Success! + theType = (UINT)val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + LONG & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + LONG val = LONG_MAX; + bOK = StringToLONG( pStr, 0, val ); + if (bOK == true) + { + // Success! + theType = val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + ULONG & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + ULONG val = ULONG_MAX; + bOK = StringToULONG( pStr, 0, val ); + if (bOK == true) + { + // Success! + theType = val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + LONGLONG & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + LONGLONG val = LLONG_MAX; + bOK = StringToLONGLONG( pStr, 0, val ); + if (bOK == true) + { + // Success! + theType = val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + FromString (Free Method) + +DESCRIPTION: + Convert a string to a value + +PARAMETERS: + pStr [ I ] - The string + theType [ O ] - Resulting value + +RETURN VALUE: + bool +===========================================================================*/ +bool FromString( + LPCSTR pStr, + ULONGLONG & theType ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + ULONGLONG val = ULLONG_MAX; + bOK = StringToULONGLONG( pStr, 0, val ); + if (bOK == true) + { + // Success! + theType = val; + } + else + { + bOK = false; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + CHAR val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int tmp = (int)val; + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%d", + tmp ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + UCHAR val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%u", + (UINT)val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + SHORT val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int tmp = (int)val; + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%d", + tmp ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + USHORT val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%u", + (UINT)val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + int val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%d", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + UINT val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%u", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + LONG val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%ld", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + ULONG val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%lu", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + LONGLONG val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%lld", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ToString (Free Method) + +DESCRIPTION: + Convert a value to a string + +PARAMETERS: + val [ I ] - The value to convert + pStr [ O ] - The resulting string + +RETURN VALUE: + bool +===========================================================================*/ +bool ToString( + ULONGLONG val, + LPSTR pStr ) +{ + // Assume failure + bool bOK = false; + + if (pStr != 0) + { + int rc = snprintf( pStr, + (size_t)(SUGGESTED_BUFFER_LEN - 1), + "%llu", + val ); + + if (rc < 0) + { + pStr[0] = 0; + } + else + { + // Success! + bOK = true; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + GetProgramPath (Public Method) + +DESCRIPTION: + Return the special folder used for storing program files + +RETURN VALUE: + std::string (Static value of "/opt/Qualcomm/Gobi/") +===========================================================================*/ +std::string GetProgramPath() +{ + // If running programs's path is desired we could + // use readlink with /proc/getpid()/exe + + // Just using static path, as we don't want them to move it + std::string path = "/opt/Qualcomm/Gobi/"; + + return path; + +} + +/*=========================================================================== +METHOD: + IsFolder (Free Method) + +DESCRIPTION: + Helper function for EnumerateFolders, tells if a dirent is a folder. + This reduces the memory usage by scandir, as compared to checking after + scandir returns. + +PARAMETERS: + pFile [ I ] - dirent structure describing file + +RETURN VALUE: + int: zero - Ignore this file + nonzero - Process this file +===========================================================================*/ +int IsFolder( const struct dirent * pFile ) +{ + // Ignore anything beginning with a '.' + if (pFile->d_name[0] == '.') + { + return 0; + } + + return (pFile->d_type == DT_DIR ? 1 : 0); +} + +/*=========================================================================== +METHOD: + EnumerateFolders (Public Method) + +DESCRIPTION: + Enumerate the subfolders of the given folder (recursive) + +PARAMETERS: + baseFolder [ I ] - Folder to search in + foundFolders [ O ] - Fully qualified paths of found folders + +RETURN VALUE: + None +===========================================================================*/ +void EnumerateFolders( + const std::string & baseFolder, + std::vector & foundFolders ) +{ + if (baseFolder.size() == 0) + { + return; + } + + std::string folderSearch = baseFolder; + + // Add trailing / if not present + int folderLen = folderSearch.size(); + if (folderSearch[folderLen - 1] != '/') + { + folderSearch += '/'; + } + + dirent ** ppDevFiles; + + // Yes, scandir really takes a triple pointer for its second param + int nNumDevFiles = scandir( folderSearch.c_str(), + &ppDevFiles, + IsFolder, + alphasort ); + for (int nFile = 0; nFile < nNumDevFiles; nFile++) + { + std::string newFolder = folderSearch + ppDevFiles[nFile]->d_name; + free( ppDevFiles[nFile] ); + + foundFolders.push_back( newFolder ); + EnumerateFolders( newFolder, foundFolders ); + } + + if (nNumDevFiles != -1) + { + free( ppDevFiles ); + } +} + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreUtilities.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreUtilities.h new file mode 100755 index 0000000..5b73e0a --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/CoreUtilities.h @@ -0,0 +1,649 @@ +/*=========================================================================== +FILE: + CoreUtilities.h + +DESCRIPTION: + Collection of various utility methods + +PUBLIC CLASSES AND METHODS: + StringToLONG + StringToULONG + StringToLONGLONG + StringToULONGLONG + + ParseCommandLine() + ParseTokens() + ParseFormatSpecifier() + + FromString( CHAR ) + FromString( UCHAR ) + FromString( SHORT ) + FromString( USHORT ) + FromString( int ) + FromString( UINT ) + FromString( LONG ) + FromString( ULONG ) + FromString( LONGLONG ) + FromString( ULONGLONG ) + + ToString( CHAR ) + ToString( UCHAR ) + ToString( SHORT ) + ToString( USHORT ) + ToString( int ) + ToString( UINT ) + ToString( LONG ) + ToString( ULONG ) + ToString( LONGLONG ) + ToString( ULONGLONG ) + + GetProgramPath() + EnumerateFolders() + + ContainerToCSVString() + CSVStringToContainer() + CSVStringToValidatedContainer() + + SetDiff() + SetIntersection() + SetUnion() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Suggested size of an argument buffer to ToString() for any key, each +// ToString() should not write more than this size to the passed in buffer +const ULONG SUGGESTED_BUFFER_LEN = 64; + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +// Replacement/front end for _tcstol +bool StringToLONG( + LPCSTR pStr, + int base, + LONG & val ); + +// Replacement/front end for _tcstoul +bool StringToULONG( + LPCSTR pStr, + int base, + ULONG & val ); + +// Replacement/front end for _tcstoi64 +bool StringToLONGLONG( + LPCSTR pStr, + int base, + LONGLONG & val ); + +// Replacement/front end for _tcstoui64 +bool StringToULONGLONG( + LPCSTR pStr, + int base, + ULONGLONG & val ); + +// Parse a command line to tokens (a command line is a string of +// space delimited values where a value that contains space is +// enclosed in text) +void ParseCommandLine( + std::string commandLine, + std::vector & tokens ); + +// Parse a line into individual tokens +void ParseTokens( + LPCSTR pSeparator, + LPSTR pLine, + std::vector & tokens ); + +// Parse a format specifier into individual format type tokens +bool ParseFormatSpecifier( + LPCSTR pFmt, + ULONG fmtLen, + std::vector & fmtTypes ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + CHAR & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + UCHAR & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + SHORT & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + USHORT & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + int & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + UINT & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + LONG & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + ULONG & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + LONGLONG & theType ); + +// Convert a string to a value +bool FromString( + LPCSTR pStr, + ULONGLONG & theType ); + + +// Convert a value to a string +bool ToString( + CHAR val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + UCHAR val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + SHORT val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + USHORT val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + int val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + UINT val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + LONG val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + ULONG val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + LONGLONG val, + LPSTR pStr ); + +// Convert a value to a string +bool ToString( + ULONGLONG val, + LPSTR pStr ); + +// Return the special folder used for storing program files +std::string GetProgramPath(); + +// Enumerate the subfolders of the given folder (recursive) +void EnumerateFolders( + const std::string & baseFolder, + std::vector & foundFolders ); + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + ContainerToCSVString (Free Method) + +DESCRIPTION: + Convert the contents of a container to a CSV string + + NOTE: ToString() must be defined for the container value type + +PARAMETERS: + cont [ I ] - The container + sep [ I ] - The character separating tokens + csv [ O ] - The resulting comma separated string + +RETURN VALUE: + None +===========================================================================*/ +template +void ContainerToCSVString( + const Container & cont, + CHAR sep, + std::string & csv ) +{ + csv = ""; + if ((ULONG)cont.size() > (ULONG)0) + { + CHAR keyBuf[SUGGESTED_BUFFER_LEN]; + + typename Container::const_iterator pIter = cont.begin(); + while (pIter != cont.end()) + { + const typename Container::value_type & theKey = *pIter; + bool bOK = ToString( theKey, &keyBuf[0] ); + + if (bOK == true && keyBuf[0] != 0) + { + if (pIter != cont.begin()) + { + csv += sep; + } + + csv += (LPCSTR)&keyBuf[0]; + } + + pIter++; + } + } +} + +/*=========================================================================== +METHOD: + CSVStringToContainer (Free Method) + +DESCRIPTION: + Populate a container from a parsed CSV string + + NOTE: FromString() must be defined for the container value type + NOTE: The container is emptied before this operation is attempted + +PARAMETERS: + pSeparator [ I ] - The characters separating tokens + pCSV [ I ] - The comma separated string (will be modified) + cont [ O ] - The resulting container + bClear [ I ] - Clear the container first? NOTE: if the container + is not cleared first then insertions may fail for + duplicate keys + +RETURN VALUE: + None +===========================================================================*/ +template +void CSVStringToContainer( + LPCSTR pSeparator, + LPSTR pCSV, + Container & cont, + bool bClear = true ) +{ + if (pCSV != 0 && *pCSV != 0) + { + // Remove a leading quote? + if (*pCSV == '\"') + { + pCSV++; + } + + // Remove a trailing quote? + ULONG len = (ULONG)strlen( pCSV ); + if (len > 0) + { + if (pCSV[len - 1] == '\"') + { + pCSV[len - 1] = 0; + } + } + + // Clear the container first? + if (bClear == true) + { + cont.clear(); + } + + std::vector tokens; + ParseTokens( pSeparator, pCSV, tokens ); + + std::vector ::const_iterator pIter = tokens.begin(); + while (pIter != tokens.end()) + { + LPCSTR pTok = *pIter; + + typename Container::value_type theKey; + bool bOK = ::FromString( pTok, theKey ); + + if (bOK == true) + { + std::insert_iterator is( cont, cont.end() ); + *is = theKey; + } + + pIter++; + } + } +} + +/*=========================================================================== +METHOD: + CSVStringToValidatedContainer (Free Method) + +DESCRIPTION: + Populate a container from a parsed CSV string + + NOTE: FromString() and IsValid() must be defined for the container + value type (the later need not do anything but return true) + + NOTE: The container is emptied before this operation is attempted + +PARAMETERS: + pSeparator [ I ] - The characters separating tokens + pCSV [ I ] - The comma separated string (will be modified) + cont [ O ] - The resulting container + +RETURN VALUE: + None +===========================================================================*/ +template +void CSVStringToValidatedContainer( + LPCSTR pSeparator, + LPSTR pCSV, + Container & cont ) +{ + cont.clear(); + if (pCSV != 0 && *pCSV != 0) + { + // Remove a leading quote? + if (*pCSV == '\"') + { + pCSV++; + } + + // Remove a trailing quote? + ULONG len = (ULONG)strlen( pCSV ); + if (len > 0) + { + if (pCSV[len - 1] == '\"') + { + pCSV[len - 1] = 0; + } + } + + cont.clear(); + + std::vector tokens; + ParseTokens( pSeparator, pCSV, tokens ); + + std::vector ::const_iterator pIter = tokens.begin(); + while (pIter != tokens.end()) + { + LPCSTR pTok = *pIter; + + typename Container::value_type theKey; + bool bOK = ::FromString( pTok, theKey ); + + if (bOK == true) + { + bool bValid = IsValid( theKey ); + if (bValid == true) + { + std::insert_iterator is( cont, cont.end() ); + *is = theKey; + } + } + + pIter++; + } + } +} + +/*=========================================================================== +METHOD: + SetDiff (Free Method) + +DESCRIPTION: + Given two sets return a third that contains everything in the first + set but not the second set + +PARAMETERS: + setA [ I ] - The first set + setB [ I ] - The second set + +RETURN VALUE: + std::set - the difference +===========================================================================*/ +template +std::set SetDiff( + const std::set & setA, + const std::set & setB ) +{ + std::set retSet; + + if (setB.size() == 0) + { + // Everything that is in the first set but not the second + // (empty) set is ... the first set! + retSet = setA; + } + else if (setA.size() == 0) + { + // The first set is empty, hence the return set is empty + } + else + { + // Both sets have elements, therefore the iterators will + // be valid and we can use the standard approach + typename std::set ::const_iterator pIterA = setA.begin(); + typename std::set ::const_iterator pIterB = setB.begin(); + + for ( ; pIterA != setA.end() && pIterB != setB.end(); ) + { + if (*pIterA < *pIterB) + { + retSet.insert( *pIterA ); + pIterA++; + } + else if (*pIterB < *pIterA) + { + pIterB++; + } + else + { + pIterA++; + pIterB++; + } + } + + while (pIterA != setA.end()) + { + retSet.insert( *pIterA ); + pIterA++; + } + } + + return retSet; +} + +/*=========================================================================== +METHOD: + SetIntersection (Free Method) + +DESCRIPTION: + Given two sets return a third that contains everything that is in both + sets + +PARAMETERS: + setA [ I ] - The first set + setB [ I ] - The second set + +RETURN VALUE: + std::set - the union +===========================================================================*/ +template +std::set SetIntersection( + const std::set & setA, + const std::set & setB ) +{ + std::set retSet; + + // Neither set can be empty + if (setA.size() != 0 && setA.size() != 0) + { + // Both sets have elements, therefore the iterators will + // be valid and we can use the standard approach + typename std::set ::const_iterator pIterA = setA.begin(); + typename std::set ::const_iterator pIterB = setB.begin(); + + for ( ; pIterA != setA.end() && pIterB != setB.end(); ) + { + if (*pIterA < *pIterB) + { + pIterA++; + } + else if (*pIterB < *pIterA) + { + pIterB++; + } + else + { + retSet.insert( *pIterA ); + pIterA++; + pIterB++; + } + } + } + + return retSet; +} + +/*=========================================================================== +METHOD: + SetUnion (Free Method) + +DESCRIPTION: + Given two sets return a third that contains everything that is either + in the first set or in the second set + +PARAMETERS: + setA [ I ] - The first set + setB [ I ] - The second set + +RETURN VALUE: + std::set - the union +===========================================================================*/ +template +std::set SetUnion( + const std::set & setA, + const std::set & setB ) +{ + std::set retSet; + + if (setB.size() == 0) + { + // Everything that is in the first (possibly empty) set or in + // the second (empty) set is ... the first set! + retSet = setA; + } + else if (setA.size() == 0) + { + // Everything that is in the first (empty) set or in the + // second (possibly empty) set is ... the second set! + retSet = setB; + } + else + { + // Both sets have elements, therefore the iterators will + // be valid and we can use the standard approach + typename std::set ::const_iterator pIterA = setA.begin(); + typename std::set ::const_iterator pIterB = setB.begin(); + + for ( ; pIterA != setA.end() && pIterB != setB.end(); ) + { + if (*pIterA < *pIterB) + { + retSet.insert( *pIterA ); + pIterA++; + } + else if (*pIterB < *pIterA) + { + retSet.insert( *pIterB ); + pIterB++; + } + else + { + retSet.insert( *pIterA ); + pIterA++; + pIterB++; + } + } + + while (pIterA != setA.end()) + { + retSet.insert( *pIterA ); + pIterA++; + } + + while (pIterB != setB.end()) + { + retSet.insert( *pIterB ); + pIterB++; + } + } + + return retSet; +} + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2NavTree.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2NavTree.cpp new file mode 100755 index 0000000..3705dcf --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2NavTree.cpp @@ -0,0 +1,434 @@ +/*=========================================================================== +FILE: + ProtocolEntityNavTree.cpp + +DESCRIPTION: + Implementation of cDB2NavTree + +PUBLIC CLASSES AND METHODS: + sDB2NavFragment + cDB2NavTree + This class distills the database description of a protocol + entity into a simple tree structure more suited to + efficient navigation for parsing/packing + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "DB2NavTree.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sDB2NavFragment Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sDB2NavFragment (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +sDB2NavFragment::sDB2NavFragment() + : mpField( 0 ), + mpFragment( 0 ), + mpNextFragment( 0 ), + mpLinkFragment( 0 ) +{ + // Nothing to do +} + +/*=========================================================================*/ +// cDB2NavTree Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cDB2NavTree (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + db [ I ] - Database to use + +RETURN VALUE: + None +===========================================================================*/ +cDB2NavTree::cDB2NavTree( const cCoreDatabase & db ) + : mDB( db ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cDB2NavTree (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cDB2NavTree::~cDB2NavTree() +{ + // Clean-up our fragment allocations + std::list ::iterator pIter; + for (pIter = mFragments.begin(); pIter != mFragments.end(); pIter++) + { + sDB2NavFragment * pFrag = *pIter; + if (pFrag != 0) + { + delete pFrag; + } + } +} + +/*=========================================================================== +METHOD: + BuildTree (Internal Method) + +DESCRIPTION: + Build nav tree for the entity described by the given key/name + +PARAMETERS: + key [ I ] - Key into the protocol entity table + +RETURN VALUE: + bool +===========================================================================*/ +bool cDB2NavTree::BuildTree( const std::vector & key ) +{ + // Assume failure + bool bRC = false; + + // Look up entity definition + bool bFound = mDB.FindEntity( key, mEntity ); + + // Did we find it? + if (bFound == false) + { + // No definition in database + return bRC; + } + + // A structure to navigate? + if (mEntity.mStructID == -1) + { + bRC = true; + return bRC; + } + + const tDB2FragmentMap & structTable = mDB.GetProtocolStructs(); + + // Grab first fragment of structure + std::pair id( mEntity.mStructID, 0 ); + tDB2FragmentMap::const_iterator pFrag = structTable.find( id ); + + // Nothing to navigate? + if (pFrag == structTable.end()) + { + ASSERT( 0 ); + return bRC; + } + + // No name? + if (mEntity.mpName == 0 || mEntity.mpName[0] == 0) + { + ASSERT( 0 ); + return bRC; + } + + // Process the initial structure + bRC = ProcessStruct( &pFrag->second, 0 ); + return bRC; +} + +/*=========================================================================== +METHOD: + ProcessStruct (Internal Method) + +DESCRIPTION: + Process a structure described by the given initial fragment + +PARAMETERS: + frag [ I ] - Entry point for structure + pOwner [ I ] - Owning fragment + +RETURN VALUE: + bool +===========================================================================*/ +bool cDB2NavTree::ProcessStruct( + const sDB2Fragment * pFrag, + sDB2NavFragment * pOwner ) +{ + // Assume success + bool bRC = true; + + // Grab struct ID/fragment ID from fragment + std::pair key = pFrag->GetKey(); + ULONG structID = key.first; + + const tDB2FragmentMap & structTable = mDB.GetProtocolStructs(); + const tDB2FieldMap & fieldTable = mDB.GetProtocolFields(); + + // Sync iterator to fragment + tDB2FragmentMap::const_iterator pFragIter = structTable.find( key ); + if (pFragIter == structTable.end()) + { + // This should not happen + ASSERT( 0 ); + + bRC = false; + return bRC; + } + + // Fragments we allocate along the way + sDB2NavFragment * pOld = 0; + sDB2NavFragment * pNew = 0; + + // Process each fragment in the structure + while ( (pFragIter != structTable.end()) + && (pFragIter->second.mStructID == structID) ) + { + pFrag = &pFragIter->second; + + // Allocate our new fragment + pNew = new sDB2NavFragment; + if (pNew == 0) + { + bRC = false; + break; + } + + // Store DB fragemnt + pNew->mpFragment = pFrag; + mFragments.push_back( pNew ); + + // Hook previous up to us + if (pOld != 0 && pOld->mpNextFragment == 0) + { + pOld->mpNextFragment = pNew; + } + + // Hook owner up to us + if (pOwner != 0 && pOwner->mpLinkFragment == 0) + { + pOwner->mpLinkFragment = pNew; + } + + // Modified? + switch (pFrag->mModifierType) + { + case eDB2_MOD_VARIABLE_ARRAY: + case eDB2_MOD_VARIABLE_STRING1: + case eDB2_MOD_VARIABLE_STRING2: + case eDB2_MOD_VARIABLE_STRING3: + { + const tDB2Array1ModMap & arrays1 = mDB.GetArray1Mods(); + + tDB2Array1ModMap::const_iterator pTmp; + pTmp = arrays1.find( pFrag->mpModifierValue ); + + if (pTmp != arrays1.end()) + { + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[pTmp->second] = entry; + } + else + { + bRC = false; + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY2: + { + const tDB2Array2ModMap & arrays2 = mDB.GetArray2Mods(); + + tDB2Array2ModMap::const_iterator pTmp; + pTmp = arrays2.find( pFrag->mpModifierValue ); + + if (pTmp != arrays2.end()) + { + // We need to track the value of the given fields + std::pair entry( false, 0 ); + mTrackedFields[pTmp->second.first] = entry; + mTrackedFields[pTmp->second.second] = entry; + } + else + { + bRC = false; + } + } + break; + + case eDB2_MOD_OPTIONAL: + { + const tDB2OptionalModMap & conditions = mDB.GetOptionalMods(); + + tDB2OptionalModMap::const_iterator pTmp; + pTmp = conditions.find( pFrag->mpModifierValue ); + + if (pTmp != conditions.end()) + { + const sDB2SimpleCondition & con = pTmp->second; + + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[con.mID] = entry; + + if (con.mbF2F == true) + { + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[(ULONG)con.mValue] = entry; + } + } + else + { + bRC = false; + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY3: + { + const tDB2ExpressionModMap & exprs = mDB.GetExpressionMods(); + + tDB2ExpressionModMap::const_iterator pTmp; + pTmp = exprs.find( pFrag->mpModifierValue ); + + if (pTmp != exprs.end()) + { + const sDB2SimpleExpression & expr = pTmp->second; + + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[expr.mID] = entry; + + if (expr.mbF2F == true) + { + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[(ULONG)expr.mValue] = entry; + } + } + else + { + bRC = false; + } + } + break; + }; + + // What type of fragment is this? + switch (pFrag->mFragmentType) + { + case eDB2_FRAGMENT_FIELD: + { + // Grab field ID + ULONG fieldID = pFrag->mFragmentValue; + + // Find field representation in database + tDB2FieldMap::const_iterator pField = fieldTable.find( fieldID ); + if (pField != fieldTable.end()) + { + pNew->mpField = &pField->second; + } + else + { + bRC = false; + } + } + break; + + case eDB2_FRAGMENT_STRUCT: + { + // Grab structure ID + ULONG structID = pFrag->mFragmentValue; + + // Grab first fragment of structure + std::pair id( structID, 0 ); + tDB2FragmentMap::const_iterator pFragIterTmp; + pFragIterTmp = structTable.find( id ); + if (pFragIterTmp != structTable.end()) + { + pFrag = &pFragIterTmp->second; + bRC = ProcessStruct( pFrag, pNew ); + } + else + { + bRC = false; + } + } + break; + + case eDB2_FRAGMENT_VARIABLE_PAD_BITS: + case eDB2_FRAGMENT_VARIABLE_PAD_BYTES: + { + // We need to track the value of the given field + std::pair entry( false, 0 ); + mTrackedFields[pFrag->mFragmentValue] = entry; + + bRC = true; + } + break; + + default: + bRC = true; + break; + } + + if (bRC == true) + { + pFragIter++; + + pOld = pNew; + pNew = 0; + } + else + { + break; + } + } + + return bRC; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2NavTree.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2NavTree.h new file mode 100755 index 0000000..a1745ba --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2NavTree.h @@ -0,0 +1,136 @@ +/*=========================================================================== +FILE: + ProtocolEntityNavTree.h + +DESCRIPTION: + Declaration of cProtocolEntityNavTree + +PUBLIC CLASSES AND METHODS: + sDB2NavFragment + cDB2NavTree + This class distills the database description of a protocol + entity into a simple tree structure more suited to + efficient navigation for parsing/packing + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "CoreDatabase.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Struct sDB2NavFragment +// Protocol entity navigation fragment +/*=========================================================================*/ +struct sDB2NavFragment +{ + public: + // Constructor + sDB2NavFragment(); + + /* Associated DB fragment (never empty) */ + const sDB2Fragment * mpFragment; + + /* Associated DB field (may be empty) */ + const sDB2Field * mpField; + + /* Next fragment in this structure */ + const sDB2NavFragment * mpNextFragment; + + /* Fragment linked to this structure */ + const sDB2NavFragment * mpLinkFragment; +}; + +/*=========================================================================*/ +// Class cDB2NavTree +// Class to describe a protocol entity suited to efficient navigation +/*=========================================================================*/ +class cDB2NavTree +{ + public: + // Constructor + cDB2NavTree( const cCoreDatabase & db ); + + // Destructor + virtual ~cDB2NavTree(); + + // Build nav tree for the protocol entity described by the given key + bool BuildTree( const std::vector & key ); + + // (Inline) Return protocol entity + const sDB2ProtocolEntity & GetEntity() const + { + return mEntity; + }; + + // (Inline) Return fragments + const std::list & GetFragments() const + { + return mFragments; + }; + + // Return a map of all tracked fields + std::map > GetTrackedFields() const + { + return mTrackedFields; + }; + + protected: + // Process a structure described by the given initial fragment + bool ProcessStruct( + const sDB2Fragment * pFrag, + sDB2NavFragment * pOwner ); + + /* Protocol entity being navigated */ + sDB2ProtocolEntity mEntity; + + /* Database reference */ + const cCoreDatabase & mDB; + + /* List of all allocated fragments */ + std::list mFragments; + + /* Map of all 'tracked' fields */ + std::map > mTrackedFields; +}; + + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2TextFile.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2TextFile.cpp new file mode 100755 index 0000000..aaebdf5 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2TextFile.cpp @@ -0,0 +1,253 @@ +/*=========================================================================== +FILE: + DB2TextFile.h + +DESCRIPTION: + Implementation of cDB2TextFile class + +PUBLIC CLASSES AND METHODS: + cDB2TextFile + The cDB2TextFile class provides the simple ability to read in an + ANSI/UNICODE file and copy it to a dynamically allocated buffer + + The sole difference between this and CStdioFile is that the issues + stemming from supporting both ANSI and UNICODE files are handled + in a simpler fashion at the expense of a bit of performance + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//----------------------------------------------------------------------------- +// Include Files +//----------------------------------------------------------------------------- +#include "StdAfx.h" +#include "DB2TextFile.h" + +//----------------------------------------------------------------------------- +// Definitions +//----------------------------------------------------------------------------- + +// Maximum size of a file this interface will try to open (8 MB) +const DWORD MAX_FILE_SZ = 1024 * 1024 * 8; + +// Maximum number of characters to run UNICODE check over +const INT MAX_UNICODE_CHECK_LEN = 128; + +/*=========================================================================*/ +// cDB2TextFile Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cDB2TextFile (Public Method) + +DESCRIPTION: + Construct object/load file into memory + +PARAMETERS + pFileName [ I ] - File name + +RETURN VALUE: + None +===========================================================================*/ +cDB2TextFile::cDB2TextFile( LPCSTR pFileName ) + : mText( "" ), + mStatus( ERROR_FILE_NOT_FOUND ), + mCurrentPos( 0 ) +{ + if (pFileName == 0 || pFileName[0] == 0) + { + return; + } + + // Open the file + std::ifstream tempFStream; + tempFStream.open( pFileName, std::ios::in | std::ios::binary ); + if (tempFStream.fail() == true) + { + mStatus = ERROR_FILE_NOT_FOUND; + return; + } + + // Get size + LONG nFileSize = tempFStream.rdbuf()->in_avail(); + if (nFileSize == -1 || nFileSize > MAX_FILE_SZ) + { + tempFStream.close(); + mStatus = ERROR_GEN_FAILURE; + return; + } + + // Read file into pTempBuffer + CHAR * pTempBuffer = new char[ nFileSize ]; + if (pTempBuffer == NULL) + { + tempFStream.close(); + mStatus = ERROR_GEN_FAILURE; + return; + } + + tempFStream.read( pTempBuffer, nFileSize ); + if (tempFStream.fail() == true) + { + tempFStream.close(); + delete [] pTempBuffer; + mStatus = ERROR_GEN_FAILURE; + return; + } + + tempFStream.close(); + + // Convert to string + mText = std::string( pTempBuffer, nFileSize ); + + delete [] pTempBuffer; + + // Final check + if (mText.size() != nFileSize) + { + mStatus = ERROR_GEN_FAILURE; + return; + } + + // Success! + mStatus = NO_ERROR; +} + +/*=========================================================================== +METHOD: + cDB2TextFile (Public Method) + +DESCRIPTION: + Construct object/copy from buffer into memory + +PARAMETERS + pBuffer [ I ] - Buffer to copy from + bufferLen [ I ] - Size of above buffer + +RETURN VALUE: + None +===========================================================================*/ +cDB2TextFile::cDB2TextFile( + LPCSTR pBuffer, + ULONG bufferLen ) + : mText( "" ), + mStatus( ERROR_FILE_NOT_FOUND ), + mCurrentPos( 0 ) +{ + // Convert to string + mText = std::string( pBuffer, bufferLen ); + + // Final check + if (mText.size() != bufferLen) + { + mStatus = ERROR_GEN_FAILURE; + return; + } + + // Success! + mStatus = NO_ERROR; +} + +/*=========================================================================== +METHOD: + ~cDB2TextFile (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cDB2TextFile::~cDB2TextFile() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ReadLine (Public Method) + +DESCRIPTION: + Read the next available line + +PARAMETERS + line [ O ] - Line (minus CR/LF) + +RETURN VALUE: + None +===========================================================================*/ +bool cDB2TextFile::ReadLine( std::string & line ) +{ + if (IsValid() == false) + { + return false; + } + + int len = mText.size(); + if (mCurrentPos >= len) + { + return false; + } + + int newIdx = mText.find( '\n', mCurrentPos ); + if (newIdx == -1) + { + // Possibly the end of the file + newIdx = len; + } + + if (newIdx < mCurrentPos) + { + return false; + } + + if (newIdx == mCurrentPos) + { + // Return an empty line + mCurrentPos++; + line = ""; + } + else + { + // Grab line + line = mText.substr( mCurrentPos, (newIdx - mCurrentPos) ); + + // Check for CR + int nCR = line.find( '\r' ); + if (nCR != -1) + { + line.erase( nCR, 1 ); + } + + mCurrentPos = newIdx + 1; + } + + return true; +} + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2TextFile.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2TextFile.h new file mode 100755 index 0000000..8ecb1cb --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2TextFile.h @@ -0,0 +1,110 @@ +/*=========================================================================== +FILE: + DB2TextFile.h + +DESCRIPTION: + Declaration of cDB2TextFile class + +PUBLIC CLASSES AND METHODS: + cDB2TextFile + The cDB2TextFile class provides the simple ability to read in an + ANSI/UNICODE file and copy it to a dynamically allocated buffer + + The sole difference between this and CStdioFile is that the issues + stemming from supporting both ANSI and UNICODE files are handled + in a simpler fashion at the expense of a bit of performance + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ +#include "StdAfx.h" + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// Class cDB2TextFile +/*=========================================================================*/ +class cDB2TextFile +{ + public: + // Constructor (loads file) + cDB2TextFile( LPCSTR pMemFile ); + + // Constructor (loads file from resource table) + cDB2TextFile( + HMODULE hModule, + LPCSTR pRscTable, + DWORD rscID ); + + // Constructor (loads file from buffer) + cDB2TextFile( + LPCSTR pBuffer, + ULONG bufferLen ); + + // Destructor + ~cDB2TextFile(); + + // (Inline) Get error status + DWORD GetStatus() + { + return mStatus; + }; + + // (Inline) Get the file contents + bool GetText( std::string & copy ) + { + bool bOK = IsValid(); + if (bOK == true) + { + copy = mText; + } + + return bOK; + }; + + // (Inline) Get file validity + virtual bool IsValid() + { + return (mStatus == NO_ERROR); + }; + + // Read the next available line + bool ReadLine( std::string & line ); + + protected: + /* File contents */ + std::string mText; + + /* Current position (in above contents) */ + int mCurrentPos; + + /* Error status */ + DWORD mStatus; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2Utilities.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2Utilities.cpp new file mode 100755 index 0000000..9ab46b7 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2Utilities.cpp @@ -0,0 +1,899 @@ +/*=========================================================================== +FILE: + DB2Utilities.cpp + +DESCRIPTION: + Utility functions for packing/parsing protocol entities using the + database + +PUBLIC ENUMERATIONS AND METHODS: + sProtocolEntityKey + sDB2PackingInput + sDB2NavInput + + MapQMIEntityTypeToProtocolType + MapQMIEntityTypeToQMIServiceType + MapQMIProtocolTypeToEntityType + DB2GetMaxBufferSize + DB2BuildQMIBuffer + DB2PackQMIBuffer + DB2ReduceQMIBuffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "DB2Utilities.h" + +#include "QMIBuffers.h" + +#include "DataPacker.h" +#include "ProtocolEntityFieldEnumerator.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +// Free Methods +//--------------------------------------------------------------------------- + +/*=========================================================================== +METHOD: + MapQMIEntityTypeToQMIServiceType (Public Free Method) + +DESCRIPTION: + Map a DB protocol entity type (for QMI) to a QMI service type + +PARAMETERS: + et [ I ] - Protocol entity type + +RETURN VALUE: + eQMIService +===========================================================================*/ +eQMIService MapQMIEntityTypeToQMIServiceType( eDB2EntityType et ) +{ + eQMIService st = eQMI_SVC_ENUM_BEGIN; + switch (et) + { + case eDB2_ET_QMI_CTL_REQ: + case eDB2_ET_QMI_CTL_RSP: + case eDB2_ET_QMI_CTL_IND: + st = eQMI_SVC_CONTROL; + break; + + case eDB2_ET_QMI_WDS_REQ: + case eDB2_ET_QMI_WDS_RSP: + case eDB2_ET_QMI_WDS_IND: + st = eQMI_SVC_WDS; + break; + + case eDB2_ET_QMI_DMS_REQ: + case eDB2_ET_QMI_DMS_RSP: + case eDB2_ET_QMI_DMS_IND: + st = eQMI_SVC_DMS; + break; + + case eDB2_ET_QMI_NAS_REQ: + case eDB2_ET_QMI_NAS_RSP: + case eDB2_ET_QMI_NAS_IND: + st = eQMI_SVC_NAS; + break; + + case eDB2_ET_QMI_QOS_REQ: + case eDB2_ET_QMI_QOS_RSP: + case eDB2_ET_QMI_QOS_IND: + st = eQMI_SVC_QOS; + break; + + case eDB2_ET_QMI_WMS_REQ: + case eDB2_ET_QMI_WMS_RSP: + case eDB2_ET_QMI_WMS_IND: + st = eQMI_SVC_WMS; + break; + + case eDB2_ET_QMI_PDS_REQ: + case eDB2_ET_QMI_PDS_RSP: + case eDB2_ET_QMI_PDS_IND: + st = eQMI_SVC_PDS; + break; + + case eDB2_ET_QMI_AUTH_REQ: + case eDB2_ET_QMI_AUTH_RSP: + case eDB2_ET_QMI_AUTH_IND: + st = eQMI_SVC_AUTH; + break; + + case eDB2_ET_QMI_VOICE_REQ: + case eDB2_ET_QMI_VOICE_RSP: + case eDB2_ET_QMI_VOICE_IND: + st = eQMI_SVC_VOICE; + break; + + case eDB2_ET_QMI_CAT_REQ: + case eDB2_ET_QMI_CAT_RSP: + case eDB2_ET_QMI_CAT_IND: + st = eQMI_SVC_CAT; + break; + + case eDB2_ET_QMI_RMS_REQ: + case eDB2_ET_QMI_RMS_RSP: + case eDB2_ET_QMI_RMS_IND: + st = eQMI_SVC_RMS; + break; + + case eDB2_ET_QMI_OMA_REQ: + case eDB2_ET_QMI_OMA_RSP: + case eDB2_ET_QMI_OMA_IND: + st = eQMI_SVC_OMA; + break; + } + + return st; +} + +/*=========================================================================== +METHOD: + MapQMIEntityTypeToProtocolType (Public Free Method) + +DESCRIPTION: + Map a DB protocol entity type (for QMI) to a buffer protocol type + +PARAMETERS: + et [ I ] - Protocol entity type + +RETURN VALUE: + eProtocolType +===========================================================================*/ +eProtocolType MapQMIEntityTypeToProtocolType( eDB2EntityType et ) +{ + eProtocolType pt = ePROTOCOL_ENUM_BEGIN; + switch (et) + { + case eDB2_ET_QMI_WDS_REQ: + pt = ePROTOCOL_QMI_WDS_TX; + break; + + case eDB2_ET_QMI_WDS_RSP: + case eDB2_ET_QMI_WDS_IND: + pt = ePROTOCOL_QMI_WDS_RX; + break; + + case eDB2_ET_QMI_DMS_REQ: + pt = ePROTOCOL_QMI_DMS_TX; + break; + + case eDB2_ET_QMI_DMS_RSP: + case eDB2_ET_QMI_DMS_IND: + pt = ePROTOCOL_QMI_DMS_RX; + break; + + case eDB2_ET_QMI_NAS_REQ: + pt = ePROTOCOL_QMI_NAS_TX; + break; + + case eDB2_ET_QMI_NAS_RSP: + case eDB2_ET_QMI_NAS_IND: + pt = ePROTOCOL_QMI_NAS_RX; + break; + + case eDB2_ET_QMI_QOS_REQ: + pt = ePROTOCOL_QMI_QOS_TX; + break; + + case eDB2_ET_QMI_QOS_RSP: + case eDB2_ET_QMI_QOS_IND: + pt = ePROTOCOL_QMI_QOS_RX; + break; + + case eDB2_ET_QMI_WMS_REQ: + pt = ePROTOCOL_QMI_WMS_TX; + break; + + case eDB2_ET_QMI_WMS_RSP: + case eDB2_ET_QMI_WMS_IND: + pt = ePROTOCOL_QMI_WMS_RX; + break; + + case eDB2_ET_QMI_PDS_REQ: + pt = ePROTOCOL_QMI_PDS_TX; + break; + + case eDB2_ET_QMI_PDS_RSP: + case eDB2_ET_QMI_PDS_IND: + pt = ePROTOCOL_QMI_PDS_RX; + break; + + case eDB2_ET_QMI_AUTH_REQ: + pt = ePROTOCOL_QMI_AUTH_TX; + break; + + case eDB2_ET_QMI_AUTH_RSP: + case eDB2_ET_QMI_AUTH_IND: + pt = ePROTOCOL_QMI_AUTH_RX; + break; + + case eDB2_ET_QMI_VOICE_REQ: + pt = ePROTOCOL_QMI_VOICE_TX; + break; + + case eDB2_ET_QMI_VOICE_RSP: + case eDB2_ET_QMI_VOICE_IND: + pt = ePROTOCOL_QMI_VOICE_RX; + break; + + case eDB2_ET_QMI_CAT_REQ: + pt = ePROTOCOL_QMI_CAT_TX; + break; + + case eDB2_ET_QMI_CAT_RSP: + case eDB2_ET_QMI_CAT_IND: + pt = ePROTOCOL_QMI_CAT_RX; + break; + + case eDB2_ET_QMI_RMS_REQ: + pt = ePROTOCOL_QMI_RMS_TX; + break; + + case eDB2_ET_QMI_RMS_RSP: + case eDB2_ET_QMI_RMS_IND: + pt = ePROTOCOL_QMI_RMS_RX; + break; + + case eDB2_ET_QMI_OMA_REQ: + pt = ePROTOCOL_QMI_OMA_TX; + break; + + case eDB2_ET_QMI_OMA_RSP: + case eDB2_ET_QMI_OMA_IND: + pt = ePROTOCOL_QMI_OMA_RX; + break; + + case eDB2_ET_QMI_CTL_REQ: + pt = ePROTOCOL_QMI_CTL_TX; + break; + + case eDB2_ET_QMI_CTL_RSP: + case eDB2_ET_QMI_CTL_IND: + pt = ePROTOCOL_QMI_CTL_RX; + break; + } + + return pt; +} + +/*=========================================================================== +METHOD: + MapQMIProtocolTypeToEntityType (Public Free Method) + +DESCRIPTION: + Map a buffer protocol type to a DB protocol entity type + +PARAMETERS: + pt [ I ] - Protocol type + bIndication [ I ] - Is this for an indication? + +RETURN VALUE: + eDB2EntityType +===========================================================================*/ +eDB2EntityType MapQMIProtocolTypeToEntityType( + eProtocolType pt, + bool bIndication ) +{ + eDB2EntityType et = eDB2_ET_ENUM_BEGIN; + switch (pt) + { + case ePROTOCOL_QMI_WDS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_WDS_IND; + } + else + { + et = eDB2_ET_QMI_WDS_RSP; + } + break; + + case ePROTOCOL_QMI_WDS_TX: + et = eDB2_ET_QMI_WDS_REQ; + break; + + case ePROTOCOL_QMI_DMS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_DMS_IND; + } + else + { + et = eDB2_ET_QMI_DMS_RSP; + } + break; + + case ePROTOCOL_QMI_DMS_TX: + et = eDB2_ET_QMI_DMS_REQ; + break; + + case ePROTOCOL_QMI_NAS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_NAS_IND; + } + else + { + et = eDB2_ET_QMI_NAS_RSP; + } + break; + + case ePROTOCOL_QMI_NAS_TX: + et = eDB2_ET_QMI_NAS_REQ; + break; + + case ePROTOCOL_QMI_QOS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_QOS_IND; + } + else + { + et = eDB2_ET_QMI_QOS_RSP; + } + break; + + case ePROTOCOL_QMI_QOS_TX: + et = eDB2_ET_QMI_QOS_REQ; + break; + + case ePROTOCOL_QMI_WMS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_WMS_IND; + } + else + { + et = eDB2_ET_QMI_WMS_RSP; + } + break; + + case ePROTOCOL_QMI_WMS_TX: + et = eDB2_ET_QMI_WMS_REQ; + break; + + case ePROTOCOL_QMI_PDS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_PDS_IND; + } + else + { + et = eDB2_ET_QMI_PDS_RSP; + } + break; + + case ePROTOCOL_QMI_PDS_TX: + et = eDB2_ET_QMI_PDS_REQ; + break; + + case ePROTOCOL_QMI_AUTH_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_AUTH_IND; + } + else + { + et = eDB2_ET_QMI_AUTH_RSP; + } + break; + + case ePROTOCOL_QMI_AUTH_TX: + et = eDB2_ET_QMI_AUTH_REQ; + break; + + case ePROTOCOL_QMI_VOICE_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_VOICE_IND; + } + else + { + et = eDB2_ET_QMI_VOICE_RSP; + } + break; + + case ePROTOCOL_QMI_VOICE_TX: + et = eDB2_ET_QMI_VOICE_REQ; + break; + + case ePROTOCOL_QMI_CAT_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_CAT_IND; + } + else + { + et = eDB2_ET_QMI_CAT_RSP; + } + break; + + case ePROTOCOL_QMI_CAT_TX: + et = eDB2_ET_QMI_CAT_REQ; + break; + + case ePROTOCOL_QMI_RMS_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_RMS_IND; + } + else + { + et = eDB2_ET_QMI_RMS_RSP; + } + break; + + case ePROTOCOL_QMI_RMS_TX: + et = eDB2_ET_QMI_RMS_REQ; + break; + + case ePROTOCOL_QMI_OMA_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_OMA_IND; + } + else + { + et = eDB2_ET_QMI_OMA_RSP; + } + break; + + case ePROTOCOL_QMI_OMA_TX: + et = eDB2_ET_QMI_OMA_REQ; + break; + + case ePROTOCOL_QMI_CTL_RX: + if (bIndication == true) + { + et = eDB2_ET_QMI_CTL_IND; + } + else + { + et = eDB2_ET_QMI_CTL_RSP; + } + break; + + case ePROTOCOL_QMI_CTL_TX: + et = eDB2_ET_QMI_CTL_REQ; + break; + } + + return et; +} + +/*=========================================================================== +METHOD: + DB2GetMaxBufferSize (Public Free Method) + +DESCRIPTION: + Return the maximum size of a payload buffer for given type of + protocol entity + +PARAMETERS: + et [ I ] - Protocol entity type + +RETURN VALUE: + ULONG - Maximum +===========================================================================*/ +ULONG DB2GetMaxBufferSize( eDB2EntityType et ) +{ + ULONG maxSzInBytes = MAX_SHARED_BUFFER_SIZE; + + if (IsQMIEntityType( et ) == true) + { + // QMI items are further constrained in size + maxSzInBytes = QMI_MAX_BUFFER_SIZE; + } + + return maxSzInBytes; +} + +/*=========================================================================== +METHOD: + DB2BuildQMIBuffer (Internal Method) + +DESCRIPTION: + Build and return an allocated shared buffer for the QMI protocol using + the specified DB keys and payloads (one per TLV content) + +PARAMETERS: + input [ I ] - Protocol entity key and payload + +RETURN VALUE: + sSharedBuffer * (0 upon failure) +===========================================================================*/ +sSharedBuffer * DB2BuildQMIBuffer( + const std::vector & input ) +{ + // Assume failure + sSharedBuffer * pRef = 0; + + const ULONG szTransHdr = (ULONG)sizeof(sQMIServiceRawTransactionHeader); + const ULONG szMsgHdr = (ULONG)sizeof(sQMIRawMessageHeader); + const ULONG szTLVHdr = (ULONG)sizeof(sQMIRawContentHeader); + + // Need something to build + ULONG tlvs = (ULONG)input.size(); + if (tlvs == 0) + { + return pRef; + } + + // The protocol entity keys need to be consistent + const sDB2NavInput & tlvInput = input[0]; + if (tlvInput.IsValid() == false || tlvInput.mKey.size() < 3) + { + return pRef; + } + + eDB2EntityType et = (eDB2EntityType)tlvInput.mKey[0]; + if (IsQMIEntityType( et ) == false) + { + return pRef; + } + + ULONG szReq = szTransHdr + szMsgHdr + (tlvs * szTLVHdr); + szReq += tlvInput.mPayloadLen; + + ULONG t = 0; + for (t = 1; t < tlvs; t++) + { + const sDB2NavInput & tlv2Input = input[t]; + if (tlv2Input.IsValid() == false || tlv2Input.mKey.size() < 3) + { + return pRef; + } + + if ( (tlvInput.mKey[0] != tlv2Input.mKey[0]) + || (tlvInput.mKey[1] != tlv2Input.mKey[1]) ) + { + return pRef; + } + + szReq += tlv2Input.mPayloadLen; + } + + // What we are building cannot be too large + if (szReq > QMI_MAX_BUFFER_SIZE) + { + return pRef; + } + + BYTE buf[QMI_MAX_BUFFER_SIZE]; + + sQMIRawContentHeader * pTLV = 0; + pTLV = (sQMIRawContentHeader *)&buf[0]; + + for (t = 0; t < tlvs; t++) + { + const sDB2NavInput & tlv2Input = input[t]; + + pTLV->mTypeID = (BYTE)tlv2Input.mKey[2]; + pTLV->mLength = (WORD)tlv2Input.mPayloadLen; + pTLV++; + + const BYTE * pPayload = (const BYTE *)pTLV; + memcpy( (LPVOID)pPayload, + (LPCVOID)tlv2Input.mpPayload, + (SIZE_T)tlv2Input.mPayloadLen ); + + pPayload += tlv2Input.mPayloadLen; + pTLV = (sQMIRawContentHeader *)pPayload; + } + + ULONG contentLen = szReq - szTransHdr - szMsgHdr; + eQMIService st = MapQMIEntityTypeToQMIServiceType( et ); + + pRef = sQMIServiceBuffer::BuildBuffer( st, + (WORD)tlvInput.mKey[1], + IsQMIEntityResponseType( et ), + IsQMIEntityIndicationType( et ), + &buf[0], + contentLen ); + + return pRef; +} + +/*=========================================================================== +METHOD: + DB2PackQMIBuffer (Internal Method) + +DESCRIPTION: + Build an allocated shared buffer for the QMI protocol + +PARAMETERS: + db [ I ] - Database to use for packing + input [ I ] - Protocol entity key and field values + +RETURN VALUE: + sSharedBuffer * (0 upon failure) +===========================================================================*/ +sSharedBuffer * DB2PackQMIBuffer( + const cCoreDatabase & db, + const std::vector & input ) +{ + // Assume failure + sSharedBuffer * pRef = 0; + + // Need something to build + ULONG tlvs = (ULONG)input.size(); + if (tlvs == 0) + { + return pRef; + } + + // The protocol entity keys need to be consistent + const sDB2PackingInput & tlvInput = input[0]; + if (tlvInput.IsValid() == false || tlvInput.mKey.size() < 3) + { + return pRef; + } + + eDB2EntityType et = (eDB2EntityType)tlvInput.mKey[0]; + if (IsQMIEntityType( et ) == false) + { + return pRef; + } + + ULONG t = 0; + for (t = 1; t < tlvs; t++) + { + const sDB2PackingInput & tlv2Input = input[t]; + if (tlv2Input.IsValid() == false || tlv2Input.mKey.size() < 3) + { + return pRef; + } + + if ( (tlvInput.mKey[0] != tlv2Input.mKey[0]) + || (tlvInput.mKey[1] != tlv2Input.mKey[1]) ) + { + return pRef; + } + } + + BYTE buf[QMI_MAX_BUFFER_SIZE]; + ULONG bufLen = 0; + + sQMIRawContentHeader * pTLV = 0; + pTLV = (sQMIRawContentHeader *)&buf[0]; + + bool bOK = true; + for (t = 0; t < tlvs; t++) + { + ULONG packedLen = 0; + const BYTE * pPackedData = 0; + + const sDB2PackingInput & tlv2Input = input[t]; + + if (tlv2Input.mbString == true) + { + if (tlv2Input.mValues.empty() == false) + { + // Convert field string to input fields + std::list fields + = cDataPacker::LoadValues( tlv2Input.mValues ); + + // Now pack + cDataPacker dp( db, tlv2Input.mKey, fields ); + bOK = dp.Pack(); + if (bOK == false) + { + break; + } + + pPackedData = dp.GetBuffer( packedLen ); + if (pPackedData == 0) + { + bOK = false; + break; + } + } + } + else + { + packedLen = tlv2Input.mDataLen; + pPackedData = tlv2Input.mpData; + } + + // Check if we need to adjust buffer + cProtocolEntityFieldEnumerator pefe( db, tlv2Input.mKey ); + bool bEnum = pefe.Enumerate(); + if (bEnum == true) + { + const std::vector & fieldIDs = pefe.GetFields(); + ULONG fieldCount = (ULONG)fieldIDs.size(); + if (fieldCount == 1) + { + const tDB2FieldMap & dbFields = db.GetProtocolFields(); + + tDB2FieldMap::const_iterator pField = dbFields.find( fieldIDs[0] ); + if (pField != dbFields.end()) + { + const sDB2Field & theField = pField->second; + if ( (theField.mType == eDB2_FIELD_STD) + && (theField.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_ANT) ) + { + // For QMI we need to strip out the trailing NULL + // string terminator when the TLV consists solely + // of a string since the length contained in the + // TLV structure itself renders the trailing NULL + // redundant + if (packedLen > 2) + { + packedLen--; + } + else + { + // This is the only way to specify an empty string in QMI + // when the TLV consists solely of a string + if (packedLen == 1) + { + packedLen--; + } + } + } + } + } + } + + if (bufLen + (ULONG)sizeof(sQMIRawContentHeader) < bufLen) + { + bOK = false; + break; + } + bufLen += (ULONG)sizeof(sQMIRawContentHeader); + if (bufLen + packedLen < bufLen) + { + bOK = false; + break; + } + bufLen += packedLen; + + // What we are building cannot be too large + if (bufLen > QMI_MAX_BUFFER_SIZE) + { + bOK = false; + break; + } + + pTLV->mTypeID = (BYTE)tlv2Input.mKey[2]; + pTLV->mLength = (WORD)packedLen; + pTLV++; + + const BYTE * pPayload = (const BYTE *)pTLV; + memcpy( (LPVOID)pPayload, + (LPCVOID)pPackedData, + (SIZE_T)packedLen ); + + pPayload += packedLen; + pTLV = (sQMIRawContentHeader *)pPayload; + } + + if (bOK == false) + { + return pRef; + } + + eQMIService st = MapQMIEntityTypeToQMIServiceType( et ); + pRef = sQMIServiceBuffer::BuildBuffer( st, + (WORD)tlvInput.mKey[1], + IsQMIEntityResponseType( et ), + IsQMIEntityIndicationType( et ), + &buf[0], + bufLen ); + + return pRef; +} + +/*=========================================================================== +METHOD: + DB2ReduceQMIBuffer (Public Free Method) + +DESCRIPTION: + Reduce a DIAG buffer to a DB key and payload + +PARAMETERS: + buf [ I ] - Protocol buffer being reduced + +RETURN VALUE: + sDB2NavInput (invalid upon failure) +===========================================================================*/ +std::vector DB2ReduceQMIBuffer( const sProtocolBuffer & buf ) +{ + std::vector retInput; + + // We must have a valid protocol buffer + if (buf.IsValid() == false) + { + return retInput; + } + + eProtocolType pt = (eProtocolType)buf.GetType(); + if (IsQMIProtocol( pt ) != true) + { + return retInput; + } + + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + std::map tlvs = qmiBuf.GetContents(); + + bool bErr = false; + std::map ::const_iterator pIter; + for (pIter = tlvs.begin(); pIter != tlvs.end(); pIter++) + { + const sQMIRawContentHeader * pHdr = pIter->second; + if (pHdr == 0) + { + bErr = true; + break; + } + + bool bIndication = qmiBuf.IsIndication(); + eProtocolType pt = (eProtocolType)qmiBuf.GetType(); + eDB2EntityType et = MapQMIProtocolTypeToEntityType( pt, bIndication ); + + sDB2NavInput tmp; + tmp.mKey.push_back( (ULONG)et ); + tmp.mKey.push_back( qmiBuf.GetMessageID() ); + tmp.mKey.push_back( (ULONG)pHdr->mTypeID ); + + tmp.mPayloadLen = pHdr->mLength; + pHdr++; + + tmp.mpPayload = (const BYTE *)pHdr; + if (tmp.IsValid() == true) + { + retInput.push_back( tmp ); + } + else + { + // Ignore empty TLVs + if (tmp.mPayloadLen != 0) + { + bErr = true; + break; + } + } + } + + if (bErr == true) + { + retInput.clear(); + } + + return retInput; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2Utilities.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2Utilities.h new file mode 100755 index 0000000..b3223e1 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/DB2Utilities.h @@ -0,0 +1,268 @@ +/*=========================================================================== +FILE: + DB2Utilities.h + +DESCRIPTION: + Utility functions for packing/parsing protocol entities using the + database + +PUBLIC ENUMERATIONS AND METHODS: + sProtocolEntityKey + sDB2PackingInput + sDB2NavInput + + MapQMIEntityTypeToProtocolType + MapQMIEntityTypeToQMIServiceType + MapQMIProtocolTypeToEntityType + DB2GetMaxBufferSize + DB2BuildQMIBuffer + DB2PackQMIBuffer + DB2ReduceQMIBuffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "CoreDatabase.h" +#include "SharedBuffer.h" +#include "ProtocolBuffer.h" +#include "QMIEnum.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Struct sProtocolEntityKey +// Simple structure to initializing protocol entity keys easier +/*=========================================================================*/ +struct sProtocolEntityKey +{ + public: + // (Inline) Constructor - default + sProtocolEntityKey() + { }; + + // (Inline) Constructor - single value keys + sProtocolEntityKey( ULONG val1 ) + { + mKey.push_back( val1 ); + }; + + // (Inline) Constructor - two value keys + sProtocolEntityKey( + ULONG val1, + ULONG val2 ) + { + mKey.push_back( val1 ); + mKey.push_back( val2 ); + }; + + // (Inline) Constructor - three value keys + sProtocolEntityKey( + ULONG val1, + ULONG val2, + ULONG val3 ) + { + mKey.push_back( val1 ); + mKey.push_back( val2 ); + mKey.push_back( val3 ); + }; + + // (Inline) Constructor - psuedo-copy constructor + sProtocolEntityKey( const std::vector & key ) + : mKey( key ) + { }; + + // (Inline) Constructor - copy constructor + sProtocolEntityKey( const sProtocolEntityKey & key ) + : mKey( key.mKey ) + { }; + + // (Inline) Assignment operator + sProtocolEntityKey & operator = ( const sProtocolEntityKey & key ) + { + mKey = key.mKey; + return *this; + }; + + // Cast operator to a protocol entity key + operator std::vector () const + { + return mKey; + }; + + /* Underlying key */ + std::vector mKey; +}; + +/*=========================================================================*/ +// Struct sDB2PackingInput +// Simple structure to make dealing packing easier +/*=========================================================================*/ +struct sDB2PackingInput +{ + public: + // (Inline) Constructor - default + sDB2PackingInput() + : mpData( 0 ), + mDataLen( 0 ), + mbString( true ) + { }; + + // (Inline) Constructor - parameterized (string payload) + sDB2PackingInput( + const sProtocolEntityKey & key, + LPCSTR pValue ) + : mKey( key ), + mpData( 0 ), + mDataLen( 0 ), + mbString( true ) + { + if (pValue != 0 && pValue[0] != 0) + { + mValues = pValue; + } + }; + + // (Inline) Constructor - parameterized (buffer payload) + sDB2PackingInput( + const sProtocolEntityKey & key, + const BYTE * pData, + ULONG dataLen ) + : mKey( key ), + mpData( pData ), + mDataLen( dataLen ), + mbString( false ) + { + // Nothing to do + }; + + // (Inline) Is this object in a valid state? + bool IsValid() const + { + // We need a key + if (mKey.size() <= 0) + { + return false; + } + + return true; + }; + + /* Underlying key */ + std::vector mKey; + + /* Are the values specified by a string? */ + bool mbString; + + /* String of space delimited field values */ + std::string mValues; + + /* Buffer containing pre-formatted fields */ + const BYTE * mpData; + + /* Length of above buffer */ + ULONG mDataLen; +}; + +/*=========================================================================*/ +// Struct sDB2NavInput +// Simple structure to make dealing with key/payload easier +/*=========================================================================*/ +struct sDB2NavInput +{ + public: + // (Inline) Constructor - default + sDB2NavInput() + : mpPayload( 0 ), + mPayloadLen( 0 ) + { }; + + // (Inline) Constructor - parameterized + sDB2NavInput( + const std::vector & key, + const BYTE * pData, + ULONG dataLen ) + : mKey( key ), + mpPayload( pData ), + mPayloadLen( dataLen ) + { }; + + // (Inline) Is this object in a valid state? + bool IsValid() const + { + return (mKey.size() > 0 && mpPayload != 0 && mPayloadLen > 0); + }; + + /* Database key for payload entity */ + std::vector mKey; + + /* Payload */ + const BYTE * mpPayload; + + /* Size of above payload */ + ULONG mPayloadLen; +}; + +// Map a DB protocol entity type to a buffer protocol type +eProtocolType MapQMIEntityTypeToProtocolType( eDB2EntityType et ); + +// Map a DB protocol entity type to a QMI service type +eQMIService MapQMIEntityTypeToQMIServiceType( eDB2EntityType et ); + +// Map a buffer protocol type to a DB protocol entity type +eDB2EntityType MapQMIProtocolTypeToEntityType( + eProtocolType pt, + bool bIndication = false ); + +// Return the maximum size of a payload buffer for given type of +// protocol entity +ULONG DB2GetMaxBufferSize( eDB2EntityType et ); + +// Build an allocated shared buffer for the QMI protocol +sSharedBuffer * DB2BuildQMIBuffer( + const std::vector & input ); + +// Build an allocated shared buffer for the QMI protocol +sSharedBuffer * DB2PackQMIBuffer( + const cCoreDatabase & db, + const std::vector & input ); + +// Reduce a QMI buffer to DB keys and payload +std::vector DB2ReduceQMIBuffer( const sProtocolBuffer & buf ); + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/DataPacker.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/DataPacker.cpp new file mode 100755 index 0000000..16107b3 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/DataPacker.cpp @@ -0,0 +1,831 @@ +/*=========================================================================== +FILE: + DataPacker.cpp + +DESCRIPTION: + Implementation of sUnpackedField and cDataPacker + +PUBLIC CLASSES AND METHODS: + sUnpackedField + Structure to represent a single unpacked (input) field - i.e. the + field value as a string and an optional field name (either fully + qualified) or partial + + cDataPacker + Class to pack bit/byte specified fields into a buffer accordinging + to a database description, uses cProtocolEntityNav to navigate the DB + definition + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "DataPacker.h" + +#include "CoreDatabase.h" +#include "DB2Utilities.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cDataPacker Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cDataPacker (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + db [ I ] - Database to use + key [ I ] - Key into protocol entity table + fields [ I ] - Fields to pack into buffer + +RETURN VALUE: + None +===========================================================================*/ +cDataPacker::cDataPacker( + const cCoreDatabase & db, + const std::vector & key, + const std::list & fields ) + : cProtocolEntityNav( db ), + mKey( key ), + mbValuesOnly( true ), + mProcessedFields( 0 ), + mbPacked( false ) +{ + // Initialize internal buffer + memset( &mBuffer[0], 0, (SIZE_T)MAX_SHARED_BUFFER_SIZE ); + + // Compute bits left in buffer + ULONG bits = MAX_SHARED_BUFFER_SIZE * BITS_PER_BYTE; + if (mKey.size() > 0) + { + eDB2EntityType et = (eDB2EntityType)mKey[0]; + bits = DB2GetMaxBufferSize( et ) * BITS_PER_BYTE; + } + + // Setup the bit packer + mBitsy.SetData( mBuffer, bits ); + + // Copy fields/set value only flag + std::list ::const_iterator pIter = fields.begin(); + while (pIter != fields.end()) + { + if (pIter->mName.size() > 0) + { + mbValuesOnly = false; + } + + mFields.push_back( *pIter ); + pIter++; + } +} + +/*=========================================================================== +METHOD: + ~cDataPacker (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cDataPacker::~cDataPacker() +{ + // Ask bit packer to release data + mBitsy.ReleaseData(); +} + +/*=========================================================================== +METHOD: + Pack (Public Method) + +DESCRIPTION: + Pack the buffer + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataPacker::Pack() +{ + // Process (pack) the protocol entity + if (mbPacked == false) + { + mbPacked = ProcessEntity( mKey ); + if (mbPacked == false) + { + // Failed due to no structure ID? + if (mEntity.IsValid() == true && mEntity.mStructID == -1) + { + // Yes, for us that means instant success (no payload to pack) + mbPacked = true; + } + } + } + + return mbPacked; +} + +/*=========================================================================== +METHOD: + GetBuffer (Public Method) + +DESCRIPTION: + Get packed buffer contents + +PARAMETERS: + bufferLen [ O ] - Length of packed buffer (in bytes) + +RETURN VALUE: + const BYTE * - Packed buffer (0 upon error) +===========================================================================*/ +const BYTE * cDataPacker::GetBuffer( ULONG & bufferLen ) +{ + if (mbPacked == false) + { + bufferLen = 0; + return 0; + } + + // Payload size in bytes + bufferLen = mBitsy.GetTotalBitsWritten() + BITS_PER_BYTE - 1; + bufferLen /= BITS_PER_BYTE; + + // Payload is our buffer + const BYTE * pBuffer = 0; + if (bufferLen > 0) + { + pBuffer = (const BYTE *)&mBuffer[0]; + } + + return pBuffer; +} + +/*=========================================================================== +METHOD: + LoadValues (Static Public Method) + +DESCRIPTION: + Load values by parsing a 'summary' string of values, an example of + which would be: + + 0 1 100 "Foo Foo Foo" 15 -1 + +PARAMETERS: + vals [ I ] - Value string + +RETURN VALUE: + std::list +===========================================================================*/ +std::list cDataPacker::LoadValues( const std::string & vals ) +{ + std::list retList; + if (vals.size() <= 0) + { + return retList; + } + + std::vector tokens; + ParseCommandLine( vals, tokens ); + + std::string name = ""; + std::string val = ""; + + std::vector ::const_iterator pIter = tokens.begin(); + while (pIter != tokens.end()) + { + val = *pIter++; + + sUnpackedField entry( name, val ); + retList.push_back( entry ); + } + + return retList; +} + +/*=========================================================================== +METHOD: + LoadValues (Static Public Method) + +DESCRIPTION: + Load values by parsing a vector of string values, an example of + which would be: + + [0] 0 + [1] 1 + [2] 100 + [3] "Foo Foo Foo" + [4] 15 + [5] -1 + +PARAMETERS: + vals [ I ] - Vector of values + startIndex [ I ] - Where in above vector values start + +RETURN VALUE: + std::list +===========================================================================*/ +std::list cDataPacker::LoadValues( + std::vector & vals, + ULONG startIndex ) +{ + std::list retList; + + ULONG sz = (ULONG)vals.size(); + if (startIndex >= sz) + { + return retList; + } + + std::string name = ""; + std::string val = ""; + + for (ULONG v = startIndex; v < sz; v++) + { + val = vals[v]; + + sUnpackedField entry( name, val ); + retList.push_back( entry ); + } + + return retList; +} + +/*=========================================================================== +METHOD: + GetLastValue (Internal Method) + +DESCRIPTION: + Working from the back of the current value list find and return the + value for the specified field ID as a LONGLONG (field type must have + been able to fit in a LONGLONG for a value to be stored in value list + and thus returned) + +PARAMETERS: + fieldID [ I ] - Field ID we are looking for + val [ O ] - The value + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataPacker::GetLastValue( + ULONG fieldID, + LONGLONG & val ) +{ + // Assume failure + bool bRC = false; + + std::list < std::pair >::reverse_iterator pValues; + pValues = mValues.rbegin(); + while (pValues != mValues.rend()) + { + std::pair & entry = *pValues; + if (entry.first == fieldID) + { + val = entry.second; + + // Success! + bRC = true; + break; + } + + pValues++; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetValueString (Internal Method) + +DESCRIPTION: + For the given field return the (input) value string + +PARAMETERS: + field [ I ] - The field being processed + fieldName [ I ] - Partial (or fully qualified) field name + pValueString [ O ] - Value string + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataPacker::GetValueString( + const sDB2Field & field, + const std::string & fieldName, + LPCSTR & pValueString ) +{ + // Assume failure + pValueString = 0; + + // Create fully qualified field name + std::string fullName = GetFullFieldName( fieldName ); + + std::vector ::const_iterator pVals = mFields.begin(); + while (pVals != mFields.end()) + { + const std::string & inName = pVals->mName; + if (fieldName == inName || fullName == inName) + { + pValueString = (LPCSTR)pVals->mValueString.c_str(); + break; + } + + pVals++; + } + + // Value provided? + if (pValueString == 0) + { + // No, are we in value only mode? + if (mbValuesOnly == true) + { + if (mProcessedFields < (ULONG)mFields.size()) + { + sUnpackedField & upf = mFields[mProcessedFields++]; + + // Set field name (partial) + upf.mName = fieldName; + + // Grab field value + pValueString = (LPCSTR)upf.mValueString.c_str(); + } + } + else + { + return false; + } + } + + // Value provided? + if (pValueString == 0) + { + return false; + } + + // Meaningful value provided? + if (pValueString[0] == 0) + { + // No value provided for field? Is it a string? + if (field.mType == eDB2_FIELD_STD) + { + if ( (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_A) + && (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_U) + && (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_U8) + && (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_ANT) + && (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_UNT) + && (field.mTypeVal != eDB2_FIELD_STDTYPE_STRING_U8NT) ) + { + // No, unable to proceed + return false; + } + } + } + + return true; +} + +/*=========================================================================== +METHOD: + PackString (Internal Method) + +DESCRIPTION: + Pack the string (described by the given arguments) into the buffer + +PARAMETERS: + numChars [ I ] - Number of characters to pack (0 = NULL terminated) + pStr [ I ] - String to pack + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataPacker::PackString( + ULONG numChars, + LPCSTR pStr ) +{ + // Sanity check string pointer + if (pStr == 0) + { + return false; + } + + // Assume success + bool bOK = true; + + // Convert native string type to desired output type + const BYTE * pTmp = (const BYTE *)pStr; + + // Have we reached the practical end of a fixed length string? + ULONG numBytes = 0; + + numBytes = (ULONG)strlen( (LPCSTR)pTmp ); + if (numChars == 0) + { + // We pack the string plus the NULL character + numChars = (ULONG)strlen( (LPCSTR)pTmp ) + 1; + } + + // String size too long? + if (numBytes > numChars) + { + return false; + } + + // Pack the string one byte at a time + for (ULONG c = 0; c < numChars; c++) + { + BYTE val = 0; + if (c < numBytes) + { + val = pTmp[c]; + } + + DWORD rc = mBitsy.Set( BITS_PER_BYTE, val ); + if (rc != NO_ERROR) + { + bOK = false; + break; + } + } + + return bOK; +} + +/*=========================================================================== +METHOD: + ProcessField (Internal Method) + +DESCRIPTION: + Process the given field (described by the given arguments) by packing + the value into the buffer + +PARAMETERS: + pField [ I ] - The field being processed + fieldName [ I ] - Field name (partial) + arrayIndex [ I ] - Not used + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataPacker::ProcessField( + const sDB2Field * pField, + const std::string & fieldName, + LONGLONG /* arrayIndex */ ) +{ + // Assume failure + bool bOK = false; + if (pField == 0) + { + return bOK; + } + + // Find given value for field + LPCSTR pVal = 0; + bool bVal = GetValueString( *pField, fieldName, pVal ); + if (bVal == false) + { + return bOK; + } + + // Grab field ID + ULONG id = pField->mID; + + // What type is this field? + switch (pField->mType) + { + case eDB2_FIELD_STD: + { + // Standard field, what kind? + eDB2StdFieldType ft = (eDB2StdFieldType)pField->mTypeVal; + switch (ft) + { + // Field is a boolean (0/1, false/true)/8-bit unsigned integer + case eDB2_FIELD_STDTYPE_BOOL: + case eDB2_FIELD_STDTYPE_UINT8: + { + // We pack as a UCHAR + UCHAR val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + if (ft == eDB2_FIELD_STDTYPE_BOOL && val > 1) + { + val = 1; + } + + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 8-bit signed integer + case eDB2_FIELD_STDTYPE_INT8: + { + // We pack as a CHAR + CHAR val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 16-bit signed integer + case eDB2_FIELD_STDTYPE_INT16: + { + // We pack as a SHORT + SHORT val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 16-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT16: + { + // We pack as a USHORT + USHORT val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 32-bit signed integer + case eDB2_FIELD_STDTYPE_INT32: + { + // We pack as a LONG + LONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 32-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT32: + { + // We pack as a ULONG + ULONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 64-bit signed integer + case eDB2_FIELD_STDTYPE_INT64: + { + // We pack as a LONGLONG + LONGLONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + // Field is 64-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT64: + { + // We pack as a ULONGLONG + ULONGLONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + if (val <= LLONG_MAX) + { + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + } + + bOK = true; + } + } + } + break; + + // ANSI/UNICODE strings + case eDB2_FIELD_STDTYPE_STRING_A: + case eDB2_FIELD_STDTYPE_STRING_U: + case eDB2_FIELD_STDTYPE_STRING_ANT: + case eDB2_FIELD_STDTYPE_STRING_UNT: + { + // Set the character size + ULONG charSz = sizeof(CHAR); + if ( (ft == eDB2_FIELD_STDTYPE_STRING_U) + || (ft == eDB2_FIELD_STDTYPE_STRING_UNT) ) + { + charSz = sizeof(USHORT); + } + + // Compute the number of characters? + ULONG numChars = 0; + if ( (ft == eDB2_FIELD_STDTYPE_STRING_A) + || (ft == eDB2_FIELD_STDTYPE_STRING_U) ) + { + numChars = (pField->mSize / BITS_PER_BYTE) / charSz; + } + + // Pack the string + bOK = PackString( numChars, pVal ); + } + break; + + // UTF-8 strings + case eDB2_FIELD_STDTYPE_STRING_U8: + case eDB2_FIELD_STDTYPE_STRING_U8NT: + { + // Unsupported in the Linux adaptation + bOK = false; + } + break; + + // Field is 32-bit floating point value + case eDB2_FIELD_STDTYPE_FLOAT32: + { + // We pack as a ULONG + FLOAT val = (float)atof( (LPCSTR)pVal ); + ULONG * pTmp = (ULONG *)&val; + + DWORD rc = mBitsy.Set( pField->mSize, *pTmp ); + if (rc == NO_ERROR) + { + // Success! + bOK = true; + } + } + break; + + // Field is 64-bit floating point value + case eDB2_FIELD_STDTYPE_FLOAT64: + { + // We pack as a ULONGLONG + double val = atof( (LPCSTR)pVal ); + ULONGLONG * pTmp = (ULONGLONG *)&val; + + DWORD rc = mBitsy.Set( pField->mSize, *pTmp ); + if (rc == NO_ERROR) + { + // Success! + bOK = true; + } + } + break; + + default: + { + bOK = false; + } + break; + } + } + break; + + case eDB2_FIELD_ENUM_UNSIGNED: + { + // We pack as a ULONG + ULONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + case eDB2_FIELD_ENUM_SIGNED: + { + // We pack as a LONG + LONG val = 0; + bool bVal = ::FromString( pVal, val ); + if (bVal == true) + { + DWORD rc = mBitsy.Set( pField->mSize, val ); + if (rc == NO_ERROR) + { + // Success! + std::pair entry( id, (LONGLONG)val ); + mValues.push_back( entry ); + bOK = true; + } + } + } + break; + + default: + { + bOK = false; + } + break; + } + + return bOK; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/DataPacker.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/DataPacker.h new file mode 100755 index 0000000..13af0d7 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/DataPacker.h @@ -0,0 +1,216 @@ +/*=========================================================================== +FILE: + DataPacker.h + +DESCRIPTION: + Declaration of sUnpackedField and cDataPacker + +PUBLIC CLASSES AND METHODS: + sUnpackedField + Structure to represent a single unpacked (input) field - i.e. the + field value as a string and an optional field name (either fully + qualified) or partial + + cDataPacker + Class to pack bit/byte specified fields into a buffer accordinging + to a database description, uses cProtocolEntityNav to navigate the DB + definition + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "CoreDatabase.h" +#include "CoreUtilities.h" +#include "BitPacker.h" +#include "SharedBuffer.h" +#include "ProtocolEntityNav.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Struct sUnpackedField +// +// Structure to represent an unpacked (input) field +/*=========================================================================*/ +struct sUnpackedField +{ + public: + // (Inline) Constructor - default + sUnpackedField() + : mName( "" ), + mValueString( "" ) + { }; + + // (Inline) Constructor - parameterized + sUnpackedField( + const std::string & name, + const std::string & valueStr ) + : mName( name ), + mValueString( valueStr ) + { }; + + /* Field value as a string */ + std::string mValueString; + + /* Name of field */ + std::string mName; +}; + +/*=========================================================================*/ +// Class cDataPacker +// Class to pack bit/byte specified fields into a buffer +/*=========================================================================*/ +class cDataPacker : public cProtocolEntityNav +{ + public: + // Constructor + cDataPacker( + const cCoreDatabase & db, + const std::vector & key, + const std::list & fields ); + + // Destructor + virtual ~cDataPacker(); + + // Pack the buffer + virtual bool Pack(); + + // Get packed buffer contents + const BYTE * GetBuffer( ULONG & bufferLen ); + + // Return the results of packing as an allocated shared buffer + sSharedBuffer * GetDiagBuffer( bool bNVRead ); + + // Load values by parsing a 'summary' string of values + static std::list LoadValues( const std::string & vals ); + + // Load values by parsing a vector of string values + static std::list LoadValues( + std::vector & vals, + ULONG startIndex ); + + protected: + // Working from the back of the current value list find + // and return the value for the specified field ID as a + // LONGLONG (field type must be able to fit) + virtual bool GetLastValue( + ULONG fieldID, + LONGLONG & val ); + + // For the given field return the (input) value string + virtual bool GetValueString( + const sDB2Field & field, + const std::string & fieldName, + LPCSTR & pValueString ); + + // Pack the string (described by the given arguments) into the buffer + virtual bool PackString( + ULONG numChars, + LPCSTR pStr ); + + // Process the given field + virtual bool ProcessField( + const sDB2Field * pField, + const std::string & fieldName, + LONGLONG arrayIndex = -1 ); + + // (Inline) Get current working offset + virtual ULONG GetOffset() + { + return mBitsy.GetNumBitsWritten(); + }; + + // (Inline) Set current working offset + virtual bool SetOffset( ULONG offset ) + { + mBitsy.SetOffset( offset ); + return true; + }; + + // (Inline) Get current navigation order + virtual bool GetLSBMode() + { + return mBitsy.GetLSBMode(); + }; + + // (Inline) Set current navigation order + virtual bool SetLSBMode( bool bLSB ) + { + // Assume success + bool bOK = true; + if (bLSB != GetLSBMode()) + { + if ((GetOffset() % BITS_PER_BYTE) != 0) + { + // We need to be on a byte boundary + bOK = false; + } + else + { + mBitsy.SetLSBMode( bLSB ); + } + } + + return bOK; + }; + + /* Entity key */ + std::vector mKey; + + /* The underlying bit packer */ + cBitPacker mBitsy; + + /* The vector of fields */ + std::vector mFields; + + /* Are we operating in value only mode, i.e. no field names given? */ + bool mbValuesOnly; + ULONG mProcessedFields; + + /* Raw field values associated with field ID */ + std::list < std::pair > mValues; + + /* Internal working buffer */ + BYTE mBuffer[MAX_SHARED_BUFFER_SIZE]; + + /* Did we successfully pack the buffer? */ + bool mbPacked; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/DataParser.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/DataParser.cpp new file mode 100755 index 0000000..e9e77db --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/DataParser.cpp @@ -0,0 +1,1118 @@ +/*=========================================================================== +FILE: + DataParser.cpp + +DESCRIPTION: + Implementation of sParsedField and cDataParser + +PUBLIC CLASSES AND METHODS: + sParsedField + Structure to represent a single parsed field (field ID, offset, + size, value, name, etc.) + + cDataParser + Class to parse a buffer into bit/byte specified fields accordinging + to a database description, uses cProtocolEntityNav to navigate the DB + definition + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "DataParser.h" + +#include "CoreDatabase.h" +#include "DB2Utilities.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sParsedField Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sParsedField (Public Method) + +DESCRIPTION: + Construct a parsed field by setting the values and extracting + the data according to the definition + +PARAMETERS: + db [ I ] - Database to use + field [ I ] - Field description (from database) + name [ I ] - Desired field name + bp [I/O] - Bit parser to use + bGenStrings [ I ] - Generate field value strings? + + NOTE: 'bGenStrings' does not apply to fields that are string types? + +RETURN VALUE: + None +===========================================================================*/ +sParsedField::sParsedField( + const cCoreDatabase & db, + const sDB2Field * pField, + const std::string & name, + cBitParser & bp, + bool bGenStrings ) + : mField(), + mOffset( bp.GetNumBitsParsed() ), + mValueString( "" ), + mName( name ), + mbValid( false ) +{ + // Clear value + memset( (PVOID)&mValue, 0, (SIZE_T)sizeof( mValue ) ); + + // Assume failure + bool bOK = false; + if (pField == 0) + { + return; + } + + mField = *pField; + + char tempValueString[128]; + memset( &tempValueString[0], 0, 128 ); + + // What type is this field? + switch (mField.mType) + { + case eDB2_FIELD_STD: + { + // Standard field, what kind? + eDB2StdFieldType ft = (eDB2StdFieldType)mField.mTypeVal; + switch (ft) + { + // Field is a boolean (0/1, false/true)/8-bit unsigned integer + case eDB2_FIELD_STDTYPE_BOOL: + case eDB2_FIELD_STDTYPE_UINT8: + { + // We store as a UCHAR + UCHAR val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Constrain boolean values? + if (ft == eDB2_FIELD_STDTYPE_BOOL && val > 1) + { + val = 1; + } + + // Success! + mValue.mU8 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%02X", (UINT)mValue.mU8 ); + } + else + { + snprintf( &tempValueString[0], 0, "%u", (UINT)mValue.mU8 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 8-bit signed integer + case eDB2_FIELD_STDTYPE_INT8: + { + // We store as a CHAR + CHAR val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mS8 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%02X", (UINT)mValue.mU8 ); + } + else + { + snprintf( &tempValueString[0], 0, "%d", (INT)mValue.mS8 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 16-bit signed integer + case eDB2_FIELD_STDTYPE_INT16: + { + // We store as a SHORT + SHORT val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mS16 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%04hX", mValue.mU16 ); + } + else + { + snprintf( &tempValueString[0], 0, "%hd", mValue.mS16 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 16-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT16: + { + // We store as a USHORT + USHORT val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mU16 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%04hX", mValue.mU16 ); + } + else + { + snprintf( &tempValueString[0], 0, "%hu", mValue.mU16 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 32-bit signed integer + case eDB2_FIELD_STDTYPE_INT32: + { + // We store as a LONG + LONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mS32 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%08lX", mValue.mU32 ); + } + else + { + snprintf( &tempValueString[0], 0, "%ld", mValue.mS32 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 32-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT32: + { + // We store as a ULONG + ULONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mU32 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%08lX", mValue.mU32 ); + } + else + { + snprintf( &tempValueString[0], 0, "%lu", mValue.mU32 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 64-bit signed integer + case eDB2_FIELD_STDTYPE_INT64: + { + // We store as a LONGLONG + LONGLONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mS64 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%016llX", mValue.mU64 ); + } + else + { + snprintf( &tempValueString[0], 0, "%lld", mValue.mS64 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 64-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT64: + { + // We store as a ULONGLONG + ULONGLONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mU64 = val; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%016llX", mValue.mU64 ); + } + else + { + snprintf( &tempValueString[0], 0, "%llu", mValue.mU64 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // ANSI/UNICODE fixed length string + case eDB2_FIELD_STDTYPE_STRING_A: + case eDB2_FIELD_STDTYPE_STRING_U: + { + // Compute the number of characters + ULONG numChars = mField.mSize / BITS_PER_BYTE; + + // Parse out the string + bOK = ParseString( numChars, bp ); + } + break; + + // ANSI NULL terminated string + case eDB2_FIELD_STDTYPE_STRING_ANT: + { + // Figure out the length of the string + ULONG numChars = 0; + + // Temporarily assume success + bOK = true; + + ULONG tmpOffset = bp.GetNumBitsParsed(); + + CHAR val = 1; + while (val != 0) + { + DWORD rc = bp.Get( BITS_PER_BYTE, val ); + if (rc == NO_ERROR) + { + numChars++; + } + else + { + val = 0; + } + } + + // Now actually parse/load the string + if (bOK == true) + { + bp.SetOffset( tmpOffset ); + bOK = ParseString( numChars, bp ); + } + } + break; + + // UNICODE NULL terminated string + case eDB2_FIELD_STDTYPE_STRING_UNT: + { + // Figure out the length of the string + ULONG numChars = 0; + + // Temporarily assume success + bOK = true; + + ULONG tmpOffset = bp.GetNumBitsParsed(); + + USHORT val = 1; + while (val != 0) + { + DWORD rc = bp.Get( BITS_PER_BYTE, val ); + if (rc == NO_ERROR) + { + numChars++; + } + else + { + val = 0; + } + } + + // Now actually parse/load the string + if (bOK == true) + { + bp.SetOffset( tmpOffset ); + bOK = ParseString( numChars, bp ); + } + } + break; + + case eDB2_FIELD_STDTYPE_STRING_U8: + case eDB2_FIELD_STDTYPE_STRING_U8NT: + // Unsupported in the Linux adaptation + bOK = false; + break; + + // Field is 32-bit floating point value + case eDB2_FIELD_STDTYPE_FLOAT32: + { + // We store as a ULONG + ULONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + FLOAT * pFloat = (FLOAT *)&val; + + // Success! + mValue.mFP32 = *pFloat; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%04lX", mValue.mU32 ); + } + else + { + snprintf( &tempValueString[0], 0, "%f", mValue.mFP32 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + + // Field is 64-bit floating point value + case eDB2_FIELD_STDTYPE_FLOAT64: + { + // We store as a ULONGLONG + ULONGLONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + DOUBLE * pFloat = (DOUBLE *)&val; + + // Success! + mValue.mFP64 = *pFloat; + bOK = true; + + if (bGenStrings == true) + { + if (mField.mbHex == true) + { + snprintf( &tempValueString[0], 0, "0x%08llX", mValue.mU64 ); + } + else + { + snprintf( &tempValueString[0], 0, "%f", mValue.mFP64 ); + } + mValueString = &tempValueString[0]; + } + } + } + break; + } + } + break; + + // Unsigend enum value + case eDB2_FIELD_ENUM_UNSIGNED: + { + // We store as a ULONG + ULONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mU32 = val; + bOK = true; + + // Grab the enum ID + ULONG id = pField->mTypeVal; + + // Map to a string? + if (bGenStrings == true) + { + mValueString = db.MapEnumToString( id, + (int)mValue.mU32, + true, + mField.mbHex ); + } + } + } + break; + + // Signed enum value + case eDB2_FIELD_ENUM_SIGNED: + { + // We store as a LONG + LONG val; + DWORD rc = bp.Get( mField.mSize, val ); + if (rc == NO_ERROR) + { + // Success! + mValue.mS32 = val; + bOK = true; + + // Grab the enum ID + ULONG id = pField->mTypeVal; + + // Map to a string? + if (bGenStrings == true) + { + mValueString = db.MapEnumToString( id, + (int)mValue.mS32, + true, + mField.mbHex ); + } + } + } + break; + } + + mbValid = bOK; +} + +/*=========================================================================== +METHOD: + ParseString (Public Method) + +DESCRIPTION: + Convert the field value to a string + +PARAMETERS: + numChars [ I ] - Number of characters to parse/load + bp [I/O] - Bit parser to use + +RETURN VALUE: + bool +===========================================================================*/ +bool sParsedField::ParseString( + ULONG numChars, + cBitParser & bp ) +{ + // Validate size (including '\0') + if (MAX_SHARED_BUFFER_SIZE < numChars + 1) + { + return false; + } + + // Assume success + bool bRC = true; + + // Store current offset so we can update field length + ULONG curOffset = bp.GetNumBitsParsed(); + + // Load each byte of the string individually + BYTE buf[MAX_SHARED_BUFFER_SIZE]; + for (ULONG c = 0; c < numChars; c++) + { + BYTE val = 0; + DWORD rc = bp.Get( BITS_PER_BYTE, val ); + if (rc == NO_ERROR) + { + buf[c] = val; + } + else + { + bRC = false; + break; + } + } + + if (bRC == true) + { + // Write zeros to the rest of the buffer + ULONG size = numChars; + ULONG end = numChars + 1; + for (ULONG current = size; current < end; current++) + { + buf[current] = 0; + } + + mValueString = (LPCSTR)&buf[0]; + + mValue.mpAStr = (LPCSTR)mValueString.c_str(); + + // Update field size + mField.mSize = bp.GetNumBitsParsed() - curOffset; + } + + return bRC; +} + +/*=========================================================================*/ +// cParsedFieldNavigator Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetFieldIndex (Public Method) + +DESCRIPTION: + Get index of the (first) field that matches the given field ID + +PARAMETERS: + fieldID [ I ] - Field ID to look for + bLoop [ I ] - Loop around end of field list? + +RETURN VALUE: + ULONG - Index of the field (0xFFFFFFFF upon failure) +===========================================================================*/ +ULONG cParsedFieldNavigator::GetFieldIndex( + ULONG fieldID, + bool bLoop ) const +{ + ULONG id = ULONG_MAX; + ULONG count = (ULONG)mFields.size(); + + // Start from last field ID? + ULONG fp = 0; + ULONG fi = 0; + if (mLastIDIndex < count) + { + fi = mLastIDIndex; + } + else if (mLastIDIndex != ULONG_MAX && bLoop == false) + { + // Beyond end of fields with no looping + mLastIDIndex = id; + return id; + } + + for (fp = 0; fp < count; fp++) + { + if (mFields[fi].mField.mID == fieldID) + { + id = fi; + break; + } + + fi++; + if (fi == count) + { + if (bLoop == true) + { + fi = 0; + } + else + { + break; + } + } + } + + // Update last ID accordingly (0xFFFFFFFF upon failure), and return + mLastIDIndex = id; + if (mLastIDIndex != ULONG_MAX) + { + mLastIDIndex++; + if (mLastIDIndex == count) + { + mLastIDIndex = 0; + } + } + + return id; +} + +/*=========================================================================*/ +// cDataParser Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cDataParser (Public Method) + +DESCRIPTION: + Constructor (protocol buffer, entity key, and payload) + +PARAMETERS: + db [ I ] - Database to use + buffer [ I ] - The protocol buffer being parsed + key [ I ] - Protocol entity key + pData [ I ] - Payload from above protocol buffer + dataLen [ I ] - Size of above payload + +RETURN VALUE: + None +===========================================================================*/ +cDataParser::cDataParser( + const cCoreDatabase & db, + const sProtocolBuffer & buffer, + const std::vector & key, + const BYTE * pData, + ULONG dataLen ) + : cProtocolEntityNav( db ), + mBuffer( buffer.GetSharedBuffer() ), + mbFieldStrings( true ), + mbParsed( false ) +{ + // We must have a valid protocol buffer + if (mBuffer.IsValid() == false) + { + return; + } + + // We need something to parse + if (pData == 0 || dataLen == 0) + { + return; + } + + // Key has to be proper + if (key.size() < 1) + { + return; + } + + // Key needs to match protocol + eProtocolType pt = (eProtocolType)mBuffer.GetType(); + eDB2EntityType et = (eDB2EntityType)key[0]; + + if (pt == ePROTOCOL_DIAG_RX || pt == ePROTOCOL_DIAG_TX) + { + if (IsDiagEntityType( et ) == false) + { + return; + } + } + + else if (IsQMIProtocol( pt ) == true) + { + if (IsQMIEntityType( et ) == false) + { + return; + } + } + + // Pass data to the bit parser + mKey = key; + mBitsy.SetData( pData, dataLen * BITS_PER_BYTE ); +} + +/*=========================================================================== +METHOD: + ~cDataParser (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cDataParser::~cDataParser() +{ + // Ask bit parser to release data + mBitsy.ReleaseData(); + + // Empty fields + mFields.clear(); +} + +/*=========================================================================== +METHOD: + Parse (Public Method) + +DESCRIPTION: + Parse the data to a list of fields/summary text + +PARAMETERS: + bFieldStrings [ I ] - Generate string representations of field values? + bFieldNames [ I ] - Generate (partial) field names? + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataParser::Parse( + bool bFieldStrings, + bool bFieldNames ) +{ + // Store parsing options + mbFieldStrings = bFieldStrings; + mbFieldNames = bFieldNames; + + if (mbParsed == false) + { + // Allocate space for 1024 fields up front in order to increase + // performance when parsing and accessing parsed fields + mFields.reserve( 1024 ); + + // Process (parse) the protocol entity + mbParsed = ProcessEntity( mKey ); + } + + return mbParsed; +} + + +/*=========================================================================== +METHOD: + GetLastValue (Internal Method) + +DESCRIPTION: + Working from the back of the current field list find and return the + value for the specified field ID as a LONGLONG (field type must be + able to fit in a LONGLONG for a value to be returned) + +PARAMETERS: + fieldID [ I ] - Field ID we are looking for + val [ O ] - The value + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataParser::GetLastValue( + ULONG fieldID, + LONGLONG & val ) +{ + // Assume failure + bool bRC = false; + + // Use field value tracking information + std::map >::iterator pTF; + pTF = mTrackedFields.find( fieldID ); + if (pTF != mTrackedFields.end() && pTF->second.first == true) + { + val = pTF->second.second; + bRC = true; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ContinueNavigation (Internal Method) + +DESCRIPTION: + Continue navigation now that entity has been set? + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataParser::ContinueNavigation() +{ + // Proceed to parse? + bool bParse = true; + + // Is there actually something to process? + if (mBitsy.GetNumBitsLeft() == 0) + { + bParse = false; + } + + return bParse; +} + +/*=========================================================================== +METHOD: + ProcessField (Internal Method) + +DESCRIPTION: + Process the given field by parsing the value + +PARAMETERS: + pField [ I ] - The field being processed + fieldName [ I ] - Field name (partial) + arrayIndex [ I ] - Not used + +RETURN VALUE: + bool +===========================================================================*/ +bool cDataParser::ProcessField( + const sDB2Field * pField, + const std::string & fieldName, + LONGLONG /* arrayIndex */ ) +{ + // Assume failure + bool bRC = false; + if (pField == 0) + { + return bRC; + } + + // We must have a name + sParsedField theField( mDB, + pField, + fieldName, + mBitsy, + mbFieldStrings ); + + // Did that result in a valid field? + if (theField.IsValid() == true) + { + // Add field + mFields.push_back( theField ); + bRC = true; + + // Are we tracking the value of this field? + std::map >::iterator pTF; + pTF = mTrackedFields.find( pField->mID ); + if (pTF != mTrackedFields.end()) + { + std::pair & entry = pTF->second; + + // What type is this field? + switch (pField->mType) + { + case eDB2_FIELD_STD: + { + // Standard field, what kind? + eDB2StdFieldType ft = (eDB2StdFieldType)pField->mTypeVal; + switch (ft) + { + // Field is a boolean (0/1, false/true)/8-bit unsigned + case eDB2_FIELD_STDTYPE_BOOL: + case eDB2_FIELD_STDTYPE_UINT8: + { + // Treat as UCHAR + entry.second = (LONGLONG)theField.mValue.mU8; + entry.first = true; + } + break; + + // Field is 8-bit signed integer + case eDB2_FIELD_STDTYPE_INT8: + { + // Treat as CHAR + entry.second = (LONGLONG)theField.mValue.mS8; + entry.first = true; + } + break; + + // Field is 16-bit signed integer + case eDB2_FIELD_STDTYPE_INT16: + { + // Treat as SHORT + entry.second = (LONGLONG)theField.mValue.mS16; + entry.first = true; + } + break; + + // Field is 16-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT16: + { + // Treat as USHORT + entry.second = (LONGLONG)theField.mValue.mU16; + entry.first = true; + } + break; + + // Field is 32-bit signed integer + case eDB2_FIELD_STDTYPE_INT32: + { + // Treat as LONG + entry.second = (LONGLONG)theField.mValue.mS32; + entry.first = true; + } + break; + + // Field is 32-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT32: + { + // Treat as ULONG + entry.second = (LONGLONG)theField.mValue.mU32; + entry.first = true; + } + break; + + // Field is 64-bit signed integer + case eDB2_FIELD_STDTYPE_INT64: + { + // Treat as LONGLONG + entry.second = (LONGLONG)theField.mValue.mS64; + entry.first = true; + } + break; + + // Field is 64-bit unsigned integer + case eDB2_FIELD_STDTYPE_UINT64: + { + // Treat as ULONGLONG + if (theField.mValue.mU64 <= LLONG_MAX) + { + entry.second = (LONGLONG)theField.mValue.mU64; + entry.first = true; + } + } + break; + } + } + break; + + case eDB2_FIELD_ENUM_UNSIGNED: + { + // Treat as ULONG + entry.second = (LONGLONG)theField.mValue.mU32; + entry.first = true; + } + break; + + case eDB2_FIELD_ENUM_SIGNED: + { + // Treat as LONG + entry.second = (LONGLONG)theField.mValue.mS32; + entry.first = true; + } + break; + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + HandleSpecialCases (Internal Method) + +DESCRIPTION: + Handle special case processing for summary text generation + + NOTE: This should only be added to as a last resort + +PARAMETERS: + args [I/O] - Current argument list/updated 'special' argument list + fs [I/O] - Current format specifier/updated 'special' format + specifier + +RETURN VALUE: + None +===========================================================================*/ +void cDataParser::HandleSpecialCases( + std::string & args, + std::string & fs ) +{ + std::vector key = mEntity.GetKey(); + if (key.size() == 2 && key[0] == (ULONG)eDB2_ET_DIAG_EVENT) + { + ULONG id = key[1]; + + mBitsy.SetOffset( 0 ); + ULONG lenInBits = mBitsy.GetNumBitsLeft(); + + switch (id) + { + case 276: + if (lenInBits == 16) + { + // Old style idle handoff event, remap summary + args = "idle_handoff"; + fs = "idle_handoff=%u"; + } + break; + + case 277: + if (lenInBits == 16) + { + // Old style access handoff event, remap summary + args = "ms_access_handoff"; + fs = "ms_access_handoff=%u"; + } + break; + + case 278: + if (lenInBits == 16) + { + // Old style access probe handoff event, remap summary + args = "ms_access_probe_handoff"; + fs = "ms_access_probe_handoff=%u"; + } + break; + + case 639: + if (lenInBits == 16) + { + // Old style access entry handoff event, remap summary + args = "ms_access_handoff"; + fs = "ms_access_handoff=%u"; + } + break; + } + } +} + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/DataParser.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/DataParser.h new file mode 100755 index 0000000..5435046 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/DataParser.h @@ -0,0 +1,399 @@ +/*=========================================================================== +FILE: + DataParser.h + +DESCRIPTION: + Declaration of sParsedField and cDataParser + +PUBLIC CLASSES AND METHODS: + sParsedField + Structure to represent a single parsed field (field ID, offset, + size, value, name, etc.) + + cDataParser + Class to parse a buffer into bit/byte specified fields accordinging + to a database description, uses cProtocolEntityNav to navigate the DB + definition + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "CoreDatabase.h" +#include "BitParser.h" +#include "ProtocolEntityNav.h" +#include "ProtocolBuffer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +class cColorItem; + +/*=========================================================================*/ +// Union uFields +// +// Union to represent the data of a parsed field +/*=========================================================================*/ +union uFields +{ + CHAR mS8; + UCHAR mU8; + SHORT mS16; + USHORT mU16; + LONG mS32; + ULONG mU32; + FLOAT mFP32; + LONGLONG mS64; + ULONGLONG mU64; + double mFP64; + LPCSTR mpAStr; +}; + +/*=========================================================================*/ +// Struct sParsedField +// +// Structure to represent a parsed field +/*=========================================================================*/ +struct sParsedField +{ + // Give data parser full access + friend class cDataParser; + + public: + // (Inline) Constructor - default + sParsedField() + : mField(), + mOffset( 0 ), + mValueString( "" ), + mName( "" ), + mbValid( false ) + { + memset( (PVOID)&mValue, 0, sizeof( mValue ) ); + }; + + // Constructor - parameterized + sParsedField( + const cCoreDatabase & db, + const sDB2Field * pField, + const std::string & name, + cBitParser & bp, + bool bGenStrings = true ); + + // (Inline) Get the raw value string (i.e. unmapped enums) + std::string GetRawValueString() const + { + std::string retStr = ""; + std::ostringstream tmp; + + if (IsValid() == true) + { + if (mField.mType == eDB2_FIELD_ENUM_UNSIGNED) + { + if (mField.mbHex == false) + { + tmp << mValue.mU32; + retStr = tmp.str(); + } + else + { + tmp << std::ios_base::hex << std::ios_base::uppercase + << std::ios_base::showbase << mValue.mU32; + retStr = tmp.str(); + } + } + else if (mField.mType == eDB2_FIELD_ENUM_SIGNED) + { + if (mField.mbHex == false) + { + tmp << mValue.mS32; + retStr = tmp.str(); + } + else + { + tmp << std::ios_base::hex << std::ios_base::uppercase + << std::ios_base::showbase << mValue.mU32; + retStr = tmp.str(); + } + } + else + { + retStr = mValueString; + } + } + + return retStr; + }; + + // (Inline) Get field size in bits + ULONG GetSize() const + { + ULONG sz = 0; + if (mField.IsValid() == true) + { + sz = mField.mSize; + } + + return sz; + }; + + // (Inline) Is this field a string type? + bool IsString() const + { + bool bStr = false; + if (IsValid() == false) + { + return bStr; + } + + if (mField.mType == eDB2_FIELD_STD) + { + switch ((eDB2StdFieldType)mField.mTypeVal) + { + case eDB2_FIELD_STDTYPE_STRING_A: + case eDB2_FIELD_STDTYPE_STRING_U: + case eDB2_FIELD_STDTYPE_STRING_U8: + case eDB2_FIELD_STDTYPE_STRING_ANT: + case eDB2_FIELD_STDTYPE_STRING_UNT: + case eDB2_FIELD_STDTYPE_STRING_U8NT: + bStr = true; + break; + } + } + + return bStr; + }; + + // (Inline) Is this object valid? + bool IsValid() const + { + return mbValid; + }; + + /* Field definition */ + sDB2Field mField; + + /* Bit offset (from start of payload) */ + ULONG mOffset; + + /* Field value */ + uFields mValue; + + /* Field value as a string */ + std::string mValueString; + + /* Partially qualified name of field */ + std::string mName; + + protected: + // Parse a string + bool ParseString( + ULONG numChars, + cBitParser & bp ); + + /* Is this object valid? */ + bool mbValid; +}; + +/*=========================================================================*/ +// Class cParsedFieldNavigator +// +// Class to navigate/search parsed fields produced by the above +/*=========================================================================*/ +class cParsedFieldNavigator +{ + public: + // (Inline) Constructor + cParsedFieldNavigator( const std::vector & pf ) + : mFields( pf ), + mLastIDIndex( ULONG_MAX ) + { }; + + // Get index of the (first) field that matches the field ID, + // the search starts from the last success index returned by + // a previous call to this method + ULONG GetFieldIndex( + ULONG fieldID, + bool bLoop = false ) const; + + // (Inline) Get index of the (first) field that matches the + // given ID, the search starts from the provided index + ULONG GetFieldIndexFrom( + ULONG fieldID, + ULONG startIndex, + bool bLoop = false ) const + { + mLastIDIndex = startIndex; + return GetFieldIndex( fieldID, bLoop ); + }; + + protected: + /* The list of parsed fields */ + const std::vector & mFields; + + /* Index of last field we matched */ + mutable ULONG mLastIDIndex; +}; + +/*=========================================================================*/ +// Class cDataParser +// Class to parse a buffer into bit/byte specified fields +/*=========================================================================*/ +class cDataParser : public cProtocolEntityNav +{ + public: + // Constructor (protocol buffer) + cDataParser( + const cCoreDatabase & db, + const sProtocolBuffer & buffer ); + + // Constructor (protocol buffer, entity key, and payload) + cDataParser( + const cCoreDatabase & db, + const sProtocolBuffer & buffer, + const std::vector & key, + const BYTE * pData, + ULONG dataLen ); + + // Destructor + virtual ~cDataParser(); + + // Parse the data to a list of fields/summary text + virtual bool Parse( + bool bFieldStrings = true, + bool bFieldNames = true ); + + // (Inline) Get the protocol entity name + std::string GetEntityName() const + { + std::string retName = "?"; + if (mEntity.mpName != 0 && mEntity.mpName[0] != 0) + { + retName = mEntity.mpName; + } + + return retName; + }; + + // (Inline) Get the parsed fields + typedef std::vector tParsedFields; + const tParsedFields & GetFields() const + { + return mFields; + }; + + protected: + // Working from the back of the current field list find + // and return the value for the specified field ID as a + // LONGLONG (field type must be able to fit) + virtual bool GetLastValue( + ULONG fieldID, + LONGLONG & val ); + + // Contiue navigation now that entity has been set? + virtual bool ContinueNavigation(); + + // Process the given field + virtual bool ProcessField( + const sDB2Field * pField, + const std::string & fieldName, + LONGLONG arrayIndex = -1 ); + + // (Inline) Get current working offset + virtual ULONG GetOffset() + { + return mBitsy.GetNumBitsParsed(); + }; + + // (Inline) Set current working offset + virtual bool SetOffset( ULONG offset ) + { + mBitsy.SetOffset( offset ); + return true; + }; + + // (Inline) Get current navigation order + virtual bool GetLSBMode() + { + return mBitsy.GetLSBMode(); + }; + + // (Inline) Set current navigation order + virtual bool SetLSBMode( bool bLSB ) + { + // Assume success + bool bOK = true; + if (bLSB != GetLSBMode()) + { + if ((GetOffset() % BITS_PER_BYTE) != 0) + { + // We need to be on a byte boundary + bOK = false; + } + else + { + mBitsy.SetLSBMode( bLSB ); + } + } + + return bOK; + }; + + // Handle special case processing for summary text generation + virtual void HandleSpecialCases( + std::string & args, + std::string & fs ); + + /* Color item containing the data we are parsing */ + sProtocolBuffer mBuffer; + + /* Entity key */ + std::vector mKey; + + /* The underlying bit parser */ + cBitParser mBitsy; + + /* The list of parsed fields */ + tParsedFields mFields; + + /* Generate field value strings? */ + bool mbFieldStrings; + + /* Did we successfully parse the buffer? */ + bool mbParsed; + + /* Parsed field vector index of last instance of each field (by ID) */ + std::map mFieldIndices; +}; + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/Event.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/Event.cpp new file mode 100755 index 0000000..3be587c --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/Event.cpp @@ -0,0 +1,443 @@ +/*=========================================================================== +FILE: + Event.cpp + +DESCRIPTION: + Implementation of cEvent class + +PUBLIC CLASSES AND METHODS: + WaitOnMultipleEvents + cEvent + Functionality to mimic Windows events using UNIX pipes (enhanced + somewhat to allow one to specify a DWORD value to pass through + when signalling the event) + + WARNING: + This class is not designed to be thread safe + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "Event.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +const DWORD READING = 0; +const DWORD WRITING = 1; + +/*=========================================================================== +METHOD: + WaitOnMultipleEvents (Free Method) + +DESCRIPTION: + Wait for any of the events to be set and return the value + + Note: If multiple events are set, only the event specified by + eventIndex will be read from. Run this function again + to get the next event. + +PARAMETERS: + events [ I ] - Vector of events which may be signaled + timeoutMS [ I ] - Relative timeout length (in milliseconds) + val [ O ] - Associated value upon success + eventIndex [ O ] - Index of event which was signaled + +RETURN VALUE: + Return code + positive for number of events set + -ETIME on timeout + negative errno value on failure +===========================================================================*/ +int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ) +{ + // Check internal pipes' status + for (int index = 0; index < events.size(); index++) + { + int error = events[index]->mError; + if (error != 0) + { + TRACE( "cEvent %d has error %d\n", index, error ); + return -error; + } + } + + // Initialize the FD set + fd_set fds; + FD_ZERO( &fds ); + + // Add each item to the FD set, keeping track of the largest, + // which is used for select() + int largestFD = 0; + for (int index = 0; index < events.size(); index++) + { + int pipe = events[index]->mPipes[READING]; + FD_SET( pipe, &fds ); + + largestFD = std::max( pipe, largestFD ); + } + + struct timeval timeOut; + + // Add avoiding an overflow on (long)usec + timeOut.tv_sec = timeoutMS / 1000l; + timeOut.tv_usec = ( timeoutMS % 1000l ) * 1000l; + + // Wait for activity on the pipes for the specified amount of time + int rc = select( largestFD + 1, &fds, 0, 0, &timeOut ); + if (rc == -1) + { + TRACE( "WaitOnMultipleEvents error %d\n", errno ); + return -errno; + } + else if (rc == 0) + { + // No activity on the pipes + return -ETIME; + } + + int numSignaled = rc; + + // Only read from first pipe which was signaled + int signaled = -1; + for (int index = 0; index < events.size(); index++) + { + int pipe = events[index]->mPipes[READING]; + if (FD_ISSET( pipe, &fds ) != 0) + { + signaled = index; + break; + } + } + + if (signaled == -1) + { + // Odd, no one was signaled + return -ENODATA; + } + + DWORD tempVal = 0; + rc = events[signaled]->Read( tempVal ); + if (rc == 0) + { + // Success + val = tempVal; + eventIndex = signaled; + return numSignaled; + } + else + { + // failure + return rc; + } +} + +/*=========================================================================*/ +// cEvent Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cEvent (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cEvent::cEvent() + : mError( 0 ) +{ + int rc = pipe( mPipes ); + if (rc != 0) + { + mError = errno; + TRACE( "cEvent - Error %d creating pipe, %s\n", + mError, + strerror( mError ) ); + } +} + +/*=========================================================================== +METHOD: + ~cEvent (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cEvent::~cEvent() +{ + // Check internal pipe status + if (mError == 0) + { + Close(); + mError = EBADF; + } +} + +/*=========================================================================== +METHOD: + Close (Internal Method) + +DESCRIPTION: + Close pipe + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Close() +{ + int retCode = 0; + + int rc = close( mPipes[READING] ); + mPipes[READING] = -1; + + if (rc != 0) + { + retCode = errno; + TRACE( "cEvent - Error %d deleting pipe[READING], %s\n", + retCode, + strerror( retCode ) ); + } + + rc = close( mPipes[WRITING] ); + mPipes[WRITING] = -1; + + if (rc != 0) + { + retCode = errno; + TRACE( "cEvent - Error %d deleting pipe[WRITING], %s\n", + retCode, + strerror( retCode ) ); + } + + return retCode; +} + +/*=========================================================================== +METHOD: + Set (Public Method) + +DESCRIPTION: + Set/signal the event with the specified value + +PARAMETERS: + val [ I ] - Value to pass through with signal + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Set( DWORD val ) +{ + // Check internal pipe status + if (mError != 0) + { + return mError; + } + + PBYTE pWrite = (PBYTE)&val; + + int writeSize = sizeof( DWORD ); + while (writeSize > 0) + { + int bytesWritten = write( mPipes[WRITING], pWrite, writeSize ); + if (bytesWritten == -1) + { + // Store error from write + int writeErr = errno; + + // First error? + if (mError == 0) + { + // Yes, save the error + mError = writeErr; + } + + // We cannot recover from this error + Close(); + return writeErr; + } + + pWrite += bytesWritten; + writeSize -= bytesWritten; + } + + // Success + return 0; +} + +/*=========================================================================== +METHOD: + Wait (Free Method) + +DESCRIPTION: + Wait for the event to be signalled and return the read in value + +PARAMETERS: + timeoutMS [ I ] - Relative timeout length (in milliseconds) + val [ O ] - Associated value upon success + +RETURN VALUE: + Return code + 0 on success + ETIME on timeout + errno value on failure +===========================================================================*/ +int cEvent::Wait( + DWORD timeoutMS, + DWORD & val ) +{ + // Check internal pipe status + if (mError != 0) + { + return mError; + } + + fd_set fds; + FD_ZERO( &fds ); + FD_SET( mPipes[READING], &fds ); + + struct timeval timeOut; + + // Add avoiding an overflow on (long)usec + timeOut.tv_sec = timeoutMS / 1000l; + timeOut.tv_usec = ( timeoutMS % 1000l ) * 1000l; + + // Wait for activity on the pipe for the specified amount of time + int rc = select( mPipes[READING] + 1, &fds, 0, 0, &timeOut ); + if (rc == -1) + { + // Store error from select + int selectErr = errno; + + // First error? + if (mError == 0) + { + // Yes, save the error + mError = selectErr; + } + + // We cannot recover from this error + Close(); + return selectErr; + } + else if (rc == 0) + { + // No activity on the pipe + return ETIME; + } + + return Read( val ); +} + +/*=========================================================================== +METHOD: + Clear (Free Method) + +DESCRIPTION: + Read and discard all values currently in the pipe +===========================================================================*/ +void cEvent::Clear() +{ + DWORD unusedVal; + int rc = 0; + while (rc == 0) + { + rc = Wait( (DWORD)0, unusedVal ); + } +} + + +/*=========================================================================== +METHOD: + Read (Internal Method) + +DESCRIPTION: + Read a DWORD from the pipe + +RETURN VALUE: + Return code + 0 on success + errno value on failure +===========================================================================*/ +int cEvent::Read( DWORD & val ) +{ + DWORD tempVal; + PBYTE pRead = (PBYTE)&tempVal; + + int readSize = sizeof( DWORD ); + while (readSize > 0) + { + int bytesRead = read( mPipes[READING], pRead, readSize ); + if (bytesRead <= 0) + { + // Store error from read + int readErr = errno; + if (readErr == 0) + { + // Hard error! This should NEVER happen for a pipe + ASSERT( 0 ); + readErr = EBADF; + } + + // First error? + if (mError == 0) + { + // Yes, store the error + mError = readErr; + } + + // We cannot recover from this error + Close(); + return readErr; + } + + pRead += bytesRead; + readSize -= bytesRead; + } + + val = tempVal; + + return 0; +} \ No newline at end of file diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/Event.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/Event.h new file mode 100755 index 0000000..43db20d --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/Event.h @@ -0,0 +1,117 @@ +/*=========================================================================== +FILE: + Event.h + +DESCRIPTION: + Declaration of cEvent class + +PUBLIC CLASSES AND METHODS: + WaitOnMultipleEvents + cEvent + Functionality to mimic Windows events using UNIX pipes (enhanced + somewhat to allow one to specify a DWORD value to pass through + when signalling the event) + + WARNING: + This class is not designed to be thread safe + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include + +//--------------------------------------------------------------------------- +// Prototype +//--------------------------------------------------------------------------- + +class cEvent; + +/*=========================================================================*/ +// Free methods +/*=========================================================================*/ + +// Wait for any of the events to be set and return the value +int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ); + +/*=========================================================================*/ +// Class cEvent +/*=========================================================================*/ +class cEvent +{ + public: + // Constructor + cEvent(); + + // Destructor + ~cEvent(); + + // Set/signal the event with the specified value + int Set( DWORD val ); + + // Wait for the event to be signalled and return the read in value + int Wait( + DWORD timeoutMS, + DWORD & val ); + + // Read and discard all values currently in the pipe + void Clear(); + + protected: + // Close pipe (used in errors or normal exit) + int Close(); + + // Read from the pipe + int Read( DWORD & val ); + + /* Internal error status */ + int mError; + + /* Internal pipes */ + int mPipes[2]; + + // WaitOnMultipleEvents gets full access + friend int WaitOnMultipleEvents( + std::vector events, + DWORD timeoutMS, + DWORD & val, + DWORD & eventIndex ); +}; + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLC.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLC.cpp new file mode 100755 index 0000000..10c3689 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLC.cpp @@ -0,0 +1,304 @@ +/*=========================================================================== +FILE: + HDLC.cpp + +DESCRIPTION: + Encode and decode asynchronous HDLC protocol packets as described + by both the QUALCOMM download & SDIC (diagnostic) protocol documents + +PUBLIC CLASSES AND METHODS: + HDLCDecode() + HDLCEncode() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//----------------------------------------------------------------------------- +// Include Files +//----------------------------------------------------------------------------- +#include "StdAfx.h" +#include "HDLC.h" +#include "CRC.h" +#include "SharedBuffer.h" +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/* Async HDLC defines */ +const BYTE AHDLC_FLAG = 0x7e; +const BYTE AHDLC_ESCAPE = 0x7d; +const BYTE AHDLC_ESC_M = 0x20; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + HDLCDecode (Free Method) + +DESCRIPTION: + HDLC decode the given buffer returning the results in an allocated buffer + +PARAMETERS: + pBuf [ I ] - The data buffer to decode + +RETURN VALUE: + sSharedBuffer * : The decoded buffer (allocated), 0 on error +===========================================================================*/ +sSharedBuffer * HDLCDecode( sSharedBuffer * pBuf ) +{ + // The return buffer + sSharedBuffer * pRet = 0; + + // The has to be something to decode + if (pBuf == 0 || pBuf->IsValid() == false) + { + return pRet; + } + + // Grab raw data from shared buffer + const BYTE * pData = pBuf->GetBuffer(); + UINT sz = pBuf->GetSize(); + + // Is the first character a leading flag? + if (pData[0] == AHDLC_FLAG) + { + pData++; + sz--; + } + + // There must be at least four bytes (data, CRC, trailing flag) + if (sz < 4) + { + return pRet; + } + + // The last character must be the trailing flag + if (pData[sz - 1] == AHDLC_FLAG) + { + sz--; + } + else + { + return pRet; + } + + // Allocate the decode buffer + PBYTE pDecoded = new BYTE[sz]; + if (pDecoded == 0) + { + return pRet; + } + + // Handle escaped characters and copy into decode buffer + UINT encodeIndex = 0; + UINT decodeIndex = 0; + while (encodeIndex < sz) + { + BYTE b = pData[encodeIndex++]; + if (b == AHDLC_ESCAPE && encodeIndex < sz) + { + b = pData[encodeIndex++]; + b ^= AHDLC_ESC_M; + } + + pDecoded[decodeIndex++] = b; + } + + // Check CRC value + if (CheckCRC( pDecoded, decodeIndex ) == false) + { + delete [] pDecoded; + return pRet; + } + + // Adjust decode length down for CRC + decodeIndex -= 2; + + // ... and wrap up in a shared buffer + pRet = new sSharedBuffer( decodeIndex, pDecoded, pBuf->GetType() ); + return pRet; +} + +/*=========================================================================== +METHOD: + HDLCEncode (Free Method) + +DESCRIPTION: + HDLC encode the given buffer returning the results in an allocated buffer + +PARAMETERS: + pBuf [ I ] - The data buffer to decode + +RETURN VALUE: + sSharedBuffer * : The decoded buffer (allocated), 0 on error +===========================================================================*/ +sSharedBuffer * HDLCEncode( sSharedBuffer * pBuf ) +{ + // The return buffer + sSharedBuffer * pRet = 0; + + // The has to be something to decode + if (pBuf == 0 || pBuf->IsValid() == false) + { + return pRet; + } + + // Grab raw data from shared buffer + const BYTE * pData = pBuf->GetBuffer(); + UINT sz = pBuf->GetSize(); + + // Compute CRC + USHORT CRC = CalculateCRC( pData, sz * 8 ); + + // Allocate the encode buffer + PBYTE pEncoded = new BYTE[sz * 2 + 4]; + if (pEncoded == 0) + { + return pRet; + } + + // Add leading flag + UINT encodeIndex = 0; + pEncoded[encodeIndex++] = AHDLC_FLAG; + + // Add data, escaping when necessary + UINT decodeIndex = 0; + while (decodeIndex < sz) + { + BYTE value = pData[decodeIndex++]; + if (value == AHDLC_FLAG || value == AHDLC_ESCAPE) + { + value ^= AHDLC_ESC_M; + pEncoded[encodeIndex++] = AHDLC_ESCAPE; + } + + pEncoded[encodeIndex++] = value; + } + + // Byte order CRC + BYTE byteOrderedCRC[2]; + byteOrderedCRC[0] = (BYTE)(CRC & 0x00ff); + byteOrderedCRC[1] = (BYTE)(CRC >> 8); + + // Add CRC + UINT c = 0; + while (c < 2) + { + BYTE value = byteOrderedCRC[c++]; + if (value == AHDLC_FLAG || value == AHDLC_ESCAPE) + { + value ^= AHDLC_ESC_M; + pEncoded[encodeIndex++] = AHDLC_ESCAPE; + } + + pEncoded[encodeIndex++] = value; + } + + // Add trailing flag + pEncoded[encodeIndex++] = AHDLC_FLAG; + + // Wrap up in a shared buffer + pRet = new sSharedBuffer( encodeIndex, pEncoded, pBuf->GetType() ); + return pRet; +} + +/*=========================================================================== +METHOD: + HDLCUnitTest (Free Method) + +DESCRIPTION: + Simple in = out testing of HDLCEncode/HDLCDecode + +RETURN VALUE: + bool: + true - Test succeeded + false - Test failed +===========================================================================*/ +#ifdef DEBUG +#include + +bool HDLCUnitTest() +{ + // Assume failure + bool bRC = false; + + const UINT MAX_LEN = 2048; + BYTE testBuf[MAX_LEN]; + + srand( GetTickCount() ); + + UINT len = (((UINT)rand()) % MAX_LEN) + 1; + for (UINT i = 0; i < len; i++) + { + testBuf[i] = (BYTE)((UINT)rand() % 256); + } + + sSharedBuffer * pOrig = new sSharedBuffer( testBuf, len, 0 ); + if (pOrig != 0) + { + // Encode buffer + sSharedBuffer * pEnc = HDLCEncode( pOrig ); + if (pEnc != 0) + { + // Now decode buffer encoded above + sSharedBuffer * pDec = HDLCDecode( pEnc ); + if (pDec != 0) + { + if (pOrig->IsValid() == true && pDec->IsValid() == true) + { + // Compare decoded to original + const BYTE * pOrigData = pOrig->GetBuffer(); + const BYTE * pDecData = pDec->GetBuffer(); + + if (len == pDec->GetSize()) + { + int cmp = memcmp( (const void *)pOrigData, + (const void *)pDecData, + (size_t)len ); + + bRC = (cmp == 0); + } + } + + delete [] pDec; + } + + delete [] pEnc; + } + + delete [] pOrig; + } + + return bRC; +} + +#endif diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLC.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLC.h new file mode 100755 index 0000000..91a1a75 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLC.h @@ -0,0 +1,70 @@ +/*=========================================================================== +FILE: + HDLC.h + +DESCRIPTION: + Encode and decode asynchronous HDLC protocol packets as described + by both the QUALCOMM download & SDIC (diagnostic) protocol documents + +PUBLIC CLASSES AND METHODS: + HDLCDecode() + HDLCEncode() + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +extern const BYTE AHDLC_FLAG; +extern const BYTE AHDLC_ESCAPE; +extern const BYTE AHDLC_ESC_M; + +struct sSharedBuffer; + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +// HDLC encode the given buffer returning the results in an allocated buffer +sSharedBuffer * HDLCEncode( sSharedBuffer * pBuf ); + +// HDLC decode the given buffer returning the results in an allocated buffer +sSharedBuffer * HDLCDecode( sSharedBuffer * pBuf ); + +#ifdef DEBUG + +// Simple in = out testing of HDLCEncode/HDLCDecode +bool HDLCUnitTest(); + +#endif diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLCProtocolServer.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLCProtocolServer.cpp new file mode 100755 index 0000000..7c92a8b --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLCProtocolServer.cpp @@ -0,0 +1,323 @@ +/*=========================================================================== +FILE: + HDLCProtocolServer.cpp + +DESCRIPTION: + Generic HDLC framed protocol packet server + +PUBLIC CLASSES AND METHODS: + cHDLCProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "HDLCProtocolServer.h" +#include "HDLC.h" +#include "CRC.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cHDLCProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cHDLCProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + rxType [ I ] - Protocol type to assign to incoming data + txType [ I ] - Protocol type to verify for outgoing data + bufferSzRx [ I ] - Size of data buffer for incoming data + logSz [ I ] - Size of log (number of buffers) + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cHDLCProtocolServer::cHDLCProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ) + : cProtocolServer( rxType, txType, bufferSzRx, logSz ), + mRxType( rxType ), + mpEncodedBuffer( 0 ), + mpRxDecodeBuffer( 0 ), + mRxDecodeOffset( 0 ), + mbInEscape( false ) +{ + // Allocate decode buffer? + if (mRxBufferSize > 0) + { + mpRxDecodeBuffer = new BYTE[mRxBufferSize * 4]; + } +} + +/*=========================================================================== +METHOD: + ~cHDLCProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cHDLCProtocolServer::~cHDLCProtocolServer() +{ + // Free encoded buffer? + if (mpEncodedBuffer != 0) + { + delete mpEncodedBuffer; + mpEncodedBuffer = 0; + } + + // Free decode buffer? + if (mpRxDecodeBuffer != 0) + { + delete [] mpRxDecodeBuffer; + mpRxDecodeBuffer = 0; + } +} + +/*=========================================================================== +METHOD: + InitializeComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port initialization + + NOTE: This sends the commands to the driver which sends the IOCTL, but + that isn't successful + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cHDLCProtocolServer::InitializeComm() +{ + // Default configuration setting + struct termios settings; + + if (mComm.GetSettings( &settings ) == false) + { + return false; + } + + cfmakeraw( &settings ); + settings.c_cflag |= CREAD|CLOCAL; + + return mComm.ConfigureSettings( &settings ); +} + +/*=========================================================================== +METHOD: + CleanupComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port cleanup + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cHDLCProtocolServer::CleanupComm() +{ + // Nothing to actually do here + return true; +} + +/*=========================================================================== +METHOD: + EncodeTxData (Internal Method) + +DESCRIPTION: + Encode data for transmission + +PARAMETERS: + pBuffer [ I ] - Data to be encoded + bEncoded [ O ] - Do we even encoded data? + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + sSharedBuffer * - Encoded data (0 upon error when encoding is indicated) +===========================================================================*/ +sSharedBuffer * cHDLCProtocolServer::EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) +{ + // We encoded data + bEncoded = true; + + // Last encoded buffer around? + if (mpEncodedBuffer != 0) + { + // Yes free it. Note that this assumes that the last transmission has + // concluded since the buffer must exist during transmission. Since we + // support one and only one outstanding request this is valid + delete mpEncodedBuffer; + mpEncodedBuffer = 0; + } + + mpEncodedBuffer = HDLCEncode( pBuffer ); + return mpEncodedBuffer; +} + +/*=========================================================================== +METHOD: + DecodeRxData (Internal Method) + +DESCRIPTION: + Decode incoming data into packets returning the last response + +PARAMETERS: + bytesReceived [ I ] - Number of bytes to decoded + rspIdx [ O ] - Log index of last valid response + bAbortTx [ O ] - Response aborts current transmission? + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool - Was a response received? +===========================================================================*/ +bool cHDLCProtocolServer::DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ) +{ + // Assume failure + bool bRC = false; + rspIdx = INVALID_LOG_INDEX; + + // Something to decode from/to? + if (bytesReceived == 0 || mpRxDecodeBuffer == 0) + { + return bRC; + } + + BYTE val; + ULONG idx = 0; + ULONG maxSz = mRxBufferSize * 4; + + while (idx < bytesReceived) + { + val = mpRxBuffer[idx++]; + + // Check for target spewing nonsense + if (mRxDecodeOffset >= maxSz) + { + // Reset to beginning + mRxDecodeOffset = 0; + } + + // Was the previous byte an escape byte? + if (mbInEscape == true) + { + // Yes, handle it + mbInEscape = false; + + val ^= AHDLC_ESC_M; + mpRxDecodeBuffer[mRxDecodeOffset++] = val; + } + else if (val == AHDLC_ESCAPE) + { + // No, but this one is + mbInEscape = true; + } + else if (val == AHDLC_FLAG) + { + // Is this a valid frame? + if ( (mRxDecodeOffset > 0) + && (CheckCRC( mpRxDecodeBuffer, mRxDecodeOffset ) == true) ) + { + // Yes, extract it (minus CRC) to a shared buffer + sSharedBuffer * pTmp = 0; + pTmp = new sSharedBuffer( mpRxDecodeBuffer, + mRxDecodeOffset - 2, + (ULONG)mRxType ); + + if (pTmp != 0) + { + sProtocolBuffer tmpPB( pTmp ); + ULONG tmpIdx = mLog.AddBuffer( tmpPB ); + + // Abort? + bool bTmpAbortTx = IsTxAbortResponse( tmpPB ); + if (bTmpAbortTx == true) + { + bAbortTx = true; + } + else + { + // Is this the response we are looking for? + bool bRsp = IsResponse( tmpPB ); + if (bRsp == true) + { + rspIdx = tmpIdx; + bRC = true; + } + } + } + } + + // Reset for next frame + mRxDecodeOffset = 0; + } + else + { + // No, just a regular value + mpRxDecodeBuffer[mRxDecodeOffset++] = val; + } + } + + return bRC; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLCProtocolServer.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLCProtocolServer.h new file mode 100755 index 0000000..58b3d8f --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/HDLCProtocolServer.h @@ -0,0 +1,107 @@ +/*=========================================================================== +FILE: + HDLCProtocolServer.h + +DESCRIPTION: + Generic HDLC framed protocol packet server + +PUBLIC CLASSES AND METHODS: + cHDLCProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cHDLCProtocolServer +/*=========================================================================*/ +class cHDLCProtocolServer : public cProtocolServer +{ + public: + // Constructor + cHDLCProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cHDLCProtocolServer(); + + protected: + // Perform protocol specific communications port initialization + virtual bool InitializeComm(); + + // Perform protocol specific communications port cleanup + virtual bool CleanupComm(); + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ); + + // Decode incoming data into packets returning the last response + virtual bool DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ); + + // Is the passed in data a response to the current request? + virtual bool IsResponse( const sProtocolBuffer & /* rsp */ ) = 0; + + // Is the passed in data a response that aborts the current request? + virtual bool IsTxAbortResponse( const sProtocolBuffer & rsp ) = 0; + + /* Protocol type for incoming data*/ + eProtocolType mRxType; + + /* Encoded data being transmitted */ + sSharedBuffer * mpEncodedBuffer; + + /* Decode buffer for incoming data */ + BYTE * mpRxDecodeBuffer; + + /* Current index into above buffer */ + ULONG mRxDecodeOffset; + + /* Are we currently escaping a character? */ + bool mbInEscape; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/Makefile.am b/gobi-api/fixed-GobiAPI-1.0.40/Core/Makefile.am new file mode 100644 index 0000000..e906f98 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/Makefile.am @@ -0,0 +1,71 @@ +noinst_LTLIBRARIES = libCore.la + +libCore_la_CXXFLAGS = -Wunused-variable + +libCore_includedir = $(includedir)/gobi + +libCore_include_HEADERS = \ + types.h \ + apidefs.h + +libCore_la_SOURCES = \ + BitPacker.cpp \ + BitPacker.h \ + BitParser.cpp \ + BitParser.h \ + Comm.cpp \ + Comm.h \ + CoreDatabase.cpp \ + CoreDatabase.h \ + CoreUtilities.cpp \ + CoreUtilities.h \ + CRC.cpp \ + CRC.h \ + DataPacker.cpp \ + DataPacker.h \ + DataParser.cpp \ + DataParser.h \ + DB2NavTree.cpp \ + DB2NavTree.h \ + DB2TextFile.cpp \ + DB2TextFile.h \ + DB2Utilities.cpp \ + DB2Utilities.h \ + Event.cpp \ + Event.h \ + HDLC.cpp \ + HDLC.h \ + HDLCProtocolServer.cpp \ + HDLCProtocolServer.h \ + MemoryMappedFile.cpp \ + MemoryMappedFile.h \ + ProtocolBuffer.cpp \ + ProtocolBuffer.h \ + ProtocolEntityFieldEnumerator.h \ + ProtocolEntityNav.cpp \ + ProtocolEntityNav.h \ + ProtocolEnum.h \ + ProtocolLog.cpp \ + ProtocolLog.h \ + ProtocolNotification.cpp \ + ProtocolNotification.h \ + ProtocolRequest.cpp \ + ProtocolRequest.h \ + ProtocolServer.cpp \ + ProtocolServer.h \ + QDLBuffers.cpp \ + QDLBuffers.h \ + QDLEnum.h \ + QDLProtocolServer.cpp \ + QDLProtocolServer.h \ + QMIBuffers.cpp \ + QMIBuffers.h \ + QMIEnum.h \ + QMIProtocolServer.cpp \ + QMIProtocolServer.h \ + SharedBuffer.cpp \ + SharedBuffer.h \ + StdAfx.h \ + SyncQueue.h + + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/MemoryMappedFile.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/MemoryMappedFile.cpp new file mode 100755 index 0000000..ec1709e --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/MemoryMappedFile.cpp @@ -0,0 +1,183 @@ +/*=========================================================================== +FILE: + MemoryMappedFile.cpp + +DESCRIPTION: + Implementation of cMemoryMappedFile class + +PUBLIC CLASSES AND METHODS: + cMemoryMappedFile + The cMemoryMappedFile class provides the ability to read in a file + via Linux memory maps + + Note: cMemoryMappedFiles are read only + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//----------------------------------------------------------------------------- +// Include Files +//----------------------------------------------------------------------------- +#include "StdAfx.h" +#include "MemoryMappedFile.h" + +#include + +//----------------------------------------------------------------------------- +// Definitions +//----------------------------------------------------------------------------- + +// Maximum size of a file this interface will try to open (64 MB) +const DWORD MAX_FILE_SZ = 1024 * 1024 * 64; + +/*=========================================================================*/ +// cMemoryMappedFile Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cMemoryMappedFile (Public Method) + +DESCRIPTION: + Construct object/load file into memory + +PARAMETERS + pFile [ I ] - File name + +RETURN VALUE: + None +===========================================================================*/ +cMemoryMappedFile::cMemoryMappedFile( LPCSTR pFile ) + : mbResourceBased( false ), + mpBuffer( 0 ), + mFileSize( 0 ), + mStatus( ERROR_FILE_NOT_FOUND ) +{ + if (pFile == 0 || pFile[0] == 0) + { + return; + } + + // Open the file + mFile = open( pFile, O_RDONLY ); + if (mFile == -1) + { + TRACE( "Unable to Map %s to memory. Error %d: %s\n", + pFile, + errno, + strerror( errno ) ); + return; + } + + // Grab the file size + struct stat fileInfo; + if (fstat( mFile, &fileInfo ) != 0) + { + TRACE( "Unable to get info for %s. Error %d: %s\n", + pFile, + errno, + strerror( errno ) ); + return; + } + DWORD fileSize = fileInfo.st_size; + + // Map to mpBuffer + mpBuffer = mmap( 0, + fileSize, + PROT_READ, + MAP_SHARED | MAP_POPULATE, + mFile, + 0 ); + if (mpBuffer == 0 || mpBuffer == MAP_FAILED ) + { + TRACE( "Memory map failed error %d:, %s\n", + errno, + strerror( errno ) ); + return; + } + + // Success! + mFileSize = fileSize; + mStatus = NO_ERROR; +} + +/*=========================================================================== +METHOD: + cMemoryMappedFile (Public Method) + +DESCRIPTION: + Construct object/load resource based file into memory + +PARAMETERS + pStart [ I ] - Start location of object + nSize [ I ] - Size of object + +RETURN VALUE: + None +===========================================================================*/ +cMemoryMappedFile::cMemoryMappedFile( + const char * pStart, + const int nSize ) + : mbResourceBased( true ), + mpBuffer( 0 ), + mFileSize( 0 ), + mStatus( INVALID_HANDLE_VALUE ) +{ + // Set size + mFileSize = nSize; + + // Set memory pointer + mpBuffer = (void * )pStart; + + // Success! + mStatus = NO_ERROR; +} + +/*=========================================================================== +METHOD: + ~cMemoryMappedFile (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cMemoryMappedFile::~cMemoryMappedFile() +{ + if (mbResourceBased == false) + { + if (munmap( mpBuffer, mFileSize ) == -1) + { + TRACE( "Memory unmapping error %d: %s\n", + errno, + strerror( errno ) ); + return; + } + } +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/MemoryMappedFile.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/MemoryMappedFile.h new file mode 100755 index 0000000..180aa88 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/MemoryMappedFile.h @@ -0,0 +1,120 @@ +/*=========================================================================== +FILE: + MemoryMappedFile.h + +DESCRIPTION: + Declaration of cMemoryMappedFile class + +PUBLIC CLASSES AND METHODS: + cMemoryMappedFile + The cMemoryMappedFile class provides the ability to read in a file + via Linux memory maps + + Note: cMemoryMappedFiles are read only + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// Class cMemoryMappedFile +/*=========================================================================*/ +class cMemoryMappedFile +{ + public: + // Constructor (loads file) + cMemoryMappedFile( LPCSTR pFile ); + + // Constructor (loads file from resource) + cMemoryMappedFile( + const char * pStart, + const int nSize ); + + // Destructor + virtual ~cMemoryMappedFile(); + + // (Inline) Get error status + DWORD GetStatus() + { + DWORD stat = mStatus; + if (mStatus == NO_ERROR) + { + if (mpBuffer == 0 || mFileSize == 0) + { + // We failed but GetLastError() return NO_ERROR + stat = ERROR_NO_MORE_ITEMS; + } + } + + return stat; + }; + + // (Inline) Return the size of the file (contents) + ULONG GetSize() + { + ULONG sz = 0; + if (GetStatus() == NO_ERROR) + { + sz = mFileSize; + } + + return sz; + }; + + // (Inline) Return the file contents + LPVOID GetContents() + { + LPVOID pContents = 0; + if (GetStatus() == NO_ERROR) + { + pContents = mpBuffer; + } + + return pContents; + }; + + protected: + /* Resource based file? */ + bool mbResourceBased; + + /* File handle */ + int mFile; + + /* File contents*/ + LPVOID mpBuffer; + + /* File size */ + ULONG mFileSize; + + /* Error status */ + DWORD mStatus; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolBuffer.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolBuffer.cpp new file mode 100755 index 0000000..7171d62 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolBuffer.cpp @@ -0,0 +1,222 @@ +/*=========================================================================== +FILE: + ProtocolBuffer.cpp + +DESCRIPTION: + Generic protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sProtocolBuffer + Simple struct to represent a protocol buffer using a reference counted + (shared) buffer, this allows us to use in in several places without + copying it once in each place. A few base services are provided + but the main purpose is to provide a class to inherit off of for + specific protocols + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolBuffer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sProtocolBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Constructor (default) + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer() + : mpData( 0 ), + mbValid( false ) +{ + // Object is currently invalid + mTimestamp = EMPTY_TIME; +} + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Constructor (parameterized) + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the DIAG data + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer( sSharedBuffer * pBuffer ) + : mpData( 0 ), + mbValid( false ) +{ + mTimestamp = EMPTY_TIME; + + time_t rawtime; + time( &rawtime ); + tm * timestamp = localtime( &rawtime ); + if (timestamp != 0) + { + mTimestamp = *timestamp; + } + + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->Release(); + mpData = 0; + } + + mpData = pBuffer; + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + } + + // NOTE: Derived classes need to call their own validation method + // in their constructors since the override might try to access + // data that is not yet in place + sProtocolBuffer::Validate(); +} + +/*=========================================================================== +METHOD: + sProtocolBuffer (Public Method) + +DESCRIPTION: + Copy constructor + +PARAMETERS: + copyThis [ I ] - sProtocolBuffer to base the new one on + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::sProtocolBuffer( const sProtocolBuffer & copyThis ) + : mpData( copyThis.mpData ), + mTimestamp( copyThis.mTimestamp ), + mbValid( copyThis.mbValid ) +{ + // Bump reference count for shared buffer + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + mbValid = false; + } +} + +/*=========================================================================== +METHOD: + operator = (Public Method) + +DESCRIPTION: + Assignment operator + +PARAMETERS: + copyThis [ I ] - sProtocolBuffer to base the new one on + +RETURN VALUE: + sProtocolBuffer & +===========================================================================*/ +sProtocolBuffer & sProtocolBuffer::operator = ( const sProtocolBuffer & copyThis ) +{ + // Do we already have data? + if (mpData != 0) + { + // Is it different than what we are duplicating? + if (mpData != copyThis.mpData) + { + // Yes, release our current buffer + mpData->Release(); + } + } + + mpData = copyThis.mpData; + mTimestamp = copyThis.mTimestamp; + mbValid = copyThis.mbValid; + + // Bump reference count for shared buffer + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->AddRef(); + } + else + { + mpData = 0; + mbValid = false; + } + + return *this; +} + +/*=========================================================================== +METHOD: + ~sProtocolBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sProtocolBuffer::~sProtocolBuffer() +{ + if (mpData != 0 && mpData->IsValid() == true) + { + mpData->Release(); + mpData = 0; + } + else if (mpData != 0) + { + ASSERT( 0 ); + } + + mbValid = false; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolBuffer.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolBuffer.h new file mode 100755 index 0000000..1c34747 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolBuffer.h @@ -0,0 +1,162 @@ +/*=========================================================================== +FILE: + ProtocolBuffer.h + +DESCRIPTION: + Generic protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sProtocolBuffer + Simple struct to represent a protocol buffer using a reference counted + (shared) buffer, this allows us to use in in several places without + copying it once in each place. A few base services are provided + but the main purpose is to provide a class to inherit off of for + specific protocols + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "SharedBuffer.h" +#include "ProtocolEnum.h" + +static const tm EMPTY_TIME = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + +/*=========================================================================*/ +// Struct sProtocolBuffer +/*=========================================================================*/ +struct sProtocolBuffer +{ + public: + // Constructor (default) + sProtocolBuffer(); + + // Constructor (parameterized) + sProtocolBuffer( sSharedBuffer * pBuffer ); + + // Copy constructor + sProtocolBuffer( const sProtocolBuffer & copyThis ); + + // Assignment operator + sProtocolBuffer & operator = ( const sProtocolBuffer & copyThis ); + + // Destructor + virtual ~sProtocolBuffer(); + + // (Inline) Get buffer + const BYTE * GetBuffer() const + { + BYTE * pRet = 0; + if (IsValid() == true) + { + pRet = (BYTE *)mpData->GetBuffer(); + } + + return (const BYTE *)pRet; + }; + + // (Inline) Get buffer size + ULONG GetSize() const + { + ULONG size = 0; + if (IsValid() == true) + { + size = mpData->GetSize(); + } + + return size; + }; + + // (Inline) Return the protocol type + eProtocolType GetType() const + { + eProtocolType pt = ePROTOCOL_ENUM_BEGIN; + if (IsValid() == true) + { + pt = (eProtocolType)mpData->GetType(); + } + + return pt; + }; + + // (Inline) Return the shared buffer + sSharedBuffer * GetSharedBuffer() const + { + sSharedBuffer * pRet = 0; + if (IsValid() == true) + { + pRet = mpData; + } + + return pRet; + }; + + // (Inline) Return the timestamp + tm GetTimestamp() const + { + tm ft = EMPTY_TIME; + + if (IsValid() == true) + { + ft = mTimestamp; + } + + return ft; + }; + + // (Inline) Is this buffer valid? + virtual bool IsValid() const + { + return mbValid; + }; + + protected: + // (Inline) Validate buffer + virtual bool Validate() + { + // Do we have a shared buffer and is it valid? + mbValid = (mpData != 0 && mpData->IsValid()); + return mbValid; + }; + + /* Our data buffer */ + sSharedBuffer * mpData; + + /* Time buffer was created */ + tm mTimestamp; + + /* Has this buffer been validated? (NOTE: *NOT* set in base) */ + bool mbValid; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityFieldEnumerator.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityFieldEnumerator.h new file mode 100755 index 0000000..1a2743f --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityFieldEnumerator.h @@ -0,0 +1,139 @@ +/*=========================================================================== +FILE: + ProtocolEntityFieldEnumerator.h + +DESCRIPTION: + Declaration of cProtocolEntityFieldEnumerator + +PUBLIC CLASSES AND METHODS: + cProtocolEntityFieldEnumerator + Class to navigate a protoocl entity, generating a vector of + field IDs, i.e. every field referenced by this protocol entity + in the exact order it would regularly be found + + NOTE: This only functions for fixed structures such as NV items + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolEntityNav.h" +#include "DB2NavTree.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cProtocolEntityFieldEnumerator +/*=========================================================================*/ +class cProtocolEntityFieldEnumerator : public cProtocolEntityNav +{ + public: + // (Inline) Constructor + cProtocolEntityFieldEnumerator( + const cCoreDatabase & db, + const std::vector & key ) + : cProtocolEntityNav( db ), + mKey( key ) + { + // Nothing to do + }; + + // (Inline) Destructor + virtual ~cProtocolEntityFieldEnumerator() + { + // Nothing to do + }; + + // (Inline) Enumerate the fields + virtual bool Enumerate() + { + bool bRC = ProcessEntity( mKey ); + return bRC; + }; + + // (Inline) Return fields + const std::vector & GetFields() const + { + return mFields; + }; + + protected: + // (Inline) Evaluate the given condition + virtual bool EvaluateCondition( + LPCSTR /* pCondition */, + bool & bResult ) + { + // All conditions pass + bResult = true; + return bResult; + }; + + // Return the value for the specified field ID as a + // LONGLONG (field type must be able to fit) + virtual bool GetLastValue( + ULONG /* fieldID */, + LONGLONG & val ) + { + // This should only be called for figuring out array + // boundaries (including strings) + val = 1; + return true; + }; + + // Process the given field + virtual bool ProcessField( + const sDB2Field * pField, + const std::string & /* fieldName */, + LONGLONG /* arrayIndex = -1 */ ) + { + if (pField != 0) + { + mFields.push_back( pField->mID ); + } + + return true; + }; + + + /* Protocol entity being navigated */ + std::vector mKey; + + /* Fields (by ID) */ + std::vector mFields; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityNav.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityNav.cpp new file mode 100755 index 0000000..de2ea14 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityNav.cpp @@ -0,0 +1,997 @@ +/*=========================================================================== +FILE: + ProtocolEntityNav.cpp + +DESCRIPTION: + Implementation of cProtocolEntityNav + +PUBLIC CLASSES AND METHODS: + cProtocolEntityNav + This calss serves as a base for all class that need to + 'navigate' a protocol entity database description. It is + necessary in order to seperate the structural aspects + from parsing/packing details + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolEntityNav.h" +#include "BitParser.h" +#include "CoreUtilities.h" +#include "DB2NavTree.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Field seperator string +LPCSTR PE_NAV_FIELD_SEP = "."; + +/*=========================================================================*/ +// cProtocolEntityNav Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolEntityNav (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + db [ I ] - Database to use + bSummaryOnly [ I ] - Only navigate if a format specifier exists? + +RETURN VALUE: + None +===========================================================================*/ +cProtocolEntityNav::cProtocolEntityNav( const cCoreDatabase & db ) + : mDB( db ), + mbFieldNames( true ), + mConditions( db.GetOptionalMods() ), + mExpressions( db.GetExpressionMods() ), + mArrays1( db.GetArray1Mods() ), + mArrays2( db.GetArray2Mods() ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cProtocolEntityNav (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cProtocolEntityNav::~cProtocolEntityNav() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + EvaluateCondition (Internal Method) + +DESCRIPTION: + Evaluate the given condition + +PARAMETERS: + pCondition [ I ] - Condition to evaluate + bResult [ O ] - Result of evaluating the condition (true/false) + +RETURN VALUE: + bool : + true - We were able to evaluate the condition + false - Unable to evaluate condition +===========================================================================*/ +bool cProtocolEntityNav::EvaluateCondition( + LPCSTR pCondition, + bool & bResult ) +{ + // Assume error + bool bRC = false; + + tDB2OptionalModMap::const_iterator pIter; + pIter = mConditions.find( pCondition ); + + if (pIter != mConditions.end()) + { + const sDB2SimpleCondition & con = pIter->second; + + // Grab the value for the given field ID + LONGLONG valA = 0; + bRC = GetLastValue( con.mID, valA ); + + // Field to field? + LONGLONG valB = con.mValue; + if (con.mbF2F == true) + { + // Yes, grab value of the second field + bRC &= GetLastValue( (ULONG)con.mValue, valB ); + } + + if (bRC == true) + { + bResult = sDB2Fragment::EvaluateCondition( valA, + con.mOperator, + valB ); + } + else + { + // We could not find the field used in the condition, this + // can either be because of a bad entity (which is ruled + // out prior to reaching this point) or the existence of + // the field itself is based on another condition. The + // former should not happen and the later is not an error + bResult = false; + bRC = true; + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetArrayBounds (Internal Method) + +DESCRIPTION: + Get the array bounds described by the fragment descriptor + +PARAMETERS: + frag [ I ] - Fragment descriptor + arraySz [ O ] - Size of array + arrayAdj [ O ] - Adjust for array indices + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolEntityNav::GetArrayBounds( + const sDB2Fragment & frag, + LONGLONG & arraySz, + LONGLONG & arrayAdj ) +{ + // Assume failure + bool bRC = false; + + // Figure out the array size/adjust + arraySz = 0; + arrayAdj = 0; + + switch (frag.mModifierType) + { + case eDB2_MOD_CONSTANT_ARRAY: + { + tDB2Array1ModMap::const_iterator pIter; + pIter = mArrays1.find( frag.mpModifierValue ); + + if (pIter != mArrays1.end()) + { + arraySz = (LONGLONG)pIter->second; + bRC = true; + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY: + { + tDB2Array1ModMap::const_iterator pIter; + pIter = mArrays1.find( frag.mpModifierValue ); + + if (pIter != mArrays1.end()) + { + ULONG id = pIter->second; + + // Now find last occurence of this field ID and grab the value + bRC = GetLastValue( id, arraySz ); + if (bRC == true) + { + // It makes no sense to have a negative sized array + if (arraySz < 0) + { + bRC = false; + } + } + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY2: + { + tDB2Array2ModMap::const_iterator pIter; + pIter = mArrays2.find( frag.mpModifierValue ); + + if (pIter != mArrays2.end()) + { + ULONG sID = pIter->second.first; + ULONG eID = pIter->second.second; + + LONGLONG s; + LONGLONG e; + + // Now find last occurence of these field IDs and + // grab the values + bRC = GetLastValue( sID, s ); + bRC &= GetLastValue( eID, e ); + if (bRC == true) + { + // It makes no sense to have an negative sized array + if (e < s) + { + bRC = false; + } + else + { + arrayAdj = s; + arraySz = (e - s) + 1; + } + } + } + } + break; + + case eDB2_MOD_VARIABLE_ARRAY3: + { + tDB2ExpressionModMap::const_iterator pIter; + pIter = mExpressions.find( frag.mpModifierValue ); + + if (pIter != mExpressions.end()) + { + const sDB2SimpleExpression & expr = pIter->second; + + // Grab the value for the given field ID + LONGLONG valA = 0; + bRC = GetLastValue( expr.mID, valA ); + + // Field to field? + LONGLONG valB = expr.mValue; + if (expr.mbF2F == true) + { + // Yes, grab value of the second field + bRC &= GetLastValue( (ULONG)expr.mValue, valB ); + } + + if (bRC == true) + { + bRC = sDB2Fragment::EvaluateExpression( valA, + expr.mOperator, + valB, + arraySz ); + + // It makes no sense to have a negative sized array + if (bRC == true && arraySz < 0) + { + bRC = false; + } + } + } + } + break; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ModifyStringLength (Internal Method) + +DESCRIPTION: + Modify string length based on existing field value, at the end + of this function the field size will be the string length in bits + +PARAMETERS: + frag [ I ] - Fragment descriptor + field [ O ] - Field to modify + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolEntityNav::ModifyStringLength( + const sDB2Fragment & frag, + sDB2Field & field ) +{ + // Assume failure + bool bRC = false; + + if (field.mType != eDB2_FIELD_STD) + { + // Why are we here? + ASSERT( 0 ); + return false; + } + + if ( (field.mTypeVal != (ULONG)eDB2_FIELD_STDTYPE_STRING_A) + && (field.mTypeVal != (ULONG)eDB2_FIELD_STDTYPE_STRING_U) + && (field.mTypeVal != (ULONG)eDB2_FIELD_STDTYPE_STRING_U8) ) + { + // Why are we here? + ASSERT( 0 ); + return false; + } + + if ( (frag.mModifierType == eDB2_MOD_VARIABLE_STRING3) + && (field.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_U8) ) + { + // We can't have the size specified in characters when the + // size of the character itself is variable length + ASSERT( 0 ); + return false; + } + + tDB2Array1ModMap::const_iterator pIter; + pIter = mArrays1.find( frag.mpModifierValue ); + if (pIter == mArrays1.end()) + { + // Unable to obtain string length + return bRC; + } + + ULONG id = pIter->second; + + // Now find last occurence of this field ID and grab the value + LONGLONG strSz; + bRC = GetLastValue( id, strSz ); + if (bRC == false || strSz < 0) + { + // Unable to obtain size or invalid size + bRC = false; + return bRC; + } + + // Compute character size + ULONG charSz = BITS_PER_BYTE; + if (field.mTypeVal == (ULONG)eDB2_FIELD_STDTYPE_STRING_U) + { + charSz *= 2; + } + + if (frag.mModifierType == eDB2_MOD_VARIABLE_STRING2) + { + strSz *= BITS_PER_BYTE; + } + else if (frag.mModifierType == eDB2_MOD_VARIABLE_STRING3) + { + strSz *= charSz; + } + + if (strSz > ULONG_MAX) + { + // String length far too large + bRC = false; + return bRC; + } + + if (strSz != 0) + { + if (strSz < charSz || (strSz % charSz) != 0) + { + // String length not a proper multiple of character size + bRC = false; + return bRC; + } + } + + field.mSize = (ULONG)strSz; + return bRC; +} + +/*=========================================================================== +METHOD: + ProcessEntity (Internal Method) + +DESCRIPTION: + Process a protocol entity + +PARAMETERS: + key [ I ] - Key into the protocol entity table + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolEntityNav::ProcessEntity( const std::vector & key ) +{ + // Assume failure + bool bRC = false; + + // Look up entity definition + const cDB2NavTree * pNavTree = mDB.GetEntityNavTree( key ); + + // Did we find it? + if (pNavTree == 0) + { + return bRC; + } + + // Is it valid? + mEntity = pNavTree->GetEntity(); + if (mEntity.IsValid() == false) + { + // No definition in database + return bRC; + } + + // Check if we should continue + if (ContinueNavigation() == false) + { + // Success! + bRC = true; + return bRC; + } + + // A structure to navigate? + if (mEntity.mStructID == -1) + { + // Success! + bRC = true; + return bRC; + } + + // Grab navigation fragments + const std::list & frags = pNavTree->GetFragments(); + + // Nothing to navigate? + if (frags.size() == 0) + { + ASSERT( 0 ); + return bRC; + } + + // No name? + if (mEntity.mpName == 0 || mEntity.mpName[0] == 0) + { + ASSERT( 0 ); + return bRC; + } + + // Grab tracked fields + mTrackedFields = pNavTree->GetTrackedFields(); + + std::string preamble = ""; + + // Process the initial structure + EnterStruct( mEntity.mpName, -1 ); + bRC = ProcessStruct( frags.front(), preamble, -1 ); + ExitStruct( mEntity.mpName, -1 ); + + return bRC; +} + +/*=========================================================================== +METHOD: + ProcessStruct (Internal Method) + +DESCRIPTION: + Process a structure described by the given initial fragment + +PARAMETERS: + pFrag [ I ] - First fragment in structure + preamable [ I ] - String to prepend to any field/struct names + arrayIndex [ I ] - Array index (-1 = not part of an array) + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolEntityNav::ProcessStruct( + const sDB2NavFragment * pFrag, + const std::string & preamble, + LONGLONG /* arrayIndex */ ) +{ + // Assume success + bool bRC = true; + + ULONG structSz = 0; + ULONG structOffset = GetOffset(); + + // Grab current navigation order + bool bOldLSB = GetLSBMode(); + bool bNewLSB = bOldLSB; + + // Check for directives + if (pFrag != 0) + { + bool bDirective = false; + + const sDB2Fragment & frag = *pFrag->mpFragment; + if (frag.mFragmentType == eDB2_FRAGMENT_MSB_2_LSB) + { + bDirective = true; + if (bOldLSB == true) + { + bNewLSB = false; + bRC = SetLSBMode( bNewLSB ); + } + } + + if (frag.mFragmentType == eDB2_FRAGMENT_LSB_2_MSB) + { + bDirective = true; + if (bOldLSB == false) + { + bNewLSB = true; + bRC = SetLSBMode( bNewLSB ); + } + } + + if (bDirective == true) + { + // We process directives here so move on to the next fragment + // upon success + if (bRC == true) + { + pFrag = pFrag->mpNextFragment; + } + else + { + pFrag = 0; + } + } + } + + // Process each fragment in the structure + while (pFrag != 0) + { + bRC = ProcessFragment( pFrag, structOffset, structSz, preamble ); + if (bRC == true) + { + pFrag = pFrag->mpNextFragment; + } + else + { + break; + } + } + + // Restore navigation order + if (bRC == true && bOldLSB != bNewLSB) + { + bRC = SetLSBMode( bOldLSB ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ProcessFragment (Internal Method) + +DESCRIPTION: + Process the given fragment + +PARAMETERS: + pFrag [ I ] - Fragment to be processed + structOffset [ I ] - Offset (from start of payload) of enclosing struct + structSize [ I ] - Current size of enclosing struct + preamble [ I ] - String to prepend to any field/struct names + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolEntityNav::ProcessFragment( + const sDB2NavFragment * pFrag, + ULONG structOffset, + ULONG & structSize, + const std::string & preamble ) +{ + // Assume failure + bool bRC = false; + if (pFrag == 0 || pFrag->mpFragment == 0) + { + return bRC; + } + + // Grab database fragment + const sDB2Fragment & frag = *pFrag->mpFragment; + + // Is this fragment optional? + if (frag.mModifierType == eDB2_MOD_OPTIONAL) + { + bool bParse = false; + bool bOK = EvaluateCondition( frag.mpModifierValue, bParse ); + if (bOK == false) + { + // Error evaluating the condition + bRC = false; + return bRC; + } + + if (bParse == false) + { + // Condition not satisfied, nothing to parse + bRC = true; + return bRC; + } + } + + // Is this an array? + LONGLONG arraySz = -1; + LONGLONG arrayAdj = 0; + bool bArray = ModifiedToArray( frag.mModifierType ); + if (bArray == true) + { + bool bOK = GetArrayBounds( frag, arraySz, arrayAdj ); + if (bOK == false) + { + // Error obtaining array dimensions + bRC = false; + return bRC; + } + else if (arraySz == 0) + { + // No array to process + bRC = true; + return bRC; + } + } + + // Set base name + std::string baseName = ""; + if (mbFieldNames == true) + { + baseName = preamble; + + // Add in fragment name? + if (frag.mpName != EMPTY_STRING) + { + if (baseName.size() > 0) + { + baseName += PE_NAV_FIELD_SEP; + } + + // Yes, add to the preamble + baseName += frag.mpName; + } + } + + // Is this fragment offset? + if (frag.mFragmentOffset != -1) + { + // Yes, add in offset to structure offset and save + ULONG newOffset = frag.mFragmentOffset + structOffset; + SetOffset( newOffset ); + } + + // What type of fragment is this? + switch (frag.mFragmentType) + { + case eDB2_FRAGMENT_FIELD: + { + const sDB2Field * pField = pFrag->mpField; + if (pField != 0) + { + if (mbFieldNames == true) + { + if (baseName.size() > 0) + { + baseName += PE_NAV_FIELD_SEP; + } + + // Add in field name + baseName += pField->mpName; + } + + // Variable string? + sDB2Field modField; + if ( (frag.mModifierType == eDB2_MOD_VARIABLE_STRING1) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING2) + || (frag.mModifierType == eDB2_MOD_VARIABLE_STRING3) ) + { + modField = *pField; + bRC = ModifyStringLength( frag, modField ); + if (bRC == false) + { + // Unable to obtain string length + return bRC; + } + + if (modField.mSize == 0) + { + // String has no length - treat like an optional fragment + bRC = true; + return bRC; + } + + pField = &modField; + } + + // Handle an array? + if (bArray == true) + { + EnterArray( frag, arraySz ); + + if (mbFieldNames == true) + { + ULONG baseLen = baseName.size(); + + std::string fieldName; + fieldName.reserve( baseLen + 16 ); + fieldName = baseName; + + CHAR arraySpec[32]; + + for (LONGLONG i = 0; i < arraySz; i++) + { + snprintf( arraySpec, 31, "[%lld]", i + arrayAdj ); + fieldName += arraySpec; + + bRC = ProcessField( pField, fieldName, i ); + if (bRC == false) + { + break; + } + + // Remove the array specifier for the next pass + fieldName.resize( baseLen ); + } + } + else + { + for (LONGLONG i = 0; i < arraySz; i++) + { + bRC = ProcessField( pField, baseName, i ); + if (bRC == false) + { + break; + } + } + } + + ExitArray( frag, arraySz ); + } + else + { + bRC = ProcessField( pField, baseName ); + } + } + } + break; + + case eDB2_FRAGMENT_STRUCT: + { + if (pFrag->mpLinkFragment != 0) + { + // Handle an array? + if (bArray == true) + { + EnterArray( frag, arraySz ); + + if (mbFieldNames == true) + { + ULONG baseLen = baseName.size(); + + std::string structName; + structName.reserve( baseLen + 16 ); + structName = baseName; + + CHAR arraySpec[32]; + + for (LONGLONG i = 0; i < arraySz; i++) + { + snprintf( arraySpec, 31, "[%lld]", i + arrayAdj ); + structName += arraySpec; + + EnterStruct( frag.mpName, i ); + + bRC = ProcessStruct( pFrag->mpLinkFragment, + structName, + i ); + + ExitStruct( frag.mpName, i ); + + if (bRC == false) + { + break; + } + + // Remove the array specifier for the next pass + structName.resize( baseLen ); + } + } + else + { + + for (LONGLONG i = 0; i < arraySz; i++) + { + EnterStruct( frag.mpName, i ); + + bRC = ProcessStruct( pFrag->mpLinkFragment, + baseName, + i ); + + ExitStruct( frag.mpName, i ); + + if (bRC == false) + { + break; + } + } + } + + ExitArray( frag, arraySz ); + } + else + { + EnterStruct( frag.mpName, -1 ); + bRC = ProcessStruct( pFrag->mpLinkFragment, baseName ); + ExitStruct( frag.mpName, -1 ); + } + } + } + break; + + case eDB2_FRAGMENT_CONSTANT_PAD: + { + // Is the structure is smaller than the specified + // value that we are to pad out to? + ULONG totalSz = frag.mFragmentValue; + if (totalSz >= structSize) + { + ULONG newOffset = structOffset + totalSz; + SetOffset( newOffset ); + } + + // Succcess! + bRC = true; + } + break; + + case eDB2_FRAGMENT_VARIABLE_PAD_BITS: + case eDB2_FRAGMENT_VARIABLE_PAD_BYTES: + { + // Find last occurence of this field ID and grab the value + LONGLONG totalSz = 0; + bRC = GetLastValue( frag.mFragmentValue, totalSz ); + if (bRC == true) + { + // Convert to bits? + if (frag.mFragmentType == eDB2_FRAGMENT_VARIABLE_PAD_BYTES) + { + totalSz *= BITS_PER_BYTE; + } + + // Is the structure is smaller than the specified + // value that we are to pad out to? + if ((ULONG)totalSz >= structSize) + { + ULONG newOffset = structOffset + (ULONG)totalSz; + SetOffset( newOffset ); + } + } + } + break; + + case eDB2_FRAGMENT_FULL_BYTE_PAD: + { + ULONG totalSz = structSize; + while ((totalSz % BITS_PER_BYTE) != 0) + { + totalSz++; + } + + if (totalSz > structSize) + { + ULONG newOffset = structOffset + totalSz; + SetOffset( newOffset ); + } + + // Succcess! + bRC = true; + } + break; + + default: + bRC = false; + break; + } + + // Adjust struct size? + if (bRC == true) + { + ULONG newOffset = GetOffset(); + if (newOffset > structOffset) + { + ULONG newSz = newOffset - structOffset; + if (newSz > structSize) + { + structSize = newSz; + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetPartialFieldName (Public Method) + +DESCRIPTION: + Return the fully qualified field name given the partial name + +PARAMETERS: + partialName [ I ] - Partial field name + +RETURN VALUE: + std::string +===========================================================================*/ +std::string cProtocolEntityNav::GetFullFieldName( + const std::string & partialName ) const +{ + std::string retStr = EMPTY_STRING; + + if (mEntity.mpName != 0 && mEntity.mpName != EMPTY_STRING) + { + retStr = mEntity.mpName; + retStr += PE_NAV_FIELD_SEP; + retStr += partialName; + } + + return retStr; +} + +/*=========================================================================== +METHOD: + GetPartialFieldName (Public Method) + +DESCRIPTION: + Return the partial field name given the fully qualified name + +PARAMETERS: + fieldNameFQ [ I ] - Fully qualified name + +RETURN VALUE: + std::string +===========================================================================*/ +std::string cProtocolEntityNav::GetPartialFieldName( + const std::string & fieldNameFQ ) const +{ + std::string retStr = EMPTY_STRING; + + if (mEntity.mpName != 0 && mEntity.mpName != EMPTY_STRING) + { + int idx = fieldNameFQ.find( mEntity.mpName, 0 ); + if (idx == 0) + { + idx = fieldNameFQ.find( PE_NAV_FIELD_SEP ); + if (idx != -1) + { + retStr = fieldNameFQ.substr( idx - 1 ); + } + + } + } + + return retStr; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityNav.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityNav.h new file mode 100755 index 0000000..4ad8550 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEntityNav.h @@ -0,0 +1,246 @@ +/*=========================================================================== +FILE: + ProtocolEntityNav.h + +DESCRIPTION: + Declaration of cProtocolEntityNav + +PUBLIC CLASSES AND METHODS: + cProtocolEntityNav + This class serves as a base for all class that need to + 'navigate' a protocol entity database description. It is + necessary in order to seperate the structural aspects + from parsing/packing details + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "CoreDatabase.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +struct sSharedBuffer; +struct sDB2NavFragment; + +// Field seperator string +extern LPCSTR PE_NAV_FIELD_SEP; + +// Types of protocol entity field attributes +enum ePENavFieldAttr +{ + ePENAV_FIELD_BEGIN = -1, + + ePENAV_FIELD_NAME, // Name of field + ePENAV_FIELD_NAME_FULL, // Fully qualified name of field + ePENAV_FIELD_NAME_PARTIAL, // Partially qualified name of field + ePENAV_FIELD_VALUE, // Translated value of field + ePENAV_FIELD_VALUE_RAW, // Raw value of field + ePENAV_FIELD_TYPE, // Type of field + ePENAV_FIELD_SIZE, // Size of field + ePENAV_FIELD_OFFSET, // Offset of field + ePENAV_FIELD_INDEX, // Index of field + ePENAV_FIELD_ID, // ID of field + + ePENAV_FIELD_END // Number of field attributes +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + Is this a valid ePENavFieldAttr? + +PARAMETERS: + contentType [ I ] - The enum value being validated + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( ePENavFieldAttr attr ) +{ + bool bRC = false; + if (attr > ePENAV_FIELD_BEGIN && attr < ePENAV_FIELD_END) + { + bRC = true; + } + + return bRC; +}; + +/*=========================================================================*/ +// Class cProtocolEntityNav +// Class to navigate a protocol entity +/*=========================================================================*/ +class cProtocolEntityNav +{ + public: + // Constructor + cProtocolEntityNav( const cCoreDatabase & db ); + + // Destructor + virtual ~cProtocolEntityNav(); + + // Return the fully qualified field name given the partial name + virtual std::string GetFullFieldName( const std::string & partialName ) const; + + // Return the partial field name given the fully qualified name + virtual std::string GetPartialFieldName( + const std::string & fieldNameFQ ) const; + + protected: + // Evaluate the given condition + virtual bool EvaluateCondition( + LPCSTR pCondition, + bool & bResult ); + + // Get the array bounds described by the fragment descriptor + virtual bool GetArrayBounds( + const sDB2Fragment & frag, + LONGLONG & arraySz, + LONGLONG & arrayAdj ); + + // Return the value for the specified field ID as a + // LONGLONG (field type must be able to fit) + virtual bool GetLastValue( + ULONG fieldID, + LONGLONG & val ) = 0; + + // Modify string length based on existing field value + virtual bool ModifyStringLength( + const sDB2Fragment & frag, + sDB2Field & field ); + + // Process the protocol entity described by the given key/name + virtual bool ProcessEntity( const std::vector & key ); + + // (Inline) Contiue navigation now that entity has been set? + virtual bool ContinueNavigation() + { + // Override to implement + return true; + }; + + // Process a structure described by the given initial fragment + virtual bool ProcessStruct( + const sDB2NavFragment * pFrag, + const std::string & preamble, + LONGLONG arrayIndex = -1 ); + + // Process the given fragment + virtual bool ProcessFragment( + const sDB2NavFragment * pFrag, + ULONG structOffset, + ULONG & structSize, + const std::string & preamble ); + + // Process the given field + virtual bool ProcessField( + const sDB2Field * pField, + const std::string & fieldName, + LONGLONG arrayIndex = -1 ) = 0; + + // (Inline) Handle an array being entered + virtual void EnterArray( + const sDB2Fragment & /* frag */, + LONGLONG /* arraySz */ ) + { }; + + // (Inline) Handle an array being exited + virtual void ExitArray( + const sDB2Fragment & /* frag */, + LONGLONG /* arraySz */ ) + { }; + + // (Inline) Handle a structure being entered + virtual void EnterStruct( + LPCSTR /* pName */, + LONGLONG /* arrayIndex */ ) + { }; + + // (Inline) Handle a structure being exited + virtual void ExitStruct( + LPCSTR /* pName */, + LONGLONG /* arrayIndex */ ) + { }; + + // (Inline) Get current working offset + virtual ULONG GetOffset() + { + // Override to implement + return 0; + }; + + // (Inline) Set current working offset + virtual bool SetOffset( ULONG /* offset */ ) + { + // Override to implement + return true; + }; + + // (Inline) Get current navigation order + virtual bool GetLSBMode() + { + // Override to implement + return true; + }; + + // (Inline) Set current navigation order + virtual bool SetLSBMode( bool /* bLSB */ ) + { + // Override to implement + return true; + }; + + /* Generate field name strings? */ + bool mbFieldNames; + + /* Protocol entity being navigated */ + sDB2ProtocolEntity mEntity; + + /* Database reference */ + const cCoreDatabase & mDB; + + /* References to DB tables we need */ + const tDB2OptionalModMap & mConditions; + const tDB2ExpressionModMap & mExpressions; + const tDB2Array1ModMap & mArrays1; + const tDB2Array2ModMap & mArrays2; + + /* Map of all 'tracked' fields */ + std::map > mTrackedFields; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEnum.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEnum.h new file mode 100755 index 0000000..fbb50f1 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolEnum.h @@ -0,0 +1,214 @@ +/*=========================================================================== +FILE: + ProtocolEnum.h + +DESCRIPTION: + Generic protocol enumerations and related methods + +PUBLIC ENUMERATIONS AND METHODS: + eProtocolType + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +/*=========================================================================*/ +// eProtocolType Enumeration +/*=========================================================================*/ +enum eProtocolType +{ + ePROTOCOL_ENUM_BEGIN = -1, + + ePROTOCOL_COMMAND, // 00 Protocol server command + ePROTOCOL_AT, // 01 AT command protocol + ePROTOCOL_NMEA, // 02 NMEA (GPS) protocol + ePROTOCOL_DIAG_RX, // 03 DIAG protocol (incoming) + ePROTOCOL_DIAG_TX, // 04 DIAG protocol (outgoing) + ePROTOCOL_DOWNLOAD_RX, // 05 Download protocol (incoming) + ePROTOCOL_DOWNLOAD_TX, // 06 Download protocol (outgoing) + ePROTOCOL_SDOWNLOAD_RX, // 07 Streaming download protocol (incoming) + ePROTOCOL_SDOWNLOAD_TX, // 08 Streaming download protocol (outgoing) + ePROTOCOL_QDL_RX, // 09 QDL variant of streaming protocol (incoming) + ePROTOCOL_QDL_TX, // 10 QDL variant of streaming protocol (outgoing) + ePROTOCOL_QMI_CTL_RX, // 11 QMI CTL protocol (incoming) + ePROTOCOL_QMI_CTL_TX, // 12 QMI CTL protocol (outgoing) + ePROTOCOL_QMI_WDS_RX, // 13 QMI WDS protocol (incoming) + ePROTOCOL_QMI_WDS_TX, // 14 QMI WDS protocol (outgoing) + ePROTOCOL_QMI_DMS_RX, // 15 QMI DMS protocol (incoming) + ePROTOCOL_QMI_DMS_TX, // 16 QMI DMS protocol (outgoing) + ePROTOCOL_QMI_NAS_RX, // 17 QMI NAS protocol (incoming) + ePROTOCOL_QMI_NAS_TX, // 18 QMI NAS protocol (outgoing) + ePROTOCOL_QMI_QOS_RX, // 19 QMI QOS protocol (incoming) + ePROTOCOL_QMI_QOS_TX, // 20 QMI QOS protocol (outgoing) + ePROTOCOL_QMI_WMS_RX, // 21 QMI WMS protocol (incoming) + ePROTOCOL_QMI_WMS_TX, // 22 QMI WMS protocol (outgoing) + ePROTOCOL_QMI_PDS_RX, // 23 QMI PDS protocol (incoming) + ePROTOCOL_QMI_PDS_TX, // 24 QMI PDS protocol (outgoing) + ePROTOCOL_QMI_AUTH_RX, // 25 QMI AUTH protocol (incoming) + ePROTOCOL_QMI_AUTH_TX, // 26 QMI AUTH protocol (outgoing) + ePROTOCOL_QMI_CAT_RX, // 27 QMI CAT protocol (incoming) + ePROTOCOL_QMI_CAT_TX, // 28 QMI CAT protocol (outgoing) + ePROTOCOL_QMI_RMS_RX, // 29 QMI RMS protocol (incoming) + ePROTOCOL_QMI_RMS_TX, // 30 QMI RMS protocol (outgoing) + ePROTOCOL_QMI_OMA_RX, // 31 QMI OMA protocol (incoming) + ePROTOCOL_QMI_OMA_TX, // 32 QMI OMA protocol (outgoing) + ePROTOCOL_QMI_VOICE_RX, // 33 QMI Voice protocol (incoming) + ePROTOCOL_QMI_VOICE_TX, // 34 QMI Voice protocol (outgoing) + + ePROTOCOL_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eProtocolType validity check + +PARAMETERS: + pt [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eProtocolType pt ) +{ + bool retVal = false; + if (pt > ePROTOCOL_ENUM_BEGIN && pt < ePROTOCOL_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocol (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocol( eProtocolType pt ) +{ + bool retVal = false; + if (pt >= ePROTOCOL_QMI_CTL_RX && pt <= ePROTOCOL_QMI_VOICE_TX) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocolRX (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol and if so in the + incoming direction? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocolRX( eProtocolType pt ) +{ + bool retVal = false; + + switch (pt) + { + case ePROTOCOL_QMI_CTL_RX: + case ePROTOCOL_QMI_WDS_RX: + case ePROTOCOL_QMI_DMS_RX: + case ePROTOCOL_QMI_NAS_RX: + case ePROTOCOL_QMI_QOS_RX: + case ePROTOCOL_QMI_WMS_RX: + case ePROTOCOL_QMI_PDS_RX: + case ePROTOCOL_QMI_AUTH_RX: + case ePROTOCOL_QMI_CAT_RX: + case ePROTOCOL_QMI_RMS_RX: + case ePROTOCOL_QMI_OMA_RX: + case ePROTOCOL_QMI_VOICE_RX: + retVal = true; + break; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsQMIProtocolTX (Inline Method) + +DESCRIPTION: + Does the passed in value represent a QMI protocol and if so in the + outgoing direction? + +PARAMETERS: + pt [ I ] - Enum value being checked + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsQMIProtocolTX( eProtocolType pt ) +{ + bool retVal = false; + + switch (pt) + { + case ePROTOCOL_QMI_CTL_TX: + case ePROTOCOL_QMI_WDS_TX: + case ePROTOCOL_QMI_DMS_TX: + case ePROTOCOL_QMI_NAS_TX: + case ePROTOCOL_QMI_QOS_TX: + case ePROTOCOL_QMI_WMS_TX: + case ePROTOCOL_QMI_PDS_TX: + case ePROTOCOL_QMI_AUTH_TX: + case ePROTOCOL_QMI_CAT_TX: + case ePROTOCOL_QMI_RMS_TX: + case ePROTOCOL_QMI_OMA_TX: + case ePROTOCOL_QMI_VOICE_TX: + retVal = true; + break; + } + + return retVal; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolLog.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolLog.cpp new file mode 100755 index 0000000..7b6ad74 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolLog.cpp @@ -0,0 +1,190 @@ +/*=========================================================================== +FILE: + ProtocolLog.h + +DESCRIPTION: + Simple protocol 'log' class definition + +PUBLIC CLASSES AND METHODS: + cProtocolLog + This class stores protocol buffers in to a flat array (actually a + double-ended queue) so that they can be accessed by other objects + during the flow of normal processing. Note that the storage is + in-memory and therefore finite + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolLog.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// The maximum number of in-memory buffers we allow +const ULONG MAX_PROTOCOL_BUFFERS = 1024 * 16; + +/*=========================================================================*/ +// cProtocolLog Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolLog (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + maxBuffers [ I ] - Maximum number of buffers to store in the log + +RETURN VALUE: + None +===========================================================================*/ +cProtocolLog::cProtocolLog( ULONG maxBuffers ) + : mLog( maxBuffers > MAX_PROTOCOL_BUFFERS ? MAX_PROTOCOL_BUFFERS : maxBuffers, + true ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cProtocolLog (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cProtocolLog::~cProtocolLog() +{ + // Empty out the log + Clear(); +} + +/*=========================================================================== +METHOD: + AddBuffer (Public Method) + +DESCRIPTION: + Add an protocol buffer to the end of the log + +PARAMETERS: + buff [ I ] - Protocol buffer to add + +RETURN VALUE: + ULONG - Index of newly added buffer (INVALID_LOG_INDEX upon failure) +===========================================================================*/ +ULONG cProtocolLog::AddBuffer( sProtocolBuffer & buf ) +{ + ULONG idx = INVALID_LOG_INDEX; + if (buf.IsValid() == false) + { + return idx; + } + + bool bRC = mLog.AddElement( buf, idx ); + if (bRC == false) + { + idx = INVALID_LOG_INDEX; + } + + return idx; +} + +/*=========================================================================== +METHOD: + GetBuffer (Public Method) + +DESCRIPTION: + Return the protocol buffer at the given index from the log + +PARAMETERS: + idx [ I ] - Index of protocol buffer to obtain + +RETURN VALUE: + sProtocolBuffer - Protocol buffer +===========================================================================*/ +sProtocolBuffer cProtocolLog::GetBuffer( ULONG idx ) const +{ + sProtocolBuffer buf; + mLog.GetElement( idx, buf ); + return buf; +} + +/*=========================================================================== +METHOD: + GetSignalEvent (Public Method) + +DESCRIPTION: + Return the underlying signal event, which will be set when + the log is updated. + +RETURN VALUE: + cEvent - Signal event +===========================================================================*/ +cEvent & cProtocolLog::GetSignalEvent() const +{ + return mLog.GetSignalEvent(); +} + +/*=========================================================================== +METHOD: + GetCount (Public Method) + +DESCRIPTION: + Return the total number of buffers added to the log + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG cProtocolLog::GetCount() const +{ + return mLog.GetTotalCount(); +} + +/*=========================================================================== +METHOD: + Clear (Public Method) + +DESCRIPTION: + Clear the log + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolLog::Clear() +{ + mLog.EmptyQueue(); +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolLog.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolLog.h new file mode 100755 index 0000000..c0d6163 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolLog.h @@ -0,0 +1,91 @@ +/*=========================================================================== +FILE: + ProtocolLog.h + +DESCRIPTION: + Simple protocol 'log' class declaration + +PUBLIC CLASSES AND METHODS: + cProtocolLog + This class stores protocol buffers in to a flat array (actually a + double-ended queue) so that they can be accessed by other objects + during the flow of normal processing. Note that the storage is + in-memory and therefore finite + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "SyncQueue.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +const ULONG INVALID_LOG_INDEX = ULONG_MAX; + +/*=========================================================================*/ +// Class cProtocolLog +/*=========================================================================*/ +class cProtocolLog +{ + public: + // Constructor + cProtocolLog( ULONG maxBuffers ); + + // Destructor + virtual ~cProtocolLog(); + + // Add an protocol buffer to the end of the log + virtual ULONG AddBuffer( sProtocolBuffer & buf ); + + // Return the protocol buffer at the given index from the log + virtual sProtocolBuffer GetBuffer( ULONG idx ) const; + + // Return the underlying signal event + virtual cEvent & GetSignalEvent() const; + + // Return the total number of buffers added to the log + virtual ULONG GetCount() const; + + // Clear the log + virtual void Clear(); + + protected: + /* The underlying 'log' */ + cSyncQueue mLog; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolNotification.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolNotification.cpp new file mode 100755 index 0000000..92bcc68 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolNotification.cpp @@ -0,0 +1,171 @@ +/*=========================================================================== +FILE: + ProtocolNotification.cpp + +DESCRIPTION: + Implementation of cProtocolNotification base class and derivations + +PUBLIC CLASSES AND METHODS: + sProtocolNotificationEvent + Generic protocol event notification structure + + cProtocolNotification + This abstract base class provides notification of protocol server + events sent from the protocol server to protocol server clients + + cProtocolQueueNotification + This class provides notification via a cSyncQueue object + populated with sProtocolNotificationEvent objects + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "ProtocolNotification.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cProtocolQueueNotification Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pSQ [ I ] - Sync queue to utilize + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::cProtocolQueueNotification( + cSyncQueue * pSQ ) + : mpSQ( pSQ ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Copy constructor + +PARAMETERS: + notifier [ I ] - Notifier to base the new one on + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::cProtocolQueueNotification( + const cProtocolQueueNotification & notifier ) + : mpSQ( notifier.mpSQ ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cProtocolQueueNotification (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cProtocolQueueNotification::~cProtocolQueueNotification() +{ + mpSQ = 0; +} + +/*=========================================================================== +METHOD: + Clone (Public Method) + +DESCRIPTION: + Return an allocated copy of this object downcasted to our base class + +RETURN VALUE: + cProtocolNotification * : Cloned object (0 on error) +===========================================================================*/ +cProtocolNotification * cProtocolQueueNotification::Clone() const +{ + cProtocolQueueNotification * pCopy = 0; + + try + { + pCopy = new cProtocolQueueNotification( *this ); + } + catch (...) + { + // Simply return 0 + } + + return ((cProtocolNotification *)pCopy); +} + +/*=========================================================================== +METHOD: + Notify (Public Method) + +DESCRIPTION: + Notify view of a protocol event by adding notification structure to + the underlying sync queue (which will provide the notification + by signalling an event) + +PARAMETERS: + eventType [ I ] - Protocol event type + param1 [ I ] - Event type specific argument (see header description) + param2 [ I ] - Event type specific argument (see header description) + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolQueueNotification::Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const +{ + sProtocolNotificationEvent evt( eventType, param1, param2 ); + if (evt.IsValid() == true && mpSQ != 0 && mpSQ->IsValid() == true) + { + sProtocolNotificationEvent elem( eventType, param1, param2 ); + mpSQ->AddElement( elem ); + } +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolNotification.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolNotification.h new file mode 100755 index 0000000..f44d13e --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolNotification.h @@ -0,0 +1,237 @@ +/*=========================================================================== +FILE: + ProtocolNotification.h + +DESCRIPTION: + Declaration of cProtocolNotification base class and derivations + +PUBLIC CLASSES AND METHODS: + sProtocolNotificationEvent + Generic protocol event notification structure + + cProtocolNotification + This abstract base class provides notification of protocol server + events sent from the protocol server to protocol server clients + + cProtocolQueueNotification + This class provides notification via a cSyncQueue object + populated with sProtocolNotificationEvent objects + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "SyncQueue.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +enum eProtocolEventType +{ + ePROTOCOL_EVT_BEGIN = -1, + + ePROTOCOL_EVT_REQ_ERR, // There was an error sending the request + ePROTOCOL_EVT_REQ_SENT, // The request has been sent + + ePROTOCOL_EVT_RSP_ERR, // There was an error receiving the response + ePROTOCOL_EVT_RSP_RECV, // The response has been received + + ePROTOCOL_EVT_AUX_TU_SENT, // Auxiliary data transmission unit sent + + ePROTOCOL_EVT_END +}; + +// NOTE: The arguments for each event are currently as follows: +// +// ePROTOCOL_EVT_REQ_ERR +// param1: Request ID +// param2: Error code +// +// ePROTOCOL_EVT_REQ_SENT +// param1: Request ID +// param2: Index of request buffer in associated protocol log + +// ePROTOCOL_EVT_RSP_ERR +// param1: Request ID +// param2: Error code +// +// ePROTOCOL_EVT_RSP_RECV +// param1: Request ID +// param2: Index of response buffer in associated protocol log +// +// ePROTOCOL_EVT_AUX_TU_SENT +// param1: Request ID +// param2: Size of transmission unit + +// NOTE: To handle protoocl events using the Windows notifier add the following +// prototype to your Window class header file: +// +// afx_msg LRESULT OnProtocolEvent( +// WPARAM wParam, +// LPARAM lParam ); +// +// Then add an entry to the message map in your Window class source file: +// +// BEGIN_MESSAGE_MAP( CView, CChildView ) +// ON_MESSAGE( PROTOCOL_WM_BASE + (ULONG)ePROTOCOL_EVT_XXX, OnProtocolEvent ) +// END_MESSAGE_MAP() +// +// Finally write the handler itself: +// +// LRESULT CView::OnProtocolEvent( +// WPARAM wParam, +// LPARAM lParam ) +// { +// Do something +// return 0; +// } + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eProtocolEventType validity check + +PARAMETERS: + evtType [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eProtocolEventType evtType ) +{ + bool bRC = false; + if (evtType > ePROTOCOL_EVT_BEGIN && evtType < ePROTOCOL_EVT_END) + { + bRC = true; + } + + return bRC; +}; + +/*=========================================================================*/ +// Struct sProtocolNotificationEvent +/*=========================================================================*/ +struct sProtocolNotificationEvent +{ + public: + // (Inline) Default constructor (results in invalid object) + sProtocolNotificationEvent() + : mEventType( ePROTOCOL_EVT_BEGIN ), + mParam1( 0 ), + mParam2( 0 ) + { + // Nothing to do + }; + + // (Inline) Parameter constructor + sProtocolNotificationEvent( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) + : mEventType( eventType ), + mParam1( param1 ), + mParam2( param2 ) + { + // Nothing to do + }; + + // (Inline) Is this object valid? + bool IsValid() + { + return ::IsValid( mEventType ); + } + + /* Event type */ + eProtocolEventType mEventType; + + /* First parameter (see above) */ + DWORD mParam1; + + /* Second parameter (see above) */ + DWORD mParam2; +}; + +/*=========================================================================*/ +// Class cProtocolNotification +// +// This abstract base class provides notification of protocol server +// events sent from the protocol server to protocol server clients +/*=========================================================================*/ +class cProtocolNotification +{ + public: + // Return an allocated copy of this object + virtual cProtocolNotification * Clone() const = 0; + + // Notify view of a protocol event + virtual void Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const = 0; +}; + +/*=========================================================================*/ +// Class cProtocolQueueNotification +// +// This class provides notification via a cSyncQueue object +// populated with sProtocolNotificationEvent objects +/*=========================================================================*/ +class cProtocolQueueNotification : public cProtocolNotification +{ + public: + // Constructor + cProtocolQueueNotification( cSyncQueue * pSQ ); + + // Copy constructor + cProtocolQueueNotification( const cProtocolQueueNotification & notifier ); + + // Destructor + virtual ~cProtocolQueueNotification(); + + // Return a copy of this object + virtual cProtocolNotification * Clone() const; + + // Notify view of a MIS event + virtual void Notify( + eProtocolEventType eventType, + DWORD param1, + DWORD param2 ) const; + + protected: + /* Event notification queue */ + mutable cSyncQueue * mpSQ; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolRequest.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolRequest.cpp new file mode 100755 index 0000000..23069ec --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolRequest.cpp @@ -0,0 +1,254 @@ +/*=========================================================================== +FILE: + ProtocolRequest.cpp + +DESCRIPTION: + Generic protocol request/command related structures and + affliated methods, these structures are used by clients of + the protocol server to specify outgoing requests + +PUBLIC CLASSES AND METHODS: + sProtocolRequest + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" + +#include "ProtocolRequest.h" +#include "ProtocolNotification.h" +#include "ProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default protocol request timeout +const ULONG DEFAULT_REQ_TIMEOUT = 1000; + +// Minimum and maximum allowable timeout values (in milliseconds) +const ULONG MIN_REQ_TIMEOUT = 100; +const ULONG MAX_REQ_TIMEOUT = 300000; + +// Minimum number of attempts a request can be scheduled for +const ULONG MIN_REQ_ATTEMPTS = 1; + +// Value to indicate that a request is to be sent out indefinately +const ULONG INFINITE_REQS = 0xFFFFFFFF; + +// Minimum/default amount of time between repeated requests (in milliseconds) +const ULONG MIN_REQ_FREQUENCY = 10; +const ULONG DEFAULT_REQ_FREQUENCY = 100; + +/*=========================================================================*/ +// sProtocolRequest Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Parameterized constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer representing the request (must be + valid) + + schedule [ I ] - When (from now, in milliseconds) to send the first + request, this isn't a hard value as the request is + only guaranteed to go out after this time elapses + + timeout [ I ] - Milliseconds to wait for a response to an individual + request before declaring a timeout. Regardless of + what is passed in the timeout value used will be + between MIN/MAX_REQ_TIMEOUT + + requests [ I ] - Number of request attempts to make, this isn't a + retry count rather this value is used to specify + repeating requests. Regardless of what is passed in + the requests value used will be at least + MIN_REQ_ATTEMPTS + + frequency [ I ] - If the 'requests' value is greater than the + MIN_REQ_ATTEMPTS than this represents the amount of + time to wait between requests (from the completion of + the last request attempt, in milliseconds), again this + isn't a hard value. Regardless of what is passed in + the frequency value used will be at least + MIN_REQ_FREQUENCY + + pNotifier [ I ] - Status notification mechanism (may be 0) + + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( + sSharedBuffer * pBuffer, + ULONG schedule, + ULONG timeout, + ULONG requests, + ULONG frequency, + cProtocolNotification * pNotifier ) + : sProtocolBuffer( pBuffer ), + mSchedule( schedule ), + mTimeout( DEFAULT_REQ_TIMEOUT ), + mRequests( MIN_REQ_ATTEMPTS ), + mFrequency( DEFAULT_REQ_FREQUENCY ), + mpNotifier( 0 ), + mpAuxData( 0 ), + mAuxDataSize( 0 ), + mbTXOnly( false ) +{ + // Constrain requested timeout to allowable range + if (timeout < MIN_REQ_TIMEOUT) + { + timeout = MIN_REQ_TIMEOUT; + } + + if (timeout > MAX_REQ_TIMEOUT) + { + timeout = MAX_REQ_TIMEOUT; + } + + mTimeout = timeout; + + // Constrain request attempts + if (requests >= MIN_REQ_ATTEMPTS) + { + mRequests = requests; + } + + // Constrain frequency + if (frequency >= MIN_REQ_FREQUENCY) + { + mFrequency = frequency; + } + + // Clone notifier? + if (pNotifier != 0) + { + mpNotifier = pNotifier->Clone(); + } +} + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Parameterized constructor (notification with defaults) + +PARAMETERS: + pBuffer [ I ] - Shareable buffer representing the request (must be + valid) + + pNotifier [ I ] - Status notification mechanism (may be 0) + + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( + sSharedBuffer * pBuffer, + cProtocolNotification * pNotifier ) + : sProtocolBuffer( pBuffer ), + mSchedule( 0 ), + mTimeout( DEFAULT_REQ_TIMEOUT ), + mRequests( MIN_REQ_ATTEMPTS ), + mFrequency( DEFAULT_REQ_FREQUENCY ), + mpNotifier( pNotifier ), + mpAuxData( 0 ), + mAuxDataSize( 0 ), + mbTXOnly( false ) +{ + // Clone notifier? + if (pNotifier != 0) + { + mpNotifier = pNotifier->Clone(); + } + + Validate(); +} + +/*=========================================================================== +METHOD: + sProtocolRequest + +DESCRIPTION: + Copy constructor + +PARAMETERS: + req [ I ] - Request to copy + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::sProtocolRequest( const sProtocolRequest & req ) + : sProtocolBuffer( req ), + mSchedule( req.mSchedule ), + mTimeout( req.mTimeout ), + mRequests( req.mRequests ), + mFrequency( req.mFrequency ), + mpNotifier( 0 ), + mpAuxData( req.mpAuxData ), + mAuxDataSize( req.mAuxDataSize ), + mbTXOnly( req.mbTXOnly ) +{ + // Clone notifier? + if (req.mpNotifier != 0) + { + mpNotifier = req.mpNotifier->Clone(); + } + + Validate(); +} + +/*=========================================================================== +METHOD: + ~sProtocolRequest + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sProtocolRequest::~sProtocolRequest() +{ + // Delete cloned notifier? + if (mpNotifier != 0) + { + delete mpNotifier; + mpNotifier = 0; + } +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolRequest.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolRequest.h new file mode 100755 index 0000000..414e1c2 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolRequest.h @@ -0,0 +1,193 @@ +/*=========================================================================== +FILE: + ProtocolRequest.h + +DESCRIPTION: + Generic protocol request/command related structures and + affliated methods, these structures are used by clients of + the protocol server to specify outgoing protocol requests + +PUBLIC CLASSES AND METHODS: + sProtocolRequest + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +class cProtocolNotification; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default protocol request timeout +extern const ULONG DEFAULT_REQ_TIMEOUT; + +// Minimum and maximum allowable timeout values (in milliseconds) +extern const ULONG MIN_REQ_TIMEOUT; +extern const ULONG MAX_REQ_TIMEOUT; + +// Minimum number of attempts a request can be scheduled for +extern const ULONG MIN_REQ_ATTEMPTS; + +// Value to indicate that a request is to be sent out indefinately +extern const ULONG INFINITE_REQS; + +// Minimum/default amount of time between repeated requests (in milliseconds) +extern const ULONG MIN_REQ_FREQUENCY; +extern const ULONG DEFAULT_REQ_FREQUENCY; + +/*=========================================================================*/ +// Struct sProtocolRequest +// +// Structure to represent a generic request packet, including all the +// information needed to schedule the request, send the request, and +// (optionally) reschedule the request for another TX/RX attempt +// +// The default parameters schedule an immediate request (indicated by +// passing in '0' for the schedule parameter) to be sent once with +// the default timeout value +/*=========================================================================*/ +struct sProtocolRequest : public sProtocolBuffer +{ + public: + // Parameterized constructor + sProtocolRequest( + sSharedBuffer * pBuffer, + ULONG schedule = 0, + ULONG timeout = DEFAULT_REQ_TIMEOUT, + ULONG requests = MIN_REQ_ATTEMPTS, + ULONG frequency = DEFAULT_REQ_FREQUENCY, + cProtocolNotification * pNotifier = 0 ); + + // Parameterized constructor (notification with defaults) + sProtocolRequest( + sSharedBuffer * pBuffer, + cProtocolNotification * pNotifier ); + + // Copy constructor + sProtocolRequest( const sProtocolRequest & req ); + + // Destructor + virtual ~sProtocolRequest(); + + // (Inline) Get schedule value (value is in milliseconds) + ULONG GetSchedule() const + { + return mSchedule; + }; + + // (Inline) Get timeout value + ULONG GetTimeout() const + { + return mTimeout; + }; + + // (Inline) Get requests value + ULONG GetRequests() const + { + return mRequests; + }; + + // (Inline) Get frequency value (value is in milliseconds) + ULONG GetFrequency() const + { + return mFrequency; + }; + + const cProtocolNotification * GetNotifier() const + { + return mpNotifier; + }; + + // (Inline) Set auxiliary data + void SetAuxiliaryData( + const BYTE * pData, + ULONG dataSz ) + { + mpAuxData = pData; + mAuxDataSize = dataSz; + }; + + // (Inline) Get auxiliary data + const BYTE * GetAuxiliaryData( ULONG & dataSz ) const + { + dataSz = mAuxDataSize; + return mpAuxData; + }; + + // (Inline) Set TX only flag + void SetTXOnly() + { + mbTXOnly = true; + }; + + // (Inline) Get TX only flag + bool IsTXOnly() const + { + return mbTXOnly; + }; + + protected: + /* Schedule (approximately when to send the initial request) */ + ULONG mSchedule; + + /* Timeout value for receiving a response */ + ULONG mTimeout; + + /* Number of requests to schedule (must be at least one) */ + ULONG mRequests; + + /* Frequency (approximately how long to wait before next request) */ + ULONG mFrequency; + + /* Notification object */ + cProtocolNotification * mpNotifier; + + /* Auxiliary data */ + const BYTE * mpAuxData; + + /* Auxilary data size */ + ULONG mAuxDataSize; + + /* TX only (i.e. do not wait for a response) ? */ + bool mbTXOnly; +}; + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolServer.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolServer.cpp new file mode 100755 index 0000000..261289d --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolServer.cpp @@ -0,0 +1,1700 @@ +/*=========================================================================== +FILE: + ProtocolServer.cpp + +DESCRIPTION: + Generic protocol packet server + +PUBLIC CLASSES AND METHODS: + cProtocolServer + Abstract base class for protocol servers + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" + +#include "ProtocolServer.h" +#include "ProtocolNotification.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid request ID +const ULONG INVALID_REQUEST_ID = 0; + +// Default activity timeout value +const ULONG DEFAULT_WAIT = 10000; + +// MTU (Maximum Transmission Unit) for auxiliary data (QC USB imposed) +const ULONG MAX_AUX_MTU_SIZE = 1024 * 256; + +// USB's MaxPacketSize +const ULONG MAX_PACKET_SIZE = 512; + +// Maximum amount of time to wait on external access synchronization object +#ifdef DEBUG + // For the sake of debugging do not be so quick to assume failure + const ULONG DEADLOCK_TIME = 180000; +#else + const ULONG DEADLOCK_TIME = 10000; +#endif + +// Maximum amount of time to wait for the protocol server to process a command +const ULONG COMMAND_TIME = DEADLOCK_TIME; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + ScheduleThread (Free Method) + +DESCRIPTION: + Watch schedule for event to process or timeout + +PARAMETERS: + pArg [ I ] - The protocol server object + +RETURN VALUE: + void * - thread exit value (always NULL) +===========================================================================*/ +void * ScheduleThread( PVOID pArg ) +{ + // Do we have a server? + cProtocolServer * pServer = (cProtocolServer *)pArg; + if (pServer == 0) + { + TRACE( "ScheduleThread started with empty pArg." + " Unable to locate cProtocolServer\n" ); + + ASSERT( 0 ); + return NULL; + } + + TRACE( "Schedule thread [%lu] started\n", + pthread_self() ); + + // Default wait event + timespec toTime = TimeIn( DEFAULT_WAIT ); + + // Return value checking + int nRet; + + while (pServer->mbExiting == false) + { + DWORD nTemp; + nRet = pServer->mThreadScheduleEvent.Wait( TimeFromNow( toTime ), nTemp ); + if (nRet != 0 && nRet != ETIME) + { + // Error condition + TRACE( "ScheduleThread [%lu] ScheduleThread wait error %d, %s\n", + pthread_self(), + nRet, + strerror( nRet ) ); + break; + } + + // Time to exit? + if (pServer->mbExiting == true) + { + break; + } + + nRet = pthread_mutex_lock( &pServer->mScheduleMutex ); + if (nRet != 0) + { + // Error condition + TRACE( "ScheduleThread [%lu] mScheduleMutex error %d, %s\n", + pthread_self(), + nRet, + strerror( nRet ) ); + break; + } + + // Verify time. In the rare event it does move backward + // it would simply place all our schedule items as due now + pServer->CheckSystemTime(); + + // Default next wait period + toTime = TimeIn( DEFAULT_WAIT ); + + timespec curTime = TimeIn( 0 ); + + if (pServer->mpActiveRequest != 0) + { + if (pServer->mpActiveRequest->mbWaitingForResponse == true) + { + // Waiting on a response, this takes priority over the next + // scheduled event + + // Has timeout expired? + if (pServer->mActiveRequestTimeout <= curTime) + { + // Response timeout + + // Note: This may clear mpActiveRequest + pServer->RxTimeout(); + } + else + { + // Active response timer is not yet due to expire + // Default timeout again, or this response's timeout? + if (pServer->mActiveRequestTimeout <= toTime) + { + toTime = pServer->mActiveRequestTimeout; + } + } + } + else + { + // This should never happen + + TRACE( "ScheduleThread() Sequencing error: " + "Active request %lu is not waiting for response ???\n", + pServer->mpActiveRequest->mID ); + pthread_mutex_unlock( &pServer->mScheduleMutex ); + break; + } + } + + if (pServer->mpActiveRequest == 0 + && pServer->mRequestSchedule.size() > 0) + { + // No response timer active, ready to start the next + // scheduled item if due + + timespec scheduledItem = pServer->GetNextRequestTime(); + + // Is item due to be scheduled? + if (scheduledItem <= curTime) + { + // Process scheduled item + pServer->ProcessRequest(); + } + else + { + // Scheduled item is not yet due to be processed + // Default timeout again, or this item's start time? + if (scheduledItem <= toTime) + { + toTime = scheduledItem; + } + } + } + + /*TRACE( "Updated timer at %llu waiting %lu\n", + GetTickCount(), + TimeFromNow( toTime ) ); */ + + pthread_mutex_unlock( &pServer->mScheduleMutex ); + } + + TRACE( "Schedule thread [%lu] exited\n", + pthread_self() ); + + return NULL; +} + +/*=========================================================================== +METHOD: + TimeIn (Free Method) + +DESCRIPTION: + Fill timespec with the time it will be in specified milliseconds + Relative time to Absolute time + +PARAMETERS: + millis [ I ] - Milliseconds from current time + +RETURN VALUE: + timespec - resulting time (from epoc) + NOTE: tv_sec of 0 is an error +===========================================================================*/ +timespec TimeIn( ULONG millis ) +{ + timespec outTime; + + int nRC = clock_gettime( CLOCK_REALTIME, &outTime ); + if (nRC == 0) + { + // Add avoiding an overflow on (long)nsec + outTime.tv_sec += millis / 1000l; + outTime.tv_nsec += ( millis % 1000l ) * 1000000l; + + // Check if we need to carry + if (outTime.tv_nsec >= 1000000000l) + { + outTime.tv_sec += outTime.tv_nsec / 1000000000l; + outTime.tv_nsec = outTime.tv_nsec % 1000000000l; + } + } + else + { + outTime.tv_sec = 0; + outTime.tv_nsec = 0; + } + + return outTime; +} + +/*=========================================================================== +METHOD: + TimeFromNow (Free Method) + +DESCRIPTION: + Find the milliseconds from current time this timespec will occur + Absolute time to Relative time + +PARAMETERS: + time [ I ] - Absolute time + +RETURN VALUE: + Milliseconds in which absolute time will occur + 0 if time has passed or error has occured +===========================================================================*/ +ULONG TimeFromNow( timespec time ) +{ + // Assume failure + ULONG nOutTime = 0; + + timespec now; + int nRC = clock_gettime( CLOCK_REALTIME, &now ); + if (nRC == -1) + { + TRACE( "Error %d with gettime, %s\n", errno, strerror( errno ) ); + return nOutTime; + } + + if (time <= now) + { + return nOutTime; + } + + nOutTime = (time.tv_sec - now.tv_sec) * 1000l; + nOutTime += (time.tv_nsec - now.tv_nsec) / 1000000l; + + return nOutTime; +} + +/*=========================================================================== +METHOD: + GetTickCount (Free Method) + +DESCRIPTION: + Provide a number for sequencing reference, similar to the windows + ::GetTickCount(). + + NOTE: This number is based on the time since epoc, not + uptime. + +PARAMETERS: + +RETURN VALUE: + ULONGLONG - Number of milliseconds system has been up +===========================================================================*/ +ULONGLONG GetTickCount() +{ + timespec curtime = TimeIn( 0 ); + + ULONGLONG outtime = curtime.tv_sec * 1000LL; + outtime += curtime.tv_nsec / 1000000LL; + + return outtime; +} + +/*=========================================================================*/ +// cProtocolServerRxCallback Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + IOComplete (Free Method) + +DESCRIPTION: + The I/O has been completed, process the results + +PARAMETERS: + status [ I ] - Status of operation + bytesReceived [ I ] - Bytes received during operation + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServerRxCallback::IOComplete( + DWORD status, + DWORD bytesReceived ) +{ + if (mpServer != 0) + { + mpServer->RxComplete( status, bytesReceived ); + } +} + +/*=========================================================================*/ +// cProtocolServer::sProtocolReqRsp Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolServer::sProtocolReqRsp (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + requestInfo [ I ] - Underlying request object + requestID [ I ] - Request ID + auxDataMTU [ I ] - MTU (Maximum Transmission Unit) for auxiliary data + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::sProtocolReqRsp::sProtocolReqRsp( + const sProtocolRequest & requestInfo, + ULONG requestID, + ULONG auxDataMTU ) + : mRequest( requestInfo ), + mID( requestID ), + mAttempts( 0 ), + mEncodedSize( requestInfo.GetSize() ), + mRequiredAuxTxs( 0 ), + mCurrentAuxTx( 0 ), + mbWaitingForResponse( false ) +{ + ULONG auxDataSz = 0; + const BYTE * pAuxData = requestInfo.GetAuxiliaryData( auxDataSz ); + + // Compute the number of required auxiliary data transmissions? + if (auxDataMTU > 0 && pAuxData != 0 && auxDataSz > 0) + { + mRequiredAuxTxs = 1; + if (auxDataSz > auxDataMTU) + { + mRequiredAuxTxs = auxDataSz / auxDataMTU; + if ((auxDataSz % auxDataMTU) != 0) + { + mRequiredAuxTxs++; + } + } + } +} + +/*=========================================================================== +METHOD: + cProtocolServer::sProtocolReqRsp (Public Method) + +DESCRIPTION: + Coop constructor + +PARAMETERS: + reqRsp [ I ] - Object being copied + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::sProtocolReqRsp::sProtocolReqRsp( + const sProtocolReqRsp & reqRsp ) + : mRequest( reqRsp.mRequest ), + mID( reqRsp.mID ), + mAttempts( reqRsp.mAttempts ), + mEncodedSize( reqRsp.mEncodedSize ), + mRequiredAuxTxs( reqRsp.mRequiredAuxTxs ), + mCurrentAuxTx( reqRsp.mCurrentAuxTx ), + mbWaitingForResponse( reqRsp.mbWaitingForResponse ) +{ + // Nothing to do +}; + +/*=========================================================================*/ +// cProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + rxType [ I ] - Protocol type to assign to incoming data + txType [ I ] - Protocol type to verify for outgoing data + bufferSzRx [ I ] - Size of data buffer for incoming data + logSz [ I ] - Size of log (number of buffers) + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::cProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ) + : mComm(), + mRxCallback(), + mScheduleThreadID( 0 ), + mThreadScheduleEvent(), + mbExiting( false ), + mpServerControl( 0 ), + mLastRequestID( 1 ), + mpActiveRequest( 0 ), + mpRxBuffer( 0 ), + mRxBufferSize( bufferSzRx ), + mRxType( rxType ), + mTxType( txType ), + mLog( logSz ) +{ + mLastTime = TimeIn( 0 ); + + // Allocate receive buffer? + if (mRxBufferSize > 0 && mComm.IsValid() == true) + { + mpRxBuffer = new BYTE[mRxBufferSize]; + } + + // Before continuing verify receive buffer was allocated + if (mpRxBuffer != 0) + { + // Schedule mutex + int nRet = pthread_mutex_init( &mScheduleMutex, NULL ); + if (nRet != 0) + { + TRACE( "Unable to init schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + } +} + +/*=========================================================================== +METHOD: + ~cProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (destroys sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cProtocolServer::~cProtocolServer() +{ + // This should have already been called, but ... + Exit(); + + // Schedule mutex + int nRet = pthread_mutex_destroy( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to destroy schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + } + + // Free receive buffer + if (mpRxBuffer != 0) + { + delete [] mpRxBuffer; + mpRxBuffer = 0; + } +} + +/*=========================================================================== +METHOD: + HandleRemoveRequest (Public Method) + +DESCRIPTION: + Remove a previously added protocol request + + Note: if a request is being processed, it cannot be inturrupted + +PARAMETERS: + reqID [ I ] - Server assigned request ID + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::HandleRemoveRequest( ULONG reqID ) +{ + // Assume failure + bool bRC = false; + + // Find and erase request from request map + std::map ::iterator pReqIter; + pReqIter = mRequestMap.find( reqID ); + + if (pReqIter != mRequestMap.end()) + { + sProtocolReqRsp * pReqRsp = pReqIter->second; + if (pReqRsp != 0) + { + delete pReqRsp; + } + + mRequestMap.erase( pReqIter ); + + // Success! + bRC = true; + + // Find and erase request from schedule + bool bFound = false; + int entryIndex = -1; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + while (pScheduleIter != mRequestSchedule.end()) + { + entryIndex++; + + tSchedule entry = *pScheduleIter; + if (entry.second == reqID) + { + bFound = true; + mRequestSchedule.erase( pScheduleIter ); + break; + } + else + { + pScheduleIter++; + } + } + + // Note: schedule will be updated when mutex is unlocked/signaled + } + else if (mpActiveRequest != 0 && mpActiveRequest->mID == reqID) + { + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Cancel the response timer (when active) + if (mpActiveRequest->mbWaitingForResponse == true) + { + // Schedule will be updated when mutex is unlocked + + // Failure to receive response, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_ERR, + (DWORD)reqID, + ECANCELED ); + } + } + else + { + // This is the active request, cancel the underlying transmit + // Note: Because ProcessRequest and RemoveRequest are both muxed + // with ScheduleMutex, it is impossible to for the write + // to actually be in progress when this code is reached. + mComm.CancelTx(); + + // Failure to send request, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_ERR, + (DWORD)reqID, + ECANCELED ); + } + } + + // Now delete the request + delete mpActiveRequest; + mpActiveRequest = 0; + + // Success! + bRC = true; + } + else + { + TRACE( "cProtocolServer::RemoveRequest( %lu )," + " invalid request ID\n", + reqID ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ScheduleRequest (Internal Method) + +DESCRIPTION: + Schedule a request for transmission + +PARAMETERS: + reqID [ I ] - ID of the request being scheduled this ID must exist + in the internal request/schedule maps + + schedule [ I ] - Value in milliseconds that indicates the approximate + time from now that the request is to be sent out, the + actual time that the request is sent will be greater + than or equal to this value dependant on requests + scheduled before the request in question and + standard server processing time + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::ScheduleRequest( + ULONG reqID, + ULONG schedule ) +{ + // Assume failure + bool bRC = false; + + // Schedule adjust is in milliseconds + timespec schTimer = TimeIn( schedule ); + + // Create the schedule entry + tSchedule newEntry( schTimer, reqID ); + + // Fit this request into the schedule (ordered by scheduled time) + mRequestSchedule.insert( newEntry ); + + // Note: timer will be updated when mScheduleMutex is unlocked + + return bRC; +} + +/*=========================================================================== +METHOD: + RescheduleActiveRequest (Internal Method) + +DESCRIPTION: + Reschedule (or cleanup) the active request + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RescheduleActiveRequest() +{ + // Are there more attempts to be made? + if (mpActiveRequest->mAttempts < mpActiveRequest->mRequest.GetRequests()) + { + // Yes, first reset the request + mpActiveRequest->Reset(); + + // Now add it back to the request map + mRequestMap[mpActiveRequest->mID] = mpActiveRequest; + + TRACE( "RescheduleActiveRequest(): req %lu rescheduled\n", mpActiveRequest->mID ); + + // Lastly reschedule the request + ScheduleRequest( mpActiveRequest->mID, + mpActiveRequest->mRequest.GetFrequency() ); + + } + else + { + TRACE( "RescheduleActiveRequest(): req %lu removed\n", mpActiveRequest->mID ); + + // No, we are through with this request + delete mpActiveRequest; + } + + // There is no longer an active request + mpActiveRequest = 0; + +} + +/*=========================================================================== +METHOD: + ProcessRequest (Internal Method) + +DESCRIPTION: + Process a single outgoing protocol request, this consists of removing + the request ID from the head of the schedule, looking up the internal + request object in the request map, sending out the request, and setting + up the response timer (if a response is required) + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: +===========================================================================*/ +void cProtocolServer::ProcessRequest() +{ + // Is there already an active request? + if (mpActiveRequest != 0) + { + return; + } + + // Grab request ID from the schedule + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + // Did we find the request? + if (pScheduleIter == mRequestSchedule.end()) + { + // No + return; + } + + // Yes, grab the request ID + ULONG reqID = pScheduleIter->second; + + // Remove from schedule + mRequestSchedule.erase( pScheduleIter ); + + // Look up the internal request object + std::map ::iterator pReqIter; + pReqIter = mRequestMap.find( reqID ); + + // Request not found around? + if (pReqIter == mRequestMap.end() || pReqIter->second == 0) + { + // No + return; + } + + // Set this request as the active request + mpActiveRequest = pReqIter->second; + + TRACE( "ProcessRequest(): req %lu started\n", mpActiveRequest->mID ); + + // Remove request from pending request map + mRequestMap.erase( pReqIter ); + + // Extract the underlying request + const sProtocolRequest & req = mpActiveRequest->mRequest; + + // Increment attempt count? + if (req.GetRequests() != INFINITE_REQS) + { + // This request isn't an indefinite one, so keep track of each attempt + mpActiveRequest->mAttempts++; + } + + bool bTxSuccess = false; + + // Encode data for transmission? + bool bEncoded = false; + sSharedBuffer * pEncoded = 0; + pEncoded = EncodeTxData( req.GetSharedBuffer(), bEncoded ); + if (bEncoded == false) + { + // Note: no longer asynchronus + // Send the request data + bTxSuccess = mComm.TxData( req.GetBuffer(), + req.GetSize() ); + } + else if (bEncoded == true) + { + if (pEncoded != 0 && pEncoded->IsValid() == true) + { + // Note: no longer asynchronus + // Send the request data + mpActiveRequest->mEncodedSize = pEncoded->GetSize(); + bTxSuccess = mComm.TxData( pEncoded->GetBuffer(), + pEncoded->GetSize() ); + } + } + + if (bTxSuccess == true) + { + TRACE( "ProcessRequest(): req %lu finished\n", mpActiveRequest->mID ); + TxComplete(); + } + else + { + TxError(); + TRACE( "ProcessRequest(): req finished with a TxError\n" ); + } + + return; +} + +/*=========================================================================== +METHOD: + CheckSystemTime (Internal Method) + +DESCRIPTION: + Check that system time hasn't moved backwards. Since we use the system + time for scheduling requests we need to periodically check that the + user (or system itself) hasn't reset system time backwards, if it has + then we reschedule everything to the current system time. This disrupts + the schedule but avoids stranding requests + + Updates mLastTime + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + bool: System time moved backwards? +===========================================================================*/ +bool cProtocolServer::CheckSystemTime() +{ + // Assume that time is still marching forward + bool bAdjust = false; + + timespec curTime = TimeIn( 0 ); + + if (curTime < mLastTime) + { + // Looks like the system clock has been adjusted to an earlier + // value, go through the current schedule and adjust each timer + // to reflect the adjustment. This isn't an exact approach but + // it prevents requests from being stranded which is our goal + + // Note: set iterators are constant. This means we need to + // create a set with the new data, we can't modify this one + + std::set < tSchedule, std::less > tempSchedule; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + + while (pScheduleIter != mRequestSchedule.end()) + { + tSchedule entry = *pScheduleIter; + entry.first.tv_sec = curTime.tv_sec; + entry.first.tv_nsec = curTime.tv_nsec; + tempSchedule.insert( entry ); + + pScheduleIter++; + } + + mRequestSchedule = tempSchedule; + + // Update mActiveRequestTimeout + if ( (mpActiveRequest != 0) + && (mpActiveRequest->mbWaitingForResponse == true) ) + { + // Restart active request's timeout + ULONG mTimeout = mpActiveRequest->mRequest.GetTimeout(); + mActiveRequestTimeout = TimeIn( mTimeout ); + } + + TRACE( "Time has moved backwards, schedule updated\n" ); + + // Indicate the change + bAdjust = true; + } + + mLastTime.tv_sec = curTime.tv_sec; + mLastTime.tv_nsec = curTime.tv_nsec; + + return bAdjust; +} + +/*=========================================================================== +METHOD: + RxComplete (Internal Method) + +DESCRIPTION: + Handle completion of receive data operation + +PARAMETERS: + status [ I ] - Status of operation + bytesReceived [ I ] - Number of bytes received + +SEQUENCING: + This method is sequenced according to the schedule mutex + i.e. any other thread that needs to modify the schedule + will block until this method completes + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RxComplete( + DWORD status, + DWORD bytesReceived ) +{ + if (status != NO_ERROR) + { + TRACE( "cProtocolServer::RxComplete() = %lu\n", status ); + } + + // Error with the read + if (status != NO_ERROR || bytesReceived == 0) + { + // Setup the next read + mComm.RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + + return; + } + + // Get Schedule Mutex + if (GetScheduleMutex() == false) + { + TRACE( "RxComplete(), unable to get schedule Mutex\n" ); + return; + } + + TRACE( "RxComplete() - Entry at %llu\n", GetTickCount() ); + + // Decode data + bool bAbortTx = false; + ULONG rspIdx = INVALID_LOG_INDEX; + bool bRsp = DecodeRxData( bytesReceived, rspIdx, bAbortTx ); + + // Is there an active request that needs to be aborted + if (mpActiveRequest != 0 && bAbortTx == true) + { + // Yes, terminate the transmission and handle the error + mComm.CancelTx(); + TxError(); + } + // Is there an active request and a valid response? + else if (mpActiveRequest != 0 && bRsp == true) + { + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Notify client that response was received + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_RECV, + (DWORD)mpActiveRequest->mID, + (DWORD)rspIdx ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); + } + + // Setup the next read + mComm.RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + + TRACE( "RxComplete() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return; + } + + return; +} + +/*=========================================================================== +METHOD: + RxTimeout (Internal Method) + +DESCRIPTION: + Handle the response timer expiring + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::RxTimeout() +{ + // No active request? + if (mpActiveRequest == 0) + { + TRACE( "RxTimeout() with no active request\n" ); + ASSERT( 0 ); + } + + TRACE( "RxTimeout() for req %lu\n", mpActiveRequest->mID ); + + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Failure to receive response, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_RSP_ERR, + (DWORD)mpActiveRequest->mID, + (DWORD)0 ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); +} + +/*=========================================================================== +METHOD: + TxComplete (Internal Method) + +DESCRIPTION: + Handle completion of transmit data operation + +PARAMETERS: + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::TxComplete() +{ + // No active request? + if (mpActiveRequest == 0) + { + TRACE( "TxComplete() called with no active request\n" ); + ASSERT( 0 ); + } + + TRACE( "TxComplete() req %lu started\n", mpActiveRequest->mID ); + + ULONG reqID = mpActiveRequest->mID; + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Notify client of auxiliary data being sent? + if (mpActiveRequest->mRequiredAuxTxs && mpActiveRequest->mCurrentAuxTx) + { + pNotifier->Notify( ePROTOCOL_EVT_AUX_TU_SENT, + (DWORD)reqID, + (DWORD)mpActiveRequest->mEncodedSize ); + } + + // Check for more auxiliary data to transmit + if (mpActiveRequest->mCurrentAuxTx < mpActiveRequest->mRequiredAuxTxs) + { + ULONG auxDataSz = 0; + const BYTE * pAuxData = req.GetAuxiliaryData( auxDataSz ); + if (auxDataSz > 0 && pAuxData != 0) + { + bool bRC = false; + + // Adjust for current MTU + pAuxData += (mpActiveRequest->mCurrentAuxTx * MAX_AUX_MTU_SIZE); + mpActiveRequest->mCurrentAuxTx++; + + // Last MTU? + if (mpActiveRequest->mCurrentAuxTx == mpActiveRequest->mRequiredAuxTxs) + { + // More than one MTU? + if (mpActiveRequest->mRequiredAuxTxs > 1) + { + auxDataSz = (auxDataSz % MAX_AUX_MTU_SIZE); + if (auxDataSz == 0) + { + auxDataSz = MAX_AUX_MTU_SIZE; + } + } + + if (auxDataSz % MAX_PACKET_SIZE == 0) + { + // If last write of unframed write request is divisible + // by 512, break off last byte and send seperatly. + TRACE( "TxComplete() Special case, break off last byte\n" ); + + bRC = mComm.TxData( pAuxData, + auxDataSz - 1 ); + + if (bRC == true) + { + bRC = mComm.TxData( pAuxData + auxDataSz -1, + 1 ); + } + } + else + { + bRC = mComm.TxData( pAuxData, + auxDataSz ); + } + } + else if (mpActiveRequest->mRequiredAuxTxs > 1) + { + auxDataSz = MAX_AUX_MTU_SIZE; + + bRC = mComm.TxData( pAuxData, + auxDataSz ); + } + + if (bRC == true) + { + mpActiveRequest->mEncodedSize = auxDataSz; + TxComplete(); + } + else + { + TxError(); + } + + return; + } + } + + // Another successful transmission, add the buffer to the log + ULONG reqIdx = INVALID_LOG_INDEX; + + sProtocolBuffer pb( req.GetSharedBuffer() ); + reqIdx = mLog.AddBuffer( pb ); + + // Notify client? + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_SENT, (DWORD)reqID, (DWORD)reqIdx ); + } + + // Wait for a response? + if (mpActiveRequest->mRequest.IsTXOnly() == false) + { + // We now await the response + mpActiveRequest->mbWaitingForResponse = true; + mActiveRequestTimeout = TimeIn( mpActiveRequest->mRequest.GetTimeout() ); + } + else + { + // Reschedule request as needed + RescheduleActiveRequest(); + } +} + +/*=========================================================================== +METHOD: + TxError (Internal Method) + +DESCRIPTION: + Handle transmit data operation error be either rescheduling the + request or cleaning it up + +SEQUENCING: + Calling process must have lock on mScheduleMutex + +RETURN VALUE: + None +===========================================================================*/ +void cProtocolServer::TxError() +{ + // No active request? + if (mpActiveRequest == 0) + { + return; + } + + ULONG reqID = mpActiveRequest->mID; + const sProtocolRequest & req = mpActiveRequest->mRequest; + const cProtocolNotification * pNotifier = req.GetNotifier(); + + // Failure to send request, notify client + if (pNotifier != 0) + { + pNotifier->Notify( ePROTOCOL_EVT_REQ_ERR, (DWORD)reqID, (DWORD)0 ); + } + + // Reschedule request as needed + RescheduleActiveRequest(); +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the protocol server by starting up the schedule thread + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Initialize() +{ + // Assume failure + bool bRC = false; + + mbExiting = false; + + // Get mScheduleMutex + if (GetScheduleMutex() == true) + { + if (mScheduleThreadID == 0) + { + // Yes, start thread + int nRet = pthread_create( &mScheduleThreadID, + NULL, + ScheduleThread, + this ); + if (nRet == 0) + { + // Success! + bRC = true; + } + } + } + else + { + TRACE( "cProtocolServer::Initialize(), unable to aquire ScheduleMutex\n" ); + return false; + } + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return false; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Exit (Public Method) + +DESCRIPTION: + Exit the protocol server by exiting the schedule thread (if necessary) + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Exit() +{ + // Assume failure + bool bRC = false; + + if (mScheduleThreadID != 0) + { + if (GetScheduleMutex() == false) + { + // This should never happen + return false; + } + + // Set exit event + mbExiting = true; + + // Signal a schedule update + if (mThreadScheduleEvent.Set( 1 ) != 0) + { + // This should never happen + return false; + } + + TRACE( "Joining ScheduleThread\n" ); + + // Allow process to continue until it finishes + int nRet = pthread_join( mScheduleThreadID, NULL ); + if (nRet == ESRCH) + { + TRACE( "ScheduleThread has exited already\n" ); + } + else if (nRet != 0) + { + TRACE( "Unable to join ScheduleThread. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + TRACE( "cProtocolServer::Exit(), completed thread %lu\n", + (ULONG)mScheduleThreadID ); + + bRC = true; + + // Release "handle" + mScheduleThreadID = 0; + + // Release mutex lock, don't signal ScheduleThread + if (ReleaseScheduleMutex( false ) == false) + { + // This should never happen + return false; + } + } + else + { + // No ScheduleThread + bRC = true; + } + + // Free any allocated requests + std::map ::iterator pReqIter; + pReqIter = mRequestMap.begin(); + + while (pReqIter != mRequestMap.end()) + { + sProtocolReqRsp * pReqRsp = pReqIter->second; + if (pReqRsp != 0) + { + delete pReqRsp; + } + + pReqIter++; + } + + mRequestMap.clear(); + + // Free log + mLog.Clear(); + + return bRC; +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the given communications port + +PARAMETERS: + pPort [ I ] - String pointer representing the device node to + connect to (IE: /dev/qcqmi0) + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Connect( LPCSTR pPort ) +{ + // Assume failure + bool bRC = false; + if (pPort == 0 || pPort[0] == 0) + { + return bRC; + } + + // Connect to device + + // Set callback + mRxCallback.SetServer( this ); + + // Override to initialize port with protocol specific options + bRC = mComm.Connect( pPort ); + if (bRC == true) + { + bRC = InitializeComm(); + if (bRC == true) + { + // Setup the initial read + mComm.RxData( mpRxBuffer, + (ULONG)mRxBufferSize, + (cIOCallback *)&mRxCallback ); + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the current communications port + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::Disconnect() +{ + // Disconnect + + // Cancel any outstanding I/O + mComm.CancelIO(); + + // Empty callback + mRxCallback.SetServer( 0 ); + + // Cleanup COM port + CleanupComm(); + + // Now disconnect + return mComm.Disconnect(); +} + +/*=========================================================================== +METHOD: + IsConnected (Public Method) + +DESCRIPTION: + Are we currently connected to a port? + +SEQUENCING: + None + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::IsConnected() +{ + return mComm.IsConnected(); +} + +/*=========================================================================== +METHOD: + AddRequest (Public Method) + +DESCRIPTION: + Add an outgoing protocol request to the protocol server request queue + +PARAMETERS: + req [ I ] - Request being added + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + +RETURN VALUE: + ULONG - ID of scheduled request (INVALID_REQUEST_ID upon error) +===========================================================================*/ +ULONG cProtocolServer::AddRequest( const sProtocolRequest & req ) +{ + // Assume failure + ULONG reqID = INVALID_REQUEST_ID; + + // Server not configured for sending requests? + if (IsValid( mTxType ) == false) + { + return reqID; + } + + // Request type not valid for server? + if (req.GetType() != mTxType) + { + return reqID; + } + + // Invalide request? + if (ValidateRequest( req ) == false) + { + return reqID; + } + + // Get mScheduleMutex + if (GetScheduleMutex() == true) + { + TRACE( "AddRequest() - Entry at %llu\n", GetTickCount() ); + + // Grab next available request ID + if (++mLastRequestID == 0) + { + mLastRequestID++; + } + + reqID = mLastRequestID; + while (mRequestMap.find( reqID ) != mRequestMap.end()) + { + reqID++; + } + + // Wrap in our internal structure + sProtocolReqRsp * pReqRsp = 0; + pReqRsp = new sProtocolReqRsp( req, reqID, MAX_AUX_MTU_SIZE ); + + if (pReqRsp != 0) + { + // Add to request map + mRequestMap[reqID] = pReqRsp; + + // ... and schedule + ScheduleRequest( reqID, req.GetSchedule() ); + } + + TRACE( "AddRequest() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return INVALID_REQUEST_ID; + } + } + else + { + TRACE( "cProtocolServer::AddRequest(), unable to get schedule Mutex\n" ); + } + + return reqID; +} + +/*=========================================================================== +METHOD: + RemoveRequest (Public Method) + +DESCRIPTION: + Remove a previously added protocol request + +SEQUENCING: + This method is sequenced according to the schedule mutex, i.e. any + other thread that needs to modify the schedule will block until + this method completes + + Note: If a request is being written, it cannot be inturrupted as + both ProcessRequest and RemoveRequest depend on the ScheduleMutex + and the write is synchronus. If the request has been written but + the read has not been triggered it can be removed. + +PARAMETERS: + reqID [ I ] - ID of request being removed + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::RemoveRequest( ULONG reqID ) +{ + // Assume failure + bool bRC = false; + + // Get Schedule Mutex + if (GetScheduleMutex() == true) + { + TRACE( "RemoveRequest() - Entry at %llu\n", GetTickCount() ); + + bRC = HandleRemoveRequest( reqID ); + + TRACE( "RemoveRequest() - Exit at %llu\n", GetTickCount() ); + + // Unlock schedule mutex + if (ReleaseScheduleMutex() == false) + { + // This should never happen + return false; + } + } + else + { + TRACE( "cProtocolServer::RemoveRequest(), unable to get mScheduleMutex\n" ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetScheduleMutex (Internal Method) + +DESCRIPTION: + Get the schedule mutex. Additionally a check is applied to verify the + DEADLOCK_TIME was not exceeded + +SEQUENCING: + This function will block until the mScheduleMutex is aquired + +PARAMETERS: + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::GetScheduleMutex() +{ + ULONGLONG nStart = GetTickCount(); + + //TRACE( "Locking Schedule mutex\n" ); + int nRet = pthread_mutex_lock( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to lock schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + ULONGLONG nEnd = GetTickCount(); + if (nEnd - nStart > DEADLOCK_TIME) + { + TRACE( "Deadlock time exceeded: took %llu ms\n", nEnd - nStart ); + ReleaseScheduleMutex( true ); + return false; + } + + //TRACE( "Locked ScheduleMutex\n" ); + return true; +} + +/*=========================================================================== +METHOD: + ReleaseScheduleMutex (Internal Method) + +DESCRIPTION: + Release lock on the schedule mutex + +SEQUENCING: + Calling process must have lock + +PARAMETERS: + bSignalThread [ I ] - Signal Schedule thread as well? + +RETURN VALUE: + bool +===========================================================================*/ +bool cProtocolServer::ReleaseScheduleMutex( bool bSignalThread ) +{ + if (bSignalThread == true) + { + if (mThreadScheduleEvent.Set( 1 ) != 0) + { + return false; + } + } + + int nRet = pthread_mutex_unlock( &mScheduleMutex ); + if (nRet != 0) + { + TRACE( "Unable to unlock schedule mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return true; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolServer.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolServer.h new file mode 100755 index 0000000..4f8bd4c --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/ProtocolServer.h @@ -0,0 +1,351 @@ +/*=========================================================================== +FILE: + ProtocolServer.h + +DESCRIPTION: + Generic protocol packet server + +PUBLIC CLASSES AND METHODS: + cProtocolServer + Abstract base class for protocol servers + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "Comm.h" +#include "ProtocolRequest.h" +#include "ProtocolLog.h" +#include "Event.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +class cProtocolServer; +struct sServerControl; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid request ID +extern const ULONG INVALID_REQUEST_ID; + +// Fill timespec with the time it will be in specified milliseconds +// Relative time to Absolute time +timespec TimeIn( ULONG millis ); + +// Find the milliseconds from current time this timespec will occur +// Absolute time to Relative time +ULONG TimeFromNow( timespec time ); + +// Provide a number for sequencing reference, similar to the windows function +ULONGLONG GetTickCount(); + +// timespec < comparison method +inline bool operator< (const timespec & first, const timespec & second) +{ + return ( (first.tv_sec < second.tv_sec) + ||( (first.tv_sec == second.tv_sec) + &&(first.tv_nsec < second.tv_nsec) ) ); +} + +// timespec <= comparison method +inline bool operator<= (const timespec & first, const timespec & second) +{ + return ( (first.tv_sec < second.tv_sec) + ||( (first.tv_sec == second.tv_sec) + &&(first.tv_nsec <= second.tv_nsec) ) ); +} + +/*=========================================================================*/ +// Class cProtocolServerRxCallback +/*=========================================================================*/ +class cProtocolServerRxCallback +{ + public: + // (Inline) Constructor + cProtocolServerRxCallback() + : mpServer( 0 ) + { }; + + // (Inline) Destructor + virtual ~cProtocolServerRxCallback() { }; + + // (Inline) Set server object to pass results to + void SetServer( cProtocolServer * pServer ) + { + mpServer = pServer; + }; + + // The I/O has been completed, process the results + virtual void IOComplete( + DWORD status, + DWORD bytesReceived ); + + protected: + /* Protocol server to interact with */ + cProtocolServer * mpServer; +}; + +/*=========================================================================*/ +// Class cProtocolServer +/*=========================================================================*/ +class cProtocolServer +{ + public: + // Constructor + cProtocolServer( + eProtocolType rxType, + eProtocolType txType, + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cProtocolServer(); + + // Initialize the protocol server + bool Initialize(); + + // Exit the protocol server + bool Exit(); + + // Connect to the given communications port + bool Connect( LPCSTR pPort ); + + // Disconnect from target + bool Disconnect(); + + // Are we currently connected to a port? + bool IsConnected(); + + // Add an outgoing protocol request to the protocol server request queue + ULONG AddRequest( const sProtocolRequest & req ); + + // Remove a previously added protocol request + bool RemoveRequest( ULONG reqID ); + + // (Inline) Return the protocol log + const cProtocolLog & GetLog() + { + return mLog; + }; + + protected: + // Internal protocol server request/response structure, used to track + // info related to sending out a request + struct sProtocolReqRsp + { + public: + // Constructor + sProtocolReqRsp( + const sProtocolRequest & requestInfo, + ULONG requestID, + ULONG auxDataMTU ); + + // Copy constructor + sProtocolReqRsp( const sProtocolReqRsp & reqRsp ); + + // (Inline) Reset for next transmission attempt + void Reset() + { + mEncodedSize = mRequest.GetSize(); + + mCurrentAuxTx = 0; + mbWaitingForResponse = 0; + }; + + /* Request ID */ + ULONG mID; + + /* Number of times this request has been attempted */ + ULONG mAttempts; + + /* Size of encoded data being transmitted */ + ULONG mEncodedSize; + + /* Number of required auxiliary data transmissions */ + ULONG mRequiredAuxTxs; + + /* Current auxiliary data transmission */ + ULONG mCurrentAuxTx; + + /* Are we currently waiting for a response? */ + bool mbWaitingForResponse; + + /* Underlying protocol request */ + sProtocolRequest mRequest; + }; + + // Handle the remove request + bool HandleRemoveRequest( ULONG reqID ); + + // Schedule a request for transmission + bool ScheduleRequest( + ULONG reqID, + ULONG schedule ); + + // (Inline) Get next request's time from mRequestSchedule + timespec GetNextRequestTime() + { + timespec outTime; + + std::set ::iterator pScheduleIter; + pScheduleIter = mRequestSchedule.begin(); + tSchedule entry = *pScheduleIter; + + outTime = entry.first; + return outTime; + } + + // (Inline) Validate a request that is about to be scheduled + virtual bool ValidateRequest( const sProtocolRequest & req ) + { + return req.IsValid(); + }; + + // Reschedule (or cleanup) the active request + void RescheduleActiveRequest(); + + // Process a single outgoing protocol request + void ProcessRequest(); + + // Check that system time hasn't moved backwards + bool CheckSystemTime(); + + // Perform protocol specific communications port initialization + virtual bool InitializeComm() = 0; + + // Perform protocol specific communications port cleanup + virtual bool CleanupComm() = 0; + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) = 0; + + // Decode incoming data into packets returning the last response + virtual bool DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ) = 0; + + // Handle completion of receive data operation + void RxComplete( + DWORD status, + DWORD bytesReceived ); + + // Handle the response timer expiring + void RxTimeout(); + + // Handle completion of transmit data operation + virtual void TxComplete(); + + // Handle a transmission error + void TxError(); + + /* Underlying communications object */ + cComm mComm; + + /* Rx callback */ + cProtocolServerRxCallback mRxCallback; + + /* ID of Schedule thread */ + pthread_t mScheduleThreadID; + + // ScheduleThread signal event + cEvent mThreadScheduleEvent; + + // Schedule mutex + // Ensures exclusive access to mRequestSchedule + pthread_mutex_t mScheduleMutex; + + // Is the thread in the process of exiting? + // (no new commands will be accepted) + bool mbExiting; + + /* Client/server thread control object */ + sSharedBuffer * mpServerControl; + + /* Protocol request schedule (scheduled time/request ID) */ + typedef std::pair tSchedule; + std::set < tSchedule, std::less > mRequestSchedule; + + /* Last system time value (used to check for time changes) */ + timespec mLastTime; + + /* Protocol request map (request ID mapped to internal req/rsp struct) */ + std::map mRequestMap; + + /* Last assigned request ID */ + ULONG mLastRequestID; + + /* Current request being processed */ + sProtocolReqRsp * mpActiveRequest; + + /* Absolute timeout for mpActiveRequest + based on when write was completed */ + timespec mActiveRequestTimeout; + + /* Data buffer for incoming data */ + BYTE * mpRxBuffer; + + /* Size of above buffer (i.e. how much data to read in at once) */ + ULONG mRxBufferSize; + + /* Protocol type for incoming/outgoing data*/ + eProtocolType mRxType; + eProtocolType mTxType; + + /* Protocol log */ + cProtocolLog mLog; + + // Get a lock on ScheduleMutex + bool GetScheduleMutex(); + + // Release lock on ScheduleMutex + // Signal ScheduleThread if desired + bool ReleaseScheduleMutex( bool bSignalThread = true ); + + // Schedule Thread gets full access + friend void * ScheduleThread( PVOID pArg ); + + // Callback objects get full access + friend class cProtocolServerRxCallback; +}; + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLBuffers.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLBuffers.cpp new file mode 100755 index 0000000..c6e2010 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLBuffers.cpp @@ -0,0 +1,1093 @@ +/*=========================================================================== +FILE: + QDLBuffers.cpp + +DESCRIPTION: + QDL protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQDLRawHelloReq + sQDLRawHelloRsp + sQDLRawErrorRsp + sQDLRawOpenUnframedReq + sQDLRawOpenUnframedRsp + sQDLRawWriteUnframedReq + sQDLRawWriteUnframedRsp + sQDLRawDoneRsp + sQDLRawGetImagePrefRsp + sQDLRawImageID + + sQDLHello + sQDLError + sQDLOpenUnframed + sQDLWriteUnframed + sQDLDone + sQDLGetImagePref + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QDLBuffers.h" +#include "CRC.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sQDLHello Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLHello (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLHello::sQDLHello( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLHello::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLHello (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLHello::~sQDLHello() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this hello request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLHello::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX && pt != ePROTOCOL_QDL_TX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szReq = (ULONG)sizeof(sQDLRawHelloReq); + const ULONG szRsp = (ULONG)sizeof(sQDLRawHelloRsp); + + if (pt == ePROTOCOL_QDL_TX && sz == szReq) + { + const sQDLRawHelloReq * pReq = (const sQDLRawHelloReq *)GetBuffer(); + if (pReq->mCommandCode != (BYTE)eQDL_CMD_HELLO_REQ) + { + return bRC; + } + + int notEqual = memcmp( (const void *)&pReq->mMagicNumber[0], + (const void *)&QDL_HELLO_MAGIC_REQ[0], + sizeof( QDL_HELLO_MAGIC_REQ ) ); + + if (notEqual != 0) + { + return bRC; + } + + bRC = true; + } + else if (pt == ePROTOCOL_QDL_RX && sz == szRsp) + { + const sQDLRawHelloRsp * pRsp = (const sQDLRawHelloRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_HELLO_RSP) + { + return bRC; + } + + int notEqual = memcmp( (const void *)&pRsp->mMagicNumber[0], + (const void *)&QDL_HELLO_MAGIC_RSP[0], + sizeof( QDL_HELLO_MAGIC_RSP ) ); + + if (notEqual != 0) + { + return bRC; + } + + if ( (pRsp->mMaxVersion != QDL_MIN_VERSION) + || (pRsp->mMinVersion != QDL_MAX_VERSION) ) + { + return bRC; + } + + if ( ((pRsp->mFeatures & QDL_FEATURE_GENERIC_UNFRAMED) == 0) + || ((pRsp->mFeatures & QDL_FEATURE_QDL_UNFRAMED) == 0) ) + { + return bRC; + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================== +METHOD: + GetBootVersionInfo (Internal Method) + +DESCRIPTION: + Extract boot downloader version info from the response + +PARAMETERS: + major [ O ] - Major version + minor [ O ] - Minor version + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLHello::GetBootVersionInfo( + ULONG & major, + ULONG & minor ) const +{ + // Assume failure + bool bRC = false; + + major = 0; + minor = 0; + + const sQDLRawHelloRsp * pRsp = GetResponse(); + if (pRsp == 0) + { + return bRC; + } + + major = (ULONG)pRsp->mBootMajorVersion; + minor = (ULONG)pRsp->mBootMinorVersion; + + bRC = true; + return bRC; +} + +/*=========================================================================== +METHOD: + BuildHelloReq (Static Public Method) + +DESCRIPTION: + Build a hello request + +PARAMETERS: + bBARMode [ O ] - Request boot and recovery mode feature + +RETURN VALUE: + sSharedBuffer * : The request in an allocated buffer (0 on error) +===========================================================================*/ +sSharedBuffer * sQDLHello::BuildHelloReq( bool bBARMode ) +{ + const ULONG sz = (ULONG)sizeof(sQDLRawHelloReq); + BYTE req[sz]; + + sQDLRawHelloReq * pReq = (sQDLRawHelloReq *)&req[0]; + + pReq->mCommandCode = (BYTE)eQDL_CMD_HELLO_REQ; + pReq->mMaxVersion = QDL_MIN_VERSION; + pReq->mMinVersion = QDL_MAX_VERSION; + pReq->mFeatures = QDL_FEATURE_GENERIC_UNFRAMED | QDL_FEATURE_QDL_UNFRAMED; + + if (bBARMode == true) + { + pReq->mFeatures |= QDL_FEATURE_BAR_MODE; + } + + memcpy( (PVOID)&pReq->mMagicNumber[0], + (const VOID *)&QDL_HELLO_MAGIC_REQ[0], + (SIZE_T)32 ); + + eProtocolType pt = ePROTOCOL_QDL_TX; + sSharedBuffer * pRetBuf = new sSharedBuffer( (const BYTE *)req, sz, pt ); + return pRetBuf; +} + +/*=========================================================================*/ +// sQDLError Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLError (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLError::sQDLError( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLError::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLError (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLError::~sQDLError() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this session done request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLError::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szRsp = (ULONG)sizeof( sQDLRawErrorRsp ); + + if (sz >= szRsp) + { + const sQDLRawErrorRsp * pRsp = 0; + pRsp = (const sQDLRawErrorRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_ERROR) + { + return bRC; + } + + // Error code needs to be valid + if (::IsValid( (eQDLError)pRsp->mErrorCode ) == false) + { + return bRC; + } + + // Error text needs to be NULL terminated + const BYTE * pTmp = GetBuffer(); + if (pTmp[sz - 1] != 0) + { + return bRC; + } + + // What there is of the error text needs to be printable + pTmp = &pRsp->mErrorText; + while (*pTmp != 0) + { + int val = (int)*pTmp++; + if (isprint( (int)val ) == 0) + { + return bRC; + } + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================*/ +// sQDLOpenUnframed Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLOpenUnframed (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLOpenUnframed::sQDLOpenUnframed( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLOpenUnframed::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLOpenUnframed (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLOpenUnframed::~sQDLOpenUnframed() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this open unframed request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLOpenUnframed::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX && pt != ePROTOCOL_QDL_TX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szReq = (ULONG)sizeof(sQDLRawOpenUnframedReq); + const ULONG szRsp = (ULONG)sizeof(sQDLRawOpenUnframedRsp); + + if (pt == ePROTOCOL_QDL_TX && sz == szReq) + { + const sQDLRawOpenUnframedReq * pReq = 0; + pReq = (const sQDLRawOpenUnframedReq *)GetBuffer(); + if (pReq->mCommandCode != (BYTE)eQDL_CMD_OPEN_UNFRAMED_REQ) + { + return bRC; + } + + if (::IsValid( (eQDLImageType)pReq->mImageType ) == false) + { + return bRC; + } + + if (pReq->mWindowSize != 1) + { + return bRC; + } + + bRC = true; + } + else if (pt == ePROTOCOL_QDL_RX && sz == szRsp) + { + const sQDLRawOpenUnframedRsp * pRsp = 0; + pRsp = (const sQDLRawOpenUnframedRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_OPEN_UNFRAMED_RSP) + { + return bRC; + } + + if (pRsp->mWindowSize != 1) + { + return bRC; + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================== +METHOD: + GetChunkSize (Internal Method) + +DESCRIPTION: + Extract chunk size info from the response + +PARAMETERS: + chunkSize [ O ] - Target supported chunk size + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLOpenUnframed::GetChunkSize( ULONG & chunkSize ) const +{ + // Assume failure + bool bRC = false; + + chunkSize = 0; + + const sQDLRawOpenUnframedRsp * pRsp = GetResponse(); + if (pRsp == 0) + { + return bRC; + } + + chunkSize = (ULONG)pRsp->mUnframedChunkSize; + + bRC = true; + return bRC; +} + +/*=========================================================================== +METHOD: + BuildOpenUnframedReq (Static Public Method) + +DESCRIPTION: + Build an open image for unframed write request + +PARAMETERS: + imageType [ I ] - Type of image about to be written + imageSize [ I ] - Size of image about to be written + chunkSize [ I ] - Desired size of chunk for each write + +RETURN VALUE: + sSharedBuffer * : The request in an allocated buffer (0 on error) +===========================================================================*/ +sSharedBuffer * sQDLOpenUnframed::BuildOpenUnframedReq( + eQDLImageType imageType, + ULONG imageSize, + ULONG chunkSize ) +{ + sSharedBuffer * pRetBuf = 0; + if (::IsValid( imageType ) == false) + { + return pRetBuf; + } + + // We can not write out chunks larger than the maximum + if (chunkSize > QDL_MAX_CHUNK_SIZE) + { + return pRetBuf; + } + + const ULONG sz = (ULONG)sizeof(sQDLRawOpenUnframedReq); + BYTE req[sz]; + + memset( (LPVOID)&req[0], 0, (SIZE_T)sz ); + + sQDLRawOpenUnframedReq * pReq = (sQDLRawOpenUnframedReq *)&req[0]; + + pReq->mCommandCode = (BYTE)eQDL_CMD_OPEN_UNFRAMED_REQ; + pReq->mImageType = (BYTE)imageType; + pReq->mImageLength = (DWORD)imageSize; + pReq->mWindowSize = 1; + pReq->mUnframedChunkSize = chunkSize; + + eProtocolType pt = ePROTOCOL_QDL_TX; + pRetBuf = new sSharedBuffer( (const BYTE *)req, sz, pt ); + return pRetBuf; +} + +/*=========================================================================*/ +// sQDLWriteUnframed Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLWriteUnframed (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLWriteUnframed::sQDLWriteUnframed( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLWriteUnframed::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLWriteUnframed (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLWriteUnframed::~sQDLWriteUnframed() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this unframed write request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLWriteUnframed::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX && pt != ePROTOCOL_QDL_TX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szReq = (ULONG)sizeof( sQDLRawWriteUnframedReq ); + const ULONG szRsp = (ULONG)sizeof( sQDLRawWriteUnframedRsp ); + + if (pt == ePROTOCOL_QDL_TX && sz == szReq) + { + const sQDLRawWriteUnframedReq * pReq = 0; + pReq = (const sQDLRawWriteUnframedReq *)GetBuffer(); + if (pReq->mCommandCode != (BYTE)eQDL_CMD_WRITE_UNFRAMED_REQ) + { + return bRC; + } + + bRC = CheckCRC( GetBuffer(), szReq - sizeof( USHORT ) ); + } + else if (pt == ePROTOCOL_QDL_RX && sz == szRsp) + { + const sQDLRawWriteUnframedRsp * pRsp = 0; + pRsp = (const sQDLRawWriteUnframedRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_WRITE_UNFRAMED_RSP) + { + return bRC; + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================== +METHOD: + GetSequenceNumber (Internal Method) + +DESCRIPTION: + Extract sequence number from the response + +PARAMETERS: + sequenceNumber [ O ] - Target reported sequence number + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLWriteUnframed::GetSequenceNumber( ULONG & sequenceNumber ) const +{ + // Assume failure + bool bRC = false; + + sequenceNumber = 0; + + const sQDLRawWriteUnframedRsp * pRsp = GetResponse(); + if (pRsp == 0) + { + return bRC; + } + + sequenceNumber = (ULONG)pRsp->mSequenceNumber; + + bRC = true; + return bRC; +} + +/*=========================================================================== +METHOD: + BuildWriteUnframedReq (Static Public Method) + +DESCRIPTION: + Build an unframed write request + +PARAMETERS: + sequenceNumber [ I ] - Type of image about to be written + chunkSize [ I ] - Size of chunk being written + +RETURN VALUE: + sSharedBuffer * : The request in an allocated buffer (0 on error) +===========================================================================*/ +sSharedBuffer * sQDLWriteUnframed::BuildWriteUnframedReq( + USHORT sequenceNumber, + ULONG chunkSize ) +{ + sSharedBuffer * pRetBuf = 0; + + // We can not write out chunks larger than the maximum + if (chunkSize == 0 || chunkSize > (ULONG)QDL_MAX_CHUNK_SIZE) + { + return pRetBuf; + } + + const ULONG sz = (ULONG)sizeof(sQDLRawWriteUnframedReq); + BYTE req[sz]; + + memset( (LPVOID)&req[0], 0, (SIZE_T)sz ); + + sQDLRawWriteUnframedReq * pReq = (sQDLRawWriteUnframedReq *)&req[0]; + + pReq->mCommandCode = (BYTE)eQDL_CMD_WRITE_UNFRAMED_REQ; + pReq->mSequenceNumber = (WORD)sequenceNumber; + pReq->mUnframedChunkSize = (DWORD)chunkSize; + SetCRC( req, sz - sizeof( USHORT ) ); + + eProtocolType pt = ePROTOCOL_QDL_TX; + pRetBuf = new sSharedBuffer( (const BYTE *)req, sz, pt ); + return pRetBuf; +} + +/*=========================================================================== +METHOD: + BuildWriteUnframedReqs (Static Public Method) + +DESCRIPTION: + Build list of unframed write requests from the given parameters + +PARAMETERS: + chunkSize [ I ] - Size to write in each request + dataLen [ I ] - Total number of bytes to write + +RETURN VALUE: + std::list : The requests in allocated buffers (the + list is empty on error) +===========================================================================*/ +std::list sQDLWriteUnframed::BuildWriteUnframedReqs( + ULONG chunkSize, + ULONG totalSize ) +{ + std::list retList; + + // Check length (in bytes) is acceptable + if (chunkSize == 0 || chunkSize > QDL_MAX_CHUNK_SIZE) + { + return retList; + } + + ULONG writes = 1; + ULONG rem = totalSize; + + // Will we need more than one write request? + if (totalSize > chunkSize) + { + writes = totalSize / chunkSize; + rem = totalSize % chunkSize; + + // Total size is a multiple of chunk size? + if (rem == 0) + { + // Yes, the remainder will be the block size + rem = chunkSize; + } + else + { + // No, we need an extra write for the remainder + writes++; + } + } + + ULONG blockSz = chunkSize; + if (writes == 1) + { + blockSz = rem; + } + + // Generate first request + USHORT seqNum = 0; + sSharedBuffer * pReq = 0; + pReq = sQDLWriteUnframed::BuildWriteUnframedReq( seqNum++, blockSz ); + if (pReq != 0) + { + retList.push_back( pReq ); + } + + // Generate remaining requests + for (UINT b = 1; b < writes; b++) + { + blockSz = chunkSize; + if (b == writes - 1) + { + blockSz = rem; + } + + pReq = sQDLWriteUnframed::BuildWriteUnframedReq( seqNum++, blockSz ); + if (pReq != 0) + { + retList.push_back( pReq ); + } + } + + // Errors? + if (retList.size() != writes) + { + // Free up all our hard work + std::list ::const_iterator pIter = retList.begin(); + while (pIter != retList.end()) + { + delete [] *pIter; + pIter++; + } + + retList.clear(); + } + + return retList; +} + +/*=========================================================================*/ +// sQDLDone Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLDone (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLDone::sQDLDone( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLDone::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLDone (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLDone::~sQDLDone() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this session done request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLDone::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX && pt != ePROTOCOL_QDL_TX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szReq = (ULONG)sizeof( BYTE ); + const ULONG szRsp = (ULONG)sizeof( sQDLRawDoneRsp ); + + if (pt == ePROTOCOL_QDL_TX && sz == szReq) + { + const BYTE * pReq = GetBuffer(); + if (*pReq != (BYTE)eQDL_CMD_SESSION_DONE_REQ) + { + return bRC; + } + + bRC = true; + } + else if (pt == ePROTOCOL_QDL_RX && sz >= szRsp) + { + const sQDLRawDoneRsp * pRsp = 0; + pRsp = (const sQDLRawDoneRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_SESSION_DONE_RSP) + { + return bRC; + } + + // Status needs to be valid + if (::IsValid( (eQDLDoneStatus)pRsp->mStatus ) == false) + { + return bRC; + } + + // For success the error text should be NULL + if ( (pRsp->mStatus == (WORD)eQDL_DONE_STATUS_SUCCESS) + && (sz != szRsp || pRsp->mErrorText != 0) ) + { + return bRC; + } + + if (pRsp->mStatus != (WORD)eQDL_DONE_STATUS_SUCCESS) + { + // Error text needs to be NULL terminated + const BYTE * pTmp = GetBuffer(); + if (pTmp[sz - 1] != 0) + { + return bRC; + } + + // What there is of the error text needs to be printable + pTmp = &pRsp->mErrorText; + while (*pTmp != 0) + { + int val = (int)*pTmp++; + if (isprint( (int)val ) == 0) + { + return bRC; + } + } + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================*/ +// sQDLGetImagePref Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQDLGetImagePref (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the QDL data + +RETURN VALUE: + None +===========================================================================*/ +sQDLGetImagePref::sQDLGetImagePref( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQDLGetImagePref::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQDLGetImagePref (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQDLGetImagePref::~sQDLGetImagePref() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this get image preference request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQDLGetImagePref::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (pt != ePROTOCOL_QDL_RX && pt != ePROTOCOL_QDL_TX) + { + mbValid = bRC; + return bRC; + } + + ULONG sz = GetSize(); + const ULONG szReq = (ULONG)sizeof( BYTE ); + const ULONG szRsp = (ULONG)sizeof( sQDLRawGetImagePrefRsp ); + + if (pt == ePROTOCOL_QDL_TX && sz == szReq) + { + const BYTE * pReq = GetBuffer(); + if (*pReq != (BYTE)eQDL_CMD_GET_IMAGE_PREF_REQ) + { + return bRC; + } + + bRC = true; + } + else if (pt == ePROTOCOL_QDL_RX && sz >= szRsp) + { + const sQDLRawGetImagePrefRsp * pRsp = 0; + pRsp = (const sQDLRawGetImagePrefRsp *)GetBuffer(); + if (pRsp->mCommandCode != (BYTE)eQDL_CMD_GET_IMAGE_PREF_RSP) + { + return bRC; + } + + BYTE entries = pRsp->mEntries; + ULONG needSz = szRsp + (ULONG)entries * (ULONG)sizeof( sQDLRawImageID ); + if (sz != needSz) + { + return bRC; + } + + // Skip response header + pRsp++; + + // Validate image IDs + const sQDLRawImageID * pID = (const sQDLRawImageID *)pRsp; + for (BYTE e = 0; e < entries; e++) + { + sQDLRawImageID imagePref = *pID++; + if (::IsValid( (eQDLImageType)imagePref.mImageType) == false) + { + return bRC; + } + } + + bRC = true; + } + + mbValid = bRC; + return mbValid; +} + +/*=========================================================================== +METHOD: + GetImageIDs (Public Method) + +DESCRIPTION: + Return image IDs + +RETURN VALUE: + std::list +===========================================================================*/ +std::list sQDLGetImagePref::GetImageIDs() const +{ + // Assume failure + std::list retIDs; + + const sQDLRawGetImagePrefRsp * pRsp = GetResponse(); + if (pRsp == 0) + { + return retIDs; + } + + BYTE entries = pRsp->mEntries; + if (entries == 0) + { + return retIDs; + } + + // Skip response header + pRsp++; + + const sQDLRawImageID * pID = (const sQDLRawImageID *)pRsp; + for (BYTE e = 0; e < entries; e++) + { + retIDs.push_back( *pID++ ); + } + + return retIDs; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLBuffers.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLBuffers.h new file mode 100755 index 0000000..cf6f1af --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLBuffers.h @@ -0,0 +1,716 @@ +/*=========================================================================== +FILE: + QDLBuffers.h + +DESCRIPTION: + QDL protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQDLRawHelloReq + sQDLRawHelloRsp + sQDLRawErrorRsp + sQDLRawOpenUnframedReq + sQDLRawOpenUnframedRsp + sQDLRawWriteUnframedReq + sQDLRawWriteUnframedRsp + sQDLRawDoneRsp + sQDLRawGetImagePrefRsp + sQDLRawImageID + + sQDLHello + sQDLError + sQDLOpenUnframed + sQDLWriteUnframed + sQDLDone + sQDLGetImagePref + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "QDLEnum.h" + +#include + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sQDLRawHelloReq +// Struct to represent a QDL hello request (raw) +/*=========================================================================*/ +struct sQDLRawHelloReq +{ + public: + BYTE mCommandCode; + BYTE mMagicNumber[32]; + BYTE mMaxVersion; + BYTE mMinVersion; + BYTE mFeatures; +}; + +/*=========================================================================*/ +// Struct sQDLRawHelloRsp +// Struct to represent a QDL hello response (raw) +/*=========================================================================*/ +struct sQDLRawHelloRsp +{ + public: + BYTE mCommandCode; + BYTE mMagicNumber[24]; + DWORD mReserved1; + WORD mBootMajorVersion; + WORD mBootMinorVersion; + BYTE mMaxVersion; + BYTE mMinVersion; + DWORD mReserved2; + DWORD mReserved3; + BYTE mReserved4; + WORD mReserved5; + WORD mReserved6; + BYTE mFeatures; +}; + +/*=========================================================================*/ +// Struct sQDLRawErrorRsp +// Struct to represent a QDL error response (raw) +/*=========================================================================*/ +struct sQDLRawErrorRsp +{ + public: + BYTE mCommandCode; + DWORD mErrorCode; + BYTE mErrorText; +}; + +/*=========================================================================*/ +// Struct sQDLRawOpenUnframedReq +// Struct to represent a QDL open unframed image write request (raw) +/*=========================================================================*/ +struct sQDLRawOpenUnframedReq +{ + public: + BYTE mCommandCode; + BYTE mImageType; + DWORD mImageLength; + BYTE mWindowSize; + DWORD mUnframedChunkSize; + WORD mReserved1; +}; + +/*=========================================================================*/ +// Struct sQDLRawOpenUnframedRsp +// Struct to represent a QDL open unframed image write response (raw) +/*=========================================================================*/ +struct sQDLRawOpenUnframedRsp +{ + public: + BYTE mCommandCode; + WORD mStatus; + BYTE mWindowSize; + DWORD mUnframedChunkSize; +}; + +/*=========================================================================*/ +// Struct sQDLRawWriteUnframedReq +// Struct to represent a QDL unframed image write request (raw) +/*=========================================================================*/ +struct sQDLRawWriteUnframedReq +{ + public: + BYTE mCommandCode; + WORD mSequenceNumber; + DWORD mReserved; + DWORD mUnframedChunkSize; + WORD mCRC; +}; + +/*=========================================================================*/ +// Struct sQDLRawWriteUnframedRsp +// Struct to represent a QDL unframed image write response (raw) +/*=========================================================================*/ +struct sQDLRawWriteUnframedRsp +{ + public: + BYTE mCommandCode; + WORD mSequenceNumber; + DWORD mReserved; + WORD mStatus; +}; + +/*=========================================================================*/ +// Struct sQDLRawDoneRsp +// Struct to represent a QDL session done response (raw) +/*=========================================================================*/ +struct sQDLRawDoneRsp +{ + public: + BYTE mCommandCode; + WORD mStatus; + BYTE mImageType; + BYTE mErrorText; +}; + +/*=========================================================================*/ +// Struct sQDLRawGetImagePrefRsp +// Struct to represent a QDL get image preference response (raw) +/*=========================================================================*/ +struct sQDLRawGetImagePrefRsp +{ + public: + BYTE mCommandCode; + BYTE mEntries; + + // Array of sQDLRawImageID follows (sized by mEntries) +}; + +/*=========================================================================*/ +// Struct sQDLRawImageID +// Struct to represent a QDL image ID (raw) +/*=========================================================================*/ +struct sQDLRawImageID +{ + public: + BYTE mImageType; + BYTE mImageID[16]; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + + +/*=========================================================================*/ +// Struct sQDLHello +// Struct to represent a QDL hello request/response (shared buffer) +/*=========================================================================*/ +struct sQDLHello : public sProtocolBuffer +{ + public: + // Constructor + sQDLHello( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLHello(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bRequest = (pBuf[0] == (BYTE)eQDL_CMD_HELLO_REQ); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bResponse = (pBuf[0] == (BYTE)eQDL_CMD_HELLO_RSP); + } + + return bResponse; + }; + + // (Inline) Return raw request + const sQDLRawHelloReq * GetRequest() const + { + const sQDLRawHelloReq * pReq = 0; + if (IsRequest() == true) + { + pReq = (const sQDLRawHelloReq *)GetBuffer(); + } + + return pReq; + }; + + // (Inline) Return raw response + const sQDLRawHelloRsp * GetResponse() const + { + const sQDLRawHelloRsp * pRsp = 0; + if (IsResponse() == true) + { + pRsp = (const sQDLRawHelloRsp *)GetBuffer(); + } + + return pRsp; + }; + + // Extract boot downloader version info from the response + bool GetBootVersionInfo( + ULONG & major, + ULONG & minor ) const; + + // Build a hello request + static sSharedBuffer * BuildHelloReq( bool bBARMode = false ); + + protected: + // Is this hello request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLHello( const sProtocolBuffer & ); + sQDLHello & operator = ( const sProtocolBuffer & ); +}; + +/*=========================================================================*/ +// Struct sQDLError +// Struct to represent a QDL error response (shared buffer) +/*=========================================================================*/ +struct sQDLError : public sProtocolBuffer +{ + public: + // Constructor + sQDLError( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLError(); + + // (Inline) Return raw response + const sQDLRawErrorRsp * GetResponse() const + { + const sQDLRawErrorRsp * pRsp = 0; + if (IsValid() == true) + { + pRsp = (const sQDLRawErrorRsp *)GetBuffer(); + } + + return pRsp; + }; + + // (Inline) Return the (validated) error code + eQDLError GetErrorCode() const + { + eQDLError err = eQDL_ERROR_ENUM_BEGIN; + + const sQDLRawErrorRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + err = (eQDLError)pRsp->mErrorCode; + } + + return err; + }; + + // (Inline) Return the error text string + LPCSTR GetError() const + { + LPCSTR pErr = 0; + + const sQDLRawErrorRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + pErr = (LPCSTR)&pRsp->mErrorText; + } + + return pErr; + }; + + protected: + // Is this session done request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLError( const sProtocolBuffer & ); + sQDLError & operator = ( const sProtocolBuffer & ); +}; + +/*=========================================================================*/ +// Struct sQDLOpenUnframed +// Struct to represent a QDL open image for unframed write +// request/response (shared buffer) +/*=========================================================================*/ +struct sQDLOpenUnframed : public sProtocolBuffer +{ + public: + // Constructor + sQDLOpenUnframed( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLOpenUnframed(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bRequest = (pBuf[0] == (BYTE)eQDL_CMD_OPEN_UNFRAMED_REQ); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bResponse = (pBuf[0] == (BYTE)eQDL_CMD_OPEN_UNFRAMED_RSP); + } + + return bResponse; + }; + + // (Inline) Return raw request + const sQDLRawOpenUnframedReq * GetRequest() const + { + const sQDLRawOpenUnframedReq * pReq = 0; + if (IsRequest() == true) + { + pReq = (const sQDLRawOpenUnframedReq *)GetBuffer(); + } + + return pReq; + }; + + // (Inline) Return raw response + const sQDLRawOpenUnframedRsp * GetResponse() const + { + const sQDLRawOpenUnframedRsp * pRsp = 0; + if (IsResponse() == true) + { + pRsp = (const sQDLRawOpenUnframedRsp *)GetBuffer(); + } + + return pRsp; + }; + + // (Inline) Does the response indicate success? + bool IsSuccess() const + { + bool bSuccess = false; + + const sQDLRawOpenUnframedRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + bSuccess = (pRsp->mStatus == eQDL_OPEN_STATUS_SUCCESS); + } + + return bSuccess; + }; + + // Extract supported chunk size from the response + bool GetChunkSize( ULONG & chunkSize ) const; + + // Build an open image for unframed write request + static sSharedBuffer * BuildOpenUnframedReq( + eQDLImageType imageType, + ULONG imageSize, + ULONG chunkSize ); + + protected: + // Is this open unframed request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLOpenUnframed( const sProtocolBuffer & ); + sQDLOpenUnframed & operator = ( const sProtocolBuffer & ); +}; + +/*=========================================================================*/ +// Struct sQDLWriteUnframed +// Struct to represent a QDL unframed write of an image +// request/response (shared buffer) +/*=========================================================================*/ +struct sQDLWriteUnframed : public sProtocolBuffer +{ + public: + // Constructor + sQDLWriteUnframed( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLWriteUnframed(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bRequest = (pBuf[0] == (BYTE)eQDL_CMD_WRITE_UNFRAMED_REQ); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bResponse = (pBuf[0] == (BYTE)eQDL_CMD_WRITE_UNFRAMED_RSP); + } + + return bResponse; + }; + + // (Inline) Return raw request + const sQDLRawWriteUnframedReq * GetRequest() const + { + const sQDLRawWriteUnframedReq * pReq = 0; + if (IsRequest() == true) + { + pReq = (const sQDLRawWriteUnframedReq *)GetBuffer(); + } + + return pReq; + }; + + // (Inline) Return raw response + const sQDLRawWriteUnframedRsp * GetResponse() const + { + const sQDLRawWriteUnframedRsp * pRsp = 0; + if (IsResponse() == true) + { + pRsp = (const sQDLRawWriteUnframedRsp *)GetBuffer(); + } + + return pRsp; + }; + + // (Inline) Does the response indicate success? + bool IsSuccess() const + { + bool bSuccess = false; + + const sQDLRawWriteUnframedRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + bSuccess = (pRsp->mStatus == eQDL_WRITE_STATUS_SUCCESS); + } + + return bSuccess; + }; + + // Extract sequence number from the response + bool GetSequenceNumber( ULONG & sequenceNumber ) const; + + // Build an unframed write request + static sSharedBuffer * BuildWriteUnframedReq( + USHORT sequenceNumber, + ULONG chunkSize ); + + // Build unframed write requests for the specified parameters + static std::list BuildWriteUnframedReqs( + ULONG chunkSize, + ULONG totalSize ); + + protected: + // Is this open unframed request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLWriteUnframed( const sProtocolBuffer & ); + sQDLWriteUnframed & operator = ( const sProtocolBuffer & ); +}; + +/*=========================================================================*/ +// Struct sQDLDone +// Struct to represent a QDL session done request/response (shared buffer) +/*=========================================================================*/ +struct sQDLDone : public sProtocolBuffer +{ + public: + // Constructor + sQDLDone( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLDone(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bRequest = (pBuf[0] == (BYTE)eQDL_CMD_SESSION_DONE_REQ); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bResponse = (pBuf[0] == (BYTE)eQDL_CMD_SESSION_DONE_RSP); + } + + return bResponse; + }; + + // (Inline) Return raw response + const sQDLRawDoneRsp * GetResponse() const + { + const sQDLRawDoneRsp * pRsp = 0; + if (IsResponse() == true) + { + pRsp = (const sQDLRawDoneRsp *)GetBuffer(); + } + + return pRsp; + }; + + // (Inline) Does the response indicate success? + bool IsSuccess() const + { + bool bSuccess = false; + + const sQDLRawDoneRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + bSuccess = (pRsp->mStatus == eQDL_DONE_STATUS_SUCCESS); + } + + return bSuccess; + }; + + // (Inline) Return the error text string + LPCSTR GetError() const + { + LPCSTR pErr = 0; + + const sQDLRawDoneRsp * pRsp = GetResponse(); + if (pRsp != 0) + { + if (pRsp->mStatus != eQDL_DONE_STATUS_SUCCESS) + { + pErr = (LPCSTR)&pRsp->mErrorText; + } + } + + return pErr; + }; + + protected: + // Is this session done request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLDone( const sProtocolBuffer & ); + sQDLDone & operator = ( const sProtocolBuffer & ); +}; + +/*=========================================================================*/ +// Struct sQDLGetImagePref +// Struct to represent a QDL get image preference +// request/response (shared buffer) +/*=========================================================================*/ +struct sQDLGetImagePref : public sProtocolBuffer +{ + public: + // Constructor + sQDLGetImagePref( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQDLGetImagePref(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bRequest = (pBuf[0] == (BYTE)eQDL_CMD_GET_IMAGE_PREF_REQ); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + if (IsValid() == true) + { + const BYTE * pBuf = GetBuffer(); + bResponse = (pBuf[0] == (BYTE)eQDL_CMD_GET_IMAGE_PREF_RSP); + } + + return bResponse; + }; + + // (Inline) Return raw response + const sQDLRawGetImagePrefRsp * GetResponse() const + { + const sQDLRawGetImagePrefRsp * pRsp = 0; + if (IsResponse() == true) + { + pRsp = (const sQDLRawGetImagePrefRsp *)GetBuffer(); + } + + return pRsp; + }; + + // Return image IDs + std::list GetImageIDs() const; + + protected: + // Is this get image preference request/response packet valid? + virtual bool Validate(); + + private: + // Prevent 'upcopying' + sQDLGetImagePref( const sProtocolBuffer & ); + sQDLGetImagePref & operator = ( const sProtocolBuffer & ); +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLEnum.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLEnum.h new file mode 100755 index 0000000..f53b19e --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLEnum.h @@ -0,0 +1,428 @@ +/*=========================================================================== +FILE: + QDLEnum.h + +DESCRIPTION: + QDL protocol enumerations and related methods + +PUBLIC ENUMERATIONS AND METHODS: + eQDLCommand + eQDLError + eQDLImageType + eQDLOpenStatus + eQDLWriteStatus + eQDLDoneStatus + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// QDL feature bits +const BYTE QDL_FEATURE_GENERIC_UNFRAMED = 0x10; +const BYTE QDL_FEATURE_QDL_UNFRAMED = 0x20; +const BYTE QDL_FEATURE_BAR_MODE = 0x40; + +// QDL protocol version +const BYTE QDL_MIN_VERSION = 6; +const BYTE QDL_MAX_VERSION = 6; + +const BYTE QDL_HELLO_MAGIC_REQ[32] = +{ + 'Q', + 'C', + 'O', + 'M', + ' ', + 'h', + 'i', + 'g', + 'h', + ' ', + 's', + 'p', + 'e', + 'e', + 'd', + ' ', + 'p', + 'r', + 'o', + 't', + 'o', + 'c', + 'o', + 'l', + ' ', + 'h', + 's', + 't', + 0, + 0, + 0, + 0 +}; + +const BYTE QDL_HELLO_MAGIC_RSP[24] = +{ + 'Q', + 'C', + 'O', + 'M', + ' ', + 'h', + 'i', + 'g', + 'h', + ' ', + 's', + 'p', + 'e', + 'e', + 'd', + ' ', + 'p', + 'r', + 'o', + 't', + 'o', + 'c', + 'o', + 'l' +}; + +// QDL maximum chunk size we support +const ULONG QDL_MAX_CHUNK_SIZE = 1024 * 1024 * 64; + +/*=========================================================================*/ +// eQDLCommand Enumeration +// QDL Command Code Enumeration +/*=========================================================================*/ +enum eQDLCommand +{ + eQDL_CMD_ENUM_BEGIN = -1, + + eQDL_CMD_HELLO_REQ = 1, // 001 Hello request + eQDL_CMD_HELLO_RSP, // 002 Hello response + + eQDL_CMD_ERROR = 13, // 013 Error report + + eQDL_CMD_OPEN_UNFRAMED_REQ = 37, // 037 Open unframed image write request + eQDL_CMD_OPEN_UNFRAMED_RSP, // 038 Open unframed image write response + eQDL_CMD_WRITE_UNFRAMED_REQ, // 039 Unframed image write request + eQDL_CMD_WRITE_UNFRAMED_RSP, // 040 Unframed image write response + eQDL_CMD_SESSION_DONE_REQ, // 041 Unframed session done request + eQDL_CMD_SESSION_DONE_RSP, // 042 Unframed session done response + eQDL_CMD_DOWNLOAD_REQ, // 043 Switch to download protocol request + + eQDL_CMD_SESSION_CLOSE_REQ = 45, // 045 Close unframed session request + eQDL_CMD_GET_IMAGE_PREF_REQ, // 046 Get image preference request + eQDL_CMD_GET_IMAGE_PREF_RSP, // 047 Get image preference response + + eQDL_CMD_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLCommand validity check + +PARAMETERS: + cmd [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLCommand cmd ) +{ + bool retVal = false; + + switch (cmd) + { + case eQDL_CMD_HELLO_REQ: + case eQDL_CMD_HELLO_RSP: + case eQDL_CMD_ERROR: + case eQDL_CMD_OPEN_UNFRAMED_REQ: + case eQDL_CMD_OPEN_UNFRAMED_RSP: + case eQDL_CMD_WRITE_UNFRAMED_REQ: + case eQDL_CMD_WRITE_UNFRAMED_RSP: + case eQDL_CMD_SESSION_DONE_REQ: + case eQDL_CMD_SESSION_DONE_RSP: + case eQDL_CMD_DOWNLOAD_REQ: + case eQDL_CMD_SESSION_CLOSE_REQ: + case eQDL_CMD_GET_IMAGE_PREF_REQ: + case eQDL_CMD_GET_IMAGE_PREF_RSP: + retVal = true; + break; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQDLError Enumeration +// QDL Error Enumeration +/*=========================================================================*/ +enum eQDLError +{ + eQDL_ERROR_ENUM_BEGIN = 0, + + eQDL_ERROR_01, // 01 Reserved + eQDL_ERROR_BAD_ADDR, // 02 Invalid destination address + eQDL_ERROR_BAD_LEN, // 03 Invalid length + eQDL_ERROR_BAD_PACKET, // 04 Unexpected end of packet + eQDL_ERROR_BAD_CMD, // 05 Invalid command + eQDL_ERROR_06, // 06 Reserved + eQDL_ERROR_OP_FAILED, // 07 Operation failed + eQDL_ERROR_BAD_FLASH_ID, // 08 Invalid flash intelligent ID + eQDL_ERROR_BAD_VOLTAGE, // 09 Invalid programming voltage + eQDL_ERROR_WRITE_FAILED, // 10 Write verify failed + eQDL_ERROR_11, // 11 Reserved + eQDL_ERROR_BAD_SPC, // 12 Invalid security code + eQDL_ERROR_POWERDOWN, // 13 Power-down failed + eQDL_ERROR_UNSUPPORTED, // 14 NAND flash programming not supported + eQDL_ERROR_CMD_SEQ, // 15 Command out of sequence + eQDL_ERROR_CLOSE, // 16 Close failed + eQDL_ERROR_BAD_FEATURES, // 17 Invalid feature bits + eQDL_ERROR_SPACE, // 18 Out of space + eQDL_ERROR_BAD_SECURITY, // 19 Invalid security mode + eQDL_ERROR_MULTI_UNSUPPORTED, // 20 Multi-image NAND not supported + eQDL_ERROR_POWEROFF, // 21 Power-off command not supported + eQDL_ERROR_CMD_UNSUPPORTED, // 22 Command not supported + eQDL_ERROR_BAD_CRC, // 23 Invalid CRC + eQDL_ERROR_STATE, // 24 Command received in invalid state + eQDL_ERROR_TIMEOUT, // 25 Receive timeout + eQDL_ERROR_IMAGE_AUTH, // 26 Image authentication error + + eQDL_ERROR_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLError validity check + +PARAMETERS: + err [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLError err ) +{ + bool retVal = false; + if (err > eQDL_ERROR_ENUM_BEGIN && err < eQDL_ERROR_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQDLImageType Enumeration +// QDL Download Image Type Enumeration +/*=========================================================================*/ +enum eQDLImageType +{ + eQDL_IMAGE_ENUM_BEGIN = -1, + + eQDL_IMAGE_AMSS_MODEM = 5, // 05 AMSS modem image + eQDL_IMAGE_AMSS_APPLICATION, // 06 AMSS application image + + eQDL_IMAGE_AMSS_UQCN = 13, // 13 Provisioning information + + eQDL_IMAGE_DBL = 15, // 15 DBL image + eQDL_IMAGE_OSBL, // 16 OSBL image + + eQDL_IMAGE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLImageType validity check + +PARAMETERS: + it [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLImageType it ) +{ + bool retVal = false; + + switch (it) + { + case eQDL_IMAGE_AMSS_MODEM: + case eQDL_IMAGE_AMSS_APPLICATION: + case eQDL_IMAGE_AMSS_UQCN: + case eQDL_IMAGE_DBL: + case eQDL_IMAGE_OSBL: + retVal = true; + break; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQDLOpenStatus Enumeration +// QDL Unframed Open Status Enumeration +/*=========================================================================*/ +enum eQDLOpenStatus +{ + eQDL_OPEN_STATUS_ENUM_BEGIN = -1, + + eQDL_OPEN_STATUS_SUCCESS, // 00 Success + eQDL_OPEN_STATUS_SIZE, // 01 Reported image size error + eQDL_OPEN_STATUS_BAD_TYPE, // 02 Invalid image type for downloader + eQDL_OPEN_STATUS_HDR_SIZE, // 03 Reported image header size error + eQDL_OPEN_STATUS_HDR1, // 04 Image header incorrectly present + eQDL_OPEN_STATUS_HDR2, // 05 Image header required + eQDL_OPEN_STATUS_PROTECTION, // 06 Memory block protection error + eQDL_OPEN_STATUS_NOT_NEEDED, // 07 Image type not required + + eQDL_OPEN_STATUS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLOpenStatus validity check + +PARAMETERS: + os [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLOpenStatus os ) +{ + bool retVal = false; + if (os > eQDL_OPEN_STATUS_ENUM_BEGIN && os < eQDL_OPEN_STATUS_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQDLWriteStatus Enumeration +// QDL Unframed Write Status Enumeration +/*=========================================================================*/ +enum eQDLWriteStatus +{ + eQDL_WRITE_STATUS_ENUM_BEGIN = -1, + + eQDL_WRITE_STATUS_SUCCESS, // 00 Success + eQDL_WRITE_STATUS_CRC, // 01 Error with CRC + eQDL_WRITE_STATUS_CONTENT, // 02 Error with chunk content + + eQDL_WRITE_STATUS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLWriteStatus validity check + +PARAMETERS: + ws [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLWriteStatus ws ) +{ + bool retVal = false; + if (ws > eQDL_WRITE_STATUS_ENUM_BEGIN && ws < eQDL_WRITE_STATUS_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQDLDoneStatus Enumeration +// QDL Done Status Enumeration +/*=========================================================================*/ +enum eQDLDoneStatus +{ + eQDL_DONE_STATUS_ENUM_BEGIN = -1, + + eQDL_DONE_STATUS_SUCCESS, // 00 Success + eQDL_DONE_STATUS_AUTH, // 01 Authentication failure + eQDL_DONE_STATUS_WRITE, // 02 Write failure + + eQDL_DONE_STATUS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQDLDoneStatus validity check + +PARAMETERS: + ds [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQDLDoneStatus ds ) +{ + bool retVal = false; + if (ds > eQDL_DONE_STATUS_ENUM_BEGIN && ds < eQDL_DONE_STATUS_ENUM_END) + { + retVal = true; + } + + return retVal; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLProtocolServer.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLProtocolServer.cpp new file mode 100755 index 0000000..9568b1a --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLProtocolServer.cpp @@ -0,0 +1,269 @@ +/*=========================================================================== +FILE: + QDLProtocolServer.cpp + +DESCRIPTION: + QDL protocol packet server + +PUBLIC CLASSES AND METHODS: + cQDLProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QDLProtocolServer.h" +#include "QDLEnum.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cQDLProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cQDLProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + bufferSzRx [ I ] - Size of data buffer for incoming data + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQDLProtocolServer::cQDLProtocolServer( + ULONG bufferSzRx, + ULONG logSz ) + : cHDLCProtocolServer( ePROTOCOL_QDL_RX, + ePROTOCOL_QDL_TX, + bufferSzRx, + logSz ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cQDLProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (destroys sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQDLProtocolServer::~cQDLProtocolServer() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + EncodeTxData (Internal Method) + +DESCRIPTION: + Encode data for transmission + +PARAMETERS: + pBuffer [ I ] - Data to be encoded + bEncoded [ O ] - Do we even encoded data? + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + sSharedBuffer * - Encoded data (0 upon error when encoding is indicated) +===========================================================================*/ +sSharedBuffer * cQDLProtocolServer::EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) +{ + // We encoded data + bEncoded = true; + if (pBuffer != 0 && pBuffer->IsValid() == true) + { + const BYTE * pReqBuf = mpActiveRequest->mRequest.GetBuffer(); + + eQDLCommand reqCmd = (eQDLCommand)pReqBuf[0]; + if (reqCmd == eQDL_CMD_WRITE_UNFRAMED_REQ) + { + // The write request is not HDLC encoded + bEncoded = false; + } + } + + if (bEncoded == true) + { + // Base class can handle HDLC encoding + return cHDLCProtocolServer::EncodeTxData( pBuffer, bEncoded ); + } + + return 0; +} + +/*=========================================================================== +METHOD: + IsResponse (Internal Method) + +DESCRIPTION: + Is the passed in data a response to the current request? + +PARAMETERS: + rsp [ I ] - Candidate response + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQDLProtocolServer::IsResponse( const sProtocolBuffer & rsp ) +{ + // Assume not + bool bRC = false; + if ( (mpActiveRequest == 0) + || (mpActiveRequest->mRequest.IsValid() == false) + || (mpActiveRequest->mbWaitingForResponse == false) + || (rsp.IsValid() == false) ) + { + return bRC; + } + + const BYTE * pReqBuf = mpActiveRequest->mRequest.GetBuffer(); + const BYTE * pRspBuf = rsp.GetBuffer(); + + eQDLCommand reqCmd = (eQDLCommand)pReqBuf[0]; + eQDLCommand rspCmd = (eQDLCommand)pRspBuf[0]; + + switch (reqCmd) + { + case eQDL_CMD_HELLO_REQ: + if ( (rspCmd == eQDL_CMD_HELLO_RSP) + || (rspCmd == eQDL_CMD_ERROR) ) + { + bRC = true; + } + break; + + case eQDL_CMD_OPEN_UNFRAMED_REQ: + if ( (rspCmd == eQDL_CMD_OPEN_UNFRAMED_RSP) + || (rspCmd == eQDL_CMD_ERROR) ) + { + bRC = true; + } + break; + + case eQDL_CMD_WRITE_UNFRAMED_REQ: + if ( (rspCmd == eQDL_CMD_WRITE_UNFRAMED_RSP) + || (rspCmd == eQDL_CMD_ERROR) ) + { + bRC = true; + } + break; + + case eQDL_CMD_SESSION_DONE_REQ: + if ( (rspCmd == eQDL_CMD_SESSION_DONE_RSP) + || (rspCmd == eQDL_CMD_ERROR) ) + { + bRC = true; + } + break; + + case eQDL_CMD_DOWNLOAD_REQ: + case eQDL_CMD_SESSION_CLOSE_REQ: + if (rspCmd == eQDL_CMD_ERROR) + { + bRC = true; + } + break; + + case eQDL_CMD_GET_IMAGE_PREF_REQ: + if ( (rspCmd == eQDL_CMD_GET_IMAGE_PREF_RSP) + || (rspCmd == eQDL_CMD_ERROR) ) + { + bRC = true; + } + break; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + IsTxAbortResponse (Internal Method) + +DESCRIPTION: + Is the passed in data a response that aborts the current request? + +PARAMETERS: + rsp [ I ] - Candidate response + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQDLProtocolServer::IsTxAbortResponse( const sProtocolBuffer & rsp ) +{ + // Assume not + bool bRC = false; + if ( (mpActiveRequest == 0) + || (mpActiveRequest->mRequest.IsValid() == false) + || (mpActiveRequest->mbWaitingForResponse == true) + || (rsp.IsValid() == false) ) + { + return bRC; + } + + // If we are in the middle of a transmission an we receive an error + // packet then we abort + const BYTE * pRspBuf = rsp.GetBuffer(); + eQDLCommand rspCmd = (eQDLCommand)pRspBuf[0]; + if (rspCmd == eQDL_CMD_ERROR) + { + bRC = true; + } + + return bRC; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLProtocolServer.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLProtocolServer.h new file mode 100755 index 0000000..f86c6fe --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/QDLProtocolServer.h @@ -0,0 +1,77 @@ +/*=========================================================================== +FILE: + QDLProtocolServer.h + +DESCRIPTION: + QDL protocol packet server + +PUBLIC CLASSES AND METHODS: + cQDLProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "HDLCProtocolServer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cQDLProtocolServer +/*=========================================================================*/ +class cQDLProtocolServer : public cHDLCProtocolServer +{ + public: + // Constructor + cQDLProtocolServer( + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cQDLProtocolServer(); + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ); + + // Is the passed in data a response to the current request? + virtual bool IsResponse( const sProtocolBuffer & rsp ); + + // Is the passed in data a response that aborts the current request? + virtual bool IsTxAbortResponse( const sProtocolBuffer & rsp ); +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIBuffers.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIBuffers.cpp new file mode 100755 index 0000000..154617b --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIBuffers.cpp @@ -0,0 +1,366 @@ +/*=========================================================================== +FILE: + QMIBuffers.cpp + +DESCRIPTION: + QMI service protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQMIControlRawTransactionHeader + sQMIServiceRawTransactionHeader + sQMIRawMessageHeader + sQMIRawContentHeader + + sQMIServiceBuffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// sQMIServiceBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sQMIServiceBuffer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + pBuffer [ I ] - Shareable buffer that contains the DIAG data + +RETURN VALUE: + None +===========================================================================*/ +sQMIServiceBuffer::sQMIServiceBuffer( sSharedBuffer * pBuffer ) + : sProtocolBuffer( pBuffer ) +{ + sQMIServiceBuffer::Validate(); +} + +/*=========================================================================== +METHOD: + ~sQMIServiceBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sQMIServiceBuffer::~sQMIServiceBuffer() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + GetResult (Public Method) + +DESCRIPTION: + Return contents of mandatory result content + +PARAMETERS: + returnCode [ I ] - The return code (should be eQMIResultCode) + errorCode [ I ] - The error code (should be eQMIErrorCode) + +RETURN VALUE: + bool +===========================================================================*/ +bool sQMIServiceBuffer::GetResult( + ULONG & returnCode, + ULONG & errorCode ) +{ + if (IsResponse() == false) + { + return false; + } + + std::map ::const_iterator pIter; + pIter = mContents.find( QMI_TLV_ID_RESULT ); + if (pIter == mContents.end()) + { + return false; + } + + const sQMIRawContentHeader * pContent = pIter->second; + if (pContent == 0) + { + ASSERT( 0 ); + return false; + } + + if (pContent->mLength != 4) + { + return false; + } + + const WORD * pData = (const WORD *)(++pContent); + + returnCode = (ULONG)*pData++; + errorCode = (ULONG)*pData; + + return true; +} + +/*=========================================================================== +METHOD: + BuildBuffer (Static Public Method) + +DESCRIPTION: + Build a QMI request + +PARAMETERS: + serviceType [ I ] - QMI service type + msgID [ I ] - The QMI message request ID + bResponse [ I ] - Build a response? + bIndication [ I ] - Build an indication? + pPayload [ I ] - Payload + payloadLen [ I ] - Size of above payload + +RETURN VALUE: + sSharedBuffer * : The request in an allocated buffer (0 on error) +===========================================================================*/ +sSharedBuffer * sQMIServiceBuffer::BuildBuffer( + eQMIService serviceType, + WORD msgID, + bool bResponse, + bool bIndication, + const BYTE * pPayload, + ULONG payloadLen ) +{ + const ULONG szTransHdr = (ULONG)sizeof(sQMIServiceRawTransactionHeader); + const ULONG szMsgHdr = (ULONG)sizeof(sQMIRawMessageHeader); + const ULONG totalHdrSz = szTransHdr + szMsgHdr; + + // Truncate payload? + if (payloadLen > (QMI_MAX_BUFFER_SIZE - totalHdrSz)) + { + payloadLen = QMI_MAX_BUFFER_SIZE - totalHdrSz; + } + + // Make sure length agrees with pointer + if (pPayload == 0) + { + payloadLen = 0; + } + + // Allocate buffer + PBYTE pBuffer = new BYTE[payloadLen + totalHdrSz]; + if (pBuffer == 0) + { + return 0; + } + + // Format header + sQMIServiceRawTransactionHeader * pHdr = 0; + pHdr = (sQMIServiceRawTransactionHeader *)&pBuffer[0]; + pHdr->mCompound = 0; + pHdr->mResponse = 0; + pHdr->mIndication = 0; + pHdr->mReserved = 0; + pHdr->mTransactionID = 1; + + bool bTX = true; + if (bResponse == true) + { + pHdr->mResponse = 1; + bTX = false; + } + else if (bIndication == true) + { + pHdr->mIndication = 1; + bTX = false; + } + + pHdr++; + + // Format message header + sQMIRawMessageHeader * pMsg = 0; + pMsg = (sQMIRawMessageHeader *)pHdr; + pMsg->mMessageID = msgID; + pMsg->mLength = (WORD)payloadLen; + + // Copy in payload? + if (payloadLen > 0 && pPayload != 0) + { + memcpy( (LPVOID)&pBuffer[totalHdrSz], + (LPCVOID)&pPayload[0], + (SIZE_T)payloadLen ); + } + + // Compute total size + ULONG sz = payloadLen + totalHdrSz; + + // Build and return the shared buffer + eProtocolType pt = MapQMIServiceToProtocol( serviceType, bTX ); + sSharedBuffer * pBuf = new sSharedBuffer( sz, pBuffer, pt ); + return pBuf; +} + +/*=========================================================================== +METHOD: + Validate (Internal Method) + +DESCRIPTION: + Is this open unframed request/response packet valid? + +RETURN VALUE: + bool +===========================================================================*/ +bool sQMIServiceBuffer::Validate() +{ + // Assume failure + bool bRC = false; + + // Sanity check protocol type + eProtocolType pt = GetType(); + if (IsQMIProtocol( pt ) == false) + { + mbValid = bRC; + return bRC; + } + + const ULONG szTransHdr = (ULONG)sizeof(sQMIServiceRawTransactionHeader); + const ULONG szMsgHdr = (ULONG)sizeof(sQMIRawMessageHeader); + const ULONG szContentHdr = (ULONG)sizeof(sQMIRawContentHeader); + + // Must be enough space for both headers + ULONG sz = GetSize(); + if (sz < szTransHdr + szMsgHdr) + { + mbValid = bRC; + return bRC; + } + + const BYTE * pBuffer = GetBuffer(); + + // Obtain transaction header + const sQMIServiceRawTransactionHeader * pTransHdr = 0; + pTransHdr = (const sQMIServiceRawTransactionHeader *)pBuffer; + pBuffer += szTransHdr; + + // This is required to be 0 + if (pTransHdr->mCompound != 0) + { + mbValid = bRC; + return bRC; + } + + // These are mutually exclusive + if (pTransHdr->mIndication == 1 && pTransHdr->mResponse == 1) + { + mbValid = bRC; + return bRC; + } + + // Requests/responses required valid transaction IDs + if ( (pTransHdr->mIndication == 0) + && (pTransHdr->mTransactionID == (WORD)INVALID_QMI_TRANSACTION_ID) ) + { + mbValid = bRC; + return bRC; + } + + if ( (pTransHdr->mResponse == 1 || pTransHdr->mIndication == 1) + && (IsQMIProtocolRX( pt ) == false) ) + { + mbValid = bRC; + return bRC; + } + + if ( (pTransHdr->mResponse == 0 && pTransHdr->mIndication == 0) + && (IsQMIProtocolTX( pt ) == false) ) + { + mbValid = bRC; + return bRC; + } + + // Obtain message header + const sQMIRawMessageHeader * pMsgHdr = 0; + pMsgHdr = (const sQMIRawMessageHeader *)pBuffer; + pBuffer += szMsgHdr; + + // Validate reported length + if (sz != ((ULONG)pMsgHdr->mLength + szTransHdr + szMsgHdr)) + { + mbValid = bRC; + return bRC; + } + + // Extract content TLV structures + ULONG contentProcessed = 0; + ULONG contentSz = (ULONG)pMsgHdr->mLength; + while (contentProcessed < contentSz) + { + const sQMIRawContentHeader * pContent = 0; + pContent = (const sQMIRawContentHeader *)pBuffer; + + ULONG tlvLen = szContentHdr + pContent->mLength; + + contentProcessed += tlvLen; + if (contentProcessed <= contentSz) + { + mContents[(ULONG)pContent->mTypeID] = pContent; + } + else + { + mContents.clear(); + + mbValid = bRC; + return bRC; + } + + pBuffer += tlvLen; + } + + // Validate TLV reported lengths + if (contentProcessed != contentSz) + { + mbValid = bRC; + return bRC; + } + + // Success! + bRC = true; + + mbValid = bRC; + return mbValid; +} + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIBuffers.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIBuffers.h new file mode 100755 index 0000000..2f4c5eb --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIBuffers.h @@ -0,0 +1,379 @@ +/*=========================================================================== +FILE: + QMIBuffers.h + +DESCRIPTION: + QMI service protocol related structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sQMUXHeader + sQMIControlRawTransactionHeader + sQMIServiceRawTransactionHeader + sQMIRawMessageHeader + sQMIRawContentHeader + + sQMIServiceBuffer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "QMIEnum.h" + +#include +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// QMI maximum buffer size (cannot be larger than MAX_SHARED_BUFFER_SIZE) +const ULONG QMI_MAX_BUFFER_SIZE = MAX_SHARED_BUFFER_SIZE; + +// Content ID for mandatory result TLV +const ULONG QMI_TLV_ID_RESULT = 2; + +/*=========================================================================== +METHOD: + MapQMIServiceToProtocol (Inline Method) + +DESCRIPTION: + Map QMI service type (eQMIService) and direction to a protocol type + (eProtocolType) + +PARAMETERS: + serviceType [ I ] - Enum value being mapped + bTransmission [ I ] - IS this a transmission (TX vs. RX)? + +RETURN VALUE: + bool +===========================================================================*/ +inline eProtocolType MapQMIServiceToProtocol( + eQMIService serviceType, + bool bTransmission = true ) +{ + eProtocolType pt = ePROTOCOL_ENUM_BEGIN; + switch (serviceType) + { + case eQMI_SVC_WDS: + pt = ePROTOCOL_QMI_WDS_RX; + break; + + case eQMI_SVC_DMS: + pt = ePROTOCOL_QMI_DMS_RX; + break; + + case eQMI_SVC_NAS: + pt = ePROTOCOL_QMI_NAS_RX; + break; + + case eQMI_SVC_QOS: + pt = ePROTOCOL_QMI_QOS_RX; + break; + + case eQMI_SVC_WMS: + pt = ePROTOCOL_QMI_WMS_RX; + break; + + case eQMI_SVC_PDS: + pt = ePROTOCOL_QMI_PDS_RX; + break; + + case eQMI_SVC_AUTH: + pt = ePROTOCOL_QMI_AUTH_RX; + break; + + case eQMI_SVC_VOICE: + pt = ePROTOCOL_QMI_VOICE_RX; + break; + + case eQMI_SVC_CAT: + pt = ePROTOCOL_QMI_CAT_RX; + break; + + case eQMI_SVC_RMS: + pt = ePROTOCOL_QMI_RMS_RX; + break; + + case eQMI_SVC_OMA: + pt = ePROTOCOL_QMI_OMA_RX; + break; + + case eQMI_SVC_CONTROL: + pt = ePROTOCOL_QMI_CTL_RX; + break; + + } + + if (pt != ePROTOCOL_ENUM_BEGIN && bTransmission == true) + { + // This relies on the fact the the TX variant is always the next + // enumerated value after the RX variant (so don't do something + // to change that) + pt = (eProtocolType)((ULONG)pt + 1); + } + + return pt; +}; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sQMUXHeader +// Struct to represent a QMUX transaction header (raw) +/*=========================================================================*/ +struct sQMUXHeader +{ + public: + WORD mLength; + BYTE mFlags; + BYTE mServiceType; + BYTE mClientID; +}; + +/*=========================================================================*/ +// Struct sQMIControlRawTransactionHeader +// Struct to represent a QMI control transaction header (raw) +/*=========================================================================*/ +struct sQMIControlRawTransactionHeader +{ + public: + BYTE mResponse : 1; // Is this a response transaction? + BYTE mIndication : 1; // Is this an indication transaction? + BYTE mReserved : 6; + + BYTE mTransactionID; // Transaction ID +}; + +/*=========================================================================*/ +// Struct sQMIServiceRawTransactionHeader +// Struct to represent a QMI service transaction header (raw) +/*=========================================================================*/ +struct sQMIServiceRawTransactionHeader +{ + public: + BYTE mCompound : 1; // Is this a compound transaction? + BYTE mResponse : 1; // Is this a response transaction? + BYTE mIndication : 1; // Is this an indication transaction? + BYTE mReserved : 5; + + WORD mTransactionID; // Transaction ID +}; + +/*=========================================================================*/ +// Struct sQMIRawMessageHeader +// Struct to represent a QMI (control/service) message header (raw) +/*=========================================================================*/ +struct sQMIRawMessageHeader +{ + public: + WORD mMessageID; // Message ID + WORD mLength; // Length of message (not including this header) +}; + +/*=========================================================================*/ +// Struct sQMIRawContentHeader +// Struct to represent a QMI (control/service) content +// (i.e Type/Length/Value, TLV) header (raw) +/*=========================================================================*/ +struct sQMIRawContentHeader +{ + public: + BYTE mTypeID; // Content type ID + WORD mLength; // Content length (not including this header) +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + + +/*=========================================================================*/ +// Struct sQMIServiceBuffer +// Struct to represent a QMI service channel request/response/indication +// (shared buffer) +/*=========================================================================*/ +struct sQMIServiceBuffer : public sProtocolBuffer +{ + public: + // Constructor + sQMIServiceBuffer( sSharedBuffer * pBuffer ); + + // Destructor + virtual ~sQMIServiceBuffer(); + + // (Inline) Is this a request? + bool IsRequest() const + { + bool bRequest = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bRequest = (pHdr->mResponse == 0 && pHdr->mIndication == 0); + } + + return bRequest; + }; + + // (Inline) Is this a response? + bool IsResponse() const + { + bool bResponse = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bResponse = (pHdr->mResponse == 1); + } + + return bResponse; + }; + + // (Inline) Is this an indication? + bool IsIndication() const + { + bool bInd = false; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + bInd = (pHdr->mIndication == 1); + } + + return bInd; + }; + + // (Inline) Return raw header + const sQMIServiceRawTransactionHeader * GetHeader() const + { + const sQMIServiceRawTransactionHeader * pHdr = 0; + if (IsValid() == true) + { + pHdr = (const sQMIServiceRawTransactionHeader *)GetBuffer(); + } + + return pHdr; + }; + + // (Inline) Return the message ID + ULONG GetMessageID() const + { + ULONG id = (ULONG)ULONG_MAX; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + pHdr++; + const sQMIRawMessageHeader * pMsgHdr = 0; + pMsgHdr = (sQMIRawMessageHeader *)pHdr; + + id = pMsgHdr->mMessageID; + } + + return id; + }; + + // (Inline) Return the transaction ID + WORD GetTransactionID() const + { + WORD id = (WORD)INVALID_QMI_TRANSACTION_ID; + + const sQMIServiceRawTransactionHeader * pHdr = GetHeader(); + if (pHdr != 0) + { + id = pHdr->mTransactionID; + } + + return id; + }; + + // (Inline) Return content structures + std::map GetContents() const + { + return mContents; + }; + + // Return contents of mandatory result content + bool GetResult( + ULONG & returnCode, + ULONG & errorCode ); + + // Build a QMI request/response/indication + static sSharedBuffer * BuildBuffer( + eQMIService serviceType, + WORD msgID, + bool bResponse = false, + bool bIndication = false, + const BYTE * pData = 0, + ULONG dataLen = 0 ); + + protected: + // QMI protocol server has to be able to set the transaction ID + friend class cQMIProtocolServer; + + // Set the transaction ID + void SetTransactionID( WORD tid ) const + { + if (tid == (WORD)INVALID_QMI_TRANSACTION_ID || IsValid() == false) + { + return; + } + + sQMIServiceRawTransactionHeader * pHdr = 0; + pHdr = (sQMIServiceRawTransactionHeader *)GetHeader(); + if (pHdr != 0) + { + pHdr->mTransactionID = tid; + } + }; + + // Is this QMI request/response/indication packet valid? + virtual bool Validate(); + + /* Content TLV structures (indexed by type ID) */ + std::map mContents; + + private: + // Prevent 'upcopying' + sQMIServiceBuffer( const sProtocolBuffer & ); + sQMIServiceBuffer & operator = ( const sProtocolBuffer & ); +}; + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIEnum.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIEnum.h new file mode 100755 index 0000000..88a7d9d --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIEnum.h @@ -0,0 +1,1149 @@ +/*=========================================================================== +FILE: + QMIEnum.h + +DESCRIPTION: + QMI protocol enumerations and related methods + +PUBLIC ENUMERATIONS AND METHODS: + eQMIService + eQMIMessageCTL + eQMIMessageWDS + eQMIMessageDMS + eQMIMessageNAS + eQMIMessageWMS + eQMIMessagePDS + eQMIMessageAUTH + eQMIMessageCAT + eQMIMessageRMS + eQMIMessageOMA + eQMIResultCode + eQMIErrorCode + eQMICallEndReason + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Invalid QMI transaction ID +const ULONG INVALID_QMI_TRANSACTION_ID = 0; + +// QMI DMS PRL size constants +const ULONG QMI_DMS_MAX_PRL_SIZE = 16384; +const ULONG QMI_DMS_MAX_PRL_BLOCK = 256; + +/*=========================================================================*/ +// eQMIService Enumeration +// QMI Service Type Enumeration +/*=========================================================================*/ +enum eQMIService +{ + eQMI_SVC_ENUM_BEGIN = -1, + + eQMI_SVC_CONTROL, // 000 Control service + eQMI_SVC_WDS, // 001 Wireless data service + eQMI_SVC_DMS, // 002 Device management service + eQMI_SVC_NAS, // 003 Network access service + eQMI_SVC_QOS, // 004 Quality of service, err, service + eQMI_SVC_WMS, // 005 Wireless messaging service + eQMI_SVC_PDS, // 006 Position determination service + eQMI_SVC_AUTH, // 007 Authentication service + + eQMI_SVC_VOICE = 9, // 009 Voice service + + eQMI_SVC_CAT = 224, // 224 Card application toolkit service + eQMI_SVC_RMS, // 225 Remote management service + eQMI_SVC_OMA, // 226 Open mobile alliance dev mgmt service + + eQMI_SVC_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIService validity check + +PARAMETERS: + svc [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIService svc ) +{ + bool retVal = false; + if ( (svc > eQMI_SVC_ENUM_BEGIN && svc <= eQMI_SVC_AUTH) + || (svc == eQMI_SVC_VOICE) + || (svc >= eQMI_SVC_CAT && svc < eQMI_SVC_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageCTL Enumeration +// QMI Control Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageCTL +{ + eQMI_CTL_ENUM_BEGIN = -1, + + eQMI_CTL_SET_INSTANCE_ID = 32, // 32 Set the unique link instance ID + eQMI_CTL_GET_VERSION_INFO, // 33 Get supported service version info + eQMI_CTL_GET_CLIENT_ID, // 34 Get a unique client ID + eQMI_CTL_RELEASE_CLIENT_ID, // 35 Release the unique client ID + eQMI_CTL_REVOKE_CLIENT_ID_IND, // 36 Indication of client ID revocation + eQMI_CTL_INVALID_CLIENT_ID, // 37 Indication of invalid client ID + eQMI_CTL_SET_DATA_FORMAT, // 38 Set host driver data format + eQMI_CTL_SYNC, // 39 Synchronize client/server + eQMI_CTL_SYNC_IND = 39, // 39 Synchronize indication + eQMI_CTL_SET_EVENT, // 40 Set event report conditions + eQMI_CTL_EVENT_IND = 40, // 40 Event report indication + eQMI_CTL_SET_POWER_SAVE_CFG, // 41 Set power save config + eQMI_CTL_SET_POWER_SAVE_MODE, // 42 Set power save mode + eQMI_CTL_GET_POWER_SAVE_MODE, // 43 Get power save mode + + eQMI_CTL_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageCTL validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageCTL msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_CTL_SET_INSTANCE_ID && msgID < eQMI_CTL_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageWDS Enumeration +// QMI WDS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageWDS +{ + eQMI_WDS_ENUM_BEGIN = -1, + + eQMI_WDS_RESET, // 00 Reset WDS service state variables + eQMI_WDS_SET_EVENT, // 01 Set connection state report conditions + eQMI_WDS_EVENT_IND = 1, // 01 Connection state report indication + eQMI_WDS_ABORT, // 02 Abort previously issued WDS command + + eQMI_WDS_START_NET = 32, // 32 Start WDS network interface + eQMI_WDS_STOP_NET, // 33 Stop WDS network interface + eQMI_WDS_GET_PKT_STATUS, // 34 Get packet data connection status + eQMI_WDS_PKT_STATUS_IND = 34, // 34 Packet data connection status indication + eQMI_WDS_GET_RATES, // 35 Get current bit rates of the connection + eQMI_WDS_GET_STATISTICS, // 36 Get the packet data transfer statistics + eQMI_WDS_G0_DORMANT, // 37 Go dormant + eQMI_WDS_G0_ACTIVE, // 38 Go active + eQMI_WDS_CREATE_PROFILE, // 39 Create profile with specified settings + eQMI_WDS_MODIFY_PROFILE, // 40 Modify profile with specified settings + eQMI_WDS_DELETE_PROFILE, // 41 Delete the specified profile + eQMI_WDS_GET_PROFILE_LIST, // 42 Get all profiles + eQMI_WDS_GET_PROFILE, // 43 Get the specified profile + eQMI_WDS_GET_DEFAULTS, // 44 Get the default data session settings + eQMI_WDS_GET_SETTINGS, // 45 Get the runtime data session settings + eQMI_WDS_SET_MIP, // 46 Get the mobile IP setting + eQMI_WDS_GET_MIP, // 47 Set the mobile IP setting + eQMI_WDS_GET_DORMANCY, // 48 Get the dormancy status + + eQMI_WDS_GET_AUTOCONNECT = 52, // 52 Get the NDIS autoconnect setting + eQMI_WDS_GET_DURATION, // 53 Get the duration of data session + eQMI_WDS_GET_MODEM_STATUS, // 54 Get the modem status + eQMI_WDS_MODEM_IND = 54, // 54 Modem status indication + eQMI_WDS_GET_DATA_BEARER, // 55 Get the data bearer type + eQMI_WDS_GET_MODEM_INFO, // 56 Get the modem info + eQMI_WDS_MODEM_INFO_IND = 56, // 56 Modem info indication + + eQMI_WDS_GET_ACTIVE_MIP = 60, // 60 Get the active mobile IP profile + eQMI_WDS_SET_ACTIVE_MIP, // 61 Set the active mobile IP profile + eQMI_WDS_GET_MIP_PROFILE, // 62 Get mobile IP profile settings + eQMI_WDS_SET_MIP_PROFILE, // 63 Set mobile IP profile settings + eQMI_WDS_GET_MIP_PARAMS, // 64 Get mobile IP parameters + eQMI_WDS_SET_MIP_PARAMS, // 65 Set mobile IP parameters + eQMI_WDS_GET_LAST_MIP_STATUS, // 66 Get last mobile IP status + eQMI_WDS_GET_AAA_AUTH_STATUS, // 67 Get AN-AAA authentication status + eQMI_WDS_GET_CUR_DATA_BEARER, // 68 Get current data bearer + eQMI_WDS_GET_CALL_LIST, // 69 Get the call history list + eQMI_WDS_GET_CALL_ENTRY, // 70 Get an entry from the call history list + eQMI_WDS_CLEAR_CALL_LIST, // 71 Clear the call history list + eQMI_WDS_GET_CALL_LIST_MAX, // 72 Get maximum size of call history list + + eQMI_WDS_SET_IP_FAMILY = 77, // 77 Set the client IP family preference + + eQMI_WDS_SET_AUTOCONNECT = 81, // 81 Set the NDIS autoconnect setting + eQMI_WDS_GET_DNS, // 82 Get the DNS setting + eQMI_WDS_SET_DNS, // 83 Set the DNS setting + + eQMI_WDS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageWDS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageWDS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_WDS_ENUM_BEGIN && msgID <= eQMI_WDS_ABORT) + || (msgID >= eQMI_WDS_START_NET && msgID <= eQMI_WDS_GET_DORMANCY) + || (msgID >= eQMI_WDS_GET_AUTOCONNECT && msgID <= eQMI_WDS_MODEM_INFO_IND) + || (msgID >= eQMI_WDS_GET_ACTIVE_MIP && msgID <= eQMI_WDS_GET_CALL_LIST_MAX) + || (msgID == eQMI_WDS_SET_IP_FAMILY) + || (msgID >= eQMI_WDS_SET_AUTOCONNECT && msgID < eQMI_WDS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageDMS Enumeration +// QMI DMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageDMS +{ + eQMI_DMS_ENUM_BEGIN = -1, + + eQMI_DMS_RESET, // 00 Reset DMS service state variables + eQMI_DMS_SET_EVENT, // 01 Set connection state report conditions + eQMI_DMS_EVENT_IND = 1, // 01 Connection state report indication + + eQMI_DMS_GET_CAPS = 32, // 32 Get the device capabilities + eQMI_DMS_GET_MANUFACTURER, // 33 Get the device manfacturer + eQMI_DMS_GET_MODEL_ID, // 34 Get the device model ID + eQMI_DMS_GET_REV_ID, // 35 Get the device revision ID + eQMI_DMS_GET_NUMBER, // 36 Get the assigned voice number + eQMI_DMS_GET_IDS, // 37 Get the ESN/IMEI/MEID + eQMI_DMS_GET_POWER_STATE, // 38 Get the get power state + eQMI_DMS_UIM_SET_PIN_PROT, // 39 UIM - Set PIN protection + eQMI_DMS_UIM_PIN_VERIFY, // 40 UIM - Verify PIN + eQMI_DMS_UIM_PIN_UNBLOCK, // 41 UIM - Unblock PIN + eQMI_DMS_UIM_PIN_CHANGE, // 42 UIM - Change PIN + eQMI_DMS_UIM_GET_PIN_STATUS, // 43 UIM - Get PIN status + eQMI_DMS_GET_MSM_ID = 44, // 44 Get MSM ID + eQMI_DMS_GET_OPERTAING_MODE, // 45 Get the operating mode + eQMI_DMS_SET_OPERATING_MODE, // 46 Set the operating mode + eQMI_DMS_GET_TIME, // 47 Get timestamp from the device + eQMI_DMS_GET_PRL_VERSION, // 48 Get the PRL version + eQMI_DMS_GET_ACTIVATED_STATE, // 49 Get the activation state + eQMI_DMS_ACTIVATE_AUTOMATIC, // 50 Perform an automatic activation + eQMI_DMS_ACTIVATE_MANUAL, // 51 Perform a manual activation + eQMI_DMS_GET_USER_LOCK_STATE, // 52 Get the lock state + eQMI_DMS_SET_USER_LOCK_STATE, // 53 Set the lock state + eQMI_DMS_SET_USER_LOCK_CODE, // 54 Set the lock PIN + eQMI_DMS_READ_USER_DATA, // 55 Read user data + eQMI_DMS_WRITE_USER_DATA, // 56 Write user data + eQMI_DMS_READ_ERI_FILE, // 57 Read the enhanced roaming indicator file + eQMI_DMS_FACTORY_DEFAULTS, // 58 Reset to factory defaults + eQMI_DMS_VALIDATE_SPC, // 59 Validate service programming code + eQMI_DMS_UIM_GET_ICCID, // 60 Get UIM ICCID + eQMI_DMS_GET_FIRWARE_ID, // 61 Get firmware ID + eQMI_DMS_SET_FIRMWARE_ID, // 62 Set firmware ID + eQMI_DMS_GET_HOST_LOCK_ID, // 63 Get host lock ID + eQMI_DMS_UIM_GET_CK_STATUS, // 64 UIM - Get control key status + eQMI_DMS_UIM_SET_CK_PROT, // 65 UIM - Set control key protection + eQMI_DMS_UIM_UNBLOCK_CK, // 66 UIM - Unblock facility control key + eQMI_DMS_GET_IMSI, // 67 Get the IMSI + eQMI_DMS_UIM_GET_STATE, // 68 UIM - Get the UIM state + eQMI_DMS_GET_BAND_CAPS, // 69 Get the device band capabilities + eQMI_DMS_GET_FACTORY_ID, // 70 Get the device factory ID + eQMI_DMS_GET_FIRMWARE_PREF, // 71 Get firmware preference + eQMI_DMS_SET_FIRMWARE_PREF, // 72 Set firmware preference + eQMI_DMS_LIST_FIRMWARE, // 73 List all stored firmware + eQMI_DMS_DELETE_FIRMWARE, // 74 Delete specified stored firmware + eQMI_DMS_SET_TIME, // 75 Set device time + eQMI_DMS_GET_FIRMWARE_INFO, // 76 Get stored firmware info + eQMI_DMS_GET_ALT_NET_CFG, // 77 Get alternate network config + eQMI_DMS_SET_ALT_NET_CFG, // 78 Set alternate network config + eQMI_DMS_GET_IMG_DLOAD_MODE, // 79 Get next image download mode + eQMI_DMS_SET_IMG_DLOAD_MODE, // 80 Set next image download mod + + eQMI_DMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageDMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageDMS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_DMS_ENUM_BEGIN && msgID <= eQMI_DMS_EVENT_IND) + || (msgID >= eQMI_DMS_GET_CAPS && msgID < eQMI_DMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageNAS Enumeration +// QMI NAS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageNAS +{ + eQMI_NAS_ENUM_BEGIN = -1, + + eQMI_NAS_RESET, // 00 Reset NAS service state variables + eQMI_NAS_ABORT, // 01 Abort previously issued NAS command + eQMI_NAS_SET_EVENT, // 02 Set NAS state report conditions + eQMI_NAS_EVENT_IND = 2, // 02 Connection state report indication + eQMI_NAS_SET_REG_EVENT, // 03 Set NAS registration report conditions + + eQMI_NAS_GET_RSSI = 32, // 32 Get the signal strength + eQMI_NAS_SCAN_NETS, // 33 Scan for visible network + eQMI_NAS_REGISTER_NET, // 34 Initiate a network registration + eQMI_NAS_ATTACH_DETACH, // 35 Initiate an attach or detach action + eQMI_NAS_GET_SS_INFO, // 36 Get info about current serving system + eQMI_NAS_SS_INFO_IND = 36, // 36 Current serving system info indication + eQMI_NAS_GET_HOME_INFO, // 37 Get info about home network + eQMI_NAS_GET_NET_PREF_LIST, // 38 Get the list of preferred networks + eQMI_NAS_SET_NET_PREF_LIST, // 39 Set the list of preferred networks + eQMI_NAS_GET_NET_BAN_LIST, // 40 Get the list of forbidden networks + eQMI_NAS_SET_NET_BAN_LIST, // 41 Set the list of forbidden networks + eQMI_NAS_SET_TECH_PREF, // 42 Set the technology preference + eQMI_NAS_GET_TECH_PREF, // 43 Get the technology preference + eQMI_NAS_GET_ACCOLC, // 44 Get the Access Overload Class + eQMI_NAS_SET_ACCOLC, // 45 Set the Access Overload Class + eQMI_NAS_GET_SYSPREF, // 46 Get the CDMA system preference + eQMI_NAS_GET_NET_PARAMS, // 47 Get various network parameters + eQMI_NAS_SET_NET_PARAMS, // 48 Set various network parameters + eQMI_NAS_GET_RF_INFO, // 49 Get the SS radio/band channel info + eQMI_NAS_GET_AAA_AUTH_STATUS, // 50 Get AN-AAA authentication status + eQMI_NAS_SET_SYS_SELECT_PREF, // 51 Set system selection preference + eQMI_NAS_GET_SYS_SELECT_PREF, // 52 Get system selection preference + eQMI_NAS_SYS_SELECT_IND = 52, // 52 System selection pref indication + + eQMI_NAS_SET_DDTM_PREF = 55, // 55 Set DDTM preference + eQMI_NAS_GET_DDTM_PREF, // 56 Get DDTM preference + eQMI_NAS_DDTM_IND = 56, // 56 DDTM preference indication + + eQMI_NAS_GET_PLMN_MODE = 59, // 59 Get PLMN mode bit from CSP + eQMI_NAS_PLMN_MODE_IND, // 60 CSP PLMN mode bit indication + + eQMI_NAS_GET_PLMN_NAME = 68, // 68 Get operator name for specified network + + eQMI_NAS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageNAS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageNAS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_NAS_ENUM_BEGIN && msgID <= eQMI_NAS_SET_REG_EVENT) + || (msgID >= eQMI_NAS_GET_RSSI && msgID <= eQMI_NAS_SYS_SELECT_IND) + || (msgID >= eQMI_NAS_SET_DDTM_PREF && msgID <= eQMI_NAS_DDTM_IND) + || (msgID >= eQMI_NAS_GET_PLMN_MODE && msgID <= eQMI_NAS_PLMN_MODE_IND) + || (msgID >= eQMI_NAS_GET_PLMN_NAME && msgID < eQMI_NAS_ENUM_END) ) + { + retVal = true; + } + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageWMS Enumeration +// QMI WMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageWMS +{ + eQMI_WMS_ENUM_BEGIN = -1, + + eQMI_WMS_RESET, // 00 Reset WMS service state variables + eQMI_WMS_SET_EVENT, // 01 Set new message report conditions + eQMI_WMS_EVENT_IND = 1, // 01 New message report indication + + eQMI_WMS_RAW_SEND = 32, // 32 Send a raw message + eQMI_WMS_RAW_WRITE, // 33 Write a raw message to the device + eQMI_WMS_RAW_READ, // 34 Read a raw message from the device + eQMI_WMS_MODIFY_TAG, // 35 Modify message tag on the device + eQMI_WMS_DELETE, // 36 Delete message by index/tag/memory + + eQMI_WMS_GET_MSG_PROTOCOL = 48, // 48 Get the current message protocol + eQMI_WMS_GET_MSG_LIST, // 49 Get list of messages from the device + eQMI_WMS_SET_ROUTES, // 50 Set routes for message memory storage + eQMI_WMS_GET_ROUTES, // 51 Get routes for message memory storage + eQMI_WMS_GET_SMSC_ADDR, // 52 Get SMSC address + eQMI_WMS_SET_SMSC_ADDR, // 53 Set SMSC address + eQMI_WMS_GET_MSG_LIST_MAX, // 54 Get maximum size of SMS storage + eQMI_WMS_SEND_ACK, // 55 Send ACK + eQMI_WMS_SET_RETRY_PERIOD, // 56 Set retry period + eQMI_WMS_SET_RETRY_INTERVAL, // 57 Set retry interval + eQMI_WMS_SET_DC_DISCO_TIMER, // 58 Set DC auto-disconnect timer + eQMI_WMS_SET_MEMORY_STATUS, // 59 Set memory storage status + eQMI_WMS_SET_BC_ACTIVATION, // 60 Set broadcast activation + eQMI_WMS_SET_BC_CONFIG, // 61 Set broadcast config + eQMI_WMS_GET_BC_CONFIG, // 62 Get broadcast config + eQMI_WMS_MEMORY_FULL_IND, // 63 Memory full indication + eQMI_WMS_GET_DOMAIN_PREF, // 64 Get domain preference + eQMI_WMS_SET_DOMAIN_PREF, // 65 Set domain preference + eQMI_WMS_MEMORY_SEND, // 66 Send message from memory store + eQMI_WMS_GET_MSG_WAITING, // 67 Get message waiting info + eQMI_WMS_MSG_WAITING_IND, // 68 Message waiting indication + eQMI_WMS_SET_PRIMARY_CLIENT, // 69 Set client as primary client + eQMI_WMS_SMSC_ADDR_IND, // 70 SMSC address indication + + eQMI_WMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageWMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageWMS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_WMS_ENUM_BEGIN && msgID <= eQMI_WMS_EVENT_IND) + || (msgID >= eQMI_WMS_RAW_SEND && msgID <= eQMI_WMS_DELETE) + || (msgID >= eQMI_WMS_GET_MSG_PROTOCOL && msgID < eQMI_WMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessagePDS Enumeration +// QMI PDS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessagePDS +{ + eQMI_PDS_ENUM_BEGIN = -1, + + eQMI_PDS_RESET, // 00 Reset PDS service state variables + eQMI_PDS_SET_EVENT, // 01 Set PDS report conditions + eQMI_PDS_EVENT_IND = 1, // 01 PDS report indication + + eQMI_PDS_GET_STATE = 32, // 32 Return PDS service state + eQMI_PDS_STATE_IND = 32, // 32 PDS service state indication + eQMI_PDS_SET_STATE, // 33 Set PDS service state + eQMI_PDS_START_SESSION, // 34 Start a PDS tracking session + eQMI_PDS_GET_SESSION_INFO, // 35 Get PDS tracking session info + eQMI_PDS_FIX_POSITION, // 36 Manual tracking session position + eQMI_PDS_END_SESSION, // 37 End a PDS tracking session + eQMI_PDS_GET_NMEA_CFG, // 38 Get NMEA sentence config + eQMI_PDS_SET_NMEA_CFG, // 39 Set NMEA sentence config + eQMI_PDS_INJECT_TIME, // 40 Inject a time reference + eQMI_PDS_GET_DEFAULTS, // 41 Get default tracking session config + eQMI_PDS_SET_DEFAULTS, // 42 Set default tracking session config + eQMI_PDS_GET_XTRA_PARAMS, // 43 Get the GPS XTRA parameters + eQMI_PDS_SET_XTRA_PARAMS, // 44 Set the GPS XTRA parameters + eQMI_PDS_FORCE_XTRA_DL, // 45 Force a GPS XTRA database download + eQMI_PDS_GET_AGPS_CONFIG, // 46 Get the AGPS mode configuration + eQMI_PDS_SET_AGPS_CONFIG, // 47 Set the AGPS mode configuration + + eQMI_PDS_GET_SVC_AUTOTRACK, // 48 Get the service auto-tracking state + eQMI_PDS_SET_SVC_AUTOTRACK, // 49 Set the service auto-tracking state + eQMI_PDS_GET_COM_AUTOTRACK, // 50 Get COM port auto-tracking config + eQMI_PDS_SET_COM_AUTOTRACK, // 51 Set COM port auto-tracking config + eQMI_PDS_RESET_DATA, // 52 Reset PDS service data + eQMI_PDS_SINGLE_FIX, // 53 Request single position fix + eQMI_PDS_GET_VERSION, // 54 Get PDS service version + eQMI_PDS_INJECT_XTRA, // 55 Inject XTRA data + eQMI_PDS_INJECT_POSITION, // 56 Inject position data + eQMI_PDS_INJECT_WIFI, // 57 Inject Wi-Fi obtained data + eQMI_PDS_GET_SBAS_CONFIG, // 58 Get SBAS config + eQMI_PDS_SET_SBAS_CONFIG, // 59 Set SBAS config + eQMI_PDS_SEND_NI_RESPONSE, // 60 Send network initiated response + eQMI_PDS_INJECT_ABS_TIME, // 61 Inject absolute time + eQMI_PDS_INJECT_EFS, // 62 Inject EFS data + eQMI_PDS_GET_DPO_CONFIG, // 63 Get DPO config + eQMI_PDS_SET_DPO_CONFIG, // 64 Set DPO config + eQMI_PDS_GET_ODP_CONFIG, // 65 Get ODP config + eQMI_PDS_SET_ODP_CONFIG, // 66 Set ODP config + eQMI_PDS_CANCEL_SINGLE_FIX, // 67 Cancel single position fix + eQMI_PDS_GET_GPS_STATE, // 68 Get GPS state + + eQMI_PDS_GET_METHODS = 80, // 80 Get GPS position methods state + eQMI_PDS_SET_METHODS, // 81 Set GPS position methods state + + eQMI_PDS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessagePDS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessagePDS msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_PDS_ENUM_BEGIN && msgID <= eQMI_PDS_EVENT_IND) + || (msgID >= eQMI_PDS_GET_STATE && msgID <= eQMI_PDS_GET_GPS_STATE) + || (msgID >= eQMI_PDS_GET_METHODS && msgID < eQMI_PDS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageAUTH Enumeration +// QMI Authentication Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageAUTH +{ + eQMI_AUTH_ENUM_BEGIN = -1, + + eQMI_AUTH_START_EAP = 32, // 32 Start the EAP session + eQMI_AUTH_SEND_EAP, // 33 Send and receive EAP packets + eQMI_AUTH_EAP_RESULT_IND, // 34 EAP session result indication + eQMI_AUTH_GET_EAP_KEYS, // 35 Get the EAP session keys + eQMI_AUTH_END_EAP, // 36 End the EAP session + + eQMI_AUTH_ENUM_END +}; + +/*=========================================================================*/ +// eQMIMessageVoice Enumeration +// QMI Voice Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageVoice +{ + eQMI_VOICE_ENUM_BEGIN = -1, + + eQMI_VOICE_INDICATION_REG = 3, // 03 Set indication registration state + + eQMI_VOICE_CALL_ORIGINATE = 32, // 32 Originate a voice call + eQMI_VOICE_CALL_END, // 33 End a voice call + eQMI_VOICE_CALL_ANSWER, // 34 Answer incoming voice call + + eQMI_VOICE_GET_CALL_INFO = 36, // 36 Get call information + eQMI_VOICE_OTASP_STATUS_IND, // 37 OTASP/OTAPA event indication + eQMI_VOICE_INFO_REC_IND, // 38 New info record indication + eQMI_VOICE_SEND_FLASH, // 39 Send a simple flash + eQMI_VOICE_BURST_DTMF, // 40 Send a burst DTMF + eQMI_VOICE_START_CONT_DTMF, // 41 Starts a continuous DTMF + eQMI_VOICE_STOP_CONT_DTMF, // 42 Stops a continuous DTMF + eQMI_VOICE_DTMF_IND, // 43 DTMF event indication + eQMI_VOICE_SET_PRIVACY_PREF, // 44 Set privacy preference + eQMI_VOICE_PRIVACY_IND, // 45 Privacy change indication + eQMI_VOICE_ALL_STATUS_IND, // 46 Voice all call status indication + eQMI_VOICE_GET_ALL_STATUS, // 47 Get voice all call status + + eQMI_VOICE_MANAGE_CALLS = 49, // 49 Manage calls + eQMI_VOICE_SUPS_NOTIFICATION_IND, // 50 Supplementary service notifications + eQMI_VOICE_SET_SUPS_SERVICE, // 51 Manage supplementary service + eQMI_VOICE_GET_CALL_WAITING, // 52 Query sup service call waiting + eQMI_VOICE_GET_CALL_BARRING, // 53 Query sup service call barring + eQMI_VOICE_GET_CLIP, // 54 Query sup service CLIP + eQMI_VOICE_GET_CLIR, // 55 Query sup service CLIR + eQMI_VOICE_GET_CALL_FWDING, // 56 Query sup service call forwarding + eQMI_VOICE_SET_CALL_BARRING_PWD, // 57 Set call barring password + eQMI_VOICE_ORIG_USSD, // 58 Initiate USSD operation + eQMI_VOICE_ANSWER_USSD, // 59 Answer USSD request + eQMI_VOICE_CANCEL_USSD, // 60 Cancel USSD operation + eQMI_VOICE_USSD_RELEASE_IND, // 61 USSD release indication + eQMI_VOICE_USSD_IND, // 62 USSD request/notification indication + eQMI_VOICE_UUS_IND, // 63 UUS information indication + eQMI_VOICE_SET_CONFIG, // 64 Set config + eQMI_VOICE_GET_CONFIG, // 65 Get config + eQMI_VOICE_SUPS_IND, // 66 Sup service request indication + eQMI_VOICE_ASYNC_ORIG_USSD, // 67 Initiate USSD operation + eQMI_VOICE_ASYNC_USSD_IND = 67, // 67 USSD request/notification indication + + eQMI_VOICE_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageVoice validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageVoice msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_VOICE_INDICATION_REG) + || (msgID >= eQMI_VOICE_CALL_ORIGINATE && msgID <= eQMI_VOICE_CALL_ANSWER) + || (msgID >= eQMI_VOICE_GET_CALL_INFO && msgID <= eQMI_VOICE_GET_ALL_STATUS) + || (msgID >= eQMI_VOICE_MANAGE_CALLS && msgID < eQMI_VOICE_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageAUTH validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageAUTH msgID ) +{ + bool retVal = false; + if (msgID >= eQMI_AUTH_START_EAP && msgID < eQMI_AUTH_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageCAT Enumeration +// QMI CAT Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageCAT +{ + eQMI_CAT_ENUM_BEGIN = -1, + + eQMI_CAT_RESET, // 00 Reset CAT service state variables + eQMI_CAT_SET_EVENT, // 01 Set new message report conditions + eQMI_CAT_EVENT_IND = 1, // 01 New message report indication + + eQMI_CAT_GET_STATE = 32, // 32 Get service state information + eQMI_CAT_SEND_TERMINAL, // 33 Send a terminal response + eQMI_CAT_SEND_ENVELOPE, // 34 Send an envelope command + + eQMI_CAT_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageCAT validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageCAT msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_CAT_ENUM_BEGIN && msgID <= eQMI_CAT_EVENT_IND) + || (msgID >= eQMI_CAT_GET_STATE && msgID < eQMI_CAT_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageRMS Enumeration +// QMI RMS Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageRMS +{ + eQMI_RMS_ENUM_BEGIN = -1, + + eQMI_RMS_RESET, // 00 Reset RMS service state variables + + eQMI_RMS_GET_SMS_WAKE = 32, // 32 Get SMS wake settings + eQMI_RMS_SET_SMS_WAKE, // 33 Set SMS wake settings + + eQMI_RMS_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageRMS validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageRMS msgID ) +{ + bool retVal = false; + if ( (msgID == eQMI_RMS_RESET) + || (msgID >= eQMI_RMS_GET_SMS_WAKE && msgID < eQMI_RMS_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIMessageOMA Enumeration +// QMI OMA-DM Service Type Message ID Enumeration +/*=========================================================================*/ +enum eQMIMessageOMA +{ + eQMI_OMA_ENUM_BEGIN = -1, + + eQMI_OMA_RESET, // 00 Reset OMA service state variables + eQMI_OMA_SET_EVENT, // 01 Set OMA report conditions + eQMI_OMA_EVENT_IND = 1, // 01 OMA report indication + + eQMI_OMA_START_SESSION = 32, // 32 Start client inititated session + eQMI_OMA_CANCEL_SESSION, // 33 Cancel session + eQMI_OMA_GET_SESSION_INFO, // 34 Get session information + eQMI_OMA_SEND_SELECTION, // 35 Send selection for net inititated msg + eQMI_OMA_GET_FEATURES, // 36 Get feature settings + eQMI_OMA_SET_FEATURES, // 37 Set feature settings + + eQMI_OMA_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIMessageOMA validity check + +PARAMETERS: + msgID [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIMessageOMA msgID ) +{ + bool retVal = false; + if ( (msgID > eQMI_OMA_ENUM_BEGIN && msgID <= eQMI_OMA_EVENT_IND) + || (msgID >= eQMI_OMA_START_SESSION && msgID < eQMI_OMA_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIResultCode Enumeration +// QMI Result Code Enumeration +/*=========================================================================*/ +enum eQMIResultCode +{ + eQMI_RC_ENUM_BEGIN = -1, + + eQMI_RC_SUCCESS, // 00 Success + eQMI_RC_ERROR, // 01 Error + + eQMI_RC_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIResultCode validity check + +PARAMETERS: + rc [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIResultCode rc ) +{ + bool retVal = false; + if (rc > eQMI_RC_ENUM_BEGIN && rc < eQMI_RC_ENUM_END) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMIErrorCode Enumeration +// QMI Error Code Enumeration +/*=========================================================================*/ +enum eQMIErrorCode +{ + eQMI_ERR_ENUM_BEGIN = -1, + + eQMI_ERR_NONE, // 00 + eQMI_ERR_MALFORMED_MSG, // 01 + eQMI_ERR_NO_MEMORY, // 02 + eQMI_ERR_INTERNAL, // 03 + eQMI_ERR_ABORTED, // 04 + eQMI_ERR_CLIENT_IDS_EXHAUSTED, // 05 + eQMI_ERR_UNABORTABLE_TRANSACTION, // 06 + eQMI_ERR_INVALID_CLIENT_ID, // 07 + eQMI_ERR_NO_THRESHOLDS, // 08 + eQMI_ERR_INVALID_HANDLE, // 09 + eQMI_ERR_INVALID_PROFILE, // 10 + eQMI_ERR_INVALID_PIN_ID, // 11 + eQMI_ERR_INCORRECT_PIN, // 12 + eQMI_ERR_NO_NETWORK_FOUND, // 13 + eQMI_ERR_CALL_FAILED, // 14 + eQMI_ERR_OUT_OF_CALL, // 15 + eQMI_ERR_NOT_PROVISIONED, // 16 + eQMI_ERR_MISSING_ARG, // 17 + eQMI_ERR_18, // 18 + eQMI_ERR_ARG_TOO_LONG, // 19 + eQMI_ERR_20, // 20 + eQMI_ERR_21, // 21 + eQMI_ERR_INVALID_TX_ID, // 22 + eQMI_ERR_DEVICE_IN_USE, // 23 + eQMI_ERR_OP_NETWORK_UNSUPPORTED, // 24 + eQMI_ERR_OP_DEVICE_UNSUPPORTED, // 25 + eQMI_ERR_NO_EFFECT, // 26 + eQMI_ERR_NO_FREE_PROFILE, // 27 + eQMI_ERR_INVALID_PDP_TYPE, // 28 + eQMI_ERR_INVALID_TECH_PREF, // 29 + eQMI_ERR_INVALID_PROFILE_TYPE, // 30 + eQMI_ERR_INVALID_SERVICE_TYPE, // 31 + eQMI_ERR_INVALID_REGISTER_ACTION, // 32 + eQMI_ERR_INVALID_PS_ATTACH_ACTION, // 33 + eQMI_ERR_AUTHENTICATION_FAILED, // 34 + eQMI_ERR_PIN_BLOCKED, // 35 + eQMI_ERR_PIN_ALWAYS_BLOCKED, // 36 + eQMI_ERR_UIM_UNINITIALIZED, // 37 + eQMI_ERR_MAX_QOS_REQUESTS_IN_USE, // 38 + eQMI_ERR_INCORRECT_FLOW_FILTER, // 39 + eQMI_ERR_NETWORK_QOS_UNAWARE, // 40 + eQMI_ERR_INVALID_QOS_ID, // 41 + eQMI_ERR_REQUESTED_NUM_UNSUPPORTED, // 42 + eQMI_ERR_INTERFACE_NOT_FOUND, // 43 + eQMI_ERR_FLOW_SUSPENDED, // 44 + eQMI_ERR_INVALID_DATA_FORMAT, // 45 + eQMI_ERR_GENERAL, // 46 + eQMI_ERR_UNKNOWN, // 47 + eQMI_ERR_INVALID_ARG, // 48 + eQMI_ERR_INVALID_INDEX, // 49 + eQMI_ERR_NO_ENTRY, // 50 + eQMI_ERR_DEVICE_STORAGE_FULL, // 51 + eQMI_ERR_DEVICE_NOT_READY, // 52 + eQMI_ERR_NETWORK_NOT_READY, // 53 + eQMI_ERR_WMS_CAUSE_CODE, // 54 + eQMI_ERR_WMS_MESSAGE_NOT_SENT, // 55 + eQMI_ERR_WMS_MESSAGE_DELIVERY_FAILURE, // 56 + eQMI_ERR_WMS_INVALID_MESSAGE_ID, // 57 + eQMI_ERR_WMS_ENCODING, // 58 + eQMI_ERR_AUTHENTICATION_LOCK, // 59 + eQMI_ERR_INVALID_TRANSITION, // 60 + eQMI_ERR_61, // 61 + eQMI_ERR_62, // 62 + eQMI_ERR_63, // 63 + eQMI_ERR_64, // 64 + eQMI_ERR_SESSION_INACTIVE, // 65 + eQMI_ERR_SESSION_INVALID, // 66 + eQMI_ERR_SESSION_OWNERSHIP, // 67 + eQMI_ERR_INSUFFICIENT_RESOURCES, // 68 + eQMI_ERR_DISABLED, // 69 + eQMI_ERR_INVALID_OPERATION, // 70 + eQMI_ERR_INVALID_QMI_CMD, // 71 + eQMI_ERR_WMS_TPDU_TYPE, // 72 + eQMI_ERR_WMS_SMSC_ADDR, // 73 + eQMI_ERR_INFO_UNAVAILABLE, // 74 + eQMI_ERR_SEGMENT_TOO_LONG, // 75 + eQMI_ERR_SEGMENT_ORDER, // 76 + eQMI_ERR_BUNDLING_NOT_SUPPORTED, // 77 + eQMI_ERR_78, // 78 + eQMI_ERR_POLICY_MISMATCH, // 79 + eQMI_ERR_SIM_FILE_NOT_FOUND, // 80 + eQMI_ERR_EXTENDED_EXTERNAL, // 81 + eQMI_ERR_ACCESS_DENIED, // 82 + eQMI_ERR_HARDWARE_RESTRICTED, // 83 + eQMI_ERR_ACK_NOT_SENT, // 84 + + eQMI_ERR_INCOMPATIBLE_STATE = 90, // 90 + eQMI_ERR_FDN_RESTRICT, // 91 + eQMI_ERR_SUPS_FAILURE_CAUSE, // 92 + eQMI_ERR_NO_RADIO, // 93 + eQMI_ERR_NOT_SUPPORTED, // 94 + + eQMI_ERR_CARD_CALL_CONTROL_FAILED = 96, // 96 + eQMI_ERR_NETWORK_ABORTED, // 97 + + eQMI_ERR_CAT_EVT_REG_FAILED, // 61441 + eQMI_ERR_CAT_INVALID_TR, // 61442 + eQMI_ERR_CAT_INVALID_ENV_CMD, // 61443 + eQMI_ERR_CAT_ENV_CMD_BUSY, // 61444 + eQMI_ERR_CAT_ENV_CMD_FAIL, // 61445 + + eQMI_ERR_ENUM_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMIErrorCode validity check + +PARAMETERS: + ec [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMIErrorCode ec ) +{ + bool retVal = false; + if ( (ec > eQMI_ERR_ENUM_BEGIN && ec <= eQMI_ERR_ACK_NOT_SENT) + || (ec >= eQMI_ERR_INCOMPATIBLE_STATE && ec <= eQMI_ERR_NOT_SUPPORTED) + || (ec == eQMI_ERR_CARD_CALL_CONTROL_FAILED) + || (ec == eQMI_ERR_NETWORK_ABORTED) + || (ec >= eQMI_ERR_CAT_EVT_REG_FAILED && ec < eQMI_ERR_ENUM_END) ) + { + retVal = true; + } + + return retVal; +}; + +/*=========================================================================*/ +// eQMICallEndReason Enumeration +// QMI Call End Reason Enumeration +/*=========================================================================*/ +enum eQMICallEndReason +{ + eQMI_CALL_END_REASON_BEGIN = -1, + + // General + eQMI_CALL_END_REASON_UNSPECIFIED = 1, // 1 + eQMI_CALL_END_REASON_CLIENT_END, // 2 + eQMI_CALL_END_REASON_NO_SRV, // 3 + eQMI_CALL_END_REASON_FADE, // 4 + eQMI_CALL_END_REASON_REL_NORMAL, // 5 + eQMI_CALL_END_REASON_ACC_IN_PROG, // 6 + eQMI_CALL_END_REASON_ACC_FAIL, // 7 + eQMI_CALL_END_REASON_REDIR_OR_HANDOFF, // 8 + eQMI_CALL_END_REASON_CLOSE_IN_PROGRESS, // 9 + eQMI_CALL_END_REASON_AUTH_FAILED, // 10 + eQMI_CALL_END_REASON_INTERNAL, // 11 + + // CDMA + eQMI_CALL_END_REASON_CDMA_LOCK = 500, // 500 + eQMI_CALL_END_REASON_INTERCEPT, // 501 + eQMI_CALL_END_REASON_REORDER, // 502 + eQMI_CALL_END_REASON_REL_SO_REJ, // 503 + eQMI_CALL_END_REASON_INCOM_CALL, // 504 + eQMI_CALL_END_REASON_ALERT_STOP, // 505 + eQMI_CALL_END_REASON_ACTIVATION, // 506 + eQMI_CALL_END_REASON_MAX_ACCESS_PROBE, // 507 + eQMI_CALL_END_REASON_CCS_NOT_SUPPORTED_BY_BS, // 508 + eQMI_CALL_END_REASON_NO_RESPONSE_FROM_BS, // 509 + eQMI_CALL_END_REASON_REJECTED_BY_BS, // 510 + eQMI_CALL_END_REASON_INCOMPATIBLE, // 511 + eQMI_CALL_END_REASON_ALREADY_IN_TC, // 512 + eQMI_CALL_END_REASON_USER_CALL_ORIG_DURING_GPS, // 513 + eQMI_CALL_END_REASON_USER_CALL_ORIG_DURING_SMS, // 514 + eQMI_CALL_END_REASON_NO_CDMA_SRV, // 515 + + // GSM/WCDMA + eQMI_CALL_END_REASON_CONF_FAILED = 1000, // 1000 + eQMI_CALL_END_REASON_INCOM_REJ, // 1001 + eQMI_CALL_END_REASON_NO_GW_SRV, // 1002 + eQMI_CALL_END_REASON_NETWORK_END, // 1003 + + eQMI_CALL_END_REASON_LLC_SNDCP_FAILURE, // 1004 + eQMI_CALL_END_REASON_INSUFFICIENT_RESOURCES, // 1005 + eQMI_CALL_END_REASON_OPTION_TEMP_OOO, // 1006 + eQMI_CALL_END_REASON_NSAPI_ALREADY_USED, // 1007 + eQMI_CALL_END_REASON_REGULAR_DEACTIVATION, // 1008 + eQMI_CALL_END_REASON_NETWORK_FAILURE, // 1009 + eQMI_CALL_END_REASON_UMTS_REATTACH_REQ, // 1010 + eQMI_CALL_END_REASON_UMTS_PROTOCOL_ERROR, // 1011 + eQMI_CALL_END_REASON_OPERATOR_BARRING, // 1012 + eQMI_CALL_END_REASON_UNKNOWN_APN, // 1013 + eQMI_CALL_END_REASON_UNKNOWN_PDP, // 1014 + eQMI_CALL_END_REASON_GGSN_REJECT, // 1015 + eQMI_CALL_END_REASON_ACTIVATION_REJECT, // 1016 + eQMI_CALL_END_REASON_OPTION_NOT_SUPPORTED, // 1017 + eQMI_CALL_END_REASON_OPTION_UNSUBSCRIBED, // 1018 + eQMI_CALL_END_REASON_QOS_NOT_ACCEPTED, // 1019 + eQMI_CALL_END_REASON_TFT_SEMANTIC_ERROR, // 1020 + eQMI_CALL_END_REASON_TFT_SYNTAX_ERROR, // 1021 + eQMI_CALL_END_REASON_UNKNOWN_PDP_CONTEXT, // 1022 + eQMI_CALL_END_REASON_FILTER_SEMANTIC_ERROR, // 1023 + eQMI_CALL_END_REASON_FILTER_SYNTAX_ERROR, // 1024 + eQMI_CALL_END_REASON_PDP_WITHOUT_ACTIVE_TFT, // 1025 + eQMI_CALL_END_REASON_INVALID_TRANSACTION_ID, // 1026 + eQMI_CALL_END_REASON_MESSAGE_SEMANTIC_ERROR, // 1027 + eQMI_CALL_END_REASON_INVALID_MANDATORY_INFO, // 1028 + eQMI_CALL_END_REASON_TYPE_UNSUPPORTED, // 1029 + eQMI_CALL_END_REASON_MSG_TYPE_WRONG_FOR_STATE, // 1030 + eQMI_CALL_END_REASON_UNKNOWN_INFO_ELEMENT, // 1031 + eQMI_CALL_END_REASON_CONDITIONAL_IE_ERROR, // 1032 + eQMI_CALL_END_REASON_MSG_WRONG_FOR_PROTOCOL, // 1033 + eQMI_CALL_END_REASON_APN_TYPE_CONFLICT, // 1034 + eQMI_CALL_END_REASON_NO_GPRS_CONTEXT, // 1035 + eQMI_CALL_END_REASON_FEATURE_NOT_SUPPORTED, // 1036 + + // CDMA 1xEV-DO (HDR) + eQMI_CALL_END_REASON_CD_GEN_OR_BUSY = 1500, // 1500 + eQMI_CALL_END_REASON_CD_BILL_OR_AUTH, // 1501 + eQMI_CALL_END_REASON_CHG_HDR, // 1502 + eQMI_CALL_END_REASON_EXIT_HDR, // 1503 + eQMI_CALL_END_REASON_HDR_NO_SESSION , // 1504 + eQMI_CALL_END_REASON_HDR_ORIG_DURING_GPS_FIX, // 1505 + eQMI_CALL_END_REASON_HDR_CS_TIMEOUT , // 1506 + eQMI_CALL_END_REASON_HDR_RELEASED_BY_CM, // 1507 + + eQMI_CALL_END_REASON_END +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eQMICallEndReason validity check + +PARAMETERS: + err [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eQMICallEndReason err ) +{ + if ( (err >= eQMI_CALL_END_REASON_UNSPECIFIED) + && (err <= eQMI_CALL_END_REASON_INTERNAL) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CDMA_LOCK) + && (err <= eQMI_CALL_END_REASON_NO_CDMA_SRV) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CONF_FAILED) + && (err <= eQMI_CALL_END_REASON_FEATURE_NOT_SUPPORTED) ) + { + return true; + } + + if ( (err >= eQMI_CALL_END_REASON_CD_GEN_OR_BUSY) + && (err <= eQMI_CALL_END_REASON_HDR_RELEASED_BY_CM) ) + { + return true; + } + + return false; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIProtocolServer.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIProtocolServer.cpp new file mode 100755 index 0000000..9ee6d1c --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIProtocolServer.cpp @@ -0,0 +1,425 @@ +/*=========================================================================== +FILE: + QMIProtocolServer.h + +DESCRIPTION: + QMI protocol server + +PUBLIC CLASSES AND METHODS: + cQMIProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "QMIProtocolServer.h" +#include "QMIBuffers.h" + +/*=========================================================================*/ +// cQMIProtocolServer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cQMIProtocolServer (Public Method) + +DESCRIPTION: + Constructor + +PARAMETERS: + serviceType [ I ] - QMI service type requested + bufferSzRx [ I ] - Size of data buffer for incoming data + logSz [ I ] - Size of log (number of buffers) + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQMIProtocolServer::cQMIProtocolServer( + eQMIService serviceType, + ULONG bufferSzRx, + ULONG logSz ) + : cProtocolServer( MapQMIServiceToProtocol( serviceType, false ), + MapQMIServiceToProtocol( serviceType, true ), + bufferSzRx, + logSz ), + mLastTID( (WORD)INVALID_QMI_TRANSACTION_ID ), + mService( serviceType ), + mMEID( "" ) + +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cQMIProtocolServer (Public Method) + +DESCRIPTION: + Destructor + +SEQUENCING: + None (constructs sequencing objects) + +RETURN VALUE: + None +===========================================================================*/ +cQMIProtocolServer::~cQMIProtocolServer() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the configured QMI service using the given QMI + control file + +PARAMETERS: + pControlFile [ I ] - QMI control file + +SEQUENCING: + This method is sequenced according to the command event, i.e. any + other thread that needs to send a command to the protocol server + thread will block until this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::Connect( LPCSTR pControlFile ) +{ + // Assume failure + bool bRC = false; + if (IsValid( mService ) == false || mService == eQMI_SVC_CONTROL) + { + return bRC; + } + + // Store the MEID + mMEID = GetDeviceMEID( pControlFile ); + + // Pass service file to base class for actual connection + bRC = cProtocolServer::Connect( pControlFile ); + + if (bRC == false) + { + TRACE( "QMI connect %d failed\n", mService ); + } + + return bRC; +} + +/*=========================================================================== +METHOD: + GetDeviceMEID (Internal Method) + +DESCRIPTION: + Get device MEID by interfacing to the given QMI control file + +PARAMETERS: + deviceNode [ I ] - QMI device node + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + std::string (empty upon failure) +===========================================================================*/ +std::string cQMIProtocolServer::GetDeviceMEID( std::string deviceNode ) +{ + std::string retStr = ""; + + int devHandle = open( deviceNode.c_str(), 0 ); + if (devHandle == INVALID_HANDLE_VALUE) + { + return retStr; + } + + char devMEID[15]; + memset( &devMEID[0], 0, 15 ); + + if (ioctl( devHandle, QMI_GET_MEID_IOCTL, &devMEID[0] ) != 0) + { + close( devHandle ); + return retStr; + } + + // Enforce null + devMEID[14] = 0; + + retStr = &devMEID[0]; + + close( devHandle ); +} + +/*=========================================================================== +METHOD: + ValidateRequest (Internal Method) + +DESCRIPTION: + Validate a request that is about to be scheduled + +SEQUENCING: + This method is sequenced according to the command event, i.e. any + other thread that needs to send a command to the protocol server + thread will block until this method completes + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::ValidateRequest( const sProtocolRequest & req ) +{ + if (cProtocolServer::ValidateRequest( req ) == false) + { + return false; + } + + sQMIServiceBuffer qmiReq( req.GetSharedBuffer() ); + return qmiReq.IsValid(); +} + +/*=========================================================================== +METHOD: + InitializeComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port initialization + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::InitializeComm() +{ + // Setup the QMI Service type + int result = mComm.RunIOCTL( QMI_GET_SERVICE_FILE_IOCTL, + (void*)(unsigned long)mService ); + + if (result == 0) + { + return true; + } + else + { + return false; + } +} + +/*=========================================================================== +METHOD: + CleanupComm (Internal Method) + +DESCRIPTION: + Perform protocol specific communications port cleanup + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::CleanupComm() +{ + mComm.RunIOCTL(0x8BE4, NULL); + // Nothing to actually do here + return true; +} + +/*=========================================================================== +METHOD: + DecodeRxData (Internal Method) + +DESCRIPTION: + Decode incoming data into QMI indications/responses + +PARAMETERS: + bytesReceived [ I ] - Number of bytes to decoded + rspIdx [ O ] - Log index of last valid response (not used) + bAbortTx [ O ] - Response aborts current transmission? (not used) + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool - Was a response received? +===========================================================================*/ +bool cQMIProtocolServer::DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ) +{ + // Assume failure + bool bRC = false; + + rspIdx = INVALID_LOG_INDEX; + bAbortTx = false; + + // Something to decode from? + if (bytesReceived == 0) + { + return bRC; + } + + // Set protocol type (we have to be dealing with a valid QMI service) + eProtocolType pt = MapQMIServiceToProtocol( mService, false ); + if (pt == ePROTOCOL_ENUM_BEGIN) + { + return bRC; + } + + sSharedBuffer * pTmp = 0; + pTmp = new sSharedBuffer( mpRxBuffer, bytesReceived, pt ); + if (pTmp != 0) + { + sQMIServiceBuffer tmpBuf( pTmp ); + if (tmpBuf.IsValid() == true) + { + rspIdx = mLog.AddBuffer( tmpBuf ); + if (IsResponse( tmpBuf ) == true) + { + bRC = true; + } + else + { + rspIdx = INVALID_LOG_INDEX; + } + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + EncodeTxData (Internal Method) + +DESCRIPTION: + Encode data for transmission + +PARAMETERS: + pBuffer [ I ] - Data to be encoded + bEncoded [ O ] - Do we even encode data? + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + sSharedBuffer * - Encoded data (0 upon error when encoding is indicated) +===========================================================================*/ +sSharedBuffer * cQMIProtocolServer::EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ) +{ + WORD tid = ++mLastTID; + if (tid == (WORD)INVALID_QMI_TRANSACTION_ID) + { + tid++; + } + + sQMIServiceBuffer tmpBuf( pBuffer ); + tmpBuf.SetTransactionID( tid ); + + // No actual encoding required as we alter the original request + bEncoded = false; + return 0; +}; + +/*=========================================================================== +METHOD: + IsResponse (Internal Method) + +DESCRIPTION: + Is the passed in data a response to the current request? + +PARAMETERS: + rsp [ I ] - Candidate response + +SEQUENCING: + None (must be called from protocol server thread) + +RETURN VALUE: + bool +===========================================================================*/ +bool cQMIProtocolServer::IsResponse( const sProtocolBuffer & rsp ) +{ + // Assume not + bool bRC = false; + if ( (mpActiveRequest == 0) + || (mpActiveRequest->mRequest.IsValid() == false) + || (mpActiveRequest->mbWaitingForResponse == false) + || (rsp.IsValid() == false) ) + { + return bRC; + } + + sQMIServiceBuffer qmiReq( mpActiveRequest->mRequest.GetSharedBuffer() ); + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + + if (qmiReq.IsValid() == false || qmiRsp.IsValid() == false) + { + return bRC; + } + + if (qmiRsp.IsResponse() == false) + { + return bRC; + } + + WORD reqID = qmiReq.GetTransactionID(); + WORD rspID = qmiRsp.GetTransactionID(); + + if ( (reqID == (WORD)INVALID_QMI_TRANSACTION_ID) + || (rspID == (WORD)INVALID_QMI_TRANSACTION_ID) + || (reqID != rspID) ) + { + return bRC; + } + + // Sadly there are documentated cases of firmware returning responses + // with a matching transaction ID but a mismatching message ID. There + // is no reason for this to be considered valid behavior as of yet + ULONG reqMsgID = qmiReq.GetMessageID(); + ULONG rspMsgID = qmiRsp.GetMessageID(); + + if (reqMsgID != rspMsgID) + { + return bRC; + } + + bRC = true; + return bRC; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIProtocolServer.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIProtocolServer.h new file mode 100755 index 0000000..1276de9 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/QMIProtocolServer.h @@ -0,0 +1,128 @@ +/*=========================================================================== +FILE: + QMIProtocolServer.h + +DESCRIPTION: + QMI protocol server + +PUBLIC CLASSES AND METHODS: + cQMIProtocolServer + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolServer.h" +#include "QMIEnum.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cQMIProtocolServer +/*=========================================================================*/ +class cQMIProtocolServer : public cProtocolServer +{ + public: + // Constructor + cQMIProtocolServer( + eQMIService serviceType, + ULONG bufferSzRx, + ULONG logSz ); + + // Destructor + virtual ~cQMIProtocolServer(); + + // Connect to the given QMI service using the configured QMI + // control file + bool Connect( LPCSTR pControlFile ); + + // (Inline) Return the device MEID + std::string GetMEID() + { + return mMEID; + }; + + // (Inline) Return the QMI service type + eQMIService GetServiceType() + { + return mService; + }; + + // Get device MEID by interfacing to the given device node + static std::string GetDeviceMEID( std::string deviceNode ); + + protected: + // Validate a request that is about to be scheduled + virtual bool ValidateRequest( const sProtocolRequest & req ); + + // Perform protocol specific communications port initialization + virtual bool InitializeComm(); + + // Perform protocol specific communications port cleanup + virtual bool CleanupComm(); + + // Decode incoming data into packets returning the last response + virtual bool DecodeRxData( + ULONG bytesReceived, + ULONG & rspIdx, + bool & bAbortTx ); + + // Encode data for transmission + virtual sSharedBuffer * EncodeTxData( + sSharedBuffer * pBuffer, + bool & bEncoded ); + + // Is the passed in data a response to the current request? + virtual bool IsResponse( const sProtocolBuffer & rsp ); + + // (Inline) Is the passed in data a response that aborts the + // current request? + virtual bool IsTxAbortResponse( const sProtocolBuffer & /* rsp */ ) + { + // QMI doesn't necessarily require this + return false; + }; + + /* Current transaction ID */ + SHORT mLastTID; + + /* Type of QMI service we are serving */ + eQMIService mService; + + /* Device MEID */ + std::string mMEID; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/SharedBuffer.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Core/SharedBuffer.cpp new file mode 100755 index 0000000..74334e8 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/SharedBuffer.cpp @@ -0,0 +1,382 @@ +/*=========================================================================== +FILE: + SharedBuffer.cpp + +DESCRIPTION: + Shareable protocol structures and affliated methods + +PUBLIC CLASSES AND METHODS: + + sSharedBuffer + Simple struct to represent a reference counted shareable (no copy) + buffer, as the basis for all buffer related classes + + sDiagBuffer + Simple struct to represent a DIAG buffer using a reference counted + (shared) buffer, this allows us to use in in several places without + copying it once in each place. A few base services are provided + but the main purpose is to provide a class to inherit off of for + DIAG command code specific DIAG buffers + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "SharedBuffer.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Synchronization object +struct sSharedBufferSync +{ + public: + // Constructor + sSharedBufferSync() + : mbInitialized( false ) + { + int nRet = pthread_mutex_init( &mSyncSection, NULL ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to init sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + mbInitialized = true; + }; + + // Destructor + ~sSharedBufferSync() + { + mbInitialized = false; + int nRet = pthread_mutex_destroy( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to destroy sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + } + + }; + + // Lock sync object + void Lock() + { + if (mbInitialized == true) + { + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to lock sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + } + }; + + // Unlock sync object + void Unlock() + { + if (mbInitialized == true) + { + int nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SharedBuffer: Unable to unlock sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + + } + }; + + protected: + /* DIAG buffer critical section */ + pthread_mutex_t mSyncSection; + + /* Has this object been initialized? */ + bool mbInitialized; +}; + +// Global (across all shared buffers) reference count guard +sSharedBufferSync gRefCount; + +/*=========================================================================*/ +// sSharedBuffer Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + sSharedBuffer (Public Method) + +DESCRIPTION: + Constructor (copy passed in buffer) + +PARAMETERS: + pDataToCopy [ I ] - The data buffer to copy (should be non-zero) + dataLen [ I ] - The length of the above buffer (should be > 1) + dataType [ I ] - Type of data (not used internal to class) + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::sSharedBuffer( + const BYTE * pDataToCopy, + ULONG dataLen, + ULONG dataType ) + : mpData( 0 ), + mSize( 0 ), + mType( dataType ), + mRefCount( 0 ) +{ + // Length not too small/not too big? + if (IsValidSize( dataLen ) == true) + { + // Yes, data actually exists? + if (pDataToCopy != 0) + { + // Yes, try to allocate memory + mpData = new BYTE[dataLen]; + if (mpData != 0) + { + // Now copy into our allocation + memcpy( (PVOID)mpData, + (LPCVOID)pDataToCopy, + (SIZE_T)dataLen ); + + // Now set the size, we do this last so that our double + // deletion logic is only applied if we had an allocation + // in the first place + mSize = dataLen; + } + } + } +} + +/*=========================================================================== +METHOD: + sSharedBuffer (Public Method) + +DESCRIPTION: + Constructor (assume ownership of passed in buffer) + +PARAMETERS: + dataLen [ I ] - The length of the above buffer (should be > 1) + pDataToOwn [ I ] - The data buffer to assume ownership of (should + be non-zero) + + dataType [ I ] - Type of data (not used internal to class) + + NOTE: The order is intentionally reversed from the previous constructor + to avoid any cases of mistaken identity (copy versus assume ownership) + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::sSharedBuffer( + ULONG dataLen, + PBYTE pDataToOwn, + ULONG dataType ) + : mpData( 0 ), + mSize( 0 ), + mType( dataType ), + mRefCount( 0 ) +{ + // Data actually exists? + if (pDataToOwn != 0) + { + // Yes, length not too small/not too big? + if (IsValidSize( dataLen ) == true) + { + // Yes, assume ownership of the passed in buffer + mpData = pDataToOwn; + mSize = dataLen; + } + else + { + // This data buffer is not acceptable to us, but we have assumed + // ownership of the memory which we will now free + delete [] pDataToOwn; + } + } +} + +/*=========================================================================== +METHOD: + ~sSharedBuffer (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +sSharedBuffer::~sSharedBuffer() +{ + ASSERT( mRefCount == 0 ); + + // Buffer data to free? + if (mpData != 0) + { + // Yes, zero first byte for caution and then delete it + mpData[0] = 0; + delete [] mpData; + + // Even more caution, zero out pointer + mpData = 0; + } + else if (mSize != 0) + { + ASSERT( (PVOID)("Double deletion detected in ~sSharedBuffer") == 0 ); + } +} + +/*=========================================================================== +METHOD: + operator == (Public Method) + +DESCRIPTION: + Equality operator + +RETURN VALUE: + bool +===========================================================================*/ +bool sSharedBuffer::operator == ( const sSharedBuffer & refBuf ) const +{ + // Assume they are not equal + bool bEq = false; + + // The buffers must be the same + if (mpData == refBuf.mpData) + { + if (mSize == refBuf.mSize) + { + if (mRefCount == refBuf.mRefCount) + { + if (mType == refBuf.mType) + { + // The shared buffers are the same + bEq = true; + } + } + else + { + // Very odd - the buffers are the same, but not the ref count?!? + ASSERT( 0 ); + } + } + else + { + // Very odd - the buffers are the same, but not the size?!? + ASSERT( 0 ); + } + } + + return bEq; +} + +/*=========================================================================== +METHOD: + operator != (Public Method) + +DESCRIPTION: + Inequality operator + +RETURN VALUE: + bool +===========================================================================*/ +bool sSharedBuffer::operator != ( const sSharedBuffer & refBuf ) const +{ + if (*this == refBuf) + { + return false; + } + + return true; +} + +/*=========================================================================== +METHOD: + AddRef (Internal Method) + +DESCRIPTION: + Increment reference count + +RETURN VALUE: + None +===========================================================================*/ +void sSharedBuffer::AddRef() +{ + gRefCount.Lock(); + mRefCount++; + gRefCount.Unlock(); +} + +/*=========================================================================== +METHOD: + Release (Internal Method) + +DESCRIPTION: + Release reference, delete if reference count zero + +RETURN VALUE: + None +===========================================================================*/ +void sSharedBuffer::Release() +{ + gRefCount.Lock(); + + ASSERT( mRefCount != 0 ); + + // Decrement reference count + if (mRefCount > 0) + { + mRefCount--; + } + + // ... and delete if reference count now 0 + if (mRefCount == 0) + { + delete this; + } + + gRefCount.Unlock(); +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/SharedBuffer.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/SharedBuffer.h new file mode 100755 index 0000000..c2d4bc7 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/SharedBuffer.h @@ -0,0 +1,166 @@ +/*=========================================================================== +FILE: + SharedBuffer.h + +DESCRIPTION: + Shareable buffer structures and affliated methods + +PUBLIC CLASSES AND METHODS: + sSharedBuffer + Simple struct to represent a reference counted shareable (no copy) + buffer, as the basis for all buffer related classes + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Forward Declarations +//--------------------------------------------------------------------------- +struct sProtocolBuffer; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum size of a shared buffer +const ULONG MAX_SHARED_BUFFER_SIZE = 1024 * 16 + 256; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sSharedBuffer +// +// Simple struct to represent a reference counted shareable (no copy) +// buffer, as the basis for all buffer related classes +// +// NOTE: Do *NOT* create instances of this structure on the stack, it +// must be dynamically allocated in order to function correctly +/*=========================================================================*/ +struct sSharedBuffer +{ + public: + // Constructor (copy passed in buffer) + sSharedBuffer( + const BYTE * pDataToCopy, + ULONG dataLen, + ULONG dataType ); + + // Constructor (assume ownership of passed in buffer) + sSharedBuffer( + ULONG dataLen, + PBYTE pDataToOwn, + ULONG dataType ); + + // Destructor + virtual ~sSharedBuffer(); + + // Equality operator + bool operator == ( const sSharedBuffer & ) const; + + // Inequality operator + bool operator != ( const sSharedBuffer & ) const; + + // (Inline) Get buffer + const BYTE * GetBuffer() const + { + return mpData; + }; + + // (Inline) Get buffer size + ULONG GetSize() const + { + return mSize; + }; + + // (Inline) Get buffer type + ULONG GetType() const + { + return mType; + }; + + // (Inline) Is this buffer valid? + bool IsValid() const + { + return (mpData != 0 && IsValidSize( mSize )); + }; + + // (Inline) Get reference count + ULONG GetRefCount() const + { + return mRefCount; + }; + + // (Static Inline) Is the passed in size within the allowable range + // a shared buffer? + static bool IsValidSize( ULONG sz ) + { + return (sz > 0 && sz <= MAX_SHARED_BUFFER_SIZE); + }; + + protected: + // Add reference + void AddRef(); + + // Release reference, delete if reference count zero + void Release(); + + /* Data */ + PBYTE mpData; + + /* Size of data */ + ULONG mSize; + + /* Type of data */ + ULONG mType; + + /* Reference count */ + ULONG mRefCount; + + private: + // Leave copy constructor and assignment operator unimplemented + // to prevent unintentional and unauthorized copying of the object + // (which would lead to bad reference counting) + sSharedBuffer( const sSharedBuffer & ); + sSharedBuffer & operator = ( const sSharedBuffer & ); + + friend struct sProtocolBuffer; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/StdAfx.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/StdAfx.h new file mode 100755 index 0000000..ebc9bb9 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/StdAfx.h @@ -0,0 +1,172 @@ +/*=========================================================================== +FILE: + StdAfx.h + +DESCRIPTION: + Application Framework eXtenstions for Linux + +PUBLIC CLASSES AND FUNCTIONS: + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once +//--------------------------------------------------------------------------- +// Includes +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//--------------------------------------------------------------------------- +// Macro defination +//--------------------------------------------------------------------------- + +#define ASSERT( x ) assert( x ) + +#ifdef DEBUG + #define TRACE printf +#else + #define TRACE(...) +#endif + +//--------------------------------------------------------------------------- +// data type defination +//--------------------------------------------------------------------------- +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef CONST +#define CONST const +#endif + +typedef void VOID; +typedef unsigned long DWORD; +typedef int BOOL; +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef float FLOAT; +typedef long long LONGLONG; +typedef unsigned long long ULONGLONG; +typedef signed char INT8; +typedef double DOUBLE; + +typedef int INT; +typedef unsigned int UINT; +typedef unsigned int * PUINT; +typedef INT HANDLE; +typedef HANDLE HMODULE; + +typedef char CHAR; +typedef short SHORT; +typedef long LONG; + +typedef unsigned long ULONG; +typedef ULONG * PULONG; +typedef unsigned short USHORT; +typedef USHORT * PUSHORT; +typedef unsigned char UCHAR; +typedef UCHAR * PUCHAR; +typedef char * PSZ; + + +typedef CONST CHAR * LPCSTR; +typedef CHAR * LPSTR; + +typedef BYTE * PBYTE; +typedef BOOL * PBOOL; +typedef INT * PINT; +typedef UINT * LPINT; +typedef WORD * PWORD; +typedef PWORD LPWORD; +typedef LONG * LPLONG; +typedef DWORD * PDWORD; +typedef VOID * PVOID; +typedef PVOID LPVOID; +typedef const void * LPCVOID; + +typedef size_t SIZE_T; +typedef double DATE; + +// Error code +#define NO_ERROR 0L +#define ERROR_SUCCESS 0L +#define ERROR_NO_MORE_ITEMS 259L +#define ERROR_CRC 23L +#define ERROR_OUTOFMEMORY 14L +#define ERROR_CAN_NOT_COMPLETE 1003L +#define ERROR_REVISION_MISMATCH 1306L +#define ERROR_BAD_ARGUMENTS 160L +#define INVALID_SET_FILE_POINTER -1 +#define VALID_HANDLE_VALUE 0 +#define INVALID_HANDLE_VALUE -1 +#define INVALID_FILE_SZ -1 + +#define ERROR_GEN_FAILURE 31L +#define ERROR_FILE_NOT_FOUND 2L +#define ERROR_NOT_ENOUGH_MEMORY 8L +#define ERROR_INVALID_PARAMETER 87L +#define ERROR_BAD_FORMAT 11L + + +// Other Constant definitions +#define MAX_PATH 512 +#define INFINITE 0xffffffff + + +// SIOCIWFIRSTPRIV = 0x8BE0 + +// Device I/O control code for setting QMI service +#define QMI_GET_SERVICE_FILE_IOCTL 0x8BE0 + 1 + +// Device I/O control code for obtaining device VIDPID +#define QMI_GET_VIDPID_IOCTL 0x8BE0 + 2 + +// Device I/O control code for obtaining device MEID +#define QMI_GET_MEID_IOCTL 0x8BE0 + 3 + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/SyncQueue.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/SyncQueue.h new file mode 100755 index 0000000..7c62e3f --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/SyncQueue.h @@ -0,0 +1,419 @@ +/*=========================================================================== +FILE: + SyncQueue.h + +DESCRIPTION: + Declaration/Implementation of cSyncQueue class + +PUBLIC CLASSES AND METHODS: + cSyncQueue + Synchronized shareable (across multiple threads) queue of + structures with event notifications + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +===========================================================================*/ + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include +#include "Event.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cSyncQueue +/*=========================================================================*/ +template class cSyncQueue +{ + public: + // (Inline) Constructor + cSyncQueue( + ULONG maxElements, + bool bSignalEvent = false ) + : mSignature( (ULONG)eSYNC_QUEUE_SIG ), + mSignalEvent(), + mbSignalEvent( bSignalEvent ), + mMaxElements( maxElements ), + mTotalElements( 0 ) + { + // Create sync CS + int nRet = pthread_mutex_init( &mSyncSection, NULL ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to init sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + }; + + // (Inline) Destructor + ~cSyncQueue() + { + if (IsValid() == false) + { + ASSERT( (PVOID)"Double deletion detected in ~cSyncQueue" == 0 ); + } + else + { + EmptyQueue(); + + mSignature = 0; + int nRet = pthread_mutex_destroy( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to destroy sync mutex." + " Error %d: %s\n", + nRet, + strerror( nRet ) ); + return; + } + } + + }; + + // (Inline) Add an element to the queue + bool AddElement( const tElementType & elem ) + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Are we out of space? + if ((ULONG)mElementDeque.size() >= mMaxElements) + { + // Yes, drop oldest element + mElementDeque.pop_front(); + } + + // Add new item to the queue + mElementDeque.push_back( elem ); + mTotalElements++; + + // Set event? + if (mbSignalEvent == true) + { + // Signal index of event + nRet = mSignalEvent.Set( mTotalElements - 1 ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to signal. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + } + + // Success! + bRC = true; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Add an element to the queue returning the index of + // the element + bool AddElement( + const tElementType & elem, + ULONG & idx ) + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Are we out of space? + if ((ULONG)mElementDeque.size() >= mMaxElements) + { + mElementDeque.pop_front(); + } + + // Add new item to the queue + mElementDeque.push_back( elem ); + idx = mTotalElements++; + + // Set event? + if (mbSignalEvent == true) + { + // Signal index of event + nRet = mSignalEvent.Set( mTotalElements - 1 ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to signal. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + } + + // Success! + bRC = true; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Return given element in the queue + bool GetElement( + ULONG idx, + tElementType & elem ) const + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + // Is this a current element index? + ULONG expiredIndices = mTotalElements - (ULONG)mElementDeque.size(); + if (idx >= expiredIndices) + { + // Yes, grab it from the deque + idx -= expiredIndices; + if (idx < (ULONG)mElementDeque.size()) + { + elem = mElementDeque[idx]; + bRC = true; + } + } + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + return bRC; + }; + + // (Inline) Empty element queue + bool EmptyQueue() + { + // Assume failure + bool bRC = false; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return bRC; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + + mElementDeque.clear(); + mTotalElements = 0; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return false; + } + + bRC = true; + return bRC; + }; + + // (Inline) Return the number of queued elements + ULONG GetQueueCount() const + { + ULONG elems = 0; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return elems; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + elems = (ULONG)mElementDeque.size(); + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + return elems; + }; + + // (Inline) Return the total number of elements added to queue + ULONG GetTotalCount() const + { + ULONG elems = 0; + if (IsValid() == false) + { + ASSERT( (PVOID)"Bad cSyncQueue object detected" == 0 ); + return elems; + } + + int nRet = pthread_mutex_lock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to lock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + elems = mTotalElements; + + nRet = pthread_mutex_unlock( &mSyncSection ); + if (nRet != 0) + { + TRACE( "SyncQueue: Unable to unlock sync mutex. Error %d: %s\n", + nRet, + strerror( nRet ) ); + return 0; + } + + return elems; + }; + + // (Inline) Return the signal event + cEvent & GetSignalEvent() const + { + return mSignalEvent; + }; + + // (Inline) Is this sync queue valid? + bool IsValid() const + { + return (mSignature == (ULONG)eSYNC_QUEUE_SIG); + }; + + protected: + // Object signature + enum eClassConstants + { + eSYNC_QUEUE_SIG = 0x1799A2BC + }; + + /* Object signature */ + ULONG mSignature; + + /* Multithreaded mutex type */ + mutable pthread_mutex_t mSyncSection; + + /* Signal event, set everytime an element is added (if configured) */ + mutable cEvent mSignalEvent; + + /* Use above signal event? */ + bool mbSignalEvent; + + /* Maximum number of elements to add to the deque */ + ULONG mMaxElements; + + /* Total number of elements added to the deque */ + ULONG mTotalElements; + + /* Element queue */ + std::deque mElementDeque; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/apidefs.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/apidefs.h new file mode 100644 index 0000000..42a3395 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/apidefs.h @@ -0,0 +1,21 @@ +/* Core/apidefs.h - API constants */ + +#ifndef GOBI_CORE_APIDEFS_H +#define GOBI_CORE_APIDEFS_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum GobiType { + GOBITYPE_UNKNOWN, + GOBITYPE_2K, + GOBITYPE_3K, +} GobiType; + +#ifdef __cplusplus +}; +#endif + +#endif /* !GOBI_CORE_APIDEFS_H */ + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Core/types.h b/gobi-api/fixed-GobiAPI-1.0.40/Core/types.h new file mode 100644 index 0000000..311cf4d --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Core/types.h @@ -0,0 +1,16 @@ +/* Core/types.h - basic sdk types */ + +#ifndef GOBI_CORE_TYPES_H +#define GOBI_CORE_TYPES_H + +typedef unsigned long ULONG; +typedef unsigned long long ULONGLONG; +typedef signed char INT8; +typedef unsigned char BYTE; +typedef char CHAR; +typedef unsigned short WORD; +typedef unsigned short USHORT; +typedef const char *LPCSTR; + +#endif /* !GOBI_CORE_TYPES_H */ + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Database/Makefile.am b/gobi-api/fixed-GobiAPI-1.0.40/Database/Makefile.am new file mode 100644 index 0000000..720a3fb --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Database/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS=QMI + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Entity.txt b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Entity.txt new file mode 100755 index 0000000..593b6e2 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Entity.txt @@ -0,0 +1,964 @@ +30^"32,1"^"CTL/Set Instance ID Request/Instance"^50900^-1^0 +30^"34,1"^"CTL/Get Client ID Request/Type"^50905^-1^0 +30^"35,1"^"CTL/Release Client ID Request/ID"^50906^-1^0 +30^"38,1"^"CTL/Set Data Format Request/Format"^50907^-1^0 +30^"38,16"^"CTL/Set Data Format Request/Protocol"^50908^-1^0 +30^"40,1"^"CTL/Set Event Report Request/Report"^50909^-1^0 +30^"41,1"^"CTL/Set Power Save Config Request/Descriptor"^50911^-1^0 +30^"41,17"^"CTL/Set Power Save Config Request/Permitted Set"^50912^-1^0 +30^"42,1"^"CTL/Set Power Save Mode Request/Mode"^50913^-1^0 +31^"32,1"^"CTL/Set Instance ID Response/Link"^50901^-1^0 +31^"32,2"^"CTL/Set Instance ID Response/Result Code"^50000^-1^0 +31^"33,1"^"CTL/Get Version Info Response/List"^50902^-1^0 +31^"33,2"^"CTL/Get Version Info Response/Result Code"^50000^-1^0 +31^"33,16"^"CTL/Get Version Info Response/Addendum"^50904^-1^0 +31^"34,1"^"CTL/Get Client ID Response/ID"^50906^-1^0 +31^"34,2"^"CTL/Get Client ID Response/Result Code"^50000^-1^0 +31^"35,1"^"CTL/Release Client ID Response/ID"^50906^-1^0 +31^"35,2"^"CTL/Release Client ID Response/Result Code"^50000^-1^0 +31^"38,2"^"CTL/Set Data Format Response/Result Code"^50000^-1^0 +31^"38,16"^"CTL/Set Data Format Response/Protocol"^50908^-1^0 +31^"40,2"^"CTL/Set Event Report Response/Result Code"^50000^-1^0 +31^"41,2"^"CTL/Set Power Save Config Response/Result Code"^50000^-1^0 +31^"42,2"^"CTL/Set Power Save Mode Response/Result Code"^50000^-1^0 +31^"43,1"^"CTL/Get Power Save Mode Response/Mode"^50913^-1^0 +31^"43,2"^"CTL/Get Power Save Mode Response/Result Code"^50000^-1^0 +32^"36,1"^"CTL/Release Client ID Indication/ID"^50906^-1^0 +32^"37,1"^"CTL/Invalid Client ID Indication/ID"^50906^-1^0 +32^"40,1"^"CTL/Event Report Indication/Report"^50910^-1^0 +33^"1,16"^"WDS/Set Event Report Request/Channel Rate Indicator"^50010^-1 +33^"1,17"^"WDS/Set Event Report Request/Transfer Statistics Indicator"^50011^-1 +33^"1,18"^"WDS/Set Event Report Request/Data Bearer Technology Indicator"^50012^-1 +33^"1,19"^"WDS/Set Event Report Request/Dormancy Status Indicator"^50041^-1 +33^"1,20"^"WDS/Set Event Report Request/MIP Status Indicator"^50087^-1 +33^"1,21"^"WDS/Set Event Report Request/Current Data Bearer Technology Indicator"^50012^-1 +33^"2,1"^"WDS/Abort Request/Transaction ID"^50001^-1 +33^"32,16"^"WDS/Start Network Interface Request/Primary DNS"^50021^-1 +33^"32,17"^"WDS/Start Network Interface Request/Secondary DNS"^50021^-1 +33^"32,18"^"WDS/Start Network Interface Request/Primary NBNS"^50021^-1 +33^"32,19"^"WDS/Start Network Interface Request/Secondary NBNS"^50021^-1 +33^"32,20"^"WDS/Start Network Interface Request/Context APN Name"^50022^-1 +33^"32,21"^"WDS/Start Network Interface Request/IP Address"^50021^-1 +33^"32,22"^"WDS/Start Network Interface Request/Authentication"^50023^-1 +33^"32,23"^"WDS/Start Network Interface Request/Username"^50024^-1 +33^"32,24"^"WDS/Start Network Interface Request/Password"^50025^-1 +33^"32,25"^"WDS/Start Network Interface Request/IP Family"^50097^-1 +33^"32,48"^"WDS/Start Network Interface Request/Technology Preference"^50026^-1 +33^"32,49"^"WDS/Start Network Interface Request/3GPP Profile Identifier"^50027^-1 +33^"32,50"^"WDS/Start Network Interface Request/3GPP2 Profile Identifier"^50027^-1 +33^"32,51"^"WDS/Start Network Interface Request/Autoconnect"^50045^-1 +33^"32,52"^"WDS/Start Network Interface Request/Extended Technology Preference"^50095^-1 +33^"32,53"^"WDS/Start Network Interface Request/Call Type"^50096^-1 +33^"33,1"^"WDS/Stop Network Interface Request/Packet Data Handle"^50028^-1 +33^"33,16"^"WDS/Stop Network Interface Request/Autoconnect"^50046^-1 +33^"36,1"^"WDS/Get Packet Statistics Request/Packet Stats Mask"^50032^-1 +33^"39,1"^"WDS/Create Profile Request/Profile Type"^50033^-1 +33^"39,16"^"WDS/Create Profile Request/Profile Name"^50034^-1 +33^"39,17"^"WDS/Create Profile Request/PDP Type"^50035^-1 +33^"39,20"^"WDS/Create Profile Request/APN Name"^50022^-1 +33^"39,21"^"WDS/Create Profile Request/Primary DNS"^50021^-1 +33^"39,22"^"WDS/Create Profile Request/Secondary DNS"^50021^-1 +33^"39,23"^"WDS/Create Profile Request/UMTS Requested QoS"^50036^-1 +33^"39,24"^"WDS/Create Profile Request/UMTS Minimum QoS"^50036^-1 +33^"39,25"^"WDS/Create Profile Request/GPRS Requested QoS"^50037^-1 +33^"39,26"^"WDS/Create Profile Request/GPRS Minimum QoS"^50037^-1 +33^"39,27"^"WDS/Create Profile Request/Username"^50024^-1 +33^"39,28"^"WDS/Create Profile Request/Password"^50025^-1 +33^"39,29"^"WDS/Create Profile Request/Authentication"^50023^-1 +33^"39,30"^"WDS/Create Profile Request/IP Address"^50021^-1 +33^"39,31"^"WDS/Create Profile Request/P-CSCF"^50099^-1 +33^"40,1"^"WDS/Modify Profile Request/Profile Identifier"^50038^-1 +33^"40,16"^"WDS/Modify Profile Request/Profile Name"^50034^-1 +33^"40,17"^"WDS/Modify Profile Request/PDP Type"^50035^-1 +33^"40,20"^"WDS/Modify Profile Request/APN Name"^50022^-1 +33^"40,21"^"WDS/Modify Profile Request/Primary DNS"^50021^-1 +33^"40,22"^"WDS/Modify Profile Request/Secondary DNS"^50021^-1 +33^"40,23"^"WDS/Modify Profile Request/UMTS Requested QoS"^50036^-1 +33^"40,24"^"WDS/Modify Profile Request/UMTS Minimum QoS"^50036^-1 +33^"40,25"^"WDS/Modify Profile Request/GPRS Requested QoS"^50037^-1 +33^"40,26"^"WDS/Modify Profile Request/GPRS Minimum QoS"^50037^-1 +33^"40,27"^"WDS/Modify Profile Request/Username"^50024^-1 +33^"40,28"^"WDS/Modify Profile Request/Password"^50025^-1 +33^"40,29"^"WDS/Modify Profile Request/Authentication"^50023^-1 +33^"40,30"^"WDS/Modify Profile Request/IP Address"^50021^-1 +33^"40,31"^"WDS/Modify Profile Request/P-CSCF"^50099^-1 +33^"40,32"^"WDS/Modify Profile Request/PDP Access Control Flag"^60086^-1 +33^"40,33"^"WDS/Modify Profile Request/P-CSCF Address Using DHCP"^60087^-1 +33^"40,34"^"WDS/Modify Profile Request/IM CN Flag"^60088^-1 +33^"40,35"^"WDS/Modify Profile Request/Traffic Flow Template ID1 Parameters"^60018^-1 +33^"40,36"^"WDS/Modify Profile Request/Traffic Flow Template ID2 Parameters"^60018^-1 +33^"40,37"^"WDS/Modify Profile Request/PDP Context Number"^60020^-1 +33^"40,38"^"WDS/Modify Profile Request/PDP Context Secondary Flag"^60021^-1 +33^"40,39"^"WDS/Modify Profile Request/PDP Context Primary ID"^60022^-1 +33^"40,40"^"WDS/Modify Profile Request/IPv6 Address"^60023^-1 +33^"40,41"^"WDS/Modify Profile Request/Requested QoS"^60024^-1 +33^"40,42"^"WDS/Modify Profile Request/Minimum QoS"^60024^-1 +33^"40,43"^"WDS/Modify Profile Request/Primary IPv6"^60090^-1 +33^"40,44"^"WDS/Modify Profile Request/Secondary IPv6"^60090^-1 +33^"40,45"^"WDS/Modify Profile Request/Address Allocation Preference"^60028^-1 +33^"40,46"^"WDS/Modify Profile Request/LTE QoS Parameters"^60029^-1 +33^"40,144"^"WDS/Modify Profile Request/Negotiate DNS Server Prefrence"^60059^-1 +33^"40,145"^"WDS/Modify Profile Request/PPP Session Close Timer DO"^60060^-1 +33^"40,146"^"WDS/Modify Profile Request/PPP Session Close Timer 1X"^60061^-1 +33^"40,147"^"WDS/Modify Profile Request/Allow Linger"^60062^-1 +33^"40,148"^"WDS/Modify Profile Request/LCP ACK Timeout"^60063^-1 +33^"40,149"^"WDS/Modify Profile Request/IPCP ACK Timeout"^60064^-1 +33^"40,150"^"WDS/Modify Profile Request/Authentication Timeout"^60065^-1 +33^"40,154"^"WDS/Modify Profile Request/Authentication Protocol"^60069^-1 +33^"40,155"^"WDS/Modify Profile Request/User ID"^60070^-1 +33^"40,156"^"WDS/Modify Profile Request/Authentication Password"^60071^-1 +33^"40,157"^"WDS/Modify Profile Request/Data Rate"^60072^-1 +33^"40,158"^"WDS/Modify Profile Request/Application Type"^60073^-1 +33^"40,159"^"WDS/Modify Profile Request/Data Mode"^60074^-1 +33^"40,160"^"WDS/Modify Profile Request/Application Priority"^60075^-1 +33^"40,161"^"WDS/Modify Profile Request/APN String"^60076^-1 +33^"40,162"^"WDS/Modify Profile Request/PDN Type"^60077^-1 +33^"40,163"^"WDS/Modify Profile Request/P-CSCF Address Needed"^60078^-1 +33^"40,164"^"WDS/Modify Profile Request/Primary IPv4 Address"^60079^-1 +33^"40,165"^"WDS/Modify Profile Request/Secondary IPv4 Address"^60080^-1 +33^"40,166"^"WDS/Modify Profile Request/Primary IPv6 Address"^60081^-1 +33^"40,167"^"WDS/Modify Profile Request/Secondary IPv6 Address"^60082^-1 +33^"41,1"^"WDS/Delete Profile Request/Profile Identifier"^50038^-1 +33^"43,1"^"WDS/Get Profile Settings Request/Profile Identifier"^50038^-1 +33^"44,1"^"WDS/Get Default Settings Request/Profile Type"^50033^-1 +33^"45,16"^"WDS/Get Current Settings Request/Requested Settings"^50084^-1 +33^"46,1"^"WDS/Set MIP Mode Request/Mobile IP Mode"^50044^-1 +33^"56,1"^"WDS/Get Modem Info Request/Requested Status"^50051^-1 +33^"56,16"^"WDS/Get Modem Info Request/Connection Status Indicator"^50052^-1 +33^"56,17"^"WDS/Get Modem Info Request/Transfer Statistics Indicator"^50053^-1 +33^"56,18"^"WDS/Get Modem Info Request/Dormancy Status Indicator"^50041^-1 +33^"56,19"^"WDS/Get Modem Info Request/Data Bearer Technology Indicator"^50012^-1 +33^"56,20"^"WDS/Get Modem Info Request/Channel Rate Indicator"^50010^-1 +33^"61,1"^"WDS/Set Active MIP Profile Request/Index"^50056^-1 +33^"62,1"^"WDS/Get MIP Profile Request/Index"^50027^-1 +33^"63,1"^"WDS/Set MIP Profile Request/Index"^50056^-1 +33^"63,16"^"WDS/Set MIP Profile Request/State"^50057^-1 +33^"63,17"^"WDS/Set MIP Profile Request/Home Address"^50021^-1 +33^"63,18"^"WDS/Set MIP Profile Request/Primary Home Agent Address"^50021^-1 +33^"63,19"^"WDS/Set MIP Profile Request/Secondary Home Agent Address"^50021^-1 +33^"63,20"^"WDS/Set MIP Profile Request/Reverse Tunneling"^50058^-1 +33^"63,21"^"WDS/Set MIP Profile Request/NAI"^50059^-1 +33^"63,22"^"WDS/Set MIP Profile Request/HA SPI"^50060^-1 +33^"63,23"^"WDS/Set MIP Profile Requeste/AAA SPI"^50061^-1 +33^"63,24"^"WDS/Set MIP Profile Request/MN-HA"^50062^-1 +33^"63,25"^"WDS/Set MIP Profile Request/MN-AAA"^50063^-1 +33^"65,1"^"WDS/Set MIP Parameters Request/SPC"^50070^-1 +33^"65,16"^"WDS/Set MIP Parameters Request/Mobile IP Mode"^50044^-1 +33^"65,17"^"WDS/Set MIP Parameters Request/Retry Attempt Limit"^50064^-1 +33^"65,18"^"WDS/Set MIP Parameters Request/Retry Attempt Interval"^50065^-1 +33^"65,19"^"WDS/Set MIP Parameters Request/Re-Registration Period"^50066^-1 +33^"65,20"^"WDS/Set MIP Parameters Request/Re-Registration Only With Traffic"^50067^-1 +33^"65,21"^"WDS/Set MIP Parameters Request/MN-HA Authenticator Calculator"^50068^-1 +33^"65,22"^"WDS/Set MIP Parameters Request/MN-HA RFC 2002 BIS Authentication"^50069^-1 +33^"69,16"^"WDS/Get Call List Request/List Type"^50073^-1 +33^"70,1"^"WDS/Get Call Record Request/Record ID"^50077^-1 +33^"81,1"^"WDS/Set Autoconnect Setting Request/Autoconnect"^50045^-1 +33^"81,16"^"WDS/Set Autoconnect Setting Request/Roam"^60008^-1 +33^"83,16"^"WDS/Set DNS Setting Request/Primary"^60009^-1 +33^"83,17"^"WDS/Set DNS Setting Request/Secondary"^60009^-1 +33^"83,18"^"WDS/Set DNS Setting Request/Primary IPv6 Address"^60084^-1 +33^"83,19"^"WDS/Set DNS Setting Request/Secondary IPv6 Address"^60085^-1 +34^"0,2"^"WDS/Reset Response/Result Code"^50000^-1 +34^"1,2"^"WDS/Set Event Report Response/Result Code"^50000^-1 +34^"2,2"^"WDS/Abort Response/Result Code"^50000^-1 +34^"32,1"^"WDS/Start Network Interface Response/Packet Data Handle"^50028^-1 +34^"32,2"^"WDS/Start Network Interface Response/Result Code"^50000^-1 +34^"32,16"^"WDS/Start Network Interface Response/Call End Reason"^50043^-1 +34^"32,17"^"WDS/Start Network Interface Response/Verbose Call End Reason"^50098^-1 +34^"33,2"^"WDS/Stop Network Interface Response/Result Code"^50000^-1 +34^"34,1"^"WDS/Get Packet Service Status Response/Status"^50029^-1 +34^"34,2"^"WDS/Get Packet Service Status Response/Result Code"^50000^-1 +34^"35,1"^"WDS/Get Channel Rates Response/Channel Rates"^50031^-1 +34^"35,2"^"WDS/Get Channel Rates Response/Result Code"^50000^-1 +34^"36,2"^"WDS/Get Packet Statistics Response/Result Code"^50000^-1 +34^"36,16"^"WDS/Get Packet Statistics Response/TX Packet Successes"^50013^-1 +34^"36,17"^"WDS/Get Packet Statistics Response/RX Packet Successes"^50014^-1 +34^"36,18"^"WDS/Get Packet Statistics Response/TX Packet Errors"^50015^-1 +34^"36,19"^"WDS/Get Packet Statistics Response/RX Packet Errors"^50016^-1 +34^"36,20"^"WDS/Get Packet Statistics Response/TX Overflows"^50017^-1 +34^"36,21"^"WDS/Get Packet Statistics Response/RX Overflows"^50018^-1 +34^"36,25"^"WDS/Get Packet Statistics Response/TX Bytes"^50054^-1 +34^"36,26"^"WDS/Get Packet Statistics Response/RX Bytes"^50055^-1 +34^"36,27"^"WDS/Get Packet Statistics Response/Previous TX Bytes"^50079^-1 +34^"36,28"^"WDS/Get Packet Statistics Response/Previous RX Bytes"^50080^-1 +34^"37,2"^"WDS/Go Dormant Response/Result Code"^50000^-1 +34^"38,2"^"WDS/Go Active Response/Result Code"^50000^-1 +34^"39,1"^"WDS/Create Profile Response/Profile Identifier"^50038^-1 +34^"39,2"^"WDS/Create Profile Response/Result Code"^50000^-1 +34^"40,2"^"WDS/Modify Profile Response/Result Code"^50000^-1 +34^"40,151"^"WDS/Modify Profile Request/LCP Config Retry Count"^60066^-1 +34^"40,152"^"WDS/Modify Profile Request/IPCP Config Retry Count"^60067^-1 +34^"40,153"^"WDS/Modify Profile Request/Authentication Retry"^60068^-1 +34^"40,224"^"WDS/Modify Profile Request/Extended Error Code"^60083^-1 +34^"41,2"^"WDS/Delete Profile Response/Result Code"^50000^-1 +34^"42,1"^"WDS/Get Profile List Response/Profile List"^50039^-1 +34^"42,2"^"WDS/Get Profile List Response/Result Code"^50000^-1 +34^"43,2"^"WDS/Get Profile Settings Response/Result Code"^50000^-1 +34^"43,16"^"WDS/Get Profile Settings Response/Profile Name"^50034^-1 +34^"43,17"^"WDS/Get Profile Settings Response/PDP Type"^50035^-1 +34^"43,20"^"WDS/Get Profile Settings Response/APN Name"^50022^-1 +34^"43,21"^"WDS/Get Profile Settings Response/Primary DNS"^50021^-1 +34^"43,22"^"WDS/Get Profile Settings Response/Secondary DNS"^50021^-1 +34^"43,23"^"WDS/Get Profile Settings Response/UMTS Requested QoS"^50036^-1 +34^"43,24"^"WDS/Get Profile Settings Response/UMTS Minimum QoS"^50036^-1 +34^"43,25"^"WDS/Get Profile Settings Response/GPRS Requested QoS"^50037^-1 +34^"43,26"^"WDS/Get Profile Settings Response/GPRS Minimum QoS"^50037^-1 +34^"43,27"^"WDS/Get Profile Settings Response/Username"^50024^-1 +34^"43,29"^"WDS/Get Profile Settings Response/Authentication"^50023^-1 +34^"43,30"^"WDS/Get Profile Settings Response/IP Address"^50021^-1 +34^"43,31"^"WDS/Get Profile Settings Response/P-CSCF"^50099^-1 +34^"44,2"^"WDS/Get Default Settings Response/Result Code"^50000^-1 +34^"44,16"^"WDS/Get Default Settings Response/Profile Name"^50034^-1 +34^"44,17"^"WDS/Get Default Settings Response/PDP Type"^50035^-1 +34^"44,20"^"WDS/Get Default Settings Response/APN Name"^50022^-1 +34^"44,21"^"WDS/Get Default Settings Response/Primary DNS"^50021^-1 +34^"44,22"^"WDS/Get Default Settings Response/Secondary DNS"^50021^-1 +34^"44,23"^"WDS/Get Default Settings Response/UMTS Requested QoS"^50036^-1 +34^"44,24"^"WDS/Get Default Settings Response/UMTS Minimum QoS"^50036^-1 +34^"44,25"^"WDS/Get Default Settings Response/GPRS Requested QoS"^50037^-1 +34^"44,26"^"WDS/Get Default Settings Response/GPRS Minimum QoS"^50037^-1 +34^"44,27"^"WDS/Get Default Settings Response/Username"^50024^-1 +34^"44,28"^"WDS/Get Default Settings Response/Password"^50025^-1 +34^"44,29"^"WDS/Get Default Settings Response/Authentication"^50023^-1 +34^"44,30"^"WDS/Get Default Settings Response/IP Address"^50021^-1 +34^"44,31"^"WDS/Get Default Settings Response/P-CSCF"^50099^-1 +34^"44,32"^"WDS/Get Default Settings Response/PDP Access Control Flag"^60015^-1 +34^"44,33"^"WDS/Get Default Settings Response/P-CSCF Address Using DHCP"^60016^-1 +34^"44,34"^"WDS/Get Default Settings Response/IM CN Flag"^60017^-1 +34^"44,35"^"WDS/Get Default Settings Response/Traffic Flow Template ID1 Parameters"^60018^-1 +34^"44,36"^"WDS/Get Default Settings Response/Traffic Flow Template ID2 Parameters"^60019^-1 +34^"44,37"^"WDS/Get Default Settings Response/PDP Context Number"^60020^-1 +34^"44,38"^"WDS/Get Default Settings Response/PDP Context Secondary Flag"^60021^-1 +34^"44,39"^"WDS/Get Default Settings Response/PDP Context Primary ID"^60022^-1 +34^"44,40"^"WDS/Get Default Settings Response/IPv6 Address"^60023^-1 +34^"44,41"^"WDS/Get Default Settings Response/Requested QoS"^60024^-1 +34^"44,42"^"WDS/Get Default Settings Response/Minimum QoS"^60025^-1 +34^"44,43"^"WDS/Get Default Settings Response/Primary DNS IPv6 Address"^60026^-1 +34^"44,44"^"WDS/Get Default Settings Response/Secondary DNS IPv6 Address"^60027^-1 +34^"44,45"^"WDS/Get Default Settings Response/DHCP NAS Preference"^60028^-1 +34^"44,46"^"WDS/Get Default Settings Response/LTE QoS Parameters"^60029^-1 +34^"44,144"^"WDS/Get Default Settings Response/Negotiate DSN Server Preferences"^60030^-1 +34^"44,145"^"WDS/Get Default Settings Response/PPP Session CLose Timer DO"^60031^-1 +34^"44,146"^"WDS/Get Default Settings Response/PPP Session Close Timer 1X"^60032^-1 +34^"44,147"^"WDS/Get Default Settings Response/Allow Lingering Interface"^60033^-1 +34^"44,148"^"WDS/Get Default Settings Response/LCP ACK Timeout"^60034^-1 +34^"44,149"^"WDS/Get Default Settings Response/IPCP ACK Timeout"^60035^-1 +34^"44,150"^"WDS/Get Default Settings Response/Authentication Timeout"^60036^-1 +34^"44,151"^"WDS/Get Default Settings Response/LCP Config Retry Count"^60037^-1 +34^"44,152"^"WDS/Get Default Settings Response/IPCP Config Retry Count"^60038^-1 +34^"44,153"^"WDS/Get Default Settings Response/Authentication Retry"^60039^-1 +34^"44,154"^"WDS/Get Default Settings Response/Authentication Protocol"^60040^-1 +34^"44,155"^"WDS/Get Default Settings Response/User ID"^60041^-1^0^-1^0^0 +34^"44,156"^"WDS/Get Default Settings Response/Authentication Password"^60042^-1 +34^"44,157"^"WDS/Get Default Settings Response/Data Rate"^60043^-1 +34^"44,158"^"WDS/Get Default Settings Response/Application Type"^60044^-1 +34^"44,159"^"WDS/Get Default Settings Response/Data Mode"^60045^-1 +34^"44,160"^"WDS/Get Default Settings Response/Application Priority"^60046^-1 +34^"44,161"^"WDS/Get Default Settings Response/APN String"^60047^-1 +34^"44,162"^"WDS/Get Default Settings Response/PDN Type"^60048^-1 +34^"44,163"^"WDS/Get Default Settings Response/P-CSCF Address Needed"^60049^-1 +34^"44,164"^"WDS/Get Default Settings Response/Primary DNS Address"^60050^-1 +34^"44,165"^"WDS/Get Default Settings Response/Secondary DNS Address"^60051^-1 +34^"44,166"^"WDS/Get Default Settings Response/Primary IPv6 Address"^60052^-1 +34^"44,167"^"WDS/Get Default Settings Response/Secondary IPv6 Address"^60053^-1 +34^"44,224"^"WDS/Get Default Settings Response/Extended Error Code"^60054^-1 +34^"45,2"^"WDS/Get Current Settings Response/Result Code"^50000^-1 +34^"45,16"^"WDS/Get Current Settings Response/Profile Name"^50034^-1 +34^"45,17"^"WDS/Get Current Settings Response/PDP Type"^50035^-1 +34^"45,20"^"WDS/Get Current Settings Response/APN Name"^50022^-1 +34^"45,21"^"WDS/Get Current Settings Response/Primary DNS"^50021^-1 +34^"45,22"^"WDS/Get Current Settings Response/Secondary DNS"^50021^-1 +34^"45,23"^"WDS/Get Current Settings Response/UMTS Granted QoS"^50036^-1 +34^"45,25"^"WDS/Get Current Settings Response/GPRS Granted QoS"^50037^-1 +34^"45,27"^"WDS/Get Current Settings Response/Username"^50024^-1 +34^"45,29"^"WDS/Get Current Settings Response/Authentication"^50023^-1 +34^"45,30"^"WDS/Get Current Settings Response/IP Address"^50021^-1 +34^"45,31"^"WDS/Get Current Settings Response/Profile ID"^50038^-1 +34^"45,32"^"WDS/Get Current Settings Response/Gateway Address"^50021^-1 +34^"45,33"^"WDS/Get Current Settings Response/Gateway Subnet Mask"^50085^-1 +34^"45,34"^"WDS/Get Current Settings Response/P-CSCF"^50099^-1 +34^"45,35"^"WDS/Get Current Settings Response/P-CSCF Server Address List"^60000^-1 +34^"45,36"^"WDS/Get Current Settings Response/P-CSCF Domain Name List"^60001^-1 +34^"45,37"^"WDS/Get Current Settings Response/IPv6 Address"^60010^-1 +34^"45,38"^"WDS/Get Current Settings Response/IPv6 Gateway Address"^60011^-1 +34^"45,39"^"WDS/Get Current Settings Response/Primary IPv6 DNS"^60003^-1 +34^"45,40"^"WDS/Get Current Settings Response/Secondary IPv6 DNS"^60003^-1 +34^"45,41"^"WDS/Get Current Settings Response/MTU"^60004^-1 +34^"45,42"^"WDS/Get Current Settings Response/Domain Name List"^60005^-1 +34^"45,43"^"WDS/Get Current Settings Response/IP Family"^50097^-1 +34^"45,44"^"WDS/Get Current Settings Response/IM CN Flag"^60007^-1 +34^"45,45"^"WDS/Get Current Settings Response/Extended Technology"^50095^-1 +34^"45,46"^"WDS/Get Current Settings Response/P-CSCF IPv6 Address List"^60057^-1 +34^"46,2"^"WDS/Set MIP Mode Response/Result Code"^50000^-1 +34^"47,1"^"WDS/Get MIP Mode Response/Mobile IP Mode"^50044^-1 +34^"47,2"^"WDS/Get MIP Mode Response/Result Code"^50000^-1 +34^"48,1"^"WDS/Get Dormancy Response/Dormancy Status"^50042^-1 +34^"48,2"^"WDS/Get Dormancy Response/Result Code"^50000^-1 +34^"52,1"^"WDS/Get Autoconnect Setting Response/Autoconnect"^50045^-1 +34^"52,2"^"WDS/Get Autoconnect Setting Response/Result Code"^50000^-1 +34^"52,16"^"WDS/Get Autoconnect Setting Response/Roam"^60008^-1 +34^"53,1"^"WDS/Get Data Session Duration Response/Duration"^50047^-1 +34^"53,2"^"WDS/Get Data Session Duration Response/Result Code"^50000^-1 +34^"53,16"^"WDS/Get Data Session Duration Response/Previous Duration"^50081^-1 +34^"53,17"^"WDS/Get Data Session Duration Response/Active Duration"^50082^-1 +34^"53,18"^"WDS/Get Data Session Duration Response/Previous Active Duration"^50083^-1 +34^"54,1"^"WDS/Get Modem Status Response/Status"^50048^-1 +34^"54,2"^"WDS/Get Modem Status Response/Result Code"^50000^-1 +34^"54,16"^"WDS/Get Modem Status Response/Call End Reason"^50049^-1 +34^"55,1"^"WDS/Get Data Bearer Technology Response/Technology"^50020^-1 +34^"55,2"^"WDS/Get Data Bearer Technology Response/Result Code"^50000^-1 +34^"55,16"^"WDS/Get Data Bearer Technology Response/Last Call Technology"^50020^-1 +34^"56,2"^"WDS/Get Modem Info Response/Result Code"^50000^-1 +34^"56,16"^"WDS/Get Modem Info Response/Status"^50048^-1 +34^"56,17"^"WDS/Get Modem Info Response/Call End Reason"^50049^-1 +34^"56,18"^"WDS/Get Modem Info Response/TX Bytes"^50054^-1 +34^"56,19"^"WDS/Get Modem Info Response/RX Bytes"^50055^-1 +34^"56,20"^"WDS/Get Modem Info Response/Dormancy Status"^50042^-1 +34^"56,21"^"WDS/Get Modem Info Response/Technology"^50020^-1 +34^"56,22"^"WDS/Get Modem Info Response/Rates"^50031^-1 +34^"56,23"^"WDS/Get Modem Info Response/Previous TX Bytes"^50079^-1 +34^"56,24"^"WDS/Get Modem Info Response/Previous RX Bytes"^50080^-1 +34^"56,25"^"WDS/Get Modem Info Duration Response/Active Duration"^50082^-1 +34^"60,1"^"WDS/Get Active MIP Profile Response/Index"^50027^-1 +34^"60,2"^"WDS/Get Active MIP Profile Response/Result Code"^50000^-1 +34^"61,2"^"WDS/Set Active MIP Profile Response/Result Code"^50000^-1 +34^"62,2"^"WDS/Get MIP Profile Response/Result Code"^50000^-1 +34^"62,16"^"WDS/Get MIP Profile Response/State"^50057^-1 +34^"62,17"^"WDS/Get MIP Profile Response/Home Address"^50021^-1 +34^"62,18"^"WDS/Get MIP Profile Response/Primary Home Agent Address"^50021^-1 +34^"62,19"^"WDS/Get MIP Profile Response/Secondary Home Agent Address"^50021^-1 +34^"62,20"^"WDS/Get MIP Profile Response/Reverse Tunneling"^50058^-1 +34^"62,21"^"WDS/Get MIP Profile Response/NAI"^50059^-1 +34^"62,22"^"WDS/Get MIP Profile Response/HA SPI"^50060^-1 +34^"62,23"^"WDS/Get MIP Profile Response/AAA SPI"^50061^-1 +34^"62,26"^"WDS/Get MIP Profile Response/HA State"^50086^-1 +34^"62,27"^"WDS/Get MIP Profile Response/AAA State"^50086^-1 +34^"63,2"^"WDS/Set MIP Profile Response/Result Code"^50000^-1 +34^"64,2"^"WDS/Get MIP Parameters Response/Result Code"^50000^-1 +34^"64,16"^"WDS/Get MIP Parameters Response/Mobile IP Mode"^50044^-1 +34^"64,17"^"WDS/Get MIP Parameters Response/Retry Attempt Limit"^50064^-1 +34^"64,18"^"WDS/Get MIP Parameters Response/Retry Attempt Interval"^50065^-1 +34^"64,19"^"WDS/Get MIP Parameters Response/Re-Registration Period"^50066^-1 +34^"64,20"^"WDS/Get MIP Parameters Response/Re-Registration Only With Traffic"^50067^-1 +34^"64,21"^"WDS/Get MIP Parameters Response/MN-HA Authenticator Calculator"^50068^-1 +34^"64,22"^"WDS/Get MIP Parameters Response/MN-HA RFC 2002 BIS Authentication"^50069^-1 +34^"65,2"^"WDS/Set MIP Parameters Response/Result Code"^50000^-1 +34^"66,1"^"WDS/Get Last MIP Status Response/Status"^50071^-1 +34^"66,2"^"WDS/Get Last MIP Status Response/Result Code"^50000^-1 +34^"67,1"^"WDS/Get AN-AAA Authentication Status Response/Status"^50072^-1 +34^"67,2"^"WDS/Get AN-AAA Authentication Status Response/Result Code"^50000^-1 +34^"68,1"^"WDS/Get Current Data Bearer Technology Response/Technology"^50090^-1 +34^"68,2"^"WDS/Get Current Data Bearer Technology Response/Result Code"^50000^-1 +34^"69,2"^"WDS/Get Call List Response/Result Code"^50000^-1 +34^"69,16"^"WDS/Get Call List Response/Full List"^50074^-1 +34^"69,17"^"WDS/Get Call List Response/ID List"^50076^-1 +34^"70,1"^"WDS/Get Call Record Response/Record"^50075^-1 +34^"70,2"^"WDS/Get Call Record Response/Result Code"^50000^-1 +34^"71,2"^"WDS/Clear Call List Response/Result Code"^50000^-1 +34^"72,1"^"WDS/Get Call List Max Size Response/Maximum"^50078^-1 +34^"72,2"^"WDS/Get Call List Max Size Response/Result Code"^50000^-1 +34^"81,2"^"WDS/Set Autoconnect Setting Response/Result Code"^50000^-1 +34^"82,2"^"WDS/Get DNS Setting Response/Result Code"^50000^-1 +34^"82,16"^"WDS/Get DNS Setting Response/Primary"^60009^-1 +34^"82,17"^"WDS/Get DNS Setting Response/Secondary"^60009^-1 +34^"82,18"^"WDS/Get DNS Setting Response/Primary IPv6"^60055^-1 +34^"82,19"^"WDS/Get DNS Setting Response/Secondary IPv6"^60056^-1 +34^"83,2"^"WDS/Set DNS Setting Response/Result Code"^50000^-1 +35^"1,16"^"WDS/Event Report/TX Packet Successes"^50013^-1 +35^"1,17"^"WDS/Event Report/RX Packet Successes"^50014^-1 +35^"1,18"^"WDS/Event Report/TX Packet Errors"^50015^-1 +35^"1,19"^"WDS/Event Report/RX Packet Errors"^50016^-1 +35^"1,20"^"WDS/Event Report/TX Overflows"^50017^-1 +35^"1,21"^"WDS/Event Report/RX Overflows"^50018^-1 +35^"1,22"^"WDS/Event Report/Channel Rates"^50019^-1 +35^"1,23"^"WDS/Event Report/Data Bearer Technology"^50020^-1 +35^"1,24"^"WDS/Event Report/Dormancy Status"^50042^-1 +35^"1,25"^"WDS/Event Report/TX Bytes"^50054^-1 +35^"1,26"^"WDS/Event Report/RX Bytes"^50055^-1 +35^"1,27"^"WDS/Event Report/MIP Status"^50088^-1 +35^"1,29"^"WDS/Event Report/Current Data Bearer Technology"^50090^-1 +35^"34,1"^"WDS/Packet Service Status Report/Status"^50030^-1 +35^"34,16"^"WDS/Packet Service Status Report/Call End Reason"^50043^-1 +35^"34,17"^"WDS/Packet Service Status Report/Verbose Call End Reason"^50098^-1 +35^"54,1"^"WDS/Modem Status Report/Status"^50050^-1 +35^"54,16"^"WDS/Modem Status Report/Call End Reason"^50049^-1 +35^"56,16"^"WDS/Modem Info Report/Status"^50050^-1 +35^"56,17"^"WDS/Modem Info Report/Call End Reason"^50049^-1 +35^"56,18"^"WDS/Modem Info Report/TX Bytes"^50054^-1 +35^"56,19"^"WDS/Modem Info Report/RX Bytes"^50055^-1 +35^"56,20"^"WDS/Modem Info Report/Dormancy Status"^50042^-1 +35^"56,21"^"WDS/Modem Info Report/Technology"^50020^-1 +35^"56,22"^"WDS/Modem Info Report/Rates"^50019^-1 +36^"1,16"^"DMS/Set Event Report Request/Power State"^50100^-1 +36^"1,17"^"DMS/Set Event Report Request/Battery Level"^50101^-1 +36^"1,18"^"DMS/Set Event Report Request/PIN Status"^50133^-1 +36^"1,19"^"DMS/Set Event Report Request/Activation State"^50111^-1 +36^"1,20"^"DMS/Set Event Report Request/Operating Mode"^50144^-1 +36^"1,21"^"DMS/Set Event Report Request/UIM State"^50151^-1 +36^"1,22"^"DMS/Set Event Report Request/Wireless Disable State"^50166^-1 +36^"39,1"^"DMS/UIM Set PIN Protection Request/Info"^50127^-1 +36^"40,1"^"DMS/UIM Verify PIN Request/Info"^50129^-1 +36^"41,1"^"DMS/UIM Unblock PIN Request/Info"^50130^-1 +36^"42,1"^"DMS/UIM Change PIN Request/Info"^50131^-1 +36^"46,1"^"DMS/Set Operating Mode Request/Operating Mode"^50115^-1 +36^"50,1"^"DMS/Activate Automatic Request/Activation Code"^50118^-1 +36^"51,1"^"DMS/Activate Manual Request/Activation Data"^50119^-1 +36^"51,16"^"DMS/Activate Manual Request/PRL (Obsolete)"^50120^-1 +36^"51,17"^"DMS/Activate Manual Request/MN-HA Key"^50121^-1 +36^"51,18"^"DMS/Activate Manual Request/MN-AAA Key"^50122^-1 +36^"51,19"^"DMS/Activate Manual Request/PRL"^50135^-1 +36^"53,1"^"DMS/Set Lock State Request/Lock State"^50124^-1 +36^"54,1"^"DMS/Set Lock Code Request/Lock Code"^50125^-1 +36^"56,1"^"DMS/Write User Data Request/User Data"^50126^-1 +36^"58,1"^"DMS/Reset Factory Defaults Request/SPC"^50134^-1 +36^"59,1"^"DMS/Validate SPC Request/SPC"^50070^-1 +36^"62,1"^"DMS/UIM Set Firmware ID Request/ID"^50141^-1 +36^"64,1"^"DMS/UIM Get Control Key Status Request/Facility"^50145^-1 +36^"65,1"^"DMS/UIM Set Control Key Protection Request/Facility"^50147^-1 +36^"66,1"^"DMS/UIM Unblock Control Key Request/Facility"^50149^-1 +36^"72,1"^"DMS/Set Firmware Preference Request/Image List"^50155^-1 +36^"72,16"^"DMS/Set Firmware Preference Request/Override"^50157^-1 +36^"72,17"^"DMS/Set Firmware Preference Request/Index"^50158^-1 +36^"74,1"^"DMS/Delete Stored Firmware Request/Image"^50156^-1 +36^"75,1"^"DMS/Set Device Time Request/Time"^50170^-1 +36^"75,16"^"DMS/Set Device Time Request/Type"^50171^-1 +36^"76,1"^"DMS/Get Stored Firmware Info Request/Image"^50156^-1 +36^"78,1"^"DMS/Set Alternate Net Config Request/Config"^50169^-1 +36^"80,1"^"DMS/Set Image Download Mode Request/Mode"^50175^-1 +37^"0,2"^"DMS/Reset Response/Result Code"^50000^-1 +37^"1,2"^"DMS/Set Event Report Response/Result Code"^50000^-1 +37^"32,1"^"DMS/Get Device Capabilities Response/Capabilities"^50103^-1 +37^"32,2"^"DMS/Get Device Capabilities Response/Result Code"^50000^-1 +37^"33,1"^"DMS/Get Device Manfacturer Response/Manfacturer"^50104^-1 +37^"33,2"^"DMS/Get Device Manfacturer Response/Result Code"^50000^-1 +37^"34,1"^"DMS/Get Device Model Response/Model"^50105^-1 +37^"34,2"^"DMS/Get Device Model Response/Result Code"^50000^-1 +37^"35,1"^"DMS/Get Device Revision Response/Revision"^50106^-1 +37^"35,2"^"DMS/Get Device Revision Response/Result Code"^50000^-1 +37^"35,16"^"DMS/Get Device Revision Response/Boot Code Revision"^50136^-1 +37^"35,17"^"DMS/Get Device Revision Response/UQCN Revision"^50136^-1 +37^"36,1"^"DMS/Get Device Voice Number Response/Voice Number"^50107^-1 +37^"36,2"^"DMS/Get Device Voice Number Response/Result Code"^50000^-1 +37^"36,16"^"DMS/Get Device Voice Number Response/Mobile ID Number"^50113^-1 +37^"36,17"^"DMS/Get Device Voice Number Response/IMSI"^50138^-1 +37^"37,2"^"DMS/Get Device Serial Numbers Response/Result Code"^50000^-1 +37^"37,16"^"DMS/Get Device Serial Numbers Response/ESN"^50108^-1 +37^"37,17"^"DMS/Get Device Serial Numbers Response/IMEI"^50109^-1 +37^"37,18"^"DMS/Get Device Serial Numbers Response/MEID"^50110^-1 +37^"38,1"^"DMS/Get Power State Response/Power State"^50102^-1 +37^"38,2"^"DMS/Get Power State Response/Result Code"^50000^-1 +37^"39,2"^"DMS/UIM Set PIN Protection Response/Result Code"^50000^-1 +37^"39,16"^"DMS/UIM Set PIN Protection Response/Retry Info"^50128^-1 +37^"40,2"^"DMS/UIM Verify PIN Response/Result Code"^50000^-1 +37^"40,16"^"DMS/UIM Verify PIN Response/Retry Info"^50128^-1 +37^"41,2"^"DMS/UIM Unblock PIN Response/Result Code"^50000^-1 +37^"41,16"^"DMS/UIM Unblock PIN Response/Retry Info"^50128^-1 +37^"42,2"^"DMS/UIM Change PIN Response/Result Code"^50000^-1 +37^"42,16"^"DMS/UIM Change PIN Response/Retry Info"^50128^-1 +37^"43,2"^"DMS/UIM Get PIN Status Response/Result Code"^50000^-1 +37^"43,17"^"DMS/UIM Get PIN Status Response/PIN1 Status"^50132^-1 +37^"43,18"^"DMS/UIM Get PIN Status Response/PIN2 Status"^50132^-1 +37^"44,1"^"DMS/Get Hardware Revision Response/Hardware Revision"^50114^-1 +37^"44,2"^"DMS/Get Hardware Revision Response/Result Code"^50000^-1 +37^"45,1"^"DMS/Get Operating Mode Response/Operating Mode"^50115^-1 +37^"45,2"^"DMS/Get Operating Mode Response/Result Code"^50000^-1 +37^"45,16"^"DMS/Get Operating Mode Response/Offline Reason"^50139^-1 +37^"45,17"^"DMS/Get Operating Mode Response/Platform Restricted"^50143^-1 +37^"46,2"^"DMS/Set Operating Mode Response/Result Code"^50000^-1 +37^"47,1"^"DMS/Get Timestamp Response/Timestamp"^50116^-1 +37^"47,2"^"DMS/Get Timestamp Response/Result Code"^50000^-1 +37^"48,1"^"DMS/Get PRL Version Response/PRL Version"^50117^-1 +37^"48,2"^"DMS/Get PRL Version Response/Result Code"^50000^-1 +37^"49,1"^"DMS/Get Activation State Response/Activation State"^50112^-1 +37^"49,2"^"DMS/Get Activation State Response/Result Code"^50000^-1 +37^"50,2"^"DMS/Activate Automatic Response/Result Code"^50000^-1 +37^"51,2"^"DMS/Activate Manual Response/Result Code"^50000^-1 +37^"52,1"^"DMS/Get Lock State Response/Lock State"^50123^-1 +37^"52,2"^"DMS/Get Lock State Response/Result Code"^50000^-1 +37^"53,2"^"DMS/Set Lock State Response/Result Code"^50000^-1 +37^"54,2"^"DMS/Set Lock Code Response/Result Code"^50000^-1 +37^"55,1"^"DMS/Read User Data Response/User Data"^50126^-1 +37^"55,2"^"DMS/Read User Data Response/Result Code"^50000^-1 +37^"56,2"^"DMS/Write User Data Response/Result Code"^50000^-1 +37^"57,1"^"DMS/Read ERI Data Response/User Data"^50126^-1 +37^"57,2"^"DMS/Read ERI Data Response/Result Code"^50000^-1 +37^"58,2"^"DMS/Reset Factory Defaults Response/Result Code"^50000^-1 +37^"59,2"^"DMS/Validate SPC Response/Result Code"^50000^-1 +37^"60,1"^"DMS/UIM Get ICCID Response/ICCID"^50140^-1 +37^"60,2"^"DMS/UIM Get ICCID Response/Result Code"^50000^-1 +37^"61,1"^"DMS/UIM Get Firmware ID Response/ID"^50141^-1 +37^"61,2"^"DMS/UIM Get Firmware ID Response/Result Code"^50000^-1 +37^"62,2"^"DMS/UIM Set Firmware ID Response/Result Code"^50000^-1 +37^"63,1"^"DMS/UIM Get Host Lock ID Response/ID"^50142^-1 +37^"63,2"^"DMS/UIM Get Host Lock ID Response/Result Code"^50000^-1 +37^"64,1"^"DMS/UIM Get Control Key Status Response/Status"^50146^-1 +37^"64,2"^"DMS/UIM Get Control Key Status Response/Result Code"^50000^-1 +37^"64,16"^"DMS/UIM Get Control Key Status Response/Blocking"^50153^-1 +37^"65,2"^"DMS/UIM Set Control Key Protection Response/Result Code"^50000^-1 +37^"65,16"^"DMS/UIM Set Control Key Protection Response/Status"^50148^-1 +37^"66,2"^"DMS/UIM Unblock Control Key Response/Result Code"^50000^-1 +37^"66,16"^"DMS/UIM Unblock Control Key Response/Status"^50150^-1 +37^"67,1"^"DMS/Get IMSI Response/IMSI"^50138^-1 +37^"67,2"^"DMS/Get IMSI Response/Result Code"^50000^-1 +37^"68,1"^"DMS/Get UIM State Response/State"^50152^-1 +37^"68,2"^"DMS/Get UIM State Response/Result Code"^50000^-1 +37^"69,1"^"DMS/Get Band Capabilities Response/Bands"^50165^-1 +37^"69,2"^"DMS/Get Band Capabilities Response/Result Code"^50000^-1 +37^"70,1"^"DMS/Get Factory Serial Number Response/ID"^50168^-1^0 +37^"70,2"^"DMS/Get Factory Serial Number Response/Result Code"^50000^-1^0 +37^"71,1"^"DMS/Get Firmware Preference Response/Image List"^50155^-1 +37^"71,2"^"DMS/Get Firmware Preference Response/Result Code"^50000^-1 +37^"72,1"^"DMS/Set Firmware Preference Response/Image List"^50159^-1 +37^"72,2"^"DMS/Set Firmware Preference Response/Result Code"^50000^-1 +37^"72,16"^"DMS/Set Firmware Preference Response/Maximum"^50160^-1 +37^"73,1"^"DMS/List Stored Firmware Response/Image List"^50161^-1 +37^"73,2"^"DMS/List Stored Firmware Response/Result Code"^50000^-1 +37^"74,2"^"DMS/Delete Stored Firmware Response/Result Code"^50000^-1 +37^"75,2"^"DMS/Set Device Time Response/Result Code"^50000^-1 +37^"76,2"^"DMS/Get Stored Firmware Info Response/Result Code"^50000^-1 +37^"76,16"^"DMS/Get Stored Firmware Info Response/Boot Version"^50172^-1 +37^"76,17"^"DMS/Get Stored Firmware Info Response/PRI Version"^50173^-1 +37^"76,18"^"DMS/Get Stored Firmware Info Response/OEM Lock ID"^50174^-1 +37^"77,1"^"DMS/Get Alternate Net Config Response/Config"^50169^-1 +37^"77,2"^"DMS/Get Alternate Net Config Response/Result Code"^50000^-1 +37^"78,2"^"DMS/Set Alternate Net Config Response/Result Code"^50000^-1 +37^"79,2"^"DMS/Get Image Download Mode Response/Result Code"^50000^-1 +37^"79,16"^"DMS/Get Image Download Mode Response/Mode"^50175^-1 +37^"80,2"^"DMS/Set Image Download Mode Response/Result Code"^50000^-1 +38^"1,16"^"DMS/Event Report/Power State"^50102^-1 +38^"1,17"^"DMS/Event Report/PIN1 State"^50132^-1 +38^"1,18"^"DMS/Event Report/PIN2 State"^50132^-1 +38^"1,19"^"DMS/Event Report/Activation State"^50112^-1 +38^"1,20"^"DMS/Event Report/Operating Mode"^50115^-1 +38^"1,21"^"DMS/Event Report/UIM State"^50152^-1 +38^"1,22"^"DMS/Event Report/Wireless Disable State"^50167^-1 +39^"1,1"^"NAS/Abort Request/Transaction ID"^50001^-1 +39^"2,16"^"NAS/Set Event Report Request/Signal Indicator"^50200^-1 +39^"2,17"^"NAS/Set Event Report Request/RF Indicator"^50233^-1 +39^"2,18"^"NAS/Set Event Report Request/Registration Reject Indicator"^50234^-1 +39^"2,19"^"NAS/Set Event Report Request/RSSI Indicator"^50240^-1 +39^"2,20"^"NAS/Set Event Report Request/ECIO Indicator"^50241^-1 +39^"2,21"^"NAS/Set Event Report Request/IO Indicator"^50242^-1 +39^"2,22"^"NAS/Set Event Report Request/SINR Indicator"^50243^-1 +39^"2,23"^"NAS/Set Event Report Request/Error Rate Indicator"^50244^-1 +39^"2,24"^"NAS/Set Event Report Request/RSRQ Indicator"^50277^-1 +39^"3,16"^"NAS/Set Registration Event Report Request/System Select Indicator"^50250^-1 +39^"3,18"^"NAS/Set Registration Event Report Request/DDTM Indicator"^50251^-1 +39^"3,19"^"NAS/Set Registration Event Report Request/Serving System Indicator"^50252^-1 +39^"32,16"^"NAS/Get Signal Strength Request/Request Mask"^50253^-1 +39^"34,1"^"NAS/Initiate Network Register Request/Action"^50204^-1 +39^"34,16"^"NAS/Initiate Network Register Request/Manual Info"^50205^-1 +39^"34,17"^"NAS/Initiate Network Register Request/Change Duration"^50276^-1 +39^"35,16"^"NAS/Initiate Attach Request/Action"^50206^-1 +39^"39,16"^"NAS/Set Preferred Networks Request/Networks"^50210^-1 +39^"41,16"^"NAS/Set Forbidden Networks Request/Networks"^50213^-1 +39^"42,1"^"NAS/Set Technology Preference Request/Preference"^50216^-1 +39^"45,1"^"NAS/Set ACCOLC Request/ACCOLC"^50219^-1 +39^"48,16"^"NAS/Set Network Parameters Request/SPC"^50230^-1 +39^"48,20"^"NAS/Set Network Parameters Request/CDMA 1xEV-DO Revision"^50228^-1 +39^"48,21"^"NAS/Set Network Parameters Request/CDMA 1xEV-DO SCP Custom"^50229^-1 +39^"48,22"^"NAS/Set Network Parameters Request/Roaming"^50231^-1 +39^"51,16"^"NAS/Set System Selection Pref Request/Emergency Mode"^50263^-1 +39^"51,17"^"NAS/Set System Selection Pref Request/Mode"^50264^-1 +39^"51,18"^"NAS/Set System Selection Pref Request/Band"^50265^-1 +39^"51,19"^"NAS/Set System Selection Pref Request/PRL"^50266^-1 +39^"51,20"^"NAS/Set System Selection Pref Request/Roaming"^50267^-1 +39^"55,1"^"NAS/Set DDTM Preference Request/DDTM"^50268^-1 +39^"68,1"^"NAS/Get PLMN Name Request/PLMN"^50214^-1 +40^"0,2"^"NAS/Reset Response/Result Code"^50000^-1 +40^"1,2"^"NAS/Abort Response/Result Code"^50000^-1 +40^"2,2"^"NAS/Set Event Report Response/Result Code"^50000^-1 +40^"3,2"^"NAS/Set Registration Event Report Response/Result Code"^50000^-1 +40^"32,1"^"NAS/Get Signal Strength Response/Signal Strength"^50201^-1 +40^"32,2"^"NAS/Get Signal Strength Response/Result Code"^50000^-1 +40^"32,16"^"NAS/Get Signal Strength Response/Signal Strength List"^50220^-1 +40^"32,17"^"NAS/Get Signal Strength Response/RSSI List"^50254^-1 +40^"32,18"^"NAS/Get Signal Strength Response/ECIO List"^50255^-1 +40^"32,19"^"NAS/Get Signal Strength Response/IO"^50247^-1 +40^"32,20"^"NAS/Get Signal Strength Response/SINR"^50248^-1 +40^"32,21"^"NAS/Get Signal Strength Response/Error Rate List"^50256^-1 +40^"33,2"^"NAS/Perform Network Scan Response/Result Code"^50000^-1 +40^"33,16"^"NAS/Perform Network Scan Response/Network Info"^50202^-1 +40^"33,17"^"NAS/Perform Network Scan Response/Network RAT"^50270^-1 +40^"34,2"^"NAS/Initiate Network Register Response/Result Code"^50000^-1 +40^"35,2"^"NAS/Initiate Attach Response/Result Code"^50000^-1 +40^"36,1"^"NAS/Get Serving System Response/Serving System"^50207^-1 +40^"36,2"^"NAS/Get Serving System Response/Result Code"^50000^-1 +40^"36,16"^"NAS/Get Serving System Response/Roaming Indicator"^50208^-1 +40^"36,17"^"NAS/Get Serving System Response/Data Services"^50223^-1 +40^"36,18"^"NAS/Get Serving System Response/Current PLMN"^50209^-1 +40^"36,19"^"NAS/Get Serving System Response/System ID"^50215^-1 +40^"36,20"^"NAS/Get Serving System Response/Base Station"^50257^-1 +40^"36,21"^"NAS/Get Serving System Response/Roaming List"^50258^-1 +40^"36,22"^"NAS/Get Serving System Response/Default Roaming"^50260^-1 +40^"36,23"^"NAS/Get Serving System Response/Time Zone"^50261^-1 +40^"36,24"^"NAS/Get Serving System Response/Protocol Revision"^50262^-1 +40^"37,1"^"NAS/Get Home Network Response/Home Network"^50209^-1 +40^"37,2"^"NAS/Get Home Network Response/Result Code"^50000^-1 +40^"37,16"^"NAS/Get Home Network Response/Home IDs"^50215^-1 +40^"37,17"^"NAS/Get Home Network Response/Extended Home Network"^50269^-1 +40^"38,2"^"NAS/Get Preferred Networks Response/Result Code"^50000^-1 +40^"38,16"^"NAS/Get Preferred Networks Response/Networks"^50210^-1 +40^"38,17"^"NAS/Get Preferred Networks Response/Static Networks"^50210^-1 +40^"39,2"^"NAS/Set Preferred Networks Response/Result Code"^50000^-1 +40^"40,2"^"NAS/Get Forbidden Networks Response/Result Code"^50000^-1 +40^"40,16"^"NAS/Get Forbidden Networks Response/Networks"^50213^-1 +40^"41,2"^"NAS/Set Forbidden Networks Response/Result Code"^50000^-1 +40^"42,2"^"NAS/Set Technology Preference Response/Result Code"^50000^-1 +40^"43,1"^"NAS/Get Technology Preference Response/Active Preference"^50216^-1 +40^"43,2"^"NAS/Get Technology Preference Response/Result Code"^50000^-1 +40^"43,16"^"NAS/Get Technology Preference Response/Persistent Preference"^50217^-1 +40^"44,1"^"NAS/Get ACCOLC Response/ACCOLC"^50218^-1 +40^"44,2"^"NAS/Get ACCOLC Response/Result Code"^50000^-1 +40^"45,2"^"NAS/Set ACCOLC Response/Result Code"^50000^-1 +40^"46,1"^"NAS/Get System Preference/Pref"^50224^-1 +40^"46,2"^"NAS/Get System Preference/Result Code"^50000^-1 +40^"47,2"^"NAS/Get Network Parameters Response/Result Code"^50000^-1 +40^"47,17"^"NAS/Get Network Parameters Response/SCI"^50225^-1 +40^"47,18"^"NAS/Get Network Parameters Response/SCM"^50226^-1 +40^"47,19"^"NAS/Get Network Parameters Response/Registration"^50227^-1 +40^"47,20"^"NAS/Get Network Parameters Response/CDMA 1xEV-DO Revision"^50228^-1 +40^"47,21"^"NAS/Get Network Parameters Response/CDMA 1xEV-DO SCP Custom"^50229^-1 +40^"47,22"^"NAS/Get Network Parameters Response/Roaming"^50231^-1 +40^"48,2"^"NAS/Set Network Parameters Response/Result Code"^50000^-1 +40^"49,1"^"NAS/Get RF Info Response/RF Info"^50235^-1 +40^"49,2"^"NAS/Get RF Info Response/Result Code"^50000^-1 +40^"50,1"^"NAS/Get AN-AAA Authentication Status Response/Status"^50237^-1 +40^"50,2"^"NAS/Get AN-AAA Authentication Status Response/Result Code"^50000^-1 +40^"51,2"^"NAS/Set System Selection Pref Response/Result Code"^50000^-1 +40^"52,2"^"NAS/Get System Selection Pref Response/Result Code"^50000^-1 +40^"52,16"^"NAS/Get System Selection Pref Response/Emergency Mode"^50263^-1 +40^"52,17"^"NAS/Get System Selection Pref Response/Mode"^50264^-1 +40^"52,18"^"NAS/Get System Selection Pref Response/Band"^50265^-1 +40^"52,19"^"NAS/Get System Selection Pref Response/PRL"^50266^-1 +40^"52,20"^"NAS/Get System Selection Pref Response/Roaming"^50267^-1 +40^"55,2"^"NAS/Set DDTM Preference Response/Result Code"^50000^-1 +40^"56,1"^"NAS/Get DDTM Preference Response/DDTM"^50268^-1 +40^"56,2"^"NAS/Get DDTM Preference Response/Result Code"^50000^-1 +40^"59,2"^"NAS/Get CSP PLMN Mode Response/Result Code"^50000^-1 +40^"59,16"^"NAS/Get CSP PLMN Mode Response/Mode"^50273^-1 +40^"68,2"^"NAS/Get PLMN Name Response/Result Code"^50000^-1 +40^"68,16"^"NAS/Get PLMN Name Response/Name"^50274^-1 +41^"2,16"^"NAS/Event Report/Signal Strength"^50201^-1 +41^"2,17"^"NAS/Event Report/RF Info"^50235^-1 +41^"2,18"^"NAS/Event Report/Registration Reject"^50236^-1 +41^"2,19"^"NAS/Event Report/RSSI"^50245^-1 +41^"2,20"^"NAS/Event Report/ECIO"^50246^-1 +41^"2,21"^"NAS/Event Report/IO"^50247^-1 +41^"2,22"^"NAS/Event Report/SINR"^50248^-1 +41^"2,23"^"NAS/Event Report/Error Rate"^50249^-1 +41^"2,24"^"NAS/Event Report/RSRQ"^50275^-1 +41^"36,1"^"NAS/Serving System Indication/Serving System"^50207^-1 +41^"36,16"^"NAS/Serving System Indication/Roaming Indicator"^50208^-1 +41^"36,17"^"NAS/Serving System Indication/Data Services"^50223^-1 +41^"36,18"^"NAS/Serving System Indication/Current PLMN"^50209^-1 +41^"36,19"^"NAS/Serving System Indication/System ID"^50215^-1 +41^"36,20"^"NAS/Serving System Indication/Base Station"^50257^-1 +41^"36,21"^"NAS/Serving System Indication/Roaming List"^50258^-1 +41^"36,22"^"NAS/Serving System Indication/Default Roaming"^50260^-1 +41^"36,23"^"NAS/Serving System Indication/Time Zone"^50261^-1 +41^"36,24"^"NAS/Serving System Indication/Protocol Revision"^50262^-1 +41^"36,25"^"NAS/Serving System Indication/PLMN Change"^50272^-1 +41^"52,16"^"NAS/System Selection Pref Indication/Emergency Mode"^50263^-1 +41^"52,17"^"NAS/System Selection Pref Indication/Mode"^50264^-1 +41^"52,18"^"NAS/System Selection Pref Indication/Band"^50265^-1 +41^"52,19"^"NAS/System Selection Pref Indication/PRL"^50266^-1 +41^"52,20"^"NAS/System Selection Pref Indication/Roaming"^50267^-1 +41^"56,1"^"NAS/DDTM Preference Indication/DDTM"^50268^-1 +41^"60,16"^"NAS/CSP PLMN Mode Indication/Mode"^50273^-1 +45^"1,16"^"WMS/Set Event Report Request/New MT Message Indicator"^50300^-1 +45^"32,1"^"WMS/Raw Send Request/Message Data"^50302^-1 +45^"32,16"^"WMS/Raw Send Request/Force On DC"^50321^-1 +45^"32,17"^"WMS/Raw Send Request/Follow On DC"^50322^-1 +45^"32,18"^"WMS/Raw Send Request/Link Control"^50323^-1 +45^"33,1"^"WMS/Raw Write Request/Message Data"^50304^-1 +45^"34,1"^"WMS/Raw Read Request/Message Index"^50301^-1 +45^"34,16"^"WMS/Raw Read Request/Message Mode"^50310^-1 +45^"35,1"^"WMS/Modify Tag Request/Message Tag"^50307^-1 +45^"35,16"^"WMS/Modify Tag Request/Message Mode"^50310^-1 +45^"36,1"^"WMS/Delete Request/Memory Storage"^50308^-1 +45^"36,16"^"WMS/Delete Request/Message Index"^50305^-1 +45^"36,17"^"WMS/Delete Request/Message Tag"^50309^-1 +45^"36,18"^"WMS/Delete Request/Message Mode"^50310^-1 +45^"49,1"^"WMS/List Messages Request/Memory Storage"^50308^-1 +45^"49,16"^"WMS/List Messages Request/Message Tag"^50309^-1 +45^"49,17"^"WMS/List Messages Request/Message Mode"^50310^-1 +45^"50,1"^"WMS/Set Routes Request/Route List"^50313^-1 +45^"50,16"^"WMS/Set Routes Request/Transfer Status Report"^50326^-1 +45^"53,1"^"WMS/Set SMSC Address Request/Address"^50319^-1 +45^"53,16"^"WMS/Set SMSC Address Request/Address Type"^50318^-1 +45^"54,1"^"WMS/Get Storage Max Size Request/Memory Storage"^50308^-1 +45^"54,16"^"WMS/Get Storage Max Size Request/Message Mode"^50310^-1 +45^"55,1"^"WMS/Send ACK Request/ACK"^50329^-1 +45^"55,16"^"WMS/Send ACK Request/3GPP2 Failure Info"^50330^-1 +45^"55,17"^"WMS/Send ACK Request/3GPP Failure Info"^50331^-1 +45^"56,1"^"WMS/Set Retry Period Request/Period"^50332^-1 +45^"57,1"^"WMS/Set Retry Interval Request/Interval"^50333^-1 +45^"58,1"^"WMS/Set DC Disconnect Timer Request/Timer"^50334^-1 +45^"59,1"^"WMS/Set Memory Status Request/Status"^50335^-1 +45^"60,1"^"WMS/Set Broadcast Activation Request/BC Info"^50336^-1 +45^"61,1"^"WMS/Set Broadcast Config Request/Mode"^50310^-1 +45^"61,16"^"WMS/Set Broadcast Config Request/3GPP Info"^50337^-1 +45^"61,17"^"WMS/Set Broadcast Config Request/3GPP2 Info"^50339^-1 +45^"62,1"^"WMS/Get Broadcast Config Request/Mode"^50310^-1 +45^"65,1"^"WMS/Set Domain Preference Request/Pref"^50344^-1 +45^"66,1"^"WMS/Send From Memory Store Request/Info"^50345^-1 +46^"0,2"^"WMS/Reset Response/Result Code"^50000^-1 +46^"1,2"^"WMS/Set Event Report Response/Result Code"^50000^-1 +46^"32,2"^"WMS/Raw Send Response/Result Code"^50000^-1 +46^"32,16"^"WMS/Raw Send Response/Cause Code"^50303^-1 +46^"32,17"^"WMS/Raw Send Response/Error Class"^50324^-1 +46^"32,18"^"WMS/Raw Send Response/Cause Info"^50325^-1 +46^"33,1"^"WMS/Raw Write Response/Message Index"^50305^-1 +46^"33,2"^"WMS/Raw Write Response/Result Code"^50000^-1 +46^"34,1"^"WMS/Raw Read Response/Message Data"^50306^-1 +46^"34,2"^"WMS/Raw Read Response/Result Code"^50000^-1 +46^"35,2"^"WMS/Modify Tag Response/Result Code"^50000^-1 +46^"36,2"^"WMS/Delete Response/Result Code"^50000^-1 +46^"48,1"^"WMS/Get Message Protocol Response/Message Protocol"^50310^-1 +46^"48,2"^"WMS/Get Message Protocol Response/Result Code"^50000^-1 +46^"49,1"^"WMS/List Messages Response/Message List"^50311^-1 +46^"49,2"^"WMS/List Messages Response/Result Code"^50000^-1 +46^"50,2"^"WMS/Set Routes Response/Result Code"^50000^-1 +46^"51,1"^"WMS/Get Routes Response/Route List"^50315^-1 +46^"51,16"^"WMS/Get Routes Response/Transfer Status Report"^50326^-1 +46^"51,2"^"WMS/Get Routes Response/Result Code"^50000^-1 +46^"52,1"^"WMS/Get SMSC Address Response/Address"^50317^-1 +46^"52,2"^"WMS/Get SMSC Address Response/Result Code"^50000^-1 +46^"54,1"^"WMS/Get Storage Max Size Response/Max Size"^50327^-1 +46^"54,2"^"WMS/Get Storage Max Size Response/Result Code"^50000^-1 +46^"54,16"^"WMS/Get Storage Max Size Response/Available Size"^50328^-1 +46^"55,2"^"WMS/Send ACK Response/Result Code"^50000^-1 +46^"56,2"^"WMS/Set Retry Period Response/Result Code"^50000^-1 +46^"57,2"^"WMS/Set Retry Interval Response/Result Code"^50000^-1 +46^"58,2"^"WMS/Set DC Disconnect Timer Response/Result Code"^50000^-1 +46^"59,2"^"WMS/Set Memory Status Response/Result Code"^50000^-1 +46^"60,2"^"WMS/Set Broadcast Activation Response/Result Code"^50000^-1 +46^"61,2"^"WMS/Set Broadcast Config Response/Result Code"^50000^-1 +46^"62,2"^"WMS/Get Broadcast Config Response/Result Code"^50000^-1 +46^"62,16"^"WMS/Get Broadcast Config Response/3GPP Info"^50341^-1 +46^"62,17"^"WMS/Get Broadcast Config Response/3GPP2 Info"^50342^-1 +46^"64,1"^"WMS/Get Domain Preference Response/Pref"^50344^-1 +46^"64,2"^"WMS/Get Domain Preference Response/Result Code"^50000^-1 +46^"65,2"^"WMS/Set Domain Preference Response/Result Code"^50000^-1 +46^"66,2"^"WMS/Send From Memory Store Response/Result Code"^50000^-1 +46^"66,16"^"WMS/Send From Memory Store Response/Message ID"^50346^-1 +46^"66,17"^"WMS/Send From Memory Store Response/Cause Code"^50303^-1 +46^"66,18"^"WMS/Send From Memory Store Response/Error Class"^50324^-1 +46^"66,19"^"WMS/Send From Memory Store Response/Cause Info"^50325^-1 +47^"1,16"^"WMS/Event Report/Received MT Message"^50301^-1 +47^"1,17"^"WMS/Event Report/Transfer Route MT Message"^50320^-1 +47^"1,18"^"WMS/Event Report/Message Mode"^50310^-1 +47^"63,1"^"WMS/Memory Full Indication/Info"^50343^-1 +47^"70,1"^"WMS/SMSC Address Indication/Address"^50317^-1 +48^"1,16"^"PDS/Set Event Report Request/NMEA Indicator"^50400^-1 +48^"1,17"^"PDS/Set Event Report Request/Mode Indicator"^50416^-1 +48^"1,18"^"PDS/Set Event Report Request/Raw Indicator"^50420^-1 +48^"1,19"^"PDS/Set Event Report Request/XTRA Request Indicator"^50421^-1 +48^"1,20"^"PDS/Set Event Report Request/Time Injection Indicator"^50422^-1 +48^"1,21"^"PDS/Set Event Report Request/Wi-Fi Indicator"^50423^-1 +48^"1,22"^"PDS/Set Event Report Request/Satellite Indicator"^50424^-1 +48^"1,23"^"PDS/Set Event Report Request/VX Network Indicator"^50425^-1 +48^"1,24"^"PDS/Set Event Report Request/SUPL Network Indicator"^50426^-1 +48^"1,25"^"PDS/Set Event Report Request/UMTS CP Network Indicator"^50427^-1 +48^"1,26"^"PDS/Set Event Report Request/PDS Comm Indicator"^50428^-1 +48^"33,1"^"PDS/Set Service State Request/State"^50403^-1 +48^"34,1"^"PDS/Start Tracking Session Request/Session"^50404^-1 +48^"39,1"^"PDS/Set NMEA Config Request/Config"^50405^-1 +48^"40,1"^"PDS/Inject Time Reference Request/Time"^50406^-1 +48^"42,1"^"PDS/Set Defaults Request/Defaults"^50407^-1 +48^"44,16"^"PDS/Set XTRA Parameters Request/Automatic"^50408^-1 +48^"44,17"^"PDS/Set XTRA Parameters Request/Medium"^50409^-1 +48^"44,18"^"PDS/Set XTRA Parameters Request/Network"^50410^-1 +48^"44,20"^"PDS/Set XTRA Parameters Request/Embedded"^50441^-1 +48^"46,18"^"PDS/Get AGPS Config Request/Network Mode"^50471^-1 +48^"47,16"^"PDS/Set AGPS Config Request/Server"^50412^-1 +48^"47,17"^"PDS/Set AGPS Config Request/Server URL"^50432^-1 +48^"47,18"^"PDS/Set AGPS Config Request/Network Mode"^50471^-1 +48^"49,1"^"PDS/Set Service Auto-Tracking State Request/State"^50413^-1 +48^"51,1"^"PDS/Set COM Port Auto-Tracking Config Request/Config"^50413^-1 +48^"52,16"^"PDS/Reset PDS Data Request/GPS Data"^50414^-1 +48^"52,17"^"PDS/Reset PDS Data Request/Cell Data"^50415^-1 +48^"53,16"^"PDS/Single Position Fix Request/Mode"^50442^-1 +48^"53,17"^"PDS/Single Position Fix Request/Timeout"^50443^-1 +48^"53,18"^"PDS/Single Position Fix Request/Accuracy"^50444^-1 +48^"55,1"^"PDS/Inject XTRA Data Request/Data"^50446^-1 +48^"56,16"^"PDS/Inject Position Data Request/Timestamp"^50447^-1 +48^"56,17"^"PDS/Inject Position Data Request/Latitude"^50448^-1 +48^"56,18"^"PDS/Inject Position Data Request/Longitude"^50449^-1 +48^"56,19"^"PDS/Inject Position Data Request/Altitude Ellipsoid"^50450^-1 +48^"56,20"^"PDS/Inject Position Data Request/Altitude Sea Level"^50451^-1 +48^"56,21"^"PDS/Inject Position Data Request/Horizontal Uncertainty"^50452^-1 +48^"56,22"^"PDS/Inject Position Data Request/Vertical Uncertainty"^50453^-1 +48^"56,23"^"PDS/Inject Position Data Request/Horizontal Confidence"^50454^-1 +48^"56,24"^"PDS/Inject Position Data Request/Vertical Confidence"^50455^-1 +48^"56,25"^"PDS/Inject Position Data Request/Source"^50456^-1 +48^"57,16"^"PDS/Inject Wi-Fi Position Data Request/Time"^50457^-1 +48^"57,17"^"PDS/Inject Wi-Fi Position Data Request/Position"^50458^-1 +48^"57,18"^"PDS/Inject Wi-Fi Position Data Request/AP Info"^50459^-1 +48^"59,16"^"PDS/Set SBAS Config Request/Config"^50462^-1 +48^"60,1"^"PDS/Send Network Initiated Response Request/Action"^50463^-1 +48^"60,16"^"PDS/Send Network Initiated Response Request/VX"^50437^-1 +48^"60,17"^"PDS/Send Network Initiated Response Request/SUPL"^50438^-1 +48^"60,18"^"PDS/Send Network Initiated Response Request/UMTS CP"^50439^-1 +48^"61,1"^"PDS/Inject Absolute Time Request/Time"^50464^-1 +48^"62,1"^"PDS/Inject EFS Data Request/Date File"^50465^-1 +48^"64,1"^"PDS/Set DPO Config Request/Config"^50467^-1 +48^"66,16"^"PDS/Set ODP Config Request/Config"^50468^-1 +48^"81,16"^"PDS/Set Position Methods State Request/XTRA Time"^50470^-1 +48^"81,17"^"PDS/Set Position Methods State Request/XTRA Data"^50470^-1 +48^"81,18"^"PDS/Set Position Methods State Request/Wi-Fi"^50470^-1 +49^"0,2"^"PDS/Reset Response/Result Code"^50000^-1 +49^"1,2"^"PDS/Set Event Report Response/Result Code"^50000^-1 +49^"32,1"^"PDS/Get Service State Response/State"^50402^-1 +49^"32,2"^"PDS/Get Service State Response/Result Code"^50000^-1 +49^"33,2"^"PDS/Set Service State Response/Result Code"^50000^-1 +49^"34,2"^"PDS/Start Tracking Session Response/Result Code"^50000^-1 +49^"35,1"^"PDS/Get Tracking Session Info Response/Info"^50404^-1 +49^"35,2"^"PDS/Get Tracking Session Info Response/Result Code"^50000^-1 +49^"36,2"^"PDS/Fix Position Response/Result Code"^50000^-1 +49^"37,2"^"PDS/End Tracking Session Response/Result Code"^50000^-1 +49^"38,1"^"PDS/Get NMEA Config Response/Config"^50405^-1 +49^"38,2"^"PDS/Get NMEA Config Response/Result Code"^50000^-1 +49^"39,2"^"PDS/Set NMEA Config Response/Result Code"^50000^-1 +49^"40,2"^"PDS/Inject Time Reference Response/Result Code"^50000^-1 +49^"41,1"^"PDS/Get Defaults Response/Defaults"^50407^-1 +49^"41,2"^"PDS/Get Defaults Response/Result Code"^50000^-1 +49^"42,2"^"PDS/Set Defaults Response/Result Code"^50000^-1 +49^"43,2"^"PDS/Get XTRA Parameters Response/Result Code"^50000^-1 +49^"43,16"^"PDS/Get XTRA Parameters Response/Automatic"^50408^-1 +49^"43,17"^"PDS/Get XTRA Parameters Response/Medium"^50409^-1 +49^"43,18"^"PDS/Get XTRA Parameters Response/Network"^50410^-1 +49^"43,19"^"PDS/Get XTRA Parameters Response/Validity"^50411^-1 +49^"43,20"^"PDS/Get XTRA Parameters Response/Embedded"^50441^-1 +49^"44,2"^"PDS/Set XTRA Parameters Response/Result Code"^50000^-1 +49^"45,2"^"PDS/Force XTRA Download Response/Result Code"^50000^-1 +49^"46,2"^"PDS/Get AGPS Config Response/Result Code"^50000^-1 +49^"46,16"^"PDS/Get AGPS Config Response/Server"^50412^-1 +49^"46,17"^"PDS/Get AGPS Config Response/Server URL"^50432^-1 +49^"47,2"^"PDS/Set AGPS Config Response/Result Code"^50000^-1 +49^"48,1"^"PDS/Get Service Auto-Tracking State Response/State"^50413^-1 +49^"48,2"^"PDS/Get Service Auto-Tracking State Response/Result Code"^50000^-1 +49^"49,2"^"PDS/Set Service Auto-Tracking State Response/Result Code"^50000^-1 +49^"50,1"^"PDS/Get COM Port Auto-Tracking Config Response/Config"^50413^-1 +49^"50,2"^"PDS/Get COM Port Auto-Tracking Config Response/Result Code"^50000^-1 +49^"51,2"^"PDS/Set COM Port Auto-Tracking Config Response/Result Code"^50000^-1 +49^"52,2"^"PDS/Reset PDS Data Response/Result Code"^50000^-1 +49^"53,2"^"PDS/Single Position Fix Response/Result Code"^50000^-1 +49^"54,1"^"PDS/Get Service Version Response/Version"^50445^-1 +49^"54,2"^"PDS/Get Service Version Response/Result Code"^50000^-1 +49^"55,2"^"PDS/Inject XTRA Data Response/Result Code"^50000^-1 +49^"56,2"^"PDS/Inject Position Data Response/Result Code"^50000^-1 +49^"57,2"^"PDS/Inject Wi-Fi Position Data Response/Result Code"^50000^-1 +49^"58,2"^"PDS/Get SBAS Config Response/Result Code"^50000^-1 +49^"58,16"^"PDS/Get SBAS Config Response/Config"^50461^-1 +49^"59,2"^"PDS/Set SBAS Config Response/Result Code"^50000^-1 +49^"60,2"^"PDS/Send Network Initiated Response Response/Result Code"^50000^-1 +49^"61,2"^"PDS/Inject Absolute Time Response/Result Code"^50000^-1 +49^"62,2"^"PDS/Inject EFS Data Response/Result Code"^50000^-1 +49^"63,2"^"PDS/Get DPO Config Response/Result Code"^50000^-1 +49^"63,16"^"PDS/Get DPO Config Response/Config"^50466^-1 +49^"64,2"^"PDS/Set DPO Config Response/Result Code"^50000^-1 +49^"65,2"^"PDS/Get ODP Config Response/Result Code"^50000^-1 +49^"65,16"^"PDS/Get ODP Config Response/Config"^50468^-1 +49^"66,2"^"PDS/Set ODP Config Response/Result Code"^50000^-1 +49^"67,2"^"PDS/Cancel Single Position Fix Response/Result Code"^50000^-1 +49^"68,2"^"PDS/Get GPS State Response/Result Code"^50000^-1 +49^"68,16"^"PDS/Get GPS State Response/State"^50469^-1 +49^"80,2"^"PDS/Get Position Methods State Response/Result Code"^50000^-1 +49^"80,16"^"PDS/Get Position Methods State Response/XTRA Time"^50470^-1 +49^"80,17"^"PDS/Get Position Methods State Response/XTRA Data"^50470^-1 +49^"80,18"^"PDS/Get Position Methods State Response/Wi-Fi"^50470^-1 +49^"81,2"^"PDS/Set Position Methods State Response/Result Code"^50000^-1 +50^"1,16"^"PDS/Event Report/NMEA Sentence"^50401^-1 +50^"1,17"^"PDS/Event Report/NMEA Sentence Plus Mode"^50417^-1 +50^"1,18"^"PDS/Event Report/Position Session Status"^50429^-1 +50^"1,19"^"PDS/Event Report/Parsed Position Data"^50430^-1 +50^"1,20"^"PDS/Event Report/External XTRA Request"^50431^-1 +50^"1,21"^"PDS/Event Report/External Time Injection Request"^50433^-1 +50^"1,22"^"PDS/Event Report/External Wi-Fi Position Request"^50434^-1 +50^"1,23"^"PDS/Event Report/Satellite Info"^50435^-1 +50^"1,24"^"PDS/Event Report/VX Network Initiated Prompt"^50437^-1 +50^"1,25"^"PDS/Event Report/SUPL Network Initiated Prompt"^50438^-1 +50^"1,26"^"PDS/Event Report/UMTS CP Network Initiated Prompt"^50439^-1 +50^"1,27"^"PDS/Event Report/Comm Events"^50440^-1 +50^"32,1"^"PDS/Service State Indication/State"^50402^-1 +51^"32,16"^"AUTH/Start EAP Session Request/Method Mask"^50700^-1^0 +51^"33,1"^"AUTH/Send EAP Packet Request/Request Packet"^50701^-1^0 +52^"32,2"^"AUTH/Start EAP Session Response/Result Code"^50000^-1^0 +52^"33,1"^"AUTH/Send EAP Packet Response/Response Packet"^50703^-1^0 +52^"33,2"^"AUTH/Send EAP Packet Response/Result Code"^50000^-1^0 +52^"35,1"^"AUTH/Get EAP Session Keys Response/Session Keys"^50705^-1^0 +52^"35,2"^"AUTH/Get EAP Session Keys Response/Result Code"^50000^-1^0 +52^"36,2"^"AUTH/End EAP Session Response/Result Code"^50000^-1^0 +52^"34,1"^"AUTH/EAP Session Result/Result"^50704^-1^0 +54^"1,16"^"CAT/Set Event Report Request/Report Mask"^50600^-1^0 +54^"33,1"^"CAT/Send Terminal Response Request/Terminal Response Type"^50612^-1^0 +54^"34,1"^"CAT/Envelope Command Request/Envelope Command"^50613^-1^0 +55^"0,2"^"CAT/Reset Response/Result Code"^50000^-1^0 +55^"1,2"^"CAT/Set Event Report Response/Result Code"^50000^-1^0 +55^"1,16"^"CAT/Set Event Report Response/Reg Status Mask"^50600^-1^0 +55^"32,1"^"CAT/Get Service State Response/CAT Service State"^50615^-1^0 +55^"32,2"^"CAT/Get Service State Response/Result Code"^50000^-1^0 +55^"33,2"^"CAT/Send Terminal Response Response/Result Code"^50000^-1^0 +55^"34,2"^"CAT/Envelope Command Response/Result Code"^50000^-1^0 +56^"1,16"^"CAT/Event Report/Display Text Event"^50601^-1^0 +56^"1,17"^"CAT/Event Report/Get Inkey Event"^50602^-1^0 +56^"1,18"^"CAT/Event Report/Get Input Event"^50603^-1^0 +56^"1,19"^"CAT/Event Report/Setup Menu Event"^50604^-1^0 +56^"1,20"^"CAT/Event Report/Select Item Event"^50605^-1^0 +56^"1,21"^"CAT/Event Report/Alpha ID Available"^50606^-1^0 +56^"1,22"^"CAT/Event Report/Setup Event List"^50607^-1^0 +56^"1,23"^"CAT/Event Report/Setup Idle Mode Text Event"^50608^-1^0 +56^"1,24"^"CAT/Event Report/Language Notification Event"^50609^-1^0 +56^"1,25"^"CAT/Event Report/Refresh Event"^50610^-1^0 +56^"1,26"^"CAT/Event Report/End Proactive Session"^50611^-1^0 +57^"33,16"^"RMS/Set SMS Wake Request/State"^50500^-1^0 +57^"33,17"^"RMS/Set SMS Wake Request/Mask"^50501^-1^0 +58^"0,2"^"RMS/Reset Response/Result Code"^50000^-1^0 +58^"32,2"^"RMS/Get SMS Wake Response/Result Code"^50000^-1^0 +58^"32,16"^"RMS/Get SMS Wake Response/State"^50500^-1^0 +58^"32,17"^"RMS/Get SMS Wake Request/Mask"^50501^-1^0 +58^"33,2"^"RMS/Set SMS Wake Response/Result Code"^50000^-1^0 +60^"1,16"^"OMA/Set Event Report Request/NIA"^50800^-1^0 +60^"1,17"^"OMA/Set Event Report Request/Status"^50801^-1^0 +60^"32,16"^"OMA/Start Session Request/Type"^50805^-1^0 +60^"35,16"^"OMA/Send Selection Request/Type"^50808^-1^0 +60^"37,16"^"OMA/Set Features Response/Provisioning"^50809^-1^0 +60^"37,17"^"OMA/Set Features Response/PRL Update"^50810^-1^0 +60^"37,18"^"OMA/Set Features Response/HFA Feature"^50811^-1^0 +61^"0,2"^"OMA/Reset Response/Result Code"^50000^-1^0 +61^"1,2"^"OMA/Set Event Report Response/Result Code"^50000^-1^0 +61^"32,2"^"OMA/Start Session Response/Result Code"^50000^-1^0 +61^"33,2"^"OMA/Cancel Session Response/Result Code"^50000^-1^0 +61^"34,2"^"OMA/Get Session Info Response/Result Code"^50000^-1^0 +61^"34,16"^"OMA/Get Session Info Response/Info"^50806^-1^0 +61^"34,17"^"OMA/Get Session Info Response/Failure"^50804^-1^0 +61^"34,18"^"OMA/Get Session Info Response/Retry"^50807^-1^0 +61^"34,19"^"OMA/Get Session Info Response/NIA"^50802^-1^0 +61^"35,2"^"OMA/Send Selection Response/Result Code"^50000^-1^0 +61^"36,2"^"OMA/Get Features Response/Result Code"^50000^-1^0 +61^"36,16"^"OMA/Get Features Response/Provisioning"^50809^-1^0 +61^"36,17"^"OMA/Get Features Response/PRL Update"^50810^-1^0 +61^"36,18"^"OMA/Get Features Response/HFA Feature"^50811^-1^0 +61^"36,19"^"OMA/Get Features Response/HFA Done State"^50812^-1^0 +61^"37,2"^"OMA/Set Features Response/Result Code"^50000^-1^0 +62^"1,16"^"OMA/Event Report/NIA"^50802^-1^0 +62^"1,17"^"OMA/Event Report/Status"^50803^-1^0 +62^"1,18"^"OMA/Event Report/Failure"^50804^-1^0 +63^"58,1"^"Voice/Initiate USSD Request/Info"^70000^-1^0 +63^"59,1"^"Voice/Answer USSD Request/Info"^70000^-1^0 +63^"67,1"^"Voice/Async Initiate USSD Request/Info"^70000^-1^0 +64^"58,2"^"Voice/Initiate USSD Response/Result Code"^50000^-1^0 +64^"58,16"^"Voice/Initiate USSD Response/Fail Cause"^70001^-1^0 +64^"58,17"^"Voice/Initiate USSD Response/Alpha ID"^70002^-1^0 +64^"58,18"^"Voice/Initiate USSD Response/Data"^70000^-1^0 +64^"59,2"^"Voice/Answer USSD Response/Result Code"^50000^-1^0 +64^"60,2"^"Voice/Cancel USSD Response/Result Code"^50000^-1^0 +64^"67,2"^"Voice/Async Initiate USSD Response/Result Code"^50000^-1^0 +65^"62,1"^"Voice/USSD Indication/Type"^70003^-1^0 +65^"62,16"^"Voice/USSD Indication/Data"^70000^-1 +65^"67,16"^"Voice/USSD Async Indication/Error"^70004^-1^0 +65^"67,17"^"Voice/USSD Async Indication/Fail Cause"^70001^-1^0 +65^"67,18"^"Voice/USSD Async Indication/Info"^70000^-1^0 +65^"67,19"^"Voice/USSD Async Indication/Alpha ID"^70002^-1^0 \ No newline at end of file diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Enum.txt b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Enum.txt new file mode 100755 index 0000000..a772f9a --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Enum.txt @@ -0,0 +1,147 @@ +50000^"QMI Results"^-1^0 +50001^"QMI Errors"^-1^0 +50002^"QMI Data Bearer Technologies"^-1^0 +50003^"QMI Connection Status"^-1^0 +50004^"QMI Profile Types"^-1^0 +50005^"QMI PDP Types"^-1^0 +50006^"QMI Traffic Classes"^-1^0 +50007^"QMI QoS Delivery Orders"^-1^0 +50008^"QMI SDU Error Ratios"^-1^0 +50009^"QMI SDU Residual Bit Error Ratios"^-1^0 +50010^"QMI Erroneous SDU Deliveries"^-1^0 +50011^"QMI Dormancy Status"^-1^0 +50012^"QMI Call End Reasons"^-1^0 +50013^"QMI Mobile IP Modes"^-1^0 +50014^"QMI Call History Types"^-1^0 +50015^"QMI Call Types"^-1^0 +50016^"QMI HA/AAA Key States"^-1^0 +50017^"QMI WDS Network Types"^-1^0 +50018^"QMI WDS Extended Tech Prefs"^-1^0 +50019^"QMI WDS Call Types"^-1^0 +50020^"QMI WDS IP Families"^-1^0 +50021^"QMI WDS Mobile IP Call End Reasons"^-1^0 +50022^"QMI WDS Internal Call End Reasons"^-1^0 +50023^"QMI WDS Call Manager Call End Reasons"^-1^0 +50024^"QMI WDS 3GPP Call End Reasons"^-1^0 +50025^"QMI WDS Call End Reason Types"^-1^0 +50026^"QMI WDS Autoconnect Settings"^-1^0 +50027^"QMI WDS Autoconnect Roam Settings"^-1^0 +50028^"QMI PDP Access Control Flag"^-1^0 +50029^"QMI IP Version"^-1^0 +50030^"QMI Address Allocation Preference"^-1^0 +50031^"QMI QoS Class Identifier"^-1^0 +50032^"QMI Authentication Protocol"^-1^0 +50033^"QMI Data Rate"^-1^0 +50034^"QMI Application Type"^-1^0 +50035^"QMI Data Mode"^-1^0 +50036^"QMI PDN Type"^-1^0 +50037^"QMI Extended Error Code"^-1^0 +50100^"QMI Power Sources"^-1^0 +50101^"QMI Data Service Capabilities 1"^-1^0 +50102^"QMI DMS Radio Interfaces"^-1^0 +50103^"QMI DMS Activation States"^-1^0 +50104^"QMI DMS Operating Modes"^-1^0 +50105^"QMI DMS Timestamp Sources"^-1^0 +50106^"QMI DMS Activation Types"^-1^0 +50107^"QMI DMS Lock States"^-1^0 +50108^"QMI DMS PIN Status"^-1^0 +50109^"QMI DMS UIM Facility"^-1^0 +50110^"QMI DMS UIM Facility States"^-1^0 +50111^"QMI DMS UIM States"^-1^0 +50112^"QMI DMS Image Types"^-1^0 +50113^"QMI DMS Time References"^-1^0 +50200^"QMI NAS Radio Interfaces"^-1^0 +50201^"QMI In Use States"^-1^0 +50202^"QMI Roaming States"^-1^0 +50203^"QMI Forbidden States"^-1^0 +50204^"QMI Preferred States"^-1^0 +50205^"QMI Register Actions"^-1^0 +50206^"QMI Radio Access Technologies"^-1^0 +50207^"QMI PS Attach Actions"^-1^0 +50208^"QMI Registration States"^-1^0 +50209^"QMI CS/PS Attach States"^-1^0 +50210^"QMI Registered Networks"^-1^0 +50211^"QMI Roaming Indicators"^-1^0 +50212^"QMI Tech Pref Durations"^-1^0 +50213^"QMI Tech Prefs"^-1^0 +50214^"QMI Data Service Capabilities 2"^-1^0 +50215^"QMI NAS System Preferences"^-1^0 +50216^"QMI NAS Roaming Preferences"^-1^0 +50217^"QMI NAS Band Classes"^-1^0 +50218^"QMI NAS Service Domains"^-1^0 +50219^"QMI NAS AN-AAA Authentication Status"^-1^0 +50220^"QMI NAS SINR Levels"^-1^0 +50221^"QMI NAS PRL Preferences"^-1^0 +50222^"QMI NAS Roaming Preferences 2"^-1^0 +50223^"QMI NAS DDTM Preferences"^-1^0 +50224^"QMI NAS Service Option Actions"^-1^0 +50225^"QMI NAS Network Description Displays"^-1^0 +50226^"QMI NAS Network Description Encodings"^-1^0 +50227^"QMI NAS PLMN Name Encoding Schemes"^-1^0 +50228^"QMI NAS PLMN Name Country Initials"^-1^0 +50229^"QMI NAS PLMN Name Spare Bits"^-1^0 +50230^"QMI Change Duration"^-1^0 +50300^"QMI WMS Storage Types"^-1^0 +50301^"QMI WMS Message Formats"^-1^0 +50302^"QMI WMS Message Tags"^-1^0 +50303^"QMI WMS Message Protocols"^-1^0 +50304^"QMI WMS Message Types"^-1^0 +50305^"QMI WMS Message Classes"^-1^0 +50306^"QMI WMS Receipt Actions"^-1^0 +50307^"QMI WMS Route Values"^-1^0 +50308^"QMI WMS CDMA Service Options"^-1^0 +50309^"QMI WMS Error Classes"^-1^0 +50310^"QMI WMS Error Classes 2"^-1^0 +50311^"QMI WMS GSM/WCDMA Domains"^-1^0 +50400^"QMI PDS Tracking Session States"^-1^0 +50401^"QMI PDS Session Control Types"^-1^0 +50402^"QMI PDS Session Types"^-1^0 +50403^"QMI PDS Operation Types"^-1^0 +50404^"QMI PDS Server Options"^-1^0 +50405^"QMI PDS Output Devices"^-1^0 +50406^"QMI PDS NMEA Reporting Options"^-1^0 +50407^"QMI PDS Mediums"^-1^0 +50408^"QMI PDS WWAN Network Preferences"^-1^0 +50409^"QMI PDS NMEA Sentence Operating Modes"^-1^0 +50410^"QMI PDS Session Status"^-1^0 +50411^"QMI PDS Calendar Months"^-1^0 +50412^"QMI PDS Calendar Days"^-1^0 +50413^"QMI PDS Wi-Fi Request Types"^-1^0 +50414^"QMI PDS SV Systems"^-1^0 +50415^"QMI PDS SV Health Status"^-1^0 +50416^"QMI PDS SV Processing Status"^-1^0 +50417^"QMI PDS SV Ephemeris Status"^-1^0 +50418^"QMI PDS SV Almanac Status"^-1^0 +50419^"QMI PDS Privacy Modes"^-1^0 +50420^"QMI PDS VX Modes"^-1^0 +50421^"QMI PDS VX Data Coding Schemes"^-1^0 +50422^"QMI PDS SUPL Modes"^-1^0 +50423^"QMI PDS SUPL Data Coding Schemes"^-1^0 +50424^"QMI PDS SUPL ID/Name Data Coding Schemes"^-1^0 +50425^"QMI PDS UMTS CP Data Coding Schemes"^-1^0 +50426^"QMI PDS UMTS CP Location Types"^-1^0 +50427^"QMI PDS Comm Event Types"^-1^0 +50428^"QMI PDS Comm Event Protocols"^-1^0 +50429^"QMI PDS Injected Position Sources"^-1^0 +50430^"QMI PDS SBAS States"^-1^0 +50431^"QMI PDS Time Bases"^-1^0 +50432^"QMI PDS EFS File Operations"^-1^0 +50433^"QMI PDS ODP States"^-1^0 +50434^"QMI PDS Method States"^-1^0 +50435^"QMI Network Mode"^-1^0 +50600^"QMI CAT Alpha ID Command Type"^-1^0 +50601^"QMI CAT Refresh Stage"^-1^0 +50602^"QMI CAT Proactive Session End Type"^-1^0 +50603^"QMI CAT Envelope Command Type"^-1^0 +50700^"QMI AUTH EAP Result"^-1^0 +50800^"QMI OMA Session Types"^-1^0 +50801^"QMI OMA Session States"^-1^0 +50802^"QMI OMA Session Failure Reasons"^-1^0 +50803^"QMI OMA Selections"^-1^0 +50804^"QMI OMA HFA Done States"^-1^0 +50900^"QMI Service Types"^-1^0 +50901^"QMI Driver Data Formats"^-1^0 +50902^"QMI Power Save States "^-1^0 +70000^"USSD Data Coding Schemes"^-1^0 +70001^"USSD Alpha Coding Schemes"^-1^0 +70002^"USSD Notifcation Types"^-1^0 \ No newline at end of file diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/EnumEntry.txt b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/EnumEntry.txt new file mode 100755 index 0000000..75837cc --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/EnumEntry.txt @@ -0,0 +1,916 @@ +50000^0^"Success" +50000^1^"Failure" +50001^0^"None" +50001^1^"Malformed Message" +50001^2^"No Memory" +50001^3^"Internal" +50001^4^"Aborted" +50001^5^"Client IDs Exhausted" +50001^6^"Unabortable Transaction" +50001^7^"Invalid Client ID" +50001^8^"No Thresholds Provided" +50001^9^"Invalid Handle" +50001^10^"Invalid Profile" +50001^11^"Invalid PIN ID" +50001^12^"Incorrect PIN" +50001^13^"No Network Found" +50001^14^"Call Failed" +50001^15^"Out Of Call" +50001^16^"Not Provisioned" +50001^17^"Missing Argument" +50001^19^"Argument Too Long" +50001^22^"Invalid Transaction ID" +50001^23^"Device In Use" +50001^24^"Network Unsupported" +50001^25^"Device Unsupported" +50001^26^"No Effect" +50001^27^"No Free Profile" +50001^28^"Invalid PDP Type" +50001^29^"Invalid Technology Preference" +50001^30^"Invalid Profile Type" +50001^31^"Invalid Service Type" +50001^32^"Invalid Register Action" +50001^33^"Invalid PS Attach Action" +50001^34^"Authentication Failed" +50001^35^"PIN Blocked" +50001^36^"PIN Always Blocked" +50001^37^"UIM Uninitialized" +50001^38^"Maximum QoS Requests In Use" +50001^39^"Incorrect Flow Filter" +50001^40^"Network QoS Unaware" +50001^41^"Invalid QoS ID" +50001^42^"QoS Unavailable" +50001^43^"Flow Suspended" +50001^46^"General Error" +50001^47^"Unknown Error" +50001^48^"Invalid Argument" +50001^49^"Invalid Index" +50001^50^"No Entry" +50001^51^"Device Storage Full" +50001^52^"Device Not Ready" +50001^53^"Network Not Ready" +50001^54^"WMS Cause Code" +50001^55^"WMS Message Not Sent" +50001^56^"WMS Message Delivery Failure" +50001^57^"WMS Invalid Message ID" +50001^58^"WMS Encoding" +50001^59^"Authentication Lock" +50001^60^"Invalid Transition" +50001^65^"Session Inactive" +50001^66^"Session Invalid" +50001^67^"Session Ownership" +50001^68^"Insufficient Resources" +50001^69^"Disabled" +50001^70^"Invalid Operation" +50001^71^"Invalid QMI Command" +50001^72^"WMS TPDU Type" +50001^73^"WMS SMSC Address" +50001^74^"Information Unavailable" +50001^75^"Segment Too Long" +50001^76^"Segment Order" +50001^77^"Bundling Not Supported" +50001^80^"SIM File Not Found" +50001^82^"Access Denied" +50001^83^"Hardware Restricted" +50001^61441^"CAT Event Registration Failed" +50001^61442^"CAT Invalid Terminal Response" +50001^61443^"CAT Invalid Envelope Command" +50001^61444^"CAT Envelope Command Busy" +50001^61445^"CAT Envelope Command Failed" +50002^1^"CDMA2000 1x" +50002^2^"CDMA2000 1x Ev-DO Rev. 0" +50002^3^"GPRS" +50002^4^"WCDMA" +50002^5^"CDMA2000 1x Ev-DO Rev. A" +50002^6^"EGPRS" +50002^7^"HSDPA/WCDMA" +50002^8^"WCDMA/HSUPA" +50002^9^"HSDPA/HSUPA" +50002^10^"LTE" +50002^11^"CDMA2000 EHRPD" +50003^1^"Disconnected" +50003^2^"Connected" +50003^3^"Suspended" +50003^4^"Authenticating" +50004^0^"3GPP" +50004^1^"3GPP2" +50005^0^"PDP-IP (V4)" +50006^0^"Subscribed" +50006^1^"Conversational" +50006^2^"Streaming" +50006^3^"Interactive" +50006^4^"Background" +50007^0^"Subscribe" +50007^1^"Delivery Order On" +50007^2^"Delivery Order Off" +50008^0^"Subscribe" +50008^1^"1 x 10-2" +50008^2^"7 x 10-3" +50008^3^"1 x 10-3" +50008^4^"1 x 10-4" +50008^5^"1 x 10-5" +50008^6^"1 x 10-6" +50008^7^"1 x 10-1" +50009^0^"Subscribe" +50009^1^"5 x 10-2" +50009^2^"1 x 10-2" +50009^3^"5 x 10-3" +50009^4^"4 x 10-3" +50009^5^"1 x 10-3" +50009^6^"1 x 10-4" +50009^7^"1 x 10-5" +50009^8^"1 x 10-6" +50009^9^"6 x 10-8" +50010^0^"Subscribe" +50010^1^"No Detection" +50010^2^"Erroneous SDU Is Delivered" +50010^3^"Erroneous SDU Is Not Delivered" +50011^1^"Traffic Channel Dormant" +50011^2^"Traffic Channel Active" +50012^1^"Unspecified" +50012^2^"Client End" +50012^3^"No Service" +50012^4^"Fade" +50012^5^"Release Normal" +50012^6^"Acc In Progress" +50012^7^"Acc Failed" +50012^8^"Redirect Or Handoff" +50012^9^"Close In Progress" +50012^10^"Authentication Failed" +50012^11^"Internal Error" +50012^500^"CDMA Lock" +50012^501^"Intercept" +50012^502^"Reorder" +50012^503^"Release Service Option Rejected" +50012^504^"Incoming Call" +50012^505^"Alert Stop" +50012^506^"Activation" +50012^507^"Max Access Probe" +50012^508^"CCS Not Supported By BS" +50012^509^"No Response From BS" +50012^510^"Rejected By BS" +50012^511^"Incompatible" +50012^512^"Already In TC" +50012^513^"User Call Orig During GPS" +50012^514^"User Call Orig During SMS" +50012^515^"No CDMA Service" +50012^1000^"Conf Failed" +50012^1001^"Incoming Rejected" +50012^1002^"No GW Service" +50012^1003^"Network End" +50012^1004^"LLC Or SNDCP Failure" +50012^1005^"Insufficient Resources" +50012^1006^"Service Option Out Of order" +50012^1007^"NSAPI Already Used" +50012^1008^"Regular PDP Context Deactivation" +50012^1009^"Network Failure" +50012^1010^"Reactivation Requested" +50012^1011^"Protocol Error" +50012^1012^"Operator Determined Barring" +50012^1013^"Unknown Or Missing APN" +50012^1014^"Unknown PDP Address Or PDP Type" +50012^1015^"Activation Rejected By GGSN" +50012^1016^"Activation Rejected, Unspecified" +50012^1017^"Service Option Not Supported" +50012^1018^"Requested Service Option Not Subscribed" +50012^1019^"QoS Not Accepted" +50012^1020^"Semantic Error In The TFT Operation" +50012^1021^"Syntactical Error In The TFT Operation" +50012^1022^"Unknown PDP Context" +50012^1023^"Semantic Errors In Packet Filter(s)" +50012^1024^"Syntactical Errors In Packet Filter(s)" +50012^1025^"PDP Context Without TFT Already Activated" +50012^1026^"Invalid Transaction Identifier Value" +50012^1027^"Semantically Incorrect Message" +50012^1028^"Invalid Mandatory Information" +50012^1029^"Message Type Non-Existent" +50012^1030^"Message Not Compatible With State" +50012^1031^"Information Element Nonexistent " +50012^1032^"Conditional Information Element Error" +50012^1033^"Message Not Compatible With Protocol State" +50012^1034^"APN Restriction Value Incompatible With Active PDP Context" +50012^1035^"No GPRS Context Present" +50012^1036^"Requested Feature Not Supported" +50012^1500^"CD Gen Or Busy" +50012^1501^"CD Bill Or Auth" +50012^1502^"Change HDR" +50012^1503^"Exit HDR" +50012^1504^"HDR No Session" +50012^1505^"HDR Orig During GPS Fix" +50012^1506^"HDR CS Timeout" +50012^1507^"HDR Released By CM" +50013^0^"MIP Off (Simple IP Only)" +50013^1^"MIP Preferred" +50013^2^"MIP Only" +50014^0^"Full" +50014^1^"IDs Only" +50015^0^"NDIS" +50015^1^"DUN" +50016^0^"Unset" +50016^1^"Set, Default" +50016^2^"Set, Modified" +50017^0^"Unknown" +50017^1^"CDMA" +50017^2^"UMTS" +50018^0x8001^"CDMA" +50018^0x8004^"UMTS" +50019^0^"Laptop" +50019^1^"Embedded" +50020^4^"IPv4" +50020^6^"IPv6" +50020^8^"Unspecified" +50021^64^"FA Unspecified" +50021^65^"FA Administratively Prohibited" +50021^66^"FA Insufficient Resources" +50021^67^"FA Mobile Node Authentication Failure" +50021^68^"FA HA Authentication Failure" +50021^69^"FA Requested Lifetime Too Long" +50021^70^"FA Malformed Request" +50021^71^"FA Malformed Reply" +50021^72^"FA Encapsulation Unavailable" +50021^73^"FA VJHC Unavailable" +50021^74^"FA Reverse Tunnel Unavailable" +50021^75^"FA Reverse Tunnel Is Mandatory And T Bit Is Not Set" +50021^79^"FA Delivery Style Not Supported" +50021^97^"FA Missing NAI" +50021^98^"FA Missing HA" +50021^99^"FA Missing Home Address" +50021^104^"FA Unknown Challenge" +50021^105^"FA Missing Challenge" +50021^106^"FA Stale Challenge" +50021^128^"HA Reason Unspecified" +50021^129^"HA Administratively Prohibited" +50021^130^"HA Insufficient Resources" +50021^131^"HA Mobile Node Authentication Failure" +50021^132^"HA FA Authentication Failure" +50021^133^"HA Registration ID Mismatch" +50021^134^"HA Malformed Request" +50021^136^"HA Unknown HA Address" +50021^137^"HA Reverse Tunnel Unavailable" +50021^138^"HA Reverse Tunnel Is Mandatory And T Bit Is Not Set" +50021^139^"HA Encapsulation Unavailable" +50021^65535^"Unknown" +50022^201^"Internal" +50022^202^"Call Ended" +50022^203^"Internal Unknown Cause Code" +50022^204^"Unknown Cause Code" +50022^205^"Close In Progress" +50022^206^"NW Initiated Termination" +50022^207^"App Preempted" +50023^500^"CDMA Lock" +50023^501^"Intercept" +50023^502^"Reorder" +50023^503^"Release Service Option Reject" +50023^504^"Incoming Call" +50023^505^"Alert Stop" +50023^506^"Activation" +50023^507^"Max Access Probe" +50023^508^"CCS Not Supported By BS" +50023^509^"No Response From BS" +50023^510^"Rejected By BS" +50023^511^"Incompatible" +50023^512^"Already In TC" +50023^513^"User Call Orig During GPS" +50023^514^"User Call Orig During SMS" +50023^515^"No CDMA Service" +50023^1000^"Conf Failed" +50023^1001^"Incoming Rejected" +50023^1002^"No GW Service" +50023^1003^"No GPRS Context" +50023^1004^"Illegal MS" +50023^1005^"Illegal ME" +50023^1006^"GPRS Services And Non-GPRS Service Not Allowed" +50023^1007^"GPRS Services Not Allowed" +50023^1008^"MS Identity Cannot Be Derived By The Network" +50023^1009^"Implicitly Detached" +50023^1010^"PLMN Not Allowed" +50023^1011^"LA Not Allowed" +50023^1012^"GPRS Services Not Allowed In This PLMN" +50023^1013^"PDP Duplicate" +50023^1014^"UE RAT Change" +50023^1015^"Congestion" +50023^1016^"No PDP Context Activated" +50023^1017^"Access Class DSAC Rejection" +50023^1500^"CD Gen Or Busy" +50023^1501^"CD Bill Or Auth" +50023^1502^"Change HDR" +50023^1503^"Exit HDR" +50023^1504^"HDR No Session" +50023^1505^"HDR Orig During GPS Fix" +50023^1506^"HDR CS Timeout" +50023^1507^"HDR Released By CM" +50023^2000^"Client End" +50023^2001^"No Service" +50023^2002^"Fade" +50023^2003^"Normal Release" +50023^2004^"Access In Progress" +50023^2005^"Access Fail" +50023^2006^"Redirect Or Handoff" +50024^8^"Operator Determined Barring" +50024^25^"LLC SNDCP Failure" +50024^26^"Insufficient Resources" +50024^27^"Unknown APN" +50024^28^"Unknown PDP" +50024^29^"Authentication FAiled" +50024^30^"GGSN Reject" +50024^31^"Activation Reject" +50024^32^"Option Not Supported" +50024^33^"Option Unsubscribed" +50024^34^"Option Temporarily OOO" +50024^35^"NSAPI Already Used" +50024^36^"Regular Deactivation" +50024^37^"QoS Not Accepted" +50024^38^"Network Failure" +50024^39^"UMTS Reactivation Request" +50024^40^"Feature Not Supported" +50024^41^"TFT Semantic Error" +50024^42^"TFT Syntax Error" +50024^43^"Unknown PDP Context" +50024^44^"Filter Semantic Error" +50024^45^"Filter Syntax Error" +50024^46^"PDP Without Active TFT" +50024^81^"Invalid Transaction ID" +50024^95^"Message Incorrect Semantic" +50024^96^"Invalid Mandatory ID" +50024^97^"Message Type Unsupported" +50024^98^"Message Type Noncompatible State" +50024^99^"Unknown Info Element" +50024^100^"Conditional Info Element Error" +50024^101^"Message And Protocol State Uncompatible" +50024^111^"Protocol Error" +50024^112^"APN Type Conflict" +50025^1^"Mobile IP" +50025^2^"Internal" +50025^3^"Call Manager Defined" +50025^6^"3GPP Specification Defined" +50026^0^"Disabled" +50026^1^"Enabled" +50026^2^"Paused" +50027^0^"Always" +50027^1^"Home Only" +50028^0^"PDP Access Control None" +50028^1^"PDP Access Control Reject" +50028^2^"PDP Access Control Permission" +50029^4^"IPv4" +50029^6^"IPv6" +50030^0^"NAS signaling" +50030^1^"DHCP" +50031^0^"Network Assign QCI" +50031^1^"Guaranteed Bitrate" +50031^2^"Guaranteed Bitrate" +50031^3^"Guaranteed Bitrate" +50031^4^"Guaranteed Bitrate" +50031^5^"Non Guaranteed Bitrate" +50031^6^"Non Guaranteed Bitrate" +50031^7^"Non Guaranteed Bitrate" +50031^8^"Non Guaranteed Bitrate" +50032^1^"PAP" +50032^2^"CHAP" +50032^3^"PAP or CHAP" +50033^0^"Low (SO15 Only)" +50033^1^"Medium (SO33 + low R-SCH)" +50033^2^"High (SO33 + high R-SCH)" +50034^0^"Default Application Type" +50034^32^"LBS Application Type" +50034^64^"Tethered Application Type" +50035^0^"CDMA or HDR" +50035^1^"CDMA Only" +50035^2^"HDR Only" +50036^0^"IPv4 PDN Type" +50036^1^"IPv6 PDN Type" +50036^2^"IPv4 or IPv6 PDN Type" +50036^3^"Unspecified PDN Type" +50037^1^"Failure" +50037^2^"Invalid handle" +50037^3^"Invalid Operation" +50037^4^"Invalid Profile Type" +50037^5^"Invalid Profile Number" +50037^6^"Invalid Identifier" +50037^7^"Invalid Argument" +50037^8^"Not Initialized" +50037^9^"Invalid Length" +50037^10^"List End" +50037^11^"Invalid Subscription ID" +50037^12^"Invalid Profile Family" +50037^1001^"3GPP Invalid Profile Family" +50037^1002^"3GPP Access Error" +50037^1003^"3GPP Context Not Defined" +50037^1004^"3GPP Valid Flag Not Set" +50037^1005^"3GPP Read Only Flag Set" +50037^1006^"3GPP Error Max Profile Number" +50037^1101^"3GPP2 Error Invalid Identifier For Profile" +50100^0^"Battery" +50100^1^"External" +50101^0^"No Data Services Supported" +50101^1^"Only Circuit Switched" +50101^2^"Only Packet Switched" +50101^3^"Simultaneous Circuit/Packet Switched" +50101^4^"Nonsimultaneous Circuit/Packet Switched" +50102^1^"CDMA2000 1x" +50102^2^"CDMA2000 HRPD" +50102^4^"GSM" +50102^5^"UMTS" +50102^8^"LTE" +50103^0^"Service Not Activated" +50103^1^"Serivce Activated" +50103^2^"Activation Connecting" +50103^3^"Activation In Progress" +50103^4^"OTASP Security Authenticated" +50103^5^"OTASP NAM Downloaded" +50103^6^"OTASP MDN Downloaded" +50103^7^"OTASP IMSI Downloaded" +50103^8^"OTASP PRL Downloaded" +50103^9^"OTASP SPC Downloaded" +50103^10^"OTASP Settings Committed" +50104^0^"Online" +50104^1^"Low Power" +50104^2^"Factory Test Mode" +50104^3^"Offline" +50104^4^"Reset" +50104^5^"Shutdown" +50104^6^"Persistent Low Power" +50104^7^"Mode-Only Low Power" +50105^0^"Device" +50105^1^"CDMA Network" +50105^2^"CDMA 1xEV-DO Network" +50105^3^"GSM Network" +50105^4^"WCDMA Network" +50105^5^"GPS Network" +50105^6^"MFLO Network" +50106^0^"OTASP" +50107^0^"Lock Disabled" +50107^1^"Lock Enabled" +50108^0^"PIN Uninitialized" +50108^1^"PIN Enabled, Unverified" +50108^2^"PIN Enabled, Verified" +50108^3^"PIN Disabled" +50108^4^"PIN Blocked" +50108^5^"PIN Blocked Permanently" +50108^6^"PIN Unblocked" +50108^7^"PIN Changed" +50109^0^"PN - Network Personalization" +50109^1^"PU - Network Subset Personalization" +50109^2^"PP - Service Provider Personalization" +50109^3^"PC - Corporate Personalization" +50109^4^"PF - UIM Personalization" +50110^0^"Deactivated" +50110^1^"Activated" +50110^2^"Block" +50111^0^"Initialization Completed" +50111^1^"Initialization Failed" +50111^2^"Not Present" +50111^255^"State Unavailable" +50112^0^"Modem" +50112^1^"PRI" +50113^0^"User" +50200^0^"None (No Service)" +50200^1^"CDMA2000 1x" +50200^2^"CDMA2000 HRPD" +50200^3^"AMPS" +50200^4^"GSM" +50200^5^"UMTS" +50200^8^"LTE" +50201^0^"Unknown" +50201^1^"Current Serving" +50201^2^"Available" +50202^0^"Unknown" +50202^1^"Home" +50202^2^"Roam" +50203^0^"Unknown" +50203^1^"Forbidden" +50203^2^"Not Forbidden" +50204^0^"Unknown" +50204^1^"Preferred" +50204^2^"Not Preferred" +50205^1^"Automatic" +50205^2^"Manual" +50206^4^"GSM" +50206^5^"UMTS" +50206^8^"LTE" +50207^1^"Attach" +50207^2^"Detach" +50208^0^"NAS Not Registered" +50208^1^"NAS Registered" +50208^2^"NAS Not Registered (Searching)" +50208^3^"NAS Registration Denied" +50208^4^"Registration State Unknown" +50209^0^"Unknown/Not Applicable" +50209^1^"Attached" +50209^2^"Detached" +50210^0^"Unknown" +50210^1^"3GPP2" +50210^2^"3GPP" +50211^0^"Roaming" +50211^1^"Home" +50211^2^"Roaming (Partner)" +50212^0^"Permanent" +50212^1^"Power Cycle" +50213^0^"Automatic" +50213^1^"3GPP2" +50213^2^"3GPP" +50213^3^"Invalid" +50214^1^"GPRS" +50214^2^"EGPRS" +50214^3^"HSDPA" +50214^4^"HSUPA" +50214^5^"WCDMA" +50214^6^"CDMA" +50214^7^"CDMA 1xEV-DO Rev. 0" +50214^8^"CDMA 1xEV-DO Rev. A" +50214^9^"GSM" +50214^10^"CDMA 1xEV-DO Rev. B" +50214^11^"LTE" +50214^12^"HSDPA+" +50214^13^"DC-HSDPA+" +50215^0^"Automatic" +50215^1^"Automatic A" +50215^2^"Automatic B" +50216^0^"Automatic" +50216^1^"Home Only" +50216^2^"Roaming Only" +50216^3^"Home/Roaming" +50217^0^"CDMA Band Class 0" +50217^1^"CDMA Band Class 1" +50217^3^"CDMA Band Class 3" +50217^4^"CDMA Band Class 4" +50217^5^"CDMA Band Class 5" +50217^6^"CDMA Band Class 6" +50217^7^"CDMA Band Class 7" +50217^8^"CDMA Band Class 8" +50217^9^"CDMA Band Class 9" +50217^10^"CDMA Band Class 10" +50217^11^"CDMA Band Class 11" +50217^12^"CDMA Band Class 12" +50217^13^"CDMA Band Class 13" +50217^14^"CDMA Band Class 14" +50217^15^"CDMA Band Class 15" +50217^16^"CDMA Band Class 16" +50217^40^"GSM 450" +50217^41^"GSM 480" +50217^42^"GSM 750" +50217^43^"GSM 850" +50217^44^"GSM 900 (Extended)" +50217^45^"GSM 900 (Primary)" +50217^46^"GSM 900 (Railways)" +50217^47^"GSM 1800" +50217^48^"GSM 1900" +50217^80^"WCDMA 2100" +50217^81^"WCDMA PCS 1900" +50217^82^"WCDMA DCS 1800" +50217^83^"WCDMA 1700 (US)" +50217^84^"WCDMA 850" +50217^85^"WCDMA 800" +50217^86^"WCDMA 2600" +50217^87^"WCDMA 900" +50217^88^"WCDMA 1700 (Japan)" +50217^120^"E-UTRA Band 1" +50217^121^"E-UTRA Band 2" +50217^122^"E-UTRA Band 3" +50217^123^"E-UTRA Band 4" +50217^124^"E-UTRA Band 5" +50217^125^"E-UTRA Band 6" +50217^126^"E-UTRA Band 7" +50217^127^"E-UTRA Band 8" +50217^128^"E-UTRA Band 9" +50217^129^"E-UTRA Band 10" +50217^130^"E-UTRA Band 11" +50217^131^"E-UTRA Band 12" +50217^132^"E-UTRA Band 13" +50217^133^"E-UTRA Band 14" +50217^134^"E-UTRA Band 17" +50217^135^"E-UTRA Band 33" +50217^136^"E-UTRA Band 34" +50217^137^"E-UTRA Band 35" +50217^138^"E-UTRA Band 36" +50217^139^"E-UTRA Band 37" +50217^140^"E-UTRA Band 38" +50217^141^"E-UTRA Band 39" +50217^142^"E-UTRA Band 40" +50218^1^"Circuit Switched" +50219^0^"Authentication Failed" +50219^1^"Authentication Success" +50219^2^"No Authentication Requested" +50220^0^"-9 dB" +50220^1^"-6 dB" +50220^2^"-4.5 dB" +50220^3^"-3 dB" +50220^4^"-2 dB" +50220^5^"1 dB" +50220^6^"3 dB" +50220^7^"6 dB" +50220^8^"9 dB" +50221^1^"Acquire A Side Only" +50221^2^"Acquire B Side Only" +50221^16383^"Acquire Any" +50222^1^"Acquire When Roaming Indicator Off" +50222^2^"Acquire When Roaming Indicator Not Off" +50222^3^"Acquire When Roaming Indicator Not Flashing" +50222^255^"Acquire Any" +50223^0^"Off" +50223^1^"On" +50223^2^"No Change" +50224^0^"Add" +50224^1^"Replace" +50224^2^"Delete" +50224^3^"No Change" +50225^0^"Do Not Display" +50225^1^"Display" +50225^255^"Unknown" +50226^0^"Unspecified Octet" +50226^1^"Extended Protocol Message" +50226^2^"7-Bit ASCII" +50226^3^"IA5" +50226^4^"UNICODE" +50226^5^"Shift-JIS" +50226^6^"Korean" +50226^7^"Latin/Hebrew" +50226^8^"Latin" +50226^9^"GSM 7-Bit" +50226^10^"GSM DCS" +50227^0^"ASCII" +50227^1^"UCS2-LE" +50228^0^"Do Not Add Country Initials" +50228^1^"Add Country Initials" +50228^255^"Unspecified" +50229^0^"Unknown" +50229^1^"Bit 8" +50229^2^"Bits 7/8" +50229^3^"Bits 6 - 8" +50229^4^"Bits 5 - 8" +50229^5^"Bits 4 - 8" +50229^6^"Bits 3 - 8" +50229^7^"Bits 2 - 8" +50230^0^"Power Cycle" +50230^1^"Permanent" +50300^0^"UIM" +50300^1^"NV" +50300^2^"Unknown" +50301^0^"CDMA" +50301^1^"Analog CLI (Unsupported)" +50301^2^"Analog Voice Mail (Unsupported)" +50301^3^"Analog WMS (Unsupported)" +50301^4^"Analog AWI/WMS (Unsupported)" +50301^5^"MWI (Unsupported)" +50301^6^"GSM/WCDMA PP" +50301^7^"GSM/WCDMA BC" +50301^8^"MWI" +50302^0^"MT Read" +50302^1^"MT Not Read" +50302^2^"MO Send" +50302^3^"MO Not Sent" +50303^0^"CDMA" +50303^1^"GSM/WCDMA (Unsupported)" +50304^0^"Point-To-Point" +50304^1^"Broadcast" +50305^0^"Class 0" +50305^1^"Class 1" +50305^2^"Class 2" +50305^3^"Class 3" +50305^4^"Class None" +50305^5^"Class CDMA" +50306^0^"Discard" +50306^1^"Store And Notify" +50307^0^"Discard" +50307^1^"Store And Notify" +50307^2^"Unknown" +50308^0^"Automatic" +50308^6^"SO 6" +50308^14^"SO 14" +50309^0^"Temporary" +50309^1^"Permanent" +50310^2^"Temporary" +50310^3^"Permanent" +50311^0^"CS Preferred" +50311^1^"PS Preferred" +50311^2^"CS Only" +50311^3^"PS Only" +50400^0^"Unknown" +50400^1^"Inactive" +50400^2^"Active" +50401^0^"Manual" +50402^0^"New" +50403^0^"Standalone" +50403^1^"MS Based" +50403^2^"MS Assisted" +50404^0^"Default" +50405^0^"None (Disabled)" +50405^1^"USB" +50405^2^"UART1" +50405^3^"UART2" +50405^4^"Shared Memory" +50406^0^"1 Hz From Time Requested Until Final Position Determination" +50406^1^"Final Position Determination Only" +50407^0^"WWAN" +50408^0^"Any Available" +50408^1^"Home Only" +50408^2^"Roam Only" +50409^0^"Standalone" +50409^1^"MS Based" +50409^2^"MS Assisted" +50409^255^"Unknown" +50410^0^"Success" +50410^1^"In Progress" +50410^2^"General Failure" +50410^3^"Timeout" +50410^4^"User Ended" +50410^5^"Bad Parameter" +50410^6^"Phone Offline" +50410^7^"Engine Locked" +50410^8^"E911 Session In Progress" +50411^0^"January" +50411^1^"February" +50411^2^"March" +50411^3^"April" +50411^4^"May" +50411^5^"June" +50411^6^"July" +50411^7^"August" +50411^8^"September" +50411^9^"October" +50411^10^"November" +50411^11^"December" +50412^0^"Sunday" +50412^1^"Monday" +50412^2^"Tuesday" +50412^3^"Wednesday" +50412^4^"Thursday" +50412^5^"Friday" +50412^6^"Saturday" +50413^0^"Start Periodic Fixes - High Frequency" +50413^1^"Start Periodic Fixes - Keep Warm" +50413^2^"Stop Periodic Fixes" +50413^4^"Suspend" +50414^1^"GPS" +50414^2^"Galileo" +50414^3^"SBAS" +50414^4^"Compass" +50414^5^"Glonass" +50415^0^"Unhealthy" +50415^1^"Healthy" +50416^1^"Idle" +50416^2^"Search" +50416^3^"Search Verify" +50416^4^"Bit Edge" +50416^5^"Track" +50417^0^"Unavailable" +50417^1^"Available" +50418^0^"Unavailable" +50418^1^"Available" +50419^0^"No Notify/Verify" +50419^1^"Notify" +50419^2^"Notify/Verify - Allow No Response" +50419^3^"Notify/Verify - Require Response" +50419^4^"Privacy Override" +50420^0^"MS Assisted" +50420^1^"MS Based" +50420^2^"MS Assisted Preferred" +50420^3^"MS Based Preferred" +50421^0^"Octet" +50421^1^"EXN Protocol Message" +50421^2^"ASCII" +50421^3^"IA5" +50421^4^"Unicode" +50421^5^"Shift JIS" +50421^6^"Korean" +50421^7^"Latin Hebrew" +50421^8^"Latin" +50421^9^"GSM" +50422^0^"MS Assisted" +50422^1^"MS Based" +50422^2^"MS Assisted Preferred" +50422^3^"MS Based Preferred" +50422^4^"Standalone" +50422^5^"AFLT" +50422^6^"ECID" +50422^7^"EOTD" +50422^8^"OTDOA" +50422^9^"No Position" +50423^0^"UTF8" +50423^1^"UCS2" +50423^2^"GSM" +50423^255^"Unknown" +50424^0^"Logical Name" +50424^1^"Email Address" +50424^2^"MSISDN" +50424^3^"URL" +50424^4^"SIP URL" +50424^5^"MIN" +50424^6^"MDN" +50424^255^"Unknown" +50425^0^"German" +50425^1^"English" +50425^2^"Italian" +50425^3^"French" +50425^4^"Spanish" +50425^5^"Dutch" +50425^6^"Swedish" +50425^7^"Danish" +50425^8^"Portuguese" +50425^9^"Finnish" +50425^10^"Norwegian" +50425^11^"Greek" +50425^12^"Turkish" +50425^13^"Hungarian" +50425^14^"Polish" +50425^255^"Unknown" +50426^0^"Current" +50426^1^"Current Or Last Known" +50426^2^"Initial" +50427^0^"Begin" +50427^1^"Connected" +50427^2^"Failure" +50427^3^"Done" +50427^4^"Other Failure" +50428^0^"UMTS User Plane SUPL" +50428^1^"1X" +50428^2^"UMTS Control Plane WCDMA" +50428^3^"UMTS Control Plane GSM" +50428^4^"V1/V2" +50428^5^"KDDI" +50428^6^"XTRA Data Download" +50428^7^"SNTP Time Download" +50429^0^"Unknown" +50429^1^"GPS" +50429^2^"Cell ID" +50429^3^"Enhanced Cell ID" +50429^4^"Wi-Fi" +50429^5^"Terrestial" +50429^6^"Terrestial Hybrid" +50429^7^"Other" +50430^0^"Disabled" +50430^1^"Enabled" +50430^255^"Unknown" +50431^0^"GPS" +50431^1^"UTC" +50432^0^"Write" +50433^0^"Disables" +50433^1^"Enabled - Low Power Mode" +50433^2^"Enabled - Ready Mode" +50434^0^"Disabled" +50434^1^"Enabled" +50434^255^"Not Supported" +50435^0^"UMTS" +50435^1^"CDMA" +50600^1^"Send SMS Proactive Command"^-1 +50601^1^"Refresh Start"^-1 +50601^2^"Refresh Success"^-1 +50601^3^"Refresh Failed"^-1 +50602^1^"End Proactive Session Command Received from the card"^-1 +50602^2^"End Proactive Session Internal to ME"^-1 +50603^1^"Menu Selection"^-1 +50603^2^"Event Download User Activity"^-1 +50603^3^"Event Download Idle Screen Available"^-1 +50603^4^"Event Download Language Selection"^-1 +50700^0^"Success"^-1 +50700^1^"Failure"^-1 +50800^0^"Client Initiated Device Configure"^-1 +50800^1^"Client Initiated PRL Update"^-1 +50800^2^"Client Initiated Hands Free Activation"^-1 +50800^3^"Device Initiated Hands Free Activation"^-1 +50800^4^"Network Initiated PRL Update"^-1 +50800^5^"Network Initiated Device Configure"^-1 +50801^0^"Complete, Info Updated"^-1 +50801^1^"Complete, Info Unavailable"^-1 +50801^2^"Failed"^-1 +50801^3^"Retrying"^-1 +50801^4^"Connecting"^-1 +50801^5^"Connected"^-1 +50801^6^"Authenticated"^-1 +50801^7^"MDN Downloaded"^-1 +50801^8^"MSID Downloaded"^-1 +50801^9^"PRL Downloaded"^-1 +50801^10^"MIP Profile Downloaded"^-1 +50802^0^"Unknown"^-1 +50802^1^"Network Unavailable"^-1 +50802^2^"Server Unavailable"^-1 +50802^3^"Authentication Failed"^-1 +50802^4^"Max Retry Exceeded"^-1 +50802^5^"Session Cancelled"^-1 +50803^0^"Reject"^-1 +50803^1^"Accept"^-1 +50804^0^"None"^-1 +50804^1^"Succeeded"^-1 +50804^2^"Failed"^-1 +50900^0^"Control"^-1 +50900^1^"WDS"^-1 +50900^2^"DMS"^-1 +50900^3^"NAS"^-1 +50900^4^"QOS"^-1 +50900^5^"WMS"^-1 +50900^6^"PDS"^-1 +50900^7^"AUTH"^-1 +50900^224^"CAT"^-1 +50900^225^"RMS"^-1 +50900^226^"OMA"^-1 +50901^0^"QoS Flow Header Absent"^-1 +50901^1^"QoS Flow Header Present"^-1 +50902^0^"Normal"^-1 +50902^1^"Suspend"^-1 +50902^2^"Powerdown"^-1 +70000^1^"ASCII"^-1 +70000^2^"8-Bit"^-1 +70000^3^"UCS2"^-1 +70001^1^"GSM"^-1 +70001^2^"UCS2"^-1 +70002^1^"No Action Required"^-1 +70002^2^"Action Is Required"^-1 \ No newline at end of file diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Field.txt b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Field.txt new file mode 100755 index 0000000..c50db38 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Field.txt @@ -0,0 +1,967 @@ +50000^"QMI Result"^16^1^50000^0 +50001^"QMI Error"^16^1^50001^0 +50002^"Transaction ID"^16^0^4^0 +50100^"Report Channel Rate"^8^0^0^0 +50101^"Transfer Statistics Interval (Seconds)"^8^0^2^0 +50102^"Report TX Packet Successes"^1^0^0^0 +50103^"Report RX Packet Successes"^1^0^0^0 +50104^"Report TX Packet Errors"^1^0^0^0 +50105^"Report RX Packet Errors"^1^0^0^0 +50106^"Report TX Overflows"^1^0^0^0 +50107^"Report RX Overflows"^1^0^0^0 +50108^"Report Data Bearer Technology"^8^0^0^0 +50109^"TX Packet Successes"^32^0^6^0 +50110^"RX Packet Successes"^32^0^6^0 +50111^"TX Packet Errors"^32^0^6^0 +50112^"RX Packet Errors"^32^0^6^0 +50113^"TX Overflows"^32^0^6^0 +50114^"RX Overflows"^32^0^6^0 +50115^"Channel TX Rate (bps)"^32^0^6^0 +50116^"Channel RX Rate (bps)"^32^0^6^0 +50117^"Data Bearer Technology"^8^1^50002^0 +50118^"IP V4 Address"^8^0^2^0 +50119^"APN Name"^0^0^11^0 +50120^"Enable PAP"^1^0^0^0 +50121^"Enable CHAP"^1^0^0^0 +50122^"Username"^0^0^11^0 +50123^"Password"^0^0^11^0 +50124^"Enable 3GPP"^1^0^0^0 +50125^"Enable 3GPP2"^1^0^0^0 +50126^"Profile Index"^8^0^2^0 +50127^"Packet Data Handle"^32^0^6^1 +50128^"Connection Status"^8^1^50003^0 +50129^"Reconfigure Required"^8^0^0^0 +50130^"Max Channel TX Rate (bps)"^32^0^6^0 +50131^"Max Channel RX Rate (bps)"^32^0^6^0 +50132^"Profile Type"^8^1^50004^0 +50133^"Profile Name"^0^0^11^0 +50134^"PDP Type"^8^1^50005^0 +50135^"Traffic Class"^8^1^50006^0 +50136^"Max Uplink Bitrate"^32^0^6^0 +50137^"Max Downlink Bitrate"^32^0^6^0 +50138^"Guaranteed Uplink Bitrate"^32^0^6^0 +50139^"Guaranteed Downlink Bitrate"^32^0^6^0 +50140^"QoS Delivery Order"^8^1^50007^0 +50141^"Max SDU Size"^32^0^6^0 +50142^"SDU Error Ratio"^8^1^50008^0 +50143^"SDU Residual Bit Error Ratio"^8^1^50009^0 +50144^"Erroneous SDU Delivery"^8^1^50010^0 +50145^"Transfer Delay"^32^0^6^0 +50146^"Traffic Handling Priority"^32^0^6^0 +50147^"Precedence Class"^32^0^6^0 +50148^"Delay Class"^32^0^6^0 +50149^"Reliability Class"^32^0^6^0 +50150^"Peak Throughput Class"^32^0^6^0 +50151^"Mean Throughput Class"^32^0^6^0 +50152^"Number Of Profiles"^8^0^2^0 +50153^"Profile Name Length"^8^0^2^0 +50154^"Profile Name"^8^0^9^0 +50155^"Report Dormancy Status"^8^0^0^0 +50156^"Dormancy Status"^8^1^50011^0 +50157^"Call End"^16^1^50012^0 +50158^"MIP Mode"^8^1^50013^0 +50159^"Autoconnect Setting"^8^1^50026^0 +50160^"Autoconnect Off"^8^0^0^0 +50161^"Data Session Duration"^64^0^8^0 +50162^"Connection Status"^1^0^0^0 +50163^"Last Call End Reason"^1^0^0^0 +50164^"RX/TX Byte Totals"^1^0^0^0 +50165^"Dormancy Status"^1^0^0^0 +50166^"Data Bearer Technology"^1^0^0^0 +50167^"Channel Rates"^1^0^0^0 +50168^"Report Connection Status"^8^0^0^0 +50169^"TX Byte Total"^1^0^0^0 +50170^"RX Byte Total"^1^0^0^0 +50171^"TX Byte Total"^64^0^8^0 +50172^"RX Byte Total"^64^0^8^0 +50173^"SPC"^48^0^9^0 +50174^"Enabled"^8^0^0^0 +50175^"Reverse Tunneling"^8^0^0^0 +50176^"NAI"^0^0^11^0 +50177^"HA SPI"^32^0^6^0 +50178^"AAA SPI"^32^0^6^0 +50179^"MN-HA Key"^0^0^11^0 +50180^"MN-AAA Key"^0^0^11^0 +50181^"Retry Attempt Limit"^8^0^2^0 +50182^"Retry Attempt Interval"^8^0^2^0 +50183^"Re-Registration Period"^8^0^2^0 +50184^"Re-Registration Only With Traffic"^8^0^0^0 +50185^"MN-HA Authenticator Calculator"^8^0^0^0 +50186^"MN-HA RFC 2002 BIS Authentication"^8^0^0^0 +50187^"Last MIP Status"^8^0^2^0 +50188^"AN-AAA Authenticated"^8^0^0^0 +50189^"Call List Type"^8^1^50014^0 +50190^"Call Records"^16^0^4^0 +50191^"ID"^16^0^4^0 +50192^"Type"^8^1^50015^0 +50193^"Data Bearer"^8^1^50002^0 +50194^"Timestamp"^64^0^8^1 +50196^"Total Duration"^64^0^8^0 +50197^"Active Duration"^64^0^8^0 +50198^"RX Byte Total"^64^0^8^0 +50199^"TX Byte Total"^64^0^8^0 +50201^"Phone Number Length"^8^0^2^0 +50202^"Phone Number"^8^0^9^0 +50203^"Call List Max Size"^16^0^4^0 +50204^"Previous Call TX Byte Total"^64^0^8^0 +50205^"Previous Call RX Byte Total"^64^0^8^0 +50206^"Previous Data Session Duration"^64^0^8^0 +50207^"Data Session Active Duration"^64^0^8^0 +50208^"Previous Data Session Active Duration"^64^0^8^0 +50209^"Duration"^1^0^0^0 +50210^"Profile ID"^1^0^0^0 +50211^"Profile Name"^1^0^0^0 +50212^"PDP Type"^1^0^0^0 +50213^"APN Name"^1^0^0^0 +50214^"DNS Address"^1^0^0^0 +50215^"Granted QoS"^1^0^0^0 +50216^"Username"^1^0^0^0 +50217^"Authentication Protocol"^1^0^0^0 +50218^"IP Address"^1^0^0^0 +50219^"Gateway Info"^1^0^0^0 +50220^"IPv4 Subnet Mask"^32^0^6^1 +50221^"Key State"^8^1^50016^0 +50222^"Report MIP Status"^8^0^0^0 +50223^"MIP Status"^8^0^2^0 +50230^"Network Type"^8^1^50017^0 +50231^"CDMA 1x"^1^0^0^0 +50232^"CDMA 1x Ev-DO Rev. 0"^1^0^0^0 +50233^"CDMA 1x Ev-DO Rev. A"^1^0^0^0 +50234^"WCDMA"^1^0^0^0 +50235^"GPRS"^1^0^0^0 +50236^"HSDPA"^1^0^0^0 +50237^"HSUPA"^1^0^0^0 +50238^"EDGE"^1^0^0^0 +50239^"CDMA 1x IS95"^1^0^0^0 +50240^"CDMA 1x IS2000"^1^0^0^0 +50241^"CDMA 1x IS2000 Rel. A"^1^0^0^0 +50242^"CDMA 1x Ev-DO Rev. A DPA"^1^0^0^0 +50243^"CDMA 1x Ev-DO Rev. A MFPA"^1^0^0^0 +50244^"CDMA 1x Ev-DO Rev. A EMPA"^1^0^0^0 +50245^"Extended Technology Preference"^16^1^50018^0 +50246^"Call Type"^8^1^50019^0 +50247^"IP Family"^8^1^50020^0 +50248^"Call End Reason Type"^16^1^50025^0 +50249^"Call End Reason Value"^16^0^4^0 +50250^"Call End Reason"^16^1^50021^0 +50251^"Call End Reason"^16^1^50022^0 +50252^"Call End Reason"^16^1^50023^0 +50253^"Call End Reason"^16^1^50024^0 +50254^"P-CSCF Address Using PCO"^8^0^0^0 +50255^"P-CSCF Address"^1^0^0^0 +50256^"P-CSCF Server Address List"^1^0^0^0 +50257^"P-CSCF Domain Name List"^1^0^0^0 +50258^"MTU"^1^0^0^0 +50259^"Domain Name List"^1^0^0^0 +50260^"IP Family"^1^0^0^0 +50261^"IM CN Flag"^1^0^0^0 +50262^"Extended Technology"^1^0^0^0 +50263^"Number Of Instances"^8^0^2^0 +50264^"FQDN Length"^16^0^4^0 +50265^"FQDN"^8^0^9^0 +50266^"MTU"^32^0^6^0 +50267^"Domain Name Length"^16^0^4^0 +50268^"Domain Name"^8^0^9^0 +50269^"IM CN"^8^0^0^0 +50270^"Autoconnect Roam Setting"^8^1^50027^0 +50271^"DNS Address"^8^0^2^0 +50272^"IP Prefix Length"^8^0^2^0 +50273^"LTE"^1^0^0^0 +50274^"CDMA 1x Ev-DO Rev. A EMPA EHRPD"^1^0^0^0 +50275^"IPv6 Address"^16^0^4^1 +50276^"PDP Access Control Flag"^8^1^50028^0 +50277^"P-CSCF Address Using DHCP"^8^0^0^0 +50278^"Filter ID"^8^0^2^0 +50279^"Evaluation ID"^8^0^2^0 +50280^"IP Version"^8^1^50029^0 +50281^"IP Source"^8^0^2^0 +50282^"Source IP Mask"^8^0^2^0 +50283^"Next Header"^8^0^2^0 +50284^"Destination Port Range Start"^16^0^4^0 +50285^"Destination Port Range End"^16^0^4^0 +50286^"Source Port Range Start"^16^0^4^0 +50287^"Source Port Range End"^16^0^4^0 +50288^"IPSEC Security Parameter Index"^32^0^6^0 +50289^"TOS Mask"^16^0^4^0 +50290^"Flow Label"^32^0^6^0 +50291^"PDP Context Number"^8^0^2^0 +50292^"PDP Context Secondary Flag"^8^0^0^0 +50293^"PDP Primary ID"^8^0^2^0 +50294^"Signaling Indication"^8^0^0^0 +50295^"Address Allocation Preference"^8^1^50030^0 +50296^"QoS Class Identifier"^8^1^50031^0 +50297^"Negotiate DNS Server Preference"^8^0^0^0 +50298^"PPP Session Close Timer DO"^32^0^6^0 +50299^"PPP Session Close Timer 1X"^32^0^6^0 +50300^"Allow Linger"^8^0^0^0 +50301^"Timeout"^16^0^4^0 +50302^"Retry Count"^8^0^2^0 +50303^"Authentication Protocol"^8^1^50032^0 +50304^"Data Rate"^8^1^50033^0 +50305^"Application Type"^32^1^50034^0 +50306^"Data Mode"^8^1^50035^0 +50307^"Application Priority"^8^0^2^0 +50308^"PDN Type"^8^1^50036^0 +50309^"P-CSCF Address Needed"^8^0^0^0 +50310^"Extended Error Code"^16^1^50037^0 +50311^"Number Of Addresses"^8^0^2^0 +51000^"Report Power State"^8^0^0^0 +51001^"Battery Level Lower Limit (%)"^8^0^2^0 +51002^"Battery Level Upper Limit (%)"^8^0^2^0 +51003^"Power Source"^1^1^50100^0 +51004^"Battery Connected"^1^0^0^0 +51005^"Battery Charging"^1^0^0^0 +51006^"Power Fault"^1^0^0^0 +51007^"Battery Level (%)"^8^0^2^0 +51008^"Max TX Rate (bps)"^32^0^6^0 +51009^"Max RX Rate (bps)"^32^0^6^0 +51010^"Data Service Capability"^8^1^50101^0 +51011^"SIM Supported"^8^0^0^0 +51012^"Radio Interface Count"^8^0^2^0 +51013^"Radio Interface"^8^1^50102^0 +51014^"Device Manfacturer"^0^0^11^0 +51015^"Device Model ID"^0^0^11^0 +51016^"Device Revision ID"^0^0^11^0 +51017^"Device Voice Number"^0^0^11^0 +51018^"ESN"^0^0^11^0 +51019^"IMEI"^0^0^11^0 +51020^"MEID"^0^0^11^0 +51021^"Report Activation State"^8^0^0^0 +51022^"Activation State"^16^1^50103^0 +51023^"Device Mobile ID Number"^0^0^11^0 +51024^"Device Hardware Revision"^0^0^11^0 +51025^"Operating Mode"^8^1^50104^0 +51026^"Timestamp"^48^0^8^1 +51027^"Source"^16^1^50105^0 +51028^"PRL Version"^16^0^4^0 +51030^"SPC"^48^0^9^0 +51031^"SID"^16^0^4^0 +51032^"MDN Length"^8^0^2^0 +51033^"MDN"^8^0^9^0 +51034^"MIN Length"^8^0^2^0 +51035^"MIN"^8^0^9^0 +51036^"PRL Length"^16^0^4^0 +51037^"PRL"^8^0^2^1 +51038^"MN-HA Length"^8^0^2^0 +51039^"MN-HA"^8^0^9^0 +51040^"MN-AAA Length"^8^0^2^0 +51041^"MN-AAA"^8^0^9^0 +51042^"Lock State"^8^1^50107^0 +51043^"Lock Code"^32^0^9^0 +51044^"Current Lock Code"^32^0^9^0 +51045^"New Lock Code"^32^0^9^0 +51046^"Data Length"^16^0^4^0 +51047^"Data"^8^0^2^1 +51048^"Code Length"^8^0^2^0 +51049^"Code"^8^0^9^0 +51050^"PIN ID"^8^0^2^0 +51051^"PIN Enabled"^8^0^2^0 +51052^"PIN Length"^8^0^2^0 +51053^"PIN Value"^8^0^9^0 +51054^"Remaining Verify Retries"^8^0^2^0 +51055^"Remaining Unblock Retries"^8^0^2^0 +51056^"PUK Length"^8^0^2^0 +51057^"PUK Value"^8^0^9^0 +51058^"Old PIN Length"^8^0^2^0 +51059^"Old PIN Value"^8^0^9^0 +51060^"New PIN Length"^8^0^2^0 +51061^"New PIN Value"^8^0^9^0 +51062^"PIN Status"^8^1^50108^0 +51063^"Report PIN Status"^8^0^0^0 +51064^"PRL Total Length"^16^0^4^0 +51065^"PRL Segment Length"^16^0^4^0 +51066^"PRL Segment ID"^8^0^2^0 +51067^"Boot Code Revision ID"^0^0^11^0 +51068^"UQCN Revision ID"^0^0^11^0 +51069^"IMSI"^0^0^11^0 +51070^"Host Image Mismatch"^1^0^2^0 +51071^"UQCN Image Mismatch"^1^0^2^0 +51072^"Incompatible UQCN"^1^0^2^0 +51073^"ICCID"^0^0^11^0 +51074^"Firmware ID"^32^0^6^0 +51075^"Host Lock Code"^32^0^6^0 +51076^"Platform Restricted"^8^0^0^0 +51077^"Report Operating Mode"^8^0^0^0 +51078^"Facility"^8^1^50109^0 +51079^"Facility State"^8^1^50110^0 +51080^"Control Key Length"^8^0^2^0 +51081^"Control Key"^8^0^9^0 +51082^"UQCN Copy Issue"^1^0^2^0 +51083^"Report UIM State"^8^0^0^0 +51084^"UIM State"^8^1^50111^0 +51085^"Operation Blocking"^8^0^0^0 +51090^"Number Of Images"^8^0^2^0 +51091^"Image Type"^8^1^50112^0 +51092^"Image ID"^8^0^2^1 +51093^"Build ID Length"^8^0^2^0 +51094^"Build ID"^8^0^9^0 +51095^"Force Download"^8^0^0^0 +51096^"Storage Index"^8^0^2^0 +51097^"Maximum Build ID Length"^8^0^2^0 +51098^"Number Of Image Types"^8^0^2^0 +51099^"Maximum Number Of Images"^8^0^2^0 +51100^"Index Of Executing Image"^8^0^2^0 +51101^"Failure Count"^8^0^2^0 +51110^"Band Class 0 - A System"^1^0^0^0 +51111^"Band Class 0 - B System"^1^0^0^0 +51112^"Band Class 1"^1^0^0^0 +51113^"Band Class 2"^1^0^0^0 +51114^"Band Class 3 - A System"^1^0^0^0 +51115^"Band Class 4"^1^0^0^0 +51116^"Band Class 5"^1^0^0^0 +51117^"GSM DCS"^1^0^0^0 +51118^"GSM Primary"^1^0^0^0 +51119^"GSM Extended"^1^0^0^0 +51120^"Band Class 6"^1^0^0^0 +51121^"Band Class 7"^1^0^0^0 +51122^"Band Class 8"^1^0^0^0 +51123^"Band Class 9"^1^0^0^0 +51124^"Band Class 10"^1^0^0^0 +51125^"Band Class 11"^1^0^0^0 +51126^"GSM 450"^1^0^0^0 +51127^"GSM 480"^1^0^0^0 +51128^"GSM 750"^1^0^0^0 +51129^"GSM 850"^1^0^0^0 +51130^"GSM Railways"^1^0^0^0 +51131^"GSM PCS"^1^0^0^0 +51132^"WCDMA 2100I"^1^0^0^0 +51133^"WCDMA PCS 1900"^1^0^0^0 +51134^"WCDMA DCS 1800"^1^0^0^0 +51135^"WCDMA 1700 (US)"^1^0^0^0 +51136^"WCDMA 850"^1^0^0^0 +51137^"WCDMA 800"^1^0^0^0 +51138^"Band Class 12"^1^0^0^0 +51139^"Band Class 14"^1^0^0^0 +51140^"Band Class 15"^1^0^0^0 +51141^"WCDMA 2600"^1^0^0^0 +51142^"WCDMA 900"^1^0^0^0 +51143^"WCDMA 1700 (Japan)"^1^0^0^0 +51144^"Band Class 16"^1^0^0^0 +51145^"Band Class 17"^1^0^0^0 +51146^"Band Class 18"^1^0^0^0 +51147^"Band Class 19"^1^0^0^0 +51148^"Report Wireless Disable State"^8^0^0^0 +51149^"Wireless Disable On"^8^0^0^0 +51150^"Factory Serial Number"^0^0^11^0 +51151^"Alternate Enabled"^8^0^0^0 +51152^"Time In Milliseconds"^64^0^8^0 +51153^"Time Reference"^32^1^50113^0 +51154^"Boot Major Version"^16^0^4^0 +51155^"Boot Minor Version"^16^0^4^0 +51156^"PRI Version"^32^0^6^1 +51157^"PRI Info"^256^0^9^0 +51158^"OEM Lock ID"^32^0^6^1 +51159^"BAR Mode"^8^0^0^0 +52000^"Report Signal Strength"^8^0^0^0 +52001^"Number Of Thresholds"^8^0^2^0 +52002^"Signal Strength Threshold (dBm)"^8^0^1^0 +52003^"Signal Strength (dBm)"^8^0^1^0 +52004^"Radio Interface"^8^1^50200^0 +52005^"Number Of Info Instances"^16^0^4^0 +52006^"Mobile Country Code"^16^0^4^0 +52007^"Mobile Network Code"^16^0^4^0 +52008^"In Use Status"^2^1^50201^0 +52009^"Roaming Status"^2^1^50202^0 +52010^"Forbidden Status"^2^1^50203^0 +52011^"Preferred Status"^2^1^50204^0 +52012^"Description Length"^8^0^2^0 +52013^"Description"^8^0^9^0 +52014^"Register Action"^8^1^50205^0 +52015^"Radio Access Technology"^8^1^50206^0 +52016^"PS Attach Action"^8^1^50207^0 +52017^"Registration State"^8^1^50208^0 +52018^"CS Attach State"^8^1^50209^0 +52019^"PS Attach State"^8^1^50209^0 +52020^"Registered Network"^8^1^50210^0 +52021^"Number Of Radio Interfaces In Use"^8^0^2^0 +52022^"Roaming Indicator"^8^1^50211^0 +52023^"Number Of Preferred Networks"^16^0^4^0 +52024^"GSM Compact"^1^0^0^0 +52025^"GSM"^1^0^0^0 +52026^"UMTS"^1^0^0^0 +52027^"Number Of Forbidden Networks"^16^0^4^0 +52028^"System ID"^16^0^4^0 +52029^"Network ID"^16^0^4^0 +52032^"Duration"^8^1^50212^0 +52033^"ACCOLC"^8^0^2^0 +52034^"SPC"^48^0^9^0 +52035^"Technology"^2^1^50213^0 +52036^"Analog"^1^0^2^0 +52037^"Digital"^1^0^2^0 +52038^"EV-DO"^1^0^2^0 +52039^"GSM"^1^0^2^0 +52040^"WCDMA"^1^0^2^0 +52041^"Number Of Data Capabilities"^8^0^2^0 +52042^"Data Capability"^8^1^50214^0 +52043^"System Preference"^8^1^50215^0 +52044^"Slot Cycle Index"^8^0^2^0 +52045^"Station Class Mark"^8^0^2^0 +52046^"Register On Home System"^8^0^0^0 +52047^"Register On Foreign System"^8^0^0^0 +52048^"Register On Foreign Network"^8^0^0^0 +52049^"Force CDMA 1xEV-DO Rev. 0"^8^0^0^0 +52050^"CDMA 1xEV-DO SCP Custom Config"^8^0^0^0 +52051^"Subtype 2 Physical Layer"^1^0^0^0 +52052^"Enhanced CC MAC"^1^0^0^0 +52053^"Enhanced AC MAC"^1^0^0^0 +52054^"Enhanced FTC MAC"^1^0^0^0 +52055^"Subtype 3 RTC MAC"^1^0^0^0 +52056^"Subtype 1 RTC MAC"^1^0^0^0 +52057^"Enhanced Idle"^1^0^0^0 +52058^"Generic Multimode Capable Disc Port"^1^0^0^0 +52059^"Generic Broadcast"^1^0^0^0 +52060^"SN Multiflow Packet Application"^1^0^0^0 +52061^"SN Enhanced Multiflow Packet Application"^1^0^0^0 +52062^"Roam Preference"^8^1^50216^0 +52063^"Active Band Class"^16^1^50217^0 +52064^"Active Channel"^16^0^4^0 +52065^"Report RF Info"^8^0^0^0 +52066^"Report LU Reject"^8^0^0^0 +52067^"Number Of Instances"^8^0^2^0 +52068^"Service Domain"^8^1^50218^0 +52069^"Reject Cause"^16^0^4^0 +52070^"AN-AAA Authentication Status"^8^1^50219^0 +52080^"Report RSSI"^8^0^0^0 +52081^"RSSI Delta"^8^0^2^0 +52082^"Report ECIO"^8^0^0^0 +52083^"ECIO Delta"^8^0^2^0 +52084^"Report IO"^8^0^0^0 +52085^"IO Delta"^8^0^2^0 +52086^"Report SINR"^8^0^0^0 +52087^"SINR Delta"^8^0^2^0 +52088^"Report Error Rate"^8^0^0^0 +52089^"RSSI"^8^0^2^0 +52090^"ECIO"^8^0^2^0 +52091^"IO"^32^0^6^0 +52092^"SINR"^8^1^50220^0 +52093^"Error Rate"^16^0^4^0 +52094^"Report System Select"^8^0^0^0 +52095^"Report DDTM"^8^0^0^0 +52096^"Report Serving System"^8^0^0^0 +52097^"Number Of Measurements"^16^0^4^0 +52098^"Base Station ID"^16^0^4^0 +52099^"Latitude"^32^0^5^0 +52100^"Longitude"^32^0^5^0 +52101^"Leap Seconds"^8^0^2^0 +52102^"Local Time Offset"^8^0^1^0 +52103^"Daylight Savings In Effect"^8^0^0^0 +52104^"Protocol Revision"^8^0^2^0 +52105^"Emergency Mode On"^8^0^0^0 +52106^"CDMA 1x"^1^0^0^0 +52107^"CDMA 1xEV-DO"^1^0^0^0 +52108^"GSM"^1^0^0^0 +52109^"UMTS"^1^0^0^0 +52110^"Band Class 0 - A System"^1^0^0^0 +52111^"Band Class 0 - B System"^1^0^0^0 +52112^"Band Class 1"^1^0^0^0 +52113^"Band Class 2"^1^0^0^0 +52114^"Band Class 3 - A System"^1^0^0^0 +52115^"Band Class 4"^1^0^0^0 +52116^"Band Class 5"^1^0^0^0 +52117^"GSM DCS"^1^0^0^0 +52118^"GSM Primary"^1^0^0^0 +52119^"GSM Extended"^1^0^0^0 +52120^"Band Class 6"^1^0^0^0 +52121^"Band Class 7"^1^0^0^0 +52122^"Band Class 8"^1^0^0^0 +52123^"Band Class 9"^1^0^0^0 +52124^"Band Class 10"^1^0^0^0 +52125^"Band Class 11"^1^0^0^0 +52126^"GSM 450"^1^0^0^0 +52127^"GSM 480"^1^0^0^0 +52128^"GSM 750"^1^0^0^0 +52129^"GSM 850"^1^0^0^0 +52130^"GSM Railways"^1^0^0^0 +52131^"GSM PCS"^1^0^0^0 +52132^"WCDMA 2100I"^1^0^0^0 +52133^"WCDMA PCS 1900"^1^0^0^0 +52134^"WCDMA DCS 1800"^1^0^0^0 +52135^"WCDMA 1700 (US)"^1^0^0^0 +52136^"WCDMA 850"^1^0^0^0 +52137^"WCDMA 800"^1^0^0^0 +52138^"Band Class 12"^1^0^0^0 +52139^"Band Class 14"^1^0^0^0 +52140^"Band Class 15"^1^0^0^0 +52141^"WCDMA 2600"^1^0^0^0 +52142^"WCDMA 900"^1^0^0^0 +52143^"WCDMA 1700 (Japan)"^1^0^0^0 +52144^"Band Class 16"^1^0^0^0 +52145^"Band Class 17"^1^0^0^0 +52146^"Band Class 18"^1^0^0^0 +52147^"Band Class 19"^1^0^0^0 +52148^"PRL Preference"^16^1^50221^0 +52149^"Roaming Preference"^16^1^50222^0 +52150^"DDTM Preference"^8^1^50223^0 +52151^"Suppress L2 ACK"^1^0^0^0 +52152^"Suppress 1x Registrations"^1^0^0^0 +52153^"Ignore Service Option Pages"^1^0^0^0 +52154^"Block Mobile Originated SMS And DBM"^1^0^0^0 +52155^"Service Option Action"^8^1^50224^0 +52156^"Service Option"^16^0^4^0 +52157^"Query RSSI"^1^0^0^0 +52158^"Query ECIO"^1^0^0^0 +52159^"Query IO"^1^0^0^0 +52160^"Query SINR"^1^0^0^0 +52161^"Query Error Rate"^1^0^0^0 +52162^"Display Network Description"^8^1^50225^0 +52163^"Network Description Encoding"^8^1^50226^0 +52164^"Network Description Length"^8^0^2^0 +52165^"Network Description"^8^0^2^1 +52166^"PLMN Changed"^8^0^0^0 +52167^"Restrict Manual PLMN Selection"^8^0^0^0 +52168^"SPN Encoding"^8^1^50227^0 +52169^"SPN Length"^8^0^2^0 +52170^"SPN"^8^0^2^1 +52171^"PLMN Short Encoding"^8^1^50227^0 +52172^"PLMN Short Country Initials"^8^1^50228^0 +52173^"PLMN Spare Bits"^8^1^50229^0 +52174^"PLMN Short Length"^8^0^2^0 +52175^"PLMN Short"^8^0^2^1 +52176^"PLMN Long Encoding"^8^1^50227^0 +52177^"PLMN Long Country Initials"^8^1^50228^0 +52178^"PLMN Long Bits"^8^1^50229^0 +52179^"PLMN Long Length"^8^0^2^0 +52180^"PLMN Long"^8^0^2^1 +52181^"RSRQ"^8^0^1^0 +52182^"Change Duration"^8^1^50230^0 +52183^"Report RSRQ"^8^0^0^0 +52184^"RSRQ Delta"^8^0^2^0 +53000^"Report New MT Messages"^8^0^0^0 +53001^"Storage Type"^8^1^50300^0 +53002^"Storage Index"^32^0^6^0 +53003^"Message Format"^8^1^50301^0 +53004^"Raw Message Length"^16^0^4^0 +53005^"Raw Message"^8^0^2^1 +53006^"Cause Code"^16^0^4^0 +53007^"Message Tag"^8^1^50302^0 +53008^"Mode"^8^1^50303^0 +53009^"Number Of Messages"^32^0^6^0 +53010^"Number Of Routes"^16^0^4^0 +53011^"Message Type"^8^1^50304^0 +53012^"Message Class"^8^1^50305^0 +53013^"Receipt Action"^8^1^50306^0 +53014^"Route Value"^8^1^50307^0 +53015^"SMSC Address Type"^24^0^9^0 +53016^"SMSC Address Length"^8^0^2^0 +53017^"SMSC Address"^8^0^9^0 +53018^"SMSC Address Type"^8^0^11^0 +53019^"SMSC Address"^8^0^11^0 +53020^"ACK Required"^8^0^0^0 +53021^"Transaction ID"^32^0^6^0 +53022^"Force Send On DC"^8^0^0^0 +53023^"Service Option"^8^1^50308^0 +53024^"Do Not Disconnect DC"^8^0^0^0 +53025^"Link Timer In Seconds"^8^0^2^0 +53026^"Error Class"^8^1^50309^0 +53027^"GSM/WCDMA RP Cause"^16^0^4^0 +53028^"GSM/WCDMA TP Cause"^8^0^2^0 +53029^"Transfer Status Reports"^8^0^0^0 +53030^"Max Storage Size In Messages"^32^0^6^0 +53031^"Free Storage Size In Messages"^32^0^6^0 +53032^"Processed Successfully"^8^0^0^0 +53033^"Error Class"^8^1^50310^0 +53034^"Transport Layer Status"^8^0^2^0 +53035^"GSM/WCDMA RP Cause"^8^0^2^0 +53036^"Retry Period In Seconds"^32^0^6^0 +53037^"Retry Interval In Seconds"^32^0^6^0 +53038^"DC Disconnect Timer In Seconds"^32^0^6^0 +53039^"Memory Is Available"^8^0^0^0 +53040^"Activate Broadcast"^8^0^0^0 +53041^"Number Of Instances"^16^0^4^0 +53042^"Message ID Start"^16^0^4^0 +53043^"Message ID End"^16^0^4^0 +53044^"Selected"^8^0^0^0 +53045^"Service Category"^16^0^4^0 +53046^"Language"^16^0^4^0 +53047^"Activated"^8^0^0^0 +53048^"Domain Preference"^8^1^50311^0 +53049^"Message ID"^16^0^4^0 +54000^"Report NMEA Sentences"^8^0^0^0 +54001^"NMEA Sentence"^0^0^11^0 +54002^"Service Enabled"^8^0^0^0 +54003^"Tracking Session State"^8^1^50400^0 +54004^"Session Control"^8^1^50401^0 +54005^"Session Type"^8^1^50402^0 +54006^"Session Operation"^8^1^50403^0 +54007^"Server Option"^8^1^50404^0 +54008^"Timeout In Seconds"^8^0^2^0 +54009^"Session Fix Requests"^32^0^6^0 +54010^"Fix Request Interval In Seconds"^32^0^6^0 +54011^"Desired Accuracy In Meters"^32^0^6^0 +54012^"GGA NMEA Sentences"^1^0^0^0 +54013^"RMC NMEA Sentences"^1^0^0^0 +54014^"GSV NMEA Sentences"^1^0^0^0 +54015^"GSA NMEA Sentences"^1^0^0^0 +54016^"VTG NMEA Sentences"^1^0^0^0 +54017^"Output Device"^8^1^50405^0 +54018^"NMEA Reporting"^8^1^50406^0 +54019^"System Time"^64^0^8^0 +54020^"System Discontinuties"^16^0^4^0 +54021^"Automatic Download Enabled"^8^0^0^0 +54022^"Download Interval In Hours"^16^0^4^0 +54023^"Medium Preferences"^8^0^2^0 +54024^"Medium Preference"^8^1^50407^0 +54025^"WWAN Network Preference"^8^1^50408^0 +54026^"Valid Period - GPS Start Week"^16^0^4^0 +54027^"Valid Period - GPS Start Week Offset In Minutes"^16^0^4^0 +54028^"Valid Period - Duration In Hours"^16^0^4^0 +54029^"Server Address"^8^0^2^0 +54030^"Server Port"^32^0^6^0 +54031^"Auto-Tracking Enabled"^8^0^0^0 +54032^"Reset EPH"^1^0^0^0 +54033^"Reset ALM"^1^0^0^0 +54034^"Reset POS"^1^0^0^0 +54035^"Reset TIME"^1^0^0^0 +54036^"Reset IONO"^1^0^0^0 +54037^"Reset UTC"^1^0^0^0 +54038^"Reset HEALTH"^1^0^0^0 +54039^"Reset SVDIR"^1^0^0^0 +54040^"Reset SVSTEER"^1^0^0^0 +54041^"Reset SADATA"^1^0^0^0 +54042^"Reset RTI"^1^0^0^0 +54043^"Reset ALM CORR"^1^0^0^0 +54044^"Reset FREQ BIAS EST"^1^0^0^0 +54045^"Reset POS"^1^0^0^0 +54046^"Reset LATEST GPS POS"^1^0^0^0 +54047^"Reset OTA POS"^1^0^0^0 +54048^"Reset EXT REF POS"^1^0^0^0 +54049^"Reset TIMETAG"^1^0^0^0 +54050^"Reset CELLID"^1^0^0^0 +54051^"Reset CACHED CELLID"^1^0^0^0 +54052^"Reset LAST SRV CELL"^1^0^0^0 +54053^"Reset CUR SRV CELL"^1^0^0^0 +54054^"Reset NEIGHBOR INFO"^1^0^0^0 +54055^"Report NMEA Sentences Plus Mode"^8^0^0^0 +54056^"NMEA Sentence Operating Mode"^8^1^50409^0 +54057^"NMEA Sentence Length"^16^0^4^0 +54058^"NMEA Sentence"^8^0^9^0 +54100^"Report Raw Position Data"^8^0^0^0 +54101^"Report External XTRA Data Requests"^8^0^0^0 +54102^"Report External Time Injections"^8^0^0^0 +54103^"Report External Wi-Fi Requests"^8^0^0^0 +54104^"Report Satellite Info"^8^0^0^0 +54105^"Report VX Network Initiated Prompts"^8^0^0^0 +54106^"Report SUPL Network Initiated Prompts"^8^0^0^0 +54107^"Report UMTS CP Network Initiated Prompts"^8^0^0^0 +54108^"Report PDS Comm Events"^8^0^0^0 +54109^"Session Status"^8^1^50410^0 +54110^"Timestamp Calendar Valid"^1^0^0^0 +54111^"Timestamp UTC Valid"^1^0^0^0 +54112^"Leap Seconds Valid"^1^0^0^0 +54113^"Time Uncertainty Valid"^1^0^0^0 +54114^"Latitude Valid"^1^0^0^0 +54115^"Longitude Valid"^1^0^0^0 +54116^"Ellipsoid Altitude Valid"^1^0^0^0 +54117^"Mean Sea Level Altitude Valid"^1^0^0^0 +54118^"Horizontal Speed Valid"^1^0^0^0 +54119^"Vertical Speed Valid"^1^0^0^0 +54120^"Heading Valid"^1^0^0^0 +54121^"Horizontal Uncertainty Circular Valid"^1^0^0^0 +54122^"Horizontal Uncertainty Ellipse Semi-Major Valid"^1^0^0^0 +54123^"Horizontal Uncertainty Ellipse Semi-Minor Valid"^1^0^0^0 +54124^"Horizontal Uncertainty Ellipse Orient Azimuth Valid"^1^0^0^0 +54125^"Vertical Uncertainty Valid"^1^0^0^0 +54126^"Horizontal Velocity Uncertainty Valid"^1^0^0^0 +54127^"Vertical Velocity Uncertainty Valid"^1^0^0^0 +54128^"Horizontal Confidence Valid"^1^0^0^0 +54129^"Position DOP Valid"^1^0^0^0 +54130^"Horizontal DOP Valid"^1^0^0^0 +54131^"Vertical DOP Valid"^1^0^0^0 +54132^"Operating Mode Used Valid"^1^0^0^0 +54133^"Calendar Year"^16^0^4^0 +54134^"Calendar Month"^8^1^50411^0 +54135^"Calendar Day"^8^1^50412^0 +54136^"Calendar Day Of Month"^8^0^2^0 +54137^"Calendar Hour"^8^0^2^0 +54138^"Calendar Minute"^8^0^2^0 +54139^"Calendar Second"^8^0^2^0 +54140^"Calendar Millisecond"^16^0^4^0 +54141^"Calendar Leap Seconds"^8^0^2^0 +54142^"UTC Timestamp"^64^0^8^1 +54143^"UTC Timestamp Uncertainty"^32^0^6^0 +54144^"Latitude"^64^0^14^0 +54145^"Longitude"^64^0^14^0 +54146^"Ellipsoid Altitude"^32^0^13^0 +54147^"Mean Sea Level Altitude"^32^0^13^0 +54148^"Horizontal Speed"^32^0^13^0 +54149^"Vertical Speed"^32^0^13^0 +54150^"Heading"^32^0^13^0 +54151^"Horizontal Uncertainty Circular"^32^0^13^0 +54152^"Horizontal Uncertainty Ellipse Semi-Major"^32^0^13^0 +54153^"Horizontal Uncertainty Ellipse Semi-Minor"^32^0^13^0 +54154^"Horizontal Uncertainty Ellipse Orient Azimuth"^32^0^13^0 +54155^"Vertical Uncertainty"^32^0^13^0 +54156^"Horizontal Velocity Uncertainty"^32^0^13^0 +54157^"Vertical Velocity Uncertainty"^32^0^13^0 +54158^"Horizontal Confidence"^8^0^2^0 +54159^"Position DOP "^32^0^13^0 +54160^"Horizontal DOP"^32^0^13^0 +54161^"Vertical DOP"^32^0^13^0 +54162^"Operating Mode"^8^1^50409^0 +54163^"Maximum File Size"^16^0^4^0 +54164^"URL Record Count"^8^0^2^0 +54165^"URL Length"^8^0^2^0 +54166^"URL"^8^0^9^0 +54167^"Delay Threshold"^32^0^6^0 +54168^"Wi-Fi Request Type"^8^1^50413^0 +54169^"Wi-Fi Request Time Between Fixes"^16^0^4^0 +54170^"Iono Valid"^1^0^0^0 +54171^"Satellite Count Valid"^1^0^0^0 +54172^"Satellite List Valid"^1^0^0^0 +54173^"Ionospheric Corrections"^8^0^0^0 +54174^"SV Record Count"^8^0^2^0 +54175^"System Valid"^1^0^0^0 +54176^"PRN Valid"^1^0^0^0 +54177^"Health Status Valid"^1^0^0^0 +54178^"Process Status Valid"^1^0^0^0 +54179^"Ephemeris State Valid"^1^0^0^0 +54180^"Almanac State Valid"^1^0^0^0 +54181^"Elevation Valid"^1^0^0^0 +54182^"Azimuth Valid"^1^0^0^0 +54183^"CN0 Valid"^1^0^0^0 +54184^"System"^8^1^50414^0 +54185^"PRN"^8^0^2^0 +54186^"Health Level"^8^1^50415^0 +54187^"Processing Status"^8^1^50416^0 +54188^"Ephemeris State"^8^1^50417^0 +54189^"Almanac State"^8^1^50418^0 +54190^"Azimuth"^16^0^4^0 +54191^"CN0"^16^0^4^0 +54192^"Privacy Valid"^1^0^0^0 +54193^"QoS Valid"^1^0^0^0 +54194^"Count Valid"^1^0^0^0 +54195^"Interval Valid"^1^0^0^0 +54196^"Mode Valid"^1^0^0^0 +54197^"Requestor ID Valid"^1^0^0^0 +54198^"Privacy"^8^1^50419^0 +54199^"QoS"^8^0^2^0 +54200^"Position Count"^32^0^6^0 +54201^"Interval Between Fixes"^32^0^6^0 +54202^"Mode"^8^1^50420^0 +54203^"Requestor ID DCS"^8^1^50421^0 +54204^"Requestor ID Length"^8^0^2^0 +54205^"Requestor ID"^8^0^2^1 +54206^"Privacy Valid"^1^0^0^0 +54207^"INIT Hash Valid"^1^0^0^0 +54208^"Mode Valid"^1^0^0^0 +54209^"SLP Session ID Valid"^1^0^0^0 +54210^"SLP Server IPv4 Address Valid"^1^0^0^0 +54211^"SLP Server IPv6 Address Valid"^1^0^0^0 +54212^"SLP Server URL Address Valid"^1^0^0^0 +54213^"DCS Valid"^1^0^0^0 +54214^"Requestor ID Valid"^1^0^0^0 +54215^"Client Name Valid"^1^0^0^0 +54216^"QoP Horizontal Accuracy Valid"^1^0^0^0 +54217^"QoP Vertical Accuracy Valid"^1^0^0^0 +54218^"QoP Max Location Age Valid"^1^0^0^0 +54219^"QoP Delay Valid"^1^0^0^0 +54220^"Privacy"^8^1^50419^0 +54221^"INIT Hash"^64^0^8^1 +54222^"Mode"^8^1^50422^0 +54223^"SLP Session ID"^32^0^6^0 +54224^"SLP Server IPv4 Port"^32^0^6^0 +54225^"SLP Server IPv4 Address"^8^0^2^0 +54226^"SLP Server IPv6 Address"^8^0^2^0 +54227^"SLP Server URL Length"^8^0^2^0 +54228^"SLP Server URL Address"^8^0^9^0 +54229^"Request DCS"^8^1^50423^0 +54230^"Requestor ID DCS"^8^1^50424^0 +54231^"Requestor ID Length"^8^0^2^0 +54232^"Requestor ID"^8^0^2^1 +54233^"Client Name DCS"^8^1^50424^0 +54234^"Client Name Length"^8^0^2^0 +54235^"Client Name"^8^0^2^1 +54236^"QoP Horizontal Accuracy"^8^0^2^0 +54237^"QoP Vertical Accuracy"^8^0^2^0 +54238^"QoP Max Location Age"^8^0^2^0 +54239^"QoP Delay"^8^0^2^0 +54250^"Privacy Valid"^1^0^0^0 +54251^"Invoke ID Valid"^1^0^0^0 +54252^"Notification Text Valid"^1^0^0^0 +54253^"Client Address Valid"^1^0^0^0 +54254^"Location Type Valid"^1^0^0^0 +54255^"Requestor ID Valid"^1^0^0^0 +54256^"Codeword String Valid"^1^0^0^0 +54257^"Service Type ID Valid"^1^0^0^0 +54258^"Privacy"^8^1^50419^0 +54259^"Invoke ID"^8^0^2^0 +54260^"Notification Text DCS"^8^1^50425^0 +54261^"Notification Text Length"^8^0^2^0 +54262^"Notification Text"^8^0^2^1 +54263^"Client Address Length"^8^0^2^0 +54264^"Client Address"^8^0^9^0 +54265^"Location Type"^8^1^50426^0 +54266^"Requestor ID DCS"^8^1^50425^0 +54267^"Requestor ID Length"^8^0^2^0 +54268^"Requestor ID"^8^0^2^1 +54269^"Codeword DCS"^8^1^50425^0 +54270^"Codeword Length"^8^0^2^0 +54271^"Codeword"^8^0^2^1 +54272^"Service Type ID"^8^0^2^0 +54273^"Type"^8^1^50427^0 +54274^"Protocol/Data Type"^8^1^50428^0 +54275^"Embedded XTRA Data Client Enabled"^8^0^0^0 +54276^"Embedded XTRA Time Client Enabled"^8^0^0^0 +54277^"Service Major Version"^8^0^2^0 +54278^"Service Minor Version"^8^0^2^0 +54279^"Sequence Number"^8^0^2^0 +54280^"Total Length"^16^0^4^0 +54281^"Sequence Length"^16^0^4^0 +54282^"Data"^8^0^2^1 +54283^"Vertical Confidence"^8^0^2^0 +54284^"Source"^8^1^50429^0 +54285^"Wi-Fi Time Counter"^32^0^6^0 +54286^"Wi-Fi Latitude"^32^0^5^0 +54287^"Wi-Fi Longitude"^32^0^5^0 +54288^"HEPE In Meters"^16^0^4^0 +54289^"AP Count"^8^0^2^0 +54290^"Error Code"^8^0^2^0 +54291^"MAC Address"^8^0^2^1 +54292^"RSSI"^32^0^6^0 +54293^"Beacon Channel"^16^0^4^0 +54294^"State"^8^1^50430^0 +54295^"Enable SBAS"^8^0^0^0 +54296^"Allow Request"^8^0^0^0 +54297^"Timestamp"^64^0^8^0 +54298^"Time Uncertainty"^32^0^6^0 +54299^"Time Base"^8^1^50431^0 +54300^"Force Acceptance"^8^0^0^0 +54301^"Filename Length"^8^0^2^0 +54302^"Filename"^8^0^9^0 +54303^"File Operation"^8^1^50432^0 +54304^"Data Length"^32^0^6^0 +54305^"Part Number"^8^0^2^0 +54306^"Total Parts"^8^0^2^0 +54307^"Data"^8^0^2^1 +54308^"Data Power Optimization Enabled"^8^0^0^0 +54309^"Enable Data Power Optimization"^8^0^0^0 +54310^"On Demand Positioning"^8^1^50433^0 +54311^"Position Valid"^1^0^0^0 +54312^"Altitude/Vertical Uncertainty Valid"^1^0^0^0 +54313^"Time Milliseconds Valid"^1^0^0^0 +54314^"Time Week Number Valid"^1^0^0^0 +54315^"Time Uncertainty Valid"^1^0^0^0 +54316^"Iono Valid"^1^0^0^0 +54317^"GPS Ephemeris Valid"^1^0^0^0 +54318^"GPS Almanac Valid"^1^0^0^0 +54319^"GPS Health Valid"^1^0^0^0 +54320^"GPS Visible SVs Valid"^1^0^0^0 +54321^"Glonass Ephemeris Valid"^1^0^0^0 +54322^"Glonass Almanac Valid"^1^0^0^0 +54323^"Glonass Health Valid"^1^0^0^0 +54324^"Glonass Visible SVs Valid"^1^0^0^0 +54325^"SBAS Ephemeris Valid"^1^0^0^0 +54326^"SBAS Almanac Valid"^1^0^0^0 +54327^"SBAS Health Valid"^1^0^0^0 +54328^"SBAS Visible SVs Valid"^1^0^0^0 +54329^"XTRA Information Valid"^1^0^0^0 +54330^"Timestamp In TOW Milliseconds"^32^0^6^0 +54331^"GPS Week Number"^16^0^4^0 +54332^"Iono Is Valid"^8^0^0^0 +54333^"GPS Ephemeris SV Mask"^32^0^6^1 +54334^"GPS Almanac SV Mask"^32^0^6^1 +54335^"GPS Health SV Mask"^32^0^6^1 +54336^"GPS Visible SV Mask"^32^0^6^1 +54337^"Glonass Ephemeris SV Mask"^32^0^6^1 +54338^"Glonass Almanac SV Mask"^32^0^6^1 +54339^"Glonass Health SV Mask"^32^0^6^1 +54340^"Glonass Visible SV Mask"^32^0^6^1 +54341^"SBAS Ephemeris SV Mask"^32^0^6^1 +54342^"SBAS Almanac SV Mask"^32^0^6^1 +54343^"SBAS Health SV Mask"^32^0^6^1 +54344^"SBAS Visible SV Mask"^32^0^6^1 +54345^"XTRA GPS Start Week"^16^0^4^0 +54346^"XTRA GPS Start Minutes"^16^0^4^0 +54347^"XTRA GPS Valid Hours"^16^0^4^0 +54348^"Elevation"^32^0^13^0 +54349^"SLP Server IPv6 Port"^32^0^6^0 +54350^"Used For Position"^1^0^0^0 +54351^"Hidden SSID"^1^0^0^0 +54352^"Encryption On"^1^0^0^0 +54353^"Infrastructure Mode"^1^0^0^0 +54354^"Engine Enabled"^8^0^0^0 +54355^"Method State"^8^1^50434^0 +54356^"Network Mode"^8^1^50435^0 +55000^"SMS Wake Enabled"^8^0^0^0^-1^0 +55001^"Mask"^32^0^6^1^-1^0 +56000^"Display Text"^1^0^0^0^-1^0 +56001^"Get Inkey"^1^0^0^0^-1^0 +56002^"Get Input"^1^0^0^0^-1^0 +56003^"Setup Menu"^1^0^0^0^-1^0 +56004^"Select Item"^1^0^0^0^-1^0 +56005^"Send SMS Alpha Identifier"^1^0^0^0^-1^0 +56006^"Setup Event User Activity"^1^0^0^0^-1^0 +56007^"Setup Event Idle Screen Notify"^1^0^0^0^-1^0 +56008^"Setup Event Language Sel Notify"^1^0^0^0^-1^0 +56009^"Setup Idle Mode Text"^1^0^0^0^-1^0 +56010^"Language Notification"^1^0^0^0^-1^0 +56011^"Refresh"^1^0^0^0^-1^0 +56012^"End Proactive Session"^1^0^0^0^-1^0 +56013^"Reference ID"^32^0^6^1^-1^0 +56014^"Command Length"^16^0^4^0^-1^0 +56015^"Display Text Command"^8^0^2^1^-1^0 +56016^"Get Inkey Command"^8^0^2^1^-1^0 +56017^"Get Input Command"^8^0^2^1^-1^0 +56018^"Setup Menu Command"^8^0^2^1^-1^0 +56019^"Select Item Command"^8^0^2^1^-1^0 +56020^"Alpha ID Command Type"^8^1^50600^1^-1^0 +56021^"Alpha ID Length"^16^0^4^0^-1^0 +56022^"Alpha ID"^8^0^2^1^-1^0 +56023^"User Activity Notify"^1^0^0^0^-1^0 +56024^"Idle Screen Available"^1^0^0^0^-1^0 +56025^"Language Selection Notify"^1^0^0^0^-1^0 +56026^"Setup Idle Mode Text Command"^8^0^2^1^-1^0 +56027^"Language Notification Command"^8^0^2^1^-1^0 +56028^"Refresh Mode"^16^0^4^1^-1^0 +56029^"Refresh Stage"^16^1^50601^1^-1^0 +56030^"Proactive Session End Type"^8^1^50602^1^-1^0 +56031^"Terminal Response Length"^16^0^4^0^-1^0 +56032^"Terminal Response"^8^0^2^1^-1^0 +56033^"Envelope Command Type"^16^1^50005^0^-1^0 +56034^"Envelope Length"^16^0^4^0^-1^0 +56035^"Envelope Data"^8^0^2^1^-1^0 +56036^"Envelope Command Type"^16^1^50603^0^-1^0 +57000^"EAP-SIM"^1^0^0^0^-1^0 +57001^"EAP-AKA"^1^0^0^0^-1^0 +57002^"EAP Request Packet"^8^0^2^1^-1^0 +57003^"Response Packet"^8^0^2^1^-1^0 +57005^"Session Keys"^8^0^2^1^-1^0 +57006^"Result"^8^1^50700^0^-1^0 +58000^"Report Network Initiated Alerts"^8^0^0^0^-1^0 +58001^"Report Session Status"^8^0^0^0^-1^0 +58002^"Session Type"^8^1^50800^0^-1^0 +58003^"Session ID"^16^0^4^0^-1^0 +58004^"Session State"^8^1^50801^0^-1^0 +58005^"Session Failure"^8^1^50802^0^-1^0 +58006^"Retry Count"^8^0^2^0^-1^0 +58007^"Retry Pause Timer"^16^0^4^0^-1^0 +58008^"Remaining Time"^16^0^4^0^-1^0 +58009^"Selection"^8^1^50803^0^-1^0 +58010^"Device Provisioning Service Update Enabled"^8^0^0^0^-1^0 +58011^"PRL Service Update Enabled"^8^0^0^0^-1^0 +58012^"HFA Feature Enabled"^8^0^0^0^-1^0 +58013^"HFA Feature Done State"^8^1^50804^0^-1^0 +59000^"Instance ID"^8^0^2^0^-1^0 +59001^"Link ID"^16^0^4^0^-1^0 +59002^"Service Count"^8^0^2^0^-1^0 +59003^"Service Type"^8^1^50900^0^-1^0 +59004^"Major Version"^16^0^4^0^-1^0 +59005^"Minor Version"^16^0^4^0^-1^0 +59006^"Addendum Label Length"^8^0^2^0^-1^0 +59007^"Addendum Label"^8^0^9^0^-1^0 +59008^"Client ID"^8^0^2^0^-1^0 +59009^"Data Format"^8^1^50901^0^-1^0 +59010^"Link Protocol - 802.3"^1^0^0^0^-1^0 +59011^"Link Protocol - IP"^1^0^0^0^-1^0 +59012^"Report Power State Changes"^8^0^0^0^-1^0 +59013^"Current Power Save State"^32^1^50902^0^-1^0 +59014^"Previous Power Save State"^32^1^50902^0^-1^0 +59015^"Message ID"^16^0^4^0^-1^0 +70000^"USS DCS"^8^1^70000^0^-1^0 +70001^"USS Length"^8^0^2^0^-1^0 +70002^"USS Data"^8^0^2^1^-1^0 +70003^"Failure Cause"^16^0^4^1^-1^0 +70004^"Alpha DCS"^8^1^70001^0^-1^0 +70005^"Alpha Length"^8^0^2^0^-1^0 +70006^"Alpha Data"^8^0^2^1^-1^0 +70007^"Notification Type"^8^1^70002^0^-1^0 \ No newline at end of file diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Makefile.am b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Makefile.am new file mode 100644 index 0000000..8c4c194 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Makefile.am @@ -0,0 +1,19 @@ +noinst_LTLIBRARIES = libQMIDB.la + +DBFILES = \ + $(srcdir)/Entity.txt \ + $(srcdir)/EnumEntry.txt \ + $(srcdir)/Enum.txt \ + $(srcdir)/Field.txt \ + $(srcdir)/Struct.txt + +QMIDB.o: $(DBFILES) + $(LD) -r -b binary -o QMIDB.o $(DBFILES) + +libQMIDB_la_SOURCES = foo.c + +libQMIDB_la_LIBADD = QMIDB.o + +CLEANFILES = QMIDB.o + +EXTRA_DIST = $(DBFILES) diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Struct.txt b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Struct.txt new file mode 100755 index 0000000..0ab7590 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/Struct.txt @@ -0,0 +1,1317 @@ +50000^0^0^50000^""^-1^0^"" +50000^1^0^50001^""^-1^0^"" +50001^0^0^50002^""^-1^0^"" +50010^0^0^50100^""^-1^0^"" +50011^0^0^50101^""^-1^0^"" +50011^1^0^50102^""^-1^0^"" +50011^2^0^50103^""^-1^0^"" +50011^3^0^50104^""^-1^0^"" +50011^4^0^50105^""^-1^0^"" +50011^5^0^50106^""^-1^0^"" +50011^6^0^50107^""^-1^0^"" +50011^7^0^50169^""^-1^0^"" +50011^8^0^50170^""^-1^0^"" +50011^9^2^40^""^-1^0^"" +50012^0^0^50108^""^-1^0^"" +50013^0^0^50109^""^-1^0^"" +50014^0^0^50110^""^-1^0^"" +50015^0^0^50111^""^-1^0^"" +50016^0^0^50112^""^-1^0^"" +50017^0^0^50113^""^-1^0^"" +50018^0^0^50114^""^-1^0^"" +50019^0^0^50115^""^-1^0^"" +50019^1^0^50116^""^-1^0^"" +50020^0^0^50117^""^-1^0^"" +50021^0^0^50118^""^-1^1^"4" +50022^0^0^50119^""^-1^0^"" +50023^0^0^50120^""^-1^0^"" +50023^1^0^50121^""^-1^0^"" +50023^2^2^8^""^-1^0^"" +50024^0^0^50122^""^-1^0^"" +50025^0^0^50123^""^-1^0^"" +50026^0^0^50124^""^-1^0^"" +50026^1^0^50125^""^-1^0^"" +50026^2^2^8^""^-1^0^"" +50027^0^0^50126^""^-1^0^"" +50028^0^0^50127^""^-1^0^"" +50029^0^0^50128^""^-1^0^"" +50030^0^0^50128^""^-1^0^"" +50030^1^0^50129^""^-1^0^"" +50031^0^0^50115^""^-1^0^"" +50031^1^0^50116^""^-1^0^"" +50031^2^0^50130^""^-1^0^"" +50031^3^0^50131^""^-1^0^"" +50032^0^0^50102^""^-1^0^"" +50032^1^0^50103^""^-1^0^"" +50032^2^0^50104^""^-1^0^"" +50032^3^0^50105^""^-1^0^"" +50032^4^0^50106^""^-1^0^"" +50032^5^0^50107^""^-1^0^"" +50032^6^0^50169^""^-1^0^"" +50032^7^0^50170^""^-1^0^"" +50032^8^2^32^""^-1^0^"" +50033^0^0^50132^""^-1^0^"" +50034^0^0^50133^""^-1^0^"" +50035^0^0^50134^""^-1^0^"" +50036^0^0^50135^""^-1^0^"" +50036^1^0^50136^""^-1^0^"" +50036^2^0^50137^""^-1^0^"" +50036^3^0^50138^""^-1^0^"" +50036^4^0^50139^""^-1^0^"" +50036^5^0^50140^""^-1^0^"" +50036^6^0^50141^""^-1^0^"" +50036^7^0^50142^""^-1^0^"" +50036^8^0^50143^""^-1^0^"" +50036^9^0^50144^""^-1^0^"" +50036^10^0^50145^""^-1^0^"" +50036^11^0^50146^""^-1^0^"" +50037^0^0^50147^""^-1^0^"" +50037^1^0^50148^""^-1^0^"" +50037^2^0^50149^""^-1^0^"" +50037^3^0^50150^""^-1^0^"" +50037^4^0^50151^""^-1^0^"" +50038^0^0^50132^""^-1^0^"" +50038^1^0^50126^""^-1^0^"" +50039^0^0^50152^""^-1^0^"" +50039^1^1^50040^"Profile"^-1^2^"50152" +50040^0^0^50132^""^-1^0^"" +50040^1^0^50126^""^-1^0^"" +50040^2^0^50153^""^-1^0^"" +50040^3^0^50154^""^-1^10^"50153" +50041^0^0^50155^""^-1^0^"" +50042^0^0^50156^""^-1^0^"" +50043^0^0^50157^""^-1^0^"" +50044^0^0^50158^""^-1^0^"" +50045^0^0^50159^""^-1^0^"" +50046^0^0^50160^""^-1^0^"" +50047^0^0^50161^""^-1^0^"" +50048^0^0^50128^""^-1^0^"" +50048^1^0^50161^""^-1^0^"" +50049^0^0^50157^""^-1^0^"" +50050^0^0^50128^""^-1^0^"" +50051^0^0^50162^""^-1^0^"" +50051^1^0^50163^""^-1^0^"" +50051^2^0^50164^""^-1^0^"" +50051^3^0^50165^""^-1^0^"" +50051^4^0^50166^""^-1^0^"" +50051^5^0^50167^""^-1^0^"" +50051^6^0^50209^""^-1^0^"" +50051^7^2^32^""^-1^0^"" +50052^0^0^50168^""^-1^0^"" +50053^0^0^50101^""^-1^0^"" +50053^1^0^50169^""^14^0^"" +50053^2^0^50170^""^-1^0^"" +50053^7^2^40^""^-1^0^"" +50054^0^0^50171^""^-1^0^"" +50055^0^0^50172^""^-1^0^"" +50056^0^0^50173^""^-1^0^"" +50056^1^0^50126^""^-1^0^"" +50057^0^0^50174^""^-1^0^"" +50058^0^0^50175^""^-1^0^"" +50059^0^0^50176^""^-1^0^"" +50060^0^0^50177^""^-1^0^"" +50061^0^0^50178^""^-1^0^"" +50062^0^0^50179^""^-1^0^"" +50063^0^0^50180^""^-1^0^"" +50064^0^0^50181^""^-1^0^"" +50065^0^0^50182^""^-1^0^"" +50066^0^0^50183^""^-1^0^"" +50067^0^0^50184^""^-1^0^"" +50068^0^0^50185^""^-1^0^"" +50069^0^0^50186^""^-1^0^"" +50070^0^0^50173^""^-1^0^"" +50071^0^0^50187^""^-1^0^"" +50072^0^0^50188^""^-1^0^"" +50073^0^0^50189^""^-1^0^"" +50074^0^0^50190^""^-1^0^"" +50074^1^1^50075^"Record"^-1^2^"50190" +50075^0^0^50191^""^-1^0^"" +50075^1^0^50192^""^-1^0^"" +50075^2^0^50193^""^-1^0^"" +50075^3^0^50194^""^-1^0^"" +50075^4^0^50118^""^-1^1^"4" +50075^5^0^50196^""^-1^0^"" +50075^6^0^50197^""^-1^0^"" +50075^7^0^50198^""^-1^0^"" +50075^8^0^50199^""^-1^0^"" +50075^9^0^50157^""^-1^0^"" +50075^10^0^50201^""^-1^0^"" +50075^11^0^50202^""^-1^10^"50201" +50076^0^0^50190^""^-1^0^"" +50076^1^1^50077^"Record"^-1^2^"50190" +50077^0^0^50191^""^-1^0^"" +50078^0^0^50203^""^-1^0^"" +50079^0^0^50204^""^-1^0^"" +50080^0^0^50205^""^-1^0^"" +50081^0^0^50206^""^-1^0^"" +50082^0^0^50207^""^-1^0^"" +50083^0^0^50208^""^-1^0^"" +50084^0^0^50210^""^-1^0^"" +50084^1^0^50211^""^-1^0^"" +50084^2^0^50212^""^-1^0^"" +50084^3^0^50213^""^-1^0^"" +50084^4^0^50214^""^-1^0^"" +50084^5^0^50215^""^-1^0^"" +50084^6^0^50216^""^-1^0^"" +50084^7^0^50217^""^-1^0^"" +50084^8^0^50218^""^-1^0^"" +50084^9^0^50219^""^-1^0^"" +50084^10^0^50255^""^-1^0^"" +50084^11^0^50256^""^-1^0^"" +50084^12^0^50257^""^-1^0^"" +50084^13^0^50258^""^-1^0^"" +50084^14^0^50259^""^-1^0^"" +50084^15^0^50260^""^-1^0^"" +50084^16^0^50261^""^-1^0^"" +50084^17^0^50262^""^-1^0^"" +50084^18^2^32^""^-1^0^"" +50085^0^0^50220^""^-1^0^"" +50086^0^0^50221^""^-1^0^"" +50087^0^0^50222^""^-1^0^"" +50088^0^0^50223^""^-1^0^"" +50090^0^0^50230^""^-1^0^"" +50090^1^1^50091^""^-1^5^"50230 = 1" +50090^2^1^50092^""^-1^5^"50230 = 2" +50090^3^2^72^""^-1^0^"" +50091^0^0^50231^""^-1^0^"" +50091^1^0^50232^""^-1^0^"" +50091^2^0^50233^""^-1^0^"" +50091^3^2^32^""^-1^0^"" +50091^4^1^50093^""^-1^5^"50231 = 1" +50091^5^1^50094^""^-1^5^"50233 = 1" +50091^6^2^64^""^-1^0^"" +50092^0^0^50234^""^-1^0^"" +50092^1^0^50235^""^-1^0^"" +50092^2^0^50236^""^-1^0^"" +50092^3^0^50237^""^-1^0^"" +50092^4^0^50238^""^-1^0^"" +50092^5^0^50273^""^-1^0^"" +50092^6^2^32^""^-1^0^"" +50093^0^0^50239^""^-1^0^"" +50093^1^0^50240^""^-1^0^"" +50093^2^0^50241^""^-1^0^"" +50093^3^2^32^""^-1^0^"" +50094^0^0^50242^""^-1^0^"" +50094^1^0^50243^""^-1^0^"" +50094^2^0^50244^""^-1^0^"" +50094^3^0^50274^""^-1^0^"" +50094^4^2^32^""^-1^0^"" +50095^0^0^50245^""^-1^0^"" +50096^0^0^50246^""^-1^0^"" +50097^0^0^50247^""^-1^0^"" +50098^0^0^50248^""^-1^0^"" +50098^1^0^50249^""^-1^0^"" +50098^2^0^50250^""^16^5^"50248 = 1" +50098^3^0^50251^""^16^5^"50248 = 2" +50098^4^0^50252^""^16^5^"50248 = 3" +50098^5^0^50253^""^16^5^"50248 = 6" +50099^0^0^50254^""^-1^0^"" +50100^0^0^51000^""^-1^0^"" +50101^0^0^51001^""^-1^0^"" +50101^1^0^51002^""^-1^0^"" +50102^0^0^51003^""^-1^0^"" +50102^1^0^51004^""^-1^0^"" +50102^2^0^51005^""^-1^0^"" +50102^3^0^51006^""^-1^0^"" +50102^4^0^51007^""^8^0^"" +50103^0^0^51008^""^-1^0^"" +50103^1^0^51009^""^-1^0^"" +50103^2^0^51010^""^-1^0^"" +50103^3^0^51011^""^-1^0^"" +50103^4^0^51012^""^-1^0^"" +50103^5^0^51013^""^-1^2^"51012" +50104^0^0^51014^""^-1^0^"" +50105^0^0^51015^""^-1^0^"" +50106^0^0^51016^""^-1^0^"" +50107^0^0^51017^""^-1^0^"" +50108^0^0^51018^""^-1^0^"" +50109^0^0^51019^""^-1^0^"" +50110^0^0^51020^""^-1^0^"" +50111^0^0^51021^""^-1^0^"" +50112^0^0^51022^""^-1^0^"" +50113^0^0^51023^""^-1^0^"" +50114^0^0^51024^""^-1^0^"" +50115^0^0^51025^""^-1^0^"" +50116^0^0^51026^""^-1^0^"" +50116^1^0^51027^""^-1^0^"" +50117^0^0^51028^""^-1^0^"" +50118^0^0^51048^""^-1^0^"" +50118^1^0^51049^""^-1^9^"51048" +50119^0^0^51030^""^-1^0^"" +50119^1^0^51031^""^-1^0^"" +50119^2^0^51032^""^-1^0^"" +50119^3^0^51033^""^-1^9^"51032" +50119^4^0^51034^""^-1^0^"" +50119^5^0^51035^""^-1^9^"51034" +50120^0^0^51036^""^-1^0^"" +50120^1^0^51037^""^-1^2^"51036" +50121^0^0^51038^""^-1^0^"" +50121^1^0^51039^""^-1^9^"51038" +50122^0^0^51040^""^-1^0^"" +50122^1^0^51041^""^-1^9^"51040" +50123^0^0^51042^""^-1^0^"" +50124^0^0^51042^""^-1^0^"" +50124^1^0^51043^""^-1^0^"" +50125^0^0^51044^""^-1^0^"" +50125^1^0^51045^""^-1^0^"" +50126^0^0^51046^""^-1^0^"" +50126^1^0^51047^""^-1^2^"51046" +50127^0^0^51050^""^-1^0^"" +50127^1^0^51051^""^-1^0^"" +50127^2^0^51052^""^-1^0^"" +50127^3^0^51053^""^-1^9^"51052" +50128^0^0^51054^""^-1^0^"" +50128^1^0^51055^""^-1^0^"" +50129^0^0^51050^""^-1^0^"" +50129^1^0^51052^""^-1^0^"" +50129^2^0^51053^""^-1^9^"51052" +50130^0^0^51050^""^-1^0^"" +50130^1^0^51056^""^-1^0^"" +50130^2^0^51057^""^-1^9^"51056" +50130^3^0^51060^""^-1^0^"" +50130^4^0^51061^""^-1^9^"51060" +50131^0^0^51050^""^-1^0^"" +50131^1^0^51058^""^-1^0^"" +50131^2^0^51059^""^-1^9^"51058" +50131^3^0^51060^""^-1^0^"" +50131^4^0^51061^""^-1^9^"51060" +50132^0^0^51062^""^-1^0^"" +50132^1^0^51054^""^-1^0^"" +50132^2^0^51055^""^-1^0^"" +50133^0^0^51063^""^-1^0^"" +50134^0^0^51030^""^-1^0^"" +50135^0^0^51064^""^-1^0^"" +50135^1^0^51065^""^-1^0^"" +50135^2^0^51066^""^-1^0^"" +50135^3^0^51037^""^-1^2^"51065" +50136^0^0^51067^""^-1^0^"" +50137^0^0^51068^""^-1^0^"" +50138^0^0^51069^""^-1^0^"" +50139^0^0^51070^""^-1^0^"" +50139^1^0^51071^""^-1^0^"" +50139^2^0^51072^""^-1^0^"" +50139^3^0^51082^""^-1^0^"" +50140^0^0^51073^""^-1^0^"" +50141^0^0^51074^""^-1^0^"" +50142^0^0^51075^""^-1^0^"" +50143^0^0^51076^""^-1^0^"" +50144^0^0^51077^""^-1^0^"" +50145^0^0^51078^""^-1^0^"" +50146^0^0^51079^""^-1^0^"" +50146^1^0^51054^""^-1^0^"" +50146^2^0^51055^""^-1^0^"" +50147^0^0^51078^""^-1^0^"" +50147^1^0^51079^""^-1^0^"" +50147^2^0^51080^""^-1^0^"" +50147^3^0^51081^""^-1^9^"51080" +50148^0^0^51054^""^-1^0^"" +50149^0^0^51078^""^-1^0^"" +50149^1^0^51080^""^-1^0^"" +50149^2^0^51081^""^-1^9^"51080" +50150^0^0^51055^""^-1^0^"" +50151^0^0^51083^""^-1^0^"" +50152^0^0^51084^""^-1^0^"" +50153^0^0^51085^""^-1^0^"" +50155^0^0^51090^""^-1^0^"" +50155^1^1^50156^"Image"^-1^2^"51090" +50156^0^0^51091^""^-1^0^"" +50156^1^0^51092^""^-1^1^"16" +50156^2^0^51093^""^-1^0^"" +50156^3^0^51094^""^-1^10^"51093" +50157^0^0^51095^""^-1^0^"" +50158^0^0^51096^""^-1^0^"" +50159^0^0^51090^""^-1^0^"" +50159^1^0^51091^""^-1^2^"51090" +50160^0^0^51097^""^-1^0^"" +50161^0^0^51098^""^-1^0^"" +50161^1^1^50162^"Type"^-1^2^"51098" +50162^0^0^51091^""^-1^0^"" +50162^1^0^51099^""^-1^0^"" +50162^2^0^51100^""^-1^0^"" +50162^3^0^51090^""^-1^0^"" +50162^4^1^50163^"Image"^-1^2^"51090" +50163^0^0^51096^""^-1^0^"" +50163^1^0^51101^""^-1^0^"" +50163^2^0^51092^""^-1^1^"16" +50163^3^0^51093^""^-1^0^"" +50163^4^0^51094^""^-1^10^"51093" +50165^0^0^51110^""^-1^0^"" +50165^1^0^51111^""^-1^0^"" +50165^2^0^51112^""^-1^0^"" +50165^3^0^51113^""^-1^0^"" +50165^4^0^51114^""^-1^0^"" +50165^5^0^51115^""^-1^0^"" +50165^6^0^51116^""^-1^0^"" +50165^7^0^51117^""^-1^0^"" +50165^8^0^51118^""^-1^0^"" +50165^9^0^51119^""^-1^0^"" +50165^10^0^51120^""^-1^0^"" +50165^11^0^51121^""^-1^0^"" +50165^12^0^51122^""^-1^0^"" +50165^13^0^51123^""^-1^0^"" +50165^14^0^51124^""^-1^0^"" +50165^15^0^51125^""^-1^0^"" +50165^16^0^51126^""^-1^0^"" +50165^17^0^51127^""^-1^0^"" +50165^18^0^51128^""^-1^0^"" +50165^19^0^51129^""^-1^0^"" +50165^20^0^51130^""^-1^0^"" +50165^21^0^51131^""^-1^0^"" +50165^22^0^51132^""^-1^0^"" +50165^23^0^51133^""^-1^0^"" +50165^24^0^51134^""^-1^0^"" +50165^25^0^51135^""^-1^0^"" +50165^26^0^51136^""^-1^0^"" +50165^27^0^51137^""^-1^0^"" +50165^28^0^51138^""^-1^0^"" +50165^29^0^51139^""^-1^0^"" +50165^30^0^51140^""^31^0^"" +50165^31^0^51141^""^48^0^"" +50165^32^0^51142^""^-1^0^"" +50165^33^0^51143^""^-1^0^"" +50165^34^0^51144^""^56^0^"" +50165^35^0^51145^""^-1^0^"" +50165^36^0^51146^""^-1^0^"" +50165^37^0^51147^""^-1^0^"" +50165^38^2^64^""^-1^0^"" +50166^0^0^51148^""^-1^0^"" +50167^0^0^51149^""^-1^0^"" +50168^0^0^51150^""^-1^0^"" +50169^0^0^51151^""^-1^0^"" +50170^0^0^51152^""^-1^0^"" +50171^0^0^51153^""^-1^0^"" +50172^0^0^51154^""^-1^0^"" +50172^1^0^51155^""^-1^0^"" +50173^0^0^51156^""^-1^0^"" +50173^1^0^51157^""^-1^0^"" +50174^0^0^51158^""^-1^0^"" +50175^0^0^51159^""^-1^0^"" +50200^0^0^52000^""^-1^0^"" +50200^1^0^52001^""^-1^0^"" +50200^2^0^52002^""^-1^2^"52001" +50201^0^0^52003^""^-1^0^"" +50201^1^0^52004^""^-1^0^"" +50202^0^0^52005^""^-1^0^"" +50202^1^1^50203^"Network Info"^-1^2^"52005" +50203^0^0^52006^""^-1^0^"" +50203^1^0^52007^""^-1^0^"" +50203^2^0^52008^""^-1^0^"" +50203^3^0^52009^""^-1^0^"" +50203^4^0^52010^""^-1^0^"" +50203^5^0^52011^""^-1^0^"" +50203^6^0^52012^""^-1^0^"" +50203^7^0^52013^""^-1^10^"52012" +50204^0^0^52014^""^-1^0^"" +50205^0^0^52006^""^-1^0^"" +50205^1^0^52007^""^-1^0^"" +50205^2^0^52015^""^-1^0^"" +50206^0^0^52016^""^-1^0^"" +50207^0^0^52017^""^-1^0^"" +50207^1^0^52018^""^-1^0^"" +50207^2^0^52019^""^-1^0^"" +50207^3^0^52020^""^-1^0^"" +50207^4^0^52021^""^-1^0^"" +50207^5^0^52004^""^-1^2^"52021" +50208^0^0^52022^""^-1^0^"" +50209^0^0^52006^""^-1^0^"" +50209^1^0^52007^""^-1^0^"" +50209^2^0^52012^""^-1^0^"" +50209^3^0^52013^""^-1^10^"52012" +50210^0^0^52023^""^-1^0^"" +50210^1^1^50211^"Network"^-1^2^"52023" +50211^0^0^52006^""^-1^0^"" +50211^1^0^52007^""^-1^0^"" +50211^2^1^50212^""^-1^0^"" +50212^0^0^52024^""^6^0^"" +50212^1^0^52025^""^-1^0^"" +50212^2^0^52026^""^15^0^"" +50213^0^0^52027^""^-1^0^"" +50213^1^1^50214^"Network"^-1^2^"52027" +50214^0^0^52006^""^-1^0^"" +50214^1^0^52007^""^-1^0^"" +50215^0^0^52028^""^-1^0^"" +50215^1^0^52029^""^-1^0^"" +50216^0^1^50217^""^-1^0^"" +50216^1^0^52032^""^-1^0^"" +50217^0^0^52035^""^-1^0^"" +50217^1^1^50221^""^-1^5^"52035 = 1" +50217^2^1^50222^""^-1^5^"52035 = 2" +50217^3^2^16^""^-1^0^"" +50218^0^0^52033^""^-1^0^"" +50219^0^0^52034^""^-1^0^"" +50219^1^0^52033^""^-1^0^"" +50220^0^0^52005^""^-1^0^"" +50220^1^1^50201^"Info"^-1^2^"52005" +50221^0^0^52036^""^-1^0^"" +50221^1^0^52037^""^-1^0^"" +50221^2^0^52038^""^-1^0^"" +50222^0^0^52039^""^-1^0^"" +50222^1^0^52040^""^-1^0^"" +50223^0^0^52041^""^-1^0^"" +50223^1^0^52042^""^-1^2^"52041" +50224^0^0^52043^""^-1^0^"" +50225^0^0^52044^""^-1^0^"" +50226^0^0^52045^""^-1^0^"" +50227^0^0^52046^""^-1^0^"" +50227^1^0^52047^""^-1^0^"" +50227^2^0^52048^""^-1^0^"" +50228^0^0^52049^""^-1^0^"" +50229^0^0^52050^""^-1^0^"" +50229^1^0^52051^""^-1^0^"" +50229^2^0^52052^""^-1^0^"" +50229^3^0^52053^""^-1^0^"" +50229^4^0^52054^""^-1^0^"" +50229^5^0^52055^""^-1^0^"" +50229^6^0^52056^""^-1^0^"" +50229^7^0^52057^""^-1^0^"" +50229^8^0^52058^""^-1^0^"" +50229^9^0^52059^""^40^0^"" +50229^10^0^52060^""^72^0^"" +50229^11^0^52061^""^-1^0^"" +50229^12^2^104^""^-1^0^"" +50230^0^0^52034^""^-1^0^"" +50231^0^0^52062^""^-1^0^"" +50232^0^0^52004^""^-1^0^"" +50232^1^0^52063^""^-1^0^"" +50232^2^0^52064^""^-1^0^"" +50233^0^0^52065^""^-1^0^"" +50234^0^0^52066^""^-1^0^"" +50235^0^0^52067^""^-1^0^"" +50235^1^1^50232^"Instance"^-1^2^"52067" +50236^0^0^52068^""^-1^0^"" +50236^1^0^52069^""^-1^0^"" +50237^0^0^52070^""^-1^0^"" +50240^0^0^52080^""^-1^0^"" +50240^1^0^52081^""^-1^0^"" +50241^0^0^52082^""^-1^0^"" +50241^1^0^52083^""^-1^0^"" +50242^0^0^52084^""^-1^0^"" +50242^1^0^52085^""^-1^0^"" +50243^0^0^52086^""^-1^0^"" +50243^1^0^52087^""^-1^0^"" +50244^0^0^52088^""^-1^0^"" +50245^0^0^52089^""^-1^0^"" +50245^1^0^52004^""^-1^0^"" +50246^0^0^52090^""^-1^0^"" +50246^1^0^52004^""^-1^0^"" +50247^0^0^52091^""^-1^0^"" +50248^0^0^52092^""^-1^0^"" +50249^0^0^52093^""^-1^0^"" +50249^1^0^52004^""^-1^0^"" +50250^0^0^52094^""^-1^0^"" +50251^0^0^52095^""^-1^0^"" +50252^0^0^52096^""^-1^0^"" +50253^0^0^52157^""^-1^0^"" +50253^1^0^52158^""^-1^0^"" +50253^2^0^52159^""^-1^0^"" +50253^3^0^52160^""^-1^0^"" +50253^4^0^52161^""^-1^0^"" +50253^5^2^16^""^-1^0^"" +50254^0^0^52097^""^-1^0^"" +50254^1^1^50245^"Measurement"^-1^2^"52097" +50255^0^0^52097^""^-1^0^"" +50255^1^1^50246^"Measurement"^-1^2^"52097" +50256^0^0^52097^""^-1^0^"" +50256^1^1^50249^"Measurement"^-1^2^"52097" +50257^0^0^52098^""^-1^0^"" +50257^1^0^52099^""^-1^0^"" +50257^2^0^52100^""^-1^0^"" +50258^0^0^52067^""^-1^0^"" +50258^1^1^50259^"Instance"^-1^2^"52067" +50259^0^0^52004^""^-1^0^"" +50259^1^0^52022^""^-1^0^"" +50260^0^0^52022^""^-1^0^"" +50261^0^0^52101^""^-1^0^"" +50261^1^0^52102^""^-1^0^"" +50261^2^0^52103^""^-1^0^"" +50262^0^0^52104^""^-1^0^"" +50263^0^0^52105^""^-1^0^"" +50264^0^0^52106^""^-1^0^"" +50264^1^0^52107^""^-1^0^"" +50264^2^0^52108^""^-1^0^"" +50264^3^0^52109^""^-1^0^"" +50264^4^2^16^""^-1^0^"" +50265^0^0^52110^""^-1^0^"" +50265^1^0^52111^""^-1^0^"" +50265^2^0^52112^""^-1^0^"" +50265^3^0^52113^""^-1^0^"" +50265^4^0^52114^""^-1^0^"" +50265^5^0^52115^""^-1^0^"" +50265^6^0^52116^""^-1^0^"" +50265^7^0^52117^""^-1^0^"" +50265^8^0^52118^""^-1^0^"" +50265^9^0^52119^""^-1^0^"" +50265^10^0^52120^""^-1^0^"" +50265^11^0^52121^""^-1^0^"" +50265^12^0^52122^""^-1^0^"" +50265^13^0^52123^""^-1^0^"" +50265^14^0^52124^""^-1^0^"" +50265^15^0^52125^""^-1^0^"" +50265^16^0^52126^""^-1^0^"" +50265^17^0^52127^""^-1^0^"" +50265^18^0^52128^""^-1^0^"" +50265^19^0^52129^""^-1^0^"" +50265^20^0^52130^""^-1^0^"" +50265^21^0^52131^""^-1^0^"" +50265^22^0^52132^""^-1^0^"" +50265^23^0^52133^""^-1^0^"" +50265^24^0^52134^""^-1^0^"" +50265^25^0^52135^""^-1^0^"" +50265^26^0^52136^""^-1^0^"" +50265^27^0^52137^""^-1^0^"" +50265^28^0^52138^""^-1^0^"" +50265^29^0^52139^""^-1^0^"" +50265^30^0^52140^""^31^0^"" +50265^31^0^52141^""^48^0^"" +50265^32^0^52142^""^-1^0^"" +50265^33^0^52143^""^-1^0^"" +50265^34^0^52144^""^56^0^"" +50265^35^0^52145^""^-1^0^"" +50265^36^0^52146^""^-1^0^"" +50265^37^0^52147^""^-1^0^"" +50265^38^2^64^""^-1^0^"" +50266^0^0^52148^""^-1^0^"" +50267^0^0^52149^""^-1^0^"" +50268^0^0^52150^""^-1^0^"" +50268^1^0^52151^""^-1^0^"" +50268^2^0^52152^""^-1^0^"" +50268^3^0^52153^""^-1^0^"" +50268^4^0^52154^""^-1^0^"" +50268^6^0^52155^""^24^0^"" +50268^7^0^52067^""^-1^0^"" +50268^8^0^52156^""^-1^2^"52067" +50269^0^0^52006^""^-1^0^"" +50269^1^0^52007^""^-1^0^"" +50269^2^0^52162^""^-1^0^"" +50269^3^0^52163^""^-1^0^"" +50269^4^0^52164^""^-1^0^"" +50269^5^0^52165^""^-1^2^"52164" +50270^0^0^52005^""^-1^0^"" +50270^1^1^50271^"Info"^-1^2^"52005" +50271^0^0^52006^""^-1^0^"" +50271^1^0^52007^""^-1^0^"" +50271^2^0^52015^""^-1^0^"" +50272^0^0^52166^""^-1^0^"" +50273^0^0^52167^""^-1^0^"" +50274^0^0^52168^""^-1^0^"" +50274^1^0^52169^""^-1^0^"" +50274^2^0^52170^""^-1^2^"52169" +50274^3^0^52171^""^-1^0^"" +50274^4^0^52172^""^-1^0^"" +50274^5^0^52173^""^-1^0^"" +50274^6^0^52174^""^-1^0^"" +50274^7^0^52175^""^-1^2^"52174" +50274^8^0^52176^""^-1^0^"" +50274^9^0^52177^""^-1^0^"" +50274^10^0^52178^""^-1^0^"" +50274^11^0^52179^""^-1^0^"" +50274^12^0^52180^""^-1^2^"52179" +50275^0^0^52181^""^-1^0^"" +50275^1^0^52004^""^-1^0^"" +50276^0^0^52182^""^-1^0^"" +50277^0^0^52183^""^-1^0^"" +50277^1^0^52184^""^-1^0^"" +50300^0^0^53000^""^-1^0^"" +50301^0^0^53001^""^-1^0^"" +50301^1^0^53002^""^-1^0^"" +50302^0^0^53003^""^-1^0^"" +50302^1^0^53004^""^-1^0^"" +50302^2^0^53005^""^-1^2^"53004" +50303^0^0^53006^""^-1^0^"" +50304^0^0^53001^""^-1^0^"" +50304^1^0^53003^""^-1^0^"" +50304^2^0^53004^""^-1^0^"" +50304^3^0^53005^""^-1^2^"53004" +50305^0^0^53002^""^-1^0^"" +50306^0^0^53007^""^-1^0^"" +50306^1^0^53003^""^-1^0^"" +50306^2^0^53004^""^-1^0^"" +50306^3^0^53005^""^-1^2^"53004" +50307^0^0^53001^""^-1^0^"" +50307^1^0^53002^""^-1^0^"" +50307^2^0^53007^""^-1^0^"" +50308^0^0^53001^""^-1^0^"" +50309^0^0^53007^""^-1^0^"" +50310^0^0^53008^""^-1^0^"" +50311^0^0^53009^""^-1^0^"" +50311^1^1^50312^"Message"^-1^2^"53009" +50312^0^0^53002^""^-1^0^"" +50312^1^0^53007^""^-1^0^"" +50313^0^0^53010^""^-1^0^"" +50313^1^1^50314^"Route"^-1^2^"53010" +50314^0^0^53011^""^-1^0^"" +50314^1^0^53012^""^-1^0^"" +50314^2^0^53001^""^-1^0^"" +50314^3^0^53013^""^-1^0^"" +50315^0^0^53010^""^-1^0^"" +50315^1^1^50316^"Route"^-1^2^"53010" +50316^0^0^53011^""^-1^0^"" +50316^1^0^53012^""^-1^0^"" +50316^2^0^53001^""^-1^0^"" +50316^3^0^53014^""^-1^0^"" +50317^0^0^53015^""^-1^0^"" +50317^1^0^53016^""^-1^0^"" +50317^2^0^53017^""^-1^9^"53016" +50318^0^0^53018^""^-1^0^"" +50319^0^0^53019^""^-1^0^"" +50320^0^0^53020^""^-1^0^"" +50320^1^0^53021^""^-1^0^"" +50320^2^0^53003^""^-1^0^"" +50320^3^0^53004^""^-1^0^"" +50320^4^0^53005^""^-1^2^"53004" +50321^0^0^53022^""^-1^0^"" +50321^1^0^53023^""^-1^0^"" +50322^0^0^53024^""^-1^0^"" +50323^0^0^53025^""^-1^0^"" +50324^0^0^53026^""^-1^0^"" +50325^0^0^53027^""^-1^0^"" +50325^1^0^53028^""^-1^0^"" +50326^0^0^53029^""^-1^0^"" +50327^0^0^53030^""^-1^0^"" +50328^0^0^53031^""^-1^0^"" +50329^0^0^53021^""^-1^0^"" +50329^1^0^53008^""^-1^0^"" +50329^2^0^53032^""^-1^0^"" +50330^0^0^53033^""^-1^0^"" +50330^1^0^53034^""^-1^0^"" +50331^0^0^53035^""^-1^0^"" +50331^1^0^53028^""^-1^0^"" +50332^0^0^53036^""^-1^0^"" +50333^0^0^53037^""^-1^0^"" +50334^0^0^53038^""^-1^0^"" +50335^0^0^53039^""^-1^0^"" +50336^0^0^53008^""^-1^0^"" +50336^1^0^53040^""^-1^0^"" +50337^0^0^53041^""^-1^0^"" +50337^1^1^50338^"Instance"^-1^2^"53041" +50338^0^0^53042^""^-1^0^"" +50338^1^0^53043^""^-1^0^"" +50338^2^0^53044^""^-1^0^"" +50339^0^0^53041^""^-1^0^"" +50339^1^1^50340^"Instance"^-1^2^"53041" +50340^0^0^53045^""^-1^0^"" +50340^1^0^53046^""^-1^0^"" +50340^2^0^53044^""^-1^0^"" +50341^0^0^53047^""^-1^0^"" +50341^1^0^53041^""^-1^0^"" +50341^2^1^50338^"Instance"^-1^2^"53041" +50342^0^0^53047^""^-1^0^"" +50342^1^0^53041^""^-1^0^"" +50342^2^1^50340^"Instance"^-1^2^"53041" +50343^0^0^53001^""^-1^0^"" +50343^1^0^53008^""^-1^0^"" +50344^0^0^53048^""^-1^0^"" +50345^0^0^53001^""^-1^0^"" +50345^1^0^53002^""^-1^0^"" +50345^2^0^53008^""^-1^0^"" +50346^0^0^53049^""^-1^0^"" +50400^0^0^54000^""^-1^0^"" +50401^0^0^54001^""^-1^0^"" +50402^0^0^54002^""^-1^0^"" +50402^1^0^54003^""^-1^0^"" +50403^0^0^54002^""^-1^0^"" +50404^0^0^54004^""^-1^0^"" +50404^1^0^54005^""^-1^0^"" +50404^2^0^54006^""^-1^0^"" +50404^3^0^54007^""^-1^0^"" +50404^4^0^54008^""^-1^0^"" +50404^5^0^54009^""^-1^0^"" +50404^6^0^54010^""^-1^0^"" +50404^7^0^54011^""^-1^0^"" +50405^0^0^54012^""^-1^0^"" +50405^1^0^54013^""^-1^0^"" +50405^2^0^54014^""^-1^0^"" +50405^3^0^54015^""^-1^0^"" +50405^4^0^54016^""^-1^0^"" +50405^5^0^54017^""^8^0^"" +50405^6^0^54018^""^-1^0^"" +50406^0^0^54019^""^-1^0^"" +50406^1^0^54020^""^-1^0^"" +50407^0^0^54006^""^-1^0^"" +50407^1^0^54008^""^-1^0^"" +50407^2^0^54010^""^-1^0^"" +50407^3^0^54011^""^-1^0^"" +50408^0^0^54021^""^-1^0^"" +50408^1^0^54022^""^-1^0^"" +50409^0^0^54023^""^-1^0^"" +50409^1^0^54024^""^-1^2^"54023" +50410^0^0^54025^""^-1^0^"" +50411^0^0^54026^""^-1^0^"" +50411^1^0^54027^""^-1^0^"" +50411^2^0^54028^""^-1^0^"" +50412^0^0^54029^""^-1^1^"4" +50412^1^0^54030^""^-1^0^"" +50413^0^0^54031^""^-1^0^"" +50414^0^0^54032^""^-1^0^"" +50414^1^0^54033^""^-1^0^"" +50414^2^0^54034^""^-1^0^"" +50414^3^0^54035^""^-1^0^"" +50414^4^0^54036^""^-1^0^"" +50414^5^0^54037^""^-1^0^"" +50414^6^0^54038^""^-1^0^"" +50414^7^0^54039^""^-1^0^"" +50414^8^0^54040^""^-1^0^"" +50414^9^0^54041^""^-1^0^"" +50414^10^0^54042^""^-1^0^"" +50414^11^0^54043^""^-1^0^"" +50414^12^0^54044^""^-1^0^"" +50414^13^2^32^""^-1^0^"" +50415^0^0^54045^""^-1^0^"" +50415^1^0^54046^""^-1^0^"" +50415^2^0^54047^""^-1^0^"" +50415^3^0^54048^""^-1^0^"" +50415^4^0^54049^""^-1^0^"" +50415^5^0^54050^""^-1^0^"" +50415^6^0^54051^""^-1^0^"" +50415^7^0^54052^""^-1^0^"" +50415^8^0^54053^""^-1^0^"" +50415^9^0^54054^""^-1^0^"" +50415^10^2^32^""^-1^0^"" +50416^0^0^54055^""^-1^0^"" +50417^0^0^54056^""^-1^0^"" +50417^1^0^54057^""^-1^0^"" +50417^2^0^54058^""^-1^10^"54057" +50420^0^0^54100^""^-1^0^"" +50421^0^0^54101^""^-1^0^"" +50422^0^0^54102^""^-1^0^"" +50423^0^0^54103^""^-1^0^"" +50424^0^0^54104^""^-1^0^"" +50425^0^0^54105^""^-1^0^"" +50426^0^0^54106^""^-1^0^"" +50427^0^0^54107^""^-1^0^"" +50428^0^0^54108^""^-1^0^"" +50429^0^0^54109^""^-1^0^"" +50430^0^0^54110^""^-1^0^"" +50430^1^0^54111^""^-1^0^"" +50430^2^0^54112^""^-1^0^"" +50430^3^0^54113^""^-1^0^"" +50430^4^0^54114^""^-1^0^"" +50430^5^0^54115^""^-1^0^"" +50430^6^0^54116^""^-1^0^"" +50430^7^0^54117^""^-1^0^"" +50430^8^0^54118^""^-1^0^"" +50430^9^0^54119^""^-1^0^"" +50430^10^0^54120^""^-1^0^"" +50430^11^0^54121^""^-1^0^"" +50430^12^0^54122^""^-1^0^"" +50430^13^0^54123^""^-1^0^"" +50430^14^0^54124^""^-1^0^"" +50430^15^0^54125^""^-1^0^"" +50430^16^0^54126^""^-1^0^"" +50430^17^0^54127^""^-1^0^"" +50430^18^0^54128^""^-1^0^"" +50430^19^0^54129^""^-1^0^"" +50430^20^0^54130^""^-1^0^"" +50430^21^0^54131^""^-1^0^"" +50430^22^0^54132^""^-1^0^"" +50430^23^0^54132^""^-1^0^"" +50430^24^2^32^""^-1^0^"" +50430^25^0^54133^""^-1^0^"" +50430^26^0^54134^""^-1^0^"" +50430^27^0^54135^""^-1^0^"" +50430^28^0^54136^""^-1^0^"" +50430^29^0^54137^""^-1^0^"" +50430^30^0^54138^""^-1^0^"" +50430^31^0^54139^""^-1^0^"" +50430^32^0^54140^""^-1^0^"" +50430^33^0^54141^""^-1^0^"" +50430^34^0^54142^""^-1^0^"" +50430^35^0^54143^""^-1^0^"" +50430^36^0^54144^""^-1^0^"" +50430^37^0^54145^""^-1^0^"" +50430^38^0^54146^""^-1^0^"" +50430^39^0^54147^""^-1^0^"" +50430^40^0^54148^""^-1^0^"" +50430^41^0^54149^""^-1^0^"" +50430^42^0^54150^""^-1^0^"" +50430^43^0^54151^""^-1^0^"" +50430^44^0^54152^""^-1^0^"" +50430^45^0^54153^""^-1^0^"" +50430^46^0^54154^""^-1^0^"" +50430^47^0^54155^""^-1^0^"" +50430^48^0^54156^""^-1^0^"" +50430^49^0^54157^""^-1^0^"" +50430^50^0^54158^""^-1^0^"" +50430^51^0^54159^""^-1^0^"" +50430^52^0^54160^""^-1^0^"" +50430^53^0^54161^""^-1^0^"" +50430^54^0^54162^""^-1^0^"" +50431^0^0^54163^""^-1^0^"" +50431^1^0^54164^""^-1^0^"" +50431^2^1^50432^"URL"^-1^2^"54164" +50432^0^0^54165^""^-1^0^"" +50432^1^0^54166^""^-1^10^"54165" +50433^0^0^54167^""^-1^0^"" +50433^1^0^54164^""^-1^0^"" +50433^2^1^50432^"URL"^-1^2^"54164" +50434^0^0^54168^""^-1^0^"" +50434^1^0^54169^""^-1^0^"" +50435^0^0^54170^""^-1^0^"" +50435^1^0^54171^""^-1^0^"" +50435^2^0^54172^""^-1^0^"" +50435^3^2^32^""^-1^0^"" +50435^4^0^54173^""^-1^0^"" +50435^5^0^54174^""^-1^0^"" +50435^6^1^50436^"SV"^-1^2^"54174" +50436^0^0^54175^""^-1^0^"" +50436^1^0^54176^""^-1^0^"" +50436^2^0^54177^""^-1^0^"" +50436^3^0^54178^""^-1^0^"" +50436^4^0^54179^""^-1^0^"" +50436^5^0^54180^""^-1^0^"" +50436^6^0^54181^""^-1^0^"" +50436^7^0^54182^""^-1^0^"" +50436^8^0^54183^""^-1^0^"" +50436^9^2^32^""^-1^0^"" +50436^10^0^54184^""^-1^0^"" +50436^11^0^54185^""^-1^0^"" +50436^12^0^54186^""^-1^0^"" +50436^13^0^54187^""^-1^0^"" +50436^14^0^54188^""^-1^0^"" +50436^15^0^54189^""^-1^0^"" +50436^16^0^54347^""^-1^0^"" +50436^17^0^54190^""^-1^0^"" +50436^18^0^54191^""^-1^0^"" +50437^0^0^54192^""^-1^0^"" +50437^1^0^54193^""^-1^0^"" +50437^2^0^54194^""^-1^0^"" +50437^3^0^54195^""^-1^0^"" +50437^4^0^54196^""^-1^0^"" +50437^5^0^54197^""^-1^0^"" +50437^6^2^32^""^-1^0^"" +50437^7^0^54198^""^-1^0^"" +50437^8^0^54199^""^-1^0^"" +50437^9^0^54200^""^-1^0^"" +50437^10^0^54201^""^-1^0^"" +50437^11^0^54202^""^-1^0^"" +50437^12^0^54203^""^-1^0^"" +50437^13^0^54204^""^-1^0^"" +50437^14^0^54205^""^-1^2^"54204" +50438^0^0^54206^""^-1^0^"" +50438^1^0^54207^""^-1^0^"" +50438^2^0^54208^""^-1^0^"" +50438^3^0^54209^""^-1^0^"" +50438^4^0^54210^""^-1^0^"" +50438^5^0^54211^""^-1^0^"" +50438^6^0^54212^""^-1^0^"" +50438^7^0^54213^""^-1^0^"" +50438^8^0^54214^""^-1^0^"" +50438^9^0^54215^""^-1^0^"" +50438^10^0^54216^""^-1^0^"" +50438^11^0^54217^""^-1^0^"" +50438^12^0^54218^""^-1^0^"" +50438^13^0^54219^""^-1^0^"" +50438^14^2^32^""^-1^0^"" +50438^15^0^54220^""^-1^0^"" +50438^16^0^54221^""^-1^0^"" +50438^17^0^54222^""^-1^0^"" +50438^18^0^54223^""^-1^0^"" +50438^19^0^54224^""^-1^0^"" +50438^20^0^54225^""^-1^1^"4" +50438^21^0^54348^""^-1^0^"" +50438^22^0^54226^""^-1^1^"16" +50438^23^0^54227^""^-1^0^"" +50438^24^0^54228^""^-1^10^"54227" +50438^25^0^54229^""^-1^0^"" +50438^26^0^54230^""^-1^0^"" +50438^27^0^54231^""^-1^0^"" +50438^28^0^54232^""^-1^2^"54231" +50438^29^0^54233^""^-1^0^"" +50438^30^0^54234^""^-1^0^"" +50438^31^0^54235^""^-1^2^"54234" +50438^32^0^54236^""^-1^0^"" +50438^33^0^54237^""^-1^0^"" +50438^34^0^54238^""^-1^0^"" +50438^35^0^54239^""^-1^0^"" +50439^0^0^54250^""^-1^0^"" +50439^1^0^54251^""^-1^0^"" +50439^2^0^54252^""^-1^0^"" +50439^3^0^54253^""^-1^0^"" +50439^4^0^54254^""^-1^0^"" +50439^5^0^54255^""^-1^0^"" +50439^6^0^54256^""^-1^0^"" +50439^7^0^54257^""^-1^0^"" +50439^8^2^32^""^-1^0^"" +50439^9^0^54258^""^-1^0^"" +50439^10^0^54259^""^-1^0^"" +50439^11^0^54260^""^-1^0^"" +50439^12^0^54261^""^-1^0^"" +50439^13^0^54262^""^-1^2^"54261" +50439^14^0^54263^""^-1^0^"" +50439^15^0^54264^""^-1^10^"54263" +50439^16^0^54265^""^-1^0^"" +50439^17^0^54266^""^-1^0^"" +50439^18^0^54267^""^-1^0^"" +50439^19^0^54268^""^-1^2^"54267" +50439^20^0^54269^""^-1^0^"" +50439^21^0^54270^""^-1^0^"" +50439^22^0^54271^""^-1^2^"54270" +50439^23^0^54272^""^-1^0^"" +50440^0^0^54273^""^-1^0^"" +50440^1^0^54274^""^-1^0^"" +50441^0^0^54275^""^-1^0^"" +50441^1^0^54276^""^-1^0^"" +50442^0^0^54006^""^-1^0^"" +50443^0^0^54008^""^-1^0^"" +50444^0^0^54011^""^-1^0^"" +50445^0^0^54277^""^-1^0^"" +50445^1^0^54278^""^-1^0^"" +50446^0^0^54279^""^-1^0^"" +50446^1^0^54280^""^-1^0^"" +50446^2^0^54281^""^-1^0^"" +50446^3^0^54282^""^-1^2^"54281" +50447^0^0^54142^""^-1^0^"" +50448^0^0^54144^""^-1^0^"" +50449^0^0^54145^""^-1^0^"" +50450^0^0^54146^""^-1^0^"" +50451^0^0^54147^""^-1^0^"" +50452^0^0^54151^""^-1^0^"" +50453^0^0^54155^""^-1^0^"" +50454^0^0^54158^""^-1^0^"" +50455^0^0^54283^""^-1^0^"" +50456^0^0^54284^""^-1^0^"" +50457^0^0^54285^""^-1^0^"" +50458^0^0^54286^""^-1^0^"" +50458^1^0^54287^""^-1^0^"" +50458^2^0^54288^""^-1^0^"" +50458^3^0^54289^""^-1^0^"" +50458^4^0^54290^""^-1^0^"" +50459^0^0^54289^""^-1^0^"" +50459^1^1^50460^"AP"^-1^2^"54289" +50460^0^0^54291^""^-1^1^"6" +50460^1^0^54292^""^-1^0^"" +50460^2^0^54293^""^-1^0^"" +50460^3^0^54350^""^-1^0^"" +50460^4^0^54351^""^-1^0^"" +50460^5^0^54352^""^-1^0^"" +50460^6^0^54353^""^-1^0^"" +50460^7^2^8^""^-1^0^"" +50461^0^0^54294^""^-1^0^"" +50462^0^0^54295^""^-1^0^"" +50463^0^0^54296^""^-1^0^"" +50464^0^0^54297^""^-1^0^"" +50464^1^0^54298^""^-1^0^"" +50464^2^0^54299^""^-1^0^"" +50464^3^0^54300^""^-1^0^"" +50465^0^0^54301^""^-1^0^"" +50465^1^0^54302^""^-1^10^"54301" +50465^2^0^54303^""^-1^0^"" +50465^3^0^54304^""^-1^0^"" +50465^4^0^54305^""^-1^0^"" +50465^5^0^54306^""^-1^0^"" +50465^6^0^54306^""^-1^2^"54304" +50466^0^0^54308^""^-1^0^"" +50467^0^0^54309^""^-1^0^"" +50468^0^0^54310^""^-1^0^"" +50469^0^0^54354^""^-1^0^"" +50469^1^0^54311^""^-1^0^"" +50469^2^0^54312^""^-1^0^"" +50469^3^0^54313^""^-1^0^"" +50469^4^0^54314^""^-1^0^"" +50469^5^0^54315^""^-1^0^"" +50469^6^0^54316^""^-1^0^"" +50469^7^0^54317^""^-1^0^"" +50469^8^0^54318^""^-1^0^"" +50469^9^0^54319^""^-1^0^"" +50469^10^0^54320^""^-1^0^"" +50469^11^0^54321^""^-1^0^"" +50469^12^0^54322^""^-1^0^"" +50469^13^0^54323^""^-1^0^"" +50469^14^0^54324^""^-1^0^"" +50469^15^0^54325^""^-1^0^"" +50469^16^0^54326^""^-1^0^"" +50469^17^0^54327^""^-1^0^"" +50469^18^0^54328^""^-1^0^"" +50469^19^0^54329^""^-1^0^"" +50469^20^2^32^""^-1^0^"" +50469^21^0^54144^""^-1^0^"" +50469^22^0^54145^""^-1^0^"" +50469^23^0^54151^""^-1^0^"" +50469^24^0^54146^""^-1^0^"" +50469^25^0^54155^""^-1^0^"" +50469^26^0^54330^""^-1^0^"" +50469^27^0^54331^""^-1^0^"" +50469^28^0^54298^""^-1^0^"" +50469^29^0^54332^""^-1^0^"" +50469^30^0^54333^""^-1^0^"" +50469^31^0^54334^""^-1^0^"" +50469^32^0^54335^""^-1^0^"" +50469^33^0^54336^""^-1^0^"" +50469^34^0^54337^""^-1^0^"" +50469^35^0^54338^""^-1^0^"" +50469^36^0^54339^""^-1^0^"" +50469^37^0^54340^""^-1^0^"" +50469^38^0^54341^""^-1^0^"" +50469^39^0^54342^""^-1^0^"" +50469^40^0^54343^""^-1^0^"" +50469^41^0^54344^""^-1^0^"" +50469^42^0^54345^""^-1^0^"" +50469^43^0^54346^""^-1^0^"" +50469^44^0^54347^""^-1^0^"" +50470^0^0^54355^""^-1^0^"" +50471^0^0^54356^""^-1^0^"" +50500^0^0^55000^""^-1^0^"" +50501^0^0^55001^""^-1^0^"" +50600^0^0^56000^""^-1^0^"" +50600^1^0^56001^""^-1^0^"" +50600^2^0^56002^""^-1^0^"" +50600^3^0^56003^""^-1^0^"" +50600^4^0^56004^""^-1^0^"" +50600^5^0^56005^""^-1^0^"" +50600^6^0^56006^""^-1^0^"" +50600^7^0^56007^""^-1^0^"" +50600^8^0^56008^""^-1^0^"" +50600^9^0^56009^""^-1^0^"" +50600^10^0^56010^""^-1^0^"" +50600^11^0^56011^""^-1^0^"" +50600^12^0^56012^""^-1^0^"" +50600^13^2^32^""^-1^0^"" +50601^0^0^56013^""^-1^0^"" +50601^1^0^56014^""^-1^0^"" +50601^2^0^56015^""^-1^2^"56014" +50602^0^0^56013^""^-1^0^"" +50602^1^0^56014^""^-1^0^"" +50602^2^0^56016^""^-1^2^"56014" +50603^0^0^56013^""^-1^0^"" +50603^1^0^56014^""^-1^0^"" +50603^2^0^56017^""^-1^2^"56014" +50604^0^0^56013^""^-1^0^"" +50604^1^0^56014^""^-1^0^"" +50604^2^0^56018^""^-1^2^"56014" +50605^0^0^56013^""^-1^0^"" +50605^1^0^56014^""^-1^0^"" +50605^2^0^56019^""^-1^2^"56014" +50606^0^0^56020^""^-1^0^"" +50606^1^0^56021^""^-1^0^"" +50606^2^0^56022^""^-1^2^"56021" +50607^0^0^56023^""^-1^0^"" +50607^1^0^56024^""^-1^0^"" +50607^2^0^56025^""^-1^0^"" +50607^3^2^32^""^-1^0^"" +50608^0^0^56013^""^-1^0^"" +50608^1^0^56014^""^-1^0^"" +50608^2^0^56026^""^-1^2^"56014" +50609^0^0^56013^""^-1^0^"" +50609^1^0^56014^""^-1^0^"" +50609^2^0^56027^""^-1^2^"56014" +50610^0^0^56028^""^-1^0^"" +50610^1^0^56029^""^-1^0^"" +50611^0^0^56030^""^-1^0^"" +50612^0^0^56013^""^-1^0^"" +50612^1^0^56031^""^-1^0^"" +50612^2^0^56032^""^-1^2^"56031" +50613^0^0^56036^""^-1^0^"" +50613^1^0^56034^""^-1^0^"" +50613^2^0^56035^""^-1^2^"56034" +50615^0^1^50600^"Common"^-1^0^"" +50615^1^1^50600^"Control"^-1^0^"" +50700^0^0^57000^""^-1^0^"" +50700^1^0^57001^""^-1^0^"" +50700^2^2^32^""^-1^0^"" +50701^0^0^57002^""^-1^1^"4096" +50703^0^0^57003^""^-1^1^"4096" +50704^0^0^57006^""^-1^0^"" +50705^0^0^57005^""^-1^1^"4096" +50800^0^0^58000^""^-1^0^"" +50801^0^0^58001^""^-1^0^"" +50802^0^0^58002^""^-1^0^"" +50802^1^0^58003^""^-1^0^"" +50803^0^0^58004^""^-1^0^"" +50804^0^0^58005^""^-1^0^"" +50805^0^0^58002^""^-1^0^"" +50806^0^0^58004^""^-1^0^"" +50806^1^0^58002^""^-1^0^"" +50807^0^0^58006^""^-1^0^"" +50807^1^0^58007^""^-1^0^"" +50807^2^0^58008^""^-1^0^"" +50808^0^0^58009^""^-1^0^"" +50808^1^0^58003^""^-1^0^"" +50809^0^0^58010^""^-1^0^"" +50810^0^0^58011^""^-1^0^"" +50811^0^0^58012^""^-1^0^"" +50812^0^0^58013^""^-1^0^"" +50900^0^0^59000^""^-1^0^"" +50901^0^0^59001^""^-1^0^"" +50902^0^0^59002^""^-1^0^"" +50902^1^1^50903^"Services"^-1^2^"59002" +50903^0^0^59003^""^-1^0^"" +50903^1^0^59004^""^-1^0^"" +50903^2^0^59005^""^-1^0^"" +50904^0^0^59006^""^-1^0^"" +50904^1^0^59007^""^-1^9^"59006" +50904^2^0^59002^""^-1^0^"" +50904^3^1^50903^"Services"^-1^2^"59002" +50905^0^0^59003^""^-1^0^"" +50906^0^0^59003^""^-1^0^"" +50906^1^0^59008^""^-1^0^"" +50907^0^0^59009^""^-1^0^"" +50908^0^0^59010^""^-1^0^"" +50908^1^0^59011^""^-1^0^"" +50908^2^2^16^""^-1^0^"" +50909^0^0^59012^""^-1^0^"" +50910^0^0^59013^""^-1^0^"" +50910^1^0^59014^""^-1^0^"" +50911^0^0^59013^""^-1^0^"" +50911^1^0^59003^""^-1^0^"" +50912^0^0^59015^""^-1^1^"255" +50913^0^0^59013^""^-1^0^"" +60000^0^0^50263^""^-1^0^"" +60000^1^1^50021^"Instance"^-1^2^"50263" +60001^0^0^50263^""^-1^0^"" +60001^1^1^60002^"Instance"^-1^2^"50263" +60002^0^0^50264^""^-1^0^"" +60002^1^0^50265^""^-1^10^"50264" +60003^0^1^60013^""^-1^0^"" +60004^0^0^50266^""^-1^0^"" +60005^0^0^50263^""^-1^0^"" +60005^1^1^60006^"Instance"^-1^2^"50263" +60006^0^0^50267^""^-1^0^"" +60006^1^0^50268^""^-1^10^"50267" +60007^0^0^50269^""^-1^0^"" +60008^0^0^50270^""^-1^0^"" +60009^0^0^50271^""^-1^1^"4" +60010^0^1^60012^""^-1^0^"" +60011^0^1^60012^""^-1^0^"" +60012^0^1^60013^""^-1^0^"" +60012^1^1^60014^""^-1^0^"" +60013^0^6^0^""^-1^0^"" +60013^1^0^50275^""^-1^1^"8" +60014^0^0^50272^""^-1^0^"" +60015^0^0^50276^""^-1^0^"" +60016^0^0^50277^""^-1^0^"" +60017^0^0^50269^""^-1^0^"" +60018^0^0^50278^""^-1^0^"" +60018^1^0^50279^""^-1^0^"" +60018^2^0^50280^""^-1^0^"" +60018^3^0^50281^""^-1^1^"16" +60018^4^0^50282^""^-1^0^"" +60018^5^0^50283^""^-1^0^"" +60018^6^0^50284^""^-1^0^"" +60018^7^0^50285^""^-1^0^"" +60018^8^0^50286^""^-1^0^"" +60018^9^0^50287^""^-1^0^"" +60018^10^0^50288^""^-1^0^"" +60018^11^0^50289^""^-1^0^"" +60018^12^0^50290^""^-1^0^"" +60019^0^0^50278^""^-1^0^"" +60019^1^0^50279^""^-1^0^"" +60019^2^0^50280^""^-1^0^"" +60019^3^0^50281^""^-1^0^"" +60019^4^0^50282^""^-1^0^"" +60019^5^0^50283^""^-1^0^"" +60019^6^0^50284^""^-1^0^"" +60019^7^0^50285^""^-1^0^"" +60019^8^0^50286^""^-1^0^"" +60019^9^0^50287^""^-1^0^"" +60019^10^0^50288^""^-1^0^"" +60019^11^0^50289^""^-1^0^"" +60019^12^0^50290^""^-1^0^"" +60020^0^0^50291^""^-1^0^"" +60021^0^0^50292^""^-1^0^"" +60022^0^0^50293^""^-1^0^"" +60023^0^1^60058^""^-1^0^"" +60024^0^0^50135^""^-1^0^"" +60024^1^0^50136^""^-1^0^"" +60024^2^0^50137^""^-1^0^"" +60024^3^0^50138^""^-1^0^"" +60024^4^0^50139^""^-1^0^"" +60024^5^0^50140^""^-1^0^"" +60024^6^0^50141^""^-1^0^"" +60024^7^0^50142^""^-1^0^"" +60024^8^0^50143^""^-1^0^"" +60024^9^0^50144^""^-1^0^"" +60024^10^0^50145^""^-1^0^"" +60024^11^0^50146^""^-1^0^"" +60024^12^0^50294^""^-1^0^"" +60025^0^0^50135^""^-1^0^"" +60025^1^0^50136^""^-1^0^"" +60025^2^0^50137^""^-1^0^"" +60025^3^0^50138^""^-1^0^"" +60025^4^0^50139^""^-1^0^"" +60025^5^0^50140^""^-1^0^"" +60025^6^0^50141^""^-1^0^"" +60025^7^0^50142^""^-1^0^"" +60025^8^0^50143^""^-1^0^"" +60025^9^0^50144^""^-1^0^"" +60025^10^0^50145^""^-1^0^"" +60025^11^0^50146^""^-1^0^"" +60025^12^0^50294^""^-1^0^"" +60026^0^1^60058^""^-1^0^"" +60027^0^1^60058^""^-1^0^"" +60028^0^0^50295^""^-1^0^"" +60029^0^0^50296^""^-1^0^"" +60029^1^0^50139^""^-1^0^"" +60029^2^0^50137^""^-1^0^"" +60029^3^0^50138^""^-1^0^"" +60029^4^0^50136^""^-1^0^"" +60030^0^0^50297^""^-1^0^"" +60031^0^0^50298^""^-1^0^"" +60032^0^0^50299^""^-1^0^"" +60033^0^0^50300^""^-1^0^"" +60034^0^0^50301^""^-1^0^"" +60035^0^0^50301^""^-1^0^"" +60036^0^0^50301^""^-1^0^"" +60037^0^0^50302^""^-1^0^"" +60038^0^0^50302^""^-1^0^"" +60039^0^0^50302^""^-1^0^"" +60040^0^0^50303^""^-1^0^"" +60041^0^0^50122^""^-1^0^"" +60042^0^0^50123^""^-1^0^"" +60043^0^0^50304^""^-1^0^"" +60044^0^0^50305^""^-1^0^"" +60045^0^0^50306^""^-1^0^"" +60046^0^0^50307^""^-1^0^"" +60047^0^0^50119^""^-1^0^"" +60048^0^0^50308^""^-1^0^"" +60049^0^0^50309^""^-1^0^"" +60050^0^0^50271^""^-1^0^"" +60051^0^0^50271^""^-1^0^"" +60052^0^1^60058^""^-1^0^"" +60053^0^1^60058^""^-1^0^"" +60054^0^0^50310^""^-1^0^"" +60055^0^1^60058^""^-1^0^"" +60056^0^1^60058^""^-1^0^"" +60057^0^0^50311^""^-1^0^"" +60057^1^1^60058^""^-1^2^"50311" +60058^0^1^60013^""^-1^0^"" +60059^0^0^50297^""^-1^0^"" +60060^0^0^50298^""^-1^0^"" +60061^0^0^50299^""^-1^0^"" +60062^0^0^50300^""^-1^0^"" +60063^0^0^50301^""^-1^0^"" +60064^0^0^50301^""^-1^0^"" +60065^0^0^50301^""^-1^0^"" +60066^0^0^50302^""^-1^0^"" +60067^0^0^50302^""^-1^0^"" +60068^0^0^50302^""^-1^0^"" +60069^0^0^50303^""^-1^0^"" +60070^0^0^50122^""^-1^0^"" +60071^0^0^50123^""^-1^0^"" +60072^0^0^50304^""^-1^0^"" +60073^0^0^50305^""^-1^0^"" +60074^0^0^50306^""^-1^0^"" +60075^0^0^50307^""^-1^0^"" +60076^0^0^50119^""^-1^0^"" +60077^0^0^50308^""^-1^0^"" +60078^0^0^50309^""^-1^0^"" +60079^0^0^50271^""^-1^0^"" +60080^0^0^50271^""^-1^0^"" +60081^0^1^60058^""^-1^0^"" +60082^0^1^60058^""^-1^0^"" +60083^0^0^50310^""^-1^0^"" +60084^0^1^60058^""^-1^0^"" +60085^0^1^60058^""^-1^0^"" +60086^0^0^50276^""^-1^0^"" +60087^0^0^50277^""^-1^0^"" +60088^0^0^50269^""^-1^0^"" +60090^0^1^60058^""^-1^0^"" + +70000^0^0^70000^""^-1^0^"" +70000^1^0^70001^""^-1^0^"" +70000^2^0^70002^""^-1^2^"70001" +70001^0^0^70003^""^-1^0^"" +70002^0^0^70004^""^-1^0^"" +70002^1^0^70005^""^-1^0^"" +70002^2^0^70006^""^-1^2^"70005" +70003^0^0^70007^""^-1^0^"" +70004^0^0^50001^""^-1^0^"" \ No newline at end of file diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/foo.c b/gobi-api/fixed-GobiAPI-1.0.40/Database/QMI/foo.c new file mode 100644 index 0000000..e69de29 diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.cpp b/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.cpp new file mode 100755 index 0000000..fa89daf --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.cpp @@ -0,0 +1,2882 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmt.cpp + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + cGobiConnectionMgmtDLL + cGobiConnectionMgmt + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiConnectionMgmt.h" +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Global object +cGobiConnectionMgmtDLL gConnectionDLL; + +// Interval between traffic processing loop iterations (milliseconds) +const ULONG TRAFFIC_INTERVAL_MS = 300000; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + TrafficProcessThread (Free Method) + +DESCRIPTION: + QMI traffic process thread - processes all traffic in order to fire + off QMI traffic related callbacks + +PARAMETERS: + pArg [ I ] - Object to interface to + +RETURN VALUE: + VOID * - always NULL +===========================================================================*/ +VOID * TrafficProcessThread( PVOID pArg ) +{ + // Keep running? + bool bRun = false; + + TRACE( "GobiConnectionMgmt traffic thread [%u] started\n", + (UINT)pthread_self() ); + + // Create a vector of the objects to wait on + std::vector events; + + // Store the index to service type for use later + std::map services; + + cGobiConnectionMgmt * pAPI = (cGobiConnectionMgmt *)pArg; + if (pAPI != 0) + { + // Time to go to work + bRun = true; + + // Add the thread exit event + events.push_back( &pAPI->mExitEvent ); + + // For each Protocol server, grab the signal event + std::set ::const_iterator pIter; + pIter = pAPI->mServerConfig.begin(); + while (pIter != pAPI->mServerConfig.end()) + { + eQMIService svc = pIter->first; + cQMIProtocolServer * pServer = pAPI->GetServer( svc ); + if (pServer != 0) + { + // Grab the log from the server + const cProtocolLog & log = pServer->GetLog(); + + // Grab the Signal event, if it exists + cEvent & sigEvent = log.GetSignalEvent(); + + services[events.size()] = svc; + events.push_back( &sigEvent ); + } + + pIter++; + } + } + + // Loop waiting for exit event + while (bRun == true) + { + // Wait for activity + DWORD ignoredVal, index; + int nRet = WaitOnMultipleEvents( events, + TRAFFIC_INTERVAL_MS, + ignoredVal, + index ); + // Timeout + if (nRet == -ETIME) + { + // Do nothing + } + // Error? + else if (nRet <= 0) + { + TRACE( "GobiConnectionMgmt traffic thread wait error %d\n", nRet ); + bRun = false; + } + // Exit event? + else if (index == 0) + { + bRun = false; + } + else if (index < events.size()) + { + // Run ProcessTraffic() for this service type + if (services.find( index ) != services.end()) + { + pAPI->ProcessTraffic( services[index] ); + } + } + else + { + // Fatal error + bRun = false; + } + } + + TRACE( "GobiConnectionMgmt traffic thread [%u] exited\n", + (UINT)pthread_self() ); + + return NULL; +} + +/*=========================================================================== +METHOD: + CallbackThread (Free Method) + +DESCRIPTION: + Thread to execute a callback asynchronously + +PARAMETERS: + pArg [ I ] - The cAsyncFunction object + +RETURN VALUE: + void * - thread exit value (always 0) +===========================================================================*/ +void * CallbackThread( PVOID pArg ) +{ + cGobiCMCallback * pCB = (cGobiCMCallback *)pArg; + if (pCB == 0) + { + ASSERT( 0 ); + return 0; + } + + pCB->Call(); + + delete pCB; + pCB = 0; + + return 0; +} + +/*=========================================================================*/ +// cGobiConnectionMgmtDLL Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiConnectionMgmtDLL (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmtDLL::cGobiConnectionMgmtDLL() + : mpAPI( 0 ), + mbAllocated( false ) +{ + // Create sync CS + pthread_mutex_init( &mSyncSection, NULL ); +} + +/*=========================================================================== +METHOD: + ~cGobiConnectionMgmtDLL (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmtDLL::~cGobiConnectionMgmtDLL() +{ + // Just in case + if (mpAPI != 0) + { + mpAPI->Cleanup(); + delete mpAPI; + mpAPI = 0; + } + + pthread_mutex_destroy( &mSyncSection ); +} + +/*=========================================================================== +METHOD: + GetAPI (Public Method) + +DESCRIPTION: + Return the cGobiConnectionMgmt object + +RETURN VALUE: + cGobiConnectionMgmt * +===========================================================================*/ +cGobiConnectionMgmt * cGobiConnectionMgmtDLL::GetAPI() +{ + pthread_mutex_lock( &mSyncSection ); + + bool bAlloc = mbAllocated; + + pthread_mutex_unlock( &mSyncSection ); + + if (bAlloc == true) + { + return mpAPI; + } + + pthread_mutex_lock( &mSyncSection ); + + mpAPI = new cGobiConnectionMgmt(); + if (mpAPI != 0) + { + mpAPI->Initialize(); + } + + // We have tried to allocate the object + mbAllocated = true; + + pthread_mutex_unlock( &mSyncSection ); + return mpAPI; +} + +/*=========================================================================*/ +// cGobiConnectionMgmt Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiConnectionMgmt (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmt::cGobiConnectionMgmt() + : cGobiQMICore(), + mbThreadStarted( false ), + mThreadID( 0 ), + mWDSItemsProcessed( 0 ), + mDMSItemsProcessed( 0 ), + mNASItemsProcessed( 0 ), + mWMSItemsProcessed( 0 ), + mPDSItemsProcessed( 0 ), + mCATItemsProcessed( 0 ), + mOMAItemsProcessed( 0 ), + mVoiceItemsProcessed( 0 ), + mpFNSessionState( 0 ), + mpFNByteTotals( 0 ), + mpFNDataCapabilities( 0 ), + mpFNDataBearer( 0 ), + mpFNDormancyStatus( 0 ), + mpFNMobileIPStatus( 0 ), + mpFNActivationStatus( 0 ), + mpFNPower( 0 ), + mpFNWirelessDisable( 0 ), + mpFNRoamingIndicator( 0 ), + mpFNSignalStrength( 0 ), + mpFNRFInfo( 0 ), + mpFNLUReject( 0 ), + mpPLMNMode( 0 ), + mpFNNewSMS( 0 ), + mpFNNewNMEA( 0 ), + mpFNPDSState( 0 ), + mpFNCATEvent( 0 ), + mpFNOMADMAlert( 0 ), + mpFNOMADMState( 0 ), + mpFNUSSDRelease( 0 ), + mpFNUSSDNotification( 0 ), + mpFNUSSDOrigination( 0 ) +{ + tServerConfig wdsSvr( eQMI_SVC_WDS, true ); + tServerConfig dmsSvr( eQMI_SVC_DMS, true ); + tServerConfig nasSvr( eQMI_SVC_NAS, true ); + tServerConfig wmsSvr( eQMI_SVC_WMS, true ); + tServerConfig pdsSvr( eQMI_SVC_PDS, true ); + tServerConfig catSvr( eQMI_SVC_CAT, false ); + tServerConfig rmsSvr( eQMI_SVC_RMS, false ); + tServerConfig omaSvr( eQMI_SVC_OMA, false ); + tServerConfig voiceSvr( eQMI_SVC_VOICE, false ); + mServerConfig.insert( wdsSvr ); + mServerConfig.insert( dmsSvr ); + mServerConfig.insert( nasSvr ); + mServerConfig.insert( wmsSvr ); + mServerConfig.insert( pdsSvr ); + mServerConfig.insert( catSvr ); + mServerConfig.insert( rmsSvr ); + mServerConfig.insert( omaSvr ); + mServerConfig.insert( voiceSvr ); +} + +/*=========================================================================== +METHOD: + ~cGobiConnectionMgmt (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiConnectionMgmt::~cGobiConnectionMgmt() +{ + Disconnect(); +} + +/*=========================================================================== +METHOD: + ProcessTraffic (Internal Method) + +DESCRIPTION: + Process traffic in a QMI server protocol log, this is done to + exercise QMI indication related callbacks + +PARAMETERS: + svc [ I ] - QMI Service type + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessTraffic( eQMIService svc ) +{ + ULONG count = 0; + + switch (svc) + { + case eQMI_SVC_WDS: + { + cQMIProtocolServer * pWDS = GetServer( eQMI_SVC_WDS ); + if (pWDS != 0) + { + // Grab the WDS log from the server + const cProtocolLog & logWDS = pWDS->GetLog(); + + // New WDS items to process? + count = logWDS.GetCount(); + if (count != INVALID_LOG_INDEX && count > mWDSItemsProcessed) + { + for (ULONG i = mWDSItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logWDS.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_WDS_RX) ) + { + ProcessWDSBuffer( buf ); + } + } + + mWDSItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_DMS: + { + cQMIProtocolServer * pDMS = GetServer( eQMI_SVC_DMS ); + if (pDMS != 0) + { + // Grab the DMS log from the server + const cProtocolLog & logDMS = pDMS->GetLog(); + + // New DMS items to process? + count = logDMS.GetCount(); + if (count != INVALID_LOG_INDEX && count > mDMSItemsProcessed) + { + for (ULONG i = mDMSItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logDMS.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_DMS_RX) ) + { + ProcessDMSBuffer( buf ); + } + } + + mDMSItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_NAS: + { + cQMIProtocolServer * pNAS = GetServer( eQMI_SVC_NAS ); + if (pNAS != 0) + { + // Grab the NAS log from the server + const cProtocolLog & logNAS = pNAS->GetLog(); + + // New NAS items to process? + count = logNAS.GetCount(); + if (count != INVALID_LOG_INDEX && count > mNASItemsProcessed) + { + for (ULONG i = mNASItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logNAS.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_NAS_RX) ) + { + ProcessNASBuffer( buf ); + } + } + + mNASItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_WMS: + { + cQMIProtocolServer * pWMS = GetServer( eQMI_SVC_WMS ); + if (pWMS != 0) + { + // Grab the WMS log from the server + const cProtocolLog & logWMS = pWMS->GetLog(); + + // New WMS items to process? + count = logWMS.GetCount(); + if (count != INVALID_LOG_INDEX && count > mWMSItemsProcessed) + { + for (ULONG i = mWMSItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logWMS.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_WMS_RX) ) + { + ProcessWMSBuffer( buf ); + } + } + + mWMSItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_PDS: + { + cQMIProtocolServer * pPDS = GetServer( eQMI_SVC_PDS ); + if (pPDS != 0) + { + // Grab the PDS log from the server + const cProtocolLog & logPDS = pPDS->GetLog(); + + // New PDS items to process? + count = logPDS.GetCount(); + if (count != INVALID_LOG_INDEX && count > mPDSItemsProcessed) + { + for (ULONG i = mPDSItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logPDS.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_PDS_RX) ) + { + ProcessPDSBuffer( buf ); + } + } + + mPDSItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_CAT: + { + cQMIProtocolServer * pCAT = GetServer( eQMI_SVC_CAT ); + if (pCAT != 0) + { + // Grab the CAT log from the server + const cProtocolLog & logCAT = pCAT->GetLog(); + + // New CAT items to process? + count = logCAT.GetCount(); + if (count != INVALID_LOG_INDEX && count > mCATItemsProcessed) + { + for (ULONG i = mCATItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logCAT.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_CAT_RX) ) + { + ProcessCATBuffer( buf ); + } + } + + mCATItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_OMA: + { + cQMIProtocolServer * pOMA = GetServer( eQMI_SVC_OMA ); + if (pOMA != 0) + { + // Grab the OMA log from the server + const cProtocolLog & logOMA = pOMA->GetLog(); + + // New OMA items to process? + count = logOMA.GetCount(); + if (count != INVALID_LOG_INDEX && count > mOMAItemsProcessed) + { + for (ULONG i = mOMAItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logOMA.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_OMA_RX) ) + { + ProcessOMABuffer( buf ); + } + } + + mOMAItemsProcessed = count; + } + } + + break; + } + + case eQMI_SVC_VOICE: + { + cQMIProtocolServer * pVoice = GetServer( eQMI_SVC_VOICE ); + if (pVoice != 0) + { + // Grab the voice log from the server + const cProtocolLog & logVoice = pVoice->GetLog(); + + // New voice items to process? + count = logVoice.GetCount(); + if (count != INVALID_LOG_INDEX && count > mVoiceItemsProcessed) + { + for (ULONG i = mVoiceItemsProcessed; i < count; i++) + { + sProtocolBuffer buf = logVoice.GetBuffer( i ); + if ( (buf.IsValid() == true) + && (buf.GetType() == (ULONG)ePROTOCOL_QMI_VOICE_RX) ) + { + ProcessVoiceBuffer( buf ); + } + } + + mVoiceItemsProcessed = count; + } + } + + break; + } + + default: + break; + } +} + +/*=========================================================================== +METHOD: + ProcessWDSBuffer (Internal Method) + +DESCRIPTION: + Process a WDS buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessWDSBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == eQMI_WDS_EVENT_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out data bearer technology + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_IND, msgID, 23 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + if (mpFNDataBearer != 0) + { + cDataBearerCallback * pCB = 0; + pCB = new cDataBearerCallback( mpFNDataBearer, pf[0].mValue.mU32 ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + + // Parse out dormancy status + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_IND, msgID, 24 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + if (mpFNDormancyStatus != 0) + { + cDormancyStatusCallback * pCB = 0; + pCB = new cDormancyStatusCallback( mpFNDormancyStatus, + pf[0].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + + // Parse out byte totals + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_IND, msgID, 25 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + ULONGLONG tx = pf[0].mValue.mU64; + ULONGLONG rx = ULLONG_MAX; + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_IND, msgID, 26 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + rx = pf[0].mValue.mU64; + } + + if (mpFNByteTotals != 0) + { + cByteTotalsCallback * pCB = 0; + pCB = new cByteTotalsCallback( mpFNByteTotals, tx, rx ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + // Parse out mobile IP status + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_IND, msgID, 27 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + if (mpFNMobileIPStatus != 0) + { + cMobileIPStatusCallback * pCB = 0; + pCB = new cMobileIPStatusCallback( mpFNMobileIPStatus, + pf[0].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } + else if (msgID == eQMI_WDS_PKT_STATUS_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out session status + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_IND, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + ULONG ss = pf[0].mValue.mU32; + ULONG cer = ULONG_MAX; + + // Parse out call end reason (if present) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_IND, msgID, 16 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + cer = pf[0].mValue.mU32; + } + + if (mpFNSessionState != 0) + { + cSessionStateCallback * pCB = 0; + pCB = new cSessionStateCallback( mpFNSessionState, ss, cer ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessDMSBuffer (Internal Method) + +DESCRIPTION: + Process a DMS buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessDMSBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == eQMI_DMS_EVENT_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out activation status + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_IND, msgID, 19 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1 && mpFNActivationStatus != 0) + { + cActivationStatusCallback * pCB = 0; + pCB = new cActivationStatusCallback( mpFNActivationStatus, + pf[0].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + + // Parse out operating mode + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_IND, msgID, 20 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1 && mpFNPower != 0) + { + cPowerCallback * pCB = 0; + pCB = new cPowerCallback( mpFNPower, pf[0].mValue.mU32 ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + + // Parse out wireless disable state + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_IND, msgID, 22 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1 && mpFNWirelessDisable != 0) + { + cWirelessDisableCallback * pCB = 0; + pCB = new cWirelessDisableCallback( mpFNWirelessDisable, + pf[0].mValue.mU32 ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessNASBuffer (Internal Method) + +DESCRIPTION: + Process a NAS buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessNASBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_NAS_EVENT_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse signal strength + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 2) + { + INT8 sigVal = pf[0].mValue.mS8; + ULONG radioVal = pf[1].mValue.mU32; + bool bValidSig = (sigVal <= -30 && sigVal > -125 && radioVal != 0); + + if (bValidSig == true && mpFNSignalStrength != 0) + { + cSignalStrengthCallback * pCB = 0; + pCB = new cSignalStrengthCallback( mpFNSignalStrength, + pf[0].mValue.mS8, + pf[1].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + + // Parse out RF info + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_NAS_IND, msgID, 17 ); + cDataParser::tParsedFields pf2 = ParseTLV( mDB, buf, tlvs, tlvKey2 ); + + ULONG fieldCount = (ULONG)pf2.size(); + if (fieldCount >= 1 && mpFNRFInfo != 0) + { + BYTE ifaceCount = pf2[0].mValue.mU8; + if (fieldCount >= 1 + ((ULONG)ifaceCount * 3)) + { + for (BYTE i = 0; i < ifaceCount; i++) + { + ULONG offset = 3 * (ULONG)i; + + cRFInfoCallback * pCB = 0; + pCB = new cRFInfoCallback( mpFNRFInfo, + pf2[offset + 1].mValue.mU32, + pf2[offset + 2].mValue.mU32, + (ULONG)pf2[offset + 3].mValue.mU16 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } + + // Parse out LU reject + sProtocolEntityKey tlvKey3( eDB2_ET_QMI_NAS_IND, msgID, 18 ); + cDataParser::tParsedFields pf3 = ParseTLV( mDB, buf, tlvs, tlvKey3 ); + if (pf3.size() >= 2 && mpFNLUReject != 0) + { + cLURejectCallback * pCB = 0; + pCB = new cLURejectCallback( mpFNLUReject, + pf3[0].mValue.mU32, + (ULONG)pf3[1].mValue.mU16 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + + } + else if (msgID == (ULONG)eQMI_NAS_SS_INFO_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out roaming indicator + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_NAS_IND, msgID, 16 ); + cDataParser::tParsedFields pf1 = ParseTLV( mDB, buf, tlvs, tlvKey1 ); + if (pf1.size() >= 1) + { + if (mpFNRoamingIndicator != 0) + { + cRoamingIndicatorCallback * pCB = 0; + pCB = new cRoamingIndicatorCallback( mpFNRoamingIndicator, + pf1[0].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + + // Parse out data capabilities + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_NAS_IND, msgID, 17 ); + cDataParser::tParsedFields pf2 = ParseTLV( mDB, buf, tlvs, tlvKey2 ); + if (pf2.size() >= 1) + { + BYTE activeDataCaps = pf2[0].mValue.mU8; + if (pf2.size() >= 1 + (ULONG)activeDataCaps) + { + ULONG caps[12] = { 0 }; + if (activeDataCaps > 12) + { + activeDataCaps = 12; + } + + for (ULONG d = 0; d < activeDataCaps; d++) + { + caps[d] = pf2[1 + d].mValue.mU32; + } + + if (mpFNDataCapabilities != 0) + { + cDataCapabilitiesCallback * pCB = 0; + pCB = new cDataCapabilitiesCallback( mpFNDataCapabilities, + activeDataCaps, + &caps[0] ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } + } + else if (msgID == (ULONG)eQMI_NAS_PLMN_MODE_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse PLMN mode + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + cPLMNModeCallback * pCB = 0; + pCB = new cPLMNModeCallback( mpPLMNMode, + (ULONG)pf[0].mValue.mU8 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessWMSBuffer (Internal Method) + +DESCRIPTION: + Process a WDS buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessWMSBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_WMS_EVENT_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out message details + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 2) + { + if (mpFNNewSMS != 0) + { + cNewSMSCallback * pCB = 0; + pCB = new cNewSMSCallback( mpFNNewSMS, + pf[0].mValue.mU32, + pf[1].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessPDSBuffer (Internal Method) + +DESCRIPTION: + Process a PDS buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessPDSBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_PDS_EVENT_IND) + { + // Prepare TLVs for extraction + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1 && mpFNNewNMEA != 0) + { + cNewNMEACallback * pCB = 0; + pCB = new cNewNMEACallback( mpFNNewNMEA, pf[0].mValueString ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + else if (msgID == (ULONG)eQMI_PDS_STATE_IND) + { + // Prepare TLVs for extraction + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out message details + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_IND, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 2 && mpFNPDSState != 0) + { + cPDSStateCallback * pCB = 0; + pCB = new cPDSStateCallback( mpFNPDSState, + pf[0].mValue.mU32, + pf[1].mValue.mU32 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessCATBuffer (Internal Method) + +DESCRIPTION: + Process a CAT buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessCATBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_CAT_EVENT_IND && mpFNCATEvent != 0) + { + // Prepare TLVs for extraction + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + ULONG tlvCount = (ULONG)tlvs.size(); + for (ULONG t = 0; t < tlvCount; t++) + { + const sDB2NavInput tlv = tlvs[t]; + if (tlv.mKey.size() == 3) + { + cCATEventCallback * pCB = 0; + pCB = new cCATEventCallback( mpFNCATEvent, + tlv.mKey[2], + tlv.mPayloadLen, + tlv.mpPayload ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessOMABuffer (Internal Method) + +DESCRIPTION: + Process an OMA buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessOMABuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_OMA_EVENT_IND) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + + // Parse out NIA + sProtocolEntityKey tlvKey( eDB2_ET_QMI_OMA_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 2) + { + if (mpFNOMADMAlert != 0) + { + cOMADMAlertCallback * pCB = 0; + pCB = new cOMADMAlertCallback( mpFNOMADMAlert, + pf[0].mValue.mU32, + pf[1].mValue.mU16 ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + + // Parse out failure reason (may not be present) + ULONG failureReason = ULONG_MAX; + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_OMA_IND, msgID, 18 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + failureReason = pf[0].mValue.mU32; + } + + // Parse out state + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_OMA_IND, msgID, 17 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + if (mpFNOMADMState != 0) + { + cOMADMStateCallback * pCB = 0; + pCB = new cOMADMStateCallback( mpFNOMADMState, + pf[0].mValue.mU32, + failureReason ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + } +} + +/*=========================================================================== +METHOD: + ProcessVoiceBuffer (Internal Method) + +DESCRIPTION: + Process a voice buffer + +PARAMETERS: + buf [ I ] - QMI buffer to process + +RETURN VALUE: + None +===========================================================================*/ +void cGobiConnectionMgmt::ProcessVoiceBuffer( const sProtocolBuffer & buf ) +{ + sQMIServiceBuffer qmiBuf( buf.GetSharedBuffer() ); + if (qmiBuf.IsValid() == false) + { + return; + } + + // Indication? + if (qmiBuf.IsIndication() == false) + { + return; + } + + // Do we even care? + ULONG msgID = qmiBuf.GetMessageID(); + if (msgID == (ULONG)eQMI_VOICE_USSD_RELEASE_IND && mpFNUSSDRelease != 0) + { + cUSSDReleaseCallback * pCB = 0; + pCB = new cUSSDReleaseCallback( mpFNUSSDRelease ); + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + + } + else if (msgID == (ULONG)eQMI_VOICE_USSD_IND && mpFNUSSDNotification != 0) + { + // Prepare TLVs for extraction + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + std::map tlvMap; + tlvMap = qmiBuf.GetContents(); + + // Parse out message details + sProtocolEntityKey tlvKey( eDB2_ET_QMI_VOICE_IND, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + const BYTE * pUSSData = 0; + + std::map ::const_iterator pIter; + pIter = tlvMap.find( 16 ); + if (pIter != tlvMap.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG len = (ULONG)pHdr->mLength; + if (len >= (ULONG)2) + { + const BYTE * pData = (const BYTE *)++pHdr; + if (len >= (ULONG)pData[1] + (ULONG)2) + { + pUSSData = pData; + } + } + } + + cUSSDNotificationCallback * pCB = 0; + pCB = new cUSSDNotificationCallback( mpFNUSSDNotification, + pf[0].mValue.mU32, + pUSSData ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } + } + else if ( (msgID == (ULONG)eQMI_VOICE_ASYNC_USSD_IND) + && (mpFNUSSDOrigination != 0) ) + { + // Prepare TLVs for extraction + std::vector tlvs = DB2ReduceQMIBuffer( qmiBuf ); + std::map tlvMap; + tlvMap = qmiBuf.GetContents(); + + ULONG ec = ULONG_MAX; + ULONG fc = ULONG_MAX; + + // Parse out message details + sProtocolEntityKey tlvKey( eDB2_ET_QMI_VOICE_IND, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + ec = pf[0].mValue.mU32; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_VOICE_IND, msgID, 17 ); + pf = ParseTLV( mDB, buf, tlvs, tlvKey ); + if (pf.size() >= 1) + { + fc = pf[0].mValue.mU32; + } + + const BYTE * pNetworkInfo = 0; + + std::map ::const_iterator pIter; + pIter = tlvMap.find( 18 ); + if (pIter != tlvMap.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG len = (ULONG)pHdr->mLength; + if (len >= (ULONG)2) + { + const BYTE * pData = (const BYTE *)++pHdr; + if (len >= (ULONG)pData[1] + (ULONG)2) + { + pNetworkInfo = pData; + } + } + } + + const BYTE * pAlpha = 0; + + pIter = tlvMap.find( 19 ); + if (pIter != tlvMap.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG len = (ULONG)pHdr->mLength; + if (len >= (ULONG)2) + { + const BYTE * pData = (const BYTE *)++pHdr; + if (len >= (ULONG)pData[1] + (ULONG)2) + { + pAlpha = pData; + } + } + } + + + cUSSDOriginationCallback * pCB = 0; + pCB = new cUSSDOriginationCallback( mpFNUSSDOrigination, + ec, + fc, + pNetworkInfo, + pAlpha ); + + if (pCB != 0) + { + if (pCB->Initialize() == false) + { + delete pCB; + } + } + } +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified (or first detected) Gobi device + +PARAMETERS: + pDeviceNode [ I ] - The device node + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiConnectionMgmt::Connect( + LPCSTR pDeviceNode, + LPCSTR pDeviceKey ) +{ + // Assume failure + bool bRC = cGobiQMICore::Connect( pDeviceNode, pDeviceKey ); + if (bRC == true) + { + // Clear mExitEvent; + mExitEvent.Clear(); + + pthread_create( &mThreadID, + NULL, + TrafficProcessThread, + this ); + + mbThreadStarted = true; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the currently connected Gobi device + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiConnectionMgmt::Disconnect() +{ + // Clear all callback function pointers (no need to turn them off at + // the device as we are about to tear-down each QMI service client) + mpFNSessionState = 0; + mpFNByteTotals = 0; + mpFNDataCapabilities = 0; + mpFNDataBearer = 0; + mpFNDormancyStatus = 0; + mpFNMobileIPStatus = 0; + mpFNActivationStatus = 0; + mpFNPower = 0; + mpFNWirelessDisable = 0; + mpFNRoamingIndicator = 0; + mpFNSignalStrength = 0; + mpFNRFInfo = 0; + mpFNLUReject = 0; + mpPLMNMode = 0; + mpFNNewSMS = 0; + mpFNNewNMEA = 0; + mpFNPDSState = 0; + mpFNCATEvent = 0; + mpFNOMADMAlert = 0; + mpFNOMADMState = 0; + mpFNUSSDRelease = 0; + mpFNUSSDNotification = 0; + mpFNUSSDOrigination = 0; + + // Exit traffic processing thread + if (mbThreadStarted == true) + { + // Signal thread to exit + mExitEvent.Set( 0 ); + + // If we are not being called from the thread itself then wait for + // it to exit, if not then it will have to exit automatically + if (pthread_self() != mThreadID) + { + if (mThreadID != 0) + { + pthread_join( mThreadID, NULL ); + } + } + } + + // Clear out thread handle/ID + mbThreadStarted = false; + mThreadID = 0; + + bool bRC = cGobiQMICore::Disconnect(); + + // Servers reset server logs so we need to reset our counters + mWDSItemsProcessed = 0; + mDMSItemsProcessed = 0; + mNASItemsProcessed = 0; + mWMSItemsProcessed = 0; + mPDSItemsProcessed = 0; + mCATItemsProcessed = 0; + mOMAItemsProcessed = 0; + mVoiceItemsProcessed = 0; + + return bRC; +} + +/*=========================================================================== +METHOD: + SetSessionStateCallback (Public Method) + +DESCRIPTION: + Enable/disable session state callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetSessionStateCallback( + tFNSessionState pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNSessionState = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetByteTotalsCallback + +DESCRIPTION: + This function enables/disables the RX/TX byte counts callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + interval [ I ] - Interval in seconds (ignored when disabling) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetByteTotalsCallback( + tFNByteTotals pCallback, + BYTE interval ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNByteTotals == 0); + bool bOff = (pCallback == 0 && mpFNByteTotals != 0); + bool bReplace = (pCallback != 0 && mpFNByteTotals != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_WDS; + WORD msgID = (WORD)eQMI_WDS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + + if (bOn == true) + { + std::ostringstream tmp; + tmp << (ULONG)interval << " 0 0 0 0 0 0 1 1"; + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0 0 0 0 0 0 0 0 0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNByteTotals = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNByteTotals = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetDataCapabilitiesCallback (Public Method) + +DESCRIPTION: + Enables/disables the serving system data capabilities callback + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Corrected error code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetDataCapabilitiesCallback( + tFNDataCapabilities pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNDataCapabilities = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetDataBearerCallback (Public Method) + +DESCRIPTION: + Enable/disable data bearer callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return cod +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetDataBearerCallback( + tFNDataBearer pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNDataBearer == 0); + bool bOff = (pCallback == 0 && mpFNDataBearer != 0); + bool bReplace = (pCallback != 0 && mpFNDataBearer != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_WDS; + WORD msgID = (WORD)eQMI_WDS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 18 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNDataBearer = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNDataBearer = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetDormancyStatusCallback (Public Method) + +DESCRIPTION: + Enable/disable dormancy status callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetDormancyStatusCallback( + tFNDormancyStatus pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNDormancyStatus == 0); + bool bOff = (pCallback == 0 && mpFNDormancyStatus != 0); + bool bReplace = (pCallback != 0 && mpFNDormancyStatus != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_WDS; + WORD msgID = (WORD)eQMI_WDS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 19 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNDormancyStatus = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNDormancyStatus = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetMobileIPStatusCallback (Public Method) + +DESCRIPTION: + Enable/disable mobile IP status callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetMobileIPStatusCallback( + tFNMobileIPStatus pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNMobileIPStatus == 0); + bool bOff = (pCallback == 0 && mpFNMobileIPStatus != 0); + bool bReplace = (pCallback != 0 && mpFNMobileIPStatus != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_WDS; + WORD msgID = (WORD)eQMI_WDS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 20 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNMobileIPStatus = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNMobileIPStatus = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetActivationStatusCallback (Public Method) + +DESCRIPTION: + Enable/disable activation status callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetActivationStatusCallback( + tFNActivationStatus pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNActivationStatus == 0); + bool bOff = (pCallback == 0 && mpFNActivationStatus != 0); + bool bReplace = (pCallback != 0 && mpFNActivationStatus != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_DMS; + WORD msgID = (WORD)eQMI_DMS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 19 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNActivationStatus = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNActivationStatus = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetPowerCallback (Public Method) + +DESCRIPTION: + Enable/disable power operating mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetPowerCallback( + tFNPower pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNPower == 0); + bool bOff = (pCallback == 0 && mpFNPower != 0); + bool bReplace = (pCallback != 0 && mpFNPower != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_DMS; + WORD msgID = (WORD)eQMI_DMS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 20 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNPower = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNPower = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetWirelessDisableCallback (Public Method) + +DESCRIPTION: + Enable/disable wireless disable state callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetWirelessDisableCallback( + tFNWirelessDisable pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNWirelessDisable == 0); + bool bOff = (pCallback == 0 && mpFNWirelessDisable != 0); + bool bReplace = (pCallback != 0 && mpFNWirelessDisable != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_DMS; + WORD msgID = (WORD)eQMI_DMS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 22 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNWirelessDisable = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNWirelessDisable = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetRoamingIndicatorCallback (Public Method) + +DESCRIPTION: + Enable/disable roaming indicator callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Corrected error code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetRoamingIndicatorCallback( + tFNRoamingIndicator pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNRoamingIndicator = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetSignalStrengthCallback (Public Method) + +DESCRIPTION: + Enable/disable signal strength callback function + +PARAMETERS: + pCallback [ I ] - Callback function + thresholds [ I ] - Desired threholds (only valid when enabling) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetSignalStrengthCallback( + tFNSignalStrength pCallback, + std::list thresholds ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Grab number of thresholds + ULONG thresholdCount = (ULONG)thresholds.size(); + + // Validate arguments versus what is changing + bool bOn = (pCallback != 0 && mpFNSignalStrength == 0); + if (bOn == true && thresholdCount == 0) + { + rc = eGOBI_ERR_INVALID_ARG; + return rc; + } + + bool bOff = (pCallback == 0 && mpFNSignalStrength != 0); + if (bOff == true && thresholdCount != 0) + { + rc = eGOBI_ERR_INVALID_ARG; + return rc; + } + + bool bReplace = (pCallback != 0 && mpFNSignalStrength != 0); + if (bReplace == true && thresholdCount == 0) + { + rc = eGOBI_ERR_INVALID_ARG; + return rc; + } + + eQMIService svc = eQMI_SVC_NAS; + WORD msgID = (WORD)eQMI_NAS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 16 ); + + if (bOn == true || bOff == true || bReplace == true) + { + if (bOn == true || bReplace == true) + { + std::ostringstream args; + args << "1 " << (UINT)thresholdCount; + + std::list ::const_iterator pThreshold = thresholds.begin(); + while (pThreshold != thresholds.end()) + { + INT8 t = *pThreshold++; + + args << " " << (INT)t; + } + + sDB2PackingInput pi( pek, (LPCSTR)args.str().c_str() ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0 0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true || bReplace == true) + { + mpFNSignalStrength = pCallback; + } + } + else + { + // Turning it off redundantly + if (thresholdCount != 0) + { + rc = eGOBI_ERR_INVALID_ARG; + } + else + { + rc = eGOBI_ERR_NONE; + } + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetRFInfoCallback (Public Method) + +DESCRIPTION: + Enable/disable RF information callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetRFInfoCallback( tFNRFInfo pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Validate arguments versus what is changing + bool bOn = (pCallback != 0 && mpFNRFInfo == 0); + bool bOff = (pCallback == 0 && mpFNRFInfo != 0); + bool bReplace = (pCallback != 0 && mpFNRFInfo != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_NAS; + WORD msgID = (WORD)eQMI_NAS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 17 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNRFInfo = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNRFInfo = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetLURejectCallback (Public Method) + +DESCRIPTION: + Enable/disable LU reject callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetLURejectCallback( tFNLUReject pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Validate arguments versus what is changing + bool bOn = (pCallback != 0 && mpFNLUReject == 0); + bool bOff = (pCallback == 0 && mpFNLUReject != 0); + bool bReplace = (pCallback != 0 && mpFNLUReject != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_NAS; + WORD msgID = (WORD)eQMI_NAS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 18 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNLUReject = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNLUReject = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetPLMNModeCallback (Public Method) + +DESCRIPTION: + Enable/disable PLMN mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetPLMNModeCallback( tFNPLMNMode pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpPLMNMode = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetNewSMSCallback (Public Method) + +DESCRIPTION: + Enable/disable new SMS callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetNewSMSCallback( tFNNewSMS pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNNewSMS == 0); + bool bOff = (pCallback == 0 && mpFNNewSMS != 0); + bool bReplace = (pCallback != 0 && mpFNNewSMS != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_WMS; + WORD msgID = (WORD)eQMI_WMS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 16 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNNewSMS = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNNewSMS = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetNMEACallback (Public Method) + +DESCRIPTION: + Enable/disable new NMEA sentence function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetNMEACallback( tFNNewNMEA pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNNewNMEA == 0); + bool bOff = (pCallback == 0 && mpFNNewNMEA != 0); + bool bReplace = (pCallback != 0 && mpFNNewNMEA != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_PDS; + WORD msgID = (WORD)eQMI_PDS_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 16 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNNewNMEA = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNNewNMEA = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetPDSStateCallback (Public Method) + +DESCRIPTION: + Enable/disable PDS service state callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetPDSStateCallback( tFNPDSState pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNPDSState = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetCATEventCallback (Public Method) + +DESCRIPTION: + This function enables/disables the CAT event callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + eventMask [ I ] - Bitmask of CAT events to register for + pErrorMask [ O ] - Error bitmask + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetCATEventCallback( + tFNCATEvent pCallback, + ULONG eventMask, + ULONG * pErrorMask ) +{ + // Assume failure + eGobiError retCode = eGOBI_ERR_GENERAL; + *pErrorMask = ULONG_MAX; + + // Validate arguments versus what is changing + bool bOn = (pCallback != 0 && mpFNCATEvent == 0); + bool bOff = (pCallback == 0 && mpFNCATEvent != 0); + bool bReplace = (pCallback != 0 && mpFNCATEvent != 0); + if (bOn == true || bOff == true || bReplace == true) + { + const ULONG szTLVHdr = (ULONG)sizeof( sQMIRawContentHeader ); + const ULONG szData = (ULONG)sizeof( ULONG ); + BYTE buf[szTLVHdr + szData]; + + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)&buf[0]; + pTLV->mTypeID = 16; + pTLV->mLength = (WORD)szData; + + ULONG * pData = (ULONG *)&buf[szTLVHdr]; + + *pData = eventMask; + + if (bOff == true) + { + // Ignore event mask argument when disabling the callback + *pData = 0; + + // We also always clear the callback regardless of the response + mpFNCATEvent = pCallback; + } + + sSharedBuffer * pReq = 0; + pReq = sQMIServiceBuffer::BuildBuffer( eQMI_SVC_CAT, + (WORD)eQMI_CAT_SET_EVENT, + false, + false, + &buf[0], + szTLVHdr + szData ); + + sProtocolBuffer rsp = Send( eQMI_SVC_CAT, pReq ); + if (rsp.IsValid() == false) + { + retCode = GetCorrectedLastError(); + return retCode; + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + retCode = eGOBI_ERR_MALFORMED_RSP; + return retCode; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + retCode = eGOBI_ERR_MALFORMED_RSP; + return retCode; + } + else if (rc != 0) + { + // Parse out the error mask? + if (qmiRsp.GetMessageID() == (ULONG)eQMI_CAT_SET_EVENT) + { + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 16 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + if (pHdr->mLength > 4) + + { + pData = (ULONG *)++pHdr; + *pErrorMask = *pData; + } + } + } + + retCode = GetCorrectedQMIError( ec ); + return retCode; + } + + // Success! + mpFNCATEvent = pCallback; + retCode = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + retCode = eGOBI_ERR_NONE; + } + + return retCode; +} + +/*=========================================================================== +METHOD: + SetOMADMAlertCallback (Public Method) + +DESCRIPTION: + This function enables/disables the OMA-DM network initiated alert + callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetOMADMAlertCallback( + tFNOMADMAlert pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNOMADMAlert == 0); + bool bOff = (pCallback == 0 && mpFNOMADMAlert != 0); + bool bReplace = (pCallback != 0 && mpFNOMADMAlert != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_OMA; + WORD msgID = (WORD)eQMI_OMA_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 16 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNOMADMAlert = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNOMADMAlert = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetOMADMStateCallback (Public Method) + +DESCRIPTION: + This function enables/disables the OMA-DM state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetOMADMStateCallback( tFNOMADMState pCallback ) +{ + // Assume failure + eGobiError rc = eGOBI_ERR_GENERAL; + + // Something changing? + bool bOn = (pCallback != 0 && mpFNOMADMState == 0); + bool bOff = (pCallback == 0 && mpFNOMADMState != 0); + bool bReplace = (pCallback != 0 && mpFNOMADMState != 0); + if (bOn == true || bOff == true) + { + // Turning on/off + eQMIService svc = eQMI_SVC_OMA; + WORD msgID = (WORD)eQMI_OMA_SET_EVENT; + sSharedBuffer * pReq = 0; + + std::vector piv; + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 17 ); + + if (bOn == true) + { + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + } + else + { + sDB2PackingInput pi( pek, "0" ); + piv.push_back( pi ); + } + + pReq = DB2PackQMIBuffer( mDB, piv ); + + rc = SendAndCheckReturn( svc, pReq ); + if (rc == eGOBI_ERR_NONE || bOff == true) + { + mpFNOMADMState = pCallback; + } + } + else if (bReplace == true) + { + // We don't have to register for anything so a simple assignment works + mpFNOMADMState = pCallback; + rc = eGOBI_ERR_NONE; + } + else + { + // Turning it off redundantly + rc = eGOBI_ERR_NONE; + } + + return rc; +} + +/*=========================================================================== +METHOD: + SetUSSDReleaseCallback (Public Method) + +DESCRIPTION: + Enable/disable USSD release callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetUSSDReleaseCallback( + tFNUSSDRelease pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNUSSDRelease = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetUSSDNotificationCallback (Public Method) + +DESCRIPTION: + Enable/disable USSD notification callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetUSSDNotificationCallback( + tFNUSSDNotification pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNUSSDNotification = pCallback; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetUSSDOriginationCallback (Public Method) + +DESCRIPTION: + Enable/disable USSD origination callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiConnectionMgmt::SetUSSDOriginationCallback( + tFNUSSDOrigination pCallback ) +{ + // We don't have to register for anything so a simple assignment works + mpFNUSSDOrigination = pCallback; + return eGOBI_ERR_NONE; +} + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.h b/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.h new file mode 100755 index 0000000..e92cbcf --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmt.h @@ -0,0 +1,1370 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmt.h + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + cGobiConnectionMgmtDLL + cGobiConnectionMgmt + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiQMICore.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- +extern "C" +{ + +// Session state callback function +typedef void (* tFNSessionState)( +ULONG state, +ULONG sessionEndReason ); + +// RX/TX byte counts callback function +typedef void (* tFNByteTotals)( +ULONGLONG totalBytesTX, +ULONGLONG totalBytesRX ); + +// Dormancy status callback function +typedef void (* tFNDormancyStatus)( ULONG dormancyStatus ); + +// Mobile IP status callback function +typedef void (* tFNMobileIPStatus)( ULONG mipStatus ); + +// Activation status callback function +typedef void (* tFNActivationStatus)( ULONG activationStatus ); + +// Power operating mode callback function +typedef void (* tFNPower)( ULONG operatingMode ); + +// Wireless disable callback function +typedef void (* tFNWirelessDisable)( ULONG bState ); + +// Serving system data capabilities callback function +typedef void (* tFNDataCapabilities)( +BYTE dataCapsSize, +BYTE * pDataCaps ); + +// Data bearer technology callback function +typedef void (* tFNDataBearer)( ULONG dataBearer ); + +// Roaming indicator callback function +typedef void (* tFNRoamingIndicator)( ULONG roaming ); + +// Signal strength callback function +typedef void (* tFNSignalStrength)( +INT8 signalStrength, +ULONG radioInterface ); + +// RF information callback function +typedef void (* tFNRFInfo)( +ULONG radioInterface, +ULONG activeBandClass, +ULONG activeChannel ); + +// LU reject callback function +typedef void (* tFNLUReject)( +ULONG serviceDomain, +ULONG rejectCause ); + +// PLMN mode callback function +typedef void (* tFNPLMNMode)( ULONG mode ); + +// New SMS message callback function +typedef void (* tFNNewSMS)( +ULONG storageType, +ULONG messageIndex ); + +// New NMEA sentence callback function +typedef void (* tFNNewNMEA)( LPCSTR pNMEA ); + +// PDS session state callback function +typedef void (* tFNPDSState)( +ULONG enabledStatus, +ULONG trackingStatus ); + +// CAT event callback function +typedef void (* tFNCATEvent)( +ULONG eventID, +ULONG eventLen, +BYTE * pEventData ); + +// OMA-DM network initiated alert callback function +typedef void (* tFNOMADMAlert)( + ULONG sessionType, + USHORT sessionID ); + +// OMA-DM state callback function +typedef void (* tFNOMADMState)( + ULONG sessionState, + ULONG failureReason ); + +// USSD release callback function +typedef void (* tFNUSSDRelease)(); + +// USSD notification callback function +typedef void (* tFNUSSDNotification)( + ULONG type, + BYTE * pNetworkInfo ); + +// USSD origination callback function +typedef void (* tFNUSSDOrigination)( + ULONG errorCode, + ULONG failureCause, + BYTE * pNetworkInfo, + BYTE * pAlpha ); + +}; + +// CallbackThread prototype +// Thread to execute a callback asynchronously +void * CallbackThread( PVOID pArg ); + +/*=========================================================================*/ +// Class cGobiCMCallback +/*=========================================================================*/ +class cGobiCMCallback +{ + public: + // (Inline) Constructor + cGobiCMCallback() + { }; + + // (Inline) Destructor + virtual ~cGobiCMCallback() + { }; + + // (Inline) Initialize the callback object by starting the thread + bool Initialize() + { + // Start the thread + pthread_t threadID; + pthread_attr_t attributes; + pthread_attr_init( &attributes ); + pthread_attr_setdetachstate( &attributes, PTHREAD_CREATE_DETACHED ); + + int nRC = pthread_create( &threadID, + &attributes, + CallbackThread, + this ); + + if (nRC == 0) + { + // Success! + return true; + } + + return false; + }; + + protected: + // Call the function + virtual void Call() = 0; + + // Function thread gets full access + friend void * CallbackThread( PVOID pArg ); +}; + +/*=========================================================================*/ +// Class cSessionStateCallback +/*=========================================================================*/ +class cSessionStateCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cSessionStateCallback( + tFNSessionState pCallback, + ULONG state, + ULONG sessionEndReason ) + : mpCallback( pCallback ), + mState( state ), + mSessionEndReason( sessionEndReason ) + { }; + + // (Inline) Destructor + virtual ~cSessionStateCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mState, mSessionEndReason ); + } + }; + + /* Callback function */ + tFNSessionState mpCallback; + + /* Callback arguments */ + ULONG mState; + ULONG mSessionEndReason; +}; + +/*=========================================================================*/ +// Class cByteTotalsCallback +/*=========================================================================*/ +class cByteTotalsCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cByteTotalsCallback( + tFNByteTotals pCallback, + ULONGLONG totalBytesTX, + ULONGLONG totalBytesRX ) + : mpCallback( pCallback ), + mTotalBytesTX( totalBytesTX ), + mTotalBytesRX( totalBytesRX ) + { }; + + // (Inline) Destructor + virtual ~cByteTotalsCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mTotalBytesTX, mTotalBytesRX ); + } + }; + + /* Callback function */ + tFNByteTotals mpCallback; + + /* Callback arguments */ + ULONGLONG mTotalBytesTX; + ULONGLONG mTotalBytesRX; +}; + +/*=========================================================================*/ +// Class cDormancyStatusCallback +/*=========================================================================*/ +class cDormancyStatusCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cDormancyStatusCallback( + tFNDormancyStatus pCallback, + ULONG dormancyStatus ) + : mpCallback( pCallback ), + mDormancyStatus( dormancyStatus ) + { }; + + // (Inline) Destructor + virtual ~cDormancyStatusCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mDormancyStatus ); + } + }; + + /* Callback function */ + tFNDormancyStatus mpCallback; + + /* Callback arguments */ + ULONG mDormancyStatus; +}; + +/*=========================================================================*/ +// Class cMobileIPStatusCallback +/*=========================================================================*/ +class cMobileIPStatusCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cMobileIPStatusCallback( + tFNMobileIPStatus pCallback, + ULONG mobileIPStatus ) + : mpCallback( pCallback ), + mMobileIPStatus( mobileIPStatus ) + { }; + + // (Inline) Destructor + virtual ~cMobileIPStatusCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mMobileIPStatus ); + } + }; + + /* Callback function */ + tFNMobileIPStatus mpCallback; + + /* Callback arguments */ + ULONG mMobileIPStatus; +}; + +/*=========================================================================*/ +// Class cActivationStatusCallback +/*=========================================================================*/ +class cActivationStatusCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cActivationStatusCallback( + tFNActivationStatus pCallback, + ULONG activationStatus ) + : mpCallback( pCallback ), + mActivationStatus( activationStatus ) + { }; + + // (Inline) Destructor + virtual ~cActivationStatusCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mActivationStatus ); + } + }; + + /* Callback function */ + tFNActivationStatus mpCallback; + + /* Callback arguments */ + ULONG mActivationStatus; +}; + +/*=========================================================================*/ +// Class cPowerCallback +/*=========================================================================*/ +class cPowerCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cPowerCallback( + tFNPower pCallback, + ULONG operatingMode ) + : mpCallback( pCallback ), + mOperatingMode( operatingMode ) + { }; + + // (Inline) Destructor + virtual ~cPowerCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mOperatingMode ); + } + }; + + /* Callback function */ + tFNPower mpCallback; + + /* Callback arguments */ + ULONG mOperatingMode; +}; + +/*=========================================================================*/ +// Class cWirelessDisableCallback +/*=========================================================================*/ +class cWirelessDisableCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cWirelessDisableCallback( + tFNWirelessDisable pCallback, + ULONG bState ) + : mpCallback( pCallback ), + mbState( bState ) + { }; + + // (Inline) Destructor + virtual ~cWirelessDisableCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mbState ); + } + }; + + /* Callback function */ + tFNWirelessDisable mpCallback; + + /* Callback arguments */ + ULONG mbState; +}; + +/*=========================================================================*/ +// Class cDataCapabilitiesCallback +/*=========================================================================*/ +class cDataCapabilitiesCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cDataCapabilitiesCallback( + tFNDataCapabilities pCallback, + BYTE dataCapsSize, + ULONG * pDataCaps ) + : mpCallback( pCallback ), + mDataCapsSize( dataCapsSize ) + { + memset( (LPVOID)&mDataCaps[0], 0, 12 * sizeof( ULONG ) ); + + if (mDataCapsSize > 12) + { + mDataCapsSize = 12; + } + + for (ULONG d = 0; d < mDataCapsSize; d++) + { + mDataCaps[d] = pDataCaps[d]; + } + }; + + // (Inline) Destructor + virtual ~cDataCapabilitiesCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mDataCapsSize, (BYTE *)&mDataCaps[0] ); + } + }; + + /* Callback function */ + tFNDataCapabilities mpCallback; + + /* Callback arguments */ + BYTE mDataCapsSize; + ULONG mDataCaps[12]; +}; + +/*=========================================================================*/ +// Class cDataBearerCallback +/*=========================================================================*/ +class cDataBearerCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cDataBearerCallback( + tFNDataBearer pCallback, + ULONG dataBearer ) + : mpCallback( pCallback ), + mDataBearer( dataBearer ) + { }; + + // (Inline) Destructor + virtual ~cDataBearerCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mDataBearer ); + } + }; + + /* Callback function */ + tFNDataBearer mpCallback; + + /* Callback arguments */ + ULONG mDataBearer; +}; + +/*=========================================================================*/ +// Class cRoamingIndicatorCallback +/*=========================================================================*/ +class cRoamingIndicatorCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cRoamingIndicatorCallback( + tFNRoamingIndicator pCallback, + ULONG roaming ) + : mpCallback( pCallback ), + mRoaming( roaming ) + { }; + + // (Inline) Destructor + virtual ~cRoamingIndicatorCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mRoaming ); + } + }; + + /* Callback function */ + tFNRoamingIndicator mpCallback; + + /* Callback arguments */ + ULONG mRoaming; +}; + +/*=========================================================================*/ +// Class cSignalStrengthCallback +/*=========================================================================*/ +class cSignalStrengthCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cSignalStrengthCallback( + tFNSignalStrength pCallback, + INT8 signalStrength, + ULONG radioInterface ) + : mpCallback( pCallback ), + mSignalStrength( signalStrength ), + mRadioInterface( radioInterface ) + { }; + + // (Inline) Destructor + virtual ~cSignalStrengthCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mSignalStrength, mRadioInterface ); + } + }; + + /* Callback function */ + tFNSignalStrength mpCallback; + + /* Callback arguments */ + INT8 mSignalStrength; + ULONG mRadioInterface; +}; + +/*=========================================================================*/ +// Class cRFInfoCallback +/*=========================================================================*/ +class cRFInfoCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cRFInfoCallback( + tFNRFInfo pCallback, + ULONG radioInterface, + ULONG activeBandClass, + ULONG activeChannel ) + : mpCallback( pCallback ), + mRadioInterface( radioInterface ), + mActiveBandClass( activeBandClass ), + mActiveChannel( activeChannel ) + { }; + + // (Inline) Destructor + virtual ~cRFInfoCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mRadioInterface, mActiveBandClass, mActiveChannel ); + } + }; + + /* Callback function */ + tFNRFInfo mpCallback; + + /* Callback arguments */ + ULONG mRadioInterface; + ULONG mActiveBandClass; + ULONG mActiveChannel; +}; + +/*=========================================================================*/ +// Class cLURejectCallback +/*=========================================================================*/ +class cLURejectCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cLURejectCallback( + tFNLUReject pCallback, + ULONG serviceDomain, + ULONG rejectCause ) + : mpCallback( pCallback ), + mServiceDomain( serviceDomain ), + mRejectCause( rejectCause ) + { }; + + // (Inline) Destructor + virtual ~cLURejectCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mServiceDomain, mRejectCause ); + } + }; + + /* Callback function */ + tFNLUReject mpCallback; + + /* Callback arguments */ + ULONG mServiceDomain; + ULONG mRejectCause; +}; + +/*=========================================================================*/ +// Class cPLMNModeCallback +/*=========================================================================*/ +class cPLMNModeCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cPLMNModeCallback( + tFNPLMNMode pCallback, + ULONG mode ) + : mpCallback( pCallback ), + mMode( mode ) + { }; + + // (Inline) Destructor + virtual ~cPLMNModeCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mMode ); + } + }; + + /* Callback function */ + tFNPLMNMode mpCallback; + + /* Callback arguments */ + ULONG mMode; +}; + +/*=========================================================================*/ +// Class cNewSMSCallback +/*=========================================================================*/ +class cNewSMSCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cNewSMSCallback( + tFNNewSMS pCallback, + ULONG storageType, + ULONG messageIndex ) + : mpCallback( pCallback ), + mStorageType( storageType ), + mMessageIndex( messageIndex ) + { }; + + // (Inline) Destructor + virtual ~cNewSMSCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mStorageType, mMessageIndex ); + } + }; + + /* Callback function */ + tFNNewSMS mpCallback; + + /* Callback arguments */ + ULONG mStorageType; + ULONG mMessageIndex; +}; + +/*=========================================================================*/ +// Class cNewNMEACallback +/*=========================================================================*/ +class cNewNMEACallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cNewNMEACallback( + tFNNewNMEA pCallback, + std::string & nmea ) + : mpCallback( pCallback ) + { + memset( (LPVOID)&mNMEA[0], 0, 512 ); + + ULONG len = nmea.size(); + if (len > 0 && len < 512) + { + memcpy( (LPVOID)&mNMEA[0], + (LPCVOID)nmea.c_str(), + (SIZE_T)len ); + } + }; + + // (Inline) Destructor + virtual ~cNewNMEACallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0 && mNMEA[0] != 0) + { + mpCallback( &mNMEA[0] ); + } + }; + + /* Callback function */ + tFNNewNMEA mpCallback; + + /* Callback arguments */ + CHAR mNMEA[512]; +}; + +/*=========================================================================*/ +// Class cPDSStateCallback +/*=========================================================================*/ +class cPDSStateCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cPDSStateCallback( + tFNPDSState pCallback, + ULONG enabledState, + ULONG trackingState ) + : mpCallback( pCallback ), + mEnabledState( enabledState ), + mTrackingState( trackingState ) + { }; + + // (Inline) Destructor + virtual ~cPDSStateCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mEnabledState, mTrackingState ); + } + }; + + /* Callback function */ + tFNPDSState mpCallback; + + /* Callback arguments */ + ULONG mTrackingState; + ULONG mEnabledState; +}; + +/*=========================================================================*/ +// Class cCATEventCallback +/*=========================================================================*/ +class cCATEventCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cCATEventCallback( + tFNCATEvent pCallback, + ULONG eventID, + ULONG eventLen, + const BYTE * pEventData ) + : mpCallback( pCallback ), + mEventID( eventID ), + mEventLen( 0 ) + { + memset( (LPVOID)&mData[0], 0, 2048 ); + + if (pEventData != 0 && eventLen > 0 && eventLen < 2048) + { + mEventLen = eventLen; + memcpy( (LPVOID)&mData[0], + (LPCVOID)pEventData, + (SIZE_T)eventLen ); + } + }; + + // (Inline) Destructor + virtual ~cCATEventCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mEventID, mEventLen, &mData[0] ); + } + }; + + /* Callback function */ + tFNCATEvent mpCallback; + + /* Callback arguments */ + ULONG mEventID; + ULONG mEventLen; + BYTE mData[2048]; +}; + +/*=========================================================================*/ +// Class cOMADMAlertCallback +/*=========================================================================*/ +class cOMADMAlertCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cOMADMAlertCallback( + tFNOMADMAlert pCallback, + ULONG sessionType, + USHORT sessionID ) + : mpCallback( pCallback ), + mSessionType( sessionType ), + mSessionID( sessionID ) + { }; + + // (Inline) Destructor + virtual ~cOMADMAlertCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mSessionType, mSessionID ); + } + }; + + /* Callback function */ + tFNOMADMAlert mpCallback; + + /* Callback arguments */ + ULONG mSessionType; + USHORT mSessionID; +}; + +/*=========================================================================*/ +// Class cOMADMStateCallback +/*=========================================================================*/ +class cOMADMStateCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cOMADMStateCallback( + tFNOMADMState pCallback, + ULONG sessionState, + ULONG failureReason ) + : mpCallback( pCallback ), + mSessionState( sessionState ), + mFailureReason( failureReason ) + { }; + + // (Inline) Destructor + virtual ~cOMADMStateCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback( mSessionState, mFailureReason ); + } + }; + + /* Callback function */ + tFNOMADMState mpCallback; + + /* Callback arguments */ + ULONG mSessionState; + ULONG mFailureReason; +}; + +/*=========================================================================*/ +// Class cUSSDReleaseCallback +/*=========================================================================*/ +class cUSSDReleaseCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cUSSDReleaseCallback( tFNUSSDRelease pCallback ) + : mpCallback( pCallback ) + { }; + + // (Inline) Destructor + virtual ~cUSSDReleaseCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + mpCallback(); + } + }; + + /* Callback function */ + tFNUSSDRelease mpCallback; +}; + +/*=========================================================================*/ +// Class cUSSDNotificationCallback +/*=========================================================================*/ +class cUSSDNotificationCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cUSSDNotificationCallback( + tFNUSSDNotification pCallback, + ULONG type, + const BYTE * pData ) + : mpCallback( pCallback ), + mType( type ), + mbData( false ) + { + memset( (LPVOID)&mData[0], 0, 512 ); + + // Data to copy? + if (pData != 0) + { + ULONG len = (ULONG)pData[1] + (ULONG)2; + memcpy( (LPVOID)&mData[0], (LPCVOID)pData, (SIZE_T)len ); + + mbData = true; + } + }; + + // (Inline) Destructor + virtual ~cUSSDNotificationCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + if (mbData == true) + { + mpCallback( mType, &mData[0] ); + } + else + { + mpCallback( mType, 0 ); + } + } + }; + + /* Callback function */ + tFNUSSDNotification mpCallback; + + /* Callback arguments */ + ULONG mType; + BYTE mData[512]; + + /* Did we get data? */ + bool mbData; +}; + +/*=========================================================================*/ +// Class cUSSDOriginationCallback +/*=========================================================================*/ +class cUSSDOriginationCallback : public cGobiCMCallback +{ + public: + // (Inline) Constructor + cUSSDOriginationCallback( + tFNUSSDOrigination pCallback, + ULONG errorCode, + ULONG failureCause, + const BYTE * pNetworkInfo, + const BYTE * pAlpha ) + : mpCallback( pCallback ), + mErrorCode( errorCode ), + mFailureCause( failureCause ), + mbNetwork( false ), + mbAlpha( 0 ) + { + memset( &mNetworkInfo[0], 0, 512 ); + memset( &mAlpha[0], 0, 512 ); + + // Data to copy? + if (pNetworkInfo != 0) + { + ULONG len = (ULONG)pNetworkInfo[1] + (ULONG)2; + memcpy( &mNetworkInfo[0], + pNetworkInfo, + len ); + + mbNetwork = true; + } + + if (pAlpha != 0) + { + ULONG len = (ULONG)pAlpha[1] + (ULONG)2; + memcpy( &mAlpha[0], + pAlpha, + len ); + + mbAlpha = true; + } + }; + + // (Inline) Destructor + virtual ~cUSSDOriginationCallback() + { + mpCallback = 0; + }; + + protected: + // (Inline) Call the function + virtual void Call() + { + if (mpCallback != 0) + { + BYTE * pNetworkInfo = (mbNetwork == true ? &mNetworkInfo[0] : 0); + BYTE * pAlpha = (mbAlpha == true ? &mAlpha[0] : 0); + + mpCallback( mErrorCode, mFailureCause, pNetworkInfo, pAlpha ); + } + }; + + /* Callback function */ + tFNUSSDOrigination mpCallback; + + /* Callback arguments */ + ULONG mErrorCode; + ULONG mFailureCause; + BYTE mNetworkInfo[512]; + BYTE mAlpha[512]; + + /* Did we get data? */ + bool mbNetwork; + bool mbAlpha; +}; + +/*=========================================================================*/ +// Class cGobiConnectionMgmt +/*=========================================================================*/ +class cGobiConnectionMgmt : public cGobiQMICore +{ + public: + // Constructor + cGobiConnectionMgmt(); + + // Destructor + virtual ~cGobiConnectionMgmt(); + + // Connect to the specified Gobi device + virtual bool Connect( + LPCSTR pDeviceNode = 0, + LPCSTR pDeviceKey = 0 ); + + // Disconnect from the currently connected Gobi device + virtual bool Disconnect(); + + // Enable/disable session state callback function + eGobiError SetSessionStateCallback( tFNSessionState pCallback ); + + // Enables/disables the RX/TX byte counts callback function + eGobiError SetByteTotalsCallback( + tFNByteTotals pCallback, + BYTE interval ); + + // Enables/disables the serving system data capabilities callback + eGobiError SetDataCapabilitiesCallback( tFNDataCapabilities pCallback ); + + // Enable/disable data bearer callback function + eGobiError SetDataBearerCallback( tFNDataBearer pCallback ); + + // Enable/disable dormancy status callback function + eGobiError SetDormancyStatusCallback( tFNDormancyStatus pCallback ); + + // Enable/disable mobile IP status callback function + eGobiError SetMobileIPStatusCallback( tFNDormancyStatus pCallback ); + + // Enable/disable activation status callback function + eGobiError SetActivationStatusCallback( tFNActivationStatus pCallback ); + + // Enable/disable power operating mode callback function + eGobiError SetPowerCallback( tFNPower pCallback ); + + // Enable/disable wireless disable state callback function + eGobiError SetWirelessDisableCallback( tFNWirelessDisable pCallback ); + + // Enable/disable roaming indicator callback function + eGobiError SetRoamingIndicatorCallback( tFNRoamingIndicator pCallback ); + + // Enable/disable signal strength callback function + eGobiError SetSignalStrengthCallback( + tFNSignalStrength pCallback, + std::list thresholds ); + + // Enable/disable RF information callback function + eGobiError SetRFInfoCallback( tFNRFInfo pCallback ); + + // Enable/disable LU reject callback function + eGobiError SetLURejectCallback( tFNLUReject pCallback ); + + // Enable/disable PLMN mode callback function + eGobiError SetPLMNModeCallback( tFNPLMNMode pCallback ); + + // Enable/disable new SMS callback function + eGobiError SetNewSMSCallback( tFNNewSMS pCallback ); + + // Enable/disable NMEA sentence callback function + eGobiError SetNMEACallback( tFNNewNMEA pCallback ); + + // Enable/disable PDS service state callback function + eGobiError SetPDSStateCallback( tFNPDSState pCallback ); + + // Enable/disable CAT event callback function + eGobiError SetCATEventCallback( + tFNCATEvent pCallback, + ULONG eventMask, + ULONG * pErrorMask ); + + // Enable/disable OMA-DM NIA callback function + eGobiError SetOMADMAlertCallback( tFNOMADMAlert pCallback ); + + // Enable/disable OMA-DM state callback function + eGobiError SetOMADMStateCallback( tFNOMADMState pCallback ); + + // Enable/disable USSD release callback function + eGobiError SetUSSDReleaseCallback( tFNUSSDRelease pCallback ); + + // Enable/disable USSD notification callback function + eGobiError SetUSSDNotificationCallback( tFNUSSDNotification pCallback ); + + // Enable/disable USSD origination callback function + eGobiError SetUSSDOriginationCallback( tFNUSSDOrigination pCallback ); + + protected: + // Process new traffic + void ProcessTraffic( eQMIService svc ); + + // Process QMI traffic + void ProcessWDSBuffer( const sProtocolBuffer & buf ); + void ProcessDMSBuffer( const sProtocolBuffer & buf ); + void ProcessNASBuffer( const sProtocolBuffer & buf ); + void ProcessWMSBuffer( const sProtocolBuffer & buf ); + void ProcessPDSBuffer( const sProtocolBuffer & buf ); + void ProcessCATBuffer( const sProtocolBuffer & buf ); + void ProcessOMABuffer( const sProtocolBuffer & buf ); + void ProcessVoiceBuffer( const sProtocolBuffer & buf ); + + /* Is there an active thread? */ + bool mbThreadStarted; + + /* ID of traffic processing thread */ + pthread_t mThreadID; + + /* Traffic processing thread exit event */ + cEvent mExitEvent; + + /* Has the protocol server thread finished cleanup? */ + bool mThreadCleanupFinished; + + /* Number of buffers processed by ProcessTraffic() (per server) */ + ULONG mWDSItemsProcessed; + ULONG mDMSItemsProcessed; + ULONG mNASItemsProcessed; + ULONG mWMSItemsProcessed; + ULONG mPDSItemsProcessed; + ULONG mCATItemsProcessed; + ULONG mOMAItemsProcessed; + ULONG mVoiceItemsProcessed; + + /* Callback functions */ + tFNSessionState mpFNSessionState; + tFNByteTotals mpFNByteTotals; + tFNDataCapabilities mpFNDataCapabilities; + tFNDataBearer mpFNDataBearer; + tFNDormancyStatus mpFNDormancyStatus; + tFNMobileIPStatus mpFNMobileIPStatus; + tFNActivationStatus mpFNActivationStatus; + tFNPower mpFNPower; + tFNWirelessDisable mpFNWirelessDisable; + tFNRoamingIndicator mpFNRoamingIndicator; + tFNSignalStrength mpFNSignalStrength; + tFNRFInfo mpFNRFInfo; + tFNLUReject mpFNLUReject; + tFNPLMNMode mpPLMNMode; + tFNNewSMS mpFNNewSMS; + tFNNewNMEA mpFNNewNMEA; + tFNPDSState mpFNPDSState; + tFNCATEvent mpFNCATEvent; + tFNOMADMAlert mpFNOMADMAlert; + tFNOMADMState mpFNOMADMState; + tFNUSSDRelease mpFNUSSDRelease; + tFNUSSDNotification mpFNUSSDNotification; + tFNUSSDOrigination mpFNUSSDOrigination; + + // Traffic process thread gets full access + friend VOID * TrafficProcessThread( PVOID pArg ); +}; + +/*=========================================================================*/ +// Class cGobiConnectionMgmtDLL +/*=========================================================================*/ +class cGobiConnectionMgmtDLL +{ + public: + // Constructor + cGobiConnectionMgmtDLL(); + + // Destructor + virtual ~cGobiConnectionMgmtDLL(); + + // Return the GobiConnectionMgmt object + cGobiConnectionMgmt * GetAPI(); + + protected: + /* API interface object */ + cGobiConnectionMgmt * mpAPI; + + /* Above object allocation attempted? */ + bool mbAllocated; + + /* Synchronization object */ + mutable pthread_mutex_t mSyncSection; +}; + +extern cGobiConnectionMgmtDLL gConnectionDLL; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmtAPI.h b/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmtAPI.h new file mode 100755 index 0000000..5669664 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmtAPI.h @@ -0,0 +1,3319 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtAPI.h + +DESCRIPTION: + QUALCOMM Connection Management API for Gobi 3000 + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +#include "apidefs.h" +#include "types.h" + +/*=========================================================================*/ +// Definitions +/*=========================================================================*/ + +#ifdef __cplusplus + extern "C" { +#endif + +// Session state callback function +typedef void (* tFNSessionState)( + ULONG state, + ULONG sessionEndReason ); + +// RX/TX byte counts callback function +typedef void (* tFNByteTotals)( + ULONGLONG totalBytesTX, + ULONGLONG totalBytesRX ); + +// Dormancy status callback function +typedef void (* tFNDormancyStatus)( ULONG dormancyStatus ); + +// Mobile IP status callback function +typedef void (* tFNMobileIPStatus)( ULONG mipStatus ); + +// Activation status callback function +typedef void (* tFNActivationStatus)( ULONG activationStatus ); + +// Power operating mode callback function +typedef void (* tFNPower)( ULONG operatingMode ); + +// Wireless disable callback function +typedef void (* tFNWirelessDisable)( ULONG bState ); + +// Serving system data capabilities callback function +typedef void (* tFNDataCapabilities)( + BYTE dataCapsSize, + BYTE * pDataCaps ); + +// Data bearer technology callback function +typedef void (* tFNDataBearer)( ULONG dataBearer ); + +// Roaming indicator callback function +typedef void (* tFNRoamingIndicator)( ULONG roaming ); + +// Signal strength callback function +typedef void (* tFNSignalStrength)( + INT8 signalStrength, + ULONG radioInterface ); + +// RF information callback function +typedef void (* tFNRFInfo)( + ULONG radioInterface, + ULONG activeBandClass, + ULONG activeChannel ); + +// LU reject callback function +typedef void (* tFNLUReject)( + ULONG serviceDomain, + ULONG rejectCause ); + +// PLMN mode callback function +typedef void (* tFNPLMNMode)( ULONG mode ); + +// New SMS message callback function +typedef void (* tFNNewSMS)( + ULONG storageType, + ULONG messageIndex ); + +// New NMEA sentence callback function +typedef void (* tFNNewNMEA)( LPCSTR pNMEA ); + +// PDS session state callback function +typedef void (* tFNPDSState)( + ULONG enabledStatus, + ULONG trackingStatus ); + +// CAT event callback function +typedef void (* tFNCATEvent)( + ULONG eventID, + ULONG eventLen, + BYTE * pEventData ); + +// OMA-DM network initiated alert callback function +typedef void (* tFNOMADMAlert)( + ULONG sessionType, + USHORT sessionID ); + +// OMA-DM state callback function +typedef void (* tFNOMADMState)( + ULONG sessionState, + ULONG failureReason ); + +// USSD release callback function +typedef void (* tFNUSSDRelease)(); + +// USSD notification callback function +typedef void (* tFNUSSDNotification)( + ULONG type, + BYTE * pNetworkInfo ); + +// USSD origination callback function +typedef void (* tFNUSSDOrigination)( + ULONG errorCode, + ULONG failureCause, + BYTE * pNetworkInfo, + BYTE * pAlpha ); + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ +/* Returns the type of the connected device. */ +GobiType GetDeviceType(); + +/*=========================================================================== +METHOD: + QCWWANEnumerateDevices + +DESCRIPTION: + This function enumerates the Gobi devices currently attached to the + system + +PARAMETERS: + pDevicesSize [I/O] - Upon input the maximum number of elements that the + device array can contain. Upon successful output + the actual number of elements in the device array + pDevices [ O ] - The device array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANEnumerateDevices( + BYTE * pDevicesSize, + BYTE * pDevices ); + +/*=========================================================================== +METHOD: + QCWWANConnect + +DESCRIPTION: + This function connects the CM API library to the specified Gobi + device + + Both device node and key are case sensitive + +PARAMETERS: + pDeviceNode [ I ] - The device node + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANConnect( + CHAR * pDeviceNode, + CHAR * pDeviceKey ); + +/*=========================================================================== +METHOD: + QCWWANCancel + +DESCRIPTION: + This function cancels the most recent outstanding request + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANCancel(); + +/*=========================================================================== +METHOD: + QCWWANDisconnect + +DESCRIPTION: + This function disconnects the CM API library from the currently + connected Gobi device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANDisconnect(); + +/*=========================================================================== +METHOD: + QCWWANGetConnectedDeviceID + +DESCRIPTION: + This function returns the Node/key of the device the Gobi CM API library + is currently connected to + +PARAMETERS: + deviceNodeSize [ I ] - The maximum number of characters (including NULL + terminator) that the device Node array can contain + pDeviceNode [ O ] - Device Node (NULL terminated string) + deviceKeySize [ I ] - The maximum number of characters (including NULL + terminator) that the device key array can contain + pDeviceKey [ O ] - Device key (NULL terminated string) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANGetConnectedDeviceID( + ULONG deviceNodeSize, + CHAR * pDeviceNode, + ULONG deviceKeySize, + CHAR * pDeviceKey ); + +/*=========================================================================== +METHOD: + GetSessionState + +DESCRIPTION: + This function returns the state of the current packet data session + +PARAMETERS: + pState [ O ] - State of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSessionState( ULONG * pState ); + +/*=========================================================================== +METHOD: + GetSessionDuration + +DESCRIPTION: + This function returns the duration of the current packet data session + +PARAMETERS: + pDuration [ O ] - Duration of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSessionDuration( ULONGLONG * pDuration ); + +/*=========================================================================== +METHOD: + GetDormancyState + +DESCRIPTION: + This function returns the dormancy state of the current packet + data session (when connected) + +PARAMETERS: + pState [ O ] - Dormancy state of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDormancyState( ULONG * pState ); + +/*=========================================================================== +METHOD: + GetAutoconnect (Deprecated) + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + pSetting [ O ] - NDIS autoconnect setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetAutoconnect( ULONG * pSetting ); + +/*=========================================================================== +METHOD: + SetAutoconnect (Deprecated) + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + setting [ I ] - NDIS autoconnect disabled (0) or enabled (non-zero) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetAutoconnect( ULONG setting ); + +/*=========================================================================== +METHOD: + GetEnhancedAutoconnect + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + pSetting [ O ] - NDIS autoconnect setting + pRoamSetting [ O ] - NDIS autoconnect roam setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetEnhancedAutoconnect( + ULONG * pSetting, + ULONG * pRoamSetting ); + +/*=========================================================================== +METHOD: + SetEnhancedAutoconnect + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + setting [ I ] - NDIS autoconnect setting + pRoamSetting [ I ] - (Optional) NDIS autoconnect roam setting + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetEnhancedAutoconnect( + ULONG setting, + ULONG * pRoamSetting ); + +/*=========================================================================== +METHOD: + SetDefaultProfile + +DESCRIPTION: + This function writes the default profile settings to the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being written + pPDPType [ I ] - (Optional) PDP type + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pName [ I ] - (Optional) The profile name or description + pAPNName [ I ] - (Optional) Access point name + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ); + +/*=========================================================================== +METHOD: + GetDefaultProfile + +DESCRIPTION: + This function reads the default profile settings from the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being read + pPDPType [ O ] - PDP type + pIPAddress [ O ] - Preferred assigned IPv4 address + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + pAuthentication [ O ] - Authentication algorithm bitmap + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the profile name array + can contain + pName [ O ] - The profile name or description + apnSize [ I ] - The maximum number of characters (including + NULL terminator) that the APN name array + can contain + pAPNName [ O ] - Access point name represented as a NULL + terminated string (empty string returned when + unknown) + userSize [ I ] - The maximum number of characters (including + NULL terminator) that the username array + can contain + pUsername [ O ] - Username used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ); + +/*=========================================================================== +METHOD: + StartDataSession + +DESCRIPTION: + These functions activate a packet data session + +PARAMETERS: + pTechnology [ I ] - (Optional) Technology bitmap + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pPrimaryNBNS [ I ] - (Optional) Primary NetBIOS NS IPv4 address + pSecondaryNBNS [ I ] - (Optional) Secondary NetBIOS NS IPv4 address + pAPNName [ I ] - (Optional) Access point name + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + pSessionId [ O ] - The assigned session ID + pFailureReason [ O ] - Upon call failure the failure reason provided + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG StartDataSession( + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword, + ULONG * pSessionId, + ULONG * pFailureReason ); + +/*=========================================================================== +METHOD: + CancelDataSession + +DESCRIPTION: + This function cancels an in-progress packet data session activation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CancelDataSession(); + +/*=========================================================================== +METHOD: + StopDataSession + +DESCRIPTION: + This function stops the current data session + +PARAMETERS: + sessionId [ I ] - The ID of the session to terminate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG StopDataSession( ULONG sessionId ); + +/*=========================================================================== +METHOD: + GetIPAddress + +DESCRIPTION: + This function returns the current packet data session IP address + +PARAMETERS: + pIPAddress [ O ] - Assigned IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetIPAddress( ULONG * pIPAddress ); + +/*=========================================================================== +METHOD: + GetConnectionRate + +DESCRIPTION: + This function returns connection rate information for the packet data + connection + +PARAMETERS: + pCurrentChannelTXRate [ O ] - Current channel TX rate (bps) + pCurrentChannelRXRate [ O ] - Current channel RX rate (bps) + pMaxChannelTXRate [ O ] - Maximum channel TX rate (bps) + pMaxChannelRXRate [ O ] - Maximum channel RX rate (bps) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetConnectionRate( + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ); + +/*=========================================================================== +METHOD: + GetPacketStatus + +DESCRIPTION: + This function returns the packet data transfer statistics since the start + of the current packet data session + +PARAMETERS: + pTXPacketSuccesses [ O ] - Packets transmitted without error + pRXPacketSuccesses [ O ] - Packets received without error + pTXPacketErrors [ O ] - Outgoing packets with framing errors + pRXPacketErrors [ O ] - Incoming packets with framing errors + pTXPacketOverflows [ O ] - Packets dropped because TX buffer overflowed + pRXPacketOverflows [ O ] - Packets dropped because RX buffer overflowed + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPacketStatus( + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ); + +/*=========================================================================== +METHOD: + GetByteTotals + +DESCRIPTION: + This function returns the RX/TX byte counts since the start of the + current packet data session + +PARAMETERS: + pTXTotalBytes [ O ] - Bytes transmitted without error + pRXTotalBytes [ O ] - Bytes received without error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetByteTotals( + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ); + +/*=========================================================================== +METHOD: + SetMobileIP + +DESCRIPTION: + This function sets the current mobile IP setting + +PARAMETERS: + mode [ I ] - Desired mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIP( ULONG mode ); + +/*=========================================================================== +METHOD: + GetMobileIP + +DESCRIPTION: + This function gets the current mobile IP setting + +PARAMETERS: + pMode [ O ] - Current mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIP( ULONG * pMode ); + +/*=========================================================================== +METHOD: + SetActiveMobileIPProfile + +DESCRIPTION: + This function sets the active mobile IP profile index + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Desired mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetActiveMobileIPProfile( + CHAR * pSPC, + BYTE index ); + +/*=========================================================================== +METHOD: + GetActiveMobileIPProfile + +DESCRIPTION: + This function gets the the active mobile IP profile index + +PARAMETERS: + pIndex [ O ] - Active mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetActiveMobileIPProfile( BYTE * pIndex ); + +/*=========================================================================== +METHOD: + SetMobileIPProfile + +DESCRIPTION: + This function sets the specified mobile IP profile settings + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Mobile IP profile ID + pEnabled [ I ] - (Optional) Enable MIP profile? + pAddress [ I ] - (Optional) Home IPv4 address + pPrimaryHA [ I ] - (Optional) Primary home agent IPv4 address + pSecondaryHA [ I ] - (Optional) Secondary home agent IPv4 address + pRevTunneling [ I ] - (Optional) Enable reverse tunneling? + pNAI [ I ] - (Optional) Network access identifier string + pHASPI [ I ] - (Optional) HA security parameter index + pAAASPI [ I ] - (Optional) AAA security parameter index + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPProfile( + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ); + +/*=========================================================================== +METHOD: + GetMobileIPProfile + +DESCRIPTION: + This function gets the specified mobile IP profile settings + +PARAMETERS: + index [ I ] - Mobile IP profile ID + pEnabled [ O ] - Mobile IP profile enabled? + pAddress [ O ] - Home IPv4 address + pPrimaryHA [ O ] - Primary home agent IPv4 address + pSecondaryHA [ O ] - Secondary home agent IPv4 address + pRevTunneling [ O ] - Reverse tunneling enabled? + naiSize [ I ] - The maximum number of characters (including NULL + terminator) that the NAI array can contain + pNAI [ O ] - Network access identifier string + pHASPI [ O ] - HA security parameter index + pAAASPI [ O ] - AAA security parameter index + pHAState [ O ] - HA key state + pAAAState [ O ] - AAA key state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIPProfile( + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ); + +/*=========================================================================== +METHOD: + SetMobileIPParameters + +DESCRIPTION: + This function sets the specified mobile IP parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pMode [ I ] - (Optional) Desired mobile IP setting + pRetryLimit [ I ] - (Optional) Retry attempt limit + pRetryInterval [ I ] - (Optional) Retry attempt interval + pReRegPeriod [ I ] - (Optional) Re-registration period + pReRegTraffic [ I ] - (Optional) Re-registration only with traffic? + pHAAuthenticator [ I ] - (Optional) MH-HA authenticator calculator? + pHA2002bis [ I ] - (Optional) MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPParameters( + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + +/*=========================================================================== +METHOD: + GetMobileIPParameters + +DESCRIPTION: + This function gets the mobile IP parameters + +PARAMETERS: + pMode [ O ] - Current mobile IP setting + pRetryLimit [ O ] - Retry attempt limit + pRetryInterval [ O ] - Retry attempt interval + pReRegPeriod [ O ] - Re-registration period + pReRegTraffic [ O ] - Re-registration only with traffic? + pHAAuthenticator [ O ] - MH-HA authenticator calculator? + pHA2002bis [ O ] - MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIPParameters( + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + +/*=========================================================================== +METHOD: + GetLastMobileIPError + +DESCRIPTION: + This function gets the last mobile IP error + +PARAMETERS: + pError [ O ] - Last mobile IP error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetLastMobileIPError( ULONG * pError ); + +/*=========================================================================== +METHOD: + SetDNSSettings + +DESCRIPTION: + This function sets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); + +/*=========================================================================== +METHOD: + GetDNSSettings + +DESCRIPTION: + This function gets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); + +/*=========================================================================== +METHOD: + GetANAAAAuthenticationStatus + +DESCRIPTION: + This function gets the AN-AAA authentication status + +PARAMETERS: + pStatus [ O ] - AN-AAA authentication status + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetANAAAAuthenticationStatus( ULONG * pStatus ); + +/*=========================================================================== +METHOD: + GetSignalStrengths + +DESCRIPTION: + This function gets the current available signal strengths (in dBm) + as measured by the device + +PARAMETERS: + pArraySizes [I/O] - Upon input the maximum number of elements + that each array can contain can contain. + Upon successful output the actual number + of elements in each array + pSignalStrengths [ O ] - Received signal strength array (dBm) + pRadioInterfaces [ O ] - Radio interface technology array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSignalStrengths( + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ); + +/*=========================================================================== +METHOD: + GetRFInfo (Public Method) + +DESCRIPTION: + This function gets the current RF information + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + RF info instance array can contain. Upon success + the actual number of elements in the RF info + instance array + pInstances [ O ] - The RF info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetRFInfo( + BYTE * pInstanceSize, + BYTE * pInstances ); + +/*=========================================================================== +METHOD: + PerformNetworkScan + +DESCRIPTION: + This function performs a scan for available networks + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PerformNetworkScan( + BYTE * pInstanceSize, + BYTE * pInstances ); + +/*=========================================================================== +METHOD: + PerformNetworkRATScan + +DESCRIPTION: + This function performs a scan for available networks (includes RAT) + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + pRATSize [I/O] - Upon input the maximum number of elements that the + RAT info instance array can contain. Upon success + the actual number of elements in the RAT info + instance array + pRATInstances [ O ] - The RAT info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PerformNetworkRATScan( + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ); + +/*=========================================================================== +METHOD: + InitiateNetworkRegistration + +DESCRIPTION: + This function initiates a network registration + +PARAMETERS: + regType [ I ] - Registration type + mcc [ I ] - Mobile country code (ignored for auto registration) + mnc [ I ] - Mobile network code (ignored for auto registration) + rat [ I ] - Radio access type (ignored for auto registration) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG InitiateNetworkRegistration( + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ); + +/*=========================================================================== +METHOD: + InitiateDomainAttach + +DESCRIPTION: + This function initiates a domain attach (or detach) + +PARAMETERS: + action [ I ] - PS attach action (attach or detach) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG InitiateDomainAttach( ULONG action ); + +/*=========================================================================== +METHOD: + GetServingNetwork + +DESCRIPTION: + Gets information regarding the system that currently provides service + to the device + +PARAMETERS: + pRegistrationState [ O ] - Registration state + pCSDomain [ O ] - Circuit switch domain status + pPSDomain [ O ] - Packet switch domain status + pRAN [ O ] - Radio access network + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. Upon + successful output the actual number of elements + in the radio interface array + pRadioIfaces [ O ] - The radio interface array + pRoaming [ O ] - Roaming indicator (0xFFFFFFFF - Unknown) + pMCC [ O ] - Mobile country code (0xFFFF - Unknown) + pMNC [ O ] - Mobile network code (0xFFFF - Unknown) + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the network name array + can contain + pName [ O ] - The network name or description represented + as a NULL terminated string (empty string + returned when unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServingNetwork( + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ); + +/*=========================================================================== +METHOD: + GetServingNetworkCapabilities + +DESCRIPTION: + Gets information regarding the data capabilities of the system that + currently provides service to the device + +PARAMETERS: + pDataCapsSize [I/O] - Upon input the maximum number of elements that the + data capabilities array can contain. Upon success + the actual number of elements in the data + capabilities array + pDataCaps [ O ] - The data capabilities array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServingNetworkCapabilities( + BYTE * pDataCapsSize, + BYTE * pDataCaps ); + +/*=========================================================================== +METHOD: + GetDataBearerTechnology + +DESCRIPTION: + This function retrieves the current data bearer technology (only + valid when connected) + +PARAMETERS: + pDataCaps [ O ] - The data bearer technology + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDataBearerTechnology( ULONG * pDataBearer ); + +/*=========================================================================== +METHOD: + GetHomeNetwork + +DESCRIPTION: + This function retrieves information about the home network of the device + +PARAMETERS: + pMCC [ O ] - Mobile country code + pMNC [ O ] - Mobile network code + nameSize [ I ] - The maximum number of characters (including NULL + terminator) that the network name array can contain + pName [ O ] - The network name or description represented as a NULL + terminated string (empty string returned when unknown) + pSID [ O ] - Home network system ID (0xFFFF - Unknown) + pNID [ O ] - Home network ID (0xFFFF - Unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetHomeNetwork( + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ); + +/*=========================================================================== +METHOD: + SetNetworkPreference + +DESCRIPTION: + This function sets the network registration preference + +PARAMETERS: + technologyPref [ I ] - Technology preference bitmap + duration [ I ] - Duration of active preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNetworkPreference( + ULONG technologyPref, + ULONG duration ); + +/*=========================================================================== +METHOD: + GetNetworkPreference + +DESCRIPTION: + This function returns the network registration preference + +PARAMETERS: + pTechnologyPref [ O ] - Technology preference bitmap + pDuration [ O ] - Duration of active preference + pPersistentTechnologyPref [ O ] - Persistent technology preference bitmap + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetNetworkPreference( + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ); + +/*=========================================================================== +METHOD: + SetCDMANetworkParameters + +DESCRIPTION: + This function sets the desired CDMA network parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pForceRev0 [ I ] - (Optional) Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ I ] - (Optional) Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ I ] - (Optional) Protocol mask for custom SCP config + pBroadcast [ I ] - (Optional) Broadcast mask for custom SCP config + pApplication [ I ] - (Optional) Application mask for custom SCP config + pRoaming [ I ] - (Optional) Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetCDMANetworkParameters( + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + +/*=========================================================================== +METHOD: + GetCDMANetworkParameters + +DESCRIPTION: + This function gets the current CDMA network parameters + +PARAMETERS: + pSCI [ O ] - Slot cycle index + pSCM [ O ] - Station class mark + pRegHomeSID [ O ] - Register on home SID? + pRegForeignSID [ O ] - Register on foreign SID? + pRegForeignNID [ O ] - Register on foreign NID? + pForceRev0 [ O ] - Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ O ] - Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ O ] - Protocol mask for custom SCP config + pBroadcast [ O ] - Broadcast mask for custom SCP config + pApplication [ O ] - Application mask for custom SCP config + pRoaming [ O ] - Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetCDMANetworkParameters( + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + +/*=========================================================================== +METHOD: + GetACCOLC + +DESCRIPTION: + This function returns the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pACCOLC [ O ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetACCOLC( BYTE * pACCOLC ); + +/*=========================================================================== +METHOD: + SetACCOLC + +DESCRIPTION: + This function sets the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + accolc [ I ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetACCOLC( + CHAR * pSPC, + BYTE accolc ); + +/*=========================================================================== +METHOD: + GetPLMNMode + +DESCRIPTION: + This function returns the PLMN mode from the CSP + +PARAMETERS: + pMode [ O ] - PLMN mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPLMNMode( ULONG * pMode ); + +/*=========================================================================== +METHOD: + GetPLMNName + +DESCRIPTION: + This function returns PLMN name information for the given MCC/MNC + +PARAMETERS: + mcc [ I ] - Mobile country code + mnc [ I ] - Mobile network code + pNamesSize [I/O] - Upon input the size in BYTEs of the name structure + array. Upon success the actual number of BYTEs + copied to the name structure array + pNames [ O ] - The name structure array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPLMNName( + USHORT mcc, + USHORT mnc, + ULONG * pNamesSize, + BYTE * pNames ); + +/*=========================================================================== +METHOD: + GetDeviceCapabilities + +DESCRIPTION: + This function gets device capabilities + +PARAMETERS: + pMaxTxChannelRate [ O ] - Maximum transmission rate (bps) + pMaxRxChannelRate [ O ] - Maximum reception rate (bps) + pDataServiceCapability [ O ] - CS/PS data service capability + pSimCapability [ O ] - Device SIM support + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. + Upon successful output the actual number + of elements in the radio interface array + pRadioIfaces [ O ] - The radio interface array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDeviceCapabilities( + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ); + +/*=========================================================================== +METHOD: + GetManufacturer + +DESCRIPTION: + This function returns the device manufacturer name + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetManufacturer( + BYTE stringSize, + CHAR * pString ); + +/*=========================================================================== +METHOD: + GetModelID + +DESCRIPTION: + This function returns the device model ID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetModelID( + BYTE stringSize, + CHAR * pString ); + +/*=========================================================================== +METHOD: + GetFirmwareRevision + +DESCRIPTION: + This function returns the device firmware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareRevision( + BYTE stringSize, + CHAR * pString ); + +/*=========================================================================== +METHOD: + GetFirmwareRevisions + +DESCRIPTION: + This function returns the device firmware (AMSS, boot, and PRI) + revisions + +PARAMETERS: + amssSize [ I ] - The maximum number of characters (including NULL + terminator) that the AMSS string array can contain + pAMSSString [ O ] - NULL terminated AMSS revision string + bootSize [ I ] - The maximum number of characters (including NULL + terminator) that the boot string array can contain + pBootString [ O ] - NULL terminated boot code revision string + priSize [ I ] - The maximum number of characters (including NULL + terminator) that the PRI string array can contain + pPRIString [ O ] - NULL terminated PRI revision string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareRevisions( + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ); + +/*=========================================================================== +METHOD: + GetFirmwareInfo + +DESCRIPTION: + Returns image information obtained from the current device firmware + +PARAMETERS: + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareInfo( + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ); + +/*=========================================================================== +METHOD: + GetVoiceNumber + +DESCRIPTION: + This function returns the voice number in use by the device + +PARAMETERS: + voiceNumberSize [ I ] - The maximum number of characters (including NULL + terminator) that the voice number array can + contain + pVoiceNumber [ O ] - Voice number (MDN or ISDN) string + minSize [ I ] - The maximum number of characters (including NULL + terminator) that the MIN array can contain + pMIN [ O ] - MIN string (empty string returned when MIN is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetVoiceNumber( + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ); + +/*=========================================================================== +METHOD: + GetIMSI + +DESCRIPTION: + This function returns the device IMSI + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetIMSI( + BYTE stringSize, + CHAR * pString ); + +/*=========================================================================== +METHOD: + GetSerialNumbers + +DESCRIPTION: + This command returns all serial numbers assigned to the device + +PARAMETERS: + esnSize [ I ] - The maximum number of characters (including NULL + terminator) that the ESN array can contain + pESNString [ O ] - ESN string (empty string returned when ESN is + not supported/programmed) + imeiSize [ I ] - The maximum number of characters (including NULL + terminator) that the IMEI array can contain + pIMEIString [ O ] - IMEI string (empty string returned when IMEI is + not supported/programmed) + meidSize [ I ] - The maximum number of characters (including NULL + terminator) that the MEID array can contain + pMEIDString [ O ] - MEID string (empty string returned when MEID is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSerialNumbers( + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ); + +/*=========================================================================== +METHOD: + SetLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + state [ I ] - Desired lock state + pCurrentPIN [ I ] - Current four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetLock( + ULONG state, + CHAR * pCurrentPIN ); + +/*=========================================================================== +METHOD: + QueryLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + pState [ O ] - Current lock state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QueryLock( ULONG * pState ); + +/*=========================================================================== +METHOD: + ChangeLockPIN + +DESCRIPTION: + This command sets the user lock code maintained by the device + +PARAMETERS: + pCurrentPIN [ O ] - Current four digit PIN string + pDesiredPIN [ O ] - New four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ChangeLockPIN( + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ); + +/*=========================================================================== +METHOD: + GetHardwareRevision + +DESCRIPTION: + This function returns the device hardware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetHardwareRevision( + BYTE stringSize, + CHAR * pString ); + +/*=========================================================================== +METHOD: + GetPRLVersion + +DESCRIPTION: + This function returns the version of the active Preferred Roaming List + (PRL) in use by the device + +PARAMETERS: + pPRLVersion [ O ] - The PRL version number + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPRLVersion( WORD * pPRLVersion ); + +/*=========================================================================== +METHOD: + GetERIFile + +DESCRIPTION: + This command returns the ERI file that is stored in EFS on the device + +PARAMETERS: + pFileSize [I/O] - Upon input the maximum number of bytes that the file + contents array can contain. Upon successful output + the actual number of bytes written to the file contents + array + pFile [ O ] - The file contents + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetERIFile( + ULONG * pFileSize, + BYTE * pFile ); + +/*=========================================================================== +METHOD: + ActivateAutomatic + +DESCRIPTION: + This function requests the device to perform automatic service activation + +PARAMETERS: + pActivationCode [ I ] - Activation code (maximum string length of 12) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ActivateAutomatic( CHAR * pActivationCode ); + +/*=========================================================================== +METHOD: + ActivateManual + +DESCRIPTION: + This function requests the device perform manual service activation, + after a successful request the device is then asked to reset + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + sid [ I ] - System identification number + pMDN [ I ] - Mobile Directory Number string + pMIN [ I ] - Mobile Identification Number string + prlSize [ I ] - (Optional) Size of PRL file array + pPRL [ I ] - (Optional) The PRL file contents + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ActivateManual( + CHAR * pSPC, + WORD sid, + CHAR * pMDN, + CHAR * pMIN, + ULONG prlSize, + BYTE * pPRL, + CHAR * pMNHA, + CHAR * pMNAAA ); + +/*=========================================================================== +METHOD: + ResetToFactoryDefaults + +DESCRIPTION: + This function requests the device reset configuration to factory defaults, + after a successful request the device is then asked to reset + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetToFactoryDefaults( CHAR * pSPC ); + +/*=========================================================================== +METHOD: + GetActivationState + +DESCRIPTION: + This function returns the device activation state + +PARAMETERS: + pActivationState [ O ] - Service activation state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetActivationState( ULONG * pActivationState ); + +/*=========================================================================== +METHOD: + SetPower + +DESCRIPTION: + This function sets the operating mode of the device + +PARAMETERS: + powerMode [ I ] - Selected operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPower( ULONG powerMode ); + +/*=========================================================================== +METHOD: + GetPower + +DESCRIPTION: + This function returns the operating mode of the device + +PARAMETERS: + pPowerMode [ O ] - Current operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPower( ULONG * pPowerMode ); + +/*=========================================================================== +METHOD: + GetOfflineReason + +DESCRIPTION: + This function returns the reason why the operating mode of the device + is currently offline + +PARAMETERS: + pReasonMask [ O ] - Bitmask of offline reasons + pbPlatform [ O ] - Offline due to being platform retricted? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetOfflineReason( + ULONG * pReasonMask, + ULONG * pbPlatform ); + +/*=========================================================================== +METHOD: + GetNetworkTime + +DESCRIPTION: + This function returns the current time of the device + +PARAMETERS: + pTimeStamp [ O ] - Count of 1.25ms that have elapsed from the start + of GPS time (Jan 6, 1980) + pTimeSource [ O ] - Source of the timestamp + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetNetworkTime( + ULONGLONG * pTimeCount, + ULONG * pTimeSource ); + +/*=========================================================================== +METHOD: + ValidateSPC + +DESCRIPTION: + This function validates the service programming code + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ValidateSPC( CHAR * pSPC ); + +/*=========================================================================== +METHOD: + DeleteSMS + +DESCRIPTION: + This function deletes one or more SMS messages from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + pMessageIndex [ I ] - (Optional) message index + pMessageTag [ I ] - (Optional) message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DeleteSMS( + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ); + +/*=========================================================================== +METHOD: + GetSMSList + +DESCRIPTION: + This function returns the list of SMS messages stored on the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + pRequestedTag [ I ] - Message index + pMessageListSize [I/O] - Upon input the maximum number of elements that the + message list array can contain. Upon successful + output the actual number of elements in the message + list array + pMessageList [ O ] - The message list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSList( + ULONG storageType, + ULONG * pRequestedTag, + ULONG * pMessageListSize, + BYTE * pMessageList ); + +/*=========================================================================== +METHOD: + GetSMS + +DESCRIPTION: + This function returns an SMS message from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + pMessageTag [ O ] - Message tag + pMessageFormat [ O ] - Message format + pMessageSize [I/O] - Upon input the maximum number of bytes that can be + written to the message array. Upon successful + output the actual number of bytes written to the + message array + pMessage [ I ] - The message contents array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMS( + ULONG storageType, + ULONG messageIndex, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ); + +/*=========================================================================== +METHOD: + ModifySMSStatus + +DESCRIPTION: + This function modifies the status of an SMS message saved in storage on + the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + messageTag [ I ] - Message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ModifySMSStatus( + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ); + +/*=========================================================================== +METHOD: + SaveSMS + +DESCRIPTION: + This function saves an SMS message to device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageIndex [ O ] - The message index assigned by the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SaveSMS( + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageIndex ); + +/*=========================================================================== +METHOD: + SendSMS + +DESCRIPTION: + This function sends an SMS message for immediate over the air transmission + +PARAMETERS: + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageFailureCode [ O ] - When the function fails due to an error sending + the message this parameter may contain the + message failure cause code (see 3GPP2 N.S0005 + Section 6.5.2.125). If the cause code is not + provided then the value will be 0xFFFFFFFF + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SendSMS( + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageFailureCode ); + +/*=========================================================================== +METHOD: + GetSMSCAddress + +DESCRIPTION: + This function returns the SMS center address + +PARAMETERS: + addressSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address array + can contain + pSMSCAddress [ 0 ] - The SMS center address represented as a NULL + terminated string + typeSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address type array + can contain + pSMSCType [ 0 ] - The SMS center address type represented as a NULL + terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSCAddress( + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ); + +/*=========================================================================== +METHOD: + SetSMSCAddress + +DESCRIPTION: + This function sets the SMS center address + +PARAMETERS: + pSMSCAddress [ I ] - The SMS center address represented as a NULL + terminated string + pSMSCType [ I ] - The SMS center address type represented as a NULL + terminated string (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSCAddress( + CHAR * pSMSCAddress, + CHAR * pSMSCType ); + +/*=========================================================================== +METHOD: + GetSMSRoutes + +DESCRIPTION: + This function gets the current incoming SMS routing information + +PARAMETERS: + pRouteSize [I/O] - Upon input the maximum number of elements that the + SMS route array can contain. Upon succes the actual + number of elements in the SMS route array + pRoutes [ O ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ); + +/*=========================================================================== +METHOD: + SetSMSRoutes + +DESCRIPTION: + This function sets the desired incoming SMS routing information + +PARAMETERS: + pRouteSize [ I ] - The number of elements in the SMS route array + pRoutes [ I ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ); + +/*=========================================================================== +METHOD: + UIMSetPINProtection + +DESCRIPTION: + This function enables or disables protection of UIM contents by a + given PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + bEnable [ I ] - Enable/disable PIN protection (0 = disable)? + pValue [ I ] - PIN value of the PIN to be enabled/disabled + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetPINProtection( + ULONG id, + ULONG bEnable, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMVerifyPIN + +DESCRIPTION: + This function verifies the PIN before accessing the UIM contents + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pValue [ I ] - PIN value of the PIN to verify + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMVerifyPIN( + ULONG id, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMUnblockPIN + +DESCRIPTION: + This function unblocks a blocked PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pPUKValue [ I ] - PUK value of the PIN to unblock + pNewValue [ I ] - New PIN value of the PIN to unblock + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockPIN( + ULONG id, + CHAR * pPUKValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMChangePIN + +DESCRIPTION: + This function change the PIN value + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pOldValue [ I ] - Old PIN value of the PIN to change + pNewValue [ I ] - New PIN value of the PIN to change + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangePIN( + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMGetPINStatus + +DESCRIPTION: + This function returns the status of the pin + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pStatus [ O ] - PIN status (0xFFFFFFFF = unknown) + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetPINStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMGetICCID + +DESCRIPTION: + This function returns the UIM ICCID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetICCID( + BYTE stringSize, + CHAR * pString ); +/*=========================================================================== +METHOD: + UIMGetControlKeyStatus + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetControlKeyStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMGetControlKeyBlockingStatus + +DESCRIPTION: + This function returns the blocking status of the specified facility + control key + +PARAMETERS: + id [ I ] - Facility ID + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + pbBlocking [ O ] - (Optional) Is the facility blocking? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetControlKeyBlockingStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ); + +/*=========================================================================== +METHOD: + UIMSetControlKeyProtection + +DESCRIPTION: + This function changes the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + status [ I ] - Control key status + pValue [ I ] - Control key de-personalization string + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + control key will be blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetControlKeyProtection( + ULONG id, + ULONG status, + CHAR * pValue, + ULONG * pVerifyRetriesLeft ); + +/*=========================================================================== +METHOD: + UIMUnblockControlKey + +DESCRIPTION: + This function unblocks the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pValue [ I ] - Control key de-personalization string + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockControlKey( + ULONG id, + CHAR * pValue, + ULONG * pUnblockRetriesLeft ); + +/*=========================================================================== +METHOD: + GetPDSState + +DESCRIPTION: + This function returns the current PDS state + +PARAMETERS: + pEnabled [ O ] - Current PDS state (0 = disabled) + pTracking [ O ] - Current PDS tracking session state + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPDSState( + ULONG * pEnabled, + ULONG * pTracking ); + +/*=========================================================================== +METHOD: + SetPDSState + +DESCRIPTION: + This function sets the PDS state + +PARAMETERS: + enable [ I ] - Desired PDS state (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSState( ULONG enable ); + +/*=========================================================================== +METHOD: + PDSInjectTimeReference + +DESCRIPTION: + This function injects a system time into the PDS engine + +PARAMETERS: + sysTime [ I ] - System time + sysDiscontinuities [ I ] - Number of system time discontinuities + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeReference( + ULONGLONG systemTime, + USHORT systemDiscontinuities ); + +/*=========================================================================== +METHOD: + GetPDSDefaults + +DESCRIPTION: + This function returns the default tracking session configuration + +PARAMETERS: + pOperation [ O ] - Current session operating mode + pTimeout [ O ] - Maximum amount of time (seconds) to work on each fix + pInterval [ O ] - Interval (milliseconds) between fix requests + pAccuracy [ O ] - Current accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPDSDefaults( + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ); + +/*=========================================================================== +METHOD: + SetPDSDefaults + +DESCRIPTION: + This function sets the default tracking session configuration + +PARAMETERS: + operation [ I ] - Desired session operating mode + timeout [ I ] - Maximum amount of time (seconds) to work on each fix + interval [ I ] - Interval (milliseconds) between fix requests + accuracy [ I ] - Desired accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSDefaults( + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ); + +/*=========================================================================== +METHOD: + GetXTRAAutomaticDownload + +DESCRIPTION: + This function returns the XTRA automatic download configuration + +PARAMETERS: + pbEnabled [ O ] - Automatic download enabled? + pInterval [ O ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRAAutomaticDownload( + ULONG * pbEnabled, + USHORT * pInterval ); + +/*=========================================================================== +METHOD: + SetXTRAAutomaticDownload + +DESCRIPTION: + This function sets the XTRA automatic download configuration + +PARAMETERS: + bEnabled [ I ] - Automatic download enabled? + interval [ I ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRAAutomaticDownload( + ULONG bEnabled, + USHORT interval ); + +/*=========================================================================== +METHOD: + GetXTRANetwork + +DESCRIPTION: + This function returns the XTRA WWAN network preference + +PARAMETERS: + pPreference [ O ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRANetwork( ULONG * pPreference ); + +/*=========================================================================== +METHOD: + SetXTRANetwork + +DESCRIPTION: + This function sets the XTRA WWAN network preference + +PARAMETERS: + preference [ I ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRANetwork( ULONG preference ); + +/*=========================================================================== +METHOD: + GetXTRAValidity + +DESCRIPTION: + This function returns the XTRA database validity period + +PARAMETERS: + pGPSWeek [ O ] - Starting GPS week of validity period + pGPSWeekOffset [ O ] - Starting GPS week offset (minutes) of validity period + pDuration [ O ] - Length of validity period (hours) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRAValidity( + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ); + +/*=========================================================================== +METHOD: + ForceXTRADownload + +DESCRIPTION: + This function forces the XTRA database to be downloaded to the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ForceXTRADownload(); + +/*=========================================================================== +METHOD: + GetXTRADataState + +DESCRIPTION: + This function returns the XTRA data positioning state + +PARAMETERS: + pState [ O ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRADataState( ULONG * pState ); + +/*=========================================================================== +METHOD: + SetXTRADataState + +DESCRIPTION: + This function sets the XTRA data positioning state + +PARAMETERS: + state [ I ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRADataState( ULONG state ); + +/*=========================================================================== +METHOD: + GetXTRATimeState + +DESCRIPTION: + This function returns the XTRA time positioning state + +PARAMETERS: + pState [ O ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRATimeState( ULONG * pState ); + +/*=========================================================================== +METHOD: + SetXTRATimeState + +DESCRIPTION: + This function sets the XTRA time positioning state + +PARAMETERS: + state [ I ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRATimeState( ULONG state ); + +/*=========================================================================== +METHOD: + GetAGPSConfig + +DESCRIPTION: + This function returns the PDS AGPS configuration + +PARAMETERS: + pServerAddress [ O ] - IPv4 address of AGPS server + pServerPort [ O ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetAGPSConfig( + ULONG * pServerAddress, + ULONG * pServerPort ); + +/*=========================================================================== +METHOD: + SetAGPSConfig + +DESCRIPTION: + This function sets the PDS AGPS configuration + +PARAMETERS: + serverAddress [ I ] - IPv4 address of AGPS server + serverPort [ I ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetAGPSConfig( + ULONG serverAddress, + ULONG serverPort ); + +/*=========================================================================== +METHOD: + GetServiceAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking state for the service + +PARAMETERS: + pbAuto [ O ] - Automatic tracking session started for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServiceAutomaticTracking( ULONG * pbAuto ); + +/*=========================================================================== +METHOD: + SetServiceAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking state for the service + +PARAMETERS: + pbAuto [ I ] - Start automatic tracking session for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetServiceAutomaticTracking( ULONG bAuto ); + +/*=========================================================================== +METHOD: + GetPortAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ O ] - Automatic tracking enabled for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPortAutomaticTracking( ULONG * pbAuto ); + +/*=========================================================================== +METHOD: + SetPortAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ I ] - Enable automatic tracking for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPortAutomaticTracking( ULONG bAuto ); + +/*=========================================================================== +METHOD: + ResetPDSData + +DESCRIPTION: + This function resets the specified PDS data + +PARAMETERS: + pGPSDataMask [ I ] - Bitmask of GPS data to clear (optional) + pCellDataMask [ I ] - Bitmask of cell data to clear (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetPDSData( + ULONG * pGPSDataMask, + ULONG * pCellDataMask ); + +/*=========================================================================== +METHOD: + CATSendTerminalResponse + +DESCRIPTION: + This function sends the terminal response to the device + +PARAMETERS: + refID [ I ] - UIM reference ID (from CAT event) + dataLen [ I ] - Terminal response data length + pData [ I ] - Terminal response data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendTerminalResponse( + ULONG refID, + ULONG dataLen, + BYTE * pData ); + +/*=========================================================================== +METHOD: + CATSendEnvelopeCommand + +DESCRIPTION: + This function sends the envelope command to the device + +PARAMETERS: + cmdID [ I ] - Envelope command ID + dataLen [ I ] - Envelope command data length + pData [ I ] - Envelope command data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendEnvelopeCommand( + ULONG cmdID, + ULONG dataLen, + BYTE * pData ); + +/*=========================================================================== +METHOD: + GetSMSWake + +DESCRIPTION: + This function queries the state of the SMS wake functionality + +PARAMETERS: + pbEnabled [ O ] - SMS wake functionality enabled? + pWakeMask [ O ] - SMS wake mask (only relevant when enabled) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSWake( + ULONG * pbEnabled, + ULONG * pWakeMask ); + +/*=========================================================================== +METHOD: + SetSMSWake + +DESCRIPTION: + This function enables/disables the SMS wake functionality + +PARAMETERS: + bEnable [ I ] - Enable SMS wake functionality? + wakeMask [ I ] - SMS wake mask (only relevant when enabling) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSWake( + ULONG bEnable, + ULONG wakeMask ); + +/*=========================================================================== +METHOD: + OMADMStartSession + +DESCRIPTION: + This function starts an OMA-DM session + +PARAMETERS: + sessionType [ I ] - Type of session to initiate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMStartSession( ULONG sessionType ); + +/*=========================================================================== +METHOD: + OMADMCancelSession + +DESCRIPTION: + This function cancels an ongoing OMA-DM session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMCancelSession(); + +/*=========================================================================== +METHOD: + OMADMGetSessionInfo + +DESCRIPTION: + This function returns information related to the current (or previous + if no session is active) OMA-DM session + +PARAMETERS: + pSessionState [ O ] - State of session + pSessionType [ O ] - Type of session + pFailureReason [ O ] - Session failure reason (when state indicates failure) + pRetryCount [ O ] - Session retry count (when state indicates retrying) + pSessionPause [ O ] - Session pause timer (when state indicates retrying) + pTimeRemaining [ O ] - Pause time remaining (when state indicates retrying) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetSessionInfo( + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ); + +/*=========================================================================== +METHOD: + OMADMGetPendingNIA + +DESCRIPTION: + This function returns information about the pending network initiated + alert + +PARAMETERS: + pSessionType [ O ] - Type of session + pSessionID [ O ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetPendingNIA( + ULONG * pSessionType, + USHORT * pSessionID ); + +/*=========================================================================== +METHOD: + OMADMSendSelection + +DESCRIPTION: + This function sends the specified OMA-DM selection for the current + network initiated session + +PARAMETERS: + selection [ I ] - Selection + sessionID [ I ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSendSelection( + ULONG selection, + USHORT sessionID ); + +/*=========================================================================== +METHOD: + OMADMGetFeatureSettings + +DESCRIPTION: + This function returns the OMA-DM feature settings + +PARAMETERS: + pbProvisioning [ O ] - Device provisioning service update enabled + pbPRLUpdate [ O ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetFeatureSettings( + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ); + +/*=========================================================================== +METHOD: + OMADMSetProvisioningFeature + +DESCRIPTION: + This function sets the OMA-DM device provisioning service + update feature setting + +PARAMETERS: + bProvisioning [ I ] - Device provisioning service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSetProvisioningFeature( + ULONG bProvisioning ); + +/*=========================================================================== +METHOD: + OMADMSetPRLUpdateFeature + +DESCRIPTION: + This function sets the OMA-DM PRL service update feature setting + +PARAMETERS: + bPRLUpdate [ I ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSetPRLUpdateFeature( + ULONG bPRLUpdate ); + +/*=========================================================================== +METHOD: + OriginateUSSD + +DESCRIPTION: + This function initiates a USSD operation + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OriginateUSSD( BYTE * pInfo ); + +/*=========================================================================== +METHOD: + AnswerUSSD + +DESCRIPTION: + This function responds to a USSD request from the network + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AnswerUSSD( BYTE * pInfo ); + +/*=========================================================================== +METHOD: + CancelUSSD + +DESCRIPTION: + This function cancels an in-progress USSD operation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CancelUSSD(); + +/*=========================================================================== +METHOD: + UpgradeFirmware + +DESCRIPTION: + This function performs the following set of steps: + a) Verifies arguments + b) Updates firmware ID on device + c) Resets the device + + NOTE: Upon successful completion the above steps will have been completed, + however the actual upgrade of the firmware will necessarily then + follow. + +PARAMETERS: + pDestinationPath [ I ] - The fully qualified path to the destination folder + that the firmware download service will use + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UpgradeFirmware( CHAR * pDestinationPath ); + +/*=========================================================================== +METHOD: + GetImageInfo + +DESCRIPTION: + Returns image information obtained from the firmware image located at the + provided path + +PARAMETERS: + pPath [ I ] - Location of the firmware image + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImageInfo( + CHAR * pPath, + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ); + +/*=========================================================================== +METHOD: + GetImageStore + +DESCRIPTION: + Returns the image store folder, i.e. the folder co-located with the + QDL Service executable which (by default) contains one or more carrier + specific image subfolders + +PARAMETERS: + pathSize [ I ] - Maximum number of characters (including NULL + terminator) that can be copied to the image + store path array + pImageStorePath [ O ] - The path to the image store + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImageStore( + WORD pathSize, + CHAR * pImageStorePath ); + +/*=========================================================================== +METHOD: + SetSessionStateCallback + +DESCRIPTION: + This function enables/disables the session state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSessionStateCallback( tFNSessionState pCallback ); + +/*=========================================================================== +METHOD: + SetByteTotalsCallback + +DESCRIPTION: + This function enables/disables the RX/TX byte counts callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + interval [ I ] - Interval in seconds (ignored when disabling) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetByteTotalsCallback( + tFNByteTotals pCallback, + BYTE interval ); + +/*=========================================================================== +METHOD: + SetDataCapabilitiesCallback + +DESCRIPTION: + This function enables/disables the serving system data capabilities + callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDataCapabilitiesCallback( + tFNDataCapabilities pCallback ); + +/*=========================================================================== +METHOD: + SetDataBearerCallback + +DESCRIPTION: + This function enables/disables the data bearer status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDataBearerCallback( tFNDataBearer pCallback ); + +/*=========================================================================== +METHOD: + SetDormancyStatusCallback + +DESCRIPTION: + This function enables/disables the dormancy status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDormancyStatusCallback( + tFNDormancyStatus pCallback ); + +/*=========================================================================== +METHOD: + SetMobileIPStatusCallback + +DESCRIPTION: + This function enables/disables the mobile IP status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPStatusCallback( + tFNMobileIPStatus pCallback ); + +/*=========================================================================== +METHOD: + SetActivationStatusCallback + +DESCRIPTION: + This function enables/disables the activation status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetActivationStatusCallback( + tFNActivationStatus pCallback ); + +/*=========================================================================== +METHOD: + SetPowerCallback + +DESCRIPTION: + Enable/disable power operating mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG SetPowerCallback( tFNPower pCallback ); + +/*=========================================================================== +METHOD: + SetWirelessDisableCallback + +DESCRIPTION: + Enables/disables wireless disable state callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG +===========================================================================*/ +ULONG SetWirelessDisableCallback( + tFNWirelessDisable pCallback ); + +/*=========================================================================== +METHOD: + SetRoamingIndicatorCallback + +DESCRIPTION: + This function enables/disables the roaming indicator callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetRoamingIndicatorCallback( + tFNRoamingIndicator pCallback ); + +/*=========================================================================== +METHOD: + SetSignalStrengthCallback + +DESCRIPTION: + This function enables/disables the signal strength callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + thresholdsSize [ I ] - Number of elements the threshold array contain + (a maximum of 5 thresholds is supported), must + be 0 when disabling the callback + pThresholds [ I ] - Signal threshold array (each entry in dBm), + must be 0 when disabling the callback + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSignalStrengthCallback( + tFNSignalStrength pCallback, + BYTE thresholdsSize, + INT8 * pThresholds ); + +/*=========================================================================== +METHOD: + SetRFInfoCallback + +DESCRIPTION: + This function enables/disables the RF information callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetRFInfoCallback( tFNRFInfo pCallback ); + +/*=========================================================================== +METHOD: + SetLURejectCallback + +DESCRIPTION: + This function enables/disables the LU reject callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetLURejectCallback( tFNLUReject pCallback ); + +/*=========================================================================== +METHOD: + SetPLMNModeCallback + +DESCRIPTION: + This function enables/disables the PLMN mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPLMNModeCallback( tFNPLMNMode pCallback ); + +/*=========================================================================== +METHOD: + SetNewSMSCallback + +DESCRIPTION: + This function enables/disables the new SMS callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNewSMSCallback( tFNNewSMS pCallback ); + +/*=========================================================================== +METHOD: + SetNMEACallback + +DESCRIPTION: + This function enables/disables the NMEA sentence callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNMEACallback( tFNNewNMEA pCallback ); + +/*=========================================================================== +METHOD: + SetPDSStateCallback + +DESCRIPTION: + This function enables/disables the PDS service state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSStateCallback( tFNPDSState pCallback ); + +/*=========================================================================== +METHOD: + SetCATEventCallback + +DESCRIPTION: + This function enables/disables the CAT event callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + eventMask [ I ] - Bitmask of CAT events to register for + pErrorMask [ O ] - Error bitmask + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetCATEventCallback( + tFNCATEvent pCallback, + ULONG eventMask, + ULONG * pErrorMask ); + +/*=========================================================================== +METHOD: + SetOMADMAlertCallback + +DESCRIPTION: + This function enables/disables the OMA-DM network initiated alert + callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetOMADMAlertCallback( tFNOMADMAlert pCallback ); + +/*=========================================================================== +METHOD: + SetOMADMStateCallback + +DESCRIPTION: + This function enables/disables the OMA-DM state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetOMADMStateCallback( tFNOMADMState pCallback ); + +/*=========================================================================== +METHOD: + SetUSSDReleaseCallback + +DESCRIPTION: + This function enables/disables the USSD release callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDReleaseCallback( tFNUSSDRelease pCallback ); + +/*=========================================================================== +METHOD: + SetUSSDNotificationCallback + +DESCRIPTION: + This function enables/disables the USSD notification callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDNotificationCallback( + tFNUSSDNotification pCallback ); + +/*=========================================================================== +METHOD: + SetUSSDOriginationCallback + +DESCRIPTION: + Enable/disable USSD origination callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDOriginationCallback( + tFNUSSDOrigination pCallback ); + +#ifdef __cplusplus + }; +#endif + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp b/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp new file mode 100755 index 0000000..acee0b7 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/GobiConnectionMgmtExports.cpp @@ -0,0 +1,5030 @@ +/*=========================================================================== +FILE: + GobiConnectionMgmtExports.cpp + +DESCRIPTION: + QUALCOMM Gobi 3000 Connection Management API exports + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiConnectionMgmt.h" +#include "GobiConnectionMgmtAPI.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum length for adapter device path +const ULONG MAX_AI_DEVICE_PATH = 256; + +// Maximum length for adapter key +const ULONG MAX_AI_KEY = 16; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sAdapterInfo +// Struct to represent Gobi adapter info +/*=========================================================================*/ +struct sAdapterInfo +{ + public: + CHAR mPath[MAX_AI_DEVICE_PATH]; + CHAR mKey[MAX_AI_KEY]; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// Exported Methods +/*=========================================================================*/ + +/* Returns the type of the connected device */ +GobiType GetDeviceType() +{ + cGobiConnectionMgmt *pAPI = gConnectionDLL.GetAPI(); + if (!pAPI) + return GOBITYPE_UNKNOWN; + return pAPI->GetDeviceType(); +} + +/*=========================================================================== +METHOD: + QCWWANEnumerateDevices + +DESCRIPTION: + This function enumerates the Gobi devices currently attached to the + system + +PARAMETERS: + pDevicesSize [I/O] - Upon input the maximum number of elements that the + device array can contain. Upon successful output + the actual number of elements in the device array + pDevices [ O ] - The device array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANEnumerateDevices( + BYTE * pDevicesSize, + BYTE * pDevices ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + // Validate arguments + if (pDevicesSize == 0 || pDevices == 0) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxInstances = *pDevicesSize; + *pDevicesSize = 0; + + // Obtain adapter info + std::vector adapters; + adapters = pAPI->GetAvailableDevices(); + + ULONG sz = (ULONG)adapters.size(); + if (sz > (ULONG)maxInstances) + { + sz = (ULONG)maxInstances; + } + + sAdapterInfo * pOutput = (sAdapterInfo *)pDevices; + for (ULONG a = 0; a < sz; a++) + { + const cGobiConnectionMgmt::tDeviceID & id = adapters[a]; + + memset( &pOutput->mPath[0], 0, (SIZE_T)MAX_AI_DEVICE_PATH ); + memset( &pOutput->mKey[0], 0, (SIZE_T)MAX_AI_KEY ); + + ULONG len = id.first.size(); + if (len > 0) + { + if (len >= MAX_AI_DEVICE_PATH) + { + len = MAX_AI_DEVICE_PATH - 1; + } + + memcpy( (LPVOID)&pOutput->mPath[0], + (LPVOID)id.first.c_str(), + (SIZE_T)len ); + } + + len = id.second.size(); + if (len > 0) + { + if (len >= MAX_AI_KEY) + { + len = MAX_AI_KEY - 1; + } + + memcpy( (LPVOID)&pOutput->mKey[0], + (LPCVOID)id.second.c_str(), + (SIZE_T)len ); + } + + pOutput++; + } + + *pDevicesSize = (BYTE)sz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + QCWWANConnect + +DESCRIPTION: + This function connects the CM API library to the specified Gobi + device + + Both device node and key are case sensitive + +PARAMETERS: + pDeviceNode [ I ] - The device node + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANConnect( + CHAR * pDeviceNode, + CHAR * pDeviceKey ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + // Validate arguments + if (pDeviceNode == 0 && pDeviceKey != 0) + { + // If you specify a device key then you have to specify a device ID + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + bool bConnect = pAPI->Connect( (LPCSTR)pDeviceNode, + (LPCSTR)pDeviceKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + return (ULONG)eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + QCWWANCancel + +DESCRIPTION: + This function cancels the most recent outstanding request + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANCancel() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->CancelSend(); +} + +/*=========================================================================== +METHOD: + QCWWANDisconnect + +DESCRIPTION: + This function disconnects the CM API library from the currently + connected Gobi device + +PARAMETERS: + pState [ O ] - State of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANDisconnect() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + bool bDisco = pAPI->Disconnect(); + if (bDisco == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + return (ULONG)eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + QCWWANGetConnectedDeviceID + +DESCRIPTION: + This function returns the Node/key of the device the Gobi CM API library + is currently connected to + +PARAMETERS: + deviceNodeSize [ I ] - The maximum number of characters (including NULL + terminator) that the device Node array can contain + pDeviceNode [ O ] - Device Node (NULL terminated string) + deviceKeySize [ I ] - The maximum number of characters (including NULL + terminator) that the device key array can contain + pDeviceKey [ O ] - Device key (NULL terminated string) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QCWWANGetConnectedDeviceID( + ULONG deviceNodeSize, + CHAR * pDeviceNode, + ULONG deviceKeySize, + CHAR * pDeviceKey ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + // Validate arguments + if ( (deviceNodeSize == 0) + || (pDeviceNode == 0) + || (deviceKeySize == 0) + || (pDeviceKey == 0) ) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + *pDeviceNode = 0; + *pDeviceKey = 0; + + std::string devNode = ""; + std::string devKey = ""; + bool bOK = pAPI->GetConnectedDeviceID( devNode, devKey ); + if (bOK == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG lenNode = (ULONG)devNode.size(); + + // Space to perform the copy? + if (deviceNodeSize < lenNode + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pDeviceNode, (LPVOID)devNode.c_str(), lenNode ); + + // Enforce null termination + pDeviceNode[lenNode] = 0; + + ULONG lenKey = (ULONG)devKey.size(); + + // Space to perform the copy? + if (deviceKeySize < lenKey + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pDeviceKey, (LPVOID)devKey.c_str(), lenKey ); + + // Enforce null termination + devKey[lenKey] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSessionState + +DESCRIPTION: + This function returns the state of the current packet data session + +PARAMETERS: + pState [ O ] - State of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSessionState( ULONG * pState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSessionState( pState ); +} + +/*=========================================================================== +METHOD: + GetSessionDuration + +DESCRIPTION: + This function returns the duration of the current packet data session + +PARAMETERS: + pDuration [ O ] - Duration of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSessionDuration( ULONGLONG * pDuration ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSessionDuration( pDuration ); +} + +/*=========================================================================== +METHOD: + GetDormancyState + +DESCRIPTION: + This function returns the dormancy state of the current packet + data session (when connected) + +PARAMETERS: + pState [ O ] - Dormancy state of the current packet session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDormancyState( ULONG * pState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetDormancyState( pState ); +} + +/*=========================================================================== +METHOD: + GetAutoconnect (Deprecated) + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + pSetting [ O ] - NDIS autoconnect setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetAutoconnect( ULONG * pSetting ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + ULONG dummy; + return (ULONG)pAPI->GetEnhancedAutoconnect( pSetting, &dummy ); +} + +/*=========================================================================== +METHOD: + SetAutoconnect (Deprecated) + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + setting [ I ] - NDIS autoconnect disabled (0) or enabled (non-zero) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetAutoconnect( ULONG setting ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetEnhancedAutoconnect( setting, 0 ); +} + +/*=========================================================================== +METHOD: + GetEnhancedAutoconnect + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + pSetting [ O ] - NDIS autoconnect setting + pRoamSetting [ O ] - NDIS autoconnect roam setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetEnhancedAutoconnect( + ULONG * pSetting, + ULONG * pRoamSetting ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetEnhancedAutoconnect( pSetting, pRoamSetting ); +} + +/*=========================================================================== +METHOD: + SetEnhancedAutoconnect + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + setting [ I ] - NDIS autoconnect setting + pRoamSetting [ I ] - (Optional) NDIS autoconnect roam setting + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetEnhancedAutoconnect( + ULONG setting, + ULONG * pRoamSetting ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetEnhancedAutoconnect( setting, pRoamSetting ); +} + + +/*=========================================================================== +METHOD: + SetDefaultProfile + +DESCRIPTION: + This function writes the default profile settings to the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being written + pPDPType [ I ] - (Optional) PDP type + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pName [ I ] - (Optional) The profile name or description + pAPNName [ I ] - (Optional) Access point name + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetDefaultProfile( profileType, + pPDPType, + pIPAddress, + pPrimaryDNS, + pSecondaryDNS, + pAuthentication, + pName, + pAPNName, + pUsername, + pPassword ); +} + +/*=========================================================================== +METHOD: + GetDefaultProfile + +DESCRIPTION: + This function reads the default profile settings from the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being read + pPDPType [ O ] - PDP type + pIPAddress [ O ] - Preferred assigned IPv4 address + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + pAuthentication [ O ] - Authentication algorithm bitmap + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the profile name array + can contain + pName [ O ] - The profile name or description + apnSize [ I ] - The maximum number of characters (including + NULL terminator) that the APN name array + can contain + pAPNName [ O ] - Access point name represented as a NULL + terminated string (empty string returned when + unknown) + userSize [ I ] - The maximum number of characters (including + NULL terminator) that the username array + can contain + pUsername [ O ] - Username used during authentication + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetDefaultProfile( profileType, + pPDPType, + pIPAddress, + pPrimaryDNS, + pSecondaryDNS, + pAuthentication, + nameSize, + pName, + apnSize, + pAPNName, + userSize, + pUsername ); +} + +/*=========================================================================== +METHOD: + StartDataSession + +DESCRIPTION: + This function activates a packet data session + +PARAMETERS: + pTechnology [ I ] - (Optional) Technology bitmap + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pPrimaryNBNS [ I ] - (Optional) Primary NetBIOS NS IPv4 address + pSecondaryNBNS [ I ] - (Optional) Secondary NetBIOS NS IPv4 address + pAPNName [ I ] - (Optional) Access point name + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + pSessionId [ O ] - The assigned session ID + pFailureReason [ O ] - Upon call failure the failure reason provided + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG StartDataSession( + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword, + ULONG * pSessionId, + ULONG * pFailureReason ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->StartDataSession( pTechnology, + pPrimaryDNS, + pSecondaryDNS, + pPrimaryNBNS, + pSecondaryNBNS, + pAPNName, + pIPAddress, + pAuthentication, + pUsername, + pPassword, + pSessionId, + pFailureReason ); +} + +/*=========================================================================== +METHOD: + CancelDataSession + +DESCRIPTION: + This function cancels an in-progress packet data session activation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CancelDataSession() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->CancelDataSession(); +} + +/*=========================================================================== +METHOD: + StopDataSession + +DESCRIPTION: + This function stops the current data session + +PARAMETERS: + sessionId [ I ] - The ID of the session to terminate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG StopDataSession( ULONG sessionId ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->StopDataSession( sessionId ); +} + +/*=========================================================================== +METHOD: + GetIPAddress + +DESCRIPTION: + This function returns the current packet data session IP address + +PARAMETERS: + pIPAddress [ O ] - Assigned IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetIPAddress( ULONG * pIPAddress ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->GetIPAddress( pIPAddress ); +} + +/*=========================================================================== +METHOD: + GetConnectionRate + +DESCRIPTION: + This function returns connection rate information for the packet data + connection + +PARAMETERS: + pCurrentChannelTXRate [ O ] - Current channel TX rate (bps) + pCurrentChannelRXRate [ O ] - Current channel RX rate (bps) + pMaxChannelTXRate [ O ] - Maximum channel TX rate (bps) + pMaxChannelRXRate [ O ] - Maximum channel RX rate (bps) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetConnectionRate( + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetConnectionRate( pCurrentChannelTXRate, + pCurrentChannelRXRate, + pMaxChannelTXRate, + pMaxChannelRXRate ); +} + +/*=========================================================================== +METHOD: + GetPacketStatus + +DESCRIPTION: + This function returns the packet data transfer statistics since the start + of the current packet data session + +PARAMETERS: + pTXPacketSuccesses [ O ] - Packets transmitted without error + pRXPacketSuccesses [ O ] - Packets received without error + pTXPacketErrors [ O ] - Outgoing packets with framing errors + pRXPacketErrors [ O ] - Incoming packets with framing errors + pTXPacketOverflows [ O ] - Packets dropped because TX buffer overflowed + pRXPacketOverflows [ O ] - Packets dropped because RX buffer overflowed + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPacketStatus( + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPacketStatus( pTXPacketSuccesses, + pRXPacketSuccesses, + pTXPacketErrors, + pRXPacketErrors, + pTXPacketOverflows, + pRXPacketOverflows ); +} + +/*=========================================================================== +METHOD: + GetByteTotals + +DESCRIPTION: + This function returns the RX/TX byte counts since the start of the + current packet data session + +PARAMETERS: + pTXTotalBytes [ O ] - Bytes transmitted without error + pRXTotalBytes [ O ] - Bytes received without error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetByteTotals( + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetByteTotals( pTXTotalBytes, pRXTotalBytes ); +} + +/*=========================================================================== +METHOD: + SetMobileIP + +DESCRIPTION: + This function sets the current mobile IP setting + +PARAMETERS: + mode [ I ] - Desired mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIP( ULONG mode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetMobileIP( mode ); +} + +/*=========================================================================== +METHOD: + GetMobileIP + +DESCRIPTION: + This function gets the current mobile IP setting + +PARAMETERS: + pMode [ O ] - Current mobile IP setting + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIP( ULONG * pMode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetMobileIP( pMode ); +} + +/*=========================================================================== +METHOD: + SetActiveMobileIPProfile + +DESCRIPTION: + This function sets the active mobile IP profile index + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Desired mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetActiveMobileIPProfile( + CHAR * pSPC, + BYTE index ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetActiveMobileIPProfile( pSPC, index ); +} + +/*=========================================================================== +METHOD: + GetActiveMobileIPProfile + +DESCRIPTION: + This function gets the the active mobile IP profile index + +PARAMETERS: + pIndex [ O ] - Active mobile IP profile index + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetActiveMobileIPProfile( BYTE * pIndex ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetActiveMobileIPProfile( pIndex ); +} + +/*=========================================================================== +METHOD: + SetMobileIPProfile + +DESCRIPTION: + This function sets the specified mobile IP profile settings + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Mobile IP profile ID + pEnabled [ I ] - (Optional) Enable MIP profile? + pAddress [ I ] - (Optional) Home IPv4 address + pPrimaryHA [ I ] - (Optional) Primary home agent IPv4 address + pSecondaryHA [ I ] - (Optional) Secondary home agent IPv4 address + bRevTunneling [ I ] - (Optional) Enable reverse tunneling? + pNAI [ I ] - (Optional) Network access identifier string + pHASPI [ I ] - (Optional) HA security parameter index + pAAASPI [ I ] - (Optional) AAA security parameter index + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPProfile( + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetMobileIPProfile( pSPC, + index, + pEnabled, + pAddress, + pPrimaryHA, + pSecondaryHA, + pRevTunneling, + pNAI, + pHASPI, + pAAASPI, + pMNHA, + pMNAAA ); +} + +/*=========================================================================== +METHOD: + GetMobileIPProfile + +DESCRIPTION: + This function gets the specified mobile IP profile settings + +PARAMETERS: + index [ I ] - Mobile IP profile ID + pEnabled [ O ] - Mobile IP profile enabled? + pAddress [ O ] - Home IPv4 address + pPrimaryHA [ O ] - Primary home agent IPv4 address + pSecondaryHA [ O ] - Secondary home agent IPv4 address + pRevTunneling [ O ] - Reverse tunneling enabled? + naiSize [ I ] - The maximum number of characters (including NULL + terminator) that the NAI array can contain + pNAI [ O ] - Network access identifier string + pHASPI [ O ] - HA security parameter index + pAAASPI [ O ] - AAA security parameter index + pHAState [ O ] - HA key state + pAAAState [ O ] - AAA key state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIPProfile( + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetMobileIPProfile( index, + pEnabled, + pAddress, + pPrimaryHA, + pSecondaryHA, + pRevTunneling, + naiSize, + pNAI, + pHASPI, + pAAASPI, + pHAState, + pAAAState ); +} + +/*=========================================================================== +METHOD: + SetMobileIPParameters + +DESCRIPTION: + This function sets the specified mobile IP parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pMode [ I ] - (Optional) Desired mobile IP setting + pRetryLimit [ I ] - (Optional) Retry attempt limit + pRetryInterval [ I ] - (Optional) Retry attempt interval + pReRegPeriod [ I ] - (Optional) Re-registration period + pReRegTraffic [ I ] - (Optional) Re-registration only with traffic? + pHAAuthenticator [ I ] - (Optional) MH-HA authenticator calculator? + pHA2002bis [ I ] - (Optional) MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPParameters( + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetMobileIPParameters( pSPC, + pMode, + pRetryLimit, + pRetryInterval, + pReRegPeriod, + pReRegTraffic, + pHAAuthenticator, + pHA2002bis ); +} + +/*=========================================================================== +METHOD: + GetMobileIPParameters + +DESCRIPTION: + This function gets the mobile IP parameters + +PARAMETERS: + pMode [ O ] - Current mobile IP setting + pRetryLimit [ O ] - Retry attempt limit + pRetryInterval [ O ] - Retry attempt interval + pReRegPeriod [ O ] - Re-registration period + pReRegTraffic [ O ] - Re-registration only with traffic? + pHAAuthenticator [ O ] - MH-HA authenticator calculator? + pHA2002bis [ O ] - MH-HA RFC 2002bis authentication? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetMobileIPParameters( + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetMobileIPParameters( pMode, + pRetryLimit, + pRetryInterval, + pReRegPeriod, + pReRegTraffic, + pHAAuthenticator, + pHA2002bis ); +} + +/*=========================================================================== +METHOD: + GetLastMobileIPError + +DESCRIPTION: + This function gets the last mobile IP error + +PARAMETERS: + pError [ O ] - Last mobile IP error + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetLastMobileIPError( ULONG * pError ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetLastMobileIPError( pError ); +} + +/*=========================================================================== +METHOD: + SetDNSSettings + +DESCRIPTION: + This function sets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetDNSSettings( pPrimaryDNS, pSecondaryDNS ); +} + +/*=========================================================================== +METHOD: + GetDNSSettings + +DESCRIPTION: + This function gets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetDNSSettings( pPrimaryDNS, pSecondaryDNS ); +} + +/*=========================================================================== +METHOD: + GetANAAAAuthenticationStatus + +DESCRIPTION: + This function gets the AN-AAA authentication status + +PARAMETERS: + pStatus [ O ] - AN-AAA authentication status + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetANAAAAuthenticationStatus( ULONG * pStatus ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetANAAAAuthenticationStatus( pStatus ); +} + +/*=========================================================================== +METHOD: + GetSignalStrengths + +DESCRIPTION: + This function gets the current available signal strengths (in dBm) + as measured by the device + +PARAMETERS: + pArraySizes [I/O] - Upon input the maximum number of elements + that each array can contain can contain. + Upon successful output the actual number + of elements in each array + pSignalStrengths [ O ] - Received signal strength array (dBm) + pRadioInterfaces [ O ] - Radio interface technology array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSignalStrengths( + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSignalStrengths( pArraySizes, + pSignalStrengths, + pRadioInterfaces ); +} + +/*=========================================================================== +METHOD: + GetRFInfo + +DESCRIPTION: + This function gets the current RF information + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + RF info instance array can contain. Upon success + the actual number of elements in the RF info + instance array + pInstances [ O ] - The RF info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetRFInfo( + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetRFInfo( pInstanceSize, pInstances ); +} + + + +/*=========================================================================== +METHOD: + PerformNetworkScan + +DESCRIPTION: + This function performs a scan for available networks + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PerformNetworkScan( + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->PerformNetworkScan( pInstanceSize, pInstances ); +} + +/*=========================================================================== +METHOD: + PerformNetworkRATScan + +DESCRIPTION: + This function performs a scan for available networks (includes RAT) + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + pRATSize [I/O] - Upon input the maximum number of elements that the + RAT info instance array can contain. Upon success + the actual number of elements in the RAT info + instance array + pRATInstances [ O ] - The RAT info instance array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PerformNetworkRATScan( + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->PerformNetworkRATScan( pInstanceSize, + pInstances, + pRATSize, + pRATInstances ); +} + +/*=========================================================================== +METHOD: + InitiateNetworkRegistration + +DESCRIPTION: + This function initiates a network registration + +PARAMETERS: + regType [ I ] - Registration type + mcc [ I ] - Mobile country code (ignored for auto registration) + mnc [ I ] - Mobile network code (ignored for auto registration) + rat [ I ] - Radio access type (ignored for auto registration) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG InitiateNetworkRegistration( + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->InitiateNetworkRegistration( regType, + mcc, + mnc, + rat ); +} + +/*=========================================================================== +METHOD: + InitiateDomainAttach + +DESCRIPTION: + This function initiates a domain attach (or detach) + +PARAMETERS: + action [ I ] - PS attach action (attach or detach) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG InitiateDomainAttach( ULONG action ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->InitiateDomainAttach( action ); +} + +/*=========================================================================== +METHOD: + GetServingNetwork + +DESCRIPTION: + Gets information regarding the system that currently provides service + to the device + +PARAMETERS: + pRegistrationState [ O ] - Registration state + pCSDomain [ O ] - Circuit switch domain status + pPSDomain [ O ] - Packet switch domain status + pRAN [ O ] - Radio access network + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. Upon + successful output the actual number of elements + in the radio interface array + pRadioIfaces [ O ] - The radio interface array + pRoaming [ O ] - Roaming indicator (0xFFFFFFFF - Unknown) + pMCC [ O ] - Mobile country code (0xFFFF - Unknown) + pMNC [ O ] - Mobile network code (0xFFFF - Unknown) + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the network name array + can contain + pName [ O ] - The network name or description represented + as a NULL terminated string (empty string + returned when unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServingNetwork( + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetServingNetwork( pRegistrationState, + pCSDomain, + pPSDomain, + pRAN, + pRadioIfacesSize, + pRadioIfaces, + pRoaming, + pMCC, + pMNC, + nameSize, + pName ); +} + +/*=========================================================================== +METHOD: + GetServingNetworkCapabilities + +DESCRIPTION: + Gets information regarding the data capabilities of the system that + currently provides service to the device + +PARAMETERS: + pDataCapsSize [I/O] - Upon input the maximum number of elements that the + data capabilities array can contain. Upon success + the actual number of elements in the data + capabilities array + pDataCaps [ O ] - The data capabilities array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServingNetworkCapabilities( + BYTE * pDataCapsSize, + BYTE * pDataCaps ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetServingNetworkCapabilities( pDataCapsSize, + pDataCaps ); +} + +/*=========================================================================== +METHOD: + GetDataBearerTechnology + +DESCRIPTION: + This function retrieves the current data bearer technology (only + valid when connected) + +PARAMETERS: + pDataCaps [ O ] - The data bearer technology + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDataBearerTechnology( ULONG * pDataBearer ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetDataBearerTechnology( pDataBearer ); +} + +/*=========================================================================== +METHOD: + GetHomeNetwork + +DESCRIPTION: + This function retrieves information about the home network of the device + +PARAMETERS: + pMCC [ O ] - Mobile country code + pMNC [ O ] - Mobile network code + nameSize [ I ] - The maximum number of characters (including NULL + terminator) that the network name array can contain + pName [ O ] - The network name or description represented as a NULL + terminated string (empty string returned when unknown) + pSID [ O ] - Home network system ID (0xFFFF - Unknown) + pNID [ O ] - Home network ID (0xFFFF - Unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetHomeNetwork( + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetHomeNetwork( pMCC, + pMNC, + nameSize, + pName, + pSID, + pNID ); +} + +/*=========================================================================== +METHOD: + SetNetworkPreference + +DESCRIPTION: + This function sets the network registration preference + +PARAMETERS: + technologyPref [ I ] - Technology preference bitmap + duration [ I ] - Duration of active preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNetworkPreference( + ULONG technologyPref, + ULONG duration ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetNetworkPreference( technologyPref, duration ); +} + +/*=========================================================================== +METHOD: + GetNetworkPreference + +DESCRIPTION: + This function returns the network registration preference + +PARAMETERS: + pTechnologyPref [ O ] - Technology preference bitmap + pDuration [ O ] - Duration of active preference + pPersistentTechnologyPref [ O ] - Persistent technology preference bitmap + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetNetworkPreference( + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetNetworkPreference( pTechnologyPref, + pDuration, + pPersistentTechnologyPref ); +} + +/*=========================================================================== +METHOD: + SetCDMANetworkParameters + +DESCRIPTION: + This function sets the desired CDMA network parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pForceRev0 [ I ] - (Optional) Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ I ] - (Optional) Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ I ] - (Optional) Protocol mask for custom SCP config + pBroadcast [ I ] - (Optional) Broadcast mask for custom SCP config + pApplication [ I ] - (Optional) Application mask for custom SCP config + pRoaming [ I ] - (Optional) Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetCDMANetworkParameters( + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetCDMANetworkParameters( pSPC, + pForceRev0, + pCustomSCP, + pProtocol, + pBroadcast, + pApplication, + pRoaming ); +} + +/*=========================================================================== +METHOD: + GetEVDONetworkParameters + +DESCRIPTION: + This function gets the current CDMA network parameters + +PARAMETERS: + pSCI [ O ] - Slot cycle index + pSCM [ O ] - Station class mark + pRegHomeSID [ O ] - Register on home SID? + pRegForeignSID [ O ] - Register on foreign SID? + pRegForeignNID [ O ] - Register on foreign NID? + pForceRev0 [ O ] - Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ O ] - Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ O ] - Protocol mask for custom SCP config + pBroadcast [ O ] - Broadcast mask for custom SCP config + pApplication [ O ] - Application mask for custom SCP config + pRoaming [ O ] - Roaming preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetCDMANetworkParameters( + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->GetCDMANetworkParameters( pSCI, + pSCM, + pRegHomeSID, + pRegForeignSID, + pRegForeignNID, + pForceRev0, + pCustomSCP, + pProtocol, + pBroadcast, + pApplication, + pRoaming ); +} + +/*=========================================================================== +METHOD: + GetACCOLC + +DESCRIPTION: + This function returns the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pACCOLC [ O ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetACCOLC( BYTE * pACCOLC ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetACCOLC( pACCOLC ); +} + +/*=========================================================================== +METHOD: + SetACCOLC + +DESCRIPTION: + This function sets the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + accolc [ I ] - The ACCOLC + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetACCOLC( + CHAR * pSPC, + BYTE accolc ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetACCOLC( pSPC, accolc ); +} + +/*=========================================================================== +METHOD: + GetPLMNMode + +DESCRIPTION: + This function returns the PLMN mode from the CSP + +PARAMETERS: + pMode [ O ] - PLMN mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPLMNMode( ULONG * pMode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->GetPLMNMode( pMode ); +} + +/*=========================================================================== +METHOD: + GetPLMNName + +DESCRIPTION: + This function returns PLMN name information for the given MCC/MNC + +PARAMETERS: + mcc [ I ] - Mobile country code + mnc [ I ] - Mobile network code + pNamesSize [I/O] - Upon input the size in BYTEs of the name structure + array. Upon success the actual number of BYTEs + copied to the name structure array + pNames [ O ] - The name structure array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPLMNName( + USHORT mcc, + USHORT mnc, + ULONG * pNamesSize, + BYTE * pNames ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->GetPLMNName( mcc, mnc, pNamesSize, pNames ); +} + +/*=========================================================================== +METHOD: + GetDeviceCapabilities + +DESCRIPTION: + This function gets device capabilities + +PARAMETERS: + pMaxTXChannelRate [ O ] - Maximum transmission rate (bps) + pMaxRXChannelRate [ O ] - Maximum reception rate (bps) + pDataServiceCapability [ O ] - CS/PS data service capability + pSimCapability [ O ] - Device SIM support + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. + Upon successful output the actual number + of elements in the radio interface array + pRadioIfaces [ O ] - The radio interface array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetDeviceCapabilities( + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetDeviceCapabilities( pMaxTXChannelRate, + pMaxRXChannelRate, + pDataServiceCapability, + pSimCapability, + pRadioIfacesSize, + pRadioIfaces ); +} + +/*=========================================================================== +METHOD: + GetManufacturer + +DESCRIPTION: + This function returns the device manufacturer name + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetManufacturer( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetManufacturer( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + GetModelID + +DESCRIPTION: + This function returns the device model ID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetModelID( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetModelID( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + GetFirmwareRevision + +DESCRIPTION: + This function returns the device firmware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareRevision( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetFirmwareRevision( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + GetFirmwareRevisions + +DESCRIPTION: + This function returns the device firmware (AMSS, boot, and PRI) + revisions + +PARAMETERS: + amssSize [ I ] - The maximum number of characters (including NULL + terminator) that the AMSS string array can contain + pAMSSString [ O ] - NULL terminated AMSS revision string + bootSize [ I ] - The maximum number of characters (including NULL + terminator) that the boot string array can contain + pBootString [ O ] - NULL terminated boot code revision string + priSize [ I ] - The maximum number of characters (including NULL + terminator) that the PRI string array can contain + pPRIString [ O ] - NULL terminated PRI revision string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareRevisions( + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetFirmwareRevisions( amssSize, + pAMSSString, + bootSize, + pBootString, + priSize, + pPRIString ); +} + +/*=========================================================================== +METHOD: + GetFirmwareInfo + +DESCRIPTION: + Returns image information obtained from the current device firmware + +PARAMETERS: + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetFirmwareInfo( + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetFirmwareInfo( pFirmwareID, + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); +} + +/*=========================================================================== +METHOD: + GetVoiceNumber + +DESCRIPTION: + This function returns the voice number in use by the device + +PARAMETERS: + voiceNumberSize [ I ] - The maximum number of characters (including NULL + terminator) that the voice number array can + contain + pVoiceNumber [ O ] - Voice number (MDN or ISDN) string + minSize [ I ] - The maximum number of characters (including NULL + terminator) that the MIN array can contain + pMIN [ O ] - MIN string (empty string returned when MIN is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetVoiceNumber( + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetVoiceNumber( voiceNumberSize, + pVoiceNumber, + minSize, + pMIN ); +} + +/*=========================================================================== +METHOD: + GetIMSI + +DESCRIPTION: + This function returns the device IMSI + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetIMSI( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetIMSI( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + GetSerialNumbers + +DESCRIPTION: + This command returns all serial numbers assigned to the device + +PARAMETERS: + esnSize [ I ] - The maximum number of characters (including NULL + terminator) that the ESN array can contain + pESNString [ O ] - ESN string (empty string returned when ESN is + not supported/programmed) + imeiSize [ I ] - The maximum number of characters (including NULL + terminator) that the IMEI array can contain + pIMEIString [ O ] - IMEI string (empty string returned when IMEI is + not supported/programmed) + meidSize [ I ] - The maximum number of characters (including NULL + terminator) that the MEID array can contain + pMEIDString [ O ] - MEID string (empty string returned when MEID is + not supported/programmed) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSerialNumbers( + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSerialNumbers( esnSize, + pESNString, + imeiSize, + pIMEIString, + meidSize, + pMEIDString ); +} + +/*=========================================================================== +METHOD: + SetLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + state [ I ] - Desired lock state + pCurrentPIN [ I ] - Current four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetLock( + ULONG state, + CHAR * pCurrentPIN ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetLock( state, pCurrentPIN ); +} + +/*=========================================================================== +METHOD: + QueryLock + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + pState [ O ] - Current lock state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG QueryLock( ULONG * pState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->QueryLock( pState ); +} + +/*=========================================================================== +METHOD: + ChangeLockPIN + +DESCRIPTION: + This command sets the user lock code maintained by the device + +PARAMETERS: + pCurrentPIN [ O ] - Current four digit PIN string + pDesiredPIN [ O ] - New four digit PIN string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ChangeLockPIN( + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->ChangeLockPIN( pCurrentPIN, pDesiredPIN ); +} + +/*=========================================================================== +METHOD: + GetHardwareRevision + +DESCRIPTION: + This function returns the device hardware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetHardwareRevision( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetHardwareRevision( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + GetPRLVersion + +DESCRIPTION: + This function returns the version of the active Preferred Roaming List + (PRL) in use by the device + +PARAMETERS: + pPRLVersion [ O ] - The PRL version number + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPRLVersion( WORD * pPRLVersion ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPRLVersion( pPRLVersion ); +} + +/*=========================================================================== +METHOD: + GetERIFile + +DESCRIPTION: + This command returns the ERI file that is stored in EFS on the device + +PARAMETERS: + pFileSize [I/O] - Upon input the maximum number of bytes that the file + contents array can contain. Upon successful output + the actual number of bytes written to the file contents + array + pFile [ O ] - The file contents + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetERIFile( + ULONG * pFileSize, + BYTE * pFile ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetERIFile( pFileSize, pFile ); +} + +/*=========================================================================== +METHOD: + ActivateAutomatic + +DESCRIPTION: + This function requests the device to perform automatic service activation + +PARAMETERS: + pActivationCode [ I ] - Activation code (maximum string length of 12) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ActivateAutomatic( CHAR * pActivationCode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->ActivateAutomatic( pActivationCode ); +} + +/*=========================================================================== +METHOD: + ActivateManual + +DESCRIPTION: + This function requests the device perform manual service activation + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + sid [ I ] - System identification number + pMDN [ I ] - Mobile Directory Number string + pMIN [ I ] - Mobile Identification Number string + prlSize [ I ] - (Optional) Size of PRL file array + pPRL [ I ] - (Optional) The PRL file contents + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ActivateManual( + CHAR * pSPC, + WORD sid, + CHAR * pMDN, + CHAR * pMIN, + ULONG prlSize, + BYTE * pPRL, + CHAR * pMNHA, + CHAR * pMNAAA ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->ActivateManual( pSPC, + sid, + pMDN, + pMIN, + prlSize, + pPRL, + pMNHA, + pMNAAA ); +} + +/*=========================================================================== +METHOD: + ResetToFactoryDefaults + +DESCRIPTION: + This function requests the device reset configuration to factory defaults + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetToFactoryDefaults( CHAR * pSPC ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->ResetToFactoryDefaults( pSPC ); +} + +/*=========================================================================== +METHOD: + GetActivationState + +DESCRIPTION: + This function returns the device activation state + +PARAMETERS: + pActivationState [ O ] - Service activation state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetActivationState( ULONG * pActivationState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetActivationState( pActivationState ); +} + +/*=========================================================================== +METHOD: + SetPower + +DESCRIPTION: + This function sets the operating mode of the device + +PARAMETERS: + powerMode [ I ] - Selected operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPower( ULONG powerMode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->SetPower( powerMode ); +} + +/*=========================================================================== +METHOD: + GetPower + +DESCRIPTION: + This function returns the operating mode of the device + +PARAMETERS: + pPowerMode [ O ] - Current operating mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPower( ULONG * pPowerMode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPower( pPowerMode ); +} + +/*=========================================================================== +METHOD: + GetOfflineReason + +DESCRIPTION: + This function returns the reason why the operating mode of the device + is currently offline + +PARAMETERS: + pReasonMask [ O ] - Bitmask of offline reasons + pbPlatform [ O ] - Offline due to being platform retricted? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetOfflineReason( + ULONG * pReasonMask, + ULONG * pbPlatform ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetOfflineReason( pReasonMask, pbPlatform ); +} + +/*=========================================================================== +METHOD: + GetNetworkTime + +DESCRIPTION: + This function returns the current time of the device + +PARAMETERS: + pTimeStamp [ O ] - Count of 1.25ms that have elapsed from the start + of GPS time (Jan 6, 1980) + pTimeSource [ O ] - Source of the timestamp + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetNetworkTime( + ULONGLONG * pTimeCount, + ULONG * pTimeSource ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetNetworkTime( pTimeCount, pTimeSource ); +} + +/*=========================================================================== +METHOD: + ValidateSPC + +DESCRIPTION: + This function validates the service programming code + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ValidateSPC( CHAR * pSPC ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->ValidateSPC( pSPC ); +} + +/*=========================================================================== +METHOD: + DeleteSMS + +DESCRIPTION: + This function deletes one or more SMS messages from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + pMessageIndex [ I ] - (Optional) message index + pMessageTag [ I ] - (Optional) message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DeleteSMS( + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->DeleteSMS( storageType, pMessageIndex, pMessageTag ); +} + +/*=========================================================================== +METHOD: + GetSMSList + +DESCRIPTION: + This function returns the list of SMS messages stored on the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + pRequestedTag [ I ] - Message index + pMessageListSize [I/O] - Upon input the maximum number of elements that the + message list array can contain. Upon successful + output the actual number of elements in the message + list array + pMessageList [ O ] - The message list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSList( + ULONG storageType, + ULONG * pRequestedTag, + ULONG * pMessageListSize, + BYTE * pMessageList ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSMSList( storageType, + pRequestedTag, + pMessageListSize, + pMessageList ); +} + +/*=========================================================================== +METHOD: + GetSMS + +DESCRIPTION: + This function returns an SMS message from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + pMessageTag [ O ] - Message tag + pMessageFormat [ O ] - Message format + pMessageSize [I/O] - Upon input the maximum number of bytes that can be + written to the message array. Upon successful + output the actual number of bytes written to the + message array + pMessage [ I ] - The message contents array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMS( + ULONG storageType, + ULONG messageIndex, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSMS( storageType, + messageIndex, + pMessageTag, + pMessageFormat, + pMessageSize, + pMessage ); +} + +/*=========================================================================== +METHOD: + ModifySMSStatus + +DESCRIPTION: + This function modifies the status of an SMS message saved in storage on + the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + messageTag [ I ] - Message tag + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ModifySMSStatus( + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return pAPI->ModifySMSStatus( storageType, messageIndex, messageTag ); +} + +/*=========================================================================== +METHOD: + SaveSMS + +DESCRIPTION: + This function saves an SMS message to device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageIndex [ O ] - The message index assigned by the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SaveSMS( + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageIndex ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SaveSMS( storageType, + messageFormat, + messageSize, + pMessage, + pMessageIndex ); +} + +/*=========================================================================== +METHOD: + SendSMS + +DESCRIPTION: + This function sends an SMS message for immediate over the air transmission + +PARAMETERS: + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageFailureCode [ O ] - When the function fails due to an error sending + the message this parameter may contain the + message failure cause code (see 3GPP2 N.S0005 + Section 6.5.2.125). If the cause code is not + provided then the value will be 0xFFFFFFFF + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SendSMS( + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageFailureCode ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SendSMS( messageFormat, + messageSize, + pMessage, + pMessageFailureCode ); +} + +/*=========================================================================== +METHOD: + GetSMSCAddress + +DESCRIPTION: + This function returns the SMS center address + +PARAMETERS: + addressSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address array + can contain + pSMSCAddress [ 0 ] - The SMS center address represented as a NULL + terminated string + typeSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address type array + can contain + pSMSCType [ 0 ] - The SMS center address type represented as a NULL + terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSCAddress( + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSMSCAddress( addressSize, + pSMSCAddress, + typeSize, + pSMSCType ); +} + +/*=========================================================================== +METHOD: + SetSMSCAddress + +DESCRIPTION: + This function sets the SMS center address + +PARAMETERS: + pSMSCAddress [ 0 ] - The SMS center address represented as a NULL + terminated string + pSMSCType [ 0 ] - The SMS center address type represented as a NULL + terminated string (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSCAddress( + CHAR * pSMSCAddress, + CHAR * pSMSCType ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetSMSCAddress( pSMSCAddress, pSMSCType ); +} + +/*=========================================================================== +METHOD: + GetSMSRoutes + +DESCRIPTION: + This function gets the current incoming SMS routing information + +PARAMETERS: + pRouteSize [I/O] - Upon input the maximum number of elements that the + SMS route array can contain. Upon succes the actual + number of elements in the SMS route array + pRoutes [ O ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSMSRoutes( pRouteSize, pRoutes ); +} + +/*=========================================================================== +METHOD: + SetSMSRoutes + +DESCRIPTION: + This function sets the desired incoming SMS routing information + +PARAMETERS: + pRouteSize [ I ] - The number of elements in the SMS route array + pRoutes [ I ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetSMSRoutes( pRouteSize, pRoutes ); +} + +/*=========================================================================== +METHOD: + UIMSetPINProtection + +DESCRIPTION: + This function enables or disables protection of UIM contents by a + given PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + bEnable [ I ] - Enable/disable PIN protection (0 = disable)? + pValue [ I ] - PIN value of the PIN to be enabled/disabled + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetPINProtection( + ULONG id, + ULONG bEnable, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMSetPINProtection( id, + bEnable, + pValue, + pVerifyRetriesLeft, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMVerifyPIN + +DESCRIPTION: + This function verifies the PIN before accessing the UIM contents + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pValue [ I ] - PIN value of the PIN to verify + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMVerifyPIN( + ULONG id, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMVerifyPIN( id, + pValue, + pVerifyRetriesLeft, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMUnblockPIN + +DESCRIPTION: + This function unblocks a blocked PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pPUKValue [ I ] - PUK value of the PIN to unblock + pNewValue [ I ] - New PIN value of the PIN to unblock + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockPIN( + ULONG id, + CHAR * pPUKValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMUnblockPIN( id, + pPUKValue, + pNewValue, + pVerifyRetriesLeft, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMChangePIN + +DESCRIPTION: + This function change the PIN value + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pOldValue [ I ] - Old PIN value of the PIN to change + pNewValue [ I ] - New PIN value of the PIN to change + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMChangePIN( + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMChangePIN( id, + pOldValue, + pNewValue, + pVerifyRetriesLeft, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMGetPINStatus + +DESCRIPTION: + This function returns the status of the pin + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pStatus [ O ] - PIN status (0xFFFFFFFF = unknown) + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetPINStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMGetPINStatus( id, + pStatus, + pVerifyRetriesLeft, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMGetICCID + +DESCRIPTION: + This function returns the UIM ICCID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetICCID( + BYTE stringSize, + CHAR * pString ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMGetICCID( stringSize, pString ); +} + +/*=========================================================================== +METHOD: + UIMGetControlKeyStatus + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetControlKeyStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMGetControlKeyBlockingStatus( id, + pStatus, + pVerifyRetriesLeft, + pUnblockRetriesLeft, + 0 ); +} + +/*=========================================================================== +METHOD: + UIMGetControlKeyBlockingStatus + +DESCRIPTION: + This function returns the blocking status of the specified facility + control key + +PARAMETERS: + id [ I ] - Facility ID + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + pbBlocking [ O ] - (Optional) Is the facility blocking? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMGetControlKeyBlockingStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMGetControlKeyBlockingStatus( id, + pStatus, + pVerifyRetriesLeft, + pUnblockRetriesLeft, + pbBlocking); +} + +/*=========================================================================== +METHOD: + UIMSetControlKeyProtection + +DESCRIPTION: + This function changes the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + status [ I ] - Control key status + pValue [ I ] - Control key de-personalization string + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + control key will be blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMSetControlKeyProtection( + ULONG id, + ULONG status, + CHAR * pValue, + ULONG * pVerifyRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMSetControlKeyProtection( id, + status, + pValue, + pVerifyRetriesLeft ); +} + +/*=========================================================================== +METHOD: + UIMUnblockControlKey + +DESCRIPTION: + This function unblocks the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pValue [ I ] - Control key de-personalization string + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UIMUnblockControlKey( + ULONG id, + CHAR * pValue, + ULONG * pUnblockRetriesLeft ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UIMUnblockControlKey( id, + pValue, + pUnblockRetriesLeft ); +} + +/*=========================================================================== +METHOD: + GetPDSState + +DESCRIPTION: + This function returns the current PDS state + +PARAMETERS: + pEnabled [ O ] - Current PDS state (0 = disabled) + pTracking [ O ] - Current PDS tracking session state + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPDSState( + ULONG * pEnabled, + ULONG * pTracking ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPDSState( pEnabled, pTracking ); +} + +/*=========================================================================== +METHOD: + SetPDSState + +DESCRIPTION: + This function sets the PDS state + +PARAMETERS: + enable [ I ] - Desired PDS state (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSState( ULONG enable ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPDSState( enable ); +} + +/*=========================================================================== +METHOD: + PDSInjectTimeReference + +DESCRIPTION: + This function injects a system time into the PDS engine + +PARAMETERS: + sysTime [ I ] - System time + sysDiscontinuities [ I ] - Number of system time discontinuities + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PDSInjectTimeReference( + ULONGLONG systemTime, + USHORT systemDiscontinuities ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->PDSInjectTimeReference( systemTime, + systemDiscontinuities ); +} + +/*=========================================================================== +METHOD: + GetPDSDefaults + +DESCRIPTION: + This function returns the default tracking session configuration + +PARAMETERS: + pOperation [ O ] - Current session operating mode + pTimeout [ O ] - Maximum amount of time (seconds) to work on each fix + pInterval [ O ] - Interval (milliseconds) between fix requests + pAccuracy [ O ] - Current accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPDSDefaults( + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPDSDefaults( pOperation, + pTimeout, + pInterval, + pAccuracy ); +} + +/*=========================================================================== +METHOD: + SetPDSDefaults + +DESCRIPTION: + This function sets the default tracking session configuration + +PARAMETERS: + operation [ I ] - Desired session operating mode + timeout [ I ] - Maximum amount of time (seconds) to work on each fix + interval [ I ] - Interval (milliseconds) between fix requests + accuracy [ I ] - Desired accuracy threshold (meters) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSDefaults( + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPDSDefaults( operation, + timeout, + interval, + accuracy ); +} + +/*=========================================================================== +METHOD: + GetXTRAAutomaticDownload + +DESCRIPTION: + This function returns the XTRA automatic download configuration + +PARAMETERS: + pbEnabled [ O ] - Automatic download enabled? + pInterval [ O ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRAAutomaticDownload( + ULONG * pbEnabled, + USHORT * pInterval ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetXTRAAutomaticDownload( pbEnabled, pInterval ); +} + +/*=========================================================================== +METHOD: + SetXTRAAutomaticDownload + +DESCRIPTION: + This function sets the XTRA automatic download configuration + +PARAMETERS: + bEnabled [ I ] - Automatic download enabled? + interval [ I ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRAAutomaticDownload( + ULONG bEnabled, + USHORT interval ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetXTRAAutomaticDownload( bEnabled, interval ); +} + +/*=========================================================================== +METHOD: + GetXTRANetwork + +DESCRIPTION: + This function returns the XTRA WWAN network preference + +PARAMETERS: + pPreference [ O ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRANetwork( ULONG * pPreference ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetXTRANetwork( pPreference ); +} + +/*=========================================================================== +METHOD: + SetXTRANetwork + +DESCRIPTION: + This function sets the XTRA WWAN network preference + +PARAMETERS: + preference [ I ] - XTRA WWAN network preference + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRANetwork( ULONG preference ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetXTRANetwork( preference ); +} + +/*=========================================================================== +METHOD: + GetXTRAValidity + +DESCRIPTION: + This function returns the XTRA database validity period + +PARAMETERS: + pGPSWeek [ O ] - Starting GPS week of validity period + pGPSWeekOffset [ O ] - Starting GPS week offset (minutes) of validity period + pDuration [ O ] - Length of validity period (hours) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRAValidity( + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetXTRAValidity( pGPSWeek, + pGPSWeekOffset, + pDuration ); +} + +/*=========================================================================== +METHOD: + ForceXTRADownload + +DESCRIPTION: + This function forces the XTRA database to be downloaded to the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ForceXTRADownload() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->ForceXTRADownload(); +} + +/*=========================================================================== +METHOD: + GetXTRADataState + +DESCRIPTION: + This function returns the XTRA data positioning state + +PARAMETERS: + pState [ O ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRADataState( ULONG * pState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetXTRADataState( pState ); +} + +/*=========================================================================== +METHOD: + SetXTRADataState + +DESCRIPTION: + This function sets the XTRA data positioning state + +PARAMETERS: + state [ I ] - XTRA data positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRADataState( ULONG state ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetXTRADataState( state ); +} + +/*=========================================================================== +METHOD: + GetXTRATimeState + +DESCRIPTION: + This function returns the XTRA time positioning state + +PARAMETERS: + pState [ O ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetXTRATimeState( ULONG * pState ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetXTRATimeState( pState ); +} + +/*=========================================================================== +METHOD: + SetXTRATimeState + +DESCRIPTION: + This function sets the XTRA time positioning state + +PARAMETERS: + state [ I ] - XTRA time positioning state + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetXTRATimeState( ULONG state ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetXTRATimeState( state ); +} + +/*=========================================================================== +METHOD: + GetAGPSConfig + +DESCRIPTION: + This function returns the PDS AGPS configuration + +PARAMETERS: + pServerAddress [ O ] - IPv4 address of AGPS server + pServerPort [ O ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetAGPSConfig( + ULONG * pServerAddress, + ULONG * pServerPort ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetAGPSConfig( pServerAddress, pServerPort ); +} + +/*=========================================================================== +METHOD: + SetAGPSConfig + +DESCRIPTION: + This function sets the PDS AGPS configuration + +PARAMETERS: + serverAddress [ I ] - IPv4 address of AGPS server + serverPort [ I ] - Port number of AGPS server + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetAGPSConfig( + ULONG serverAddress, + ULONG serverPort ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetAGPSConfig( serverAddress, serverPort ); +} + +/*=========================================================================== +METHOD: + GetServiceAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking state for the service + +PARAMETERS: + pbAuto [ O ] - Automatic tracking session started for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetServiceAutomaticTracking( ULONG * pbAuto ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetServiceAutomaticTracking( pbAuto ); +} + +/*=========================================================================== +METHOD: + SetServiceAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking state for the service + +PARAMETERS: + pbAuto [ I ] - Start automatic tracking session for service? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetServiceAutomaticTracking( ULONG bAuto ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetServiceAutomaticTracking( bAuto ); +} + +/*=========================================================================== +METHOD: + GetPortAutomaticTracking + +DESCRIPTION: + This function returns the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ O ] - Automatic tracking enabled for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetPortAutomaticTracking( ULONG * pbAuto ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetPortAutomaticTracking( pbAuto ); +} + +/*=========================================================================== +METHOD: + SetPortAutomaticTracking + +DESCRIPTION: + This function sets the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ I ] - Enable automatic tracking for NMEA COM port? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPortAutomaticTracking( ULONG bAuto ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPortAutomaticTracking( bAuto ); +} + +/*=========================================================================== +METHOD: + ResetPDSData + +DESCRIPTION: + This function resets the specified PDS data + +PARAMETERS: + pGPSDataMask [ I ] - Bitmask of GPS data to clear (optional) + pCellDataMask [ I ] - Bitmask of cell data to clear (optional) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetPDSData( + ULONG * pGPSDataMask, + ULONG * pCellDataMask ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->ResetPDSData( pGPSDataMask, pCellDataMask ); +} + +/*=========================================================================== +METHOD: + CATSendTerminalResponse + +DESCRIPTION: + This function sends the terminal response to the device + +PARAMETERS: + refID [ I ] - UIM reference ID (from CAT event) + dataLen [ I ] - Terminal response data length + pData [ I ] - Terminal response data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendTerminalResponse( + ULONG refID, + ULONG dataLen, + BYTE * pData ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->CATSendTerminalResponse( refID, dataLen, pData ); +} + +/*=========================================================================== +METHOD: + CATSendEnvelopeCommand + +DESCRIPTION: + This function sends the envelope command to the device + +PARAMETERS: + cmdID [ I ] - Envelope command ID + dataLen [ I ] - Envelope command data length + pData [ I ] - Envelope command data + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CATSendEnvelopeCommand( + ULONG cmdID, + ULONG dataLen, + BYTE * pData ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->CATSendEnvelopeCommand( cmdID, dataLen, pData ); +} + +/*=========================================================================== +METHOD: + GetSMSWake + +DESCRIPTION: + This function queries the state of the SMS wake functionality + +PARAMETERS: + pbEnabled [ O ] - SMS wake functionality enabled? + pWakeMask [ O ] - SMS wake mask (only relevant when enabled) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetSMSWake( + ULONG * pbEnabled, + ULONG * pWakeMask ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetSMSWake( pbEnabled, pWakeMask ); +} + +/*=========================================================================== +METHOD: + SetSMSWake + +DESCRIPTION: + This function enables/disables the SMS wake functionality + +PARAMETERS: + bEnable [ I ] - Enable SMS wake functionality? + wakeMask [ I ] - SMS wake mask (only relevant when enabling) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSMSWake( + ULONG bEnable, + ULONG wakeMask ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetSMSWake( bEnable, wakeMask ); +} + +/*=========================================================================== +METHOD: + OMADMStartSession + +DESCRIPTION: + This function starts an OMA-DM session + +PARAMETERS: + sessionType [ I ] - Type of session to initiate + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMStartSession( ULONG sessionType ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMStartSession( sessionType ); +} + +/*=========================================================================== +METHOD: + OMADMCancelSession + +DESCRIPTION: + This function cancels an ongoing OMA-DM session + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMCancelSession() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMCancelSession(); +} + +/*=========================================================================== +METHOD: + OMADMGetSessionInfo + +DESCRIPTION: + This function returns information related to the current (or previous + if no session is active) OMA-DM session + +PARAMETERS: + pSessionState [ O ] - State of session + pSessionType [ O ] - Type of session + pFailureReason [ O ] - Session failure reason (when state indicates failure) + pRetryCount [ O ] - Session retry count (when state indicates retrying) + pSessionPause [ O ] - Session pause timer (when state indicates retrying) + pTimeRemaining [ O ] - Pause time remaining (when state indicates retrying) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetSessionInfo( + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMGetSessionInfo( pSessionState, + pSessionType, + pFailureReason, + pRetryCount, + pSessionPause, + pTimeRemaining ); +} + +/*=========================================================================== +METHOD: + OMADMGetPendingNIA + +DESCRIPTION: + This function returns information about the pending network initiated + alert + +PARAMETERS: + pSessionType [ O ] - Type of session + pSessionID [ O ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetPendingNIA( + ULONG * pSessionType, + USHORT * pSessionID ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMGetPendingNIA( pSessionType, pSessionID ); +} + +/*=========================================================================== +METHOD: + OMADMSendSelection + +DESCRIPTION: + This function sends the specified OMA-DM selection for the current + network initiated session + +PARAMETERS: + selection [ I ] - Selection + sessionID [ I ] - Unique session ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSendSelection( + ULONG selection, + USHORT sessionID ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMSendSelection( selection, sessionID ); +} + +/*=========================================================================== +METHOD: + OMADMGetFeatureSettings + +DESCRIPTION: + This function returns the OMA-DM feature settings + +PARAMETERS: + pbProvisioning [ O ] - Device provisioning service update enabled + pbPRLUpdate [ O ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMGetFeatureSettings( + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMGetFeatureSettings( pbProvisioning, + pbPRLUpdate ); +} + +/*=========================================================================== +METHOD: + OMADMSetProvisioningFeature + +DESCRIPTION: + This function sets the OMA-DM device provisioning service + update feature setting + +PARAMETERS: + bProvisioning [ I ] - Device provisioning service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSetProvisioningFeature( + ULONG bProvisioning ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMSetProvisioningFeature( bProvisioning ); +} + +/*=========================================================================== +METHOD: + OMADMSetPRLUpdateFeature + +DESCRIPTION: + This function sets the OMA-DM PRL service update feature setting + +PARAMETERS: + bPRLUpdate [ I ] - PRL service update enabled + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OMADMSetPRLUpdateFeature( + ULONG bPRLUpdate ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OMADMSetPRLUpdateFeature( bPRLUpdate ); +} + +/*=========================================================================== +METHOD: + OriginateUSSD + +DESCRIPTION: + This function initiates a USSD operation + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OriginateUSSD( BYTE * pInfo ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->OriginateUSSD( pInfo ); +} + +/*=========================================================================== +METHOD: + AnswerUSSD + +DESCRIPTION: + This function responds to a USSD request from the network + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG AnswerUSSD( BYTE * pInfo ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->AnswerUSSD( pInfo ); +} + +/*=========================================================================== +METHOD: + CancelUSSD + +DESCRIPTION: + This function cancels an in-progress USSD operation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CancelUSSD() +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->CancelUSSD(); +} + +/*=========================================================================== +METHOD: + UpgradeFirmware + +DESCRIPTION: + This function performs the following set of steps: + a) Verifies arguments + b) Updates firmware ID on device + c) Resets the device + + NOTE: Upon successful completion the above steps will have been completed, + however the actual upgrade of the firmware will necessarily then + follow. + +PARAMETERS: + pDestinationPath [ I ] - The fully qualified path to the destination folder + that the firmware download service will use + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG UpgradeFirmware( CHAR * pDestinationPath ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->UpgradeFirmware( pDestinationPath ); +} + +/*=========================================================================== +METHOD: + GetImageInfo + +DESCRIPTION: + Returns image information obtained from the firmware image located at the + provided path + +PARAMETERS: + pPath [ I ] - Location of the firmware image + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImageInfo( + CHAR * pPath, + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetImageInfo( pPath, + pFirmwareID, + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); +} + +/*=========================================================================== +METHOD: + GetImageStore + +DESCRIPTION: + Returns the image store folder, i.e. the folder co-located with the + QDL Service executable which (by default) contains one or more carrier + specific image subfolders + +PARAMETERS: + pathSize [ I ] - Maximum number of characters (including NULL + terminator) that can be copied to the image + store path array + pImageStorePath [ O ] - The path to the image store + + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImageStore( + WORD pathSize, + CHAR * pImageStorePath ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetImageStore( pathSize, pImageStorePath ); +} + +/*=========================================================================== +METHOD: + SetSessionStateCallback + +DESCRIPTION: + This function enables/disables the session state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSessionStateCallback( tFNSessionState pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetSessionStateCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetByteTotalsCallback + +DESCRIPTION: + This function enables/disables the RX/TX byte counts callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + interval [ I ] - Interval in seconds (ignored when disabling) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetByteTotalsCallback( + tFNByteTotals pCallback, + BYTE interval ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetByteTotalsCallback( pCallback, interval ); +} + +/*=========================================================================== +METHOD: + SetDataCapabilitiesCallback + +DESCRIPTION: + This function enables/disables the serving system data capabilities + callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDataCapabilitiesCallback( + tFNDataCapabilities pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetDataCapabilitiesCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetDataBearerCallback + +DESCRIPTION: + This function enables/disables the data bearer status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDataBearerCallback( tFNDataBearer pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetDataBearerCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetDormancyStatusCallback + +DESCRIPTION: + This function enables/disables the dormancy status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDormancyStatusCallback( + tFNDormancyStatus pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetDormancyStatusCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetMobileIPStatusCallback + +DESCRIPTION: + This function enables/disables the mobile IP status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetMobileIPStatusCallback( + tFNMobileIPStatus pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetMobileIPStatusCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetActivationStatusCallback + +DESCRIPTION: + This function enables/disables the activation status callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetActivationStatusCallback( + tFNActivationStatus pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetActivationStatusCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetPowerCallback + +DESCRIPTION: + Enable/disable power operating mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPowerCallback( tFNPower pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPowerCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetWirelessDisableCallback + +DESCRIPTION: + Enable/disable wireless disable state callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetWirelessDisableCallback( + tFNWirelessDisable pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetWirelessDisableCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetRoamingIndicatorCallback + +DESCRIPTION: + This function enables/disables the roaming indicator callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetRoamingIndicatorCallback( + tFNRoamingIndicator pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetRoamingIndicatorCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetSignalStrengthCallback + +DESCRIPTION: + This function enables/disables the signal strength callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + thresholdsSize [ I ] - Number of elements the threshold array contain + (a maximum of 5 thresholds is supported), must + be 0 when disabling the callback + pThresholds [ I ] - Signal threshold array (each entry in dBm), + must be 0 when disabling the callback + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetSignalStrengthCallback( + tFNSignalStrength pCallback, + BYTE thresholdsSize, + INT8 * pThresholds ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + if (thresholdsSize > 0 && pThresholds == 0) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + std::list thresholdsList; + for (BYTE t = 0; t < thresholdsSize; t++) + { + thresholdsList.push_back( pThresholds[t] ); + } + + return (ULONG)pAPI->SetSignalStrengthCallback( pCallback, thresholdsList ); +} + +/*=========================================================================== +METHOD: + SetRFInfoCallback + +DESCRIPTION: + This function enables/disables the RF information callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetRFInfoCallback( tFNRFInfo pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetRFInfoCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetLURejectCallback + +DESCRIPTION: + This function enables/disables the LU reject callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetLURejectCallback( tFNLUReject pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetLURejectCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetPLMNModeCallback + +DESCRIPTION: + Enable/disable PLMN mode callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPLMNModeCallback( tFNPLMNMode pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPLMNModeCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetNewSMSCallback + +DESCRIPTION: + This function enables/disables the new SMS callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNewSMSCallback( tFNNewSMS pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetNewSMSCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetNMEACallback + +DESCRIPTION: + This function enables/disables the NMEA sentence callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetNMEACallback( tFNNewNMEA pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetNMEACallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetPDSStateCallback + +DESCRIPTION: + This function enables/disables the PDS service state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetPDSStateCallback( tFNPDSState pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetPDSStateCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetCATEventCallback + +DESCRIPTION: + This function enables/disables the CAT event callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + eventMask [ I ] - Bitmask of CAT events to register for + pErrorMask [ O ] - Error bitmask + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetCATEventCallback( + tFNCATEvent pCallback, + ULONG eventMask, + ULONG * pErrorMask ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetCATEventCallback( pCallback, eventMask, pErrorMask ); +} + +/*=========================================================================== +METHOD: + SetOMADMAlertCallback + +DESCRIPTION: + This function enables/disables the OMA-DM network initiated alert + callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetOMADMAlertCallback( tFNOMADMAlert pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetOMADMAlertCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetOMADMStateCallback + +DESCRIPTION: + This function enables/disables the OMA-DM state callback function + +PARAMETERS: + pCallback [ I ] - Callback function (0 = disable) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetOMADMStateCallback( tFNOMADMState pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetOMADMStateCallback( pCallback ); +} + +#ifdef VOICE_SUPPORT +/*=========================================================================== +METHOD: + SetUSSDReleaseCallback + +DESCRIPTION: + Enable/disable USSD release callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDReleaseCallback( + tFNUSSDRelease pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetUSSDReleaseCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetUSSDNotificationCallback + +DESCRIPTION: + Enable/disable USSD notification callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDNotificationCallback( + tFNUSSDNotification pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetUSSDNotificationCallback( pCallback ); +} + +/*=========================================================================== +METHOD: + SetUSSDOriginationCallback + +DESCRIPTION: + Enable/disable USSD origination callback function + +PARAMETERS: + pCallback [ I ] - Callback function + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetUSSDOriginationCallback( + tFNUSSDOrigination pCallback ) +{ + cGobiConnectionMgmt * pAPI = gConnectionDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetUSSDOriginationCallback( pCallback ); +} +#endif + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/Makefile.am b/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/Makefile.am new file mode 100644 index 0000000..afa6b8c --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiConnectionMgmt/Makefile.am @@ -0,0 +1,32 @@ +INCLUDES = \ + -I$(top_srcdir)/Core \ + -I$(top_srcdir)/Shared + +lib_LTLIBRARIES = libGobiConnectionMgmt.la + +libGobiConnectionMgmt_la_CPPFLAGS = \ + -D WDS_SUPPORT \ + -D DMS_SUPPORT \ + -D NAS_SUPPORT \ + -D PDS_SUPPORT \ + -D CAT_SUPPORT \ + -D RMS_SUPPORT \ + -D OMA_SUPPORT \ + -D UIM_SUPPORT \ + -D WMS_SUPPORT \ + -D IMG2K_SUPPORT \ + -D IMG_SUPPORT \ + -D VOICE_SUPPORT + +libGobiConnectionMgmt_la_SOURCES = \ + GobiConnectionMgmtAPI.h \ + GobiConnectionMgmt.cpp \ + GobiConnectionMgmt.h \ + GobiConnectionMgmtExports.cpp + +libGobiConnectionMgmt_la_LIBADD = \ + $(top_builddir)/Database/QMI/libQMIDB.la \ + $(top_builddir)/Shared/libShared.la \ + $(top_builddir)/Core/libCore.la \ + -lpthread + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmt.cpp b/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmt.cpp new file mode 100755 index 0000000..8769be0 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmt.cpp @@ -0,0 +1,315 @@ +/*=========================================================================== +FILE: + GobiQMIImageMgmt.cpp + +DESCRIPTION: + QUALCOMM Image Management API for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + cGobiImageMgmtDLL + cGobiImageMgmt + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiImageMgmt.h" + +#include "QMIBuffers.h" +#include "QDLBuffers.h" + + +// Global object +cGobiImageMgmtDLL gImageDLL; + +/*=========================================================================*/ +// cGobiImageMgmtDLL Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiImageMgmtDLL (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiImageMgmtDLL::cGobiImageMgmtDLL() + : mpAPI( 0 ), + mbAllocated( false ) +{ + // Create sync CS + pthread_mutex_init( &mSyncSection, NULL ); +} + +/*=========================================================================== +METHOD: + ~cGobiImageMgmtDLL (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiImageMgmtDLL::~cGobiImageMgmtDLL() +{ + // Just in case + if (mpAPI != 0) + { + mpAPI->Cleanup(); + delete mpAPI; + mpAPI = 0; + } + + pthread_mutex_destroy( &mSyncSection ); +} + +/*=========================================================================== +METHOD: + GetAPI (Public Method) + +DESCRIPTION: + Return the cGobiImageMgmt object + +RETURN VALUE: + cGobiImageMgmt * +===========================================================================*/ +cGobiImageMgmt * cGobiImageMgmtDLL::GetAPI() +{ + pthread_mutex_lock( &mSyncSection ); + + bool bAlloc = mbAllocated; + + pthread_mutex_unlock( &mSyncSection ); + + if (bAlloc == true) + { + return mpAPI; + } + + pthread_mutex_lock( &mSyncSection ); + + mpAPI = new cGobiImageMgmt; + if (mpAPI != 0) + { + bool bAPI = mpAPI->Initialize(); + if (bAPI == false) + { + delete mpAPI; + mpAPI = 0; + } + } + + // We have tried to allocate/initialize the object + mbAllocated = true; + + pthread_mutex_unlock( &mSyncSection ); + return mpAPI; +} + +/*=========================================================================*/ +// cGobiImageMgmt Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiImageMgmt (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiImageMgmt::cGobiImageMgmt() + : cGobiQMICore(), + mTargetDeviceNode( "" ), + mTargetDeviceKey( "" ), + mQDL() +{ + // We require a DMS server + tServerConfig dmsSvr( eQMI_SVC_DMS, true ); + mServerConfig.insert( dmsSvr ); +} + +/*=========================================================================== +METHOD: + ~cGobiImageMgmt (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiImageMgmt::~cGobiImageMgmt() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiImageMgmt::Initialize() +{ + bool bRC = cGobiQMICore::Initialize(); + if (bRC == false) + { + return bRC; + } + + bRC = mQDL.Initialize(); + return bRC; +} + +/*=========================================================================== +METHOD: + Cleanup (Public Method) + +DESCRIPTION: + Cleanup the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiImageMgmt::Cleanup() +{ + mQDL.Cleanup(); + return cGobiQMICore::Cleanup(); +} + +/*=========================================================================== +METHOD: + GetDeviceID (Public Method) + +DESCRIPTION: + Set the ID of the device to target + +PARAMETERS: + deviceID [ I ] - The device ID as reported by Windows + deviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + void +===========================================================================*/ +void cGobiImageMgmt::GetDeviceID( + std::string & deviceID, + std::string & deviceKey ) +{ + deviceID = mTargetDeviceNode; + deviceKey = mTargetDeviceKey; +} + +/*=========================================================================== +METHOD: + SetDeviceID (Public Method) + +DESCRIPTION: + Set the ID of the device to target + +PARAMETERS: + pDeviceID [ I ] - The device ID as reported by Windows + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiImageMgmt::SetDeviceID( + LPCSTR pDeviceID, + LPCSTR pDeviceKey ) +{ + // Clear last error recorded + ClearLastError(); + + // If you specify a device key then you have to specify a device ID + if (pDeviceID == 0 && pDeviceKey != 0) + { + mLastError = eGOBI_ERR_INVALID_ARG; + return false; + } + + if (pDeviceID == 0 || pDeviceID[0] == 0) + { + mTargetDeviceNode.clear(); + mTargetDeviceKey.clear(); + } + else + { + mTargetDeviceNode = pDeviceID; + if (pDeviceKey == 0 || pDeviceKey[0] == 0) + { + mTargetDeviceKey.clear(); + } + else + { + mTargetDeviceKey = pDeviceKey; + } + } + + return true; +} + +/*=========================================================================== +METHOD: + ResetDevice (Public Method) + +DESCRIPTION: + This function resets the device + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiImageMgmt::ResetDevice() +{ + WORD msgID = (WORD)eQMI_DMS_SET_OPERATING_MODE; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, "5" ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmt.h b/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmt.h new file mode 100755 index 0000000..a14132e --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmt.h @@ -0,0 +1,186 @@ +/*=========================================================================== +FILE: + GobiImageMgmt.h + +DESCRIPTION: + QUALCOMM Image Management API for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + cGobiImageMgmtDLL + cGobiImageMgmt + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiQMICore.h" +#include "GobiQDLCore.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cGobiImageMgmt +/*=========================================================================*/ +class cGobiImageMgmt : public cGobiQMICore +{ + public: + // Constructor + cGobiImageMgmt(); + + // Destructor + virtual ~cGobiImageMgmt(); + + // Initialize the object + virtual bool Initialize(); + + // Cleanup the object + virtual bool Cleanup(); + + // Get the ID of the device to target + void GetDeviceID( + std::string & deviceID, + std::string & deviceKey ); + + // Set the ID of the device to target + bool SetDeviceID( + LPCSTR pDeviceID = 0, + LPCSTR pDeviceKey = 0 ); + + // This function resets the device + eGobiError ResetDevice(); + + // (Inline) Return the set of available Gobi QDL ports + std::vector GetAvailableQDLPorts() + { + return mQDL.GetAvailableQDLPorts(); + }; + + // (Inline) Set the timeout for QDL transactions + eGobiError SetQDLTimeout( ULONG to ) + { + return mQDL.SetQDLTimeout( to ); + }; + + // (Inline) Open the specified QDL port of the device + eGobiError OpenQDLPort( + std::string & portID, + ULONG bBARMode, + ULONG * pMajorVersion, + ULONG * pMinorVersion ) + { + return mQDL.OpenQDLPort( portID, + bBARMode, + pMajorVersion, + pMinorVersion ); + }; + + // (Inline) Close the specified QDL port of the device + eGobiError CloseQDLPort( bool bInformDevice ) + { + return mQDL.CloseQDLPort( bInformDevice ); + }; + + // (Inline) Get the images preference as from the device boot downloader + eGobiError GetQDLImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ) + { + return mQDL.GetQDLImagesPreference( pImageListSize, pImageList ); + }; + + // (Inline) Prepare the device boot downloader for an image write + eGobiError PrepareQDLImageWrite( + BYTE imageType, + ULONG imageSize, + ULONG * pBlockSize ) + { + return mQDL.PrepareQDLImageWrite( imageType, imageSize, pBlockSize ); + }; + + // (Inline) Write the specified image block to the device + eGobiError WriteQDLImageBlock( + USHORT sequenceNumber, + ULONG chunkSize, + BYTE * pImageBlock ) + { + return mQDL.WriteQDLImageBlock( sequenceNumber, + chunkSize, + pImageBlock ); + }; + + // (Inline) Request the device validate the written images + eGobiError ValidateQDLImages( BYTE * pImageType ) + { + return mQDL.ValidateQDLImages( pImageType ); + }; + + protected: + /* Device node/key of the device to target */ + std::string mTargetDeviceNode; + std::string mTargetDeviceKey; + + /* QDL protocol server */ + cGobiQDLCore mQDL; +}; + +/*=========================================================================*/ +// Class cGobiImageMgmtDLL +/*=========================================================================*/ +class cGobiImageMgmtDLL +{ + public: + // Constructor + cGobiImageMgmtDLL(); + + // Destructor + virtual ~cGobiImageMgmtDLL(); + + // Return the GobiImageMgmt object + cGobiImageMgmt * GetAPI(); + + protected: + /* API interface object */ + cGobiImageMgmt * mpAPI; + + /* Above object allocation attempted? */ + bool mbAllocated; + + /* Synchronization object */ + mutable pthread_mutex_t mSyncSection; +}; + +extern cGobiImageMgmtDLL gImageDLL; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmtAPI.h b/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmtAPI.h new file mode 100755 index 0000000..93e2a43 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmtAPI.h @@ -0,0 +1,403 @@ +/*=========================================================================== +FILE: + GobiImageMgmtAPI.h + +DESCRIPTION: + QUALCOMM Image Management API for Gobi 3000 + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +#include "types.h" + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +/*=========================================================================*/ +// Definitions +/*=========================================================================*/ + +#ifdef __cplusplus + extern "C" { +#endif + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GobiEnumerateDevices + +DESCRIPTION: + This function enumerates the Gobi devices currently attached to the + system + +PARAMETERS: + pDevicesSize [I/O] - Upon input the maximum number of elements that the + device array can contain. Upon successful output + the actual number of elements in the device array + pDevices [ O ] - The device array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiEnumerateDevices( + BYTE * pDevicesSize, + BYTE * pDevices ); + +/*=========================================================================== +METHOD: + SetDeviceID + +DESCRIPTION: + This function sets the ID of the device to target + +PARAMETERS: + pDeviceID [ I ] - The device ID as reported by Windows + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDeviceID( + CHAR * pDeviceID, + CHAR * pDeviceKey ); + +/*=========================================================================== +METHOD: + GetImagesPreference + +DESCRIPTION: + This function gets the current images preference + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ); + +/*=========================================================================== +METHOD: + SetImagesPreference + +DESCRIPTION: + This function sets the current images preference + +PARAMETERS: + imageListSize [ I ] - The size in BYTEs of the image list array + pImageList [ I ] - The image list array + bForceDownload [ I ] - Force device to download images from host? + modemIndex [ I ] - Desired storage index for downloaded modem image + pImageTypesSize [I/O] - Upon input the maximum number of elements that + the download image types array can contain. + Upon successful output the actual number of + elements in the download image types array + pImageTypes [ O ] - The download image types array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetImagesPreference( + ULONG imageListSize, + BYTE * pImageList, + ULONG bForceDownload, + BYTE modemIndex, + ULONG * pImageTypesSize, + BYTE * pImageTypes ); + +/*=========================================================================== +METHOD: + GetBARMode + +DESCRIPTION: + This function returns the boot and recovery image download mode + +PARAMETERS: + pBARMode [ O ] - Boot and recovery image download mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetBARMode( ULONG * pBARMode ); + +/*=========================================================================== +METHOD: + SetBARMode + +DESCRIPTION: + This function requests the device enter boot and recovery image download + mode after the next reset + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetBARMode(); + +/*=========================================================================== +METHOD: + GetStoredImages + +DESCRIPTION: + This function gets the list of images stored on the device + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetStoredImages( + ULONG * pImageListSize, + BYTE * pImageList ); + +/*=========================================================================== +METHOD: + GetStoredImageInfo + +DESCRIPTION: + This function returns info about the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + pMajorVersion [ O ] - Major version of compatible boot downloader + pMinorVersion [ O ] - Minor version of compatible boot downloader + pVersionID [ O ] - Image version ID + pInfo [ O ] - Image info string + pLockID [ O ] - Image OEM lock ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetStoredImageInfo( + ULONG imageInfoSize, + BYTE * pImageInfo, + ULONG * pMajorVersion, + ULONG * pMinorVersion, + ULONG * pVersionID, + CHAR * pInfo, + ULONG * pLockID ); + +/*=========================================================================== +METHOD: + DeleteStoredImage + +DESCRIPTION: + This function deletes the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DeleteStoredImage( + ULONG imageInfoSize, + BYTE * pImageInfo ); + +/*=========================================================================== +METHOD: + ResetDevice + +DESCRIPTION: + This function resets the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetDevice(); + +/*=========================================================================== +METHOD: + GobiEnumerateQDLPorts + +DESCRIPTION: + This function enumerates the Gobi QDL port IDs currently attached to the + system + +PARAMETERS: + pPortSize [I/O] - Upon input the maximum number of elements that the + port ID array can contain. Upon successful output + the actual number of elements in the port ID array + pPorts [ O ] - Port ID array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiEnumerateQDLPorts( + BYTE * pPortSize, + BYTE * pPorts ); + +/*=========================================================================== +METHOD: + SetQDLTimeout + +DESCRIPTION: + This function sets the timeout for all subsequent QDL transactions + +PARAMETERS: + to [ O ] - Timeout (in milliseconds) for subsequent transactions + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetQDLTimeout( ULONG to ); + +/*=========================================================================== +METHOD: + OpenQDLPort + +DESCRIPTION: + This function opens the specified QDL port of the device + +PARAMETERS: + pPortID [ I ] - ID of QDL port to connect to + bBARMode [ I ] - Request boot and recovery mode feature + pMajorVersion [ O ] - Major version of the device boot downloader + pMinorVersion [ O ] - Minor version of the device boot downloader + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OpenQDLPort( + CHAR * pPortID, + ULONG bBARMode, + ULONG * pMajorVersion, + ULONG * pMinorVersion ); + +/*=========================================================================== +METHOD: + CloseQDLPort + +DESCRIPTION: + This function closes the currently open QDL port of the device + +PARAMETERS: + bInformDevice [ I ] - Inform device that QDL port is being closed? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CloseQDLPort( ULONG bInformDevice ); + +/*=========================================================================== +METHOD: + GetQDLImagesPreference + +DESCRIPTION: + This function gets the current images preference as reported by the + device boot downloader + +PARAMETERS: + pImageListSize [I/O] - Upon input the maximum number of elements that the + image info list can contain. Upon successful output + the actual number of elements in the image info list + pImageList [ O ] - The image info list + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetQDLImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ); + +/*=========================================================================== +METHOD: + PrepareQDLImageWrite + +DESCRIPTION: + This function prepares the device boot downloader for an image write + +PARAMETERS: + imageType [ I ] - Type of image being written + imageSize [ I ] - Size of image being written + pBlockSize [I/O] - Upon input the maximum size of image block supported + by host, upon successful output the maximum size of + image block supported by device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PrepareQDLImageWrite( + BYTE imageType, + ULONG imageSize, + ULONG * pBlockSize ); + +/*=========================================================================== +METHOD: + WriteQDLImageBlock + +DESCRIPTION: + This function writes the specified image block to the device + +PARAMETERS: + sequenceNumber [ I ] - Sequence number for image write + blockSize [ I ] - Size of image block + pImageBlock [ I ] - Image block + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WriteQDLImageBlock( + USHORT sequenceNumber, + ULONG blockSize, + BYTE * pImageBlock ); + +/*=========================================================================== +METHOD: + ValidateQDLImages + +DESCRIPTION: + This function requests the device validate the written images + +PARAMETERS: + pImageType [ O ] - Upon failure this may contain the type of the image + that failed validation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ValidateQDLImages( BYTE * pImageType ); + +#ifdef __cplusplus + }; +#endif diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmtExports.cpp b/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmtExports.cpp new file mode 100755 index 0000000..d1a8555 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/GobiImageMgmtExports.cpp @@ -0,0 +1,923 @@ +/*=========================================================================== +FILE: + GobiImageMgmtExports.cpp + +DESCRIPTION: + QUALCOMM Image Management API for Gobi 3000 exports + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "GobiImageMgmt.h" +#include "GobiImageMgmtAPI.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum length for adapter device path +const ULONG MAX_DI_DEVICE_PATH = 256; + +// Maximum length for adapter key +const ULONG MAX_DI_KEY = 16; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sDeviceInfo +// Struct to represent Gobi device info +/*=========================================================================*/ +struct sDeviceInfoElement +{ + public: + CHAR mPath[MAX_DI_DEVICE_PATH]; + CHAR mKey[MAX_DI_KEY]; +}; + +/*=========================================================================*/ +// Struct sPortInfo +// Struct to represent Gobi QDL port info +/*=========================================================================*/ +struct sPortInfoElement +{ + public: + CHAR mPath[MAX_DI_DEVICE_PATH]; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// Exported Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GobiEnumerateDevices + +DESCRIPTION: + This function enumerates the Gobi devices currently attached to the + system + +PARAMETERS: + pDevicesSize [I/O] - Upon input the maximum number of elements that the + device array can contain. Upon successful output + the actual number of elements in the device array + pDevices [ O ] - The device array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiEnumerateDevices( + BYTE * pDevicesSize, + BYTE * pDevices ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + // Validate arguments + if (pDevicesSize == 0 || pDevices == 0) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxInstances = *pDevicesSize; + *pDevicesSize = 0; + + // Obtain adapter info + std::vector adapters; + adapters = pAPI->GetAvailableDevices(); + + ULONG sz = (ULONG)adapters.size(); + if (sz > (ULONG)maxInstances) + { + sz = (ULONG)maxInstances; + } + + sDeviceInfoElement * pOutput = (sDeviceInfoElement *)pDevices; + for (ULONG a = 0; a < sz; a++) + { + const cGobiQMICore::tDeviceID & id = adapters[a]; + + memset( &pOutput->mPath[0], 0, (SIZE_T)MAX_DI_DEVICE_PATH ); + memset( &pOutput->mKey[0], 0, (SIZE_T)MAX_DI_KEY ); + + ULONG len = id.first.size(); + if (len > 0) + { + if (len >= MAX_DI_DEVICE_PATH) + { + len = MAX_DI_DEVICE_PATH - 1; + } + + LPCSTR pStr = (LPCSTR)id.first.c_str(); + memcpy( (LPVOID)&pOutput->mPath[0], + (LPCVOID)pStr, + (SIZE_T)len ); + } + + len = id.second.size(); + if (len > 0) + { + if (len >= MAX_DI_KEY) + { + len = MAX_DI_KEY - 1; + } + + LPCSTR pStr = (LPCSTR)id.second.c_str(); + memcpy( (LPVOID)&pOutput->mKey[0], + (LPCVOID)pStr, + (SIZE_T)len ); + } + + pOutput++; + } + + *pDevicesSize = (BYTE)sz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetDeviceID + +DESCRIPTION: + This function sets the ID of the device to target + +PARAMETERS: + pDeviceID [ I ] - The device ID as reported by Windows + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetDeviceID( + CHAR * pDeviceID, + CHAR * pDeviceKey ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + bool bOK = pAPI->SetDeviceID( pDeviceID, pDeviceKey ); + if (bOK == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + return (ULONG)eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetImagesPreference + +DESCRIPTION: + This function gets the current images preference + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->GetImagesPreference( pImageListSize, + pImageList ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + SetImagesPreference + +DESCRIPTION: + This function sets the current images preference + +PARAMETERS: + imageListSize [ I ] - The size in BYTEs of the image list array + pImageList [ I ] - The image list array + bForceDownload [ I ] - Force device to download images from host? + modemIndex [ I ] - Desired storage index for downloaded modem image + pImageTypesSize [I/O] - Upon input the maximum number of elements that + the download image types array can contain. + Upon successful output the actual number of + elements in the download image types array + pImageTypes [ O ] - The download image types array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetImagesPreference( + ULONG imageListSize, + BYTE * pImageList, + ULONG bForceDownload, + BYTE modemIndex, + ULONG * pImageTypesSize, + BYTE * pImageTypes ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->SetImagesPreference( imageListSize, + pImageList, + bForceDownload, + modemIndex, + pImageTypesSize, + pImageTypes ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + GetBARMode + +DESCRIPTION: + This function returns the boot and recovery image download mode + +PARAMETERS: + pBARMode [ O ] - Boot and recovery image download mode + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetBARMode( ULONG * pBARMode ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->GetBARMode( pBARMode ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + SetBARMode + +DESCRIPTION: + This function requests the device enter boot and recovery image download + mode after the next reset + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetBARMode() +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->SetBARMode(); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + GetStoredImages + +DESCRIPTION: + This function gets the list of images stored on the device + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetStoredImages( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->GetStoredImages( pImageListSize, + pImageList ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + GetStoredImageInfo + +DESCRIPTION: + This function returns info about the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + pMajorVersion [ O ] - Major version of compatible boot downloader + pMinorVersion [ O ] - Minor version of compatible boot downloader + pVersionID [ O ] - Image version ID + pInfo [ O ] - Image info string + pLockID [ O ] - Image OEM lock ID + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetStoredImageInfo( + ULONG imageInfoSize, + BYTE * pImageInfo, + ULONG * pMajorVersion, + ULONG * pMinorVersion, + ULONG * pVersionID, + CHAR * pInfo, + ULONG * pLockID ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->GetStoredImageInfo( imageInfoSize, + pImageInfo, + pMajorVersion, + pMinorVersion, + pVersionID, + pInfo, + pLockID ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + DeleteStoredImage + +DESCRIPTION: + This function deletes the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG DeleteStoredImage( + ULONG imageInfoSize, + BYTE * pImageInfo ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->DeleteStoredImage( imageInfoSize, + pImageInfo ); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + ResetDevice + +DESCRIPTION: + This function resets the device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ResetDevice() +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string devID; + std::string devKey; + pAPI->GetDeviceID( devID, devKey ); + + LPCSTR pID = 0; + if (devID.size() > 0) + { + pID = (LPCSTR)devID.c_str(); + } + + LPCSTR pKey = 0; + if (devKey.size() > 0) + { + pKey = (LPCSTR)devKey.c_str(); + } + + bool bConnect = pAPI->Connect( pID, pKey ); + if (bConnect == false) + { + return (ULONG)pAPI->GetCorrectedLastError(); + } + + ULONG rc = (ULONG)pAPI->ResetDevice(); + + pAPI->Disconnect(); + return rc; +} + +/*=========================================================================== +METHOD: + GobiEnumerateQDLPorts + +DESCRIPTION: + This function enumerates the Gobi QDL port IDs currently attached to the + system + +PARAMETERS: + pPortSize [I/O] - Upon input the maximum number of elements that the + port ID array can contain. Upon successful output + the actual number of elements in the port ID array + pPorts [ O ] - Port ID array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GobiEnumerateQDLPorts( + BYTE * pPortSize, + BYTE * pPorts ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + // Validate arguments + if (pPortSize == 0 || *pPortSize == 0 || pPorts == 0) + { + return (ULONG)eGOBI_ERR_INVALID_ARG; + } + + BYTE maxPorts = *pPortSize; + *pPortSize = 0; + + std::vector ports = pAPI->GetAvailableQDLPorts(); + ULONG portCount = (ULONG)ports.size(); + if (portCount > maxPorts) + { + portCount = (ULONG)maxPorts; + } + + sPortInfoElement * pOutput = (sPortInfoElement *)pPorts; + for (ULONG a = 0; a < portCount; a++) + { + memset( &pOutput->mPath[0], 0, (SIZE_T)MAX_DI_DEVICE_PATH ); + + ULONG len = ports[a].size(); + if (len > 0) + { + if (len >= MAX_DI_DEVICE_PATH) + { + len = MAX_DI_DEVICE_PATH - 1; + } + + LPCSTR pStr = ports[a].c_str(); + memcpy( (LPVOID)&pOutput->mPath[0], + (LPCVOID)pStr, + (SIZE_T)len ); + } + + pOutput++; + } + + *pPortSize = (BYTE)portCount; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetQDLTimeout + +DESCRIPTION: + This function sets the timeout for all subsequent QDL transactions + +PARAMETERS: + to [ O ] - Timeout (in milliseconds) for subsequent transactions + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG SetQDLTimeout( ULONG to ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->SetQDLTimeout( to ); +} + +/*=========================================================================== +METHOD: + OpenQDLPort + +DESCRIPTION: + This function opens the specified QDL port of the device + +PARAMETERS: + pPortID [ I ] - ID of QDL port to connect to + bBARMode [ I ] - Request boot and recovery mode feature + pMajorVersion [ O ] - Major version of the device boot downloader + pMinorVersion [ O ] - Minor version of the device boot downloader + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG OpenQDLPort( + CHAR * pPortID, + ULONG bBARMode, + ULONG * pMajorVersion, + ULONG * pMinorVersion ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + std::string strPortID( (const char *)pPortID ); + + return (ULONG)pAPI->OpenQDLPort( strPortID, + bBARMode, + pMajorVersion, + pMinorVersion ); +} + +/*=========================================================================== +METHOD: + CloseQDLPort + +DESCRIPTION: + This function closes the currently open QDL port of the device + +PARAMETERS: + bInformDevice [ I ] - Inform device that QDL port is being closed? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG CloseQDLPort( ULONG bInformDevice ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + bool bTmp = (bInformDevice != 0); + return (ULONG)pAPI->CloseQDLPort( bTmp ); +} + +/*=========================================================================== +METHOD: + GetQDLImagesPreference + +DESCRIPTION: + This function gets the current images preference as reported by the + device boot downloader + +PARAMETERS: + pImageListSize [I/O] - Upon input the maximum number of elements that the + image info list can contain. Upon successful output + the actual number of elements in the image info list + pImageList [ O ] - The image info list + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG GetQDLImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->GetQDLImagesPreference( pImageListSize, + pImageList ); +} + +/*=========================================================================== +METHOD: + PrepareQDLImageWrite + +DESCRIPTION: + This function prepares the device boot downloader for an image write + +PARAMETERS: + imageType [ I ] - Type of image being written + imageSize [ I ] - Size of image being written + pBlockSize [I/O] - Upon input the maximum size of image block supported + by host, upon successful output the maximum size of + image block supported by device + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG PrepareQDLImageWrite( + BYTE imageType, + ULONG imageSize, + ULONG * pBlockSize ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->PrepareQDLImageWrite( imageType, + imageSize, + pBlockSize ); +} + +/*=========================================================================== +METHOD: + WriteQDLImageBlock + +DESCRIPTION: + This function writes the specified image block to the device + +PARAMETERS: + sequenceNumber [ I ] - Sequence number for image write + blockSize [ I ] - Size of image block + pImageBlock [ I ] - Image block + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG WriteQDLImageBlock( + USHORT sequenceNumber, + ULONG blockSize, + BYTE * pImageBlock ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->WriteQDLImageBlock( sequenceNumber, + blockSize, + pImageBlock ); +} + +/*=========================================================================== +METHOD: + ValidateQDLImages + +DESCRIPTION: + This function requests the device validate the written images + +PARAMETERS: + pImageType [ O ] - Upon failure this may contain the type of the image + that failed validation + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +ULONG ValidateQDLImages( BYTE * pImageType ) +{ + cGobiImageMgmt * pAPI = gImageDLL.GetAPI(); + if (pAPI == 0) + { + return (ULONG)eGOBI_ERR_INTERNAL; + } + + return (ULONG)pAPI->ValidateQDLImages( pImageType ); +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/Makefile.am b/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/Makefile.am new file mode 100644 index 0000000..3b97d95 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiImageMgmt/Makefile.am @@ -0,0 +1,32 @@ +INCLUDES = \ + -I$(top_srcdir)/Core \ + -I$(top_srcdir)/Shared + +lib_LTLIBRARIES = libGobiImageMgmt.la + +libGobiImageMgmt_la_CPPFLAGS = \ + -D WDS_SUPPORT \ + -D DMS_SUPPORT \ + -D NAS_SUPPORT \ + -D PDS_SUPPORT \ + -D CAT_SUPPORT \ + -D RMS_SUPPORT \ + -D OMA_SUPPORT \ + -D UIM_SUPPORT \ + -D WMS_SUPPORT \ + -D IMG2K_SUPPORT \ + -D IMG_SUPPORT \ + -D VOICE_SUPPORT + +libGobiImageMgmt_la_SOURCES = \ + GobiImageMgmtAPI.h \ + GobiImageMgmt.h \ + GobiImageMgmt.cpp \ + GobiImageMgmtExports.cpp + +libGobiImageMgmt_la_LIBADD = \ + $(top_builddir)/Database/QMI/libQMIDB.la \ + $(top_builddir)/Shared/libShared.la \ + $(top_builddir)/Core/libCore.la \ + -lpthread + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/99-GobiQDLService.rules b/gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/99-GobiQDLService.rules new file mode 100755 index 0000000..a19007e --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/99-GobiQDLService.rules @@ -0,0 +1,40 @@ +#=========================================================================== +# FILE: +# 99-GobiQDLService.rules +# +# DESCRIPTION: +# Udev rules for Qualcomm Downloader application (GobiQDLService) +# +# PUBLIC CLASSES AND METHODS: +# +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +#============================================================================ + +ACTION=="add", SUBSYSTEM=="tty", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="920c", RUN+="/opt/Qualcomm/Gobi/GobiQDLService/GobiQDLService" + + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/Main.cpp b/gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/Main.cpp new file mode 100755 index 0000000..5f82901 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/Main.cpp @@ -0,0 +1,206 @@ +/*=========================================================================== +FILE: + Main.cpp + +DESCRIPTION: + Firmware downloader using cGobiQDLCore class + +PUBLIC CLASSES AND FUNCTIONS: + Run + main + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQDLCore.h" +#include "QDLBuffers.h" +#include "MemoryMappedFile.h" + +#include + +//--------------------------------------------------------------------------- +// Free Methods +//--------------------------------------------------------------------------- + +/*=========================================================================== +METHOD: + Run (Public Method) + +DESCRIPTION: + Simple QDL download + +RETURN VALUE: + bool +===========================================================================*/ +bool Run(void) +{ + cGobiQDLCore qdl; + bool bRC = qdl.Initialize(); + if (bRC == false) + { + syslog( LOG_INFO, "Failed to initialize QDL core" ); + return bRC; + } + + qdl.SetQDLTimeout( 10000 ); + + std::vector qdlPorts = qdl.GetAvailableQDLPorts(); + if (qdlPorts.size() == 0) + { + syslog( LOG_INFO, "No QDL devices found" ); + return false; + } + + std::string portName = qdlPorts[0]; + syslog( LOG_INFO, "Download started to port %s", portName.c_str() ); + + // Connect to port + ULONG maj = ULONG_MAX; + ULONG min = ULONG_MAX; + eGobiError err = qdl.OpenQDLPort( portName, 0, &maj, &min ); + if (err != eGOBI_ERR_NONE) + { + syslog( LOG_INFO, "OpenQDLPort( %s ) = %d", portName.c_str(), err ); + return false; + } + + ULONG bufSz = 12; + sQDLRawImageID buf[12]; + err = qdl.GetQDLImagesPreference( &bufSz, (BYTE *)&buf[0] ); + if (err != eGOBI_ERR_NONE) + { + syslog( LOG_INFO, "GetQDLImagesPreference() = %d", err ); + qdl.CloseQDLPort( false ); + return false; + } + + if (bufSz > 12) + { + syslog( LOG_INFO, "GetQDLImagesPreference(), bufSz = %lu", bufSz ); + qdl.CloseQDLPort( false ); + return false; + } + + bool bErr = false; + for (ULONG i = 0; i < bufSz; i++) + { + std::string img = ::GetImageByUniqueID( &buf[i].mImageID[0] ); + if (img.size() <= 0) + { + // Skip files we do not have access to + syslog( LOG_INFO, "GetImageByUniqueID() failure" ); + return false; + } + + ULONG fileMaj = 0; + ULONG fileMin = 0; + err = ::GetImageBootCompatibility( img.c_str(), + &fileMaj, + &fileMin ); + + if (err != eGOBI_ERR_NONE || fileMaj != maj) + { + // Skip files that may not be compatible + syslog( LOG_INFO, "GetImageBootCompatibility() failure [%d]", err ); + return false; + } + + cMemoryMappedFile imgFile( img.c_str() ); + syslog( LOG_INFO, "Downloading %s", img.c_str() ); + + LPVOID pImgData = imgFile.GetContents(); + ULONG imgSz = imgFile.GetSize(); + if (pImgData == 0 || imgSz == 0) + { + syslog( LOG_INFO, "Image file failure [%s]", img.c_str() ); + bErr = true; + return false; + } + + ULONG blockSz = QDL_MAX_CHUNK_SIZE; + err = qdl.PrepareQDLImageWrite( buf[i].mImageType, imgSz, &blockSz ); + if (err != eGOBI_ERR_NONE) + { + if (err == eGOBI_ERR_QDL_OPEN_SKIP) + { + // Device already has this file + continue; + } + else + { + syslog( LOG_INFO, "PrepareQDLImageWrite() = %d", err ); + bErr = true; + break; + } + } + + err = qdl.WriteQDLImageBlock( 0, imgSz, (BYTE *)pImgData ); + if (err != eGOBI_ERR_NONE) + { + syslog( LOG_INFO, "WriteQDLImageBlock() = %d", err ); + bErr = true; + break; + } + } + + if (bErr == false) + { + syslog( LOG_INFO, "Download completed" ); + BYTE errImg; + qdl.ValidateQDLImages( &errImg ); + } + + qdl.CloseQDLPort( true ); +} + +/*=========================================================================== +METHOD: + main (Public Method) + +DESCRIPTION: + Application entry point + +RETURN VALUE: + int - Process exit code +===========================================================================*/ +int main(void) +{ + + // Add PID to log statements + openlog( "GobiQDLService", LOG_PID, LOG_USER ); + + bool bSuccess = Run(); + + closelog(); + + return (bSuccess ? 0 : -1 ); +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/Makefile.am b/gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/Makefile.am new file mode 100644 index 0000000..3628e7c --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/GobiQDLService/Makefile.am @@ -0,0 +1,31 @@ +INCLUDES = \ + -I$(top_srcdir)/Core \ + -I$(top_srcdir)/Shared + +bin_PROGRAMS = GobiQDLService + +GobiQDLService_CPPFLAGS = \ + -D WDS_SUPPORT \ + -D DMS_SUPPORT \ + -D NAS_SUPPORT \ + -D PDS_SUPPORT \ + -D CAT_SUPPORT \ + -D RMS_SUPPORT \ + -D OMA_SUPPORT \ + -D UIM_SUPPORT \ + -D WMS_SUPPORT \ + -D IMG2K_SUPPORT \ + -D IMG_SUPPORT \ + -D VOICE_SUPPORT + +GobiQDLService_SOURCES = Main.cpp + +GobiQDLService_CXXFLAGS = -pthread + +GobiQDLService_LDADD = \ + $(top_builddir)/Database/QMI/libQMIDB.la \ + $(top_builddir)/Shared/libShared.la \ + $(top_builddir)/Core/libCore.la \ + -lrt \ + -lpthread + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Makefile.am b/gobi-api/fixed-GobiAPI-1.0.40/Makefile.am new file mode 100644 index 0000000..654c675 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Makefile.am @@ -0,0 +1,9 @@ +SUBDIRS= \ + Database \ + Shared \ + Core \ + GobiConnectionMgmt \ + GobiImageMgmt \ + GobiQDLService + +ACLOCAL_AMFLAGS = -I m4 diff --git a/gobi-api/fixed-GobiAPI-1.0.40/NEWS b/gobi-api/fixed-GobiAPI-1.0.40/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/gobi-api/fixed-GobiAPI-1.0.40/README b/gobi-api/fixed-GobiAPI-1.0.40/README new file mode 100644 index 0000000..e69de29 diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiError.h b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiError.h new file mode 100755 index 0000000..20117d5 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiError.h @@ -0,0 +1,147 @@ +/*=========================================================================== +FILE: + GobiError.h + +DESCRIPTION: + QUALCOMM Gobi Errors + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "QMIEnum.h" +#include "QDLEnum.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// eGobiError Enumeration +// Gobi API Error Enumeration +/*=========================================================================*/ +enum eGobiError +{ + eGOBI_ERR_ENUM_BEGIN = -1, + + eGOBI_ERR_NONE, // 00 Success + eGOBI_ERR_GENERAL, // 01 General error + eGOBI_ERR_INTERNAL, // 02 Internal error + eGOBI_ERR_MEMORY, // 03 Memory error + eGOBI_ERR_INVALID_ARG, // 04 Invalid argument + eGOBI_ERR_BUFFER_SZ, // 05 Buffer too small + eGOBI_ERR_NO_DEVICE, // 06 Unable to detect device + eGOBI_ERR_INVALID_DEVID, // 07 Invalid device ID + eGOBI_ERR_NO_CONNECTION, // 08 No connection to device + eGOBI_ERR_IFACE, // 09 Unable to obtain required interace + eGOBI_ERR_CONNECT, // 10 Unable to connect to interface + eGOBI_ERR_REQ_SCHEDULE, // 11 Unable to schedule request + eGOBI_ERR_REQUEST, // 12 Error sending request + eGOBI_ERR_RESPONSE, // 13 Error receiving response + eGOBI_ERR_REQUEST_TO, // 14 Timeout while sending request + eGOBI_ERR_RESPONSE_TO, // 15 Timeout while receiving response + eGOBI_ERR_MALFORMED_RSP, // 16 Malformed response received + eGOBI_ERR_INVALID_RSP, // 17 Invalid/error response received + eGOBI_ERR_INVALID_FILE, // 18 Invalid file path + eGOBI_ERR_FILE_OPEN, // 19 Unable to open file + eGOBI_ERR_FILE_COPY, // 20 Unable to copy file + eGOBI_ERR_QDL_SCM, // 21 Unable to open service control mgr + eGOBI_ERR_NO_QDL_SVC, // 22 Unable to detect QDL service + eGOBI_ERR_NO_QDL_SVC_INFO, // 23 Unable to obtain QDL service info + eGOBI_ERR_NO_QDL_SVC_PATH, // 24 Unable to locate QSL service + eGOBI_ERR_QDL_SVC_CFG, // 25 Unable to reconfigure QDL service + eGOBI_ERR_QDL_SVC_IFACE, // 26 Unable to interface to QDL service + eGOBI_ERR_OFFLINE, // 27 Unable to set device offline + eGOBI_ERR_RESET, // 28 Unable to reset device + eGOBI_ERR_NO_SIGNAL, // 29 No available signal + eGOBI_ERR_MULTIPLE_DEVICES, // 30 Multiple devices detected + eGOBI_ERR_DRIVER, // 31 Error interfacing to driver + eGOBI_ERR_NO_CANCELABLE_OP, // 32 No cancelable operation is pending + eGOBI_ERR_CANCEL_OP, // 33 Error canceling outstanding operation + eGOBI_ERR_QDL_CRC, // 34 QDL image data CRC error + eGOBI_ERR_QDL_PARSING, // 35 QDL image data parsing error + eGOBI_ERR_QDL_AUTH, // 36 QDL image authentication error + eGOBI_ERR_QDL_WRITE, // 37 QDL image write error + eGOBI_ERR_QDL_OPEN_SIZE, // 38 QDL image size error + eGOBI_ERR_QDL_OPEN_TYPE, // 39 QDL image type error + eGOBI_ERR_QDL_OPEN_PROT, // 40 QDL memory protection error + eGOBI_ERR_QDL_OPEN_SKIP, // 41 QDL image not required + eGOBI_ERR_QDL_ERR_GENERAL, // 42 QDL general error + eGOBI_ERR_QDL_BAR_MODE, // 43 QDL BAR mode error + + eGOBI_ERR_ENUM_END, + + // Offset from which mapped QMI error codes start from (see eQMIErrorCode) + eGOBI_ERR_QMI_OFFSET = 1000, + + // Offset from which mapped QDL errors start from (see eQDLError) + eGOBI_ERR_QDL_OFFSET = 100000 +}; + +/*=========================================================================== +METHOD: + IsValid (Inline Method) + +DESCRIPTION: + eGobiError validity check + +PARAMETERS: + ec [ I ] - Enum value being verified + +RETURN VALUE: + bool +===========================================================================*/ +inline bool IsValid( eGobiError ec ) +{ + bool retVal = false; + if (ec > eGOBI_ERR_ENUM_BEGIN && ec < eGOBI_ERR_ENUM_END) + { + retVal = true; + } + + if (ec >= eGOBI_ERR_QMI_OFFSET && ec < eGOBI_ERR_QDL_OFFSET) + { + ULONG tmp = (ULONG)ec - (ULONG)eGOBI_ERR_QMI_OFFSET; + retVal = ::IsValid( (eQMIErrorCode)tmp ); + } + + if (ec >= eGOBI_ERR_QDL_OFFSET) + { + ULONG tmp = (ULONG)ec - (ULONG)eGOBI_ERR_QDL_OFFSET; + retVal = ::IsValid( (eQDLError)tmp ); + } + + return retVal; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiImageDefinitions.h b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiImageDefinitions.h new file mode 100755 index 0000000..5fd3d57 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiImageDefinitions.h @@ -0,0 +1,176 @@ +/*=========================================================================== +FILE: + GobiImageDefinitions.h + +DESCRIPTION: + QUALCOMM Gobi Image related definitions + +PUBLIC CLASSES AND FUNCTIONS: + eGobiDeviceType + eGobiMBNType + eGobiImageTech + eGobiImageCarrier + eGobiImageRegion + eGobiImageGPS + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// eGobiDeviceType Enumeration +// Gobi Device Interface Enumeration +/*=========================================================================*/ +enum eGobiDeviceType +{ + eGOBI_DEV_ENUM_BEGIN = -1, + + eGOBI_DEV_NET, // 0 - Network adapter + eGOBI_DEV_NMEA, // 1 - NMEA COM port + eGOBI_DEV_DIAG, // 2 - DIAG port + eGOBI_DEV_MODEM, // 3 - Modem + eGOBI_DEV_AT, // 4 - AT port + eGOBI_DEV_NET2, // 5 - Auxiliary network adapter + eGOBI_DEV_QDL, // 6 - QDL port (should always be last) + + eGOBI_DEV_ENUM_END +}; + +/*=========================================================================*/ +// eGobiMBNType Enumeration +// Gobi MBN File Type Enumeration +/*=========================================================================*/ +enum eGobiMBNType +{ + eGOBI_MBN_TYPE_ENUM_BEGIN = -1, + + eGOBI_MBN_TYPE_MODEM, // 0 - Modem/AMSS + eGOBI_MBN_TYPE_PRI, // 1 - PRI/UQCN + + eGOBI_MBN_TYPE_ENUM_END, +}; + +/*=========================================================================*/ +// eGobiImageTech Enumeration +// Gobi Image Technology Enumeration +/*=========================================================================*/ +enum eGobiImageTech +{ + eGOBI_IMG_TECH_CDMA = 0, // 0 - CDMA + eGOBI_IMG_TECH_UMTS // 1 - UMTS +}; + +/*=========================================================================*/ +// eGobiImageCarrier Enumeration +// Gobi Image Carrier Enumeration +/*=========================================================================*/ +enum eGobiImageCarrier +{ + eGOBI_IMG_CAR_GENERIC = 1, // 001 + eGOBI_IMG_CAR_FACTORY, // 002 + eGOBI_IMG_CAR_NORF, // 003 + + eGOBI_IMG_CAR_VERIZON = 101, // 101 + eGOBI_IMG_CAR_SPRINT, // 102 + eGOBI_IMG_CAR_ALLTEL, // 103 + eGOBI_IMG_CAR_BELL, // 104 + eGOBI_IMG_CAR_TELUS, // 105 + eGOBI_IMG_CAR_US, // 106 + eGOBI_IMG_CAR_TELSTRA1, // 107 + eGOBI_IMG_CAR_CHINA_UNICOM, // 108 + eGOBI_IMG_CAR_TELCOM_NZ, // 109 + eGOBI_IMG_CAR_SK_TELCOM1, // 110 + eGOBI_IMG_CAR_RELIANCE1, // 111 + eGOBI_IMG_CAR_TATA, // 112 + eGOBI_IMG_CAR_METROPCS, // 113 + eGOBI_IMG_CAR_LEAP, // 114 + eGOBI_IMG_CAR_KDDI, // 115 + eGOBI_IMG_CAR_IUSACELL, // 116 + eGOBI_IMG_CAR_CHINA_TELECOM, // 117 + eGOBI_IMG_CAR_OMH, // 118 + + eGOBI_IMG_CAR_ATT = 201, // 201 + eGOBI_IMG_CAR_VODAFONE, // 202 + eGOBI_IMG_CAR_TMOBILE, // 203 + eGOBI_IMG_CAR_ORANGE, // 204 + eGOBI_IMG_CAR_TELEFONICA, // 205 + eGOBI_IMG_CAR_TELCOM_ITALIA, // 206 + eGOBI_IMG_CAR_3, // 207 + eGOBI_IMG_CAR_O2, // 208 + eGOBI_IMG_CAR_SFR, // 209 + eGOBI_IMG_CAR_SWISSCOM, // 210 + eGOBI_IMG_CAR_CHINA_MOBILE, // 211 + eGOBI_IMG_CAR_TELSTRA2, // 212 + eGOBI_IMG_CAR_SINGTEL_OPTUS, // 213 + eGOBI_IMG_CAR_RELIANCE2, // 214 + eGOBI_IMG_CAR_BHARTI, // 215 + eGOBI_IMG_CAR_NTT_DOCOMO, // 216 + eGOBI_IMG_CAR_EMOBILE, // 217 + eGOBI_IMG_CAR_SOFTBANK, // 218 + eGOBI_IMG_CAR_KT_FREETEL, // 219 + eGOBI_IMG_CAR_SK_TELCOM2, // 220 + eGOBI_IMG_CAR_TELENOR, // 221 + eGOBI_IMG_CAR_NETCOM, // 222 + eGOBI_IMG_CAR_TELIASONERA, // 223 + eGOBI_IMG_CAR_AMX_TELCEL, // 224 + eGOBI_IMG_CAR_BRASIL_VIVO // 225 +}; + +/*=========================================================================*/ +// eGobiImageRegion Enumeration +// Gobi Image Region Enumeration +/*=========================================================================*/ +enum eGobiImageRegion +{ + eGOBI_IMG_REG_NA = 0, // 0 - North America + eGOBI_IMG_REG_LA, // 1 - Latin America + eGOBI_IMG_REG_EU, // 2 - Europe + eGOBI_IMG_REG_ASIA, // 3 - Asia + eGOBI_IMG_REG_AUS, // 4 - Australia + eGOBI_IMG_REG_GLOBAL // 5 - Global +}; + +/*=========================================================================*/ +// eGobiImageGPS Enumeration +// Gobi Image GPS Enumeration +/*=========================================================================*/ +enum eGobiImageGPS +{ + eGOBI_IMG_GPS_NONE = 0, // 0 - None + eGOBI_IMG_GPS_STAND_ALONE, // 1 - Stand-alone + eGOBI_IMG_GPS_ASSISTED, // 2 - Stand-alone + AGPS + XTRA + eGOBI_IMG_GPS_NO_XTRA // 3 - Stand-alone + AGPS +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiMBNMgmt.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiMBNMgmt.cpp new file mode 100755 index 0000000..38f8eb6 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiMBNMgmt.cpp @@ -0,0 +1,1017 @@ +/*=========================================================================== +FILE: + GobiMBNMgmt.cpp + +DESCRIPTION: + QUALCOMM Gobi MBN management functions for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + GetImageStore + GetImageInfo + GetImagesInfo + GetImageBootCompatibility + MapVersionInfo + GetImageByUniqueID + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiMBNMgmt.h" +#include "GobiError.h" + +#include "CoreUtilities.h" +#include "MemoryMappedFile.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Magic values for MBN (AMSS/UQCN) images +const ULONG MBN_LOCK_MAGIC = 0x809b1d80; +const ULONG MBN_BOOT_MAGIC = 0xFEDC1234; +const ULONG MBN_BUILD_MAGIC = 0xFEDC1235; +const ULONG UQCN_INFO_MAGIC = 0xFEDC1236; +const ULONG MBN_HASH_MAGIC = 0xFEDC1237; +const ULONG MBN_LOCK_AUTH_MAGIC = 0xFEDC1238; + +// Maximum length for an UQCN build info string (including NULL) +const ULONG MBN_BUILD_ID_LEN = 32; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sMBNBootRecord +// Struct to represent the MBN boot flash record +/*=========================================================================*/ +struct sMBNBootRecord +{ + public: + ULONG mMagic; // MBN_BOOT_MAGIC + WORD mMajorID; // Boot flash major version + WORD mMinorID; // Boot flash minor version +}; + +/*=========================================================================*/ +// Struct sMBNBuildRecord +// Struct to represent the build ID record +/*=========================================================================*/ +struct sMBNBuildIDRecord +{ + public: + ULONG mMagic; // MBN_BUILD_MAGIC + CHAR mBuildID[MBN_BUILD_ID_LEN]; // Build ID string +}; + +/*=========================================================================*/ +// Struct sUQCNVersionID +// Struct to represent the UQCN version ID +/*=========================================================================*/ +struct sUQCNVersionID +{ + public: + ULONG mMinorID : 7; + ULONG mXTRADisabled : 1; + ULONG mGPSDisabled : 1; + ULONG mReserved : 7; + ULONG mMajorID : 8; + ULONG mSystem : 2; + ULONG mCompatibility : 6; +}; + +/*=========================================================================*/ +// Struct sUQCNInfoRecord +// Struct to represent the UQCN information record +/*=========================================================================*/ +struct sUQCNInfoRecord +{ + public: + ULONG mMagic; // UQCN_INFO_MAGIC + sUQCNVersionID mVersionID; // Version ID + CHAR mInfo[MBN_BUILD_ID_LEN]; // Build info string +}; + +/*=========================================================================*/ +// Struct sMBNHashRecord +// Struct to represent the signature hash record +/*=========================================================================*/ +struct sMBNHashRecord +{ + public: + ULONG mMagic; // MBN_HASH_MAGIC + BYTE mUniqueID[MBN_UNIQUE_ID_LEN]; // Build ID string +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + ReverseBinaryDataSearch (Free Method) + +DESCRIPTION: + Search a data buffer for the first occurence of a specified + sequence of data (starting from the end of the buffer) + +PARAMETERS: + pBuffer [ I ] - Buffer being search + bufferLen [ I ] - Length of above buffer + pData [ I ] - Data to search for + dataLen [ I ] - Length of above buffer + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +const BYTE * ReverseBinaryDataSearch( + const BYTE * pBuffer, + ULONG bufferLen, + const BYTE * pData, + ULONG dataLen ) +{ + // Handle empty cases + if (pBuffer == 0 || bufferLen == 0 || pData ==0 || dataLen == 0) + { + return 0; + } + + // Handle impossible case + if (dataLen > bufferLen) + { + return 0; + } + + const BYTE * pTmp = pBuffer + (bufferLen - dataLen); + while (pTmp > pBuffer) + { + int res = ::memcmp( (const void *)pTmp, + (const void *)pData, + (size_t)dataLen ); + + if (res == 0) + { + return pTmp; + } + + pTmp--; + } + + return 0; +} + +/*=========================================================================== +METHOD: + ParseUQCNVersion (Free Method) + +DESCRIPTION: + Parse UQCN version ID to image information + +PARAMETERS: + uqcnID [ I ] - UQCN ID + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + bool +===========================================================================*/ +bool ParseUQCNVersion( + ULONG uqcnID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + // Assume failure + bool bRC = false; + *pTechnology = ULONG_MAX; + *pCarrier = ULONG_MAX; + *pRegion = ULONG_MAX; + *pGPSCapability = ULONG_MAX; + + sUQCNVersionID * pID = (sUQCNVersionID *)&uqcnID; + if (pID->mSystem == 2) + { + // Successs is returned when the technology is valid + *pTechnology = (ULONG)eGOBI_IMG_TECH_UMTS; + bRC = true; + } + else if (pID->mSystem == 1) + { + // Successs is returned when the technology is valid + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + bRC = true; + } + + // Valid technology? + if (bRC == false) + { + return bRC; + } + + switch (pID->mMajorID) + { + case 0x00: + *pCarrier = (ULONG)eGOBI_IMG_CAR_FACTORY; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + break; + + case 0x01: + *pCarrier = (ULONG)eGOBI_IMG_CAR_VERIZON; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + break; + + case 0x02: + *pCarrier = (ULONG)eGOBI_IMG_CAR_SPRINT; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + break; + + case 0x03: + *pCarrier = (ULONG)eGOBI_IMG_CAR_ATT; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + break; + + case 0x04: + *pCarrier = (ULONG)eGOBI_IMG_CAR_VODAFONE; + *pRegion = (ULONG)eGOBI_IMG_REG_EU; + break; + + case 0x05: + *pCarrier = (ULONG)eGOBI_IMG_CAR_TMOBILE; + *pRegion = (ULONG)eGOBI_IMG_REG_EU; + break; + + case 0x09: + *pCarrier = (ULONG)eGOBI_IMG_CAR_GENERIC; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + break; + + case 0x0B: + *pCarrier = (ULONG)eGOBI_IMG_CAR_ORANGE; + *pRegion = (ULONG)eGOBI_IMG_REG_EU; + break; + + case 0x0C: + *pCarrier = (ULONG)eGOBI_IMG_CAR_TELEFONICA; + *pRegion = (ULONG)eGOBI_IMG_REG_EU; + break; + + case 0x0D: + *pCarrier = (ULONG)eGOBI_IMG_CAR_NTT_DOCOMO; + *pRegion = (ULONG)eGOBI_IMG_REG_ASIA; + break; + + case 0x0E: + *pCarrier = (ULONG)eGOBI_IMG_CAR_TELCOM_ITALIA; + *pRegion = (ULONG)eGOBI_IMG_REG_EU; + break; + + case 0x12: + *pCarrier = (ULONG)eGOBI_IMG_CAR_TELCOM_NZ; + *pRegion = (ULONG)eGOBI_IMG_REG_AUS; + break; + + case 0x13: + *pCarrier = (ULONG)eGOBI_IMG_CAR_CHINA_TELECOM; + *pRegion = (ULONG)eGOBI_IMG_REG_ASIA; + break; + + case 0x14: + *pCarrier = (ULONG)eGOBI_IMG_CAR_OMH; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + break; + + case 0x16: + *pCarrier = (ULONG)eGOBI_IMG_CAR_AMX_TELCEL; + *pRegion = (ULONG)eGOBI_IMG_REG_LA; + break; + + case 0x17: + *pCarrier = (ULONG)eGOBI_IMG_CAR_NORF; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + break; + + case 0x18: + *pCarrier = (ULONG)eGOBI_IMG_CAR_FACTORY; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + break; + + case 0x19: + *pCarrier = (ULONG)eGOBI_IMG_CAR_BRASIL_VIVO; + *pRegion = (ULONG)eGOBI_IMG_REG_LA; + break; + } + + // Set GPS capability + if (pID->mGPSDisabled == 1) + { + *pGPSCapability = (ULONG)eGOBI_IMG_GPS_NONE; + } + else if (*pCarrier == (ULONG)eGOBI_IMG_CAR_NORF) + { + // No RF with GPS results in stand-alone GPS support only + *pGPSCapability = (ULONG)eGOBI_IMG_GPS_STAND_ALONE; + } + else + { + if (pID->mXTRADisabled == 1) + { + *pGPSCapability = (ULONG)eGOBI_IMG_GPS_NO_XTRA; + } + else + { + *pGPSCapability = (ULONG)eGOBI_IMG_GPS_ASSISTED; + } + } + + return bRC; +} + +/*=========================================================================== +METHOD: + ParseAMSSVersion (Free Method) + +DESCRIPTION: + Parse UQCN version ID to image information + +PARAMETERS: + pVersion [ I ] - Version string + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + bool +===========================================================================*/ +bool ParseAMSSVersion( + LPCSTR pVersion, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + // Assume failure + bool bRC = false; + *pTechnology = ULONG_MAX; + *pCarrier = ULONG_MAX; + *pRegion = ULONG_MAX; + *pGPSCapability = ULONG_MAX; + + // Validate arguments + if (pVersion == 0 || pVersion[0] == 0) + { + return bRC; + } + + std::string tmpVer = pVersion; + + // std::string version of MakeUpper() + transform( tmpVer.begin(), tmpVer.end(), tmpVer.begin(), toupper ); + + if ( (tmpVer.find( "STAUFH" ) != std::string::npos) + || (tmpVer.find( "STSUFH" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + *pCarrier = (ULONG)eGOBI_IMG_CAR_FACTORY; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + + bRC = true; + return bRC; + } + else if ( (tmpVer.find( "STAUVH" ) != std::string::npos) + || (tmpVer.find( "STSUVH" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + *pCarrier = (ULONG)eGOBI_IMG_CAR_VERIZON; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + + bRC = true; + return bRC; + } + else if ( (tmpVer.find( "STAUSH" ) != std::string::npos) + || (tmpVer.find( "STSUSH" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + *pCarrier = (ULONG)eGOBI_IMG_CAR_SPRINT; + *pRegion = (ULONG)eGOBI_IMG_REG_NA; + + bRC = true; + return bRC; + } + else if (tmpVer.find( "STSUCH" ) != std::string::npos) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + *pCarrier = (ULONG)eGOBI_IMG_CAR_CHINA_TELECOM; + *pRegion = (ULONG)eGOBI_IMG_REG_ASIA; + + bRC = true; + return bRC; + } + else if (tmpVer.find( "STSUOH" ) != std::string::npos) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_CDMA; + *pCarrier = (ULONG)eGOBI_IMG_CAR_OMH; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + + bRC = true; + return bRC; + } + else if ( (tmpVer.find( "STAUXN" ) != std::string::npos) + || (tmpVer.find( "STSUXN" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_UMTS; + *pCarrier = (ULONG)eGOBI_IMG_CAR_NORF; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + + bRC = true; + return bRC; + } + else if ( (tmpVer.find( "STAUFN" ) != std::string::npos) + || (tmpVer.find( "STSUFN" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_UMTS; + *pCarrier = (ULONG)eGOBI_IMG_CAR_FACTORY; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + + bRC = true; + return bRC; + } + else if ( (tmpVer.find( "STAUGN" ) != std::string::npos) + || (tmpVer.find( "STSUGN" ) != std::string::npos) ) + { + *pTechnology = (ULONG)eGOBI_IMG_TECH_UMTS; + *pCarrier = (ULONG)eGOBI_IMG_CAR_GENERIC; + *pRegion = (ULONG)eGOBI_IMG_REG_GLOBAL; + + bRC = true; + return bRC; + } + + return bRC; +} + +struct device_id { + GobiType type; + unsigned int vid; + unsigned int pid; + const char *fwpath; +}; + +#define GOBI3(vid,pid) { GOBITYPE_3K, 0x ## vid, 0x ## pid, "/opt/Qualcomm/firmware/" #vid ":" #pid } +#define GOBI2(vid,pid,oem) { GOBITYPE_2K, 0x ## vid, 0x ## pid, "/opt/Qualcomm/Images2k/" oem } + +const struct device_id device_ids[] = { + GOBI3(05c6, 920d), /* Novatel */ + GOBI3(12d1, 14f1), /* Sony */ + GOBI3(1410, a021), /* Generic */ + GOBI3(413c, 8194), /* Dell */ + GOBI2(05c6, 9215, "Acer"), + GOBI2(05c6, 9225, "Sony"), + GOBI2(05c6, 9245, "Samsung"), + GOBI2(1410, 0000, "Novatel"), + GOBI2(413c, 8186, "Dell"), + { GOBITYPE_UNKNOWN, 0, 0, NULL } +}; + +static const struct device_id *VidPidToDev(unsigned int vid, unsigned int pid) +{ + int i; + for (i = 0; device_ids[i].fwpath; i++) { + if (device_ids[i].vid && device_ids[i].vid != vid) + continue; + if (device_ids[i].pid && device_ids[i].pid != pid) + continue; + return &device_ids[i]; + } + return NULL; +} + +GobiType GetDeviceType(unsigned int vid, unsigned int pid) +{ + const struct device_id *dev = VidPidToDev(vid, pid); + return dev ? dev->type : GOBITYPE_UNKNOWN; +} + +static const char *VidPidToImageStore(unsigned int vid, unsigned int pid) +{ + int i; + const struct device_id *dev = VidPidToDev(vid, pid); + + /* Part of the gobi 3k image API doesn't have access to the device + * vid:pid when it goes looking for images, so we support this as a + * special case - 0000:0000 means "the directory with *all* gobi3 + * firmwares in it". */ + if (vid == 0 && pid == 0) + return "/opt/Qualcomm/firmware"; + + return dev ? dev->fwpath : NULL; +} + +/*=========================================================================== +METHOD: + GetImageStore (Public Method) + +DESCRIPTION: + Get the image store folder, i.e., the folder containing one or more + carrier-specific image subfolders + +RETURN VALUE: + std::string - Image Store +===========================================================================*/ +std::string GetImageStore(unsigned int vid, unsigned int pid) +{ + std::string oem = VidPidToImageStore(vid, pid); + printf("GetImageStore: dir %s\n", oem.c_str()); + + return oem; +} + +/*=========================================================================== +METHOD: + GetImageInfo (Public Method) + +DESCRIPTION: + Get the image information for the image specified by the given fully + qualified path + +PARAMETERS: + pFilePath [ I ] - Fully qualified path to image file + pImageType [ O ] - Image type + pImageID [ O ] - Unique image ID + pVersionID [ O ] - Version ID + versionSize [ I ] - The maximum number of characters including the NULL + terminator that can be copied to the version array + pVersion [ O ] - NULL-terminated string representing the version + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError GetImageInfo( + LPCSTR pFilePath, + BYTE * pImageType, + BYTE * pImageID, + ULONG * pVersionID, + USHORT versionSize, + CHAR * pVersion ) +{ + // Validate arguments + if ( (pFilePath == 0) + || (pFilePath[0] == 0) + || (pImageType == 0) + || (pImageID == 0) + || (pVersionID == 0) + || (versionSize == 0) + || (pVersion == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Open up MBN file + cMemoryMappedFile mbnFile( pFilePath ); + const BYTE * pMBNData = (const BYTE *)mbnFile.GetContents(); + ULONG dataSz = mbnFile.GetSize(); + + // MBN file (sort of) valid? + if (pMBNData == 0) + { + return eGOBI_ERR_FILE_OPEN; + } + + if (dataSz <= 256) + { + return eGOBI_ERR_INVALID_FILE; + } + + // Skip to the end + pMBNData += (dataSz - 256); + + // Search for the UQCN specific info + const BYTE * pTmp = 0; + pTmp = ReverseBinaryDataSearch( pMBNData, + 256, + (const BYTE *)&UQCN_INFO_MAGIC, + (ULONG)sizeof( UQCN_INFO_MAGIC ) ); + + if (pTmp != 0) + { + const sUQCNInfoRecord * pRec = (const sUQCNInfoRecord *)pTmp; + *pVersionID = *(ULONG *)&pRec->mVersionID; + *pImageType = 1; + } + else + { + // Since we did not find UQCN info, presume this is an AMSS file + pTmp = ReverseBinaryDataSearch( pMBNData, + 256, + (const BYTE *)&MBN_BOOT_MAGIC, + (ULONG)sizeof( MBN_BOOT_MAGIC ) ); + + if (pTmp == 0) + { + return eGOBI_ERR_INVALID_FILE; + } + + const sMBNBootRecord * pRec = (const sMBNBootRecord *)pTmp; + *pVersionID = pRec->mMinorID; + *pImageType = 0; + } + + // Search for the unique ID + pTmp = ReverseBinaryDataSearch( pMBNData, + 256, + (const BYTE *)&MBN_HASH_MAGIC, + (ULONG)sizeof( MBN_HASH_MAGIC ) ); + + if (pTmp == 0) + { + return eGOBI_ERR_INVALID_FILE; + } + + // Copy the unique ID + const sMBNHashRecord * pHash = (const sMBNHashRecord *)pTmp; + memcpy( (LPVOID)pImageID, + (LPCVOID)&pHash->mUniqueID[0], + (SIZE_T)MBN_UNIQUE_ID_LEN ); + + + // Search for the build ID + pTmp = ReverseBinaryDataSearch( pMBNData, + 256, + (const BYTE *)&MBN_BUILD_MAGIC, + (ULONG)sizeof( MBN_BUILD_MAGIC ) ); + + if (pTmp == 0) + { + return eGOBI_ERR_INVALID_FILE; + } + + memset( (PVOID)&pVersion[0], 0, (SIZE_T)versionSize ); + + // Copy the MBN_BUILD_MAGIC ID + const sMBNBuildIDRecord * pRec = (const sMBNBuildIDRecord *)pTmp; + for (ULONG t = 0; t < MBN_BUILD_ID_LEN; t++) + { + if (t >= versionSize) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pVersion[t] = pRec->mBuildID[t]; + if (pRec->mBuildID[t] == 0) + { + break; + } + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetImagesInfo (Public Method) + +DESCRIPTION: + Return the info for the images located at the given path + +PARAMETERS: + path [ I ] - Fully qualified path + +RETURN VALUE: + std:vector - Vector of image information +===========================================================================*/ +std::vector GetImagesInfo( const std::string & path ) +{ + // Validate arguments + std::vector retVec; + if (path.size() <= 0) + { + return retVec; + } + + // Search all MBN files in the specified folder + std::string folderSearch = path; + + int folderLen = folderSearch.size(); + if (folderSearch[folderLen - 1] != '/') + { + folderSearch += '/'; + } + + folderSearch += "*.mbn"; + + glob_t files; + int ret = glob( folderSearch.c_str(), + 0, + NULL, + &files ); + if (ret != 0) + { + // Glob error + return retVec; + } + + for (int i = 0; i < files.gl_pathc; i++) + { + std::string mbnName = files.gl_pathv[i]; + + BYTE imageType = UCHAR_MAX; + BYTE imageID[16] = { 0 }; + ULONG versionID = ULONG_MAX; + USHORT versionSz = MAX_PATH * 2 + 1; + CHAR versionStr[MAX_PATH * 2 + 1] = { 0 }; + eGobiError rc = ::GetImageInfo( mbnName.c_str(), + &imageType, + &imageID[0], + &versionID, + versionSz, + &versionStr[0] ); + + if (rc == eGOBI_ERR_NONE) + { + sImageInfo ii; + ii.mImageType = (eGobiMBNType)imageType; + ii.mVersionID = versionID; + ii.mVersion = (LPCSTR)&versionStr[0]; + memcpy( (LPVOID)&ii.mImageID[0], (LPCVOID)&imageID[0], 16 ); + + retVec.push_back( ii ); + } + } + globfree( &files ); + + return retVec; +} + +/*=========================================================================== +METHOD: + GetImageBootCompatibility (Public Method) + +DESCRIPTION: + Get the image boot compatibility for the image specified by the given + fully qualified path + +PARAMETERS: + pFilePath [ I ] - Fully qualified path to image file + pMajorVersion [ O ] - Major version of compatible boot downloader + pMinorVersion [ O ] - Minor version of compatible boot downloader + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError GetImageBootCompatibility( + LPCSTR pFilePath, + ULONG * pMajorVersion, + ULONG * pMinorVersion ) +{ + // Validate arguments + if ( (pFilePath == 0) + || (pFilePath[0] == 0) + || (pMajorVersion == 0) + || (pMinorVersion == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Open up MBN file + cMemoryMappedFile mbnFile( pFilePath ); + const BYTE * pMBNData = (const BYTE *)mbnFile.GetContents(); + ULONG dataSz = mbnFile.GetSize(); + + // MBN file (sort of) valid? + if (pMBNData == 0) + { + return eGOBI_ERR_FILE_OPEN; + } + + if (dataSz <= 256) + { + return eGOBI_ERR_INVALID_FILE; + } + + // Skip to the end + pMBNData += (dataSz - 256); + + const BYTE * pTmp = 0; + pTmp = ReverseBinaryDataSearch( pMBNData, + 256, + (const BYTE *)&MBN_BOOT_MAGIC, + (ULONG)sizeof( MBN_BOOT_MAGIC ) ); + + if (pTmp == 0) + { + return eGOBI_ERR_INVALID_FILE; + } + + const sMBNBootRecord * pRec = (const sMBNBootRecord *)pTmp; + *pMajorVersion = pRec->mMajorID; + *pMinorVersion = pRec->mMinorID; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + MapVersionInfo (Public Method) + +DESCRIPTION: + Map the specified version string to image capabilities + +PARAMETERS: + versionID [ I ] - Version ID + imageType [ I ] - Image type + pVersion [ I ] - Version string for image + pTechnology [ O ] - Technology type + pCarrier [ O ] - Carrier type + pRegion [ O ] - Region type + pGPSCapability [ O ] - GPS capability + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError MapVersionInfo( + ULONG versionID, + BYTE imageType, + LPCSTR pVersion, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + if ((eGobiMBNType)imageType == eGOBI_MBN_TYPE_MODEM) + { + // AMSS (modem) + bool bOK = ParseAMSSVersion( pVersion, + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); + + if (bOK == false) + { + return eGOBI_ERR_INVALID_ARG; + } + } + else if ((eGobiMBNType)imageType == eGOBI_MBN_TYPE_PRI) + { + // UQCN (PRI) + bool bOK = ParseUQCNVersion( versionID, + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); + + if (bOK == false) + { + return eGOBI_ERR_INVALID_ARG; + } + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetImageByUniqueID (Public Method) + +DESCRIPTION: + Return the fully qualified path to an image specified by unique ID + +PARAMETERS: + pImageID [ I ] - Unique image ID + +RETURN VALUE: + std::string - Fully qualified path to matching image +===========================================================================*/ +std::string GetImageByUniqueID( BYTE * pImageID ) +{ + // Validate arguments + std::string retStr = ""; + if (pImageID == 0) + { + return retStr; + } + + // Enumerate all folders of the image store + std::vector folders; + + std::string imageStore = ::GetImageStore(0, 0); + EnumerateFolders( imageStore, folders ); + + // Did we find any folders? + ULONG foldersSz = (ULONG)folders.size(); + if (foldersSz == 0) + { + return retStr; + } + + // Go through each folder searching for a match + for (ULONG f = 0; f < foldersSz; f++) + { + // Search all MBN files in the specified folder + std::string folderSearch = folders[f]; + + int folderLen = folderSearch.size(); + if (folderSearch[folderLen - 1] != '/') + { + folderSearch += '/'; + } + + folderSearch += "*.mbn"; + + glob_t files; + int ret = glob( folderSearch.c_str(), + 0, + NULL, + &files ); + if (ret != 0) + { + // Glob error, often GLOB_NOMATCH + continue; + } + + for (int i = 0; i < files.gl_pathc; i++) + { + std::string mbnName = files.gl_pathv[i]; + + BYTE imageType = UCHAR_MAX; + BYTE imageID[16] = { 0 }; + ULONG versionID = ULONG_MAX; + USHORT versionSz = MAX_PATH * 2 + 1; + CHAR versionStr[MAX_PATH * 2 + 1] = { 0 }; + eGobiError rc = ::GetImageInfo( mbnName.c_str(), + &imageType, + &imageID[0], + &versionID, + versionSz, + &versionStr[0] ); + + if (rc == eGOBI_ERR_NONE) + { + bool bMatch = true; + for (ULONG i = 0; i < 16; i++) + { + if (imageID[i] != pImageID[i]) + { + bMatch = false; + break; + } + } + + if (bMatch == true) + { + retStr = mbnName; + break; + } + } + } + globfree( &files ); + + if (retStr.size() > 0) + { + break; + } + } + + return retStr; +} + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiMBNMgmt.h b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiMBNMgmt.h new file mode 100755 index 0000000..af814ad --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiMBNMgmt.h @@ -0,0 +1,230 @@ +/*=========================================================================== +FILE: + GobiMBNMgmt.h + +DESCRIPTION: + QUALCOMM Gobi MBN management functions for Gobi 3000 + +PUBLIC CLASSES AND FUNCTIONS: + sImageInfo + GetImageStore + GetImageInfo + GetImagesInfo + GetImageBootCompatibility + MapVersionInfo + GetImageByUniqueID + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "apidefs.h" + +#include "GobiImageDefinitions.h" +#include "GobiError.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum length for unique image ID +const ULONG MBN_UNIQUE_ID_LEN = 16; + +/*=========================================================================*/ +// Struct sImageInfo +// Storage structure for Image information +/*=========================================================================*/ +struct sImageInfo +{ + public: + // Default constructor + sImageInfo() + : mImageType( eGOBI_MBN_TYPE_ENUM_BEGIN ), + mVersionID( ULONG_MAX ), + mVersion( "" ) + { + memset( (LPVOID)&mImageID[0], 0, MBN_UNIQUE_ID_LEN ); + }; + + // Is this object valid? + bool IsValid() const + { + return ( (mImageType != eGOBI_MBN_TYPE_ENUM_BEGIN) + && (mVersionID != ULONG_MAX) + && (mVersion.size() > 0) ); + }; + + /* Image type */ + eGobiMBNType mImageType; + + /* Unique image ID */ + BYTE mImageID[MBN_UNIQUE_ID_LEN]; + + /* Version ID */ + ULONG mVersionID; + + /* Version string */ + std::string mVersion; +}; + +/*=========================================================================*/ +// Public Methods +/*=========================================================================*/ + +GobiType GetDeviceType(unsigned int vid, unsigned int pid); + +/*=========================================================================== +METHOD: + GetImageStore (Public Method) + +DESCRIPTION: + Return the image store folder, i.e., the folder containing one or more + carrier-specific image subfolders + +RETURN VALUE: + std::string - Image Store +===========================================================================*/ +std::string GetImageStore(unsigned int vid, unsigned int pid); + +/*=========================================================================== +METHOD: + GetImageInfo (Public Method) + +DESCRIPTION: + Get the image information for the image specified by the given fully + qualified path + +PARAMETERS: + pFilePath [ I ] - Fully qualified path to image file + pImageType [ O ] - Image type + pImageID [ O ] - Unique image ID + pVersionID [ O ] - Version ID + versionSize [ I ] - The maximum number of characters including the NULL + terminator that can be copied to the version array + pVersion [ O ] - NULL-terminated string representing the version + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError GetImageInfo( + LPCSTR pFilePath, + BYTE * pImageType, + BYTE * pImageID, + ULONG * pVersionID, + USHORT versionSize, + CHAR * pVersion ); + +/*=========================================================================== +METHOD: + GetImagesInfo (Public Method) + +DESCRIPTION: + Return the info for the images located at the given path + +PARAMETERS: + path [ I ] - Fully qualified path + +RETURN VALUE: + std:vector - Vector of image information +===========================================================================*/ +std::vector GetImagesInfo( const std::string & path ); + +/*=========================================================================== +METHOD: + GetImageBootCompatibility (Public Method) + +DESCRIPTION: + Get the image boot compatibility for the image specified by the given + fully qualified path + +PARAMETERS: + pFilePath [ I ] - Fully qualified path to image file + pMajorVersion [ O ] - Major version of compatible boot downloader + pMinorVersion [ O ] - Minor version of compatible boot downloader + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError GetImageBootCompatibility( + LPCSTR pFilePath, + ULONG * pMajorVersion, + ULONG * pMinorVersion ); + +/*=========================================================================== +METHOD: + MapVersionInfo (Public Method) + +DESCRIPTION: + Map the specified version string to image capabilities + +PARAMETERS: + versionID [ I ] - Version ID + imageType [ I ] - Image type + pVersion [ I ] - Version string for image + pTechnology [ O ] - Technology type + pCarrier [ O ] - Carrier type + pRegion [ O ] - Region type + pGPSCapability [ O ] - GPS capability + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError MapVersionInfo( + ULONG versionID, + BYTE imageType, + LPCSTR pVersion, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ); + +/*=========================================================================== +METHOD: + GetImageByUniqueID (Public Method) + +DESCRIPTION: + Return the fully qualified path to an image specified by unique ID + +PARAMETERS: + pImageID [ I ] - Unique image ID + +RETURN VALUE: + std::string - Fully qualified path to matching image +===========================================================================*/ +std::string GetImageByUniqueID( BYTE * pImageID ); + + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQDLCore.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQDLCore.cpp new file mode 100755 index 0000000..66ac29a --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQDLCore.cpp @@ -0,0 +1,913 @@ +/*=========================================================================== +FILE: + GobiQDLCore.cpp + +DESCRIPTION: + QUALCOMM Gobi QDL Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQDLCore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQDLCore.h" + +#include "QDLBuffers.h" +#include "ProtocolNotification.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default/minimum timeout for QCWWAN QMI requests +const ULONG DEFAULT_GOBI_QDL_TIMEOUT = 4000; +const ULONG MINIMUM_GOBI_QDL_TIMEOUT = 2000; + +/*=========================================================================*/ +// cGobiQDLCore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiQDLCore (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiQDLCore::cGobiQDLCore() + : mQDL( 512, 512 ), + mQDLPortNode( "" ), + mQDLTimeout( DEFAULT_GOBI_QDL_TIMEOUT ) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cGobiQDLCore (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiQDLCore::~cGobiQDLCore() +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQDLCore::Initialize() +{ + // Nothing to do + return true; +} + +/*=========================================================================== +METHOD: + Cleanup (Public Method) + +DESCRIPTION: + Cleanup the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQDLCore::Cleanup() +{ + // Just in case + CloseQDLPort( false ); + + return true; +} + +/*=========================================================================== +METHOD: + GetAvailableQDLPorts (Public Method) + +DESCRIPTION: + Return the set of available Gobi QDL ports + +RETURN VALUE: + std::vector +===========================================================================*/ +std::vector cGobiQDLCore::GetAvailableQDLPorts() +{ + std::vector devices; + + std::string path = "/sys/bus/usb/devices/"; + char buf[PATH_MAX]; + + glob_t files; + int ret = glob( (path + "*/*/ttyUSB*").c_str(), + 0, + NULL, + &files ); + char *s; + if (ret != 0) + { + // Glob failure + return devices; + } + + for (int i = 0; i < files.gl_pathc; i++) + { + // Example "/sys/bus/usb/devices/8-1/8-1:1.1/ttyUSB0" + std::string nodePath = files.gl_pathv[i]; + + int lastSlash = nodePath.find_last_of( "/" ); + + // This is what we want to return if everything else matches + std::string deviceNode = nodePath.substr( lastSlash + 1 ); + + // Move down one directory to the interface level + std::string curPath = nodePath.substr( 0, lastSlash ); + + // Read bInterfaceNumber + int handle = open( (curPath + "/bInterfaceNumber").c_str(), + O_RDONLY ); + if (handle == -1) + { + continue; + } + + char buff[4]; + memset( buff, 0, 4 ); + + bool bFound = false; + ret = read( handle, buff, 2 ); + if (ret == 2) + { + // Interface 1 or 0 + ret = strncmp( buff, "01", 2 ); + if (ret == 0) + { + bFound = true; + } + ret = strncmp( buff, "00", 2 ); + if (ret == 0) + { + bFound = true; + } + + } + close( handle ); + + if (bFound == false) + { + continue; + } + + memset(buf, 0, sizeof(buf)); + if (readlink((curPath + "/driver").c_str(), buf, sizeof(buf)) < 0) + continue; + buf[sizeof(buf) - 1] = '\0'; + s = strrchr(buf, '/'); + s = s ? s + 1 : buf; + + if (strcmp(s, "qcserial") && strcmp(s, "QCSerial2k") + && strcmp(s, "GobiSerial")) + continue; + + // Success! + devices.push_back( deviceNode ); + } + globfree( &files ); + + return devices; +} + +/*=========================================================================== +METHOD: + SetQDLTimeout (Public Method) + +DESCRIPTION: + Set the timeout for all subsequent QDL transactions + +PARAMETERS: + to [ I ] - Timeout value (in milliseconds) + +RETURN VALUE: + eGobiError +===========================================================================*/ +eGobiError cGobiQDLCore::SetQDLTimeout( ULONG to ) +{ + if (to < MINIMUM_GOBI_QDL_TIMEOUT) + { + return eGOBI_ERR_INVALID_ARG; + } + + mQDLTimeout = to; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + OpenQDLPort (Public Method) + +DESCRIPTION: + This function opens the specified QDL port of the device + +PARAMETERS: + portID [ I ] - ID of QDL port to connect to + bBARMode [ I ] - Request boot and recovery mode feature + pMajorVersion [ O ] - Major version of the device boot downloader + pMinorVersion [ O ] - Minor version of the device boot downloader + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::OpenQDLPort( + std::string & portID, + ULONG bBARMode, + ULONG * pMajorVersion, + ULONG * pMinorVersion ) +{ + if (portID.empty() == true || pMajorVersion == 0 || pMinorVersion == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // First disconnect from current port (if any) + CloseQDLPort( false ); + + // Validate port ID + std::string foundDevice; + std::vector availPorts = GetAvailableQDLPorts(); + for (int index = 0; index < availPorts.size(); index++) + { + if (availPorts[index] == portID) + { + foundDevice = availPorts[index]; + break; + } + } + + if (foundDevice.empty() == true) + { + return eGOBI_ERR_INVALID_DEVID; + } + + // Initialize server (we don't care about the return code + // since the following Connect() call will fail if we are + // unable to initialize the server) + mQDL.Initialize(); + + // Connect to the port + std::string deviceStr = "/dev/" + foundDevice; + bool bOK = mQDL.Connect( deviceStr.c_str() ); + if (bOK == false) + { + return eGOBI_ERR_CONNECT; + } + + // Store port ID (we are connected) + mQDLPortNode = foundDevice; + + // Build the hello request + bool bBARFeature = bBARMode != 0; + sSharedBuffer * pHelloBuf = sQDLHello::BuildHelloReq( bBARFeature ); + if (pHelloBuf == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the hello request and wait for the response + sProtocolBuffer rsp; + rsp = SendQDL( pHelloBuf ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Extract major and minor boot downloader versions + ULONG majVer; + ULONG minVer; + sQDLHello helloRsp( rsp.GetSharedBuffer() ); + if (helloRsp.GetBootVersionInfo( majVer, minVer ) == false) + { + sQDLError errRsp( rsp.GetSharedBuffer() ); + if (errRsp.IsValid() == true) + { + eQDLError qdlErr = errRsp.GetErrorCode(); + return GetCorrectedQDLError( qdlErr ); + } + + return eGOBI_ERR_MALFORMED_RSP; + } + + // NOTE: in the current firmware implimentation, this cannot happen. + // No hello response will be received in case of feature mismatch. + if (bBARFeature == true) + { + const sQDLRawHelloRsp * pTmpRsp = helloRsp.GetResponse(); + if (pTmpRsp == 0) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + if ( (pTmpRsp->mFeatures & QDL_FEATURE_BAR_MODE) == 0) + { + return eGOBI_ERR_QDL_BAR_MODE; + } + } + + *pMajorVersion = majVer; + *pMinorVersion = minVer; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + CloseQDLPort (Public Method) + +DESCRIPTION: + This function closes the currently open QDL port of the device + +PARAMETERS: + bInformDevice [ I ] - Inform device that QDL port is being closed? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::CloseQDLPort( bool bInformDevice ) +{ + // Assume success + eGobiError rc = eGOBI_ERR_NONE; + if (mQDLPortNode.empty() == true) + { + rc = eGOBI_ERR_NO_CONNECTION; + } + else if (bInformDevice == true) + { + BYTE cmd = (BYTE)eQDL_CMD_SESSION_CLOSE_REQ; + eProtocolType pt = ePROTOCOL_QDL_TX; + + sSharedBuffer * pReq = 0; + pReq = new sSharedBuffer( (const BYTE *)&cmd, 1, pt ); + if (pReq == 0) + { + rc = eGOBI_ERR_MEMORY; + } + else + { + sProtocolBuffer rsp = SendQDL( pReq, 0, 0, false ); + rc = GetLastError(); + } + } + + mQDL.Disconnect(); + mQDL.Exit(); + + mQDLPortNode.clear(); + + return rc; +} + +/*=========================================================================== +METHOD: + GetQDLImagesPreference (Public Method) + +DESCRIPTION: + This function gets the current images preference as reported by the + device boot downloader + +PARAMETERS: + pImageListSize [I/O] - Upon input the maximum number of elements that the + image info list can contain. Upon successful output + the actual number of elements in the image info list + pImageList [ O ] - The image info list + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::GetQDLImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + if (pImageListSize == 0 || *pImageListSize == 0 || pImageList == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE cmd = (BYTE)eQDL_CMD_GET_IMAGE_PREF_REQ; + eProtocolType pt = ePROTOCOL_QDL_TX; + + sSharedBuffer * pReq = 0; + pReq = new sSharedBuffer( (const BYTE *)&cmd, 1, pt ); + if (pReq == 0) + { + return eGOBI_ERR_MEMORY; + } + + ULONG maxImages = (ULONG)*pImageListSize; + *pImageListSize = 0; + + sProtocolBuffer rsp = SendQDL( pReq ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + sQDLGetImagePref prefRsp( rsp.GetSharedBuffer() ); + if (prefRsp.IsValid() == false) + { + sQDLError errRsp( rsp.GetSharedBuffer() ); + if (errRsp.IsValid() == true) + { + eQDLError qdlErr = errRsp.GetErrorCode(); + return GetCorrectedQDLError( qdlErr ); + } + + return eGOBI_ERR_MALFORMED_RSP; + } + + std::list imageIDs = prefRsp.GetImageIDs(); + ULONG imageCount = (ULONG)imageIDs.size(); + if (imageCount > maxImages) + { + imageCount = maxImages; + } + + sQDLRawImageID * pOutList = (sQDLRawImageID *)pImageList; + std::list ::const_iterator pIter = imageIDs.begin(); + for (ULONG i = 0; i < imageCount; i++) + { + *pOutList++ = *pIter++; + } + + *pImageListSize = imageCount; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PrepareQDLImageWrite (Public Method) + +DESCRIPTION: + This function prepares the device boot downloader for an image write + +PARAMETERS: + imageType [ I ] - Type of image being written + imageSize [ I ] - Size of image being written + pBlockSize [I/O] - Upon input the maximum size of image block supported + by host, upon successful output the maximum size of + image block supported by device + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::PrepareQDLImageWrite( + BYTE imageType, + ULONG imageSize, + ULONG * pBlockSize ) +{ + eQDLImageType it = (eQDLImageType)imageType; + if (::IsValid( it ) == false) + { + return eGOBI_ERR_INVALID_ARG; + } + + if (pBlockSize == 0 || *pBlockSize == 0 || *pBlockSize > QDL_MAX_CHUNK_SIZE) + { + return eGOBI_ERR_INVALID_ARG; + } + + sSharedBuffer * pReq = 0; + pReq = sQDLOpenUnframed::BuildOpenUnframedReq( it, imageSize, *pBlockSize ); + if (pReq == 0) + { + return eGOBI_ERR_MEMORY; + } + + sProtocolBuffer rsp = SendQDL( pReq ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + ULONG tmp; + sQDLOpenUnframed openRsp( rsp.GetSharedBuffer() ); + const sQDLRawOpenUnframedRsp * pTmp = openRsp.GetResponse(); + if (pTmp == 0 || openRsp.GetChunkSize( tmp ) == false) + { + sQDLError errRsp( rsp.GetSharedBuffer() ); + if (errRsp.IsValid() == true) + { + eQDLError qdlErr = errRsp.GetErrorCode(); + return GetCorrectedQDLError( qdlErr ); + } + + return eGOBI_ERR_MALFORMED_RSP; + } + + if (openRsp.IsSuccess() == false) + { + switch ((eQDLOpenStatus)pTmp->mStatus) + { + case eQDL_OPEN_STATUS_SIZE: + return eGOBI_ERR_QDL_OPEN_SIZE; + + case eQDL_OPEN_STATUS_BAD_TYPE: + return eGOBI_ERR_QDL_OPEN_TYPE; + + case eQDL_OPEN_STATUS_PROTECTION: + return eGOBI_ERR_QDL_OPEN_PROT; + + case eQDL_OPEN_STATUS_NOT_NEEDED: + return eGOBI_ERR_QDL_OPEN_SKIP; + } + + return eGOBI_ERR_QDL_ERR_GENERAL; + } + + *pBlockSize = tmp; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + WriteQDLImageBlock (Public Method) + +DESCRIPTION: + This function writes the specified image block to the device + +PARAMETERS: + sequenceNumber [ I ] - Sequence number for image write + blockSize [ I ] - Size of image block + pImageBlock [ I ] - Image block + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::WriteQDLImageBlock( + USHORT sequenceNumber, + ULONG blockSize, + BYTE * pImageBlock ) +{ + if (blockSize > QDL_MAX_CHUNK_SIZE || pImageBlock == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + sSharedBuffer * pReq = 0; + pReq = sQDLWriteUnframed::BuildWriteUnframedReq( sequenceNumber, + blockSize ); + + if (pReq == 0) + { + return eGOBI_ERR_MEMORY; + } + + sProtocolBuffer rsp = SendQDL( pReq, pImageBlock, blockSize ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + sQDLWriteUnframed writeRsp( rsp.GetSharedBuffer() ); + const sQDLRawWriteUnframedRsp * pTmp = writeRsp.GetResponse(); + if (pTmp == 0) + { + sQDLError errRsp( rsp.GetSharedBuffer() ); + if (errRsp.IsValid() == true) + { + eQDLError qdlErr = errRsp.GetErrorCode(); + return GetCorrectedQDLError( qdlErr ); + } + + return eGOBI_ERR_MALFORMED_RSP; + } + + if (writeRsp.IsSuccess() == false) + { + switch ((eQDLWriteStatus)pTmp->mStatus) + { + case eQDL_WRITE_STATUS_CRC: + return eGOBI_ERR_QDL_CRC; + + case eQDL_WRITE_STATUS_CONTENT: + return eGOBI_ERR_QDL_PARSING; + } + + return eGOBI_ERR_QDL_ERR_GENERAL; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ValidateQDLImages (Public Method) + +DESCRIPTION: + This function requests the device validate the written images + +PARAMETERS: + pImageType [ O ] - Upon failure this may contain the type of the image + that failed validation + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQDLCore::ValidateQDLImages( BYTE * pImageType ) +{ + if (pImageType == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pImageType = UCHAR_MAX; + + BYTE cmd = (BYTE)eQDL_CMD_SESSION_DONE_REQ; + eProtocolType pt = ePROTOCOL_QDL_TX; + + sSharedBuffer * pReq = 0; + pReq = new sSharedBuffer( (const BYTE *)&cmd, 1, pt ); + if (pReq == 0) + { + return eGOBI_ERR_MEMORY; + } + + sProtocolBuffer rsp = SendQDL( pReq ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + sQDLDone doneRsp( rsp.GetSharedBuffer() ); + const sQDLRawDoneRsp * pTmp = doneRsp.GetResponse(); + if (pTmp == 0) + { + sQDLError errRsp( rsp.GetSharedBuffer() ); + if (errRsp.IsValid() == true) + { + eQDLError qdlErr = errRsp.GetErrorCode(); + return GetCorrectedQDLError( qdlErr ); + } + + return eGOBI_ERR_MALFORMED_RSP; + } + + if (doneRsp.IsSuccess() == false) + { + *pImageType = pTmp->mImageType; + switch ((eQDLDoneStatus)pTmp->mStatus) + { + case eQDL_DONE_STATUS_AUTH: + return eGOBI_ERR_QDL_AUTH; + + case eQDL_DONE_STATUS_WRITE: + return eGOBI_ERR_QDL_WRITE; + } + + return eGOBI_ERR_QDL_ERR_GENERAL; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SendQDL (Public Method) + +DESCRIPTION: + Send a QDL request and wait for and return response (if needed) + +PARAMETERS: + pRequest [ I ] - Request to schedule + pAuxData [ I ] - Auxiliary data for request + auxDataSz [ I ] - Size of auxiliary data + bWaitForResponse [ I ] - Wait for a response? + +RETURN VALUE: + sProtocolBuffer - The response (invalid when no response was received) +===========================================================================*/ +sProtocolBuffer cGobiQDLCore::SendQDL( + sSharedBuffer * pRequest, + const BYTE * pAuxData, + ULONG auxDataSz, + bool bWaitForResponse ) +{ + // Clear last error recorded + ClearLastError(); + + // Returned response + sProtocolBuffer rsp; + + // Validate the arguments + if (pRequest == 0) + { + mLastError = eGOBI_ERR_MEMORY; + return rsp; + } + + // We use the event based notification approach + cSyncQueue evts( 12, true ); + cProtocolQueueNotification pn( &evts ); + + // Process up to the indicated timeout + cEvent & sigEvt = evts.GetSignalEvent(); + + // Build the request object + sProtocolRequest req( pRequest, 0, mQDLTimeout, 1, 1, &pn ); + req.SetAuxiliaryData( pAuxData, auxDataSz ); + if (bWaitForResponse == false) + { + req.SetTXOnly(); + } + + // Are we connected? + if ( (mQDLPortNode.empty() == true) + || (mQDL.IsConnected() == false) ) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return rsp; + } + + // Grab the log from the server + const cProtocolLog & protocolLog = mQDL.GetLog(); + + // Schedule the request + ULONG reqID = mQDL.AddRequest( req ); + if (reqID == INVALID_REQUEST_ID) + { + mLastError = eGOBI_ERR_REQ_SCHEDULE; + return rsp; + } + + bool bReq = false; + bool bExit = false; + DWORD idx; + + // Process up to the indicated timeout + while (bExit == false) + { + int wc = sigEvt.Wait( mQDLTimeout, idx ); + if (wc == ETIME) + { + if (bReq == true) + { + mLastError = eGOBI_ERR_RESPONSE_TO; + } + else + { + mLastError = eGOBI_ERR_REQUEST_TO; + } + break; + } + else if (wc != 0) + { + mLastError = eGOBI_ERR_INTERNAL; + break; + } + + sProtocolNotificationEvent evt; + bool bEvt = evts.GetElement( idx, evt ); + if (bEvt == false) + { + mLastError = eGOBI_ERR_INTERNAL; + bExit = true; + break; + } + + switch (evt.mEventType) + { + case ePROTOCOL_EVT_REQ_ERR: + mLastError = eGOBI_ERR_REQUEST; + bExit = true; + break; + + case ePROTOCOL_EVT_RSP_ERR: + mLastError = eGOBI_ERR_RESPONSE; + bExit = true; + break; + + case ePROTOCOL_EVT_REQ_SENT: + { + bReq = true; + if (bWaitForResponse == false) + { + // Success! + bExit = true; + } + } + break; + + case ePROTOCOL_EVT_RSP_RECV: + // Success! + rsp = protocolLog.GetBuffer( evt.mParam2 ); + bExit = true; + break; + } + } + + if ( (mLastError == eGOBI_ERR_INTERNAL) + || (mLastError == eGOBI_ERR_REQUEST_TO) + || (mLastError == eGOBI_ERR_RESPONSE_TO) ) + { + // Remove the request as our protocol notification object is + // about to go out of scope and hence be destroyed + mQDL.RemoveRequest( reqID ); + } + + return rsp; +} + +/*=========================================================================== +METHOD: + GetConnectedPortID (Public Method) + +DESCRIPTION: + Get the device node of the currently connected Gobi device + +PARAMETERS: + devNode [ O ] - Device node (IE: ttyUSB0) + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQDLCore::GetConnectedPortID( std::string & devNode ) +{ + // Assume failure + bool bFound = false; + + devNode.clear(); + + // Were we once connected? + if (mQDLPortNode.size() > 0) + { + // Yes, but is our device still present? + // NOTE: This does not garantee the device did not leave and come back + std::vector devices = GetAvailableQDLPorts(); + ULONG deviceCount = (ULONG)devices.size(); + + for (ULONG a = 0; a < deviceCount; a++) + { + if (devices[a] == mQDLPortNode) + { + devNode = devices[a]; + + bFound = true; + break; + } + } + + if (bFound == false) + { + mLastError = eGOBI_ERR_NO_DEVICE; + } + } + else + { + // We are not connected + mLastError = eGOBI_ERR_NO_CONNECTION; + } + + return bFound; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQDLCore.h b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQDLCore.h new file mode 100755 index 0000000..e8c84ec --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQDLCore.h @@ -0,0 +1,167 @@ +/*=========================================================================== +FILE: + GobiQDLCore.h + +DESCRIPTION: + QUALCOMM Gobi QDL Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQDLCore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "ProtocolBuffer.h" +#include "QDLProtocolServer.h" +#include "GobiError.h" +#include "GobiMBNMgmt.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Class cGobiQDLCore +/*=========================================================================*/ +class cGobiQDLCore +{ + public: + // Constructor + cGobiQDLCore(); + + // Destructor + virtual ~cGobiQDLCore(); + + // Initialize the object + virtual bool Initialize(); + + // Cleanup the object + virtual bool Cleanup(); + + // Return the set of available Gobi QDL ports + std::vector GetAvailableQDLPorts(); + + // Set the timeout for QDL transactions + eGobiError SetQDLTimeout( ULONG to ); + + // Open the specified QDL port of the device + eGobiError OpenQDLPort( + std::string & portID, + ULONG bBARMode, + ULONG * pMajorVersion, + ULONG * pMinorVersion ); + + // Close the specified QDL port of the device + eGobiError CloseQDLPort( bool bInformDevice ); + + // Get the images preference as from the device boot downloader + eGobiError GetQDLImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ); + + // Prepare the device boot downloader for an image write + eGobiError PrepareQDLImageWrite( + BYTE imageType, + ULONG imageSize, + ULONG * pBlockSize ); + + // Write the specified image block to the device + eGobiError WriteQDLImageBlock( + USHORT sequenceNumber, + ULONG chunkSize, + BYTE * pImageBlock ); + + // Request the device validate the written images + eGobiError ValidateQDLImages( BYTE * pImageType ); + + // Send a QDL request and wait for and return response + sProtocolBuffer SendQDL( + sSharedBuffer * pRequest, + const BYTE * pAuxData = 0, + ULONG auxDataSz = 0, + bool bWAitForResponse = true ); + + // Get currently connected port ID + bool GetConnectedPortID( std::string & portNode ); + + // (Inline) Clear last error recorded + void ClearLastError() + { + mLastError = eGOBI_ERR_NONE; + }; + + // (Inline) Get last error recorded + eGobiError GetLastError() + { + return mLastError; + }; + + // (Inline) Return the last recorded error (if this happens to indicate + // that no error occurred then return eGOBI_ERR_INTERNAL) + eGobiError GetCorrectedLastError() + { + eGobiError ec = GetLastError(); + if (ec == eGOBI_ERR_NONE) + { + ec = eGOBI_ERR_INTERNAL; + } + + return ec; + }; + + // (Inline) Return the correct QDL error + eGobiError GetCorrectedQDLError( ULONG qdlError ) + { + ULONG ec = qdlError + (ULONG)eGOBI_ERR_QDL_OFFSET; + return (eGobiError)ec; + }; + + protected: + /* QDL protocol server */ + cQDLProtocolServer mQDL; + + /* ID of QDL port device node is connected to */ + std::string mQDLPortNode; + + /* Timeout for QDL transactions (in milliseconds) */ + ULONG mQDLTimeout; + + /* Last error recorded */ + eGobiError mLastError; +}; + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICore.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICore.cpp new file mode 100755 index 0000000..64ed86a --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICore.cpp @@ -0,0 +1,1042 @@ +/*=========================================================================== +FILE: + GobiQMICore.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" +#include "ProtocolNotification.h" +#include "CoreUtilities.h" + +extern "C" { +#include +#include +#include +}; + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default timeout for Gobi QMI requests +const ULONG DEFAULT_GOBI_QMI_TIMEOUT = 2000; + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + FindTLV (Free Method) + +DESCRIPTION: + Find the given TLV + +PARAMETERS: + tlvs [ I ] - TLV parsing input vector + tlvKey [ I ] - Key of the TLV that is to be found + +RETURN VALUE: + cDataParser::tParsedFields +===========================================================================*/ +sDB2NavInput FindTLV( + const std::vector & tlvs, + const sProtocolEntityKey & tlvKey ) +{ + sDB2NavInput retNI; + + // We need some TLVs to parse and a valid QMI DB key + ULONG tlvCount = (ULONG)tlvs.size(); + if (tlvCount == 0 || tlvKey.mKey.size() < 3) + { + return retNI; + } + + for (ULONG t = 0; t < tlvCount; t++) + { + const sDB2NavInput & ni = tlvs[t]; + if (tlvKey.mKey == ni.mKey) + { + retNI = ni; + break; + } + } + + return retNI; +} + +/*=========================================================================== +METHOD: + ParseTLV (Free Method) + +DESCRIPTION: + Parse the given TLV to fields + +PARAMETERS: + db [ I ] - Database to use + qmiBuf [ I ] - Original buffer containing TLV (locks data) + tlvs [ I ] - TLV parsing input vector + tlvKey [ I ] - Key of the TLV that is to be parsed + bFieldStrings [ I ] - Generate field value strings? + +RETURN VALUE: + cDataParser::tParsedFields +===========================================================================*/ +cDataParser::tParsedFields ParseTLV( + const cCoreDatabase & db, + const sProtocolBuffer & qmiBuf, + const std::vector & tlvs, + const sProtocolEntityKey & tlvKey, + bool bFieldStrings ) +{ + cDataParser::tParsedFields retFields; + + // We need some TLVs to parse and a valid QMI DB key + ULONG tlvCount = (ULONG)tlvs.size(); + if (tlvCount == 0 || tlvKey.mKey.size() < 3) + { + return retFields; + } + + for (ULONG t = 0; t < tlvCount; t++) + { + const sDB2NavInput & ni = tlvs[t]; + if (tlvKey.mKey == ni.mKey) + { + cDataParser dp( db, qmiBuf, tlvKey, ni.mpPayload, ni.mPayloadLen ); + dp.Parse( bFieldStrings, false ); + + retFields = dp.GetFields(); + break; + } + } + + return retFields; +} + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + cGobiQMICore (Public Method) + +DESCRIPTION: + Constructor + +RETURN VALUE: + None +===========================================================================*/ +cGobiQMICore::cGobiQMICore() + : mbFailOnMultipleDevices( false ), + mDeviceNode( "" ), + mDeviceKey( "" ), + mLastError( eGOBI_ERR_NONE ), + mRequests( 16 ), + mLastNetStartID( (WORD)INVALID_QMI_TRANSACTION_ID ), + mVid(0xBAADBEEF), mPid(0xCAFEBABE) +{ + // Nothing to do +} + +/*=========================================================================== +METHOD: + ~cGobiQMICore (Public Method) + +DESCRIPTION: + Destructor + +RETURN VALUE: + BOOL +===========================================================================*/ +cGobiQMICore::~cGobiQMICore() +{ + Cleanup(); +} + +/*=========================================================================== +METHOD: + Initialize (Public Method) + +DESCRIPTION: + Initialize the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Initialize() +{ + // Initialize database + mDB.Initialize(); + + // Allocate configured QMI servers + bool bOK = true; + std::set ::const_iterator pIter = mServerConfig.begin(); + while (pIter != mServerConfig.end()) + { + cQMIProtocolServer * pSvr = 0; + pSvr = new cQMIProtocolServer( pIter->first, 8192, 512 ); + if (pSvr == 0) + { + if (pIter->second == true) + { + bOK = false; + break; + } + } + else + { + mServers[pIter->first] = pSvr; + } + + pIter++; + } + + if (bOK == false) + { + Cleanup(); + } + + return bOK; +} + +/*=========================================================================== +METHOD: + Cleanup (Public Method) + +DESCRIPTION: + Cleanup the object + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Cleanup() +{ + Disconnect(); + + // Free allocated QMI servers + std::map ::const_iterator pIter; + pIter = mServers.begin(); + + while (pIter != mServers.end()) + { + cQMIProtocolServer * pSvr = pIter->second; + if (pSvr != 0) + { + delete pSvr; + } + + pIter++; + } + + mServers.clear(); + + return true; +} + +GobiType cGobiQMICore::GetDeviceType() +{ + return ::GetDeviceType(mVid, mPid); +} + +/*=========================================================================== +METHOD: + GetAvailableDevices (Public Method) + +DESCRIPTION: + Return the set of available Gobi network devices + +RETURN VALUE: + std::vector - Vector of device ID and device key pairs +===========================================================================*/ +std::vector +cGobiQMICore::GetAvailableDevices() +{ + std::vector devices; + + std::string path = "/sys/bus/usb/devices/"; + char buf[PATH_MAX]; + char *s; + + glob_t files; + int ret = glob( (path + "*/*/*/qcqmi*").c_str(), + 0, + NULL, + &files ); + if (ret != 0) + { + // Glob failure + return devices; + } + + for (int i = 0; i < files.gl_pathc; i++) + { + // Example "/sys/bus/usb/devices/8-1/8-1:1.0/GobiQMI/qcqmi0" + std::string nodePath = files.gl_pathv[i]; + + int lastSlash = nodePath.find_last_of( "/" ); + + // This is what we want to return if everything else matches + std::string deviceNode = nodePath.substr( lastSlash + 1 ); + + // Move down two directories to the interface level + std::string curPath = nodePath.substr( 0, lastSlash ); + curPath = curPath.substr( 0, curPath.find_last_of( "/" ) ); + + // Read bInterfaceNumber + int handle = open( (curPath + "/bInterfaceNumber").c_str(), + O_RDONLY ); + if (handle == -1) + { + continue; + } + + char buff[4]; + memset( buff, 0, 4 ); + + bool bFound = false; + ret = read( handle, buff, 2 ); + if (ret == 2) + { + ret = strncmp( buff, "00", 2 ); + if (ret == 0) + { + bFound = true; + } + + ret = strncmp( buff, "05", 2 ); + if (ret == 0) + { + bFound = true; + } + } + close( handle ); + + if (bFound == false) + { + continue; + } + + memset(buf, 0, sizeof(buf)); + if (readlink((curPath + "/driver").c_str(), buf, sizeof(buf)) < 0) + continue; + buf[sizeof(buf) - 1] = '\0'; + s = strrchr(buf, '/'); + s = s ? s + 1 : buf; + + if (strcmp(s, "gobi")) + continue; + + // Device node success! + + // Get MEID of device node (via ioctl) to use as key + std::string deviceStr = "/dev/" + deviceNode; + std::string key = cQMIProtocolServer::GetDeviceMEID( deviceStr ); + + tDeviceID device; + device.first = deviceNode; + device.second = key; + + devices.push_back( device ); + } + globfree( &files ); + + return devices; +} + +static unsigned int getvidpid(const char *devname) +{ + char buf[PATH_MAX + 1]; + char nbuf[PATH_MAX + 1]; + char idproduct[16]; + char idvendor[16]; + int fd; + + snprintf(buf, sizeof(buf), "/sys/class/QCQMI/%s/../../..", devname); + memset(nbuf, 0, sizeof(nbuf)); + if (!realpath(buf, nbuf)) { + return 0; + } + + snprintf(buf, sizeof(buf), "%s/idVendor", nbuf); + fd = open(buf, O_RDONLY); + if (fd < 0) { + return 0; + } + if (read(fd, idvendor, sizeof(idvendor)) <= 0) { + return 0; + } + close(fd); + + snprintf(buf, sizeof(buf), "%s/idProduct", nbuf); + fd = open(buf, O_RDONLY); + if (fd < 0) { + return 0; + } + if (read(fd, idproduct, sizeof(idproduct)) <= 0) { + return 0; + } + close(fd); + + return (strtoul(idvendor, NULL, 16) << 16) | strtoul(idproduct, NULL, 16); +} + +/*=========================================================================== +METHOD: + Connect (Public Method) + +DESCRIPTION: + Connect to the specified (or first detected) Gobi device + + Both device node and key are case sensitive + +PARAMETERS: + pDeviceNode [ I ] - The device node + pDeviceKey [ I ] - The device key (unique, stored on-device) + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Connect( + LPCSTR pDeviceNode, + LPCSTR pDeviceKey ) +{ + // Assume failure + bool bRC = false; + + // Clear last error recorded + ClearLastError(); + + // If you specify a device key then you have to specify a device ID + if (pDeviceNode == 0 && pDeviceKey != 0) + { + mLastError = eGOBI_ERR_INVALID_ARG; + return bRC; + } + + // First we terminate the current connection + Disconnect(); + + // Query system for list of active Gobi devices + std::vector devices = GetAvailableDevices(); + + // Did we find any devices? + ULONG deviceCount = (ULONG)devices.size(); + if (deviceCount == 0) + { + mLastError = eGOBI_ERR_NO_DEVICE; + return bRC; + } + + std::string deviceKey = ""; + if (pDeviceKey != 0) + { + deviceKey = pDeviceKey; + } + + // Filter that list to include only the specified device? + if (pDeviceNode != 0) + { + std::vector ::iterator current = devices.begin(); + while (current != devices.end()) + { + // Remove if device node doesn't match + if (current->first.compare( pDeviceNode ) != 0) + { + // Erase current element and update ourself to point to next + current = devices.erase( current ); + } + // Remove if invalid key is specified + else if (deviceKey.size() != 0 + && current->second.compare( deviceKey ) != 0) + { + current = devices.erase( current ); + } + // All necessary parameters match + else + { + current++; + } + } + } + + // Anything left after filtering? + deviceCount = (ULONG)devices.size(); + if (deviceCount == 0) + { + mLastError = eGOBI_ERR_NO_DEVICE; + return bRC; + } + + // Too many to choose from? + if (deviceCount > 1 && mbFailOnMultipleDevices == true) + { + mLastError = eGOBI_ERR_MULTIPLE_DEVICES; + return bRC; + } + + // Store device ID/key strings + mDeviceNode = devices[0].first; + mDeviceKey = devices[0].second; + + unsigned int vidpid = getvidpid(mDeviceNode.c_str()); + mVid = (vidpid >> 16) & 0xFFFF; + mPid = vidpid & 0xFFFF; + + // Initalize/connect all configured QMI servers + std::map ::const_iterator pIter; + pIter = mServers.begin(); + + while (pIter != mServers.end()) + { + cQMIProtocolServer * pSvr = pIter->second; + if (pSvr != 0) + { + // Initialize server (we don't care about the return code + // since the following Connect() call will fail if we are + // unable to initialize the server) + pSvr->Initialize(); + + std::string deviceStr = "/dev/" + mDeviceNode; + bRC = pSvr->Connect( deviceStr.c_str() ); + if (bRC == false) + { + tServerConfig tsc( pIter->first, true ); + if (mServerConfig.find( tsc ) != mServerConfig.end()) + { + // Failure on essential server + break; + } + else + { + // QMI server non-essential (ignore failure) + bRC = true; + } + } + } + + pIter++; + } + + // Any server fail? + if (bRC == false) + { + // Yes, disconnect them all + Disconnect(); + + // ... and set the error code + mLastError = eGOBI_ERR_CONNECT; + } + + return bRC; +} + +/*=========================================================================== +METHOD: + Disconnect (Public Method) + +DESCRIPTION: + Disconnect from the currently connected Gobi device + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::Disconnect() +{ + // Clear last error recorded + ClearLastError(); + + // Assume failure + bool bRC = false; + if (mDeviceNode.size() > 0) + { + mDeviceNode.clear(); + mDeviceKey.clear(); + bRC = true; + } + else + { + mLastError = eGOBI_ERR_NO_CONNECTION; + } + + // Disconnect/clean-up all configured QMI servers + std::map ::const_iterator pIter; + pIter = mServers.begin(); + + while (pIter != mServers.end()) + { + cQMIProtocolServer * pSvr = pIter->second; + if (pSvr != 0) + { + pSvr->Disconnect(); + pSvr->Exit(); + } + + pIter++; + } + + mVid = 0xDEADD00D; + mPid = 0xDEADD00D; + + return bRC; +} + +/*=========================================================================== +METHOD: + GetConnectedDeviceID (Public Method) + +DESCRIPTION: + Get the device node/key of the currently connected Gobi device + +PARAMETERS: + devNode [ O ] - Device node (IE: qcqmi0) + devKey [ O ] - Device key (may be empty) + +RETURN VALUE: + bool +===========================================================================*/ +bool cGobiQMICore::GetConnectedDeviceID( + std::string & devNode, + std::string & devKey ) +{ + // Clear last error recorded + ClearLastError(); + + // Assume failure + bool bFound = false; + devNode.clear(); + devKey.clear(); + + // Are all required servers connected? + bool bAllConnected = true; + + std::map ::const_iterator pIter; + pIter = mServers.begin(); + + while (pIter != mServers.end()) + { + tServerConfig tsc( pIter->first, true ); + cQMIProtocolServer * pSvr = pIter->second; + + if (mServerConfig.find( tsc ) != mServerConfig.end() && pSvr != 0) + { + if (pSvr->IsConnected() == false) + { + // Failure on essential server + bAllConnected = false; + break; + } + } + + pIter++; + } + + // Were we once connected? + if (mDeviceNode.size() > 0 && bAllConnected == true) + { + // Yes, but is our device still present? + // NOTE: This does not guarantee the device did not leave and come back + std::vector devices = GetAvailableDevices(); + ULONG deviceCount = (ULONG)devices.size(); + + for (ULONG a = 0; a < deviceCount; a++) + { + if (devices[a].first == mDeviceNode) + { + // If there is a device key specified, it must match. + if (mDeviceKey.size() > 0) + { + if (devices[a].second == mDeviceKey) + { + devNode = devices[a].first; + devKey = devices[a].second; + + bFound = true; + break; + } + } + else + { + devNode = devices[a].first; + + bFound = true; + break; + } + } + } + + if (bFound == false) + { + mLastError = eGOBI_ERR_NO_DEVICE; + } + } + else + { + // We are not connected + mLastError = eGOBI_ERR_NO_CONNECTION; + } + + return bFound; +} + +/*=========================================================================== +METHOD: + Send (Public Method) + +DESCRIPTION: + Send a request using the specified QMI protocol server and wait for (and + then return) the response + +PARAMETERS: + svc [ I ] - QMI service type + pRequest [ I ] - Request to schedule + to [ I ] - Timeout value (in milliseconds) + +RETURN VALUE: + sProtocolBuffer - The response (invalid when no response was received) +===========================================================================*/ +sProtocolBuffer cGobiQMICore::Send( + eQMIService svc, + sSharedBuffer * pRequest, + ULONG to ) +{ + // Clear last error recorded + ClearLastError(); + + // Returned response + sProtocolBuffer rsp; + + // Validate the arguments + if (pRequest == 0) + { + mLastError = eGOBI_ERR_MEMORY; + return rsp; + } + + // We use the event based notification approach + cSyncQueue evts( 12, true ); + cProtocolQueueNotification pn( &evts ); + + // Process up to the indicated timeout + cEvent & sigEvt = evts.GetSignalEvent(); + + // Build the request object + sProtocolRequest req( pRequest, 0, to, 1, 1, &pn ); + if (to == 0) + { + mLastError = eGOBI_ERR_INTERNAL; + return rsp; + } + + // Grab the server + cQMIProtocolServer * pSvr = GetServer( svc ); + if (pSvr == 0) + { + mLastError = eGOBI_ERR_INTERNAL; + return rsp; + } + + // Are we connected? + if (mDeviceNode.size() <= 0 || pSvr->IsConnected() == false) + { + mLastError = eGOBI_ERR_NO_CONNECTION; + return rsp; + } + + // Grab the log from the server + const cProtocolLog & protocolLog = pSvr->GetLog(); + + // Schedule the request + ULONG reqID = pSvr->AddRequest( req ); + if (reqID == INVALID_REQUEST_ID) + { + mLastError = eGOBI_ERR_REQ_SCHEDULE; + return rsp; + } + + // Store for external cancel + tServiceRequest sr( svc, reqID ); + mRequests.AddElement( sr ); + + bool bReq = false; + bool bExit = false; + DWORD idx; + + // Process up to the indicated timeout + while (bExit == false) + { + int wc = sigEvt.Wait( to, idx ); + if (wc == ETIME) + { + if (bReq == true) + { + mLastError = eGOBI_ERR_RESPONSE_TO; + } + else + { + mLastError = eGOBI_ERR_REQUEST_TO; + } + break; + } + else if (wc != 0) + { + mLastError = eGOBI_ERR_INTERNAL; + break; + } + + sProtocolNotificationEvent evt; + bool bEvt = evts.GetElement( idx, evt ); + if (bEvt == false) + { + mLastError = eGOBI_ERR_INTERNAL; + bExit = true; + break; + } + + switch (evt.mEventType) + { + case ePROTOCOL_EVT_REQ_ERR: + mLastError = eGOBI_ERR_REQUEST; + bExit = true; + break; + + case ePROTOCOL_EVT_RSP_ERR: + mLastError = eGOBI_ERR_RESPONSE; + bExit = true; + break; + + case ePROTOCOL_EVT_REQ_SENT: + { + // Are we doing WDS business? + if (svc == eQMI_SVC_WDS) + { + // Grab the as-sent request + DWORD id = evt.mParam2; + sProtocolBuffer tmpReq = protocolLog.GetBuffer( id ); + sSharedBuffer * pTmpRequest = tmpReq.GetSharedBuffer(); + if (pTmpRequest != 0) + { + // Check the message ID + sQMIServiceBuffer actualReq( pTmpRequest ); + ULONG msgID = actualReq.GetMessageID(); + if (msgID == (ULONG)eQMI_WDS_START_NET) + { + // Grab the transaction ID + mLastNetStartID = actualReq.GetTransactionID(); + } + } + } + + bReq = true; + } + break; + + case ePROTOCOL_EVT_RSP_RECV: + // Success! + rsp = protocolLog.GetBuffer( evt.mParam2 ); + bExit = true; + break; + } + } + + if ( (mLastError == eGOBI_ERR_INTERNAL) + || (mLastError == eGOBI_ERR_REQUEST_TO) + || (mLastError == eGOBI_ERR_RESPONSE_TO) ) + { + // Remove the request as our protocol notification object is + // about to go out of scope and hence be destroyed + pSvr->RemoveRequest( reqID ); + } + + // Check that the device is still there? + if ( (mLastError == eGOBI_ERR_REQUEST) + || (mLastError == eGOBI_ERR_RESPONSE) + || (mLastError == eGOBI_ERR_REQUEST_TO) + || (mLastError == eGOBI_ERR_RESPONSE_TO) ) + { + eGobiError tmp = mLastError; + + std::string dummy; + GetConnectedDeviceID( dummy, dummy ); + if (mLastError == eGOBI_ERR_NONE) + { + mLastError = tmp; + } + } + + return rsp; +} + +/*=========================================================================== +METHOD: + SendAndCheckReturn (Public Method) + +DESCRIPTION: + Send a request using the specified QMI protocol server and wait for (and + then validate) the response + +PARAMETERS: + svc [ I ] - QMI service type + pRequest [ I ] - Request to schedule + to [ I ] - Timeout value (in milliseconds) + +RETURN VALUE: + eGobiError - Corrected error code +===========================================================================*/ +eGobiError cGobiQMICore::SendAndCheckReturn( + eQMIService svc, + sSharedBuffer * pRequest, + ULONG to ) +{ + sProtocolBuffer rsp = Send( svc, pRequest, to ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + mLastError = eGOBI_ERR_MALFORMED_RSP; + return mLastError; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + mLastError = eGOBI_ERR_MALFORMED_RSP; + return mLastError; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Success! + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SendSimple (Public Method) + +DESCRIPTION: + Generate/send a request using the specified QMI protocol server and + wait for (and then return) the response + +PARAMETERS: + svc [ I ] - QMI service type + msgID [ I ] - QMI message ID of the request to generate + to [ I ] - Timeout value (in milliseconds) + + NOTE: The request has to be a single byte in length, i.e. just a + command code, in order for success + +RETURN VALUE: + sProtocolBuffer - The response (invalid when no response was received) +===========================================================================*/ +sProtocolBuffer cGobiQMICore::SendSimple( + eQMIService svc, + WORD msgID, + ULONG to ) +{ + // Clear last error recorded + ClearLastError(); + + sProtocolBuffer rsp; + + sSharedBuffer * pReq = 0; + pReq = sQMIServiceBuffer::BuildBuffer( svc, msgID ); + if (pReq == 0) + { + mLastError = eGOBI_ERR_MEMORY; + return rsp; + } + + rsp = Send( svc, pReq, to ); + return rsp; +} + +/*=========================================================================== +METHOD: + CancelSend (Public Method) + +DESCRIPTION: + Cancel the most recent in-progress Send() based operation + +RETURN VALUE: + eGobiError +===========================================================================*/ +eGobiError cGobiQMICore::CancelSend() +{ + ULONG reqs = mRequests.GetTotalCount(); + if (reqs == 0) + { + return eGOBI_ERR_NO_CANCELABLE_OP; + } + + tServiceRequest elem( eQMI_SVC_ENUM_BEGIN, INVALID_REQUEST_ID ); + bool bElem = mRequests.GetElement( --reqs, elem ); + if (bElem == false) + { + return eGOBI_ERR_INTERNAL; + } + + cQMIProtocolServer * pSvr = GetServer( elem.first ); + if (pSvr == 0) + { + return eGOBI_ERR_INTERNAL; + } + + + bool bRemove = pSvr->RemoveRequest( elem.second ); + if (bRemove == false) + { + return eGOBI_ERR_CANCEL_OP; + } + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICore.h b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICore.h new file mode 100755 index 0000000..5f471ca --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICore.h @@ -0,0 +1,1036 @@ +/*=========================================================================== +FILE: + GobiQMICore.h + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +/*=========================================================================*/ +// Pragmas +/*=========================================================================*/ +#pragma once + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "apidefs.h" + +#include "CoreDatabase.h" +#include "ProtocolBuffer.h" +#include "QMIProtocolServer.h" +#include "DataParser.h" +#include "DataPacker.h" +#include "DB2Utilities.h" +#include "SyncQueue.h" +#include "GobiError.h" +#include "GobiMBNMgmt.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Default timeout for Gobi QMI requests +extern const ULONG DEFAULT_GOBI_QMI_TIMEOUT; + +/*=========================================================================*/ +// Prototypes +/*=========================================================================*/ + +// Find the given TLV +sDB2NavInput FindTLV( + const std::vector & tlvs, + const sProtocolEntityKey & tlvKey ); + +// Parse the given TLV to fields +cDataParser::tParsedFields ParseTLV( + const cCoreDatabase & db, + const sProtocolBuffer & qmiBuf, + const std::vector & tlvs, + const sProtocolEntityKey & tlvKey, + bool bFieldStrings = false ); + +/*=========================================================================*/ +// Class cGobiQMICore +/*=========================================================================*/ +class cGobiQMICore +{ + public: + // Constructor + cGobiQMICore(); + + // Destructor + virtual ~cGobiQMICore(); + + // Initialize the object + virtual bool Initialize(); + + // Cleanup the object + virtual bool Cleanup(); + + // (Inline) Return the QMI database + const cCoreDatabase & GetDatabase() + { + return mDB; + }; + + // (Inline) Return the server as determined by the service type + cQMIProtocolServer * GetServer( eQMIService svc ) + { + cQMIProtocolServer * pSvr = 0; + + std::map ::const_iterator pIter; + pIter = mServers.find( svc ); + + if (pIter != mServers.end()) + { + pSvr = pIter->second; + } + + return pSvr; + }; + + // (Inline) Clear last error recorded + void ClearLastError() + { + mLastError = eGOBI_ERR_NONE; + }; + + // (Inline) Get last error recorded + eGobiError GetLastError() + { + return mLastError; + }; + + // (Inline) Return the last recorded error (if this happens to indicate + // that no error occurred then return eGOBI_ERR_INTERNAL) + eGobiError GetCorrectedLastError() + { + eGobiError ec = GetLastError(); + if (ec == eGOBI_ERR_NONE) + { + ec = eGOBI_ERR_INTERNAL; + } + + return ec; + }; + + // (Inline) Return the correct QMI error (if this happens to indicate + // that no error occurred then return the mapped eQMI_ERR_INTERNAL + // value) + eGobiError GetCorrectedQMIError( ULONG qmiErrorCode ) + { + ULONG ec = (ULONG)eQMI_ERR_INTERNAL + (ULONG)eGOBI_ERR_QMI_OFFSET; + if (qmiErrorCode != (ULONG)eQMI_ERR_NONE) + { + ec = qmiErrorCode + (ULONG)eGOBI_ERR_QMI_OFFSET; + } + + return (eGobiError)ec; + }; + + // Return the set of available Gobi devices + typedef std::pair tDeviceID; + virtual std::vector GetAvailableDevices(); + + // Return the type of the currently connected device + GobiType GetDeviceType(); + + // Connect to the specified (or first detected) Gobi device + virtual bool Connect( + LPCSTR pDeviceNode = 0, + LPCSTR pDeviceKey = 0 ); + + // Disconnect from the currently connected Gobi device + virtual bool Disconnect(); + + // Get the device ID of the currently connected Gobi device + virtual bool GetConnectedDeviceID( + std::string & devNode, + std::string & devKey ); + + // Send a request using the specified QMI protocol server and wait + // for (and then return) the response + sProtocolBuffer Send( + eQMIService svc, + sSharedBuffer * pRequest, + ULONG to = DEFAULT_GOBI_QMI_TIMEOUT ); + + // Send a request using the specified QMI protocol server and wait + // for (and then validate) the response + eGobiError SendAndCheckReturn( + eQMIService svc, + sSharedBuffer * pRequest, + ULONG to = DEFAULT_GOBI_QMI_TIMEOUT ); + + // Generate/send a request using the specified QMI protocol server + // and wait for (and then return) the response + sProtocolBuffer SendSimple( + eQMIService svc, + WORD msgID, + ULONG to = DEFAULT_GOBI_QMI_TIMEOUT ); + + // Cancel the most recent in-progress Send() based operation + eGobiError CancelSend(); + +#ifdef WDS_SUPPORT + // Return the state of the current packet data session + eGobiError GetSessionState( ULONG * pState ); + + // Return the duration of the current packet data session + eGobiError GetSessionDuration( ULONGLONG * pDuration ); + + // Return the active/total durations of the current packet data session + eGobiError GetSessionDurations( + ULONGLONG * pActiveDuration, + ULONGLONG * pTotalDuration ); + + // Return the dormancy state of the current packet session + eGobiError GetDormancyState( ULONG * pState ); + + // Return the current autoconnect data session setting + eGobiError GetEnhancedAutoconnect( + ULONG * pSetting, + ULONG * pRoamSetting ); + + // Set the autoconnect data session setting + eGobiError SetEnhancedAutoconnect( + ULONG setting, + ULONG * pRoamSetting ); + + // Write the default profile settings to the device + eGobiError SetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ); + + // Read the default profile settings from the device + eGobiError GetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ); + + // Activate a packet data session + eGobiError StartDataSession( + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword, + ULONG * pSessionId, + ULONG * pFailureReason ); + + // Cancel an in-progress packet data session activation + eGobiError CancelDataSession(); + + // Stop the current data session + eGobiError StopDataSession( ULONG sessionId ); + + // Return the current packet data session IP address + eGobiError GetIPAddress( ULONG * pIPAddress ); + + // Return connection rate information for the packet data connection + eGobiError GetConnectionRate( + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ); + + // Return the packet data transfer statistics + eGobiError GetPacketStatus( + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ); + + // Returns the RX/TX byte counts + eGobiError GetByteTotals( + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ); + + // Set the current mobile IP setting + eGobiError SetMobileIP( ULONG mode ); + + // Get the current mobile IP setting + eGobiError GetMobileIP( ULONG * pMode ); + + // Set the active mobile IP profile index + eGobiError SetActiveMobileIPProfile( + CHAR * pSPC, + BYTE index ); + + // Get the active mobile IP profile index + eGobiError GetActiveMobileIPProfile( BYTE * pIndex ); + + // Set the specified mobile IP profile settings + eGobiError SetMobileIPProfile( + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ); + + // Get the specified mobile IP profile settings + eGobiError GetMobileIPProfile( + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ); + + // Set the mobile IP parameters + eGobiError SetMobileIPParameters( + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + + // Get the mobile IP parameters + eGobiError GetMobileIPParameters( + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ); + + // Get the last mobile IP error + eGobiError GetLastMobileIPError( ULONG * pError ); + + // Set the DNS settings for the device + eGobiError SetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); + + // Get the DNS settings for the device + eGobiError GetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ); +#endif + +#ifdef NAS_SUPPORT + // Get the AN-AAA authentication status + eGobiError GetANAAAAuthenticationStatus( ULONG * pStatus ); + + // Get the current available signal strengths (in dBm) + eGobiError GetSignalStrengths( + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ); + + // Get the current RF information + eGobiError GetRFInfo( + BYTE * pInstanceSize, + BYTE * pInstances ); + + // Perform a scan for available networks + eGobiError PerformNetworkScan( + BYTE * pInstanceSize, + BYTE * pInstances ); + + // Perform a scan for available networks (includes RAT) + eGobiError PerformNetworkRATScan( + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ); + + // Initiate a network registration + eGobiError InitiateNetworkRegistration( + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ); + + // Initiate a domain attach (or detach) + eGobiError InitiateDomainAttach( ULONG action ); + + // Get information regarding the system that currently provides service + eGobiError GetServingNetwork( + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ); + + // Get data capabilities of serving network system + eGobiError GetServingNetworkCapabilities( + BYTE * pDataCapssSize, + BYTE * pDataCaps ); + + // Retrieves the current data bearer technology + eGobiError GetDataBearerTechnology( ULONG * pDataBearer ); + + // Retrieve information about the home network of the device + eGobiError GetHomeNetwork( + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ); + + // Sets the network registration preference + eGobiError SetNetworkPreference( + ULONG technologyPref, + ULONG duration ); + + // Return the network registration preference + eGobiError GetNetworkPreference( + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ); + + // Set the current CDMA network parameters + eGobiError SetCDMANetworkParameters( + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + + // Return the current CDMA network parameters + eGobiError GetCDMANetworkParameters( + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ); + + // Return the Access Overload Class (ACCOLC) of the device + eGobiError GetACCOLC( BYTE * pACCOLC ); + + // Set the Access Overload Class (ACCOLC) of the device + eGobiError SetACCOLC( + CHAR * pSPC, + BYTE accolc ); + + // Return the PLMN mode from the CSP + eGobiError GetPLMNMode( ULONG * pMode ); + + // Return PLMN name information for the given MCC/MNC + eGobiError GetPLMNName( + USHORT mcc, + USHORT mnc, + ULONG * pNamesSize, + BYTE * pNames ); +#endif + +#ifdef DMS_SUPPORT + // Get device capabilities + eGobiError GetDeviceCapabilities( + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ); + + // Return the device manufacturer name + eGobiError GetManufacturer( + BYTE stringSize, + CHAR * pString ); + + // Return the device model ID + eGobiError GetModelID( + BYTE stringSize, + CHAR * pString ); + + // Return the device firmware revision + eGobiError GetFirmwareRevision( + BYTE stringSize, + CHAR * pString ); + + // Return the device firmware revisions + eGobiError GetFirmwareRevisions( + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ); + + // Return the voice number in use by the device + eGobiError GetVoiceNumber( + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ); + + // Return the device IMSI + eGobiError GetIMSI( + BYTE stringSize, + CHAR * pString ); + + // Return all serial numbers assigned to the device + eGobiError GetSerialNumbers( + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ); + + // Set the user lock state maintained by the device + eGobiError SetLock( + ULONG state, + CHAR * pCurrentPIN ); + + // Set the user lock state maintained by the device + eGobiError QueryLock( ULONG * pState ); + + // Set the user lock code maintained by the device + eGobiError ChangeLockPIN( + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ); + + // Return the device hardware revision + eGobiError GetHardwareRevision( + BYTE stringSize, + CHAR * pString ); + + // Return the version of the active Preferred Roaming List (PRL) + eGobiError GetPRLVersion( WORD * pPRLVersion ); + + // Return the ERI file that is stored in EFS on the device + eGobiError GetERIFile( + ULONG * pFileSize, + BYTE * pFile ); + + // Request the device to perform automatic service activation + eGobiError ActivateAutomatic( CHAR * pActivationCode ); + + // Request the device perform manual service activation + eGobiError ActivateManual( + CHAR * pSPC, + WORD sid, + CHAR * pMDN, + CHAR * pMIN, + ULONG prlSize, + BYTE * pPRL, + CHAR * pMNHA, + CHAR * pMNAAA ); + + // Requests the device reset configuration to factory defaults + eGobiError ResetToFactoryDefaults( CHAR * pSPC ); + + // Return the device activation state + eGobiError GetActivationState( ULONG * pActivationState ); + + // Set the operating mode of the device` + eGobiError SetPower( ULONG powerMode ); + + // Return the operating mode of the device + eGobiError GetPower( ULONG * pPowerMode ); + + // Return operating mode info from the device + eGobiError GetPowerInfo( + ULONG * pPowerMode, + ULONG * pReasonMask, + ULONG * pbPlatform ); + + // Return the reason why the device is currently offline + eGobiError GetOfflineReason( + ULONG * pReasonMask, + ULONG * pbPlatform ); + + // Return the current time of the device + eGobiError GetNetworkTime( + ULONGLONG * pTimeCount, + ULONG * pTimeSource ); + + // Validates the service programming code + eGobiError ValidateSPC( CHAR * pSPC ); +#endif + +#ifdef UIM_SUPPORT + // Enable or disable protection of UIM contents by a given PIN + eGobiError UIMSetPINProtection( + ULONG id, + ULONG bEnable, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + + // Verify the PIN before accessing the UIM contents + eGobiError UIMVerifyPIN( + ULONG id, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + + // Unblock a blocked PIN + eGobiError UIMUnblockPIN( + ULONG id, + CHAR * pPUKValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + + // Change the PIN value + eGobiError UIMChangePIN( + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + + // Return the status of the pin + eGobiError UIMGetPINStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ); + + // Return the UIM ICCID + eGobiError UIMGetICCID( + BYTE stringSize, + CHAR * pString ); + + // Return the blocking status of the specified facility control key + eGobiError UIMGetControlKeyBlockingStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ); + + // Change the specified facility control key + eGobiError UIMSetControlKeyProtection( + ULONG id, + ULONG status, + CHAR * pValue, + ULONG * pVerifyRetriesLeft ); + + // Unblock the specified facility control key + eGobiError UIMUnblockControlKey( + ULONG id, + CHAR * pValue, + ULONG * pUnblockRetriesLeft ); +#endif + +#ifdef WMS_SUPPORT + // Delete one or more SMS messages from device memory + eGobiError DeleteSMS( + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ); + + // Return the list of SMS messages stored on the device + eGobiError GetSMSList( + ULONG storageType, + ULONG * pRequestedTag, + ULONG * pMessageListSize, + BYTE * pMessageList ); + + // Return an SMS message from device memory + eGobiError GetSMS( + ULONG storageType, + ULONG messageIndex, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ); + + // Modify the status of an SMS message + eGobiError ModifySMSStatus( + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ); + + // Save an SMS message to device memory + eGobiError SaveSMS( + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageIndex ); + + // Send an SMS message for immediate over the air transmission + eGobiError SendSMS( + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageFailureCode ); + + // Return the SMS center address + eGobiError GetSMSCAddress( + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ); + + // Set the SMS center address + eGobiError SetSMSCAddress( + CHAR * pSMSCAddress, + CHAR * pSMSCType ); + + // Get the current incoming SMS routing information + eGobiError GetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ); + + // Set the desired incoming SMS routing information + eGobiError SetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ); +#endif + +#ifdef PDS_SUPPORT + // Return the current PDS state + eGobiError GetPDSState( + ULONG * pEnabled, + ULONG * pTracking ); + + // Set the PDS state + eGobiError SetPDSState( ULONG enable ); + + // Inject a system time into the PDS engine + eGobiError PDSInjectTimeReference( + ULONGLONG systemTime, + USHORT systemDiscontinuities ); + + // Return the default tracking session configuration + eGobiError GetPDSDefaults( + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ); + + // Set the default tracking session configuration + eGobiError SetPDSDefaults( + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ); + + // Return the XTRA automatic download configuration + eGobiError GetXTRAAutomaticDownload( + ULONG * pbEnabled, + USHORT * pInterval ); + + // Set the XTRA automatic download configuration + eGobiError SetXTRAAutomaticDownload( + ULONG bEnabled, + USHORT interval ); + + // Return the XTRA WWAN network preference + eGobiError GetXTRANetwork( ULONG * pPreference ); + + // Set the XTRA WWAN network preference + eGobiError SetXTRANetwork( ULONG preference ); + + // Return the XTRA database validity period + eGobiError GetXTRAValidity( + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ); + + // Force the XTRA database to be downloaded to the device + eGobiError ForceXTRADownload(); + + // Return the XTRA data positioning state + eGobiError GetXTRADataState( ULONG * pState ); + + // Set the XTRA data positioning state + eGobiError SetXTRADataState( ULONG state ); + + // Return the XTRA time positioning state + eGobiError GetXTRATimeState( ULONG * pState ); + + // Set the XTRA time positioning state + eGobiError SetXTRATimeState( ULONG state ); + + // Return the PDS AGPS configuration + eGobiError GetAGPSConfig( + ULONG * pServerAddress, + ULONG * pServerPort ); + + // Set the PDS AGPS configuration + eGobiError SetAGPSConfig( + ULONG serverAddress, + ULONG serverPort ); + + // Return the automatic tracking state for the service + eGobiError GetServiceAutomaticTracking( ULONG * pbAuto ); + + // Set the automatic tracking state for the service + eGobiError SetServiceAutomaticTracking( ULONG bAuto ); + + // Return the automatic tracking config for the NMEA COM port + eGobiError GetPortAutomaticTracking( ULONG * pbAuto ); + + // Set the automatic tracking config for the NMEA COM port + eGobiError SetPortAutomaticTracking( ULONG bAuto ); + + // Reset the specified PDS data + eGobiError ResetPDSData( + ULONG * pGPSDataMask, + ULONG * pCellDataMask ); +#endif + +#ifdef CAT_SUPPORT + // Send the terminal response to the device + eGobiError CATSendTerminalResponse( + ULONG refID, + ULONG dataLen, + BYTE * pData ); + + // Send the envelope command to the device + eGobiError CATSendEnvelopeCommand( + ULONG cmdID, + ULONG dataLen, + BYTE * pData ); +#endif + +#ifdef RMS_SUPPORT + // Query the state of the SMS wake functionality + eGobiError GetSMSWake( + ULONG * pbEnabled, + ULONG * pWakeMask ); + + // Enable/disable the SMS wake functionality + eGobiError SetSMSWake( + ULONG bEnable, + ULONG wakeMask ); +#endif + +#ifdef OMA_SUPPORT + // Start an OMA-DM session + eGobiError OMADMStartSession( ULONG sessionType ); + + // Cancel an ongoing OMA-DM session + eGobiError OMADMCancelSession(); + + // Return info related to the current (or previous) OMA-DM session + eGobiError OMADMGetSessionInfo( + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ); + + // Return information about the pending network initiated alert + eGobiError OMADMGetPendingNIA( + ULONG * pSessionType, + USHORT * pSessionID ); + + // Send the specified OMA-DM selection for the current network + // initiated session + eGobiError OMADMSendSelection( + ULONG selection, + USHORT sessionID ); + + // Return the OMA-DM feature settings + eGobiError OMADMGetFeatureSettings( + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ); + + // Set the OMA-DM device provisioning service update feature setting + eGobiError OMADMSetProvisioningFeature( ULONG bProvisioning ); + + // Set the OMA-DM PRL service update feature setting + eGobiError OMADMSetPRLUpdateFeature( ULONG bPRLUpdate ); +#endif + +#ifdef VOICE_SUPPORT + // Initiates a USSD operation + eGobiError OriginateUSSD( BYTE * pInfo ); + + // Respond to a USSD request from the network + eGobiError AnswerUSSD( BYTE * pInfo ); + + // Cancels an in-progress USSD operation + eGobiError CancelUSSD(); +#endif + +#ifdef IMG_SUPPORT + // Get the current image preference list + eGobiError GetImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ); + + // Set the current image preference list + eGobiError SetImagesPreference( + ULONG imageListSize, + BYTE * pImageList, + ULONG bForceDownload, + BYTE modemIndex, + ULONG * pImageTypesSize, + BYTE * pImageTypes ); + + // Return the boot and recovery image download mode + eGobiError GetBARMode( ULONG * pBARMode ); + + // Request the device enter boot and recovery image download mode + eGobiError SetBARMode(); + + // Get the list of images stored on the device + eGobiError GetStoredImages( + ULONG * pImageListSize, + BYTE * pImageList ); + + // Return info about the specified image from the device + eGobiError GetStoredImageInfo( + ULONG imageInfoSize, + BYTE * pImageInfo, + ULONG * pMajorVersion, + ULONG * pMinorVersion, + ULONG * pVersionID, + CHAR * pInfo, + ULONG * pLockID ); + + // Delete the specified image from the device + eGobiError DeleteStoredImage( + ULONG imageInfoSize, + BYTE * pImageInfo ); +#endif + +#ifdef IMG2K_SUPPORT + eGobiError GetFirmwareInfo( + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ); + + // Upgrade firmware + eGobiError UpgradeFirmware( CHAR * pDestinationPath ); + + // Return image information + eGobiError GetImageInfo( + CHAR * pPath, + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ); + + // Return the image store folder + eGobiError GetImageStore( + WORD pathSize, + CHAR * pImageStorePath ); +#endif + + protected: + /* Database used for packing/parsing QMI protocol entities */ + cCoreDatabase mDB; + + /* Service type/service is required for object operation */ + typedef std::pair tServerConfig; + + /* Servers object is configured to support */ + std::set mServerConfig; + + /* QMI protocol servers */ + std::map mServers; + + /* Fail connect attempts when multiple devices are present? */ + bool mbFailOnMultipleDevices; + + /* Device node that this object is currently connected to */ + std::string mDeviceNode; + + /* Device key string of connected device (may be empty) */ + std::string mDeviceKey; + + unsigned int mVid; + unsigned int mPid; + + /* Last error recorded */ + eGobiError mLastError; + + /* Outstanding requests */ + typedef std::pair tServiceRequest; + cSyncQueue mRequests; + + /* Last recorded QMI_WDS_START_NET transaction ID */ + WORD mLastNetStartID; +}; diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreCAT.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreCAT.cpp new file mode 100755 index 0000000..1d36e0c --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreCAT.cpp @@ -0,0 +1,219 @@ +/*=========================================================================== +FILE: + GobiQMICoreCAT.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (CAT Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sCATTerminalResponseHdr +// Struct to represent a CAT terminal response header +/*=========================================================================*/ +struct sCATTerminalResponseHdr +{ + public: + ULONG mReferenceID; + USHORT mLength; + + // Terminal response data of 'mLength' follows +}; + +/*=========================================================================*/ +// Struct sCATEnvelopeCommandHdr +// Struct to represent a CAT envelope command header +/*=========================================================================*/ +struct sCATEnvelopeCommandHdr +{ + public: + USHORT mCommandID; + USHORT mLength; + + // Envelope command data of 'mLength' follows +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + CATSendTerminalResponse (Public Method) + +DESCRIPTION: + This function sends the terminal response to the device + +PARAMETERS: + refID [ I ] - UIM reference ID (from CAT event) + dataLen [ I ] - Terminal response data length + pData [ I ] - Terminal response data + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::CATSendTerminalResponse( + ULONG refID, + ULONG dataLen, + BYTE * pData ) +{ + const ULONG szTransHdr = (ULONG)sizeof( sQMIServiceRawTransactionHeader ); + const ULONG szMsgHdr = (ULONG)sizeof( sQMIRawMessageHeader ); + const ULONG szTLVHdr = (ULONG)sizeof( sQMIRawContentHeader ); + const ULONG szCATHdr = (ULONG)sizeof( sCATTerminalResponseHdr ); + + // Validate arguments + if (pData == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE buf[QMI_MAX_BUFFER_SIZE]; + + ULONG totalLen = szTransHdr + szMsgHdr+ szTLVHdr + szCATHdr + dataLen; + if (QMI_MAX_BUFFER_SIZE < totalLen) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)&buf[0]; + pTLV->mTypeID = 1; + pTLV->mLength = (WORD)(szCATHdr + dataLen); + + sCATTerminalResponseHdr * pCAT = (sCATTerminalResponseHdr *)&buf[szTLVHdr]; + pCAT->mReferenceID = refID; + pCAT->mLength = (USHORT)dataLen; + + pCAT++; + if (dataLen > 0) + { + memcpy( (LPVOID)pCAT, (LPCVOID)pData, (SIZE_T)dataLen ); + } + + sSharedBuffer * pReq = 0; + pReq = sQMIServiceBuffer::BuildBuffer( eQMI_SVC_CAT, + (WORD)eQMI_CAT_SEND_TERMINAL, + false, + false, + &buf[0], + szTLVHdr + szCATHdr + dataLen ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_CAT, pReq ); +} + +/*=========================================================================== +METHOD: + CATSendEnvelopeCommand (Public Method) + +DESCRIPTION: + This function sends the envelope command to the device + +PARAMETERS: + cmdID [ I ] - Envelope command ID + dataLen [ I ] - Envelope command data length + pData [ I ] - Envelope command data + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::CATSendEnvelopeCommand( + ULONG cmdID, + ULONG dataLen, + BYTE * pData ) +{ + const ULONG szTransHdr = (ULONG)sizeof( sQMIServiceRawTransactionHeader ); + const ULONG szMsgHdr = (ULONG)sizeof( sQMIRawMessageHeader ); + const ULONG szTLVHdr = (ULONG)sizeof( sQMIRawContentHeader ); + const ULONG szCATHdr = (ULONG)sizeof( sCATEnvelopeCommandHdr ); + + // Validate arguments + if (pData == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE buf[QMI_MAX_BUFFER_SIZE]; + + ULONG totalLen = szTransHdr + szMsgHdr+ szTLVHdr + szCATHdr + dataLen; + if (QMI_MAX_BUFFER_SIZE < totalLen) + { + return eGOBI_ERR_BUFFER_SZ; + } + + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)&buf[0]; + pTLV->mTypeID = 1; + pTLV->mLength = (WORD)(szCATHdr + dataLen); + + sCATEnvelopeCommandHdr * pCAT = (sCATEnvelopeCommandHdr *)&buf[szTLVHdr]; + pCAT->mCommandID = (USHORT)cmdID; + pCAT->mLength = (USHORT)dataLen; + + pCAT++; + if (dataLen > 0) + { + memcpy( (LPVOID)pCAT, (LPCVOID)pData, (SIZE_T)dataLen ); + } + + sSharedBuffer * pReq = 0; + pReq = sQMIServiceBuffer::BuildBuffer( eQMI_SVC_CAT, + (WORD)eQMI_CAT_SEND_ENVELOPE, + false, + false, + &buf[0], + szTLVHdr + szCATHdr + dataLen ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_CAT, pReq ); +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreDMS.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreDMS.cpp new file mode 100755 index 0000000..16499a8 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreDMS.cpp @@ -0,0 +1,2050 @@ +/*=========================================================================== +FILE: + GobiQMICoreDMS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (DMS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetDeviceCapabilities (Public Method) + +DESCRIPTION: + This function gets device capabilities + +PARAMETERS: + pMaxTXChannelRate [ O ] - Maximum transmission rate (bps) + pMaxRXChannelRate [ O ] - Maximum reception rate (bps) + pDataServiceCapability [ O ] - CS/PS data service capability + pSimCapability [ O ] - Device SIM support + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. + Upon successful output the actual number + of elements in the radio interface array + pRadioIfaces [ O ] - The radio interface array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetDeviceCapabilities( + ULONG * pMaxTXChannelRate, + ULONG * pMaxRXChannelRate, + ULONG * pDataServiceCapability, + ULONG * pSimCapability, + ULONG * pRadioIfacesSize, + BYTE * pRadioIfaces ) +{ + // Validate arguments + if ( (pMaxTXChannelRate == 0) + || (pMaxRXChannelRate == 0) + || (pDataServiceCapability == 0) + || (pSimCapability == 0) + || (pRadioIfacesSize == 0) + || (*pRadioIfacesSize == 0) + || (pRadioIfaces == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxRadioIfaces = (ULONG)*pRadioIfacesSize; + + // Assume failure + *pRadioIfacesSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_CAPS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 5) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the variables + *pMaxTXChannelRate = pf[0].mValue.mU32; + *pMaxRXChannelRate = pf[1].mValue.mU32; + *pDataServiceCapability = pf[2].mValue.mU32; + *pSimCapability = pf[3].mValue.mU8; + + ULONG activeRadioIfaces = (ULONG)pf[4].mValue.mU8; + if (pf.size() < 5 + activeRadioIfaces) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (activeRadioIfaces > maxRadioIfaces) + { + activeRadioIfaces = maxRadioIfaces; + } + + ULONG * pOutRadioIfaces = (ULONG *)pRadioIfaces; + for (ULONG r = 0; r < activeRadioIfaces; r++) + { + *pOutRadioIfaces++ = pf[5 + r].mValue.mU32; + } + + *pRadioIfacesSize = activeRadioIfaces; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetManufacturer (Public Method) + +DESCRIPTION: + This function returns the device manufacturer name + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetManufacturer( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_MANUFACTURER; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (stringSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pString[strLen] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetModelID (Public Method) + +DESCRIPTION: + This function returns the device model ID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetModelID( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_MODEL_ID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (stringSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pString[strLen] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetFirmwareRevision (Public Method) + +DESCRIPTION: + This function returns the device firmware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetFirmwareRevision( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_REV_ID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (PRI revision) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpPRI = pf[0].mValueString; + ULONG lenPRI = (ULONG)tmpPRI.size(); + + // Space to perform the copy? + if (stringSize < lenPRI + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)tmpPRI.c_str(), lenPRI + 1 ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetFirmwareRevisions (Public Method) + +DESCRIPTION: + This function returns the device firmware (AMSS, boot, and PRI) + revisions + +PARAMETERS: + amssSize [ I ] - The maximum number of characters (including NULL + terminator) that the AMSS string array can contain + pAMSSString [ O ] - NULL terminated AMSS revision string + bootSize [ I ] - The maximum number of characters (including NULL + terminator) that the boot string array can contain + pBootString [ O ] - NULL terminated boot code revision string + priSize [ I ] - The maximum number of characters (including NULL + terminator) that the PRI string array can contain + pPRIString [ O ] - NULL terminated PRI revision string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetFirmwareRevisions( + BYTE amssSize, + CHAR * pAMSSString, + BYTE bootSize, + CHAR * pBootString, + BYTE priSize, + CHAR * pPRIString ) +{ + // Validate arguments + if ( (amssSize == 0 || pAMSSString == 0) + || (bootSize == 0 || pBootString == 0) + || (priSize == 0 || pPRIString == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pAMSSString = 0; + *pBootString = 0; + *pPRIString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_REV_ID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (PRI revision) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpPRI = pf[0].mValueString; + ULONG lenPRI = (ULONG)tmpPRI.size(); + + // Space to perform the copy? + if (priSize < lenPRI + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pPRIString, (LPCSTR)tmpPRI.c_str(), lenPRI + 1 ); + + // Parse the TLV we want (boot code revision) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpBoot = pf[0].mValueString; + ULONG lenBoot = (ULONG)tmpBoot.size(); + + // Space to perform the copy? + if (bootSize < lenBoot + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pBootString, (LPCSTR)tmpBoot.c_str(), lenBoot + 1 ); + + // Parse the TLV we want (AMSS revision) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpAMSS = pf[0].mValueString; + ULONG lenAMSS = (ULONG)tmpAMSS.size(); + + // Space to perform the copy? + if (amssSize < lenAMSS + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pAMSSString, (LPCSTR)tmpAMSS.c_str(), lenAMSS + 1 ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetVoiceNumber (Public Method) + +DESCRIPTION: + This function returns the voice number in use by the device + +PARAMETERS: + voiceNumberSize [ I ] - The maximum number of characters (including NULL + terminator) that the voice number array can + contain + pVoiceNumber [ O ] - Voice number (MDN or ISDN) string + minSize [ I ] - The maximum number of characters (including NULL + terminator) that the MIN array can contain + pMIN [ O ] - MIN string (empty string returned when MIN is + not supported/programmed) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetVoiceNumber( + BYTE voiceNumberSize, + CHAR * pVoiceNumber, + BYTE minSize, + CHAR * pMIN ) +{ + // Validate arguments + if (voiceNumberSize == 0 || pVoiceNumber == 0 || minSize == 0 || pMIN == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pVoiceNumber = 0; + *pMIN = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_NUMBER; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + LONG strLen = pf1[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (voiceNumberSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pVoiceNumber, (LPCSTR)pf1[0].mValueString.c_str(), strLen ); + pVoiceNumber[strLen] = 0; + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() >= 1) + { + strLen = pf2[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (minSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pMIN, (LPCSTR)pf2[0].mValueString.c_str(), strLen ); + pMIN[strLen] = 0; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetIMSI (Public Method) + +DESCRIPTION: + This function returns the device IMSI + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetIMSI( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_IMSI; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (IMSI) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpIMSI = pf[0].mValueString; + ULONG lenIMSI = (ULONG)tmpIMSI.size(); + + // Space to perform the copy? + if (stringSize < lenIMSI + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)tmpIMSI.c_str(), lenIMSI + 1 ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSerialNumbers (Public Method) + +DESCRIPTION: + This command returns all serial numbers assigned to the device + +PARAMETERS: + esnSize [ I ] - The maximum number of characters (including NULL + terminator) that the ESN array can contain + pESNString [ O ] - ESN string (empty string returned when ESN is + not supported/programmed) + imeiSize [ I ] - The maximum number of characters (including NULL + terminator) that the IMEI array can contain + pIMEIString [ O ] - IMEI string (empty string returned when IMEI is + not supported/programmed) + meidSize [ I ] - The maximum number of characters (including NULL + terminator) that the MEID array can contain + pMEIDString [ O ] - MEID string (empty string returned when MEID is + not supported/programmed) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSerialNumbers( + BYTE esnSize, + CHAR * pESNString, + BYTE imeiSize, + CHAR * pIMEIString, + BYTE meidSize, + CHAR * pMEIDString ) +{ + // Validate arguments + if ( (esnSize == 0) + || (pESNString == 0) + || (imeiSize == 0) + || (pIMEIString == 0) + || (meidSize == 0) + || (pMEIDString == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pESNString = 0; + *pIMEIString = 0; + *pMEIDString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_IDS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() >= 1) + { + LONG strLen = pf1[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (esnSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pESNString, (LPCSTR)pf1[0].mValueString.c_str(), strLen ); + pESNString[strLen] = 0; + } + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() >= 1) + { + LONG strLen = pf2[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (imeiSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pIMEIString, (LPCSTR)pf2[0].mValueString.c_str(), strLen ); + pIMEIString[strLen] = 0; + } + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey3( eDB2_ET_QMI_DMS_RSP, msgID, 18 ); + cDataParser::tParsedFields pf3 = ParseTLV( db, rsp, tlvs, tlvKey3 ); + if (pf3.size() >= 1) + { + LONG strLen = pf3[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (meidSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pMEIDString, (LPCSTR)pf3[0].mValueString.c_str(), strLen ); + pMEIDString[strLen] = 0; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetLock (Public Method) + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + state [ I ] - Desired lock state + pCurrentPIN [ I ] - Current four digit PIN string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetLock( + ULONG state, + CHAR * pCurrentPIN ) +{ + // Validate arguments + if (pCurrentPIN == 0 || pCurrentPIN[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string thePIN( pCurrentPIN ); + if (thePIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = thePIN.find_first_not_of( "0123456789" ); + std::string digitPIN = thePIN.substr( 0, nNonDigit ); + if (digitPIN.size() != thePIN.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_SET_USER_LOCK_STATE; + std::vector piv; + + // "%u %s" + std::ostringstream tmp; + tmp << (UINT)state << " " << thePIN; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} + +/*=========================================================================== +METHOD: + QueryLock (Public Method) + +DESCRIPTION: + This function sets the user lock state maintained by the device + +PARAMETERS: + pState [ O ] - Current lock state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::QueryLock( ULONG * pState ) +{ + // Validate arguments + if (pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_USER_LOCK_STATE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the mode + *pState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ChangeLockPIN (Public Method) + +DESCRIPTION: + This command sets the user lock code maintained by the device + +PARAMETERS: + pCurrentPIN [ O ] - Current four digit PIN string + pDesiredPIN [ O ] - New four digit PIN string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ChangeLockPIN( + CHAR * pCurrentPIN, + CHAR * pDesiredPIN ) +{ + // Validate arguments + if ( (pCurrentPIN == 0) + || (pCurrentPIN[0] == 0) + || (pDesiredPIN == 0) + || (pDesiredPIN[0] == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theCurPIN( pCurrentPIN ); + if (theCurPIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = theCurPIN.find_first_not_of( "0123456789" ); + std::string digitCurPIN = theCurPIN.substr( 0, nNonDigit ); + if (digitCurPIN.size() != theCurPIN.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theNewPIN( pDesiredPIN ); + if (theNewPIN.size() > 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + nNonDigit = theNewPIN.find_first_not_of( "0123456789" ); + std::string digitNewPIN = theNewPIN.substr( 0, nNonDigit ); + if (digitNewPIN.size() != theNewPIN.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_SET_USER_LOCK_CODE; + std::vector piv; + + // "%s %s" + std::ostringstream tmp; + tmp << theCurPIN << " " << theNewPIN; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetHardwareRevision (Public Method) + +DESCRIPTION: + This function returns the device hardware revision + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetHardwareRevision( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_MSM_ID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (stringSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pString[strLen] = 0; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetPRLVersion (Public Method) + +DESCRIPTION: + This function returns the version of the active Preferred Roaming List + (PRL) in use by the device + +PARAMETERS: + pPRLVersion [ O ] - The PRL version number + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPRLVersion( WORD * pPRLVersion ) +{ + // Validate arguments + if (pPRLVersion == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_PRL_VERSION; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pPRLVersion = pf[0].mValue.mU16; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetERIFile (Public Method) + +DESCRIPTION: + This command returns the ERI file that is stored in EFS on the device + +PARAMETERS: + pFileSize [I/O] - Upon input the maximum number of bytes that the file + contents array can contain. Upon successful output + the actual number of bytes written to the file contents + array + pFile [ O ] - The file contents + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetERIFile( + ULONG * pFileSize, + BYTE * pFile ) +{ + // Validate arguments + if (pFileSize == 0 || *pFileSize == 0 || pFile == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + ULONG maxFileSize = *pFileSize; + *pFileSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_READ_ERI_FILE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG fileSz = pf[0].mValue.mU16; + if (pf.size() < 1 + fileSz) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to copy into? + if (fileSz > maxFileSize) + { + return eGOBI_ERR_BUFFER_SZ; + } + + for (ULONG f = 0; f < fileSz; f++) + { + pFile[f] = pf[1 + f].mValue.mU8; + } + + *pFileSize = fileSz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ActivateAutomatic (Public Method) + +DESCRIPTION: + This function requests the device to perform automatic service activation + +PARAMETERS: + pActivationCode [ I ] - Activation code (maximum string length of 12) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ActivateAutomatic( CHAR * pActivationCode ) +{ + // Validate arguments + if ( (pActivationCode == 0) + || (pActivationCode[0] == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string ac( pActivationCode ); + if (ac.size() > 12) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_ACTIVATE_AUTOMATIC; + std::vector piv; + + std::ostringstream tmp; + tmp << (ULONG)ac.size() << " \"" << ac << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + /// Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest, 300000 ); +} + +/*=========================================================================== +METHOD: + ActivateManual (Public Method) + +DESCRIPTION: + This function requests the device perform manual service activation, + after a successful request the device is then asked to reset + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + sid [ I ] - System identification number + pMDN [ I ] - Mobile Directory Number string + pMIN [ I ] - Mobile Identification Number string + prlSize [ I ] - (Optional) Size of PRL file array + pPRL [ I ] - (Optional) The PRL file contents + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ActivateManual( + CHAR * pSPC, + WORD sid, + CHAR * pMDN, + CHAR * pMIN, + ULONG prlSize, + BYTE * pPRL, + CHAR * pMNHA, + CHAR * pMNAAA ) +{ + // Validate arguments + if ( (pSPC == 0) + || (pSPC[0] == 0) + || (pMDN == 0) + || (pMDN[0] == 0) + || (pMIN == 0) + || (pMIN[0] == 0) + || (prlSize > QMI_DMS_MAX_PRL_SIZE) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theMDN( pMDN ); + if (theMDN.size() > 16) + { + return eGOBI_ERR_INVALID_ARG; + } + + nNonDigit = theMDN.find_first_not_of( "0123456789" ); + std::string digitMDN = theMDN.substr( 0, nNonDigit ); + if (digitMDN.size() != theMDN.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theMIN( pMIN ); + if (theMIN.size() > 16) + { + return eGOBI_ERR_INVALID_ARG; + } + + nNonDigit = theMIN.find_first_not_of( "0123456789" ); + std::string digitMIN = theMIN.substr( 0, nNonDigit ); + if (digitMIN.size() != theMIN.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string theMNHA; + if (pMNHA != 0 && pMNHA[0] != 0) + { + theMNHA = pMNHA; + if (theMNHA.size() > 16) + { + return eGOBI_ERR_INVALID_ARG; + } + } + + std::string theMNAAA; + if (pMNAAA != 0 && pMNAAA[0] != 0) + { + theMNAAA = pMNAAA; + if (theMNAAA.size() > 16) + { + return eGOBI_ERR_INVALID_ARG; + } + } + + WORD msgID = (WORD)eQMI_DMS_ACTIVATE_MANUAL; + std::vector piv; + + // "%s %u %d %s %d %s" + std::ostringstream tmp; + tmp << spc << " " << (UINT)sid << " " << theMDN.size() << " " << theMDN + << " " << theMIN.size() << " " << theMIN; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + if (theMNHA.size() > 0) + { + sProtocolEntityKey pek1( eDB2_ET_QMI_DMS_REQ, msgID, 17 ); + std::ostringstream tmp; + tmp << (int)theMNHA.size() << " \"" << theMNHA << "\""; + + sDB2PackingInput pi1( pek1, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi1 ); + } + + if (theMNAAA.size() > 0) + { + sProtocolEntityKey pek1( eDB2_ET_QMI_DMS_REQ, msgID, 18 ); + std::ostringstream tmp; + tmp << (int)theMNAAA.size() << " \"" << theMNAAA << "\""; + + sDB2PackingInput pi1( pek1, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi1 ); + } + + // Do we need to go through the anguish of the segmented PRL? + if (prlSize > 0) + { + ULONG blockSz = QMI_DMS_MAX_PRL_BLOCK; + + // Determine number of writes + ULONG writes = prlSize / blockSz; + if ((prlSize % blockSz) != 0) + { + writes++; + } + + ULONG offset = 0; + ULONG to = DEFAULT_GOBI_QMI_TIMEOUT; + + // Generate and send requests + eGobiError err = eGOBI_ERR_NONE; + for (ULONG w = 0; w < writes; w++) + { + if (w == writes - 1) + { + to = 300000; + if ((prlSize % blockSz) != 0) + { + blockSz = prlSize % blockSz; + } + } + + std::vector pivLocal = piv; + + // "%u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)prlSize << " " << (UINT)blockSz + << " " << (UINT)w; + for (ULONG p = 0; p < blockSz; p++) + { + tmp2 << " " << (UINT)pPRL[offset + p]; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 19 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + pivLocal.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, pivLocal ); + + // Send the QMI request, check result, and return + err = SendAndCheckReturn( eQMI_SVC_DMS, pRequest, to ); + if (err != eGOBI_ERR_NONE) + { + break; + } + else + { + offset += blockSz; + } + } + + if (err != eGOBI_ERR_NONE) + { + return err; + } + } + else + { + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + eGobiError rc = SendAndCheckReturn( eQMI_SVC_DMS, pRequest, 300000 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + } + + // Ask device to power down + eGobiError rc = SetPower( 5 ); + if (rc != eGOBI_ERR_NONE) + { + return eGOBI_ERR_RESET; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ResetToFactoryDefaults (Public Method) + +DESCRIPTION: + This function requests the device reset configuration to factory defaults, + after a successful request the device is then asked to reset + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ResetToFactoryDefaults( CHAR * pSPC ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_FACTORY_DEFAULTS; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)spc.c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request and check result + eGobiError rc = SendAndCheckReturn( eQMI_SVC_DMS, pRequest, 300000 ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Ask device to power down + rc = SetPower( 5 ); + if (rc != eGOBI_ERR_NONE) + { + return eGOBI_ERR_RESET; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetActivationState (Public Method) + +DESCRIPTION: + This function returns the device activation state + +PARAMETERS: + pActivationState [ O ] - Service activation state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetActivationState( ULONG * pActivationState ) +{ + // Validate arguments + if (pActivationState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_ACTIVATED_STATE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pActivationState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetPower (Public Method) + +DESCRIPTION: + This function sets the operating mode of the device + +PARAMETERS: + powerMode [ I ] - Selected operating mode + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetPower( ULONG powerMode ) +{ + WORD msgID = (WORD)eQMI_DMS_SET_OPERATING_MODE; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)powerMode; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetPower (Public Method) + +DESCRIPTION: + This function returns the operating mode of the device + +PARAMETERS: + pPowerMode [ O ] - Current operating mode + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPower( ULONG * pPowerMode ) +{ + // Validate arguments + if (pPowerMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pPowerMode = ULONG_MAX; + + ULONG reasonMask = 0; + ULONG bPlatform = 0; + eGobiError rc = GetPowerInfo( pPowerMode, &reasonMask, &bPlatform ); + return rc; +} + +/*=========================================================================== +METHOD: + GetPowerInfo (Public Method) + +DESCRIPTION: + This function returns operating mode info from the device + +PARAMETERS: + pPowerMode [ O ] - Current operating mode + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPowerInfo( + ULONG * pPowerMode, + ULONG * pReasonMask, + ULONG * pbPlatform ) +{ + // Validate arguments + if (pPowerMode == 0 || pReasonMask == 0 || pbPlatform == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pPowerMode = ULONG_MAX; + *pReasonMask = 0; + *pbPlatform = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_OPERTAING_MODE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pPowerMode = pf[0].mValue.mU32; + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + + // Convert back to a bitmask + ULONG fieldCount = (ULONG)pf.size(); + if (fieldCount > 16) + { + fieldCount = 16; + } + + for (ULONG f = 0; f < fieldCount; f++) + { + ULONG val = (ULONG)pf[f].mValue.mU8 & 0x00000001; + *pReasonMask |= (val << f); + } + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pbPlatform = (ULONG)pf[0].mValue.mU8; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetOfflineReason + +DESCRIPTION: + This function returns the reason why the operating mode of the device + is currently offline + +PARAMETERS: + pReasonMask [ O ] - Bitmask of offline reasons + pbPlatform [ O ] - Offline due to being platform retricted? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetOfflineReason( + ULONG * pReasonMask, + ULONG * pbPlatform ) +{ + // Validate arguments + if (pReasonMask == 0 || pbPlatform == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pReasonMask = 0; + *pbPlatform = 0; + + ULONG powerMode = 0; + eGobiError rc = GetPowerInfo( &powerMode, pReasonMask, pbPlatform ); + + return rc; +} + +/*=========================================================================== +METHOD: + GetNetworkTime (Public Method) + +DESCRIPTION: + This function returns the current time of the device + +PARAMETERS: + pTimeStamp [ O ] - Count of 1.25ms that have elapsed from the start + of GPS time (Jan 6, 1980) + pTimeSource [ O ] - Source of the timestamp + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetNetworkTime( + ULONGLONG * pTimeCount, + ULONG * pTimeSource ) +{ + // Validate arguments + if (pTimeCount == 0 || pTimeSource == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_TIME; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pTimeCount = pf[0].mValue.mU64; + *pTimeSource = pf[1].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ValidateSPC (Public Method) + +DESCRIPTION: + This function validates the service programming code + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ValidateSPC( CHAR * pSPC ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_VALIDATE_SPC; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)spc.c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request and check result + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreImg.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreImg.cpp new file mode 100755 index 0000000..5f1d9c7 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreImg.cpp @@ -0,0 +1,656 @@ +/*=========================================================================== +FILE: + GobiQMICoreImg.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (Image Management) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetImagesPreference (Public Method) + +DESCRIPTION: + This function gets the current images preference + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetImagesPreference( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + // Validate arguments + if ( (pImageListSize == 0) + || (*pImageListSize == 0) + || (pImageList == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSz = *pImageListSize; + *pImageListSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_FIRMWARE_PREF; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Try to find TLV ID 1 + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 1 ); + if (pIter == tlvs.end()) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Enough space to copy result? + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG needSz = (ULONG)pHdr->mLength; + if (needSz == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pImageListSize = needSz; + if (needSz > maxSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHdr++; + const BYTE * pData = (const BYTE *)pHdr; + + memcpy( (LPVOID)pImageList, + (LPCVOID)pData, + (SIZE_T)needSz ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetImagesPreference (Public Method) + +DESCRIPTION: + This function sets the current images preference + +PARAMETERS: + imageListSize [ I ] - The size in BYTEs of the image list array + pImageList [ I ] - The image list array + bForceDownload [ I ] - Force device to download images from host? + modemIndex [ I ] - Desired storage index for downloaded modem image + pImageTypesSize [I/O] - Upon input the maximum number of elements that + the download image types array can contain. + Upon successful output the actual number of + elements in the download image types array + pImageTypes [ O ] - The download image types array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetImagesPreference( + ULONG imageListSize, + BYTE * pImageList, + ULONG bForceDownload, + BYTE modemIndex, + ULONG * pImageTypesSize, + BYTE * pImageTypes ) +{ + // Validate arguments + if ( (imageListSize == 0) + || (pImageList == 0) + || (pImageTypesSize == 0) + || (*pImageTypesSize == 0) + || (pImageTypes == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSz = *pImageTypesSize; + *pImageTypesSize = 0; + + WORD msgID = (WORD)eQMI_DMS_SET_FIRMWARE_PREF; + std::vector piv; + + sProtocolEntityKey pek1( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi1( pek1, pImageList, imageListSize ); + piv.push_back( pi1 ); + + BYTE bOverride = 0; + if (bForceDownload != 0) + { + bOverride = 1; + sProtocolEntityKey pek2( eDB2_ET_QMI_DMS_REQ, msgID, 16 ); + sDB2PackingInput pi2( pek2, &bOverride, 1 ); + piv.push_back( pi2 ); + } + + if (modemIndex != UCHAR_MAX) + { + sProtocolEntityKey pek3( eDB2_ET_QMI_DMS_REQ, msgID, 17 ); + sDB2PackingInput pi3( pek3, &modemIndex, 1 ); + piv.push_back( pi3 ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Try to find TLV ID 1 + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 1 ); + if (pIter == tlvs.end()) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Enough space to copy result? + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG dataLen = (ULONG)pHdr->mLength; + if (dataLen == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + pHdr++; + const BYTE * pData = (const BYTE *)pHdr; + BYTE typeCount = *pData++; + if (typeCount != 0) + { + if (dataLen != (ULONG)typeCount + 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pImageTypesSize = typeCount; + if (typeCount > maxSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pImageTypes, + (LPCVOID)pData, + (SIZE_T)typeCount ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetBARMode (Public Method) + +DESCRIPTION: + This function returns the boot and recovery image download mode + +PARAMETERS: + pBARMode [ O ] - Boot and recovery image download mode + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetBARMode( ULONG * pBARMode ) +{ + // Validate arguments + if (pBARMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_IMG_DLOAD_MODE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the state + *pBARMode = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetBARMode (Public Method) + +DESCRIPTION: + This function requests the device enter boot and recovery image download + mode after the next reset + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetBARMode() +{ + WORD msgID = (WORD)eQMI_DMS_SET_IMG_DLOAD_MODE; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, "1" ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetStoredImages (Public Method) + +DESCRIPTION: + This function gets the list of images stored on the device + +PARAMETERS: + pImageListSize [I/O] - Upon input the size in BYTEs of the image list + array. Upon success the actual number of BYTEs + copied to the image list array + pImageList [ O ] - The image info list array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetStoredImages( + ULONG * pImageListSize, + BYTE * pImageList ) +{ + // Validate arguments + if ( (pImageListSize == 0) + || (*pImageListSize == 0) + || (pImageList == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSz = *pImageListSize; + + // Assume failure + *pImageListSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_LIST_FIRMWARE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Try to find TLV ID 1 + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 1 ); + if (pIter == tlvs.end()) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Enough space to copy result? + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG needSz = (ULONG)pHdr->mLength; + + *pImageListSize = needSz; + if (needSz > maxSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHdr++; + const BYTE * pData = (const BYTE *)pHdr; + + memcpy( (LPVOID)pImageList, + (LPCVOID)pData, + (SIZE_T)needSz ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetStoredImageInfo (Public Method) + +DESCRIPTION: + This function returns info about the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + pMajorVersion [ O ] - Major version of compatible boot downloader + pMinorVersion [ O ] - Minor version of compatible boot downloader + pVersionID [ O ] - Image version ID + pInfo [ O ] - Image info string + pLockID [ O ] - Image OEM lock ID + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetStoredImageInfo( + ULONG imageInfoSize, + BYTE * pImageInfo, + ULONG * pMajorVersion, + ULONG * pMinorVersion, + ULONG * pVersionID, + CHAR * pInfo, + ULONG * pLockID ) +{ + // Validate arguments + if ( (imageInfoSize == 0) + || (pImageInfo == 0) + || (pMajorVersion == 0) + || (pMinorVersion == 0) + || (pVersionID == 0) + || (pInfo == 0) + || (pLockID == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pMajorVersion = ULONG_MAX; + *pMinorVersion = ULONG_MAX; + *pVersionID = ULONG_MAX; + *pLockID = ULONG_MAX; + pInfo[0] = 0; + + + WORD msgID = (WORD)eQMI_DMS_GET_FIRMWARE_INFO; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, pImageInfo, imageInfoSize ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Keep track of the number of TLVs we actually processed + ULONG tlvCount = 0; + + // Parse the TLV we want (by DB key) + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + tlvCount++; + *pMajorVersion = (ULONG)pf[0].mValue.mU16; + *pMinorVersion = (ULONG)pf[1].mValue.mU16; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + tlvCount++; + *pVersionID = pf[0].mValue.mU32; + + LONG strLen = pf[1].mValueString.size(); + if (strLen > 0 && strLen <= 32) + { + memcpy( pInfo, pf[1].mValueString.c_str(), strLen ); + + if (strLen < 32) + { + pInfo[strLen] = 0; + } + } + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 18 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + tlvCount++; + *pLockID = pf[0].mValue.mU32; + } + + if (tlvCount == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + DeleteStoredImage (Public Method) + +DESCRIPTION: + This function deletes the specified image from the device + +PARAMETERS: + imageInfoSize [ I ] - The size in BYTEs of the image info array + pImageInfo [ I ] - The image info array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::DeleteStoredImage( + ULONG imageInfoSize, + BYTE * pImageInfo ) +{ + // Validate arguments + if (imageInfoSize == 0 || pImageInfo == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_DMS_DELETE_FIRMWARE; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, pImageInfo, imageInfoSize ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreImg2k.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreImg2k.cpp new file mode 100755 index 0000000..55ce59c --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreImg2k.cpp @@ -0,0 +1,523 @@ +/*=========================================================================== +FILE: + GobiQMICoreImg2k.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (Image Management, G2k API) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiMBNMgmt.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +#include + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// Free Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetGenericImage (Free Method) + +DESCRIPTION: + Return a compatible AMSS generic image + +PARAMETERS: + uqcnInfo [ I ] - UQCN image needing a compatible AMSS generic image + +RETURN VALUE: + sImageInfo - Generic image information +===========================================================================*/ +sImageInfo GetGenericImage( const sImageInfo & uqcnInfo, unsigned int vid, + unsigned int pid ) +{ + // Validate arguments + sImageInfo amssInfo; + + // Obtain the technology/carrier of the UQCN + ULONG uqcnTech; + ULONG uqcnCarrier; + ULONG dummy; + eGobiError rc = ::MapVersionInfo( uqcnInfo.mVersionID, + (BYTE)uqcnInfo.mImageType, + uqcnInfo.mVersion.c_str(), + &uqcnTech, + &uqcnCarrier, + &dummy, + &dummy ); + + if (rc != eGOBI_ERR_NONE) + { + return amssInfo; + } + + // Recursively enumerate all folders of the image store + std::vector folders; + std::string imageStore = ::GetImageStore(vid, pid); + EnumerateFolders( imageStore, folders ); + + // Did we find any folders? + ULONG foldersSz = (ULONG)folders.size(); + if (foldersSz == 0) + { + return amssInfo; + } + + // Go through each folder searching for a compatible generic AMSS image + for (ULONG f = 0; f < foldersSz; f++) + { + // Search all MBN files in the specified folder + std::string folderSearch = folders[f]; + + int folderLen = folderSearch.size(); + if (folderSearch[folderLen - 1] != '/') + { + folderSearch += '/'; + } + + folderSearch += "*.mbn"; + + glob_t files; + int ret = glob( folderSearch.c_str(), + 0, + NULL, + &files ); + if (ret != 0) + { + // Glob error + continue; + } + + for (int i = 0; i < files.gl_pathc; i++) + { + std::string mbnName = files.gl_pathv[i]; + + BYTE imageType = UCHAR_MAX; + BYTE imageID[16] = { 0 }; + ULONG versionID = ULONG_MAX; + USHORT versionSz = MAX_PATH * 2 + 1; + CHAR versionStr[MAX_PATH * 2 + 1] = { 0 }; + rc = ::GetImageInfo( mbnName.c_str(), + &imageType, + &imageID[0], + &versionID, + versionSz, + &versionStr[0] ); + + if (rc == eGOBI_ERR_NONE) + { + if ((eGobiMBNType)imageType == eGOBI_MBN_TYPE_MODEM) + { + ULONG amssTech; + ULONG amssCarrier; + rc = ::MapVersionInfo( versionID, + imageType, + (LPCSTR)&versionStr[0], + &amssTech, + &amssCarrier, + &dummy, + &dummy ); + + if (rc == eGOBI_ERR_NONE) + { + if ( (amssTech == uqcnTech) + && (amssCarrier == (ULONG)eGOBI_IMG_CAR_GENERIC) ) + { + amssInfo.mImageType = (eGobiMBNType)imageType; + amssInfo.mVersionID = versionID; + amssInfo.mVersion = (LPCSTR)&versionStr[0]; + memcpy( (LPVOID)&amssInfo.mImageID[0], + (LPCVOID)&imageID[0], + MBN_UNIQUE_ID_LEN ); + break; + } + } + } + } + } + globfree( &files ); + } + + // Success + return amssInfo; +} + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetFirmwareInfo (Public Method) + +DESCRIPTION: + Returns image information obtained from the current device firmware + +PARAMETERS: + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetFirmwareInfo( + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + // Validate arguments + if ( (pFirmwareID == 0) + || (pTechnology == 0) + || (pCarrier == 0) + || (pRegion == 0) + || (pGPSCapability == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Do we have a device node? + if (mDeviceNode.empty() == true) + { + return eGOBI_ERR_NO_CONNECTION; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_GET_REV_ID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string uqcnIDString = pf[0].mValueString; + LONG strLen = uqcnIDString.size(); + if (strLen != 8) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string idString1 = uqcnIDString.substr( 0, 2 ); + std::string idString2 = uqcnIDString.substr( 2, 2 ); + std::string idString3 = uqcnIDString.substr( 4, 2 ); + std::string idString4 = uqcnIDString.substr( 6, 2 ); + + ULONG id1 = 0; + ULONG id2 = 0; + ULONG id3 = 0; + ULONG id4 = 0; + bool bID1 = StringToULONG( idString1.c_str(), 16, id1 ); + bool bID2 = StringToULONG( idString2.c_str(), 16, id2 ); + bool bID3 = StringToULONG( idString3.c_str(), 16, id3 ); + bool bID4 = StringToULONG( idString4.c_str(), 16, id4 ); + + if (bID1 == false || bID2 == false || bID3 == false || bID4 == false) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG uqcnID = (id1 << 24) | (id2 << 16) | (id3 << 8) | id4; + + // Parse the TLV we want (AMSS revision) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pFirmwareID = uqcnID; + eGobiError err = ::MapVersionInfo( uqcnID, + (BYTE)eGOBI_MBN_TYPE_PRI, + pf[0].mValueString.c_str(), + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); + + return err; +} + +/*=========================================================================== +METHOD: + UpgradeFirmware (Public Method) + +DESCRIPTION: + This function performs the following set of steps: + a) Verifies arguments + b) Updates firmware ID on device + c) Resets the device + + NOTE: Upon successful completion the above steps will have been completed, + however the actual upgrade of the firmware will necessarily then + follow. + +PARAMETERS: + pDestinationPath [ I ] - The fully qualified path to the destination folder + that the firmware download service will use + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UpgradeFirmware( CHAR * pDestinationPath ) +{ + char *end; + ULONG carrier; + + // Validate arguments + if (pDestinationPath == 0 || pDestinationPath[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Do we have a device ID? + if (mDeviceNode.empty() == true) + { + return eGOBI_ERR_NO_CONNECTION; + } + + if (*pDestinationPath == '/') + pDestinationPath++; + carrier = strtoul(pDestinationPath, &end, 10); + if (*end) + return eGOBI_ERR_INVALID_ARG; + + sImageInfo amssInfo; + sImageInfo uqcnInfo; + std::vector images; + + WORD msgID = (WORD)eQMI_DMS_SET_FIRMWARE_ID; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)carrier; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + eGobiError rc = SendAndCheckReturn( eQMI_SVC_DMS, pRequest ); + if (rc != eGOBI_ERR_NONE) + { + return rc; + } + + // Ask device to power down + rc = SetPower( 5 ); + if (rc != eGOBI_ERR_NONE) + { + return eGOBI_ERR_RESET; + } + + return rc; +} + +/*=========================================================================== +METHOD: + GetImageInfo (Public Method) + +DESCRIPTION: + Returns image information obtained from the firmware image located at the + provided path + +PARAMETERS: + pPath [ I ] - Location of the firmware image + pFirmwareID [ O ] - Firmware ID obtained from the firmware image + pTechnology [ O ] - Technology (0xFFFFFFFF if unknown) + pCarrier [ O ] - Carrier (0xFFFFFFFF if unknown) + pRegion [ O ] - Region (0xFFFFFFFF if unknown) + pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetImageInfo( + CHAR * pPath, + ULONG * pFirmwareID, + ULONG * pTechnology, + ULONG * pCarrier, + ULONG * pRegion, + ULONG * pGPSCapability ) +{ + // Validate arguments + if ( (pPath == 0) + || (pPath[0] == 0) + || (pFirmwareID == 0) + || (pTechnology == 0) + || (pCarrier == 0) + || (pRegion == 0) + || (pGPSCapability == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Do we have a device ID? + if (mDeviceNode.empty() == true) + { + return eGOBI_ERR_NO_CONNECTION; + } + + // Use that to validate the image store for this device + std::string tmpPath( pPath ); + int tmpPathlen = tmpPath.size(); + if (tmpPath[tmpPathlen - 1] != '/') + { + tmpPath += '/'; + } + + std::string imageStore = ::GetImageStore(mVid, mPid); + if (tmpPath.find( imageStore ) < 0) + { + return eGOBI_ERR_INVALID_FILE; + } + + std::vector images; + images = ::GetImagesInfo( tmpPath ); + + ULONG imageCount = (ULONG)images.size(); + for (ULONG i = 0; i < imageCount; i++) + { + const sImageInfo & ii = images[i]; + if (ii.mImageType == eGOBI_MBN_TYPE_PRI) + { + *pFirmwareID = ii.mVersionID; + return ::MapVersionInfo( ii.mVersionID, + (BYTE)ii.mImageType, + ii.mVersion.c_str(), + pTechnology, + pCarrier, + pRegion, + pGPSCapability ); + } + } + + return eGOBI_ERR_INVALID_FILE; +} + +/*=========================================================================== +METHOD: + GetImageStore (Public Method) + +DESCRIPTION: + Returns the image store folder, i.e. the folder co-located with the + QDL Service executable which (by default) contains one or more carrier + specific image subfolders + +PARAMETERS: + pathSize [ I ] - Maximum number of characters (including NULL + terminator) that can be copied to the image + store path array + pImageStorePath [ O ] - The path to the image store + + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetImageStore( + WORD pathSize, + CHAR * pImageStorePath ) +{ + // Do we have a device ID? + if (mDeviceNode.size() == true) + { + return eGOBI_ERR_NO_CONNECTION; + } + + std::string imageStore = ::GetImageStore(mVid, mPid); + + // Copy over image store + LONG strLen = imageStore.size(); + if (pathSize < (ULONG)strLen + 1) + { + pImageStorePath[0] = 0; + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pImageStorePath, + (LPCVOID)imageStore.c_str(), + (SIZE_T)strLen ); + + pImageStorePath[strLen] = 0; + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreNAS.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreNAS.cpp new file mode 100755 index 0000000..27c2278 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreNAS.cpp @@ -0,0 +1,1986 @@ +/*=========================================================================== +FILE: + GobiQMICoreNAS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (NAS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +// Maximum length for a scanned network description +const ULONG MAX_SNI_DESCRIPTION_LEN = 255; + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sEVDOCustomSCPConfig +// Struct to represent CDMA 1xEV-DO custom SCP config +/*=========================================================================*/ +struct sEVDOCustomSCPConfig +{ + public: + BYTE mbActive; + ULONG mProtocolMask; + ULONG mBroadcastMask; + ULONG mApplicationMask; +}; + +/*=========================================================================*/ +// Struct sScannedNetworkInfo +// Struct to represent scanned network information +/*=========================================================================*/ +struct sScannedNetworkInfo +{ + public: + USHORT mMCC; + USHORT mMNC; + ULONG mInUse; + ULONG mRoaming; + ULONG mForbidden; + ULONG mPreferred; + CHAR mDescription[MAX_SNI_DESCRIPTION_LEN]; +}; + +/*=========================================================================*/ +// Struct sScannedNetworkRATInfo +// Struct to represent scanned network RAT information +/*=========================================================================*/ +struct sScannedNetworkRATInfo +{ + public: + USHORT mMCC; + USHORT mMNC; + ULONG mRAT; +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetANAAAAuthenticationStatus (Public Method) + +DESCRIPTION: + This function gets the AN-AAA authentication status + +PARAMETERS: + pStatus [ O ] - AN-AAA authentication status + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetANAAAAuthenticationStatus( ULONG * pStatus ) +{ + // Validate arguments + if (pStatus == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_AAA_AUTH_STATUS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the index + *pStatus = (ULONG)pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSignalStrengths (Public Method) + +DESCRIPTION: + This function gets the current available signal strengths (in dBm) + as measured by the device + +PARAMETERS: + pArraySizes [I/O] - Upon input the maximum number of elements + that each array can contain can contain. + Upon successful output the actual number + of elements in each array + pSignalStrengths [ O ] - Received signal strength array (dBm) + pRadioInterfaces [ O ] - Radio interface technology array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSignalStrengths( + ULONG * pArraySizes, + INT8 * pSignalStrengths, + ULONG * pRadioInterfaces ) +{ + // Validate arguments + if ( (pArraySizes == 0) + || (*pArraySizes == 0) + || (pSignalStrengths == 0) + || (pRadioInterfaces == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSignals = (ULONG)*pArraySizes; + + // Assume failure + *pArraySizes = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_RSSI; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 2) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Remove any values outside the legal range + std::map sigMap; + + INT8 sigVal = pf[0].mValue.mS8; + ULONG radioVal = pf[1].mValue.mU32; + if (sigVal <= -30 && sigVal > -125 && radioVal != 0) + { + sigMap[radioVal] = sigVal; + } + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() > 2) + { + ULONG fi = 0; + ULONG auxSigs = (ULONG)pf[fi++].mValue.mU16; + if (pf.size() >= 1 + 2 * auxSigs) + { + for (ULONG s = 0; s < auxSigs; s++, fi += 2) + { + sigVal = pf[fi].mValue.mS8; + radioVal = pf[fi + 1].mValue.mU32; + if (sigVal <= -30 && sigVal > -125 && radioVal != 0) + { + sigMap[radioVal] = sigVal; + } + } + } + } + + ULONG sigCount = 0; + std::map ::const_iterator pIter; + for (pIter = sigMap.begin(); pIter != sigMap.end(); pIter++, sigCount++) + { + if (sigCount < maxSignals) + { + pSignalStrengths[sigCount] = pIter->second; + pRadioInterfaces[sigCount] = pIter->first; + *pArraySizes = sigCount + 1; + } + } + + // No valid signals? + if (sigCount == 0) + { + return eGOBI_ERR_NO_SIGNAL; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetRFInfo (Public Method) + +DESCRIPTION: + This function gets the current RF information + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + RF info instance array can contain. Upon success + the actual number of elements in the RF info + instance array + pInstances [ O ] - The RF info instance array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetRFInfo( + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + // Validate arguments + if (pInstanceSize == 0 || *pInstanceSize == 0 || pInstances == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxInstances = *pInstanceSize; + *pInstanceSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_RF_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + + ULONG fieldCount = (ULONG)pf.size(); + if (fieldCount < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + BYTE ifaceCount = pf[0].mValue.mU8; + if (fieldCount < 1 + ((ULONG)ifaceCount * 3)) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (ifaceCount > maxInstances) + { + ifaceCount = maxInstances; + } + + ULONG * pOutput = (ULONG *)pInstances; + for (BYTE i = 0; i < ifaceCount; i++) + { + ULONG offset = 3 * (ULONG)i; + + *pOutput++ = pf[offset + 1].mValue.mU32; + *pOutput++ = pf[offset + 2].mValue.mU32; + *pOutput++ = (ULONG)pf[offset + 3].mValue.mU16; + } + + *pInstanceSize = ifaceCount; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PerformNetworkScan (Public Method) + +DESCRIPTION: + This function performs a scan for available networks + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::PerformNetworkScan( + BYTE * pInstanceSize, + BYTE * pInstances ) +{ + // Validate arguments + if ( (pInstanceSize == 0) + || (*pInstanceSize == 0) + || (pInstances == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxInstances = *pInstanceSize; + + // Assume failure + *pInstanceSize = 0; + + // This can take a really long time + ULONG to = MAX_REQ_TIMEOUT; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_SCAN_NETS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID, to ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + + ULONG maxIdx = (ULONG)pf.size(); + if (maxIdx-- < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG idx = 0; + BYTE netCount = pf[idx++].mValue.mU8; + if (netCount > maxInstances) + { + netCount = maxInstances; + } + + sScannedNetworkInfo * pNet = (sScannedNetworkInfo *)pInstances; + for (BYTE i = 0; i < netCount; i++) + { + // Validate field count + if (idx + 6 > maxIdx) + { + return eGOBI_ERR_INVALID_RSP; + } + + pNet->mMCC = pf[idx++].mValue.mU16; + pNet->mMNC = pf[idx++].mValue.mU16; + pNet->mInUse = pf[idx++].mValue.mU32; + pNet->mRoaming = pf[idx++].mValue.mU32; + pNet->mForbidden = pf[idx++].mValue.mU32; + pNet->mPreferred = pf[idx++].mValue.mU32; + + memset( &pNet->mDescription[0], 0, (SIZE_T)MAX_SNI_DESCRIPTION_LEN ); + + BYTE descLen = pf[idx++].mValue.mU8; + if (descLen > 0) + { + std::string netDesc( pf[idx++].mValueString ); + + ULONG actualLen = netDesc.size(); + if (actualLen >= MAX_SNI_DESCRIPTION_LEN) + { + actualLen = MAX_SNI_DESCRIPTION_LEN - 1; + } + + memcpy( (LPVOID)&pNet->mDescription[0], + (LPCSTR)netDesc.c_str(), + (SIZE_T)actualLen ); + } + + pNet++; + } + + *pInstanceSize = netCount; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + PerformNetworkRATScan (Public Method) + +DESCRIPTION: + This function performs a scan for available networks (includes RAT) + +PARAMETERS: + pInstanceSize [I/O] - Upon input the maximum number of elements that the + network info instance array can contain. Upon + success the actual number of elements in the + network info instance array + pInstances [ O ] - The network info instance array + pRATSize [I/O] - Upon input the maximum number of elements that the + RAT info instance array can contain. Upon success + the actual number of elements in the RAT info + instance array + pRATInstances [ O ] - The RAT info instance array + + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::PerformNetworkRATScan( + BYTE * pInstanceSize, + BYTE * pInstances, + BYTE * pRATSize, + BYTE * pRATInstances ) +{ + // Validate arguments + if ( (pInstanceSize == 0) + || (*pInstanceSize == 0) + || (pInstances == 0) + || (pRATSize == 0) + || (*pRATSize == 0) + || (pRATInstances == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxInstances = *pInstanceSize; + BYTE maxRATInstances = *pRATSize; + + // Assume failure + *pInstanceSize = 0; + *pRATSize = 0; + + // This can take a really long time + ULONG to = MAX_REQ_TIMEOUT; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_SCAN_NETS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID, to ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + + ULONG maxIdx = (ULONG)pf.size(); + if (maxIdx-- < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG idx = 0; + BYTE netCount = pf[idx++].mValue.mU8; + if (netCount > maxInstances) + { + netCount = maxInstances; + } + + sScannedNetworkInfo * pNet = (sScannedNetworkInfo *)pInstances; + for (BYTE i = 0; i < netCount; i++) + { + // Validate field count + if (idx + 6 > maxIdx) + { + return eGOBI_ERR_INVALID_RSP; + } + + pNet->mMCC = pf[idx++].mValue.mU16; + pNet->mMNC = pf[idx++].mValue.mU16; + pNet->mInUse = pf[idx++].mValue.mU32; + pNet->mRoaming = pf[idx++].mValue.mU32; + pNet->mForbidden = pf[idx++].mValue.mU32; + pNet->mPreferred = pf[idx++].mValue.mU32; + + memset( &pNet->mDescription[0], 0, (SIZE_T)MAX_SNI_DESCRIPTION_LEN ); + + BYTE descLen = pf[idx++].mValue.mU8; + if (descLen > 0) + { + std::string netDesc( pf[idx++].mValueString ); + + ULONG actualLen = netDesc.size(); + if (actualLen >= MAX_SNI_DESCRIPTION_LEN) + { + actualLen = MAX_SNI_DESCRIPTION_LEN - 1; + } + + LPCSTR pNetDesc = netDesc.c_str(); + memcpy( (LPVOID)&pNet->mDescription[0], + (LPCVOID)pNetDesc, + (SIZE_T)actualLen ); + } + + pNet++; + } + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + + maxIdx = (ULONG)pf.size(); + if (maxIdx-- < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + idx = 0; + BYTE ratCount = pf[idx++].mValue.mU8; + if (ratCount > maxRATInstances) + { + ratCount = maxRATInstances; + } + + sScannedNetworkRATInfo * pRAT = (sScannedNetworkRATInfo *)pRATInstances; + for (BYTE r = 0; r < ratCount; r++) + { + // Validate field count + if (idx + 2 > maxIdx) + { + return eGOBI_ERR_INVALID_RSP; + } + + pRAT->mMCC = pf[idx++].mValue.mU16; + pRAT->mMNC = pf[idx++].mValue.mU16; + pRAT->mRAT = pf[idx++].mValue.mU32; + pRAT++; + } + + *pInstanceSize = netCount; + *pRATSize = ratCount; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + InitiateNetworkRegistration (Public Method) + +DESCRIPTION: + This function initiates a network registration + +PARAMETERS: + regType [ I ] - Registration type + mcc [ I ] - Mobile country code (ignored for auto registration) + mnc [ I ] - Mobile network code (ignored for auto registration) + rat [ I ] - Radio access type (ignored for auto registration) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::InitiateNetworkRegistration( + ULONG regType, + WORD mcc, + WORD mnc, + ULONG rat ) +{ + WORD msgID = (WORD)eQMI_NAS_REGISTER_NET; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)regType; + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + if (regType == 2) + { + // We need to add the manual registration data + // "%hu %hu %u" + std::ostringstream tmp2; + tmp2 << (USHORT)mcc << " " << (USHORT)mnc << " " + << (UINT)rat; + + pek = sProtocolEntityKey( eDB2_ET_QMI_NAS_REQ, msgID, 16 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_NAS, pRequest, 30000 ); +} + +/*=========================================================================== +METHOD: + InitiateDomainAttach (Public Method) + +DESCRIPTION: + This function initiates a domain attach (or detach) + +PARAMETERS: + action [ I ] - PS attach action (attach or detach) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::InitiateDomainAttach( ULONG action ) +{ + WORD msgID = (WORD)eQMI_NAS_ATTACH_DETACH; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)action; + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_NAS, pRequest, 30000 ); +} + +/*=========================================================================== +METHOD: + GetServingNetwork (Public Method) + +DESCRIPTION: + Gets information regarding the system that currently provides service + to the device + +PARAMETERS: + pRegistrationState [ O ] - Registration state + pCSDomain [ O ] - Circuit switch domain status + pPSDomain [ O ] - Packet switch domain status + pRAN [ O ] - Radio access network + pRadioIfacesSize [I/O] - Upon input the maximum number of elements + that the radio interfaces can contain. Upon + successful output the actual number of elements + in the radio interface array + pRadioIfaces [ O ] - The radio interface array + pRoaming [ O ] - Roaming indicator (0xFFFFFFFF - Unknown) + pMCC [ O ] - Mobile country code (0xFFFF - Unknown) + pMNC [ O ] - Mobile network code (0xFFFF - Unknown) + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the network name array + can contain + pName [ O ] - The network name or description represented + as a NULL terminated string (empty string + returned when unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetServingNetwork( + ULONG * pRegistrationState, + ULONG * pCSDomain, + ULONG * pPSDomain, + ULONG * pRAN, + BYTE * pRadioIfacesSize, + BYTE * pRadioIfaces, + ULONG * pRoaming, + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName ) +{ + // Validate arguments + if ( (pRegistrationState == 0) + || (pCSDomain == 0) + || (pPSDomain == 0) + || (pRAN == 0) + || (pRadioIfacesSize == 0) + || (*pRadioIfacesSize == 0) + || (pRadioIfaces == 0) + || (pRoaming == 0) + || (pMCC == 0) + || (pMNC == 0) + || (nameSize == 0) + || (pName == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxRadioIfaces = *pRadioIfacesSize; + + // Assume failure + *pRadioIfacesSize = 0; + *pRoaming = ULONG_MAX; + *pMCC = USHRT_MAX; + *pMNC = USHRT_MAX; + *pName = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_SS_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() < 5) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the variables + *pRegistrationState = pf1[0].mValue.mU32; + *pCSDomain = pf1[1].mValue.mU32; + *pPSDomain = pf1[2].mValue.mU32; + *pRAN = pf1[3].mValue.mU32; + + BYTE activeRadioIfaces = pf1[4].mValue.mU8; + if (pf1.size() < 5 + (ULONG)activeRadioIfaces) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (activeRadioIfaces > maxRadioIfaces) + { + activeRadioIfaces = maxRadioIfaces; + } + + ULONG * pOutRadioIfaces = (ULONG *)pRadioIfaces; + for (ULONG r = 0; r < activeRadioIfaces; r++) + { + *pOutRadioIfaces++ = pf1[5 + r].mValue.mU32; + } + + *pRadioIfacesSize = activeRadioIfaces; + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() >= 1) + { + *pRoaming = pf2[0].mValue.mU32; + } + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey3( eDB2_ET_QMI_NAS_RSP, msgID, 18 ); + cDataParser::tParsedFields pf3 = ParseTLV( db, rsp, tlvs, tlvKey3 ); + if (pf3.size() >= 3) + { + *pMCC = pf3[0].mValue.mU16; + *pMNC = pf3[1].mValue.mU16; + + // Network name? + if (pf3[2].mValue.mU8 > 0 && pf3.size() >= 4) + { + LONG strLen = pf3[3].mValueString.size(); + if (strLen > 0) + { + // Space to perform the copy? + if (nameSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pName, (LPCSTR)pf3[3].mValueString.c_str(), strLen ); + pName[strLen] = 0; + } + } + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetServingNetworkCapabilities (Public Method) + +DESCRIPTION: + Gets information regarding the data capabilities of the system that + currently provides service to the device + +PARAMETERS: + pDataCapsSize [I/O] - Upon input the maximum number of elements that the + data capabilities array can contain. Upon success + the actual number of elements in the data + capabilities array + pDataCaps [ O ] - The data capabilities array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetServingNetworkCapabilities( + BYTE * pDataCapsSize, + BYTE * pDataCaps ) +{ + // Validate arguments + if ( (pDataCapsSize == 0) + || (*pDataCapsSize == 0) + || (pDataCaps == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + BYTE maxDataCaps = *pDataCapsSize; + + // Assume failure + *pDataCapsSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_SS_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + BYTE activeDataCaps = pf[0].mValue.mU8; + if (pf.size() < 1 + (ULONG)activeDataCaps) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (activeDataCaps > maxDataCaps) + { + activeDataCaps = maxDataCaps; + } + + ULONG * pOutDataCaps = (ULONG *)pDataCaps; + for (ULONG d = 0; d < activeDataCaps; d++) + { + *pOutDataCaps++ = pf[1 + d].mValue.mU32; + } + + *pDataCapsSize = activeDataCaps; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetDataBearerTechnology (Public Method) + +DESCRIPTION: + This function retrieves the current data bearer technology (only + valid when connected) + +PARAMETERS: + pDataCaps [ O ] - The data bearer technology + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetDataBearerTechnology( ULONG * pDataBearer ) +{ + // Validate arguments + if (pDataBearer == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_DATA_BEARER; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the state + *pDataBearer = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetHomeNetwork (Public Method) + +DESCRIPTION: + This function retrieves information about the home network of the device + +PARAMETERS: + pMCC [ O ] - Mobile country code + pMNC [ O ] - Mobile network code + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the network name array + can contain + pName [ O ] - The network name or description represented + as a NULL terminated string (empty string + returned when unknown) + pSID [ O ] - Home network system ID (0xFFFF - Unknown) + pNID [ O ] - Home network ID (0xFFFF - Unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetHomeNetwork( + WORD * pMCC, + WORD * pMNC, + BYTE nameSize, + CHAR * pName, + WORD * pSID, + WORD * pNID ) +{ + // Validate arguments + if ( (pMCC == 0) + || (pMNC == 0) + || (nameSize == 0) + || (pName == 0) + || (pSID == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pName = 0; + *pSID = USHRT_MAX; + *pNID = USHRT_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_HOME_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the variables + *pMCC = pf1[0].mValue.mU16; + *pMNC = pf1[1].mValue.mU16; + + // Network name? + if (pf1[2].mValue.mU8 > 0 && pf1.size() >= 4) + { + LONG strLen = pf1[3].mValueString.size(); + if (strLen > 0) + { + // Space to perform the copy? + if (nameSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pName, (LPCSTR)pf1[3].mValueString.c_str(), strLen ); + pName[strLen] = 0; + } + } + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() >= 2) + { + *pSID = pf2[0].mValue.mU16; + *pNID = pf2[1].mValue.mU16; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetNetworkPreference (Public Method) + +DESCRIPTION: + This function sets the network registration preference + +PARAMETERS: + technologyPref [ I ] - Technology preference bitmap + duration [ I ] - Duration of active preference + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetNetworkPreference( + ULONG technologyPref, + ULONG duration ) +{ + // Buffer to hold technology preference TLV (ID = 1) + const ULONG TLV_HDR_SZ = (ULONG)sizeof( sQMIRawContentHeader ); + BYTE req[3 + TLV_HDR_SZ]; + + // Fill out TLV header + sQMIRawContentHeader * pTLV = (sQMIRawContentHeader *)&req[0]; + pTLV->mLength = 3; + pTLV->mTypeID = 1; + + // Copy packed technology preference WORD as-is + WORD * pTmp = (WORD *)&req[TLV_HDR_SZ]; + *pTmp = (WORD)technologyPref; + + // Fill out duration + req[TLV_HDR_SZ + 2] = (BYTE)duration; + + // Pack TLV into a QMI NAS request + sSharedBuffer * pRequest = 0; + pRequest = sQMIServiceBuffer::BuildBuffer( eQMI_SVC_NAS, + eQMI_NAS_SET_TECH_PREF, + false, + false, + &req[0], + 3 + TLV_HDR_SZ ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_NAS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetNetworkPreference (Public Method) + +DESCRIPTION: + This function returns the network registration preference + +PARAMETERS: + pTechnologyPref [ O ] - Technology preference bitmap + pDuration [ O ] - Duration of active preference + pPersistentTechnologyPref [ O ] - Persistent technology preference bitmap + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetNetworkPreference( + ULONG * pTechnologyPref, + ULONG * pDuration, + ULONG * pPersistentTechnologyPref ) +{ + // Validate arguments + if ( (pTechnologyPref == 0) + || (pDuration == 0) + || (pPersistentTechnologyPref == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_TECH_PREF; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + sDB2NavInput ni1 = FindTLV( tlvs, tlvKey1 ); + if (ni1.mPayloadLen < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + const BYTE * pData = ni1.mpPayload; + const WORD * pTmp = (const WORD *)pData; + pData += 2; + + // Populate the variables + *pTechnologyPref = (ULONG)*pTmp; + *pDuration = (ULONG)*pData; + + // Until we know any better the persistent setting is the current setting + *pPersistentTechnologyPref = *pTechnologyPref; + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + sDB2NavInput ni2 = FindTLV( tlvs, tlvKey2 ); + if (ni2.mPayloadLen >= 2) + { + pTmp = (const WORD *)ni2.mpPayload; + *pPersistentTechnologyPref = (ULONG)*pTmp; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetCDMANetworkParameters (Public Method) + +DESCRIPTION: + This function sets the desired CDMA network parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pForceRev0 [ I ] - (Optional) Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ I ] - (Optional) Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ I ] - (Optional) Protocol mask for custom SCP config + pBroadcast [ I ] - (Optional) Broadcast mask for custom SCP config + pApplication [ I ] - (Optional) Application mask for custom SCP config + pRoaming [ I ] - (Optional) Roaming preference + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetCDMANetworkParameters( + CHAR * pSPC, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + // If you specify one of the custom SCP config fields then you must + // specify them all + ULONG scpCount = 0; + if (pCustomSCP != 0) + { + scpCount++; + } + + if (pProtocol != 0) + { + scpCount++; + } + + if (pBroadcast != 0) + { + scpCount++; + } + + if (pApplication != 0) + { + scpCount++; + } + + if (scpCount != 0 && scpCount != 4) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Rev. 0 and SCP custom config are mutually exclusive + if (pForceRev0 != 0 && scpCount == 4) + { + if (*pForceRev0 != 0 && *pCustomSCP != 0) + { + return eGOBI_ERR_INVALID_ARG; + } + } + + WORD msgID = (WORD)eQMI_NAS_SET_NET_PARAMS; + std::vector piv; + + // Need to start with SPC? + if (pForceRev0 != 0 || scpCount == 4) + { + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)spc.c_str() ); + piv.push_back( pi ); + } + + if (pForceRev0 != 0) + { + // "%u" + std::ostringstream tmp; + tmp << (UINT)(*pForceRev0 == 0 ? 0 : 1); + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 20 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (scpCount == 4) + { + // "%u %u %u %u %u %u %u %u %u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)(*pCustomSCP == 0 ? 0 : 1) + << (UINT)(*pProtocol & 0x00000001 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000002 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000004 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000008 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000010 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000020 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000040 ? 1 : 0) + << (UINT)(*pProtocol & 0x00000080 ? 1 : 0) + << (UINT)(*pBroadcast & 0x00000001 ? 1 : 0) + << (UINT)(*pApplication & 0x00000001 ? 1 : 0) + << (UINT)(*pApplication & 0x00000002 ? 1 : 0); + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 21 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pRoaming != 0) + { + // "%u" + std::ostringstream tmp; + tmp << (UINT)*pRoaming; + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 22 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // We require something to actually configure + if (piv.size() == 0) + { + // Much ado about nothing + return eGOBI_ERR_INVALID_ARG; + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_NAS, pRequest, 5000 ); +} + +/*=========================================================================== +METHOD: + GetCDMANetworkParameters (Public Method) + +DESCRIPTION: + This function gets the current CDMA network parameters + +PARAMETERS: + pSCI [ O ] - Slot cycle index + pSCM [ O ] - Station class mark + pRegHomeSID [ O ] - Register on home SID? + pRegForeignSID [ O ] - Register on foreign SID? + pRegForeignNID [ O ] - Register on foreign NID? + pForceRev0 [ O ] - Force CDMA 1x-EV-DO Rev. 0 mode? + pCustomSCP [ O ] - Use a custom config for CDMA 1x-EV-DO SCP? + pProtocol [ O ] - Protocol mask for custom SCP config + pBroadcast [ O ] - Broadcast mask for custom SCP config + pApplication [ O ] - Application mask for custom SCP config + pRoaming [ O ] - Roaming preference + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetCDMANetworkParameters( + BYTE * pSCI, + BYTE * pSCM, + BYTE * pRegHomeSID, + BYTE * pRegForeignSID, + BYTE * pRegForeignNID, + BYTE * pForceRev0, + BYTE * pCustomSCP, + ULONG * pProtocol, + ULONG * pBroadcast, + ULONG * pApplication, + ULONG * pRoaming ) +{ + // Validate arguments + if ( (pSCI == 0) + || (pSCM == 0) + || (pRegHomeSID == 0) + || (pRegForeignSID == 0) + || (pRegForeignNID == 0) + || (pForceRev0 == 0) + || (pCustomSCP == 0) + || (pProtocol == 0) + || (pBroadcast == 0) + || (pApplication == 0) + || (pRoaming == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSCI = UCHAR_MAX; + *pSCM = UCHAR_MAX; + *pRegHomeSID = UCHAR_MAX; + *pRegForeignSID = UCHAR_MAX; + *pRegForeignNID = UCHAR_MAX; + *pForceRev0 = UCHAR_MAX; + *pCustomSCP = UCHAR_MAX; + *pProtocol = ULONG_MAX; + *pBroadcast = ULONG_MAX; + *pApplication = ULONG_MAX; + *pRoaming = UCHAR_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_NET_PARAMS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLVs we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pSCI = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 18 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pSCM = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 19 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 3) + { + *pRegHomeSID = pf[0].mValue.mU8; + *pRegForeignSID = pf[0].mValue.mU8; + *pRegForeignNID = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 20 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pForceRev0 = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_NAS_RSP, msgID, 21 ); + sDB2NavInput ni = FindTLV( tlvs, tlvKey ); + if (ni.mPayloadLen >= (ULONG)sizeof( sEVDOCustomSCPConfig )) + { + const sEVDOCustomSCPConfig * pData = 0; + pData = (const sEVDOCustomSCPConfig *)ni.mpPayload; + + *pCustomSCP = pData->mbActive; + *pProtocol = pData->mProtocolMask; + *pBroadcast = pData->mBroadcastMask; + *pApplication = pData->mApplicationMask; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_NAS_RSP, msgID, 22 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pRoaming = pf[0].mValue.mU32; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetACCOLC (Public Method) + +DESCRIPTION: + This function returns the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pACCOLC [ O ] - The ACCOLC + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetACCOLC( BYTE * pACCOLC ) +{ + // Validate arguments + if (pACCOLC == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_ACCOLC; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the ACCOLC + *pACCOLC = pf[0].mValue.mU8; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetACCOLC (Public Method) + +DESCRIPTION: + This function sets the Access Overload Class (ACCOLC) of the device + +PARAMETERS: + pSPC [ I ] - NULL terminated string representing the six digit + service programming code + accolc [ I ] - The ACCOLC + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetACCOLC( + CHAR * pSPC, + BYTE accolc ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_NAS_SET_ACCOLC; + std::vector piv; + + // "%s %u" + std::ostringstream tmp; + tmp << spc << " " << (UINT)accolc; + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_NAS, pRequest, 5000 ); +} + +/*=========================================================================== +METHOD: + GetPLMNMode (Public Method) + +DESCRIPTION: + This function returns the PLMN mode from the CSP + +PARAMETERS: + pMode [ O ] - PLMN mode + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPLMNMode( ULONG * pMode ) +{ + // Validate arguments + if (pMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_NAS_GET_PLMN_MODE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_NAS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_NAS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the PLMN mode + *pMode = (ULONG)pf[0].mValue.mU8; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetPLMNName (Public Method) + +DESCRIPTION: + This function returns PLMN name information for the given MCC/MNC + +PARAMETERS: + mcc [ I ] - Mobile country code + mnc [ I ] - Mobile network code + pNamesSize [I/O] - Upon input the size in BYTEs of the name structure + array. Upon success the actual number of BYTEs + copied to the name structure array + pNames [ O ] - The name structure array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPLMNName( + USHORT mcc, + USHORT mnc, + ULONG * pNamesSize, + BYTE * pNames ) +{ + // Validate arguments + if ( (pNamesSize == 0) + || (*pNamesSize == 0) + || (pNames == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxSz = *pNamesSize; + *pNamesSize = 0; + + + WORD msgID = (WORD)eQMI_NAS_GET_PLMN_NAME; + std::vector piv; + + // "%hu %hu" + std::ostringstream tmp; + tmp << mcc << " " << mnc; + + sProtocolEntityKey pek( eDB2_ET_QMI_NAS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + + sProtocolBuffer rsp = Send( eQMI_SVC_NAS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Try to find TLV ID 16 + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 16 ); + if (pIter == tlvs.end()) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Enough space to copy result? + const sQMIRawContentHeader * pHdr = pIter->second; + ULONG needSz = (ULONG)pHdr->mLength; + if (needSz == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pNamesSize = needSz; + if (needSz > maxSz) + { + return eGOBI_ERR_BUFFER_SZ; + } + + pHdr++; + const BYTE * pData = (const BYTE *)pHdr; + + memcpy( (LPVOID)pNames, + (LPCVOID)pData, + (SIZE_T)needSz ); + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreOMA.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreOMA.cpp new file mode 100755 index 0000000..713a7ab --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreOMA.cpp @@ -0,0 +1,535 @@ +/*=========================================================================== +FILE: + GobiQMICoreOMA.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (OMA-DM Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + OMADMStartSession (Public Method) + +DESCRIPTION: + This function starts an OMA-DM session + +PARAMETERS: + sessionType [ I ] - Type of session to initiate + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMStartSession( ULONG sessionType ) +{ + WORD msgID = (WORD)eQMI_OMA_START_SESSION; + std::vector piv; + + std::ostringstream tmp; + tmp << sessionType; + + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_OMA, pRequest ); +} + +/*=========================================================================== +METHOD: + OMADMCancelSession (Public Method) + +DESCRIPTION: + This function cancels an ongoing OMA-DM session + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMCancelSession() +{ + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_OMA_CANCEL_SESSION; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_OMA, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + OMADMGetSessionInfo (Public Method) + +DESCRIPTION: + This function returns information related to the current (or previous + if no session is active) OMA-DM session + +PARAMETERS: + pSessionState [ O ] - State of session + pSessionType [ O ] - Type of session + pFailureReason [ O ] - Session failure reason (when state indicates failure) + pRetryCount [ O ] - Session retry count (when state indicates retrying) + pSessionPause [ O ] - Session pause timer (when state indicates retrying) + pTimeRemaining [ O ] - Pause time remaining (when state indicates retrying) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMGetSessionInfo( + ULONG * pSessionState, + ULONG * pSessionType, + ULONG * pFailureReason, + BYTE * pRetryCount, + WORD * pSessionPause, + WORD * pTimeRemaining ) +{ + // Validate arguments + if ( (pSessionState == 0) + || (pSessionType == 0) + || (pFailureReason == 0) + || (pRetryCount == 0) + || (pSessionPause == 0) + || (pTimeRemaining == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSessionState = ULONG_MAX; + *pSessionType = ULONG_MAX; + *pFailureReason = ULONG_MAX; + *pRetryCount = UCHAR_MAX; + *pSessionPause = USHRT_MAX; + *pTimeRemaining = USHRT_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_OMA_GET_SESSION_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_OMA, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // How many parameters did we populate? + ULONG params = 0; + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLVs we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_OMA_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pSessionState = pf[0].mValue.mU32; + *pSessionType = pf[1].mValue.mU32; + params += 2; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_OMA_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pFailureReason = pf[0].mValue.mU32; + params++; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_OMA_RSP, msgID, 18 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 3) + { + *pRetryCount = pf[0].mValue.mU8; + *pSessionPause = pf[1].mValue.mU16; + *pTimeRemaining = pf[2].mValue.mU16; + params += 3; + } + + if (params == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + OMADMGetPendingNIA (Public Method) + +DESCRIPTION: + This function returns information about the pending network initiated + alert + +PARAMETERS: + pSessionType [ O ] - Type of session + pSessionID [ O ] - Unique session ID + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMGetPendingNIA( + ULONG * pSessionType, + USHORT * pSessionID ) +{ + // Validate arguments + if (pSessionType == 0 || pSessionID == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSessionType = ULONG_MAX; + *pSessionID = USHRT_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_OMA_GET_SESSION_INFO; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_OMA, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // How many parameters did we populate? + ULONG params = 0; + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLVs we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_OMA_RSP, msgID, 19 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pSessionType = pf[0].mValue.mU32; + *pSessionID = pf[1].mValue.mU16; + params += 2; + } + + if (params == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + OMADMSendSelection (Public Method) + +DESCRIPTION: + This function sends the specified OMA-DM selection for the current + network initiated session + +PARAMETERS: + selection [ I ] - Selection + sessionID [ I ] - Unique session ID + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMSendSelection( + ULONG selection, + USHORT sessionID ) +{ + WORD msgID = (WORD)eQMI_OMA_SEND_SELECTION; + std::vector piv; + + std::ostringstream tmp; + tmp << selection << " " << sessionID; + + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_OMA, pRequest ); +} + +/*=========================================================================== +METHOD: + OMADMGetFeatureSettings (Public Method) + +DESCRIPTION: + This function returns the OMA-DM feature settings + +PARAMETERS: + pbProvisioning [ O ] - Device provisioning service update enabled + pbPRLUpdate [ O ] - PRL service update enabled + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMGetFeatureSettings( + ULONG * pbProvisioning, + ULONG * pbPRLUpdate ) +{ + // Validate arguments + if (pbProvisioning == 0 || pbPRLUpdate == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pbProvisioning = ULONG_MAX; + *pbPRLUpdate = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_OMA_GET_FEATURES; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_OMA, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // How many parameters did we populate? + ULONG params = 0; + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLVs we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_OMA_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pbProvisioning = pf[0].mValue.mU32; + params++; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_OMA_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pbPRLUpdate = pf[0].mValue.mU32; + params++; + } + + if (params == 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + OMADMSetProvisioningFeature (Public Method) + +DESCRIPTION: + This function sets the OMA-DM device provisioning service + update feature setting + +PARAMETERS: + bProvisioning [ I ] - Device provisioning service update enabled + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMSetProvisioningFeature( + ULONG bProvisioning ) +{ + WORD msgID = (WORD)eQMI_OMA_SET_FEATURES; + std::vector piv; + + std::ostringstream tmp; + tmp << (ULONG)(bProvisioning != 0); + + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_OMA, pRequest ); +} + +/*=========================================================================== +METHOD: + OMADMSetPRLUpdateFeature (Public Method) + +DESCRIPTION: + This function sets the OMA-DM PRL service update feature setting + +PARAMETERS: + bPRLUpdate [ I ] - PRL service update enabled + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OMADMSetPRLUpdateFeature( + ULONG bPRLUpdate ) +{ + WORD msgID = (WORD)eQMI_OMA_SET_FEATURES; + std::vector piv; + + std::ostringstream tmp; + tmp << (ULONG)(bPRLUpdate != 0); + + sProtocolEntityKey pek( eDB2_ET_QMI_OMA_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_OMA, pRequest ); +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICorePDS.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICorePDS.cpp new file mode 100755 index 0000000..b3cc60d --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICorePDS.cpp @@ -0,0 +1,1292 @@ +/*=========================================================================== +FILE: + GobiQMICorePDS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (PDS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetPDSState (Public Method) + +DESCRIPTION: + This function returns the current PDS state + +PARAMETERS: + pEnabled [ O ] - Current PDS state (0 = disabled) + pTracking [ O ] - Current PDS tracking session state + + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPDSState( + ULONG * pEnabled, + ULONG * pTracking ) +{ + // Validate arguments + if (pEnabled == 0 || pTracking == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pEnabled = ULONG_MAX; + *pTracking = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_STATE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 2) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pEnabled = pf[0].mValue.mU32; + *pTracking = pf[1].mValue.mU32; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetPDSState (Public Method) + +DESCRIPTION: + This function sets the PDS state + +PARAMETERS: + enable [ I ] - Desired PDS state (0 = disable) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetPDSState( ULONG enable ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_STATE; + std::vector piv; + + LPCSTR pVal = enable != 0 ? "1" : "0"; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, pVal ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest, 5000 ); +} + +/*=========================================================================== +METHOD: + PDSInjectTimeReference (Public Method) + +DESCRIPTION: + This function injects a system time into the PDS engine + +PARAMETERS: + sysTime [ I ] - System time + sysDiscontinuities [ I ] - Number of system time discontinuities + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::PDSInjectTimeReference( + ULONGLONG systemTime, + USHORT systemDiscontinuities ) +{ + WORD msgID = (WORD)eQMI_PDS_INJECT_TIME; + std::vector piv; + + std::ostringstream tmp; + tmp << systemTime << " " << systemDiscontinuities; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetPDSDefaults (Public Method) + +DESCRIPTION: + This function returns the default tracking session configuration + +PARAMETERS: + pOperation [ O ] - Current session operating mode + pTimeout [ O ] - Maximum amount of time (seconds) to work on each fix + pInterval [ O ] - Interval (milliseconds) between fix requests + pAccuracy [ O ] - Current accuracy threshold (meters) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPDSDefaults( + ULONG * pOperation, + BYTE * pTimeout, + ULONG * pInterval, + ULONG * pAccuracy ) +{ + // Validate arguments + if (pOperation == 0 || pTimeout == 0 || pInterval == 0 || pAccuracy == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pOperation = ULONG_MAX; + *pTimeout = UCHAR_MAX; + *pInterval = ULONG_MAX; + *pAccuracy = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_DEFAULTS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 4) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Original QMI doc claimed milliseconds, turned out to be seconds + ULONG apiInterval = pf[2].mValue.mU32 * 1000; + + *pOperation = pf[0].mValue.mU32; + *pTimeout = pf[1].mValue.mU8; + *pInterval = apiInterval; + *pAccuracy = pf[3].mValue.mU32; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetPDSDefaults (Public Method) + +DESCRIPTION: + This function sets the default tracking session configuration + +PARAMETERS: + operation [ I ] - Desired session operating mode + timeout [ I ] - Maximum amount of time (seconds) to work on each fix + interval [ I ] - Interval (milliseconds) between fix requests + accuracy [ I ] - Desired accuracy threshold (meters) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetPDSDefaults( + ULONG operation, + BYTE timeout, + ULONG interval, + ULONG accuracy ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_DEFAULTS; + std::vector piv; + + // Original QMI doc claimed milliseconds, turned out to be seconds + ULONG qmiInterval = interval / 1000; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)operation << " " << (UINT)timeout << " " << (UINT)qmiInterval + << " " << (UINT)accuracy; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetXTRAAutomaticDownload (Public Method) + +DESCRIPTION: + This function returns the XTRA automatic download configuration + +PARAMETERS: + pbEnabled [ O ] - Automatic download enabled? + pInterval [ O ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetXTRAAutomaticDownload( + ULONG * pbEnabled, + USHORT * pInterval ) +{ + // Validate arguments + if (pbEnabled == 0 || pInterval == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pbEnabled = ULONG_MAX; + *pInterval = USHRT_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_XTRA_PARAMS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 2) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pbEnabled = pf[0].mValue.mU32; + *pInterval = pf[1].mValue.mU16; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetXTRAAutomaticDownload (Public Method) + +DESCRIPTION: + This function sets the XTRA automatic download configuration + +PARAMETERS: + bEnabled [ I ] - Automatic download enabled? + interval [ I ] - Interval (hours) between XTRA downloads + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetXTRAAutomaticDownload( + ULONG bEnabled, + USHORT interval ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_XTRA_PARAMS; + std::vector piv; + + // "%u %hu" + std::ostringstream tmp; + tmp << (UINT)bEnabled << " " << (USHORT)interval; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetXTRANetwork (Public Method) + +DESCRIPTION: + This function returns the XTRA WWAN network preference + +PARAMETERS: + pPreference [ O ] - XTRA WWAN network preference + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetXTRANetwork( ULONG * pPreference ) +{ + // Validate arguments + if (pPreference == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pPreference = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_XTRA_PARAMS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 18 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pPreference = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetXTRANetwork (Public Method) + +DESCRIPTION: + This function sets the XTRA WWAN network preference + +PARAMETERS: + preference [ I ] - XTRA WWAN network preference + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetXTRANetwork( ULONG preference ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_XTRA_PARAMS; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)preference; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 18 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetXTRAValidity (Public Method) + +DESCRIPTION: + This function returns the XTRA database validity period + +PARAMETERS: + pGPSWeek [ O ] - Starting GPS week of validity period + pGPSWeekOffset [ O ] - Starting GPS week offset (minutes) of validity period + pDuration [ O ] - Length of validity period (hours) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetXTRAValidity( + USHORT * pGPSWeek, + USHORT * pGPSWeekOffset, + USHORT * pDuration ) +{ + // Validate arguments + if (pGPSWeek == 0 || pGPSWeekOffset == 0 || pDuration == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pGPSWeek = USHRT_MAX; + *pGPSWeekOffset = USHRT_MAX; + *pDuration = USHRT_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_XTRA_PARAMS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 19 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pGPSWeek = pf[0].mValue.mU16; + *pGPSWeekOffset = pf[1].mValue.mU16; + *pDuration = pf[2].mValue.mU16; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ForceXTRADownload (Public Method) + +DESCRIPTION: + This function forces the XTRA database to be downloaded to the device + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ForceXTRADownload() +{ + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_FORCE_XTRA_DL; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetXTRADataState (Public Method) + +DESCRIPTION: + This function returns the XTRA data positioning state + +PARAMETERS: + pState [ O ] - XTRA data positioning state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetXTRADataState( ULONG * pState ) +{ + // Validate arguments + if (pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pState = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_METHODS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetXTRADataState (Public Method) + +DESCRIPTION: + This function sets the XTRA data positioning state + +PARAMETERS: + state [ I ] - XTRA data positioning state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetXTRADataState( ULONG state ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_METHODS; + std::vector piv; + + std::ostringstream tmp; + tmp << state; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetXTRATimeState (Public Method) + +DESCRIPTION: + This function returns the XTRA time positioning state + +PARAMETERS: + pState [ O ] - XTRA time positioning state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetXTRATimeState( ULONG * pState ) +{ + // Validate arguments + if (pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pState = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_METHODS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetXTRATimeState (Public Method) + +DESCRIPTION: + This function sets the XTRA time positioning state + +PARAMETERS: + state [ I ] - XTRA time positioning state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetXTRATimeState( ULONG state ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_METHODS; + std::vector piv; + + std::ostringstream tmp; + tmp << state; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetAGPSConfig (Public Method) + +DESCRIPTION: + This function returns the PDS AGPS configuration + +PARAMETERS: + pServerAddress [ O ] - IPv4 address of AGPS server + pServerPort [ O ] - Port number of AGPS server + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetAGPSConfig( + ULONG * pServerAddress, + ULONG * pServerPort ) +{ + // Validate arguments + if (pServerAddress == 0 || pServerPort == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pServerAddress = ULONG_MAX; + *pServerPort = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_AGPS_CONFIG; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 5) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pServerAddress = (ip4 | ip3 | ip2 | ip1); + *pServerPort = pf[4].mValue.mU32; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetAGPSConfig (Public Method) + +DESCRIPTION: + This function sets the PDS AGPS configuration + +PARAMETERS: + serverAddress [ I ] - IPv4 address of AGPS server + serverPort [ I ] - Port number of AGPS server + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetAGPSConfig( + ULONG serverAddress, + ULONG serverPort ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_AGPS_CONFIG; + std::vector piv; + + ULONG ip4 = (serverAddress & 0x000000FF); + ULONG ip3 = (serverAddress & 0x0000FF00) >> 8; + ULONG ip2 = (serverAddress & 0x00FF0000) >> 16; + ULONG ip1 = (serverAddress & 0xFF000000) >> 24; + + + // "%u %u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1 << " " << (UINT)serverPort; + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetServiceAutomaticTracking (Public Method) + +DESCRIPTION: + This function returns the automatic tracking state for the service + +PARAMETERS: + pbAuto [ O ] - Automatic tracking session started for service? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetServiceAutomaticTracking( ULONG * pbAuto ) +{ + // Validate arguments + if (pbAuto == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_SVC_AUTOTRACK; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pbAuto = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetServiceAutomaticTracking (Public Method) + +DESCRIPTION: + This function sets the automatic tracking state for the service + +PARAMETERS: + pbAuto [ I ] - Start automatic tracking session for service? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetServiceAutomaticTracking( ULONG bAuto ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_SVC_AUTOTRACK; + std::vector piv; + + std::ostringstream tmp; + tmp << (ULONG)(bAuto != 0); + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetPortAutomaticTracking (Public Method) + +DESCRIPTION: + This function returns the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ O ] - Automatic tracking enabled for NMEA COM port? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPortAutomaticTracking( ULONG * pbAuto ) +{ + // Validate arguments + if (pbAuto == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_PDS_GET_COM_AUTOTRACK; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_PDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_PDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pbAuto = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetPortAutomaticTracking (Public Method) + +DESCRIPTION: + This function sets the automatic tracking configuration for the NMEA + COM port + +PARAMETERS: + pbAuto [ I ] - Enable automatic tracking for NMEA COM port? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetPortAutomaticTracking( ULONG bAuto ) +{ + WORD msgID = (WORD)eQMI_PDS_SET_COM_AUTOTRACK; + std::vector piv; + + std::ostringstream tmp; + tmp << (ULONG)(bAuto != 0); + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} + +/*=========================================================================== +METHOD: + ResetPDSData (Public Method) + +DESCRIPTION: + This function resets the specified PDS data + +PARAMETERS: + pGPSDataMask [ I ] - Bitmask of GPS data to clear (optional) + pCellDataMask [ I ] - Bitmask of cell data to clear (optional) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ResetPDSData( + ULONG * pGPSDataMask, + ULONG * pCellDataMask ) +{ + // Validate arguments (one must be present) + if (pGPSDataMask == 0 && pCellDataMask == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_PDS_RESET_DATA; + std::vector piv; + + if (pGPSDataMask != 0) + { + ULONG mask = *pGPSDataMask; + + // Note that we are being lazy here by specifying more arguments + // than the DB description defines; that will not cause a problem + // and we don't want to have to update this code should more bits + // be defined + std::ostringstream tmp; + for (ULONG b = 0; b < 32; b++) + { + ULONG bit = mask & 0x00000001; + mask = mask >> 1; + + tmp << bit << " "; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pCellDataMask != 0) + { + ULONG mask = *pCellDataMask; + + std::ostringstream tmp; + for (ULONG b = 0; b < 32; b++) + { + ULONG bit = mask & 0x00000001; + mask = mask >> 1; + + tmp << bit << " "; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_PDS_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_PDS, pRequest ); +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreRMS.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreRMS.cpp new file mode 100755 index 0000000..b8c3037 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreRMS.cpp @@ -0,0 +1,187 @@ +/*=========================================================================== +FILE: + GobiQMICoreRMS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (RMS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetSMSWake + +DESCRIPTION: + This function queries the state of the SMS wake functionality + +PARAMETERS: + pbEnabled [ O ] - SMS wake functionality enabled? + pWakeMask [ O ] - SMS wake mask (only relevant when enabled) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSMSWake( + ULONG * pbEnabled, + ULONG * pWakeMask ) +{ + // Validate arguments + if (pbEnabled == 0 || pWakeMask == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pbEnabled = ULONG_MAX; + *pWakeMask = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_RMS_GET_SMS_WAKE; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_RMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Try to find TLVs ID 16/17 + std::map tlvs; + tlvs = qmiRsp.GetContents(); + + std::map ::const_iterator pIter; + pIter = tlvs.find( 16 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + if (pHdr->mLength < (WORD)1) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + const BYTE * pData = (const BYTE *)++pHdr; + *pbEnabled = (ULONG)*pData; + } + + pIter = tlvs.find( 17 ); + if (pIter != tlvs.end()) + { + const sQMIRawContentHeader * pHdr = pIter->second; + if (pHdr->mLength < (WORD)4) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + const ULONG * pData = (const ULONG *)++pHdr; + *pWakeMask = *pData; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetSMSWake + +DESCRIPTION: + This function enables/disables the SMS wake functionality + +PARAMETERS: + bEnable [ I ] - Enable SMS wake functionality? + wakeMask [ I ] - SMS wake mask (only relevant when enabling) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetSMSWake( + ULONG bEnable, + ULONG wakeMask ) +{ + WORD msgID = (WORD)eQMI_RMS_SET_SMS_WAKE; + std::vector piv; + + BYTE enableTmp = (BYTE)(bEnable == 0 ? 0 : 1 ); + sProtocolEntityKey pek1( eDB2_ET_QMI_RMS_REQ, msgID, 16 ); + sDB2PackingInput pi1( pek1, &enableTmp, 1 ); + piv.push_back( pi1 ); + + if (bEnable != 0) + { + sProtocolEntityKey pek2( eDB2_ET_QMI_RMS_REQ, msgID, 17 ); + sDB2PackingInput pi2( pek2, (const BYTE *)&wakeMask, 4 ); + piv.push_back( pi2 ); + } + + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_RMS, pRequest ); +} + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreSMS.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreSMS.cpp new file mode 100755 index 0000000..789280d --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreSMS.cpp @@ -0,0 +1,940 @@ +/*=========================================================================== +FILE: + GobiQMICoreSMS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (SMS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + DeleteSMS (Public Method) + +DESCRIPTION: + This function deletes one or more SMS messages from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + pMessageIndex [ I ] - (Optional) message index + pMessageTag [ I ] - (Optional) message tag + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::DeleteSMS( + ULONG storageType, + ULONG * pMessageIndex, + ULONG * pMessageTag ) +{ + WORD msgID = (WORD)eQMI_WMS_DELETE; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)storageType; + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + if (pMessageIndex != 0) + { + std::ostringstream tmp2; + tmp2 << (UINT)*pMessageIndex; + + sProtocolEntityKey pek1( eDB2_ET_QMI_WMS_REQ, msgID, 16 ); + sDB2PackingInput pi1( pek1, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi1 ); + } + + if (pMessageTag != 0) + { + std::ostringstream tmp2; + tmp2 << (UINT)*pMessageTag; + + sProtocolEntityKey pek1( eDB2_ET_QMI_WMS_REQ, msgID, 17 ); + sDB2PackingInput pi1( pek1, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi1 ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WMS, pRequest, 10000 ); +} + +/*=========================================================================== +METHOD: + GetSMSList (Public Method) + +DESCRIPTION: + This function returns the list of SMS messages stored on the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + pRequestedTag [ I ] - Message index + pMessageListSize [I/O] - Upon input the maximum number of elements that the + message list array can contain. Upon successful + output the actual number of elements in the message + list array + pMessageList [ O ] - The message list array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSMSList( + ULONG storageType, + ULONG * pRequestedTag, + ULONG * pMessageListSize, + BYTE * pMessageList ) +{ + // Validate arguments + if (pMessageListSize == 0 || *pMessageListSize == 0 || pMessageList == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxMessageListSz = *pMessageListSize; + + // Assume failure + *pMessageListSize = 0; + + WORD msgID = (WORD)eQMI_WMS_GET_MSG_LIST; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)storageType; + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + if (pRequestedTag != 0) + { + std::ostringstream tmp2; + tmp2 << (UINT)*pRequestedTag; + + sProtocolEntityKey pek1( eDB2_ET_QMI_WMS_REQ, msgID, 16 ); + sDB2PackingInput pi1( pek1, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi1 ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG messageListSz = pf[0].mValue.mU32; + if (messageListSz == 0) + { + // No stored messages, but not necessarily a failure + return eGOBI_ERR_NONE; + } + + if (pf.size() < (1 + (messageListSz * 2)) ) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (maxMessageListSz < messageListSz) + { + messageListSz = maxMessageListSz; + } + + ULONG m = 0; + ULONG mf = 1; + ULONG * pData = (ULONG *)pMessageList; + for (m = 0; m < messageListSz; m++) + { + *pData++ = pf[mf++].mValue.mU32; + *pData++ = pf[mf++].mValue.mU32; + } + + *pMessageListSize = messageListSz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSMS (Public Method) + +DESCRIPTION: + This function returns an SMS message from device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + pMessageTag [ O ] - Message tag + pMessageFormat [ O ] - Message format + pMessageSize [I/O] - Upon input the maximum number of bytes that can be + written to the message array. Upon successful + output the actual number of bytes written to the + message array + pMessage [ I ] - The message contents array + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSMS( + ULONG storageType, + ULONG messageIndex, + ULONG * pMessageTag, + ULONG * pMessageFormat, + ULONG * pMessageSize, + BYTE * pMessage ) +{ + // Validate arguments + if ( (pMessageTag == 0) + || (pMessageFormat == 0) + || (pMessageSize == 0) + || (*pMessageSize == 0) + || (pMessage == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + ULONG maxMessageSz = *pMessageSize; + + // Assume failure + *pMessageSize = 0; + + WORD msgID = (WORD)eQMI_WMS_RAW_READ; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)storageType << " " << (UINT)messageIndex; + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pMessageTag = pf[0].mValue.mU32; + *pMessageFormat = pf[1].mValue.mU32; + + ULONG messageSz = (ULONG)pf[2].mValue.mU16; + if (messageSz == 0) + { + // There has to be message data + return eGOBI_ERR_INVALID_RSP; + } + + if (pf.size() < 3 + messageSz) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (maxMessageSz < messageSz) + { + // We have to be able to copy the whole message + return eGOBI_ERR_BUFFER_SZ; + } + + // Copy message data + for (ULONG b = 0; b < messageSz; b++) + { + pMessage[b] = pf[3 + b].mValue.mU8; + } + + *pMessageSize = messageSz; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + ModifySMSStatus (Public Method) + +DESCRIPTION: + This function modifies the status of an SMS message saved in storage on + the device + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageIndex [ I ] - Message index + messageTag [ I ] - Message tag + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::ModifySMSStatus( + ULONG storageType, + ULONG messageIndex, + ULONG messageTag ) +{ + WORD msgID = (WORD)eQMI_WMS_MODIFY_TAG; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)storageType << " " << (UINT)messageIndex << " " + << (UINT)messageTag; + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WMS, pRequest, 5000 ); +} + +/*=========================================================================== +METHOD: + SaveSMS (Public Method) + +DESCRIPTION: + This function saves an SMS message to device memory + +PARAMETERS: + storageType [ I ] - SMS message storage type + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageIndex [ O ] - The message index assigned by the device + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SaveSMS( + ULONG storageType, + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageIndex ) +{ + // Validate arguments + if (messageSize == 0 || pMessage == 0 || pMessageIndex == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WMS_RAW_WRITE; + std::vector piv; + + // "%u %u %u" + std::ostringstream tmp; + tmp << (UINT)storageType << " " << (UINT)messageFormat + << " " << (UINT)messageSize; + + for (ULONG b = 0; b < messageSize; b++) + { + tmp << " " << (UINT)pMessage[b]; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WMS, pRequest, 10000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pMessageIndex = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SendSMS (Public Method) + +DESCRIPTION: + This function sends an SMS message for immediate over the air transmission + +PARAMETERS: + messageFormat [ I ] - Message format + messageSize [ I ] - The length of the message contents in bytes + pMessage [ I ] - The message contents + pMessageFailureCode [ O ] - When the function fails due to an error sending + the message this parameter may contain the + message failure cause code (see 3GPP2 N.S0005 + Section 6.5.2.125). If the cause code is not + provided then the value will be 0xFFFFFFFF + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SendSMS( + ULONG messageFormat, + ULONG messageSize, + BYTE * pMessage, + ULONG * pMessageFailureCode ) +{ + // Validate arguments + if (messageSize == 0 || pMessage == 0 || pMessageFailureCode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume we have no message failure cause code + *pMessageFailureCode = ULONG_MAX; + + WORD msgID = (WORD)eQMI_WMS_RAW_SEND; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)messageFormat << " " << (UINT)messageSize; + + for (ULONG b = 0; b < messageSize; b++) + { + tmp << " " << (UINT)pMessage[b]; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WMS, pRequest, 300000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pMessageFailureCode = (ULONG)pf[0].mValue.mU16; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSMSCAddress (Public Method) + +DESCRIPTION: + Return the SMS center address + +PARAMETERS: + addressSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address array + can contain + pSMSCAddress [ 0 ] - The SMS center address represented as a NULL + terminated string + typeSize [ I ] - The maximum number of characters (including NULL + terminator) that the SMS center address type array + can contain + pSMSCType [ 0 ] - The SMS center address type represented as a NULL + terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSMSCAddress( + BYTE addressSize, + CHAR * pSMSCAddress, + BYTE typeSize, + CHAR * pSMSCType ) +{ + // Validate arguments + if (addressSize == 0 || pSMSCAddress == 0 || typeSize == 0 || pSMSCType == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + pSMSCAddress[0] = 0; + pSMSCType[0] = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WMS_GET_SMSC_ADDR; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + LONG strLen = pf[0].mValueString.size(); + if (strLen > 0) + { + // Space to perform the copy? + if (typeSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pSMSCType, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pSMSCType[strLen] = 0; + } + + strLen = pf[2].mValueString.size(); + if (strLen > 0) + { + // Space to perform the copy? + if (addressSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pSMSCAddress, (LPCSTR)pf[2].mValueString.c_str(), strLen ); + pSMSCAddress[strLen] = 0; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetSMSCAddress (Public Method) + +DESCRIPTION: + Set the SMS center address + +PARAMETERS: + pSMSCAddress [ I ] - The SMS center address represented as a NULL + terminated string (maximum of 21 characters, + including NULL) + pSMSCType [ I ] - The SMS center address type represented as a NULL + terminated string (optional) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetSMSCAddress( + CHAR * pSMSCAddress, + CHAR * pSMSCType ) +{ + // Validate arguments + if (pSMSCAddress == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WMS_SET_SMSC_ADDR; + std::vector piv; + + std::ostringstream addr; + if (pSMSCAddress[0] != 0) + { + addr << "\"" << pSMSCAddress << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)addr.str().c_str() ); + piv.push_back( pi ); + + if (pSMSCType != 0) + { + std::ostringstream addrType; + if (pSMSCType[0] != 0) + { + addrType << "\"" << pSMSCType << "\""; + } + + pek = sProtocolEntityKey( eDB2_ET_QMI_WMS_REQ, msgID, 16 ); + pi = sDB2PackingInput( pek, (LPCSTR)addrType.str().c_str() ); + piv.push_back( pi ); + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WMS, pRequest, 5000 ); +} + +/*=========================================================================== +METHOD: + GetSMSRoutes (Public Method) + +DESCRIPTION: + Get the current incoming SMS routing information + +PARAMETERS: + pRouteSize [I/O] - Upon input the maximum number of elements that the + SMS route array can contain. Upon succes the actual + number of elements in the SMS route array + pRoutes [ O ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + // Validate arguments + if (pRouteSize == 0 || *pRouteSize == 0 || pRoutes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + BYTE maxRoutes = *pRouteSize; + *pRouteSize = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WMS_GET_ROUTES; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WMS, msgID, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG fi = 0; + ULONG routeCount = (ULONG)pf[fi++].mValue.mU16; + if ((ULONG)pf.size() < 1 + 4 * routeCount) + { + return eGOBI_ERR_INVALID_RSP; + } + + if (routeCount > (ULONG)maxRoutes) + { + routeCount = (ULONG)maxRoutes; + } + + ULONG * pRouteArray = (ULONG *)pRoutes; + for (ULONG r = 0; r < routeCount; r++) + { + // Message type + *pRouteArray++ = pf[fi++].mValue.mU32; + + // Message class + *pRouteArray++ = pf[fi++].mValue.mU32; + + // Storage type + *pRouteArray++ = pf[fi++].mValue.mU32; + + // Receipt action + *pRouteArray++ = pf[fi++].mValue.mU32; + } + + *pRouteSize = (BYTE)routeCount; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetSMSRoutes (Public Method) + +DESCRIPTION: + Set the desired incoming SMS routing information + +PARAMETERS: + pRouteSize [ I ] - The number of elements in the SMS route array + pRoutes [ I ] - The SMS route array + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetSMSRoutes( + BYTE * pRouteSize, + BYTE * pRoutes ) +{ + // Validate arguments + if (pRouteSize == 0 || *pRouteSize == 0 || pRoutes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Format up the request + ULONG routeCount = (ULONG)*pRouteSize; + + // %u + std::ostringstream tmp; + tmp << routeCount; + + ULONG * pRouteArray = (ULONG *)pRoutes; + for (ULONG r = 0; r < routeCount; r++) + { + // Message type, class, storage type, receipt action + for (ULONG f = 0; f < 4; f++) + { + // tmp += " %u" + tmp << " " << *pRouteArray++; + } + } + + WORD msgID = (WORD)eQMI_WMS_SET_ROUTES; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_WMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WMS, pRequest, 5000 ); +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreUIM.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreUIM.cpp new file mode 100755 index 0000000..e293d22 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreUIM.cpp @@ -0,0 +1,965 @@ +/*=========================================================================== +FILE: + GobiQMICoreUIM.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (UIM Access) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + UIMSetPINProtection (Public Method) + +DESCRIPTION: + This function enables or disables protection of UIM contents by a + given PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + bEnable [ I ] - Enable/disable PIN protection (0 = disable)? + pValue [ I ] - PIN value of the PIN to be enabled/disabled + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMSetPINProtection( + ULONG id, + ULONG bEnable, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if ( (pValue == 0) + || (pValue[0] == 0) + || (pVerifyRetriesLeft == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_SET_PIN_PROT; + std::vector piv; + + std::string val( pValue ); + ULONG valSz = val.size(); + + if (bEnable != 0) + { + bEnable = 1; + } + + // "%u %u %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)bEnable << " " << (UINT)valSz + << " \"" << val << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pVerifyRetriesLeft = (ULONG)pf[0].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[1].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMVerifyPIN (Public Method) + +DESCRIPTION: + This function verifies the PIN before accessing the UIM contents + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pValue [ I ] - PIN value of the PIN to verify + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMVerifyPIN( + ULONG id, + CHAR * pValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if ( (pValue == 0) + || (pValue[0] == 0) + || (pVerifyRetriesLeft == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_PIN_VERIFY; + std::vector piv; + + std::string val( pValue ); + ULONG valSz = val.size(); + + // "%u %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)valSz << " \"" << val << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pVerifyRetriesLeft = (ULONG)pf[0].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[1].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMUnblockPIN (Public Method) + +DESCRIPTION: + This function unblocks a blocked PIN + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pPUKValue [ I ] - PUK value of the PIN to unblock + pNewValue [ I ] - New PIN value of the PIN to unblock + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMUnblockPIN( + ULONG id, + CHAR * pPUKValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if ( (pPUKValue == 0) + || (pPUKValue[0] == 0) + || (pNewValue == 0) + || (pNewValue[0] == 0) + || (pVerifyRetriesLeft == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_PIN_UNBLOCK; + std::vector piv; + + std::string val1( pPUKValue ); + ULONG val1Sz = val1.size(); + + std::string val2( pNewValue ); + ULONG val2Sz = val2.size(); + + // "%u %u \"%s\" %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)val1Sz << " \"" << val1 << "\" " + << (UINT)val2Sz << " \"" << val2 << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pVerifyRetriesLeft = (ULONG)pf[0].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[1].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMChangePIN (Public Method) + +DESCRIPTION: + This function change the PIN value + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pOldValue [ I ] - Old PIN value of the PIN to change + pNewValue [ I ] - New PIN value of the PIN to change + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - Upon operational failure this will indicate + the number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMChangePIN( + ULONG id, + CHAR * pOldValue, + CHAR * pNewValue, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if ( (pOldValue == 0) + || (pOldValue[0] == 0) + || (pNewValue == 0) + || (pNewValue[0] == 0) + || (pVerifyRetriesLeft == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_PIN_CHANGE; + std::vector piv; + + std::string val1( pOldValue ); + ULONG val1Sz = val1.size(); + + std::string val2( pNewValue ); + ULONG val2Sz = val2.size(); + + // "%u %u \"%s\" %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)val1Sz << " \"" << val1 << "\" " + << (UINT)val2Sz << " \"" << val2 << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + *pVerifyRetriesLeft = (ULONG)pf[0].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[1].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMGetPINStatus (Public Method) + +DESCRIPTION: + This function returns the status of the pin + +PARAMETERS: + id [ I ] - PIN ID (1/2) + pStatus [ O ] - PIN status (0xFFFFFFFF = unknown) + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + PIN will be blocked (0xFFFFFFFF = unknown) + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the PIN will be permanently blocked, + i.e. UIM is unusable (0xFFFFFFFF = unknown) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMGetPINStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if (pStatus == 0 || pVerifyRetriesLeft == 0 || pUnblockRetriesLeft == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pStatus = ULONG_MAX; + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_UIM_GET_PIN_STATUS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + ULONG tlvID = 16 + id; + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, tlvID ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pStatus = pf[0].mValue.mU32; + *pVerifyRetriesLeft = (ULONG)pf[1].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[2].mValue.mU8; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMGetICCID (Public Method) + +DESCRIPTION: + This function returns the UIM ICCID + +PARAMETERS: + stringSize [ I ] - The maximum number of characters (including NULL + terminator) that the string array can contain + pString [ O ] - NULL terminated string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMGetICCID( + BYTE stringSize, + CHAR * pString ) +{ + // Validate arguments + if (stringSize == 0 || pString == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pString = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_DMS_UIM_GET_ICCID; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_DMS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (IMSI) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1 || pf[0].mValueString.size() <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + std::string tmpICCID = pf[0].mValueString; + ULONG lenICCID = (ULONG)tmpICCID.size(); + + // Space to perform the copy? + if (stringSize < lenICCID + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pString, (LPCSTR)tmpICCID.c_str(), lenICCID + 1 ); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMGetControlKeyBlockingStatus (Public Method) + +DESCRIPTION: + This function returns the status of the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pStatus [ O ] - Control key status + pVerifyRetriesLeft [ O ] - The number of retries left, after which the + control key will be blocked + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked + pbBlocking [ O ] - (Optional) Is the facility blocking? + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMGetControlKeyBlockingStatus( + ULONG id, + ULONG * pStatus, + ULONG * pVerifyRetriesLeft, + ULONG * pUnblockRetriesLeft, + ULONG * pbBlocking ) +{ + // Validate arguments + if ( (pStatus == 0) + || (pVerifyRetriesLeft == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pStatus = ULONG_MAX; + *pVerifyRetriesLeft = ULONG_MAX; + *pUnblockRetriesLeft = ULONG_MAX; + + if (pbBlocking != 0) + { + *pbBlocking = 0; + } + + WORD msgID = (WORD)eQMI_DMS_UIM_GET_CK_STATUS; + std::vector piv; + + std::ostringstream tmp; + tmp << (UINT)id; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the required TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 3) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pStatus = pf[0].mValue.mU32; + *pVerifyRetriesLeft = (ULONG)pf[1].mValue.mU8; + *pUnblockRetriesLeft = (ULONG)pf[2].mValue.mU8; + + if (pbBlocking != 0) + { + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() > 0) + { + *pbBlocking = 1; + } + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMSetControlKeyProtection (Public Method) + +DESCRIPTION: + This function changes the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + status [ I ] - Control key status + pValue [ I ] - Control key de-personalization string + pVerifyRetriesLeft [ O ] - Upon operational failure this will indicate + the number of retries left, after which the + control key will be blocked + (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMSetControlKeyProtection( + ULONG id, + ULONG status, + CHAR * pValue, + ULONG * pVerifyRetriesLeft ) +{ + // Validate arguments + if ( (pValue == 0) + || (pValue[0] == 0) + || (pVerifyRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pVerifyRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_SET_CK_PROT; + std::vector piv; + + std::string val( pValue ); + ULONG valSz = val.size(); + + //"%u %u %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)status << " " << (UINT)valSz + << " \"" << val << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pVerifyRetriesLeft = (ULONG)pf[0].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + UIMUnblockControlKey (Public Method) + +DESCRIPTION: + This function unblocks the specified facility control key + +PARAMETERS: + id [ I ] - Facility ID + pValue [ I ] - Control key de-personalization string + pUnblockRetriesLeft [ O ] - The number of unblock retries left, after + which the control key will be permanently + blocked (0xFFFFFFFF = unknown) +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::UIMUnblockControlKey( + ULONG id, + CHAR * pValue, + ULONG * pUnblockRetriesLeft ) +{ + // Validate arguments + if ( (pValue == 0) + || (pValue[0] == 0) + || (pUnblockRetriesLeft == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pUnblockRetriesLeft = ULONG_MAX; + + WORD msgID = (WORD)eQMI_DMS_UIM_UNBLOCK_CK; + std::vector piv; + + std::string val( pValue ); + ULONG valSz = val.size(); + + // "%u %u \"%s\"" + std::ostringstream tmp; + tmp << (UINT)id << " " << (UINT)valSz << " \"" << val << "\""; + + sProtocolEntityKey pek( eDB2_ET_QMI_DMS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_DMS, pRequest, 5000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the optional TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_DMS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pUnblockRetriesLeft = (ULONG)pf[0].mValue.mU8; + } + + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreWDS.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreWDS.cpp new file mode 100755 index 0000000..9a6677d --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMICoreWDS.cpp @@ -0,0 +1,2804 @@ +/*=========================================================================== +FILE: + GobiQMICoreWDS.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (WDS Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Definitions +//--------------------------------------------------------------------------- + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + GetSessionState (Public Method) + +DESCRIPTION: + This function returns the state of the current packet data session + +PARAMETERS: + pState [ O ] - State of the current packet session + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSessionState( ULONG * pState ) +{ + // Validate arguments + if (pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_PKT_STATUS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the state + *pState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSessionDuration (Public Method) + +DESCRIPTION: + This function returns the duration of the current packet data session + +PARAMETERS: + pDuration [ O ] - Duration of the current packet session + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSessionDuration( ULONGLONG * pDuration ) +{ + // Validate arguments + if (pDuration == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_DURATION; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the state + *pDuration = pf[0].mValue.mU64; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetSessionDurations (Public Method) + +DESCRIPTION: + This function returns the the active/total durations of the current + packet data session + +PARAMETERS: + pActiveDuration [ O ] - Active duration of the current packet session + pTotalDuration [ O ] - Total duration of the current packet session + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetSessionDurations( + ULONGLONG * pActiveDuration, + ULONGLONG * pTotalDuration ) +{ + // Validate arguments + if (pActiveDuration == 0 || pTotalDuration == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_DURATION; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the total duration + *pTotalDuration = pf[0].mValue.mU64; + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the active duration + *pActiveDuration = pf[0].mValue.mU64; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetDormancyState (Public Method) + +DESCRIPTION: + This function returns the dormancy state of the current packet + data session (when connected) + +PARAMETERS: + pState [ O ] - Dormancy state of the current packet session + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetDormancyState( ULONG * pState ) +{ + // Validate arguments + if (pState == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_DORMANCY; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the state + *pState = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetEnhancedAutoconnect (Public Method) + +DESCRIPTION: + This function returns the current autoconnect data session setting + +PARAMETERS: + pSetting [ O ] - NDIS autoconnect setting + pRoamSetting [ O ] - NDIS autoconnect roam setting + + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetEnhancedAutoconnect( + ULONG * pSetting, + ULONG * pRoamSetting ) +{ + // Validate arguments + if (pSetting == 0 || pRoamSetting == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pSetting = ULONG_MAX; + *pRoamSetting = ULONG_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_AUTOCONNECT; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + *pSetting = (ULONG)pf[0].mValue.mU32; + + // Parse the TLV we want (by DB key) + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() > 0) + { + *pRoamSetting = (ULONG)pf[0].mValue.mU32; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetEnhancedAutoconnect (Public Method) + +DESCRIPTION: + This function sets the autoconnect data session setting + +PARAMETERS: + setting [ I ] - NDIS autoconnect setting + pRoamSetting [ I ] - (Optional) NDIS autoconnect roam setting + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetEnhancedAutoconnect( + ULONG setting, + ULONG * pRoamSetting ) +{ + WORD msgID = (WORD)eQMI_WDS_SET_AUTOCONNECT; + std::vector piv; + + // "%u" + std::ostringstream tmp; + tmp << setting; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, tmp.str().c_str() ); + piv.push_back( pi ); + + if (pRoamSetting != 0) + { + std::ostringstream tmp2; + tmp2 << *pRoamSetting; + + sProtocolEntityKey pek1( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + sDB2PackingInput pi1( pek1, tmp2.str().c_str() ); + piv.push_back( pi1 ); + } + + ULONG to = 5000; + if (setting == 1) + { + // Connections can take a long time + to = 300000; + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest, to ); +} + +/*=========================================================================== +METHOD: + SetDefaultProfile (Public Method) + +DESCRIPTION: + This function writes the default profile settings to the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being written + pPDPType [ I ] - (Optional) PDP type + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pName [ I ] - (Optional) The profile name or description + pAPNName [ I ] - (Optional) Access point name + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + CHAR * pName, + CHAR * pAPNName, + CHAR * pUsername, + CHAR * pPassword ) +{ + WORD msgID = (WORD)eQMI_WDS_MODIFY_PROFILE; + std::vector piv; + + // "%u 1" + std::ostringstream tmp; + tmp << (UINT)profileType << " 1"; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + if (pName != 0) + { + std::ostringstream tmp2; + if (pName[0] != 0) + { + tmp2 << "\"" << pName << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pPDPType != 0) + { + // "%u" + std::ostringstream tmp2; + tmp2 << (UINT)*pPDPType; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pAPNName != 0) + { + std::ostringstream tmp2; + if (pAPNName[0] != 0) + { + tmp2 << "\"" << pAPNName << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 20 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pPrimaryDNS != 0) + { + ULONG ip4 = (*pPrimaryDNS & 0x000000FF); + ULONG ip3 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 21 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pSecondaryDNS != 0) + { + ULONG ip4 = (*pSecondaryDNS & 0x000000FF); + ULONG ip3 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 22 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pUsername != 0) + { + std::ostringstream tmp2; + if (pUsername[0] != 0) + { + tmp2 << "\"" << pUsername << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 27 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pPassword != 0) + { + std::ostringstream tmp2; + if (pPassword[0] != 0) + { + tmp2 << "\"" << pPassword << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 28 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pAuthentication != 0) + { + ULONG pap = *pAuthentication & 0x00000001; + ULONG chap = *pAuthentication & 0x00000002; + + // "%u %u" + std::ostringstream tmp2; + tmp2 << (UINT)pap << " " << (UINT)chap; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 29 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + if (pIPAddress != 0) + { + ULONG ip4 = (*pIPAddress & 0x000000FF); + ULONG ip3 = (*pIPAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pIPAddress & 0x00FF0000) >> 16; + ULONG ip1 = (*pIPAddress & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 30 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // We need to be doing something here (beyond profile type) + if (piv.size() <= 1) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Pack up and send the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetDefaultProfile (Public Method) + +DESCRIPTION: + This function reads the default profile settings from the device, the + default profile is used during autoconnect + +PARAMETERS: + profileType [ I ] - Profile type being read + pPDPType [ O ] - PDP type + pIPAddress [ O ] - Preferred assigned IPv4 address + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + pAuthentication [ O ] - Authentication algorithm bitmap + nameSize [ I ] - The maximum number of characters (including + NULL terminator) that the profile name array + can contain + pName [ O ] - The profile name or description + apnSize [ I ] - The maximum number of characters (including + NULL terminator) that the APN name array + can contain + pAPNName [ O ] - Access point name represented as a NULL + terminated string (empty string returned when + unknown) + userSize [ I ] - The maximum number of characters (including + NULL terminator) that the username array + can contain + pUsername [ O ] - Username used during authentication + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetDefaultProfile( + ULONG profileType, + ULONG * pPDPType, + ULONG * pIPAddress, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pAuthentication, + BYTE nameSize, + CHAR * pName, + BYTE apnSize, + CHAR * pAPNName, + BYTE userSize, + CHAR * pUsername ) +{ + // Validate arguments + if ( (pPDPType == 0) + || (pIPAddress == 0) + || (pPrimaryDNS == 0) + || (pSecondaryDNS == 0) + || (pAuthentication == 0) + || (nameSize == 0) + || (pName == 0) + || (apnSize == 0) + || (pAPNName == 0) + || (userSize == 0) + || (pUsername == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pPDPType = ULONG_MAX; + *pIPAddress = ULONG_MAX; + *pPrimaryDNS = ULONG_MAX; + *pSecondaryDNS = ULONG_MAX; + *pAuthentication = ULONG_MAX; + pName[0] = 0; + pAPNName[0] = 0; + pUsername[0] = 0; + + WORD msgID = (WORD)eQMI_WDS_GET_DEFAULTS; + std::vector piv; + + // "%u 0" + std::ostringstream tmp; + tmp << (UINT)profileType << " 0"; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WDS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (nameSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pName, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pName[strLen] = 0; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pPDPType = pf[0].mValue.mU32; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 20 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (apnSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pAPNName, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pAPNName[strLen] = 0; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 21 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 4) + { + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pPrimaryDNS = (ip4 | ip3 | ip2 | ip1); + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 22 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 4) + { + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pSecondaryDNS = (ip4 | ip3 | ip2 | ip1); + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 27 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + LONG strLen = pf[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (userSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pUsername, (LPCSTR)pf[0].mValueString.c_str(), strLen ); + pUsername[strLen] = 0; + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 29 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 2) + { + ULONG pap = (ULONG)pf[0].mValue.mU8; + ULONG chap = (ULONG)pf[1].mValue.mU8 << 1; + + *pAuthentication = (pap | chap); + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 30 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 4) + { + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pIPAddress = (ip4 | ip3 | ip2 | ip1); + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + StartDataSession (Public Method) + +DESCRIPTION: + This function activates a packet data session + +PARAMETERS: + pTechnology [ I ] - (Optional) Technology bitmap + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + pPrimaryNBNS [ I ] - (Optional) Primary NetBIOS NS IPv4 address + pSecondaryNBNS [ I ] - (Optional) Secondary NetBIOS NS IPv4 address + pAPNName [ I ] - (Optional) Access point name + pIPAddress [ I ] - (Optional) Preferred assigned IPv4 address + pAuthentication [ I ] - (Optional) Authentication algorithm bitmap + pUsername [ I ] - (Optional) Username used during authentication + pPassword [ I ] - (Optional) Password used during authentication + pSessionId [ O ] - The assigned session ID + pFailureReason [ O ] - Upon call failure the failure reason + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::StartDataSession( + ULONG * pTechnology, + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS, + ULONG * pPrimaryNBNS, + ULONG * pSecondaryNBNS, + CHAR * pAPNName, + ULONG * pIPAddress, + ULONG * pAuthentication, + CHAR * pUsername, + CHAR * pPassword, + ULONG * pSessionId, + ULONG * pFailureReason ) +{ + *pFailureReason = (ULONG)eQMI_CALL_END_REASON_UNSPECIFIED; + + // Validate arguments + if (pSessionId == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_START_NET; + std::vector piv; + + if (pTechnology != 0) + { + ULONG umts = *pTechnology & 0x00000001; + ULONG cdma = *pTechnology & 0x00000002; + + // "%u %u" + std::ostringstream tmp; + tmp << (UINT)umts << " " << (UINT)cdma; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 48 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pPrimaryDNS != 0) + { + ULONG ip4 = (*pPrimaryDNS & 0x000000FF); + ULONG ip3 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pSecondaryDNS != 0) + { + ULONG ip4 = (*pSecondaryDNS & 0x000000FF); + ULONG ip3 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pPrimaryNBNS != 0) + { + ULONG ip4 = (*pPrimaryNBNS & 0x000000FF); + ULONG ip3 = (*pPrimaryNBNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryNBNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pPrimaryNBNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 18 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pSecondaryNBNS != 0) + { + ULONG ip4 = (*pSecondaryNBNS & 0x000000FF); + ULONG ip3 = (*pSecondaryNBNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryNBNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pSecondaryNBNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 19 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pAPNName != 0) + { + std::ostringstream tmp; + if (pAPNName[0] != 0) + { + tmp << "\"" << pAPNName << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 20 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pIPAddress != 0) + { + ULONG ip4 = (*pIPAddress & 0x000000FF); + ULONG ip3 = (*pIPAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pIPAddress & 0x00FF0000) >> 16; + ULONG ip1 = (*pIPAddress & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 21 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pAuthentication != 0) + { + ULONG pap = *pAuthentication & 0x00000001; + ULONG chap = *pAuthentication & 0x00000002; + + // "%u %u" + std::ostringstream tmp; + tmp << (UINT)pap << " " << (UINT)chap; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 22 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pUsername != 0) + { + std::ostringstream tmp; + if (pUsername[0] != 0) + { + tmp << "\"" << pUsername << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 23 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pPassword != 0) + { + std::ostringstream tmp; + if (pPassword[0] != 0) + { + tmp << "\"" << pPassword << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 24 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + sProtocolBuffer rsp; + if (piv.size() > 0) + { + // Pack up and send the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + else + { + rsp = Send( eQMI_SVC_WDS, pRequest, 300000 ); + } + } + else + { + // Generate and send the QMI request + rsp = SendSimple( eQMI_SVC_WDS, msgID, 300000 ); + } + + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pFailureReason = pf[0].mValue.mU32; + } + + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the session ID + *pSessionId = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + CancelDataSession (Public Method) + +DESCRIPTION: + Cancel an in-progress packet data session activation + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::CancelDataSession() +{ + if (mLastNetStartID == (WORD)INVALID_QMI_TRANSACTION_ID) + { + return eGOBI_ERR_NO_CANCELABLE_OP; + } + + WORD msgID = (WORD)eQMI_WDS_ABORT; + std::vector piv; + + // %hu + std::ostringstream tmp; + tmp << mLastNetStartID; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + mLastNetStartID = (WORD)INVALID_QMI_TRANSACTION_ID; + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest, 60000 ); +} + +/*=========================================================================== +METHOD: + StopDataSession (Public Method) + +DESCRIPTION: + This function stops the current data session + +PARAMETERS: + sessionId [ I ] - The ID of the session to terminate + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::StopDataSession( ULONG sessionId ) +{ + WORD msgID = (WORD)eQMI_WDS_STOP_NET; + std::vector piv; + + // "%u" + std::ostringstream tmp; + tmp << (UINT)sessionId; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest, 60000 ); +} + +/*=========================================================================== +METHOD: + GetIPAddress + +DESCRIPTION: + This function returns the current packet data session IP address + +PARAMETERS: + pIPAddress [ I ] - Assigned IPv4 address + +RETURN VALUE: + ULONG - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetIPAddress( ULONG * pIPAddress ) +{ + // Validate arguments + if (pIPAddress == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume failure + *pIPAddress = ULONG_MAX; + + WORD msgID = (WORD)eQMI_WDS_GET_SETTINGS; + std::vector piv; + + std::string tmp = "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0"; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WDS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLVs we want (IP address) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 30 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 4) + { + return eGOBI_ERR_INVALID_RSP; + } + + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pIPAddress = (ip4 | ip3 | ip2 | ip1); + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetConnectionRate (Public Method) + +DESCRIPTION: + This function returns connection rate information for the packet data + connection + +PARAMETERS: + pCurrentChannelTXRate [ O ] - Current channel TX rate (bps) + pCurrentChannelRXRate [ O ] - Current channel RX rate (bps) + pMaxChannelTXRate [ O ] - Maximum channel TX rate (bps) + pMaxChannelRXRate [ O ] - Maximum channel RX rate (bps) + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetConnectionRate( + ULONG * pCurrentChannelTXRate, + ULONG * pCurrentChannelRXRate, + ULONG * pMaxChannelTXRate, + ULONG * pMaxChannelRXRate ) +{ + // Validate arguments + if ( (pCurrentChannelTXRate == 0) + || (pCurrentChannelRXRate == 0) + || (pMaxChannelTXRate == 0) + || (pMaxChannelRXRate == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_RATES; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 4) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the rates + *pCurrentChannelTXRate = pf[0].mValue.mU32; + *pCurrentChannelRXRate = pf[1].mValue.mU32; + *pMaxChannelTXRate = pf[2].mValue.mU32; + *pMaxChannelRXRate = pf[3].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetPacketStatus (Public Method) + +DESCRIPTION: + This function returns the packet data transfer statistics since the start + of the current packet data session + +PARAMETERS: + pTXPacketSuccesses [ O ] - Packets transmitted without error + pRXPacketSuccesses [ O ] - Packets received without error + pTXPacketErrors [ O ] - Outgoing packets with framing errors + pRXPacketErrors [ O ] - Incoming packets with framing errors + pTXPacketOverflows [ O ] - Packets dropped because TX buffer overflowed + pRXPacketOverflows [ O ] - Packets dropped because RX buffer overflowed + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetPacketStatus( + ULONG * pTXPacketSuccesses, + ULONG * pRXPacketSuccesses, + ULONG * pTXPacketErrors, + ULONG * pRXPacketErrors, + ULONG * pTXPacketOverflows, + ULONG * pRXPacketOverflows ) +{ + // Validate arguments + if ( (pTXPacketSuccesses == 0) + || (pRXPacketSuccesses == 0) + || (pTXPacketErrors == 0) + || (pRXPacketErrors == 0) + || (pTXPacketOverflows == 0) + || (pRXPacketOverflows == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_GET_STATISTICS; + std::vector piv; + + std::string tmp = "1 1 1 1 1 1 0 0"; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WDS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + // Parse the TLVs we want (by DB key) + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey3( eDB2_ET_QMI_WDS_RSP, msgID, 18 ); + cDataParser::tParsedFields pf3 = ParseTLV( db, rsp, tlvs, tlvKey3 ); + if (pf3.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey4( eDB2_ET_QMI_WDS_RSP, msgID, 19 ); + cDataParser::tParsedFields pf4 = ParseTLV( db, rsp, tlvs, tlvKey4 ); + if (pf4.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey5( eDB2_ET_QMI_WDS_RSP, msgID, 20 ); + cDataParser::tParsedFields pf5 = ParseTLV( db, rsp, tlvs, tlvKey5 ); + if (pf5.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey6( eDB2_ET_QMI_WDS_RSP, msgID, 21 ); + cDataParser::tParsedFields pf6 = ParseTLV( db, rsp, tlvs, tlvKey5 ); + if (pf6.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the statistics + *pTXPacketSuccesses = pf1[0].mValue.mU32; + *pRXPacketSuccesses = pf2[0].mValue.mU32; + *pTXPacketErrors = pf3[0].mValue.mU32; + *pRXPacketErrors = pf4[0].mValue.mU32; + *pTXPacketOverflows = pf5[0].mValue.mU32; + *pRXPacketOverflows = pf6[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetByteTotals (Public Method) + +DESCRIPTION: + This function returns the RX/TX byte counts since the start of the + current packet data session + +PARAMETERS: + pTXTotalBytes [ O ] - Bytes transmitted without error + pRXTotalBytes [ O ] - Bytes received without error + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetByteTotals( + ULONGLONG * pTXTotalBytes, + ULONGLONG * pRXTotalBytes ) +{ + // Validate arguments + if (pTXTotalBytes == 0 || pRXTotalBytes == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_GET_STATISTICS; + std::vector piv; + + std::string tmp = "0 0 0 0 0 0 1 1"; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WDS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_WDS_RSP, msgID, 25 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_WDS_RSP, msgID, 26 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the statistics + *pTXTotalBytes = pf1[0].mValue.mU64; + *pRXTotalBytes = pf2[0].mValue.mU64; + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetMobileIP (Public Method) + +DESCRIPTION: + This function sets the current mobile IP setting + +PARAMETERS: + mode [ I ] - Desired mobile IP setting + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetMobileIP( ULONG mode ) +{ + WORD msgID = (WORD)eQMI_WDS_SET_MIP; + std::vector piv; + + // "%u" + std::ostringstream tmp; + tmp << (UINT)mode; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetMobileIP (Public Method) + +DESCRIPTION: + This function gets the current mobile IP setting + +PARAMETERS: + pMode [ I ] - Desired mobile IP setting + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetMobileIP( ULONG * pMode ) +{ + // Validate arguments + if (pMode == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_MIP; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the mode + *pMode = pf[0].mValue.mU32; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetActiveMobileIPProfile (Public Method) + +DESCRIPTION: + This function sets the active mobile IP profile index + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Desired mobile IP profile index + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetActiveMobileIPProfile( + CHAR * pSPC, + BYTE index ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_SET_ACTIVE_MIP; + std::vector piv; + + // "%s %u" + std::ostringstream tmp; + tmp << spc << " " << (UINT)index; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetActiveMobileIPProfile (Public Method) + +DESCRIPTION: + This function gets the the active mobile IP profile index + +PARAMETERS: + pIndex [ O ] - Active mobile IP profile index + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetActiveMobileIPProfile( BYTE * pIndex ) +{ + // Validate arguments + if (pIndex == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_ACTIVE_MIP; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the index + *pIndex = pf[0].mValue.mU8; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetMobileIPProfile (Public Method) + +DESCRIPTION: + This function sets the specified mobile IP profile settings + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + index [ I ] - Mobile IP profile ID + pEnabled [ I ] - (Optional) Enable MIP profile? + pAddress [ I ] - (Optional) Home IPv4 address + pPrimaryHA [ I ] - (Optional) Primary home agent IPv4 address + pSecondaryHA [ I ] - (Optional) Secondary home agent IPv4 address + pRevTunneling [ I ] - (Optional) Enable reverse tunneling? + pNAI [ I ] - (Optional) Network access identifier string + pHASPI [ I ] - (Optional) HA security parameter index + pAAASPI [ I ] - (Optional) AAA security parameter index + pMNHA [ I ] - (Optional) MN-HA string + pMNAAA [ I ] - (Optional) MN-AAA string + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetMobileIPProfile( + CHAR * pSPC, + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + CHAR * pMNHA, + CHAR * pMNAAA ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_SET_MIP_PROFILE; + std::vector piv; + + // "%s %u" + std::ostringstream tmp; + tmp << spc << " " << (UINT)index; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + + // Enabled flag provided? + if (pEnabled != 0) + { + // "%u" + std::ostringstream tmp2; + tmp2 << (UINT)(*pEnabled == 0 ? 0 : 1); + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // Home address provided? + if (pAddress != 0) + { + ULONG ip4 = (*pAddress & 0x000000FF); + ULONG ip3 = (*pAddress & 0x0000FF00) >> 8; + ULONG ip2 = (*pAddress & 0x00FF0000) >> 16; + ULONG ip1 = (*pAddress & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // Primary HA address provided? + if (pPrimaryHA != 0) + { + ULONG ip4 = (*pPrimaryHA & 0x000000FF); + ULONG ip3 = (*pPrimaryHA & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryHA & 0x00FF0000) >> 16; + ULONG ip1 = (*pPrimaryHA & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 18 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // Secondary HA address provided? + if (pSecondaryHA != 0) + { + ULONG ip4 = (*pSecondaryHA & 0x000000FF); + ULONG ip3 = (*pSecondaryHA & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryHA & 0x00FF0000) >> 16; + ULONG ip1 = (*pSecondaryHA & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp2; + tmp2 << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 19 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // Reverse tunneling flag provided? + if (pRevTunneling != 0) + { + // "%u" + std::ostringstream tmp2; + tmp2 << (UINT)(*pRevTunneling == 0 ? 0 : 1); + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 20 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // NAI provided? + if (pNAI != 0) + { + std::ostringstream tmp2; + if (pNAI[0] != 0) + { + tmp2 << "\"" << pNAI << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 21 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // HA SPI provided? + if (pHASPI != 0) + { + // "%u" + std::ostringstream tmp2; + tmp2 << (UINT)*pHASPI; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 22 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // AAA SPI provided? + if (pAAASPI != 0) + { + // "%u" + std::ostringstream tmp2; + tmp2 << (UINT)*pAAASPI; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 23 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // MN-HA key provided? + if (pMNHA != 0) + { + std::ostringstream tmp2; + if (pMNHA[0] != 0) + { + tmp2 << "\"" << pMNHA << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 24 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp2.str().c_str() ); + piv.push_back( pi ); + } + + // MN-AAA key provided? + if (pMNAAA != 0) + { + std::ostringstream tmp2; + if (pMNAAA[0] != 0) + { + tmp2 << "\"" << pMNAAA << "\""; + } + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 25 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // We require at least one of the optional arguments + if (piv.size() <= 1) + { + // Much ado about nothing + return eGOBI_ERR_INVALID_ARG; + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetMobileIPProfile (Public Method) + +DESCRIPTION: + This function gets the specified mobile IP profile settings + +PARAMETERS: + index [ I ] - Mobile IP profile ID + pEnabled [ O ] - MIP profile enabled? + pAddress [ O ] - Home IPv4 address + pPrimaryHA [ O ] - Primary home agent IPv4 address + pSecondaryHA [ O ] - Secondary home agent IPv4 address + pRevTunneling [ O ] - Reverse tunneling enabled? + naiSize [ I ] - The maximum number of characters (including NULL + terminator) that the NAI array can contain + pNAI [ O ] - Network access identifier string + pHASPI [ O ] - HA security parameter index + pAAASPI [ O ] - AAA security parameter index + pHAState [ O ] - HA key state + pAAAState [ O ] - AAA key state + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetMobileIPProfile( + BYTE index, + BYTE * pEnabled, + ULONG * pAddress, + ULONG * pPrimaryHA, + ULONG * pSecondaryHA, + BYTE * pRevTunneling, + BYTE naiSize, + CHAR * pNAI, + ULONG * pHASPI, + ULONG * pAAASPI, + ULONG * pHAState, + ULONG * pAAAState ) +{ + + // Validate arguments + if ( (pEnabled == 0) + || (pAddress == 0) + || (pPrimaryHA == 0) + || (pSecondaryHA == 0) + || (pRevTunneling == 0) + || (naiSize == 0) + || (pNAI == 0) + || (pHASPI == 0) + || (pAAASPI == 0) + || (pHAState == 0) + || (pAAAState == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Assume errors + *pEnabled = UCHAR_MAX; + *pAddress = ULONG_MAX; + *pPrimaryHA = ULONG_MAX; + *pSecondaryHA = ULONG_MAX; + *pRevTunneling = UCHAR_MAX; + *pHASPI = ULONG_MAX; + *pAAASPI = ULONG_MAX; + *pHAState = ULONG_MAX; + *pAAAState = ULONG_MAX; + + WORD msgID = (WORD)eQMI_WDS_GET_MIP_PROFILE; + std::vector piv; + + // "%u" + std::ostringstream arg; + arg << (UINT)index; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)arg.str().c_str() ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request + sProtocolBuffer rsp = Send( eQMI_SVC_WDS, pRequest ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + + sProtocolEntityKey tlvKey1( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf1 = ParseTLV( db, rsp, tlvs, tlvKey1 ); + if (pf1.size() >= 1) + { + *pEnabled = pf1[0].mValue.mU8; + } + + sProtocolEntityKey tlvKey2( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + cDataParser::tParsedFields pf2 = ParseTLV( db, rsp, tlvs, tlvKey2 ); + if (pf2.size() >= 4) + { + ULONG ip4 = (ULONG)pf2[0].mValue.mU8; + ULONG ip3 = (ULONG)pf2[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf2[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf2[3].mValue.mU8 << 24; + *pAddress = (ip4 | ip3 | ip2 | ip1); + } + + + sProtocolEntityKey tlvKey3( eDB2_ET_QMI_WDS_RSP, msgID, 18 ); + cDataParser::tParsedFields pf3 = ParseTLV( db, rsp, tlvs, tlvKey3 ); + if (pf3.size() >= 4) + { + ULONG ip4 = (ULONG)pf3[0].mValue.mU8; + ULONG ip3 = (ULONG)pf3[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf3[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf3[3].mValue.mU8 << 24; + *pPrimaryHA = (ip4 | ip3 | ip2 | ip1); + } + + sProtocolEntityKey tlvKey4( eDB2_ET_QMI_WDS_RSP, msgID, 19 ); + cDataParser::tParsedFields pf4 = ParseTLV( db, rsp, tlvs, tlvKey4 ); + if (pf4.size() >= 4) + { + ULONG ip4 = (ULONG)pf4[0].mValue.mU8; + ULONG ip3 = (ULONG)pf4[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf4[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf4[3].mValue.mU8 << 24; + *pSecondaryHA = (ip4 | ip3 | ip2 | ip1); + } + + sProtocolEntityKey tlvKey5( eDB2_ET_QMI_WDS_RSP, msgID, 20 ); + cDataParser::tParsedFields pf5 = ParseTLV( db, rsp, tlvs, tlvKey5 ); + if (pf5.size() >= 1) + { + *pRevTunneling = pf5[0].mValue.mU8; + } + + sProtocolEntityKey tlvKey6( eDB2_ET_QMI_WDS_RSP, msgID, 21 ); + cDataParser::tParsedFields pf6 = ParseTLV( db, rsp, tlvs, tlvKey6 ); + if (pf6.size() >= 1) + { + LONG strLen = pf6[0].mValueString.size(); + if (strLen <= 0) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Space to perform the copy? + if (naiSize < strLen + 1) + { + return eGOBI_ERR_BUFFER_SZ; + } + + memcpy( (LPVOID)pNAI, (LPCSTR)pf6[0].mValueString.c_str(), strLen ); + pNAI[strLen] = 0; + } + + sProtocolEntityKey tlvKey7( eDB2_ET_QMI_WDS_RSP, msgID, 22 ); + cDataParser::tParsedFields pf7 = ParseTLV( db, rsp, tlvs, tlvKey7 ); + if (pf7.size() >= 1) + { + *pHASPI = pf7[0].mValue.mU32; + } + + sProtocolEntityKey tlvKey8( eDB2_ET_QMI_WDS_RSP, msgID, 23 ); + cDataParser::tParsedFields pf8 = ParseTLV( db, rsp, tlvs, tlvKey8 ); + if (pf8.size() >= 1) + { + *pAAASPI = pf8[0].mValue.mU32; + } + sProtocolEntityKey tlvKey9( eDB2_ET_QMI_WDS_RSP, msgID, 26 ); + cDataParser::tParsedFields pf9 = ParseTLV( db, rsp, tlvs, tlvKey9 ); + if (pf9.size() >= 1) + { + *pHAState = pf9[0].mValue.mU32; + } + + sProtocolEntityKey tlvKey10( eDB2_ET_QMI_WDS_RSP, msgID, 27 ); + cDataParser::tParsedFields pf10 = ParseTLV( db, rsp, tlvs, tlvKey10 ); + if (pf10.size() >= 1) + { + *pAAAState = pf10[0].mValue.mU32; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetMobileIPParameters (Public Method) + +DESCRIPTION: + This function sets the specified mobile IP parameters + +PARAMETERS: + pSPC [ I ] - Six digit service programming code + pMode [ I ] - (Optional) Desired mobile IP setting + pRetryLimit [ I ] - (Optional) Retry attempt limit + pRetryInterval [ I ] - (Optional) Retry attempt interval + pReRegPeriod [ I ] - (Optional) Re-registration period + pReRegTraffic [ I ] - (Optional) Re-registration only with traffic? + pHAAuthenticator [ I ] - (Optional) MH-HA authenticator calculator? + pHA2002bis [ I ] - (Optional) MH-HA RFC 2002bis authentication? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetMobileIPParameters( + CHAR * pSPC, + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + // Validate arguments + if (pSPC == 0 || pSPC[0] == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + std::string spc( pSPC ); + if (spc.size() > 6) + { + return eGOBI_ERR_INVALID_ARG; + } + + int nNonDigit = spc.find_first_not_of( "0123456789" ); + std::string digitSPC = spc.substr( 0, nNonDigit ); + if (digitSPC.size() != spc.size()) + { + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_SET_MIP_PARAMS; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (LPCSTR)spc.c_str() ); + piv.push_back( pi ); + + // Mode provided? + if (pMode != 0) + { + // "%u" + std::ostringstream tmp; + tmp << (UINT)*pMode; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Retry limit provided? + if (pRetryLimit != 0) + { + std::ostringstream tmp; + tmp << (UINT)*pRetryLimit; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Retry interval provided? + if (pRetryInterval != 0) + { + std::ostringstream tmp; + tmp << (UINT)*pRetryInterval; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 18 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Re-registration period provided? + if (pReRegPeriod != 0) + { + std::ostringstream tmp; + tmp << (UINT)*pReRegPeriod; + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 19 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Re-registration on traffic flag provided? + if (pReRegTraffic != 0) + { + std::ostringstream tmp; + tmp << (UINT)(*pReRegTraffic == 0 ? 0 : 1); + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 20 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // HA authenticator flag provided? + if (pHAAuthenticator != 0) + { + std::ostringstream tmp; + tmp << (UINT)(*pHAAuthenticator == 0 ? 0 : 1); + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 21 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // HA RFC2002bis authentication flag provided? + if (pHA2002bis != 0) + { + std::ostringstream tmp; + tmp << (UINT)(*pHA2002bis == 0 ? 0 : 1); + + pek = sProtocolEntityKey( eDB2_ET_QMI_WDS_REQ, msgID, 22 ); + pi = sDB2PackingInput( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // We require at least one of the optional arguments + if (piv.size() <= 1) + { + // Much ado about nothing + return eGOBI_ERR_INVALID_ARG; + } + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetMobileIPParameters (Public Method) + +DESCRIPTION: + This function gets the mobile IP parameters + +PARAMETERS: + pMode [ 0 ] - Current mobile IP setting + pRetryLimit [ 0 ] - Retry attempt limit + pRetryInterval [ 0 ] - Retry attempt interval + pReRegPeriod [ 0 ] - Re-registration period + pReRegTraffic [ 0 ] - Re-registration only with traffic? + pHAAuthenticator [ 0 ] - MH-HA authenticator calculator? + pHA2002bis [ 0 ] - MH-HA RFC 2002bis authentication? + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetMobileIPParameters( + ULONG * pMode, + BYTE * pRetryLimit, + BYTE * pRetryInterval, + BYTE * pReRegPeriod, + BYTE * pReRegTraffic, + BYTE * pHAAuthenticator, + BYTE * pHA2002bis ) +{ + // Validate arguments + if ( (pMode == 0) + || (pRetryLimit == 0) + || (pRetryInterval == 0) + || (pReRegPeriod == 0) + || (pReRegTraffic == 0) + || (pHAAuthenticator == 0) + || (pHA2002bis == 0) ) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pMode = ULONG_MAX; + *pRetryLimit = UCHAR_MAX; + *pRetryInterval = UCHAR_MAX; + *pReRegPeriod = UCHAR_MAX; + *pReRegTraffic = UCHAR_MAX; + *pHAAuthenticator = UCHAR_MAX; + *pHA2002bis = UCHAR_MAX; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_MIP_PARAMS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pMode = pf[0].mValue.mU32; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pRetryLimit = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 18 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pRetryInterval = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 19 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pReRegPeriod = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 20 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pReRegTraffic = pf[0].mValue.mU8; + } + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 21 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pHAAuthenticator = pf[0].mValue.mU8; + } + + + tlvKey = sProtocolEntityKey ( eDB2_ET_QMI_WDS_RSP, msgID, 22 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 1) + { + *pHA2002bis = pf[0].mValue.mU8; + } + + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + GetLastMobileIPError (Public Method) + +DESCRIPTION: + This function gets the last mobile IP error + +PARAMETERS: + pError [ 0 ] - Last mobile IP error + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetLastMobileIPError( ULONG * pError ) +{ + // Validate arguments + if (pError == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_LAST_MIP_STATUS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 1 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() < 1) + { + return eGOBI_ERR_INVALID_RSP; + } + + // Populate the index + *pError = (ULONG)pf[0].mValue.mU8; + return eGOBI_ERR_NONE; +} + +/*=========================================================================== +METHOD: + SetDNSSettings + +DESCRIPTION: + This function sets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ I ] - (Optional) Primary DNS IPv4 address + pSecondaryDNS [ I ] - (Optional) Secondary DNS IPv4 address + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::SetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + // Validate arguments + if (pPrimaryDNS == 0 && pSecondaryDNS == 0) + { + // At least one must be specified + return eGOBI_ERR_INVALID_ARG; + } + + WORD msgID = (WORD)eQMI_WDS_SET_DNS; + std::vector piv; + + if (pPrimaryDNS != 0) + { + ULONG ip4 = (*pPrimaryDNS & 0x000000FF); + ULONG ip3 = (*pPrimaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pPrimaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pPrimaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 16 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + if (pSecondaryDNS != 0) + { + ULONG ip4 = (*pSecondaryDNS & 0x000000FF); + ULONG ip3 = (*pSecondaryDNS & 0x0000FF00) >> 8; + ULONG ip2 = (*pSecondaryDNS & 0x00FF0000) >> 16; + ULONG ip1 = (*pSecondaryDNS & 0xFF000000) >> 24; + + // "%u %u %u %u" + std::ostringstream tmp; + tmp << (UINT)ip4 << " " << (UINT)ip3 << " " << (UINT)ip2 + << " " << (UINT)ip1; + + sProtocolEntityKey pek( eDB2_ET_QMI_WDS_REQ, msgID, 17 ); + sDB2PackingInput pi( pek, (LPCSTR)tmp.str().c_str() ); + piv.push_back( pi ); + } + + // Pack up and send the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_WDS, pRequest ); +} + +/*=========================================================================== +METHOD: + GetDNSSettings + +DESCRIPTION: + This function gets the DNS settings for the device + +PARAMETERS: + pPrimaryDNS [ O ] - Primary DNS IPv4 address + pSecondaryDNS [ O ] - Secondary DNS IPv4 address + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::GetDNSSettings( + ULONG * pPrimaryDNS, + ULONG * pSecondaryDNS ) +{ + // Validate arguments + if (pPrimaryDNS == 0 || pSecondaryDNS == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + *pPrimaryDNS = 0; + *pSecondaryDNS = 0; + + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_WDS_GET_DNS; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_WDS, msgID ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + // Prepare TLVs for parsing + std::vector tlvs = DB2ReduceQMIBuffer( qmiRsp ); + const cCoreDatabase & db = GetDatabase(); + + // Parse the TLV we want (by DB key) + sProtocolEntityKey tlvKey( eDB2_ET_QMI_WDS_RSP, msgID, 16 ); + cDataParser::tParsedFields pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 4) + { + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pPrimaryDNS = (ip4 | ip3 | ip2 | ip1); + } + + tlvKey = sProtocolEntityKey( eDB2_ET_QMI_WDS_RSP, msgID, 17 ); + pf = ParseTLV( db, rsp, tlvs, tlvKey ); + if (pf.size() >= 4) + { + ULONG ip4 = (ULONG)pf[0].mValue.mU8; + ULONG ip3 = (ULONG)pf[1].mValue.mU8 << 8; + ULONG ip2 = (ULONG)pf[2].mValue.mU8 << 16; + ULONG ip1 = (ULONG)pf[3].mValue.mU8 << 24; + *pSecondaryDNS = (ip4 | ip3 | ip2 | ip1); + } + + return eGOBI_ERR_NONE; +} diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMIVoice.cpp b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMIVoice.cpp new file mode 100755 index 0000000..99120ae --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/GobiQMIVoice.cpp @@ -0,0 +1,205 @@ +/*=========================================================================== +FILE: + GobiQMICoreVoice.cpp + +DESCRIPTION: + QUALCOMM Gobi QMI Based API Core (Voice Service) + +PUBLIC CLASSES AND FUNCTIONS: + cGobiQMICore + +Copyright (c) 2011, Code Aurora Forum. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Code Aurora Forum nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==========================================================================*/ + +//--------------------------------------------------------------------------- +// Include Files +//--------------------------------------------------------------------------- +#include "StdAfx.h" +#include "GobiQMICore.h" + +#include "QMIBuffers.h" + +//--------------------------------------------------------------------------- +// Pragmas (pack structs) +//--------------------------------------------------------------------------- +#pragma pack( push, 1 ) + +/*=========================================================================*/ +// Struct sUSSDInfo +// Struct to represent USSD/Alpha information header +/*=========================================================================*/ +struct sUSSDInfoHdr +{ + public: + BYTE mDCS; + BYTE mLength; + + // Data of 'mLength' follows +}; + +//--------------------------------------------------------------------------- +// Pragmas +//--------------------------------------------------------------------------- +#pragma pack( pop ) + +/*=========================================================================*/ +// cGobiQMICore Methods +/*=========================================================================*/ + +/*=========================================================================== +METHOD: + OriginateUSSD (Public Method) + +DESCRIPTION: + This function initiates a USSD operation + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::OriginateUSSD( BYTE * pInfo ) +{ + // Validate arguments + if (pInfo == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + const ULONG INFO_HDR_SZ = (ULONG)sizeof( sUSSDInfoHdr ); + + sUSSDInfoHdr * pInInfo = (sUSSDInfoHdr *)pInfo; + ULONG infoLen = pInInfo->mLength + INFO_HDR_SZ; + + WORD msgID = (WORD)eQMI_VOICE_ASYNC_ORIG_USSD; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_VOICE_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (const BYTE *)pInfo, infoLen ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + return SendAndCheckReturn( eQMI_SVC_VOICE, pRequest, 300000 ); +} + +/*=========================================================================== +METHOD: + AnswerUSSD (Public Method) + +DESCRIPTION: + This function responds to a USSD request from the network + +PARAMETERS: + pInfo [ I ] - USSD information + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::AnswerUSSD( BYTE * pInfo ) +{ + // Validate arguments + if (pInfo == 0) + { + return eGOBI_ERR_INVALID_ARG; + } + + const ULONG INFO_HDR_SZ = (ULONG)sizeof( sUSSDInfoHdr ); + + sUSSDInfoHdr * pInInfo = (sUSSDInfoHdr *)pInfo; + ULONG infoLen = pInInfo->mLength + INFO_HDR_SZ; + + WORD msgID = (WORD)eQMI_VOICE_ANSWER_USSD; + std::vector piv; + + sProtocolEntityKey pek( eDB2_ET_QMI_VOICE_REQ, msgID, 1 ); + sDB2PackingInput pi( pek, (const BYTE *)pInfo, infoLen ); + piv.push_back( pi ); + + // Pack up the QMI request + const cCoreDatabase & db = GetDatabase(); + sSharedBuffer * pRequest = DB2PackQMIBuffer( db, piv ); + if (pRequest == 0) + { + return eGOBI_ERR_MEMORY; + } + + // Send the QMI request, check result, and return + return SendAndCheckReturn( eQMI_SVC_VOICE, pRequest, 300000 ); +} + +/*=========================================================================== +METHOD: + CancelUSSD (Public Method) + +DESCRIPTION: + This function cancels an in-progress USSD operation + +RETURN VALUE: + eGobiError - Return code +===========================================================================*/ +eGobiError cGobiQMICore::CancelUSSD() +{ + // Generate and send the QMI request + WORD msgID = (WORD)eQMI_VOICE_CANCEL_USSD; + sProtocolBuffer rsp = SendSimple( eQMI_SVC_VOICE, msgID, 30000 ); + if (rsp.IsValid() == false) + { + return GetCorrectedLastError(); + } + + // Did we receive a valid QMI response? + sQMIServiceBuffer qmiRsp( rsp.GetSharedBuffer() ); + if (qmiRsp.IsValid() == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + + // Check the mandatory QMI result TLV for success + ULONG rc = 0; + ULONG ec = 0; + bool bResult = qmiRsp.GetResult( rc, ec ); + if (bResult == false) + { + return eGOBI_ERR_MALFORMED_RSP; + } + else if (rc != 0) + { + return GetCorrectedQMIError( ec ); + } + + return eGOBI_ERR_NONE; +} + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/Shared/Makefile.am b/gobi-api/fixed-GobiAPI-1.0.40/Shared/Makefile.am new file mode 100644 index 0000000..dfa9640 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/Shared/Makefile.am @@ -0,0 +1,41 @@ +noinst_LTLIBRARIES = libShared.la + +INCLUDES = \ + -I$(top_srcdir)/Core + +libShared_la_CPPFLAGS = \ + -D WDS_SUPPORT \ + -D DMS_SUPPORT \ + -D NAS_SUPPORT \ + -D PDS_SUPPORT \ + -D CAT_SUPPORT \ + -D RMS_SUPPORT \ + -D OMA_SUPPORT \ + -D UIM_SUPPORT \ + -D WMS_SUPPORT \ + -D IMG2K_SUPPORT \ + -D IMG_SUPPORT \ + -D VOICE_SUPPORT + +libShared_la_SOURCES = \ + GobiError.h \ + GobiImageDefinitions.h \ + GobiMBNMgmt.cpp \ + GobiMBNMgmt.h \ + GobiQDLCore.cpp \ + GobiQDLCore.h \ + GobiQMICoreCAT.cpp \ + GobiQMICore.cpp \ + GobiQMICoreDMS.cpp \ + GobiQMICore.h \ + GobiQMICoreImg2k.cpp \ + GobiQMICoreImg.cpp \ + GobiQMICoreNAS.cpp \ + GobiQMICoreOMA.cpp \ + GobiQMICorePDS.cpp \ + GobiQMICoreRMS.cpp \ + GobiQMICoreSMS.cpp \ + GobiQMICoreUIM.cpp \ + GobiQMICoreWDS.cpp \ + GobiQMIVoice.cpp + diff --git a/gobi-api/fixed-GobiAPI-1.0.40/autogen.sh b/gobi-api/fixed-GobiAPI-1.0.40/autogen.sh new file mode 100755 index 0000000..4fa6c5d --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/autogen.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. +# NOTE +# This autogen.sh is only used when building libqcdm separately from ModemManager + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. +REQUIRED_AUTOMAKE_VERSION=1.7 +PKG_NAME=GobiAPI + +(test -f $srcdir/configure.ac \ + && test -f $srcdir/Core/QDLEnum.h) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +} + +(cd $srcdir; + mkdir m4 + autoreconf --install --symlink && + autoreconf && + ./configure --enable-maintainer-mode $@ +) diff --git a/gobi-api/fixed-GobiAPI-1.0.40/configure.ac b/gobi-api/fixed-GobiAPI-1.0.40/configure.ac new file mode 100644 index 0000000..7f772f4 --- /dev/null +++ b/gobi-api/fixed-GobiAPI-1.0.40/configure.ac @@ -0,0 +1,30 @@ +AC_PREREQ(2.52) + +AC_INIT(GobiAPI, 1.0.40, foo@it.com, GobiAPI) +AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +AM_MAINTAINER_MODE + +AC_CONFIG_MACRO_DIR([m4]) + +AC_CONFIG_HEADERS(config.h) + +dnl Required programs +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_CXX +AC_PROG_INSTALL +LT_INIT + +AC_CONFIG_FILES([ +Makefile +Core/Makefile +Database/Makefile +Database/QMI/Makefile +Shared/Makefile +GobiConnectionMgmt/Makefile +GobiImageMgmt/Makefile +GobiQDLService/Makefile +]) +AC_OUTPUT + -- cgit v1.1