Skip to Main Content Skip to Search
Product Documentation

Using Events and Callbacks with Bluetooth

You can enhance the power and flexibility of your instrument control application by using events. An event occurs after a condition is met, and might result in one or more callbacks.

While the instrument object is connected to the instrument, you can use events to display a message, display data, analyze data, and so on. Callbacks are controlled through callback properties and callback functions. All event types have an associated callback property. Callback functions are MATLAB functions that you construct to suit your specific application needs.

You execute a callback when a particular event occurs by specifying the name of the callback function as the value for the associated callback property.

The Bluetooth event types and associated callback properties are described below.

Event Type

Associated Property Name

Bytes-available

BytesAvailableFcn

BytesAvailableFcnCount

BytesAvailableFcnMode

Error

ErrorFcn

Output-empty

OutputEmptyFcn

Timer

TimerFcn

TimerPeriod

These are the same callbacks that are commonly used by other interfaces in the Instrument Control Toolbox.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS