LIBGPSMM(3)

πŸ’… LIBGPSMM(3) β€” bestie, it's the GPSD Documentation section 3 page πŸ’–

okay so listen. this is libgpsmm and libQgpsm, and they're the C++ and QT class wrappers for the GPS daemon. cute little fancy jackets over the real thing. let's get into it ✨


🌸 NAME 🌸

libgpsmm, libQgpsm β€” C++ and QT class wrappers for the GPS daemon. that's it, that's the vibe πŸŽ€


✨ SYNOPSIS ✨

C++:

#include <libgpsmm>

struct gps_data_t * open(char * host char * port)

struct gps_data_t * open(void)

struct gps_data_t * send(char * request)

struct gps_data_t * read(void)

struct gps_data_t * waiting(int)

struct gps_data_t * stream unsigned(int flags)

like… yes bestie, that's genuinely all of it. six whole lines. we love a minimal era πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so libgpsmm and libQgpsmm are mere wrappers over libgps. they are not doing anything extra, they are not being special, they are simply the glow-up layer on top. periodt.

the important difference between the two libraries β€” and this is the part you need to actually remember β€” is that:

  • libgpsmm is targeted at C++ applications and is contained in libgps. it lives inside the main library, no extra package needed, she's built in πŸ’…
  • libQgpsmm is platform independent because it uses QTcpSocket to connect to gpsd, and it's shipped as an additional library due to the necessary linking to QT. so it costs you an extra dependency, but it'll run anywhere. tradeoffs, bestie 🫢

method names are the same as the analogue C functions. so if you already know the C API you already know this one, it's giving effortless ✨

for a detailed description of the functions please read libgps(3). seriously. go read it. this page is not the one with the lore πŸ“–

open() must be called after the class constructor and before any other method. yes, really. and here's why, because it's actually a good reason:

  • open() is not inside the constructor since it may fail 😭
  • however constructors have no return value, so there's no way to tell you it failed πŸ™ˆ

so they punted it out to you. you call it, you check it, you handle it. main character responsibility fr fr.

oh and the analogue of the C function gps_close() is in the destructor. so cleanup just… happens. no extra call. iconic 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

gpsd(8), gps(1), libgps(3)


πŸ“ RESOURCES πŸ“

Project web site: https://gpsd.io/


🧚 COPYING 🧚

This file is Copyright 2013 by the GPSD project

SPDX-License-Identifier: BSD-2-clause


πŸ’œ AUTHOR πŸ’œ

Alfredo Pironti


and that's the page bestie!! this was GPSD, Version 3.27.5, dated 2025-11-04, from the LIBGPSMM(3) corner of the world πŸ¦‹πŸ’– go forth and open() responsibly, and don't forget to check that return value, i'm literally begging you 😭✨