https://github.com/yageek/navilink
Basic Navilink GPS paydata library
https://github.com/yageek/navilink
c navilink serialport
Last synced: 9 months ago
JSON representation
Basic Navilink GPS paydata library
- Host: GitHub
- URL: https://github.com/yageek/navilink
- Owner: yageek
- License: gpl-3.0
- Created: 2010-11-24T18:56:40.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2019-03-03T20:58:25.000Z (over 7 years ago)
- Last Synced: 2025-01-26T02:33:09.575Z (over 1 year ago)
- Topics: c, navilink, serialport
- Language: C
- Homepage:
- Size: 1.2 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Navilink
A simple C library for the [Navilink protocol](http://notes.splitbrain.org/navilink). This can be used to communicate
with some Locosys GPS device.
# Installation
You will require the following to build the library:
- CMake (>= 3.2)
- [libserialport](https://sigrok.org/wiki/Libserialport) (0.1.1)
To build the library:
```shell
git clone git@github.com:yageek/navilink.git
cd navilink
mkdir build && cd build
cmake ..
make
make install
```
# Usage
Some simple example:
```c
#include
#include
#include
int main(int argc, char** argv)
{
NavilinkDevice device;
int result = navilink_open_device_from_name("/dev/tty.usbserial", &device);
if (result < 0) {
perror("Can not open the serial port");
exit(-1);
}
NavilinkInformation infos;
result = navilink_query_information(&device, &infos);
if (result < 0) {
perror("Can not query the device informations");
}
else {
printf("Device username: %s \n", infos.username);
printf("Device serial: %i \n", infos.deviceSerialNum);
printf("Device protocol version: %i \n", infos.protocolVersion);
printf("Device number of trackspoints: %i \n", infos.numOfTrackpoints);
}
navilink_close_device(&device);
return 0;
}
```