2

For a medical application I have sensors that can send (HEX) data over Bluetooth. I would like to use this data in Unity to give visual feedback to users. I already have a working Bluetooth connection via Serial Port but the Program should search and connect the device dynamically. I also build a Visual Studio application by using the 32feet.net API and it works fine. But it should work with Unity in C#. Is there an API like the 32feet.net in VS for Unity? I am not sure if the 32feet.net API runs with Unity as well, but I was not able to make it work. If there is a documentation how to implement 32feet in Unity it would be great. Otherwise I need another opportunity to communicate with my bluetooth device (except using serial port).

EDIT: SocketException: An address incompatible with the requested protocol was used.

mariusz_witeczek
  • 115
  • 4
  • 11
  • You mean Unity, de DI container? – Oscar Aug 13 '13 at 07:28
  • I mean Unity 3D the development environment. – mariusz_witeczek Aug 13 '13 at 07:39
  • Ok. And what is stopping you from using 32feet.net and Unity together? – Oscar Aug 13 '13 at 07:43
  • Actually I didn't find any documentation for implementing the 32feet.net API in Unity. Maybe it works only with the .net Framework and I were not able to make it work for Unity. If it works for Unity as well it would be great but I don't know how to realize it. (I guess you already noticed that I am a newby) – mariusz_witeczek Aug 13 '13 at 07:49
  • Well, I'm not a Unity3D expert, but from the website it seams that it can compile c# code, so I don't see any problem. http://docs.unity3d.com/Documentation/Manual/VisualStudioIntegration.html – Oscar Aug 13 '13 at 07:57
  • Yes it is possible to implement the 32feet.net API with Visual Studio but back in Unity there are some errors that the 32feet.net assembly can not be found. – mariusz_witeczek Aug 13 '13 at 08:02
  • Have you added a reference? – Oscar Aug 13 '13 at 08:31
  • I copy the .dll file in my assets folder. Unity automatically pick it up and I can use it in my development environment. However, as soon as I try to create a new BluetoothClient, I get a SocketException. – mariusz_witeczek Aug 13 '13 at 08:45
  • I'm afraid that I don't know enough about Unity in order to help.. My knowledge is mostly about .Net.. Anyway, could post the full stack trace? – Oscar Aug 13 '13 at 09:07
  • `SocketException: An address incompatible with the requested protocol was used.` It is not possible to post the full strack trace because the text is too long for a comment. – mariusz_witeczek Aug 13 '13 at 09:34
  • 1
    That almost sounds as if you're either using ipv6 where it's expecting ipv4 or the other way around. – Bart Aug 13 '13 at 10:36
  • If you require further help on this I might suggest you edit your main question with the above error and the code you're running to get there. – S.Richmond Aug 14 '13 at 01:26

0 Answers0