Wireless Communication Library Support Forum
Frameworks => Bluetooth Framework => Topic started by: micro-systems on May 12, 2020, 03:29:48 PM
-
Hi,
yesterday I purchased the C# Bluetooth Framework library.
My intention is to create a C# class library with Visual Studio.
My test source code:
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);
Manager.Open();
}
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
Italy
-
Hi,
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).