Bluetooth with UWP
-
Hello I am starting on a UWP app that requires a bluetooth connection. I'm using VS2015 with update2. I have looked at RFCOMM and tried to implement it however I get this error : "cannot find type System.Net.EndPoint in module System.dll" Can someone help me in solving this. What is the best bluetooth API to use? Thanks, Ron
-
Hello I am starting on a UWP app that requires a bluetooth connection. I'm using VS2015 with update2. I have looked at RFCOMM and tried to implement it however I get this error : "cannot find type System.Net.EndPoint in module System.dll" Can someone help me in solving this. What is the best bluetooth API to use? Thanks, Ron
-
System.Net.EndPoint
should be available in the framework libraries as described in EndPoint Class (System.Net)[^]. How are you referring to it?here is the code I'm working with, Trying to find paired devices
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.Devices.Bluetooth.Rfcomm;
using Windows.Devices.Enumeration;// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace GI_MobileApp.Pages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class BTDevicesPage : Page
{
private DeviceInformationCollection ServiceDeviceCollection = null;
public static readonly Guid RfcommChatServiceUuid = Guid.Parse("00001101-0000-1000-8000-00805f9b34fb");public BTDevicesPage() { this.InitializeComponent(); InitialPara(); } private void tbtnConnect\_Changed(object sender, RoutedEventArgs e) { on\_off(); } /// <summary> /// Method for connect and disconnect /// </summary> private void on\_off() { switch (this.tbtnConnect.IsChecked) { case null: this.tbtnConnect.Content = "Connect"; break; case true: this.tbtnConnect.Content = "Disconnect"; break; case false: this.tbtnConnect.Content = "Connect"; scan(); break; } } private async void scan() { //Find all paired devices and display them in a list ServiceDeviceCollection = await DeviceInformation.FindAllAsync(RfcommDeviceService.GetDeviceSelector(RfcommServiceId.SerialPort)); if (ServiceDeviceCollection.Count > 0) { tbRxData.Text = ""; foreach (var btDeviceice in ServiceDeviceCollection) { tbRxData.Text = (btDeviceice.Name); } tbRxData.Visibility = Visibility; } else { } } /// <summary> /// Method Initialising parameters /// </summary> private void InitialPara() { this.tbtnConnect.IsChecked
-
here is the code I'm working with, Trying to find paired devices
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.Devices.Bluetooth.Rfcomm;
using Windows.Devices.Enumeration;// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace GI_MobileApp.Pages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class BTDevicesPage : Page
{
private DeviceInformationCollection ServiceDeviceCollection = null;
public static readonly Guid RfcommChatServiceUuid = Guid.Parse("00001101-0000-1000-8000-00805f9b34fb");public BTDevicesPage() { this.InitializeComponent(); InitialPara(); } private void tbtnConnect\_Changed(object sender, RoutedEventArgs e) { on\_off(); } /// <summary> /// Method for connect and disconnect /// </summary> private void on\_off() { switch (this.tbtnConnect.IsChecked) { case null: this.tbtnConnect.Content = "Connect"; break; case true: this.tbtnConnect.Content = "Disconnect"; break; case false: this.tbtnConnect.Content = "Connect"; scan(); break; } } private async void scan() { //Find all paired devices and display them in a list ServiceDeviceCollection = await DeviceInformation.FindAllAsync(RfcommDeviceService.GetDeviceSelector(RfcommServiceId.SerialPort)); if (ServiceDeviceCollection.Count > 0) { tbRxData.Text = ""; foreach (var btDeviceice in ServiceDeviceCollection) { tbRxData.Text = (btDeviceice.Name); } tbRxData.Visibility = Visibility; } else { } } /// <summary> /// Method Initialising parameters /// </summary> private void InitialPara() { this.tbtnConnect.IsChecked
-
When I run the code above I get this error : cannot find type System.Net.EndPoint in module System.dll. I need help solving this error? Thanks
-
Hello I am starting on a UWP app that requires a bluetooth connection. I'm using VS2015 with update2. I have looked at RFCOMM and tried to implement it however I get this error : "cannot find type System.Net.EndPoint in module System.dll" Can someone help me in solving this. What is the best bluetooth API to use? Thanks, Ron