v1.1.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
Public Member Functions | Static Public Member Functions | List of all members
Sifteo::UsbPacket Struct Reference

A container for one Usb packet's data. More...

#include <sifteo/usb.h>

Public Member Functions

uint8_t * bytes ()
 Return a pointer to this packet's payload bytes.
 
void clear ()
 Set the packet's length and type to zero.
 
bool empty () const
 Is this packet's payload empty?
 
void resize (unsigned bytes)
 Change the size of this packet, in bytes.
 
void setType (unsigned type)
 Set a packet's 28-bit type.
 
unsigned size () const
 Retrieve the size of this packet, in bytes.
 
unsigned type () const
 Return the packet's 28-bit type code.
 

Static Public Member Functions

static unsigned capacity ()
 Retrieve the capacity of a packet, in bytes. (19)
 

Detailed Description

A container for one Usb packet's data.

Each packet consists of a variable-length payload of up to 60 bytes, and a "type" word of which the low 28 bits are available for games to use.


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