JBus
JoyBus communication server
jbus::Endpoint Class Reference

#include <Endpoint.hpp>

Public Member Functions

void stop ()
 Request stop of I/O thread and block until joined. Further use of this Endpoint is undefined behavior. The destructor calls this implicitly. More...
 
EJoyReturn GBAGetProcessStatus (u8 &percentOut)
 Get status of last asynchronous operation. More...
 
EJoyReturn GBAGetStatusAsync (u8 *status, FGBACallback &&callback)
 Get JOYSTAT register from GBA asynchronously. More...
 
EJoyReturn GBAGetStatus (u8 *status)
 Get JOYSTAT register from GBA synchronously. More...
 
EJoyReturn GBAResetAsync (u8 *status, FGBACallback &&callback)
 Send RESET command to GBA asynchronously. More...
 
EJoyReturn GBAReset (u8 *status)
 Send RESET command to GBA synchronously. More...
 
EJoyReturn GBAReadAsync (u8 *dst, u8 *status, FGBACallback &&callback)
 Send READ command to GBA asynchronously. More...
 
EJoyReturn GBARead (u8 *dst, u8 *status)
 Send READ command to GBA synchronously. More...
 
EJoyReturn GBAWriteAsync (const u8 *src, u8 *status, FGBACallback &&callback)
 Send WRITE command to GBA asynchronously. More...
 
EJoyReturn GBAWrite (const u8 *src, u8 *status)
 Send WRITE command to GBA synchronously. More...
 
EJoyReturn GBAJoyBootAsync (s32 paletteColor, s32 paletteSpeed, const u8 *programp, s32 length, u8 *status, FGBACallback &&callback)
 Initiate JoyBoot sequence on this endpoint. More...
 
int GetChan () const
 Get virtual SI channel assigned to this endpoint. More...
 
 Endpoint (u8 chan, net::Socket &&data, net::Socket &&clock)
 
 ~Endpoint ()
 

Friends

class ThreadLocalEndpoint
 

Detailed Description

Main class for performing JoyBoot and subsequent JoyBus I/O operations. Instances should be obtained though the jbus::Listener::accept method.

Constructor & Destructor Documentation

jbus::Endpoint::Endpoint ( u8  chan,
net::Socket &&  data,
net::Socket &&  clock 
)

Here is the caller graph for this function:

jbus::Endpoint::~Endpoint ( )

Here is the caller graph for this function:

Member Function Documentation

EJoyReturn jbus::Endpoint::GBAGetProcessStatus ( u8 percentOut)

Get status of last asynchronous operation.

Parameters
percentOutReference to output transfer percent of GBAJoyBootAsync.
Returns
GBA_READY when idle, or GBA_BUSY when operation in progress.
EJoyReturn jbus::Endpoint::GBAGetStatus ( u8 status)

Get JOYSTAT register from GBA synchronously.

Parameters
statusDestination pointer for EJStatFlags.
Returns
GBA_READY if submitted, or GBA_NOT_READY if another operation in progress.
EJoyReturn jbus::Endpoint::GBAGetStatusAsync ( u8 status,
FGBACallback &&  callback 
)

Get JOYSTAT register from GBA asynchronously.

Parameters
statusDestination pointer for EJStatFlags.
callbackFunctor to execute when operation completes.
Returns
GBA_READY if submitted, or GBA_NOT_READY if another operation in progress.
EJoyReturn jbus::Endpoint::GBAJoyBootAsync ( s32  paletteColor,
s32  paletteSpeed,
const u8 programp,
s32  length,
u8 status,
FGBACallback &&  callback 
)

Initiate JoyBoot sequence on this endpoint.

Parameters
paletteColorPalette for displaying logo in ROM header [0,6].
paletteSpeedPalette interpolation speed for displaying logo in ROM header [-4,4].
programpPointer to program ROM data.
lengthLength of program ROM data.
statusDestination pointer for EJStatFlags.
callbackFunctor to execute when operation completes.
Returns
GBA_READY if submitted, or GBA_NOT_READY if another operation in progress.
EJoyReturn jbus::Endpoint::GBARead ( u8 dst,
u8 status 
)

Send READ command to GBA synchronously.

Parameters
dstDestination pointer for 4-byte packet of data.
statusDestination pointer for EJStatFlags.
Returns
GBA_READY if submitted, or GBA_NOT_READY if another operation in progress.
EJoyReturn jbus::Endpoint::GBAReadAsync ( u8 dst,
u8 status,
FGBACallback &&  callback 
)

Send READ command to GBA asynchronously.

Parameters
dstDestination pointer for 4-byte packet of data.
statusDestination pointer for EJStatFlags.
callbackFunctor to execute when operation completes.
Returns
GBA_READY if submitted, or GBA_NOT_READY if another operation in progress.
EJoyReturn jbus::Endpoint::GBAReset ( u8 status)

Send RESET command to GBA synchronously.

Parameters
statusDestination pointer for EJStatFlags.
Returns
GBA_READY if submitted, or GBA_NOT_READY if another operation in progress.
EJoyReturn jbus::Endpoint::GBAResetAsync ( u8 status,
FGBACallback &&  callback 
)

Send RESET command to GBA asynchronously.

Parameters
statusDestination pointer for EJStatFlags.
callbackFunctor to execute when operation completes.
Returns
GBA_READY if submitted, or GBA_NOT_READY if another operation in progress.
EJoyReturn jbus::Endpoint::GBAWrite ( const u8 src,
u8 status 
)

Send WRITE command to GBA synchronously.

Parameters
srcSource pointer for 4-byte packet of data. It is not required to keep resident.
statusDestination pointer for EJStatFlags.
Returns
GBA_READY if submitted, or GBA_NOT_READY if another operation in progress.
EJoyReturn jbus::Endpoint::GBAWriteAsync ( const u8 src,
u8 status,
FGBACallback &&  callback 
)

Send WRITE command to GBA asynchronously.

Parameters
srcSource pointer for 4-byte packet of data. It is not required to keep resident.
statusDestination pointer for EJStatFlags.
callbackFunctor to execute when operation completes.
Returns
GBA_READY if submitted, or GBA_NOT_READY if another operation in progress.
int jbus::Endpoint::GetChan ( ) const
inline

Get virtual SI channel assigned to this endpoint.

Returns
SI channel

Here is the call graph for this function:

Here is the caller graph for this function:

void jbus::Endpoint::stop ( )

Request stop of I/O thread and block until joined. Further use of this Endpoint is undefined behavior. The destructor calls this implicitly.

Friends And Related Function Documentation

friend class ThreadLocalEndpoint
friend

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