Can is use Bluetooth Sockets with InTheHand?
I am trying to establish a bluetooth connection with my PC and my Android's unity application. I was using the InTheHand.dll so i could use its Bluetooth socket functionalities. I successfully create the client on the PC but I am unable to create the server on unity. I create a wrapper class to workaround the GUID serialization problem, but there seems to still be issues when i try to create the Bluetooth listener.
SerializableGuid UUID = new Guid("00001101-0000-1000-8000-00805F9B34FB"); BluetoothListener BTListener = new BluetoothListener(UUID);
where SerializableGuid is here:
[Serializable]
public struct SerializableGuid : IComparable, IComparable, IEquatable {
public string Value;
private SerializableGuid(string value)
{
Value = value;
}
public static implicit operator SerializableGuid(Guid guid)
{
return new SerializableGuid(guid.ToString());
}
public static implicit operator Guid(SerializableGuid serializableGuid)
{
return new Guid(serializableGuid.Value);
}
public int CompareTo(object value)
{
if (value == null)
return 1;
if (!(value is SerializableGuid))
throw new ArgumentException("Must be SerializableGuid");
SerializableGuid guid = (SerializableGuid)value;
return guid.Value == Value ? 0 : 1;
}
public int CompareTo(SerializableGuid other)
{
return other.Value == Value ? 0 : 1;
}
public bool Equals(SerializableGuid other)
{
return Value == other.Value;
}
public override bool Equals(object obj)
{
return base.Equals(obj);
}
public override int GetHashCode()
{
return (Value != null ? Value.GetHashCode() : 0);
}
public override string ToString()
{
return (Value != null ? new Guid(Value).ToString() : string.Empty);
}
}
Will .Net.Sockets work if I am trying to use bluetooth sockets?
Your answer
Follow this Question
Related Questions
java.net.SocketException: recvfrom failed: ECONNRESET 0 Answers
Socket.io, connetion works but can't emit 0 Answers
Received wrong message from socket 0 Answers
Unity Socket Port-forward 0 Answers
Implement websockets in HoloLens to Connect to Socket.IO 1 Answer