%% Access a Characteristic on a Bluetooth Low Energy Peripheral Device
% Connect to a nearby Bluetooth Low Energy peripheral device.

b = ble("DemoDev")

% List the available characteristics on this device.

b.Characteristics

% This list shows all characteristics and their respective services. Some services have multiple characteristics. The list also shows the attributes for each characteristic.
% Create a characteristic object that represents the "Battery Level" characteristic.

c = characteristic(b,"Battery Service","Battery Level")

% Alternatively, you can use the UUIDs instead of the names to create the object.

c = characteristic(b,"180F","2A19")

% This object represents the "Battery Level" characteristic. Since it has the Read attribute, you can use read to get the characteristic value.
% Copyright 2019 The MathWorks, Inc.