W
WOWCube Docs
Filters
vSDK
Navigation
infoWOWConnect_BluetoothWOWConnect_EnumsWOWConnect_UPNPDeviceInformationWOWConnect_WOWCubeDevice
changelogindex
Made byMcKay Seamons
GitHub

Cubios.WOWConnect.Bluetooth


Delegates


DetectedDevicesListChangedDelegate

Summary

Device list change delegate. Gets called when the library detects new WOWCube device, either physical or virtual.

Arguments

  • device - new WOWCube device object

Synopsis

WOWConnect_Bluetooth
1delegate void DetectedDevicesListChangedDelegate(WOWCubeDevice device)
2

MessageReceivedDelegate

Summary

This delegate is called when the library receives data over BLE from a cubeapp.

Arguments

  • sender - device that sends the data
  • messageType - data packet type identifier
  • data - received data byte array

Synopsis

WOWConnect_Bluetooth
1MessageReceivedDelegate(WOWCubeDevice sender, byte messaageType, byte[] data)
2

LogDelegate

Summary

This delegate is called when the library wants to output message to a log

Arguments

  • level - message severity level
  • text - message body

Synopsis

WOWConnect_Bluetooth
1delegate void LogDelegate(LogLevel level, String text)
2

Public Methods


Open

Summary

Opens and initializes the library

Arguments

  • lcdelegate - device list changed delegate
  • msgdelegate - message received delegate
  • logdelegate - log delegate

Output

Returns true upon successfull initialization of the library, false otherwise.

Synopsis

WOWConnect_Bluetooth
1static bool Open(DetectedDevicesListChangedDelegate lcdelegate = null, MessageReceivedDelegate msgdelegate = null, LogDelegate logdelegate = null)
2

Close

Summary

Closes the library and frees resources

Synopsis

WOWConnect_Bluetooth
1static void Close()
2

GetDevice

Summary

Returns a WOWCubeDevice deivce object from the list of detected devices by device name.

Arguments

  • deviceName - device name

Output

Returns a WOWCubeDevice object in case if device is found in the list, null otherwise.

Synopsis

WOWConnect_Bluetooth
1static WOWCubeDevice GetDevice(string deviceName)
2

AddEmulatedDevice

Summary

Adds an emulated device to the list of detected devices. This funciton comes in handy in cases when it's necessary to test a cubeapp that uses WOWConnect on WOWCube Emulator, if for one reason or another it is not possible to use the UPNP for emulated device discovery.

Arguments

  • deviceName - emulated device name as seen in the list
  • ip - ip address of the computer that runs WOWCube Emulator
  • port - emulated device communication port. The value can be found in WOWCube Emulator module 0 output console (MID0) - BLE Devise port: 32125

Output

Returns true if emulated device was added successfully, false otherwise.

Synopsis

WOWConnect_Bluetooth
1static bool AddEmulatedDevice(string deviceName, string ip, int port)
2

Public Getters

Devices

Output

Returns a list of currently detected devices

Synopsis

WOWConnect_Bluetooth
1static List<WOWCubeDevice> Devices
2

DeviceList

Output

Returns a list of objects that hold BLE device-specific information

Synopsis

WOWConnect_Bluetooth
1static List<DeviceInformation> DeviceList
2

UPNPDeviceList

Output

Returns a list of objects that hold eumlated device-specific information

Synopsis

WOWConnect_Bluetooth
1static List<UPNPDeviceInformation> UPNPDeviceList
2

LastError

Output

Returns an error code for last called method.

Synopsis

WOWConnect_Bluetooth
1static int LastError
2
3

LastErrorDescription

Output

Returns a textual description of the error code for last called method.

Synopsis

WOWConnect_Bluetooth
1static string LastErrorDescription
2

Version

Output

Returns a version of WOWConnect library

Synopsis

WOWConnect_Bluetooth
1static String Version
2

Public Variables

EnableEmulatorSupport

Summary

Despite that using an emulated WOWCube device is very convenient for cubeapp development and debugging purposes, the presence of such functionality in release versions is redundant. The library allows toggling it on and off.

Output

Returns true if support for emulated WOWCube devices is enabled, false otherwise.

Synopsis

WOWConnect_Bluetooth
1static bool EnableEmulatorSupport
2