32feet: BluetoothEndPoint does not contain a constructor that takes 2 arguments
On version 4.0.4 when I code the following line in a Visual Studio 2017 .NET Framework 4.6.1 Windows Forms application:
BluetoothEndPoint blep = new BluetoothEndPoint(BluetoothAddress.Parse("001122334455"), BluetoothService.SerialPort);
I get the error “BluetoothEndPoint does not contain a constructor that takes 2 arguments”
As per the documentation BluetoothEndPoint has constructor that takes 2 or 3 arguments.
Note: I am using 4.0.4 version because 4.0.5 nuget package fails to install as per #74
Thanks!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 34 (7 by maintainers)
@m1adow Check Microsoft Rfcomm example on their GitHub. You do not need use while(true). https://github.com/microsoft/Windows-universal-samples/tree/main/Samples/BluetoothRfcommChat
You also need to know that enable and disable SetServiceState is incredible complicated task for windows. Windows will destroy audio endpoint and then create a new one (include a lot of GUID and other data), some app that use headset could stuck.
@m1adow I suppose mac can’t get battery because it is Fake AirPods. You code does nothing because headphone waiting for response. You need read about AT+ commands. You must response on each request from headphones.
@Rast1234 Or Windows use HID device to collect battery information. Windows is mapped Bluetooth headphones also as a HID device that I suppose control the headphone buttons. HID device can provide battery information or at least event when battery is low.
https://www.bluetooth.com/specifications/specs/human-interface-device-profile-1-1-1/
We connect to RFcomm service, that lays on top of L2CAP.
https://www.bluetooth.com/specifications/specs/human-interface-device-profile-1-1-1/
So Window can just operate of data on L2CAP layer and because of it does not have any trouble to get Battery information even if socket is busy.
Anyway I tried to find HID device to get more info but without success