Skip to content

commtech/cppfscc

Repository files navigation

FSCC C++ Library (cppfscc)

This README file is best viewed online.

Installing Library

Downloading Library
  • You can use the pre-built library files that are included with the driver
  • Or, you can download the latest library version from Github releases.

Quick Start Guide

Lets get started with a quick programming example for fun.

This tutorial has already been set up for you at examples/tutorial.cpp.

First, drop cppfscc.dll, cppfscc.lib and cfscc.dll into a test directory. Now that those files are copied over, create a new C++ file (named tutorial.cpp) with the following code.

#include <iostream> /* cout, endl */
#include <cstdlib> /* EXIT_SUCCESS, EXIT_FAILURE */
#include <fscc.hpp> /* fscc_connect, fscc_disconnect, fscc_handle
                       fscc_write, fscc_read */

int main(void)
{
    Fscc::Port p(0);

    // Send "Hello world!" text
    p.Write("Hello world!");

    // Read the data back in (with our loopback connector)
    std::cout << p.Read() << std::endl;

    return EXIT_SUCCESS;
}

For this example I will use the Visual Studio command line compiler, but you can use your compiler of choice.

# cl /EHsc tutorial.cpp cppfscc.lib /I <CPPFSCC_DIR>\src

Now attach the included loopback connector.

# tutorial.exe
Hello world!

You have now transmitted and received an HDLC frame!

API Reference

There are likely other configuration options you will need to set up for your own program. All of these options are described on their respective documentation page.

Visual Studio Integration

The process for using the library will differ slightly depending on the version of Visual Studio.

  1. Configuration Properties -> C/C++ -> General -> Additional Include Directories: (folder containing fscc.hpp)
  2. Configuration Properties -> Linker -> General -> Additional Library Directories: (folder containing cppfscc{d}.lib)
  3. Configuration Properties -> Linker -> Input -> Additional Dependencies: cppfscc{d}.lib
  4. Configuration Properties -> Debugging -> Environment: PATH=%PATH%;(folder containing cppfscc{d}.dll)

Build Dependencies

  • C++ compiler (G++ & Visual Studio tested)
  • cfscc (Included)

Run-time Dependencies

  • OS: Windows XP+ & Linux

API Compatibility

We follow Semantic Versioning when creating releases.

License

Copyright (C) 2019 Commtech, Inc.

Licensed under the MIT license.