|
Bluetooth Framework C++ Edition
|
The class represents a Bluetooth LE GATT client connection. More...
#include <wclBluetooth.h>
Public Member Functions | |
| CwclGattClientConnection (CwclBluetoothRadio *const Radio) | |
| Creates a new GATT client connection object. | |
| int | ReadCharacteristics (const wclGattService &Service, const wclGattOperationFlag Flag, wclGattCharacteristics &Characteristics) |
| The method reads all the characteristics available for the specified service. | |
| int | ReadCharacteristicValue (const wclGattCharacteristic &Characteristic, const wclGattOperationFlag Flag, const wclGattProtectionLevel Protection, unsigned char *&Value, unsigned long &Length) |
| The method reads the value of the specified characteristic. | |
| int | ReadDescriptors (const wclGattCharacteristic &Characteristic, const wclGattOperationFlag Flag, wclGattDescriptors &Descriptors) |
| The method reads all the descriptors available for the specified characteristic. | |
| int | ReadDescriptorValue (const wclGattDescriptor &Descriptor, const wclGattOperationFlag Flag, const wclGattProtectionLevel Protection, wclGattDescriptorValue &Value) |
| The method reads the value of the specified descriptor. | |
| int | ReadIncludedServices (const wclGattService &Service, const wclGattOperationFlag Flag, wclGattServices &Services) |
| The method reads all the included services available for a given service. | |
| int | ReadServices (const wclGattOperationFlag Flag, wclGattServices &Services) |
| Reads available services from a remote Bluetooth LE device. | |
| int | WriteCharacteristicValue (wclGattCharacteristic Characteristic, const wclGattProtectionLevel Protection, const unsigned char *const Value, const unsigned long Length, const wclGattWriteKind WriteKind) |
| The method writes the specified characteristic value to the Bluetooth device. | |
| int | WriteDescriptorValue (const wclGattDescriptor &Descriptor, const wclGattProtectionLevel Protection, const wclGattDescriptorValue &Value) |
| The method writes the specified descriptor value to the Bluetooth device. | |
| int | AbortReliableWrite () |
| The method specifies the end of reliable write procedures, and the writes should be aborted. | |
| int | BeginReliableWrite (const wclGattCharacteristic &Characteristic) |
| The method specifies that reliable writes are about to begin. | |
| int | EndReliableWrite () |
| The method specifies the end of reliable writes, and the writes should be committed. | |
| int | WriteClientConfiguration (const wclGattCharacteristic &Characteristic, const bool Subscribe, const wclGattOperationFlag Flag, const wclGattProtectionLevel Protection) |
| Writes the client configuration descriptor to the device. | |
| int | Subscribe (const wclGattCharacteristic &Characteristic) |
| Subscribes for the characteristic changes notifications. | |
| int | Unsubscribe (const wclGattCharacteristic &Characteristic) |
| Unsubscribes from the characteristic changes notifications. | |
| int | Connect (const __int64 Address, const bool ConnectOnRead, const bool ForceNotifications) |
| Connects to a remote device. | |
| int | GetConnectionParams (wclBluetoothLeConnectionParameters &Params) |
| Gets the current connection parameters. | |
| int | SetConnectionParams (const wclBluetoothLeConnectionParametersType Params) |
| Request the connection parameters change to the specified preferred connection parameters. | |
| int | SetConnectionParams (const wclBluetoothLeConnectionParametersValue &Params) |
| Request the connection parameters change to the specified preferred connection parameters. | |
| int | GetMaxPduSize (unsigned short &Size) |
| Reads the maximum PDU size for the current connection. | |
| int | GetMaxPayloadSize (unsigned short &Size) |
| Reads the maximum payload size for the current connection. | |
| int | GetConnectionPhyInfo (wclBluetoothLeConnectionPhy &Info) |
| Reads the Bluetooth LE physical layer (PHY) information. | |
| __int64 | GetAddress () const |
| Gets a remote device MAC address. | |
| __declspec (property(get=GetAddress)) __int64 Address | |
| Gets a remote device MAC address. | |
| bool | GetConnectOnRead () const |
| Gets connection mode. | |
| __declspec (property(get=GetConnectOnRead)) bool ConnectOnRead | |
| Gets connection mode. | |
| bool | GetForceNotifications () const |
| Gets the notifications mode. | |
| __declspec (property(get=GetForceNotifications)) bool ForceNotifications | |
| Gets the notifications mode. | |
| CwclBluetoothRadio * | GetRadio () const |
| Gets the connection owner. | |
| __declspec (property(get=GetRadio)) CwclBluetoothRadio *Radio | |
| Gets the connection owner. | |
| bool | GetReliableWriteActive () const |
| Gets a reliable write operation status. | |
| __declspec (property(get=GetReliableWriteActive)) bool ReliableWriteActive | |
| Gets a reliable write operation status. | |
| __event void | OnCharacteristicChanged (void *Sender, const unsigned short Handle, const unsigned char *const Value, unsigned long const Length) |
| The event fires when a subscribed characteristic value has been changed. | |
| __event void | OnConnectionParamsChanged (void *Sender) |
| The event fires when the connection parameters changed. | |
| __event void | OnConnectionPhyChanged (void *Sender) |
| The event fires when the connection PHY changed. | |
| __event void | OnMaxPduSizeChanged (void *Sender) |
| The event fires when the maximum PDU size changed. | |
Public Member Functions inherited from CwclClientConnection | |
| CwclClientConnection () | |
| Creates a new client connection. | |
| virtual | ~CwclClientConnection () |
| Frees the connection. | |
| int | Connect (const wclMessageProcessingMethod MessageProcessing, const unsigned long Timeout=10000) |
| Connects to a remote device. | |
| int | Disconnect () |
| Disconnects from the connected remote device. | |
| wclClientState | GetState () const |
| Gets the connection state. | |
| __declspec (property(get=GetState)) wclClientState State | |
| Gets the connection state. | |
| unsigned long | GetTimeout () const |
| Gets the connect timeout value. | |
| __declspec (property(get=GetTimeout)) unsigned long Timeout | |
| Gets the connect timeout value. | |
| __event void | OnConnect (void *Sender, const int Error) |
| The event fires when a connection to a remote device has been completed (with or without success). | |
| __event void | OnDisconnect (void *Sender, const int Reason) |
| The event fires when the remote connected device has been disconnected. | |
Public Member Functions inherited from CwclCustomConnection | |
| CwclCustomConnection () | |
| Creates a new connection. | |
| virtual | ~CwclCustomConnection () |
| Frees the connection. | |
| wclMessageProcessingMethod | GetMessageProcessing () const |
| Gets the message processing method used by the connection. | |
| __declspec (property(get=GetMessageProcessing)) wclMessageProcessingMethod MessageProcessing | |
| Gets the message processing method used by the connection. | |
| CwclMessageReceiver * | GetReceiver () const |
| Gets the connection message receiver object. | |
| __declspec (property(get=GetReceiver)) CwclMessageReceiver *Receiver | |
| Gets the connection message receiver object. | |
| DWORD | GetThreadId () const |
| Gets the connection's thread ID. | |
| __declspec (property(get=GetThreadId)) DWORD ThreadId | |
| Gets the connection's thread ID. | |
Protected Member Functions | |
| virtual int | PrepareForConnection () |
| The method called internally before connection. | |
| virtual void | MessageReceived (const CwclMessage *const Message) override |
| The method called when a new notification message received. | |
| virtual int | HalConnect (CwclEvent *const Event) override |
| Implements a hardware-dependent code that connects to a remote device. | |
| virtual int | HalDisconnect () override |
| Implements a hardware-dependent code that disconnects from the connected remote device. | |
| virtual void | DoCharacteristicChanged (const unsigned short Handle, const unsigned char *const Value, const unsigned long Length) |
Fires the OnCharacteristicChanged event. | |
| virtual void | DoConnectionParamsChanged () |
Fires the OnConnectionParamsChanged event. | |
| virtual void | DoConnectionPhyChanged () |
Fires the OnConnectionPhyChanged event. | |
| virtual void | DoMaxPduSizeChanged () |
Fires the OnPduMaxSizeChanged event. | |
| virtual int | HalReadCharacteristics (const wclGattService &Service, const wclGattOperationFlag Flag, wclGattCharacteristics &Characteristics)=0 |
| Implements a hardware-dependent code for reading the characteristics available for the specified service. | |
| virtual int | HalReadCharacteristicValue (const wclGattCharacteristic &Characteristic, const wclGattOperationFlag Flag, const wclGattProtectionLevel Protection, unsigned char *&Value, unsigned long &Length)=0 |
| Implements a hardware-dependent code for reading the value of the specified characteristic. | |
| virtual int | HalReadDescriptors (const wclGattCharacteristic &Characteristic, const wclGattOperationFlag Flag, wclGattDescriptors &Descriptors)=0 |
| The method reads all the descriptors available for the specified characteristic. | |
| virtual int | HalReadDescriptorValue (const wclGattDescriptor &Descriptor, const wclGattOperationFlag Flag, const wclGattProtectionLevel Protection, wclGattDescriptorValue &Value)=0 |
| Implements a hardware-dependent code for reading the value of the specified descriptor. | |
| virtual int | HalReadIncludedServices (const wclGattService &Service, const wclGattOperationFlag Flag, wclGattServices &Services)=0 |
| Implements a hardware-dependent code for reading the included services available for a given service. | |
| virtual int | HalReadServices (const wclGattOperationFlag Flag, wclGattServices &Services)=0 |
| Implements a hardware-dependent code for reading available services from a remote Bluetooth LE device. | |
| virtual int | HalWriteCharacteristicValue (const wclGattCharacteristic &Characteristic, const wclGattProtectionLevel Protection, const unsigned char *const Value, const unsigned long Length)=0 |
| Implements a hardware-dependent code to write the specified characteristic value to the Bluetooth device. | |
| virtual int | HalWriteDescriptorValue (const wclGattDescriptor &Descriptor, const wclGattProtectionLevel Protection, const wclGattDescriptorValue &Value)=0 |
| Implements a hardware-dependent code to write the specified descriptor value to the Bluetooth device. | |
| virtual int | HalAbortReliableWrite ()=0 |
| Implements a hardware-dependent code to specify the end of reliable write procedures, and the writes should be aborted. | |
| virtual int | HalBeginReliableWrite (const wclGattCharacteristic &Characteristic)=0 |
| Implements a hardware-dependent code to specify that reliable writes are about to begin. | |
| virtual int | HalEndReliableWrite ()=0 |
| Implements a hardware-dependent code to specify the end of reliable writes, and the writes should be committed. | |
| virtual int | HalSubscribe (const wclGattCharacteristic &Characteristic, HANDLE &Hdl)=0 |
| Implements a hardware-dependent code to subscribes for the characteristic changes notifications. | |
| virtual int | HalUnsubscribe (const HANDLE Hdl)=0 |
| Implements a hardware-dependent code to unsubscribes from the characteristic changes notifications. | |
| virtual int | HalGetConnectionParams (wclBluetoothLeConnectionParameters &Params)=0 |
| Implements a hardware-dependent code to get the current connection parameters. | |
| virtual int | HalSetConnectionParams (const wclBluetoothLeConnectionParametersType Params)=0 |
| Implements a hardware-dependent code to request the connection parameters change to the specified preferred connection parameters. | |
| virtual int | HalSetConnectionParams (const wclBluetoothLeConnectionParametersValue &Params)=0 |
| Implements a hardware-dependent code to request the connection parameters change to the specified preferred connection parameters. | |
| virtual int | HalGetMaxPduSize (unsigned short &Size)=0 |
| Implements a hardware-dependent code to reads the maximum PDU size for the current connection. | |
| virtual int | HalGetConnectionPhyInfo (wclBluetoothLeConnectionPhy &Info)=0 |
| Implements a hardware-dependent code to reads the Bluetooth LE physical layer (PHY) information. | |
Protected Member Functions inherited from CwclClientConnection | |
| void | InternalDisconnect (const int Reason) |
| The internal disconnect method. Disconnects from a connected remote device. | |
| void | NotifyClosed (const int Reason) |
| Send a Disconnect notification message. | |
| virtual void | DoConnect (const int Error) |
Fires the OnConnect event. | |
| virtual void | DoDisconnect (const int Reason) |
Fires the OnDisconnect event. | |
| virtual int | HalCommunicate (CwclEvent *const Event) |
| Implements a hardware-dependent code that communicate with the connected remote device. | |
Protected Member Functions inherited from CwclCustomConnection | |
| CwclCriticalSection * | GetCS () |
| Gets the connection critical section. | |
| __declspec (property(get=GetCS)) CwclCriticalSection *CS | |
| Gets the connection critical section. | |
The class represents a Bluetooth LE GATT client connection.
An application must never create instances of this class directly. Instead of that an application must use related methods from the CwclBluetoothRadio object.