Code Monkey home page Code Monkey logo

cracl's Introduction

cracl

Common Receiver And Clock Library

A library to interface with various devices, including

  • u-blox receivers (e.g. F9P, M8T, M6T)
  • Jackson Labs oscillators (e.g. Firefly-1A - the OCXO used in USRP N2XX)
  • Microsemi clocks (e.g. sa45s CSAC, GPS300)

Feature development has been laregly as needed, though the non-UBX stuff is pretty simple and therefore mostly complete.

Sending of all UBX messages should be supported, though not fully tested. When sending a message that has an actual payload (i.e. not a basic poll message), simply pass the arguments in the call to ubx_send. They must be the correct data type per the UBX spec (e.g. 16 bit unsigned int), since under the hood ubx_send blindly bundles up anything you give it.

PUBX messages with the u-blox are similar, just pass whatever you want into the pubx_send function. NMEA messages are returned as strings for you to parse yourself.

We use Ubuntu 18.04 and 16.04, but it should theoretically be portable, you'll just need Boost ASIO.

sudo apt install libboost-all-dev

A Makefile is included which generates a shared library file to link against. After including the headers in your code, just link against the library.

The constructors for each device require the port at a minimum, but you can also set the baud rate, timeout, etc if needed.

Examples:

Communicating with u-blox LEA-M8T/NEO-M8T

Include relevant headers

#include <cracl/ublox/m8.hpp>

Create the connection

using namespace cracl;
m8 x("/dev/ttyACM1");

Send a UBX message

x.ubx_send("NAV", "STATUS");

Receive a response

auto m = x.fetch_ubx("NAV", "STATUS");

Parse the message and use contents

// Verify (confirms a non-empty message was received, and checksum is good)
if (ubx::nav::status::type(m))
{
  ubx::nav::status parsed = ubx::nav::status(m);

  std::cout << "Spoof Status: ";

  // Read spoofDetState attribute (names and values correspond to field names in
  //                               UBX protocol, except when field name is
  //                               capitalized)
  switch (parsed.spoofDetState())
  {
    case 0: std::cout << "UNKNOWN" << std::endl; break;
    case 1: std::cout << "OKAY" << std::endl; break;
    case 2: std::cout << "SPOOF INDICATORS" << std::endl; break;
    case 3: std::cout << "MULTIPLE SPOOF INDICATORS" << std::endl;
  }
}

Communicating with FireFly-1A GPSDO

Include relevant headers

#include <cracl/jackson_labs/firefly_1a.hpp>

Create the connection

using namespace cracl;
firefly_1a g("/dev/ttyUSB0");

Disable GPS disciplining

g.sync_hold_init();

Enable GPS disciplining

g.sync_hold_rec_init();

cracl's People

Contributors

oostern avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ignss

cracl's Issues

Raspberry Pi Zero W

Hello! I'm attempting to use this package on a Raspberry Pi Zero W running Raspbian Buster and am encountering an inheritance error in the file device.hpp on build.

Namely, the ~basic_serial_port() and ~io_service destructors are throwing errors about not having types prior to the '(' symbol. I've tried to explicitly include boost/asio in my libraries and am at a bit of a loss.

These errors occur whether I am trying to build the standalone cracl library or when including source and header files in my project.

Thank you for your library and for your time!
--mossti

Updating UBX messages

Calling update on UBX messages with repeated blocks does not remove old data - it just appends new message data for fields in the repeated section

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.