Giter VIP home page Giter VIP logo

winble's Introduction

WinBle

A set of classes for enumerating and interacting with Bluetooth low energy devices on the windows platform.

Requirements

  • Windows 10
  • Devices must be paired and enumerated by the windows ble driver

Example Code

Read a Characteristic

// The characteristic must have IsReadable set to true or an exception will be thrown
BleGattCharacteristicValue value = characteristic->getValue();

Write a Characteristic Value

// The characteristic must have IsSignedWritable, IsWritable, IsWritableWithoutResponse set to true or an exception will be thrown
UCHAR values[] = { 'H', 'I', '\r', '\n' };

characteristic->setValue(values, 4);

Subscribe to a Characteristic Notification

// The callback for the characteristic notification
void HandleCallback(BleGattNotificationData& data)
{
    cout << "Received callback data: " << data.getDataSize() << endl;
}

// Enumerate characteristic descriptors
characteristic->enumerateBleDescriptors();

// Get the list of descriptors
list<BleGattDescriptor *> descriptors = characteristic->getBleDescriptors();

if (descriptors.size() > 0)
{
    // Get the characteristic descriptor
    BleGattDescriptor *descriptor = descriptors.front();

    // The callback function
    const std::function<void(BleGattNotificationData&)> callback = HandleCallback;

    // Enable notifications for the characteristic IsNotifiable or IsIndicatable must be true for the characteristic or an exception will be thrown
    characteristic->enableNotifications(callback);

    // Enable the subscription notification for the characteristic
    descriptor->setIsSubscribeToNotification();

    // Disable the notification
    characteristic->disableNotifications();

    // Clear the subscription notification
    descriptor->clearIsSubscribeToNotification();
}

Windows Bluetooth Tracing

Windows Bluetooth tracing requires the download of a WPRP file from the Microsoft Git hub repo eere. The readme.md document in the Microsoft Git hub repo describes the steps to enable the tracing.

When this tracing is complete the stop command will write the trace contents to an ETL file that is provided as a parameter to the command.

The generated ETL file is a binary file in order to parse it to a readable form, a tool called BTETLParse.exe is required to convert the ETL. The tool supports a number of different formats of output, namely:

  • CFA
    • Can be opened with Teledyne LeCroy Wireless Protocol Suite
  • HCI
    • This is a plain text file
  • PCAP
    • This can be opened with wireshark

Instructions for the BTETLParse.exe tool can be found Here

The BTETLParse.exe tool can be downloaded from Here

winble's People

Contributors

derekgn avatar david-sackstein avatar mikechiarappa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.