Polyphase Game Engine
Loading...
Searching...
No Matches
SerialManager Class Reference

#include <SerialManager.h>

Public Member Functions

void Initialize ()
 
void Shutdown ()
 
void PreTickUpdate (float deltaTime)
 
std::vector< SerialPortInfoEnumeratePorts ()
 
SerialHandle Connect (const char *portName, const SerialConfig &cfg)
 
void Disconnect (SerialHandle handle)
 
bool IsConnected (SerialHandle handle) const
 
int32_t SendMessage (SerialHandle handle, const uint8_t *data, uint32_t size)
 
int32_t SendMessage (SerialHandle handle, const std::string &data)
 
void StartReceive (SerialHandle handle)
 
void StopReceive (SerialHandle handle)
 
bool IsReceiving (SerialHandle handle) const
 
uint32_t RegisterMessageMatcher (SerialHandle handle, const std::string &pattern, SerialMessageMatcher::Type type, const ScriptFunc &callback)
 
void UnregisterMessageMatcher (SerialHandle handle, uint32_t matcherId)
 
void ClearMessageMatchers (SerialHandle handle)
 
void SetScriptMessageCallback (const ScriptFunc &func)
 
void SetScriptConnectCallback (const ScriptFunc &func)
 
void SetScriptDisconnectCallback (const ScriptFunc &func)
 
SerialHandle GetCurrentEventHandle () const
 
const std::string & GetCurrentEventPortName () const
 
const std::string & GetCurrentEventData () const
 

Static Public Member Functions

static void Create ()
 
static void Destroy ()
 
static SerialManagerGet ()
 

Member Function Documentation

◆ ClearMessageMatchers()

void SerialManager::ClearMessageMatchers ( SerialHandle  handle)

◆ Connect()

SerialHandle SerialManager::Connect ( const char *  portName,
const SerialConfig cfg 
)

◆ Create()

void SerialManager::Create ( )
static

◆ Destroy()

void SerialManager::Destroy ( )
static

◆ Disconnect()

void SerialManager::Disconnect ( SerialHandle  handle)

◆ EnumeratePorts()

std::vector< SerialPortInfo > SerialManager::EnumeratePorts ( )

◆ Get()

SerialManager * SerialManager::Get ( )
static

◆ GetCurrentEventData()

const std::string & SerialManager::GetCurrentEventData ( ) const
inline

◆ GetCurrentEventHandle()

SerialHandle SerialManager::GetCurrentEventHandle ( ) const
inline

◆ GetCurrentEventPortName()

const std::string & SerialManager::GetCurrentEventPortName ( ) const
inline

◆ Initialize()

void SerialManager::Initialize ( )

◆ IsConnected()

bool SerialManager::IsConnected ( SerialHandle  handle) const

◆ IsReceiving()

bool SerialManager::IsReceiving ( SerialHandle  handle) const

◆ PreTickUpdate()

void SerialManager::PreTickUpdate ( float  deltaTime)

◆ RegisterMessageMatcher()

uint32_t SerialManager::RegisterMessageMatcher ( SerialHandle  handle,
const std::string &  pattern,
SerialMessageMatcher::Type  type,
const ScriptFunc callback 
)

◆ SendMessage() [1/2]

int32_t SerialManager::SendMessage ( SerialHandle  handle,
const std::string &  data 
)

◆ SendMessage() [2/2]

int32_t SerialManager::SendMessage ( SerialHandle  handle,
const uint8_t *  data,
uint32_t  size 
)

◆ SetScriptConnectCallback()

void SerialManager::SetScriptConnectCallback ( const ScriptFunc func)
inline

◆ SetScriptDisconnectCallback()

void SerialManager::SetScriptDisconnectCallback ( const ScriptFunc func)
inline

◆ SetScriptMessageCallback()

void SerialManager::SetScriptMessageCallback ( const ScriptFunc func)
inline

◆ Shutdown()

void SerialManager::Shutdown ( )

◆ StartReceive()

void SerialManager::StartReceive ( SerialHandle  handle)

◆ StopReceive()

void SerialManager::StopReceive ( SerialHandle  handle)

◆ UnregisterMessageMatcher()

void SerialManager::UnregisterMessageMatcher ( SerialHandle  handle,
uint32_t  matcherId 
)

The documentation for this class was generated from the following files: