This README file is best viewed online.
- 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.
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!
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.
- Connect
- Append Status
- Append Timestamp
- Clock Frequency
- Ignore Timeout
- Memory Cap
- Purge
- Read
- Registers
- RX Multiple
- Track Interrupts
- TX Modifiers
- Write
The process for using the library will differ slightly depending on the version of Visual Studio.
- Configuration Properties -> C/C++ -> General -> Additional Include Directories: (folder containing fscc.hpp)
- Configuration Properties -> Linker -> General -> Additional Library Directories: (folder containing cppfscc{d}.lib)
- Configuration Properties -> Linker -> Input -> Additional Dependencies: cppfscc{d}.lib
- Configuration Properties -> Debugging -> Environment: PATH=%PATH%;(folder containing cppfscc{d}.dll)
- C++ compiler (G++ & Visual Studio tested)
- cfscc (Included)
- OS: Windows XP+ & Linux
We follow Semantic Versioning when creating releases.
Copyright (C) 2019 Commtech, Inc.
Licensed under the MIT license.