%% Access a Descriptor on a Bluetooth Low Energy Peripheral Device
% Create a connection to a nearby Bluetooth Low Energy peripheral device.

b = ble("Thingy")

% Create a characteristic object that represents the "Temperature" characteristic.

c = characteristic(b,"Weather Station Service","Temperature")

% List the descriptors for the characteristic.

c.Descriptors

% Create a descriptor object that represents "Client Characteristic Configuration".

d = descriptor(c,"Client Characteristic Configuration")

% Alternatively, you can use the UUID instead of the name to create the object.

d = descriptor(c,"2902")

% This object represents the "Client Characteristic Configuration" descriptor. Since it has both Read and Write attributes, you can use read or write.
% Copyright 2019 The MathWorks, Inc.