RSeries astromech firmware
PSController Class Reference

#include <bt/PSController/PSController.h>

+ Inheritance diagram for PSController:
+ Collaboration diagram for PSController:

Public Types

enum  Type { kPS3, kPS3Nav, kPS4 }
 
- Public Types inherited from JoystickController
enum  BatteryStatus {
  kShutdown = 0x01, kDying = 0x02, kLow = 0x03, kHigh = 0x04,
  kFull = 0x05, kCharging = 0xEE
}
 
enum  ConnectionStatus { kUSB, kBluetooth }
 

Public Member Functions

 PSController (const char *mac, Type type=kPS3Nav)
 
 PSController ()
 
void setPlayer (int player)
 
void setLED (uint8_t r, uint8_t g, uint8_t b)
 
void setRumble (float leftIntensity, int leftDuration, float rightIntensity, int rightDuration)
 
void setRumble (float intensity, int duration=-1)
 
virtual void disconnect () override
 
void setType (Type type)
 
void setMacAddress (const char *mac)
 
- Public Member Functions inherited from JoystickController
 JoystickController ()
 
bool isConnected () const
 
bool isConnecting () const
 
bool isCongested () const
 
virtual void notify ()
 
virtual void onConnect ()
 
virtual void onDisconnect ()
 
virtual void stop ()
 

Static Public Member Functions

static bool startListening (const char *mac=nullptr)
 
static bool startListening (String &mac)
 
static bool stopListening ()
 
static String getDeviceAddress ()
 

Additional Inherited Members

- Public Attributes inherited from JoystickController
State state
 
Event event
 
- Protected Attributes inherited from JoystickController
bool fConnected
 
bool fConnecting
 
bool fCongested
 

Member Enumeration Documentation

◆ Type

Enumerator
kPS3 
kPS3Nav 
kPS4 

Constructor & Destructor Documentation

◆ PSController() [1/2]

PSController::PSController ( const char *  mac,
Type  type = kPS3Nav 
)

◆ PSController() [2/2]

PSController::PSController ( )
inline

Member Function Documentation

◆ disconnect()

virtual void PSController::disconnect ( )
overridevirtual

Reimplemented from JoystickController.

◆ getDeviceAddress()

static String PSController::getDeviceAddress ( )
static

◆ setLED()

void PSController::setLED ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

◆ setMacAddress()

void PSController::setMacAddress ( const char *  mac)

◆ setPlayer()

void PSController::setPlayer ( int  player)

◆ setRumble() [1/2]

void PSController::setRumble ( float  intensity,
int  duration = -1 
)
inline

◆ setRumble() [2/2]

void PSController::setRumble ( float  leftIntensity,
int  leftDuration,
float  rightIntensity,
int  rightDuration 
)

◆ setType()

void PSController::setType ( Type  type)

◆ startListening() [1/2]

static bool PSController::startListening ( const char *  mac = nullptr)
static

◆ startListening() [2/2]

static bool PSController::startListening ( String &  mac)
inlinestatic

◆ stopListening()

static bool PSController::stopListening ( )
static

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