Hello everyone.
The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Options
HoloLens Bluetooth Ports
Hey guys!
I'm facing the problem, that I can't use the SerialPort Class in my WSA UWP HoloLens app, to read bluetooth input, because the Unity compiler complains the following, when I'm trying to build:
error CS0234: The type or namespace name 'Ports' does not exist in the namespace 'System.IO' (are you missing an assembly reference?)
Any help about fixing this is, or alternatives is greatly appreciated.
Thank you in advance,
jschnettker
0
Answers
Hey,
if the Unity compiler is complaining, try to use the #if NETFX_CORE flag.
if NETFX_CORE
endif
Hey, try to use the #if NETFX_CORE flag.
if NETFX_CORE -your code- #endif
I tried to fix it, using the #if NETFX_CORE tag, but it keeps preventing me from building.
That's the code I'm currently using:
``using UnityEngine;
using System.IO;
if NETFX_CORE
using System.IO.Ports;
endif
using System.Collections.Generic;
using System;
//using Windows.Devices.Bluetooth.Rfcomm;
public class sizeManipulator: MonoBehaviour
{
if NETFX_CORE
endif
if NETFX_CORE
endif
if NETFX_CORE
endif
if NETFX_CORE
endif
}
Try to put the "using System.IO;" under the flag, too.
(like "using System.IO.Ports;")
@Mondo thanks for your reply!
I tried it, but unfortunately it still prevents me from building.
Ports is not a valid type in System.IO in UWP - https://msdn.microsoft.com/en-us/library/mt185496.aspx
@Jesse_McCulloch Ok, thanks. Helps to know, what doesn't work.
What alternatives do I have
@jschnettker : You have to use RFCOMM