Global Bluetooth operations. More...
#include <sifteo/bluetooth.h>
Static Public Member Functions | |
static void | advertiseState (const uint8_t *bytes, unsigned length) |
Set the current advertised game state. More... | |
template<typename T > | |
static void | advertiseState (const T &object) |
Template wrapper around advertiseState() More... | |
static bool | isAvailable () |
Is Bluetooth support available on this hardware? More... | |
static bool | isConnected () |
Is a device currently connected via the Sifteo Bluetooth API? More... | |
Global Bluetooth operations.
The system provides a basic level of Bluetooth functionality without any game-specific code. This includes filesystem access, pairing the base with a Sifteo user account, getting information about the running game, and launching a game.
|
inlinestatic |
Set the current advertised game state.
When a device has connected to the Sifteo Base's system software but hasn't necessarily connected to a game's BluetoothPipe, it can still retrieve basic information about the running game.
This basic information is "advertised" to the mobile device, which can use it to determine game state and possibly to determine whether it wants to connect.
This basic information that we advertise includes a game's package name and version. Games may optionally specify an additional game-specific binary blob to include in the advertisement data.
The provided advertisement data is atomically copied to a system buffer. The application can reuse the buffer memory immediately.
To disable this additional advertisement data, call advertiseState() with an empty or NULL buffer.
|
inlinestatic |
Template wrapper around advertiseState()
This is a convenience wrapper around advertiseState(), for passing arbitrary C++ objects. The object is copied, and it does not need to be retained in memory by the caller.
|
inlinestatic |
Is Bluetooth support available on this hardware?
Returns 'true' if the Base we're running on has firmware and hardware that support Bluetooth. If not, returns 'false'.
|
inlinestatic |
Is a device currently connected via the Sifteo Bluetooth API?
Returns 'true' if a device is connected right now, 'false' if not.
To get notified when a connection is created or destroyed, you can attach handlers to Events::bluetoothConnect and Events::bluetoothDisconnect.
Sifteo SDK v1.1.0 (see all versions)
Last updated Tue Dec 23 2014, by Doxygen