Created
September 11, 2013 14:41
-
-
Save liamja/6524604 to your computer and use it in GitHub Desktop.
Basic driver interface for VX VIO ports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Programmer: ExclamationDan Sept/1/2013 | |
// Purpose : To create a basic driver interface for VX VIO ports | |
// Yes, I use Visual Studio. | |
#pragma once | |
#include "VX_BIT_DEF.hpp" | |
#include "VX_BIT_STREAM.hpp" | |
#include "VX_MODULE_BASE.hpp" | |
#include "VX_EVENT.hpp" | |
namespace VX_DRIVER_31 | |
{ | |
enum VX_ACCESS_MODE { VX_TRANSMIT = 0, VX_RECIEVE, VX_TRANSCEIVER }; | |
enum VX_RW_MODE{ VX_BINARY = 0, VX_ASCII, VX_UTF8 }; | |
class VX_DriverInstance : public VX_ModuleBase | |
{ | |
public: | |
VX_Error_State m_ErrorState; | |
VX_EventFilter m_EventFilter; | |
VX_ACCESS_MODE m_Access_Mode; | |
float m_LastTimeout; | |
bool m_IsAttached; | |
VX_Driver_Manager* m_Subscription; | |
VX_DriverInstance(); | |
VX_DriverInstance(VX_ACCESS_MODE AccessMode = VX_TRANSMIT, VX_EventFilter EvFilter = FILTER_MODE_NONE, bool SubscribeImmediately = false); | |
// Special instance information accompanies LogData string. (Inherited from VX_ModuleBase) | |
virtual void Log(char* LogData, bool Write_To_File = true); | |
//Returns false if the write stream was in use by another process. Multithreading is possible in upcomming versions. | |
bool WriteStream(VX_Event VEvent = VX_Event::VEvent_GENERAL,VX_RW_MODE WriteMode = VX_BINARY, VX_Bit_Stream* VData = NULL); | |
VX_Bit_Stream ReadStream(VX_EventFilter Filter = FILTER_MODE_NONE, VX_RW_MODE ReadMode = VX_BINARY); | |
// Used to handle any events sent from the singleton, VX_Driver_Manager. (Inherited from VX_ModuleBase) | |
virtual void Poll(void); | |
// If NULL, Use this instance. | |
bool AttachToListener(VX_DriverInstance* DInst = NULL); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment