CommunicationManager Class Reference
#include <CommunicationManager.h>
# Public Member Functions | |
void | reset () |
Reset the manager's state. | |
void | enableCommunications (ListenerObject scope) |
void | disableCommunications () |
Disable communication on the EXT port. | |
bool | cancelCommunications () |
Cancel all pending transmissions on the EXT port. | |
void | startSyncCycle () |
bool | isConnected () |
bool | isMaster () |
bool | broadcastData (BYTE *data, int32 numberOfBytes) |
void | broadcastDataAsync (BYTE *data, int32 numberOfBytes, ListenerObject scope) |
bool | sendAndReceiveData (WORD message, BYTE *data, int32 numberOfBytes) |
bool | sendAndReceiveDataAsync (WORD message, BYTE *data, int32 numberOfBytes, ListenerObject scope) |
WORD | getSentMessage () |
Retrieve the last sent message on the EXT port. | |
WORD | getReceivedMessage () |
Retrieve the last received message on the EXT port. | |
const BYTE * | getSentData () |
Retrieve the last sent data on the EXT port. | |
const BYTE * | getReceivedData () |
Retrieve the last received data on the EXT port. | |
void | print (int32 x, int32 y) |
override bool | handleMessage (Telegram telegram) |
# Static Public Member Functions | |
static void | interruptHandler () |
Interrupt handler for COM interrupts. |
# Protected Attributes | |
volatile int32 | status |
Status of the communications. | |
volatile BYTE * | sentData |
Data sent over the EXT port. | |
volatile BYTE * | receivedData |
Data received over the EXT port. | |
volatile BYTE * | syncSentByte |
Last byte sent synchronously over the EXT port. | |
volatile BYTE * | syncReceivedByte |
Last byte received synchronously over the EXT port. | |
volatile BYTE * | asyncSentByte |
Last byte sent asynchronously over the EXT port. | |
volatile BYTE * | asyncReceivedByte |
Last byte received asynchronously over the EXT port. | |
volatile int32 | numberOfBytesPendingTransmission |
Number of bytes pending transmission over the EXT port. | |
int32 | numberOfBytesPreviouslySent |
Number of bytes already transmitted over the EXT port. | |
volatile uint32 | broadcast |
Status of broadcast communications. | |
volatile bool | connected |
Flag that indicates if there is something connected to the EXT port. | |
volatile uint8 | communicationMode |
Keeps track of the role as master or slave that the system holds in data transmissions. |
# Additional Inherited Members | |
Private Member Functions inherited from ListenerObject | |
void | constructor () |
Class' constructor. | |
void | destructor () |
Class' destructor. | |
void | addEventListener (ListenerObject listener, uint16 eventCode) |
void | removeEventListener (ListenerObject listener, uint16 eventCode) |
void | removeEventListeners (uint16 eventCode) |
void | removeAllEventListeners () |
Remove all listener objects. | |
bool | hasActiveEventListeners () |
void | fireEvent (uint16 eventCode) |
void | sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay) |
void | sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay) |
void | discardAllMessages () |
Discard all messages, both to be sent and to be received. | |
void | discardMessages (uint32 message) |
virtual bool | onEvent (ListenerObject eventFirer, uint16 eventCode) |
Private Attributes inherited from ListenerObject | |
VirtualList | events |
List of registered events. | |
int8 | eventFirings |
Counter that keeps track of the number of fired events to prevent race conditions in nested firings. |
# Detailed Description
Class CommunicationManager
Inherits from ListenerObject
Manages communications on the EXT port.
Definition at line 34 of file CommunicationManager.h.
# Member Function Documentation
# broadcastData()
Send data synchronously over the EXT port if there is nothing detectable attached to it.
- Parameters
-
data Data to broadcast numberOfBytes Number of bytes to broadcast
Definition at line 315 of file CommunicationManager.c.
# broadcastDataAsync()
secure void CommunicationManager::broadcastDataAsync | ( | BYTE * | data, |
int32 | numberOfBytes, | ||
ListenerObject | scope ) |
Send data asynchronously over the EXT port if there is nothing detectable attached to it.
- Parameters
-
data Data to broadcast numberOfBytes Number of bytes to broadcast scope Object that will be notified of communication events
Definition at line 360 of file CommunicationManager.c.
# cancelCommunications()
bool CommunicationManager::cancelCommunications | ( | ) |
Cancel all pending transmissions on the EXT port.
Definition at line 228 of file CommunicationManager.c.
# disableCommunications()
void CommunicationManager::disableCommunications | ( | ) |
Disable communication on the EXT port.
Definition at line 217 of file CommunicationManager.c.
# enableCommunications()
void CommunicationManager::enableCommunications | ( | ListenerObject | scope | ) |
Enable communications on the EXT port.
- Parameters
-
scope Object that will be notified of communication events
Definition at line 180 of file CommunicationManager.c.
# getReceivedData()
const BYTE * CommunicationManager::getReceivedData | ( | ) |
Retrieve the last received data on the EXT port.
Definition at line 429 of file CommunicationManager.c.
# getReceivedMessage()
WORD CommunicationManager::getReceivedMessage | ( | ) |
Retrieve the last received message on the EXT port.
Definition at line 415 of file CommunicationManager.c.
# getSentData()
const BYTE * CommunicationManager::getSentData | ( | ) |
Retrieve the last sent data on the EXT port.
Definition at line 422 of file CommunicationManager.c.
# getSentMessage()
WORD CommunicationManager::getSentMessage | ( | ) |
Retrieve the last sent message on the EXT port.
Definition at line 408 of file CommunicationManager.c.
# handleMessage()
Receive and process a Telegram.
- Parameters
-
telegram Received telegram to process
- Returns
- True if the telegram was processed
Reimplemented from ListenerObject.
Definition at line 122 of file CommunicationManager.c.
# interruptHandler()
|
static |
Interrupt handler for COM interrupts.
Definition at line 92 of file CommunicationManager.c.
# isConnected()
bool CommunicationManager::isConnected | ( | ) |
Check if there is something attached to the EXT port.
- Returns
- True if there is something attached to the EXT port; false otherwise
Definition at line 301 of file CommunicationManager.c.
# isMaster()
bool CommunicationManager::isMaster | ( | ) |
Check if the system is the master during the next cycle of communications over the EXT port.
- Returns
- True if the system is the master; false otherwise
Definition at line 308 of file CommunicationManager.c.
# print()
Print the manager's status.
- Parameters
-
x Screen x coordinate where to print y Screen y coordinate where to print
Definition at line 437 of file CommunicationManager.c.
# reset()
void CommunicationManager::reset | ( | ) |
Reset the manager's state.
Definition at line 146 of file CommunicationManager.c.
# sendAndReceiveData()
Send and receive data synchronously over the EXT port if there is something detectable attached to it.
- Parameters
-
message Control message for the receiving partner data Data to broadcast numberOfBytes Number of bytes to broadcast
Definition at line 391 of file CommunicationManager.c.
# sendAndReceiveDataAsync()
bool CommunicationManager::sendAndReceiveDataAsync | ( | WORD | message, |
BYTE * | data, | ||
int32 | numberOfBytes, | ||
ListenerObject | scope ) |
Send and receive data asynchronously over the EXT port if there is something detectable attached to it.
- Parameters
-
message Control message for the receiving partner data Data to broadcast numberOfBytes Number of bytes to broadcast scope Object that will be notified of communication events
Definition at line 398 of file CommunicationManager.c.
# startSyncCycle()
void CommunicationManager::startSyncCycle | ( | ) |
Start the sync procedure according to the official documentation once a connection has been stablished.
Definition at line 260 of file CommunicationManager.c.
# Member Data Documentation
# asyncReceivedByte
|
protected |
Last byte received asynchronously over the EXT port.
Definition at line 57 of file CommunicationManager.h.
# asyncSentByte
|
protected |
Last byte sent asynchronously over the EXT port.
Definition at line 54 of file CommunicationManager.h.
# broadcast
|
protected |
Status of broadcast communications.
Definition at line 66 of file CommunicationManager.h.
# communicationMode
|
protected |
Keeps track of the role as master or slave that the system holds in data transmissions.
Definition at line 72 of file CommunicationManager.h.
# connected
|
protected |
Flag that indicates if there is something connected to the EXT port.
Definition at line 69 of file CommunicationManager.h.
# numberOfBytesPendingTransmission
|
protected |
Number of bytes pending transmission over the EXT port.
Definition at line 60 of file CommunicationManager.h.
# numberOfBytesPreviouslySent
|
protected |
Number of bytes already transmitted over the EXT port.
Definition at line 63 of file CommunicationManager.h.
# receivedData
|
protected |
Data received over the EXT port.
Definition at line 45 of file CommunicationManager.h.
# sentData
|
protected |
Data sent over the EXT port.
Definition at line 42 of file CommunicationManager.h.
# status
|
protected |
Status of the communications.
Definition at line 39 of file CommunicationManager.h.
# syncReceivedByte
|
protected |
Last byte received synchronously over the EXT port.
Definition at line 51 of file CommunicationManager.h.
# syncSentByte
|
protected |
Last byte sent synchronously over the EXT port.
Definition at line 48 of file CommunicationManager.h.
The documentation for this class was generated from the following files:
- VUEngine-Core/source/Hardware/CommunicationManager.h
- VUEngine-Core/source/Hardware/CommunicationManager.c