mirror of
https://github.com/preble/libpinproc
synced 2026-02-24 18:25:23 +01:00
Added CMake building and instructions to README.markdown.
Removed YAML loading code from libpinproc.
This commit is contained in:
18
CMakeLists.txt
Normal file
18
CMakeLists.txt
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
cmake_minimum_required(VERSION 2.6)
|
||||||
|
|
||||||
|
#set( CMAKE_OSX_ARCHITECTURES ppc;i386 ) #Comment out if not universal binary
|
||||||
|
|
||||||
|
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ../bin)
|
||||||
|
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ../bin)
|
||||||
|
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ../bin)
|
||||||
|
|
||||||
|
include_directories(/usr/local/include ./include)
|
||||||
|
|
||||||
|
link_directories(/usr/local/lib)
|
||||||
|
|
||||||
|
set(FILES src/pinproc.cpp src/PRDevice.cpp src/PRHardware.cpp)
|
||||||
|
add_library(pinproc ${FILES})
|
||||||
|
|
||||||
|
add_executable(pinproctest examples/pinproctest/pinproctest.cpp)
|
||||||
|
target_link_libraries(pinproctest pinproc usb ftdi)
|
||||||
|
|
||||||
11
Makefile
11
Makefile
@@ -3,22 +3,21 @@
|
|||||||
#
|
#
|
||||||
CC=g++
|
CC=g++
|
||||||
LIB=libpinproc.a
|
LIB=libpinproc.a
|
||||||
LIBDEST=./
|
LIBDEST=./bin/
|
||||||
|
|
||||||
LIBSRC=src/pinproc.cpp src/PRDevice.cpp src/PRHardware.cpp src/PRConfig.cpp
|
LIBSRC=src/pinproc.cpp src/PRDevice.cpp src/PRHardware.cpp
|
||||||
|
|
||||||
LIBOBJ=$(LIBSRC:.cpp=.o)
|
LIBOBJ=$(LIBSRC:.cpp=.o)
|
||||||
|
|
||||||
#CXXFLAGS=-I/usr/local/lib -lusb -lftdi
|
CXXFLAGS=
|
||||||
CXXFLAGS=-I../../yaml-cpp/include
|
|
||||||
|
|
||||||
$(LIB): $(LIBOBJ)
|
$(LIB): $(LIBOBJ)
|
||||||
@echo lib Makefile - archiving $(LIB)
|
@echo lib Makefile - archiving $(LIB)
|
||||||
$(AR) r $(LIB) $(LIBOBJ)
|
$(AR) r $(LIBDEST)$(LIB) $(LIBOBJ)
|
||||||
|
|
||||||
.cpp.o:
|
.cpp.o:
|
||||||
@echo lib Makefile - compiling $<
|
@echo lib Makefile - compiling $<
|
||||||
$(CC) $(CXXFLAGS) -c $< -o $@
|
$(CC) $(CXXFLAGS) -c $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(LIBOBJ) $(LIB)
|
rm -f $(LIBOBJ) $(LIBDEST)$(LIB)
|
||||||
|
|||||||
@@ -4,15 +4,29 @@ Library for Gerry Stellenberg's [P-ROC](http://pinballcontrollers.com/) (Pinball
|
|||||||
|
|
||||||
### Compiling
|
### Compiling
|
||||||
|
|
||||||
|
#### Prerequisites
|
||||||
|
|
||||||
libpinproc requires:
|
libpinproc requires:
|
||||||
|
|
||||||
- [libusb-0.1.12](http://libusb.wiki.sourceforge.net/): Install with the default /usr/local prefix.
|
- [libusb-0.1.12](http://libusb.wiki.sourceforge.net/): Install with the default /usr/local prefix.
|
||||||
- [libftdi-0.16](http://www.intra2net.com/en/developer/libftdi/): Install with the default /usr/local prefix.
|
- [libftdi-0.16](http://www.intra2net.com/en/developer/libftdi/): Install with the default /usr/local prefix.
|
||||||
|
|
||||||
|
Once required but not right now:
|
||||||
|
|
||||||
- [yaml-cpp](http://code.google.com/p/yaml-cpp/): Should be checked out in the directory two levels below libpinproc in the full source tree (at the same level as ./P-ROC) in a directory named yaml-cpp. Follow the build instructions, creating the build subdirectory. The Makefiles and other project files expect to find libyaml-cpp.a in the yaml-cpp/build/bin directory.
|
- [yaml-cpp](http://code.google.com/p/yaml-cpp/): Should be checked out in the directory two levels below libpinproc in the full source tree (at the same level as ./P-ROC) in a directory named yaml-cpp. Follow the build instructions, creating the build subdirectory. The Makefiles and other project files expect to find libyaml-cpp.a in the yaml-cpp/build/bin directory.
|
||||||
|
|
||||||
### License
|
We are presently experimenting with different build mechanisms. As such there are three ways to build libpinproc at this time: CMake, GNU Make, and the Xcode project (for Mac). As the preferred method is presently CMake, here's how. Before you get started, you will need CMake if you don't already have it.
|
||||||
|
|
||||||
#### The MIT License
|
#### Building with CMake
|
||||||
|
|
||||||
|
cd libpinproc
|
||||||
|
mkdir build; cd build
|
||||||
|
cmake ..
|
||||||
|
make
|
||||||
|
|
||||||
|
The CMakeLists.txt file is presently designed to be run from a directory inside the libpinproc directory. This will build both libpinproc and pinproctest. Binaries will be placed in the directory that make was run from.
|
||||||
|
|
||||||
|
### License
|
||||||
|
|
||||||
Copyright (c) 2009 Gerry Stellenberg, Adam Preble
|
Copyright (c) 2009 Gerry Stellenberg, Adam Preble
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
#
|
#
|
||||||
# File: Makefile for application
|
# File: Makefile for application
|
||||||
#
|
#
|
||||||
|
PINPROC_PATH=../..
|
||||||
|
|
||||||
CC=g++
|
CC=g++
|
||||||
LDFLAGS=-L../.. -L/usr/local/lib -L../../../../yaml-cpp/build/bin
|
LDFLAGS=-L$(PINPROC_PATH)/bin -L/usr/local/lib
|
||||||
LIBS=-lpinproc -lusb -lftdi -lyaml-cpp
|
LIBS=-lpinproc -lusb -lftdi
|
||||||
|
|
||||||
SRC=pinproctest.cpp
|
SRC=pinproctest.cpp
|
||||||
|
|
||||||
CXXFLAGS=-I../../include
|
CXXFLAGS=-I$(PINPROC_PATH)/include
|
||||||
|
|
||||||
OBJS=$(SRC:.cpp=.o)
|
OBJS=$(SRC:.cpp=.o)
|
||||||
|
|
||||||
@@ -16,7 +18,7 @@ EXE=pinproctest
|
|||||||
all: $(EXE)
|
all: $(EXE)
|
||||||
|
|
||||||
# FIXME: This makes the exe require libpinproc but not in a very graceful way.
|
# FIXME: This makes the exe require libpinproc but not in a very graceful way.
|
||||||
$(EXE): $(OBJS) ../../libpinproc.a
|
$(EXE): $(OBJS) $(PINPROC_PATH)/bin/libpinproc.a
|
||||||
@echo application Makefile - linking $<
|
@echo application Makefile - linking $<
|
||||||
$(CC) $^ $(LDFLAGS) $(LIBS) -o $@
|
$(CC) $^ $(LDFLAGS) $(LIBS) -o $@
|
||||||
|
|
||||||
|
|||||||
@@ -219,15 +219,15 @@ void ConfigureDMD(PRHandle proc)
|
|||||||
|
|
||||||
// Display a simple pattern to verify DMD functionality.
|
// Display a simple pattern to verify DMD functionality.
|
||||||
// 16 consecutive rows will turn on with incrementing brightness and rotate vertically
|
// 16 consecutive rows will turn on with incrementing brightness and rotate vertically
|
||||||
void UpdateDots( unsigned char * dots, unsigned int dotPointer )
|
void UpdateDots( unsigned char * dots, unsigned int dotOffset )
|
||||||
{
|
{
|
||||||
int i,j,k,color,mappedColor,loopCtr;
|
int i,j,k,color,mappedColor,loopCtr;
|
||||||
|
|
||||||
loopCtr = dotPointer/2;
|
loopCtr = dotOffset/2;
|
||||||
color = 0xf;
|
color = 0xf;
|
||||||
|
|
||||||
// Slow it down just a tad
|
// Slow it down just a tad
|
||||||
if (dotPointer%2 == 0)
|
if (dotOffset%2 == 0)
|
||||||
{
|
{
|
||||||
// Clear the DMD dots every time the rotation occurs
|
// Clear the DMD dots every time the rotation occurs
|
||||||
memset(dots,0,((128*32)/8)*4);
|
memset(dots,0,((128*32)/8)*4);
|
||||||
@@ -266,14 +266,14 @@ void RunLoop(PRHandle proc)
|
|||||||
// Create dot array using an array of bytes. Each byte holds 8 dots. Need
|
// Create dot array using an array of bytes. Each byte holds 8 dots. Need
|
||||||
// space for 4 sub-frames of 128/32 dots.
|
// space for 4 sub-frames of 128/32 dots.
|
||||||
unsigned char dots[4*((128*32)/8)];
|
unsigned char dots[4*((128*32)/8)];
|
||||||
unsigned int dotPointer = 0;
|
unsigned int dotOffset = 0;
|
||||||
|
|
||||||
while (runLoopRun)
|
while (runLoopRun)
|
||||||
{
|
{
|
||||||
PRDriverWatchdogTickle(proc);
|
PRDriverWatchdogTickle(proc);
|
||||||
|
|
||||||
// Create a dot pattern to test the DMD
|
// Create a dot pattern to test the DMD
|
||||||
UpdateDots(dots,dotPointer++);
|
UpdateDots(dots,dotOffset++);
|
||||||
PRDMDDraw(proc,dots);
|
PRDMDDraw(proc,dots);
|
||||||
|
|
||||||
int numEvents = PRGetEvents(proc, events, maxEvents);
|
int numEvents = PRGetEvents(proc, events, maxEvents);
|
||||||
|
|||||||
@@ -91,8 +91,6 @@ typedef enum PRMachineType {
|
|||||||
PR_EXPORT PRHandle PRCreate(PRMachineType machineType); /**< Create a new P-ROC device handle. Only one handle per device may be created. This handle must be destroyed with PRDelete() when it is no longer needed. Returns #kPRHandleInvalid if an error occurred. */
|
PR_EXPORT PRHandle PRCreate(PRMachineType machineType); /**< Create a new P-ROC device handle. Only one handle per device may be created. This handle must be destroyed with PRDelete() when it is no longer needed. Returns #kPRHandleInvalid if an error occurred. */
|
||||||
PR_EXPORT void PRDelete(PRHandle handle); /**< Destroys an existing P-ROC device handle. */
|
PR_EXPORT void PRDelete(PRHandle handle); /**< Destroys an existing P-ROC device handle. */
|
||||||
|
|
||||||
PR_EXPORT PRResult PRLoadDefaultsFromYAML(PRHandle handle, const char *yamlFilePath);
|
|
||||||
|
|
||||||
/** @} */ // End of Device Creation & Deletion
|
/** @} */ // End of Device Creation & Deletion
|
||||||
|
|
||||||
// Drivers
|
// Drivers
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
668249E30FC0A3960051560E /* pinproctest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 668249E20FC0A3960051560E /* pinproctest.cpp */; };
|
668249E30FC0A3960051560E /* pinproctest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 668249E20FC0A3960051560E /* pinproctest.cpp */; };
|
||||||
668249EA0FC0A4280051560E /* libpinproc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2AAC046055464E500DB518D /* libpinproc.a */; };
|
668249EA0FC0A4280051560E /* libpinproc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2AAC046055464E500DB518D /* libpinproc.a */; };
|
||||||
668249ED0FC0A4CD0051560E /* PRHardware.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 668249EC0FC0A4CD0051560E /* PRHardware.cpp */; };
|
668249ED0FC0A4CD0051560E /* PRHardware.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 668249EC0FC0A4CD0051560E /* PRHardware.cpp */; };
|
||||||
66824DAE0FC6FC690051560E /* PRConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66824DAD0FC6FC690051560E /* PRConfig.cpp */; };
|
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@@ -37,7 +36,6 @@
|
|||||||
668249D90FC0A30A0051560E /* pinproctest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = pinproctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
668249D90FC0A30A0051560E /* pinproctest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = pinproctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
668249E20FC0A3960051560E /* pinproctest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pinproctest.cpp; path = examples/pinproctest/pinproctest.cpp; sourceTree = "<group>"; };
|
668249E20FC0A3960051560E /* pinproctest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pinproctest.cpp; path = examples/pinproctest/pinproctest.cpp; sourceTree = "<group>"; };
|
||||||
668249EC0FC0A4CD0051560E /* PRHardware.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PRHardware.cpp; path = src/PRHardware.cpp; sourceTree = "<group>"; };
|
668249EC0FC0A4CD0051560E /* PRHardware.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PRHardware.cpp; path = src/PRHardware.cpp; sourceTree = "<group>"; };
|
||||||
66824DAD0FC6FC690051560E /* PRConfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PRConfig.cpp; path = src/PRConfig.cpp; sourceTree = "<group>"; };
|
|
||||||
D2AAC046055464E500DB518D /* libpinproc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libpinproc.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
D2AAC046055464E500DB518D /* libpinproc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libpinproc.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
@@ -95,7 +93,6 @@
|
|||||||
668249390FC07B2A0051560E /* pinproc.cpp */,
|
668249390FC07B2A0051560E /* pinproc.cpp */,
|
||||||
668249400FC07D900051560E /* PRDevice.h */,
|
668249400FC07D900051560E /* PRDevice.h */,
|
||||||
668249410FC07D900051560E /* PRDevice.cpp */,
|
668249410FC07D900051560E /* PRDevice.cpp */,
|
||||||
66824DAD0FC6FC690051560E /* PRConfig.cpp */,
|
|
||||||
6682494A0FC0870B0051560E /* PRHardware.h */,
|
6682494A0FC0870B0051560E /* PRHardware.h */,
|
||||||
668249EC0FC0A4CD0051560E /* PRHardware.cpp */,
|
668249EC0FC0A4CD0051560E /* PRHardware.cpp */,
|
||||||
);
|
);
|
||||||
@@ -201,7 +198,6 @@
|
|||||||
6682493A0FC07B2A0051560E /* pinproc.cpp in Sources */,
|
6682493A0FC07B2A0051560E /* pinproc.cpp in Sources */,
|
||||||
668249430FC07D900051560E /* PRDevice.cpp in Sources */,
|
668249430FC07D900051560E /* PRDevice.cpp in Sources */,
|
||||||
668249ED0FC0A4CD0051560E /* PRHardware.cpp in Sources */,
|
668249ED0FC0A4CD0051560E /* PRHardware.cpp in Sources */,
|
||||||
66824DAE0FC6FC690051560E /* PRConfig.cpp in Sources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -285,11 +281,7 @@
|
|||||||
GCC_MODEL_TUNING = G5;
|
GCC_MODEL_TUNING = G5;
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
INSTALL_PATH = /usr/local/bin;
|
INSTALL_PATH = /usr/local/bin;
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = "-lftdi";
|
||||||
"-L../../yaml-cpp/build/bin",
|
|
||||||
"-lyaml-cpp",
|
|
||||||
"-lftdi",
|
|
||||||
);
|
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
PRODUCT_NAME = pinproctest;
|
PRODUCT_NAME = pinproctest;
|
||||||
};
|
};
|
||||||
@@ -304,11 +296,7 @@
|
|||||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||||
GCC_MODEL_TUNING = G5;
|
GCC_MODEL_TUNING = G5;
|
||||||
INSTALL_PATH = /usr/local/bin;
|
INSTALL_PATH = /usr/local/bin;
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = "-lftdi";
|
||||||
"-L../../yaml-cpp/build/bin",
|
|
||||||
"-lyaml-cpp",
|
|
||||||
"-lftdi",
|
|
||||||
);
|
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
PRODUCT_NAME = pinproctest;
|
PRODUCT_NAME = pinproctest;
|
||||||
ZERO_LINK = NO;
|
ZERO_LINK = NO;
|
||||||
|
|||||||
108
src/PRConfig.cpp
108
src/PRConfig.cpp
@@ -1,108 +0,0 @@
|
|||||||
/*
|
|
||||||
* The MIT License
|
|
||||||
* Copyright (c) 2009 Gerry Stellenberg, Adam Preble
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person
|
|
||||||
* obtaining a copy of this software and associated documentation
|
|
||||||
* files (the "Software"), to deal in the Software without
|
|
||||||
* restriction, including without limitation the rights to use,
|
|
||||||
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the
|
|
||||||
* Software is furnished to do so, subject to the following
|
|
||||||
* conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be
|
|
||||||
* included in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
||||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
||||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* PRConfig.cpp
|
|
||||||
* libpinproc
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "PRDevice.h"
|
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include "yaml.h"
|
|
||||||
|
|
||||||
PRResult PRDevice::LoadDefaultsFromYAML(const char *yamlFilePath)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
std::ifstream fin(yamlFilePath);
|
|
||||||
if (fin.is_open() == false)
|
|
||||||
{
|
|
||||||
DEBUG(PRLog("YAML file not found: %s\n", yamlFilePath));
|
|
||||||
return kPRFailure;
|
|
||||||
}
|
|
||||||
YAML::Parser parser(fin);
|
|
||||||
|
|
||||||
while(parser) {
|
|
||||||
YAML::Node doc;
|
|
||||||
parser.GetNextDocument(doc);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const YAML::Node& node = doc["PRGameName"];
|
|
||||||
std::string name; node >> name;
|
|
||||||
DEBUG(PRLog(" Game Name: %s\n", name.c_str()));
|
|
||||||
}
|
|
||||||
catch (YAML::KeyNotFound& ex) {}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const YAML::Node& dict = doc["PRSwitches"];
|
|
||||||
for(YAML::Iterator dictIt = dict.begin(); dictIt != dict.end(); ++dictIt)
|
|
||||||
{
|
|
||||||
std::string key;
|
|
||||||
std::string name;
|
|
||||||
dictIt.first() >> key;
|
|
||||||
dictIt.second() >> name;
|
|
||||||
DEBUG(PRLog(" Switch: %s -> %s\n", key.c_str(), name.c_str()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (YAML::KeyNotFound& ex) {}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const YAML::Node& dict = doc["PRDrivers"];
|
|
||||||
for(YAML::Iterator dictIt = dict.begin(); dictIt != dict.end(); ++dictIt)
|
|
||||||
{
|
|
||||||
std::string key;
|
|
||||||
std::string name;
|
|
||||||
dictIt.first() >> key;
|
|
||||||
dictIt.second() >> name;
|
|
||||||
DEBUG(PRLog(" Driver: %s -> %s\n", key.c_str(), name.c_str()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (YAML::KeyNotFound& ex) {}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (YAML::ParserException& ex)
|
|
||||||
{
|
|
||||||
DEBUG(PRLog("YAML parse error at line=%d col=%d: %s\n", ex.line, ex.column, ex.msg.c_str()));
|
|
||||||
return kPRFailure;
|
|
||||||
}
|
|
||||||
catch (YAML::RepresentationException& ex)
|
|
||||||
{
|
|
||||||
DEBUG(PRLog("YAML representation error at line=%d col=%d: %s\n", ex.line, ex.column, ex.msg.c_str()));
|
|
||||||
return kPRFailure;
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
DEBUG(PRLog("Unexpected exception while parsing YAML config.\n"));
|
|
||||||
return kPRFailure;
|
|
||||||
}
|
|
||||||
return kPRSuccess;
|
|
||||||
}
|
|
||||||
@@ -56,7 +56,6 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// public libpinproc API:
|
// public libpinproc API:
|
||||||
PRResult LoadDefaultsFromYAML(const char *yamlFilePath);
|
|
||||||
int GetEvents(PREvent *events, int maxEvents);
|
int GetEvents(PREvent *events, int maxEvents);
|
||||||
|
|
||||||
PRResult DriverUpdateGlobalConfig(PRDriverGlobalConfig *driverGlobalConfig);
|
PRResult DriverUpdateGlobalConfig(PRDriverGlobalConfig *driverGlobalConfig);
|
||||||
|
|||||||
@@ -72,11 +72,6 @@ PR_EXPORT void PRDelete(PRHandle handle)
|
|||||||
delete (PRDevice*)handle;
|
delete (PRDevice*)handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
PR_EXPORT PRResult PRLoadDefaultsFromYAML(PRHandle handle, const char *yamlFilePath)
|
|
||||||
{
|
|
||||||
return handleAsDevice->LoadDefaultsFromYAML(yamlFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
|
|
||||||
/** Get all of the available events that have been received. */
|
/** Get all of the available events that have been received. */
|
||||||
|
|||||||
Reference in New Issue
Block a user