20#ifdef LIBWINRTBLE_EXPORTS
21#define DLL_DECLSPEC __declspec(dllexport)
23#define DLL_DECLSPEC __declspec(dllimport)
DLL_DECLSPEC
DLL_DECLSPEC
DLL_DECLSPEC
106 const char* requiredServicesUuids,
DLL_DECLSPEC
DLL_DECLSPEC
DLL_DECLSPEC
DLL_DECLSPEC
166 const char* requiredServicesUuids,
DLL_DECLSPEC
DLL_DECLSPEC
DLL_DECLSPEC
DLL_DECLSPEC
DLL_DECLSPEC
244 const char* serviceUuid);
DLL_DECLSPEC
266 const char* serviceUuid,
267 const char* characteristicUuid,
DLL_DECLSPEC
288 const char* serviceUuid,
289 const char* characteristicUuid,
DLL_DECLSPEC
313 const char* serviceUuid,
314 const char* characteristicUuid,
318 bool withoutResponse,
DLL_DECLSPEC
342 const char* serviceUuid,
343 const char* characteristicUuid,
DLL_DECLSPEC
std::uint32_t characteristic_index_t
Type for the index of a characteristic instance in a service.
Definition UnityBridge.h:23
Some types used across the Systemic::BluetoothLE library.
bool sgBleStartScan(const char *requiredServicesUuids, DiscoveredPeripheralCallback onDiscoveredPeripheral)
Starts scanning for BLE peripherals advertising the given list of services.
Definition cble.cpp:341
void sgBleConnectPeripheral(bluetooth_address_t address, const char *requiredServicesUuids, bool autoReconnect, RequestStatusCallback onRequestStatus)
Connects to the given peripheral.
Definition cble.cpp:424
void(* RequestStatusCallback)(BleRequestStatus status)
Callback notifying of the status of a BLE request.
Definition cble.h:52
const char * sgBleGetServiceCharacteristics(bluetooth_address_t address, const char *serviceUuid)
Returns the list of discovered characteristics for the given peripheral's service.
Definition cble.cpp:494
void sgBleWriteCharacteristic(bluetooth_address_t address, const char *serviceUuid, const char *characteristicUuid, characteristic_index_t instanceIndex, const void *data, const size_t length, bool withoutResponse, RequestStatusCallback onRequestStatus)
Sends a request to write to the specified service's characteristic for the given peripheral.
Definition cble.cpp:566
void sgBleSetNotifyCharacteristic(bluetooth_address_t address, const char *serviceUuid, const char *characteristicUuid, characteristic_index_t instanceIndex, ValueChangedCallback onValueChanged, RequestStatusCallback onRequestStatus)
Subscribes or unsubscribes for value changes of the specified service's characteristic for the given ...
Definition cble.cpp:596
int sgBleGetPeripheralMtu(bluetooth_address_t address)
Returns the Maximum Transmission Unit (MTU) for the given peripheral.
Definition cble.cpp:464
void sgBleReadCharacteristic(bluetooth_address_t address, const char *serviceUuid, const char *characteristicUuid, characteristic_index_t instanceIndex, ValueReadCallback onValueRead)
Sends a request to read the value of the specified service's characteristic for the given peripheral.
Definition cble.cpp:534
Systemic::BluetoothLE::bluetooth_address_t bluetooth_address_t
Type for a Bluetooth address.
Definition cble.h:28
void(* BluetoothStateUpdateCallback)(Systemic::BluetoothLE::BleAdapterState state)
Callback notifying of a change of the host device Bluetooth state, for example radio turned on or off...
Definition cble.h:46
bool sgBleInitialize(bool apartmentSingleThreaded, BluetoothStateUpdateCallback onCentralStateUpdate)
Initializes the library for accessing BLE peripherals.
Definition cble.cpp:280
void(* DiscoveredPeripheralCallback)(const char *advertisementDataJson)
Callback notifying of the discovery of a BLE peripheral, with its advertisement data as a JSON string...
Definition cble.h:49
bool sgBleCreatePeripheral(bluetooth_address_t address, PeripheralConnectionEventCallback onPeripheralConnectionEvent)
Creates a Peripheral for the BLE peripheral with the given Bluetooth address.
Definition cble.cpp:374
void sgBleReleasePeripheral(bluetooth_address_t address)
Releases the Peripheral object associated with the given Bluetooth address.
Definition cble.cpp:409
void sgFreeString(char *str)
Deallocates a string returned by any of the sgBle* methods.
Definition cble.cpp:628
int sgBleGetCharacteristicProperties(bluetooth_address_t address, const char *serviceUuid, const char *characteristicUuid, characteristic_index_t instanceIndex)
Returns the standard BLE properties of the specified service's characteristic for the given periphera...
Definition cble.cpp:519
void sgBleStopScan()
Stops an on-going BLE scan.
Definition UnityBridge.mm:122
void(* PeripheralConnectionEventCallback)(bluetooth_address_t address, ConnectionEvent connectionEvent, ConnectionEventReason reason)
Callback notifying of a change connection state of a peripheral, with the reason for the change.
Definition cble.h:55
const char * sgBleGetPeripheralName(bluetooth_address_t address)
Returns the name of the given peripheral.
Definition cble.cpp:457
const char * sgBleGetDiscoveredServices(bluetooth_address_t address)
Returns the list of discovered services for the given peripheral.
Definition cble.cpp:473
void sgBleDisconnectPeripheral(bluetooth_address_t address, RequestStatusCallback onRequestStatus)
Immediately disconnects the given peripheral.
Definition cble.cpp:442
void sgBleShutdown()
Shuts down the library.
Definition UnityBridge.mm:68
void(* ValueChangedCallback)(const void *data, size_t length)
Callback notifying of a value change for a peripheral's characteristic.
Definition cble.h:61
void(* ValueReadCallback)(const void *data, size_t length, BleRequestStatus status)
Callback notifying of the value read from a peripheral's characteristic.
Definition cble.h:58
BleAdapterState
Bluetooth adapter states.
Definition bletypes.h:39
std::uint64_t bluetooth_address_t
Type for a Bluetooth address.
Definition bletypes.h:54
BleRequestStatus
Peripheral requests statuses.
Definition bletypes.h:58
CharacteristicProperties
Standard BLE values for characteristic properties, those are flags that can be combined.
Definition bletypes.h:151
ConnectionEvent
Peripheral connection events.
Definition bletypes.h:101
ConnectionEventReason
Peripheral connection event reasons.
Definition bletypes.h:123