diff --git a/bfs/implementations/breadcrumbs/gen/AHRSInputIOProcessor.cpp b/bfs/implementations/breadcrumbs/gen/AHRSInputIOProcessor.cpp new file mode 100644 index 0000000..fb8a3f3 --- /dev/null +++ b/bfs/implementations/breadcrumbs/gen/AHRSInputIOProcessor.cpp @@ -0,0 +1,23 @@ + +#include + +#include "DataSyncThread.hpp" +#include "AHRSInputIOProcessor.hpp" + + +int main() +{ + IOProcessor* client = new AHRSInputIOProcessor; + + if (!client->init()) + { + while (client->loopCondition()) + client->loop(); + + int result = client->close(); + delete client; + return result; + } + + return 0; +} diff --git a/bfs/implementations/breadcrumbs/include/AHRSInputIOProcessor.hpp b/bfs/implementations/breadcrumbs/include/AHRSInputIOProcessor.hpp index 5e9eb3d..f3227cf 100644 --- a/bfs/implementations/breadcrumbs/include/AHRSInputIOProcessor.hpp +++ b/bfs/implementations/breadcrumbs/include/AHRSInputIOProcessor.hpp @@ -1,5 +1,5 @@ -#ifndef AHRS_OUTPUT_IO_PROCESSOR_HPP -#define AHRS_OUTPUT_IO_PROCESSOR_HPP +#ifndef AHRS_INPUT_IO_PROCESSOR_HPP +#define AHRS_INPUT_IO_PROCESSOR_HPP #include "IOProcessor.hpp" #include "DataSyncThread.hpp" @@ -7,7 +7,7 @@ #include #include -class AHRSOutputIOProcessor : public IOProcessor +class AHRSInputIOProcessor : public IOProcessor { public: using IOProcessor::IOProcessor; diff --git a/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp b/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp index 24c4026..0f3ddd2 100644 --- a/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp +++ b/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp @@ -1,7 +1,7 @@ -#include "AHRSOutputIOProcessor.hpp" +#include "AHRSInputIOProcessor.hpp" -int AHRSOutputIOProcessor::configAHRS() +int AHRSInputIOProcessor::configAHRS() { DCB dcb = {0}; //HANDLE hSerial; @@ -92,12 +92,12 @@ int AHRSOutputIOProcessor::configAHRS() return 0; } -bool AHRSOutputIOProcessor::loopCondition() +bool AHRSInputIOProcessor::loopCondition() { return iterations > 0; } -void AHRSOutputIOProcessor::loop() +void AHRSInputIOProcessor::loop() { if (!configured) configAHRS(); @@ -108,7 +108,7 @@ void AHRSOutputIOProcessor::loop() if (!ReadFile(hSerial, szBuff, 64, &dwBytesRead, NULL)) { std::cout << "Error occured while trying to read bytes." << std::endl; - return 9; + //return 9; } int index = -1; @@ -142,7 +142,7 @@ void AHRSOutputIOProcessor::loop() //std::cout << "Yaw: " << doubleYaw << std::endl; Attribute attrib("yawAngle", 8, &doubleYaw); - getComs()->sendAttribute(attriv); + getComms()->sendAttribute(attrib); iterations--; if (iterations == 0)