Overview of libMga in ubxlib
masterThe libMga directory contains a modified version of the libMga C library (v22.07). This library is designed to assist u-blox GNSS customers with the integration of AssistNow, primarily on Linux and Windows systems.
In the ubxlib repository, this library has been modified to be wrapped by u_gnss_mga.c and to ensure compatibility with the ubxlib ecosystem. Key modifications include:
- Fixed-point arithmetic: Replaced
doublewithinttypes (using powers of ten) to avoid dependencies on floating-point libraries. - Memory Management:
malloc()andfree()have been replaced withpUPortMalloc()anduPortFree(). - Time and Synchronization:
time()is replaced byuPortGetTickTimeMs(), andtimezoneis replaced byuPortGetTimezoneOffsetSeconds()(compatible with both Linux and Windows). - Concurrency:
lock()andunlock()now use theuPortMutexXxx()API instead of native WIN32/Posix. - Error Handling:
assert()has been replaced withU_ASSERT(). - Structure Updates:
mgaBuildOnlineRequestParams()andmgaBuildOfflineRequestParams()now supportNULLbuffers and perform length checking.MgaOnlineServerConfighas additional fields, andMgaMsgInfohas been re-ordered for efficient structure packing. - Configuration:
MgaFlowConfigurationis modified to indicate whenUBX-CFG-VALmessages should be used instead ofUBX-CFG-NAVX5.
To identify specific changes within the source code, search for the string MODIFIED.