Module Connector - UNIX 1.4.2

SW used to communicate with all XeThru modules on a host computer

  1. Christian Rødli Amble
    ModuleConnector
    XeThru Module Connector is the SW used to communicate with all XeThru modules on a host computer over a serial communication channel. XeThru Module Connector is implemented and distributed as a Shared Object / Dynamic Link Library (DLL) and can be linked in runtime and accessed through an API from a number of different host environments including Matlab, Python and C++. This document contains all information required to configure XeThru Module Connector for the different host environments.

    Supported platforms
    • Windows 10
    • Windows 7
    • OSX
    • Ubuntu 16.04
    • Raspbian Jessie (python interface supported and tested)
    ModuleConnector might work with other platforms and versions, but it has not been tested.

    ModuleConnector functional description
    ModuleConnector use a serial protocol, queues and some threading to implement a convenient way to establish communication with supported XeTrhu modules. The ModuleConnector supports both synchronous and asynchronous messages. Ping is and example of a synchronous message. When ping is called it does not return before it either receives a response (pong) or it times out.

    Asynchronous messages are sent from the XeThru module not directly based on commands from the host, but rather based on events in the XeThru module itself. For example various radar frames are sent from the module to the host whenever the frames arrive from the radar chip. One must subscribe to the data to capture them. The code below shows an example of how to subscribe to amplitude phase data. The subscription must be given a name. All the amplitude phase baseband packets will then be collected in buffers or queues. It is possible to get the length of the queue and fetch packets from the queue.

    Code:
    #include "ModuleConnector.hpp"
    #include <iostream>
    
    int main()
    {
    const unsigned int log_level = 5;
    ModuleConnector mc("/dev/ttyACM0", log_level);
    
    X2M200 & x2m200 = mc.get_x2m200();
    
    const std::string subscription_name = "baseband_subscription";
    x2m200.subscribe_to_baseband_ap(subscription_name); //subscribe to amplitude/phase baseband
    x2m200.load_sleep_profile(); // load a profile
    x2m200.enable_baseband_ap(); // turn on baseband output
    x2m200.set_sensor_mode_run(); // start
    
    ::sleep(1); // wait for some packets
    
    x2m200.set_sensor_mode_idle(); //stop
    if (x2m200.get_number_of_packets(subscription_name) > 0) {
    baseband_data = x2m200.get_baseband_ap_data(subscription_name) // get first packet
    std::cout << "frame counter: " << baseband_data.frame_counter << std::endl;
    }
    
    return 0;
    }

Recent Reviews

  1. Davide Bongiovanni
    Davide Bongiovanni
    3/5,
    Version: 1.1.5
    It appears that it's impossible to compile on Ubuntu 14.04 because of a glibc6 version compatibility issue