How lord-microstrain/mip_sdk works
Project type and purpose
• This is a cross‐platform SDK library (“MIP SDK”) for interacting with MicroStrain MIP devices.
• It provides both a minimal C API (suitable for bare‐metal) and a more convenient C++ API.
• It also bundles example applications, documentation, tests, and build infrastructure.
File structure
• Top-level directories:
• .devcontainer — Docker/dev‐container build definitions
• cmake — Custom CMake macros/modules
• docs — SDK documentation in Markdown + CSS
• examples — Sample applications using the SDK
• scripts — release automation
• src — Source code, split into C (src/c) and C++ (src/cpp)
• test — Unit and performance tests for C and C++ APIs
• Key sub-components in src:
• microstrain/common — basic utilities (logging, time, platform)
• connections — adapters for serial, TCP, recording
• mip — packet creation/parsing, command queue, descriptors, serialization
• extras/metadata — optional higher‐level utilities, metadata support (C++ only)
README for additional insights
• The README describes:
• Two API layers: C and a thin C++ wrapper
• Two transport layers: serial port and TCP client
• Build configuration driven by CMake options (enable/disable logging, C++ API, extras, serial, TCP, tests, examples, docs)
• Example use cases (getting device info, streaming IMU data, device‐specific demos)
1. User Application (examples, 3rd-party apps)
2. SDK API Layer
• C API (mip::C namespace)
• C++ API (mip::… classes)
3. Core SDK Modules
• Common utilities (logging, timestamping, error codes)
• Command Queue & Dispatch
• Packet Builder & Parser
• Serialization / Deserialization
• Descriptor Definitions (commands_xxx, data_xxx)
• Optional Metadata Module (C++20)
4. Transport Layer
• Serial Connection adapter
• TCP Connection adapter
• Recording Connection (for offline file parsing)
5. External Systems
• Physical MIP Device (via USB/Serial or TCP server)
• File system (for recorded playback, examples)
• User App → [calls] → C++ API → [forwards] → C API (if used) → Core Modules → Transport
• Core Modules → Descriptor Definitions → Serialization → Transport
• Transport → [receives raw bytes] → Parser → Core Modules → returns structured data back up to API → User App
c. Architectural patterns / principles:
• Layered architecture (API → core logic → transport)
• Adapter pattern for connection types (serial, TCP, recording)
• Facade pattern: C++ API facade over C API and core modules
• Metadata as optional plug-in to reduce codegen and drive compile‐time reflection
d. Relevant technologies / frameworks:
• CMake (build orchestration, FindMip.cmake)
• Docker/.devcontainer (development environments)
• Doxygen (optional doc generation)
• Native C11 and C++14/20
Essential detail checklist
• Major components and sub‐modules (common, connections, mip definitions, extras, metadata).
• Both C and C++ API layers and how they relate.
• Transport adapters and the external device/file playback.
• Build/configuration influences (CMake options, devcontainer).