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)

Most upvoted comments

@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/

4.3.1 Low Battery Notifications Battery-powered Bluetooth HID devices may utilize the available HID controls in HID reports to inform the Bluetooth HID Host of a low battery condition. There are standard usages available for power status and battery reporting in the HID Specification; see USB HID Usage Tables [4], Generic Device Controls page.

We connect to RFcomm service, that lays on top of L2CAP. image

https://www.bluetooth.com/specifications/specs/human-interface-device-profile-1-1-1/

The Bluetooth HID Protocol (HIDP) operates over the Bluetooth L2CAP layer and is an adaptation of the USB HID Protocol. The USB HID specification [5] defines Control and Interrupt channels which are mapped to USB Control and Interrupt pipes. This profile defines analogous logical channels which are mapped to L2CAP channels. See section 5.2 for details on how the L2CAP channels are opened and configured.

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