Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: micro-systems on May 12, 2020, 03:29:48 PM

Title: C# class library
Post by: micro-systems on May 12, 2020, 03:29:48 PM
yesterday I purchased the C# Bluetooth Framework library.
My intention is to create a C# class library with Visual Studio.
My test source code:

Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using wclCommon;
using wclBluetooth;

namespace ManagedBLE
    public class ManagedBLE
        private wclBluetoothManager Manager;

        public void Open()
            Manager = new wclBluetoothManager();
            Manager.AfterOpen += new EventHandler(Manager_AfterOpen);
            Manager.OnDiscoveringStarted += new wclBluetoothEvent(Manager_OnDiscoveringStarted);
            Manager.OnDeviceFound += new wclBluetoothDeviceEvent(Manager_OnDeviceFound);

        void Manager_AfterOpen(object sender, EventArgs e)
            wclBluetoothRadio Radio = (wclBluetoothRadio)Manager[0];
            Int32 Res = Radio.Discover(10, wclBluetoothDiscoverKind.dkBle);

        void Manager_OnDiscoveringStarted(object Sender, wclBluetoothRadio Radio)

        void Manager_OnDeviceFound(object Sender, wclBluetoothRadio Radio, long Address)



An external executable call the Open() function, available by the library, AfterOpen event is triggered, but OnDiscoveringStarted event is never triggered.
Is it possible to create a library or does it work only for windows forms?
Do you have any suggestions on this?
Thanks for your valuable support

Tavella Fabrizio
Micro Systems
Title: Re: C# class library
Post by: Mike Petrichenko on May 12, 2020, 03:35:36 PM

You can find a "short" answer by this link: https://forum.btframework.com/index.php?topic=3520.msg9021#msg9021

I do not receomend to use skNone. Use skApc instead (refer to APC and Console demo applications from Bluetooth Framework package).