Quantcast
Channel: 32feet.NET
Viewing all 469 articles
Browse latest View live

New Post: Code never runs past AcceptBluetoothClient

$
0
0
Hi,

this discussion is older than one year, nevertheless I hope someone can help me.
I am using the same methods and i'm facing exactly the same problem like desscribed above.
I'm using a Desktop PC with Windows 7 and the Windows drivers for a USB bluetooth dongle and writing the server Code in C# in Visual Studio 2013.
My device has the Android Version 4.2.2.
Could you solve your problem? Or has anyone else a suggestion how to solve it?

I'd be very glad about any answers
Christoph

Created Unassigned: Connecting to smart phone's [43249]

$
0
0
Hello,

this is not really an issue its more of a question, I'm trying to connect a mobile device to my pc using 32feet, the BluetoothDeviceInfo connected property always returns false even though on the iPhone 6 plus I'm testing on, shows Connected, I'm using a bluetooth dongle (CSR's BlueCore4) to connect, also the Rssi value is always -2147483648.

I have tried porting the project I've made to a laptop with in built bluetooth to make sure its not the dongle and I get the same results as mentioned above.

Any help or advise would be grateful, I've tried google and everything people have suggested on google but always get the same result.

Thanks

Phil

New Post: problem with download

$
0
0
I just downloaded the sources and could not compile InTheHand.Phone.Bluetooth.
There are errors in the BluetoothDevicePicker.

Best regards
Axel

New Comment on "General Bluetooth Data Connections"

$
0
0
Hi! I've stumbled across your library as I am trying to find new ways to solve an implementation we have done. At the moment I have an application that needs to discover a bluetooth device and connect to it without issues, but during usability testing with lots of bluetooth devices around, it was easy to understand our current implementation is not the greatest. Based on that, does 32feet provides a way to determine the proximity of the bluetooth device? I might start creating a sample application for demo purposes in my organisation in which the devices are filtered by a MAC Address (we can identify our devices by the MAC address) to then try to determine the proximity of the device and connect to the one is closest.

New Post: Bluetooth Low Energy Support

$
0
0
Hi Peter,

It's been nearly two and a half years since you replied above, and I was wondering if 32Feet now supports BLE (or not). Can you fill us in on that situation please?

Thanks,
Mike

Created Unassigned: Broadcast from a BT server to BT clients [43257]

$
0
0
Hello,
I have an inssue about the server-client communication.
I googled around but I did not find a solution to this.
Right now I am using 32feet in order to get in touch 2 or more (till 7) BT clients to 1 BT server.
I need to broadcast a message from the server to every device in the same time, but I don't know how to do it.
The only way I figured out was to use the list of connection in order to send the message one per time. Unfortunately I risk to have a large delay on the last one.
Can someone please give me an advice on how to solve this problem?

If it can be helpfull, here there is the handle of connection and reading from devices.

Thanks for your help


```
private void btnStartServer_Click(object sender, EventArgs e)
{
btnStartClient.Enabled = false;
ConnectAsServer();
}

private void ConnectAsServer()
{
connessioniServer = new List<BluetoothClient>();

// thread handshake
Thread bluetoothConnectionControlThread = new Thread(new ThreadStart(ServerControlThread));
bluetoothConnectionControlThread.IsBackground = true;
bluetoothConnectionControlThread.Start();

// thread connessione
Thread bluetoothServerThread = new Thread(new ThreadStart(ServerConnectThread));
bluetoothServerThread.IsBackground = true;
bluetoothServerThread.Start();
}

private void ServerControlThread()
{
while (true)
{
foreach (BluetoothClient cc in connessioniServer)
{
if (!cc.Connected)
{
connessioniServer.Remove(cc);
break;
}
}
updateConnList();
Thread.Sleep(0);
}
}

Guid mUUID = new Guid("fc5ffc49-00e3-4c8b-9cf1-6b72aad1001a");
private void ServerConnectThread()
{
updateUI("server started");
BluetoothListener blueListener = new BluetoothListener(mUUID);
blueListener.Start();
while (true)
{
BluetoothClient conn = blueListener.AcceptBluetoothClient();
connessioniServer.Add(conn);
Thread appoggio = new Thread(new ParameterizedThreadStart(ThreadAscoltoClient));
appoggio.IsBackground = true;
appoggio.Start(conn);
updateUI(conn.RemoteMachineName+" has connected");

}
}

private void ThreadAscoltoClient(object obj)
{
BluetoothClient clientServer = (BluetoothClient)obj;
Stream streamServer = clientServer.GetStream();
streamServer.ReadTimeout=1000;
while (clientServer.Connected)
{
try
{
int bytesDaLeggere = clientServer.Available;
if (bytesDaLeggere > 0)
{
byte[] bytesLetti = new byte[bytesDaLeggere];
int byteLetti = 0;
while (bytesDaLeggere > 0)
{
int bytesDavveroLetti = streamServer.Read(bytesLetti, byteLetti, bytesDaLeggere);
bytesDaLeggere -= bytesDavveroLetti;
byteLetti += bytesDavveroLetti;
}
updateUI("message sent from "+clientServer.RemoteMachineName+": " + System.Text.Encoding.Default.GetString(bytesLetti));
}
}
catch { }
Thread.Sleep(0);
}
updateUI(clientServer.RemoteMachineName + " has gone");
}



private void updateUI(string message)
{
Func<int> del = delegate()
{
textBox1.AppendText(message + System.Environment.NewLine);
return 0;
};
Invoke(del);
}

private void updateConnList()
{
Func<int> del = delegate()
{
listaSensori.Items.Clear();
foreach (BluetoothClient d in connessioniServer)
{
listaSensori.Items.Add(d.RemoteMachineName);
}
return 0;
};
try
{
Invoke(del);
}
catch { }
}

```

Commented Unassigned: 32feet.NET does not support the Bluetooth stack on this device. [43236]

$
0
0
I have a .NET 4.0 C# project running on Windows 10. This project has worked for the last two years, and when I tried to run it to make some enhancements, I'm getting the following error when trying to create a new BluetoothClient(). Since this used to work, is this a Windows 10 issue? I can see my bluetooth device in "Windows Devices" and it pairs without issue. Thanks!


System.PlatformNotSupportedException: 32feet.NET does not support the Bluetooth stack on this device. ---> System.Net.Sockets.SocketException: An address incompatible with the requested protocol was used\r\n at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)\r\n at InTheHand.Net.Bluetooth.Msft.SocketBluetoothClient.CreateSocket()\r\n at InTheHand.Net.Bluetooth.Msft.SocketBluetoothClient..ctor(BluetoothFactory fcty)\r\n --- End of inner exception stack trace ---\r\n at InTheHand.Net.Bluetooth.Msft.SocketBluetoothClient..ctor(BluetoothFactory fcty)\r\n at InTheHand.Net.Bluetooth.SocketsBluetoothFactory.GetBluetoothClient()\r\n at InTheHand.Net.Bluetooth.Factory.BluetoothFactory.DoGetBluetoothClient()\r\n at InTheHand.Net.Sockets.BluetoothClient..ctor(BluetoothFactory factory)\r\n at InTheHand.Net.Sockets.BluetoothClient..ctor()\r\n at Tts.Evise.Windows.Entity.CommunicationManager.GetEViseList() in d:\\TFS\\E-Vise\\Windows\\Branch
es\\LMReport\\Windows\\Entity\\CommunicationManager.cs:line 457\r\n at Tts.Evise.Windows.MainForm.<>c__DisplayClass1e.<>c__DisplayClass20.<ShowPortSearchingScreen>b__1a() in d:\\TFS\\E-Vise\\Windows\\Branches\\LMReport\\Windows\\MainForm.cs:line 2923\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"
Comments: ** Comment from web user: hagelt18 **

I had issues with this for quite some time before figuring it out. The solution is to install generic Microsoft Bluetooth drivers instead of whatever you currently have. So you'd start by uninstalling your current Bluetooth drivers in Device Manager, then go to this link to download generic Microsoft Bluetooth drivers. I've had the best luck so far with the installer from this site:

http://bluetoothinstaller.com/

I've attached the x86 version of the file from that site to this post

Commented Unassigned: 32feet.NET does not support the Bluetooth stack on this device. [43236]

$
0
0
I have a .NET 4.0 C# project running on Windows 10. This project has worked for the last two years, and when I tried to run it to make some enhancements, I'm getting the following error when trying to create a new BluetoothClient(). Since this used to work, is this a Windows 10 issue? I can see my bluetooth device in "Windows Devices" and it pairs without issue. Thanks!


System.PlatformNotSupportedException: 32feet.NET does not support the Bluetooth stack on this device. ---> System.Net.Sockets.SocketException: An address incompatible with the requested protocol was used\r\n at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)\r\n at InTheHand.Net.Bluetooth.Msft.SocketBluetoothClient.CreateSocket()\r\n at InTheHand.Net.Bluetooth.Msft.SocketBluetoothClient..ctor(BluetoothFactory fcty)\r\n --- End of inner exception stack trace ---\r\n at InTheHand.Net.Bluetooth.Msft.SocketBluetoothClient..ctor(BluetoothFactory fcty)\r\n at InTheHand.Net.Bluetooth.SocketsBluetoothFactory.GetBluetoothClient()\r\n at InTheHand.Net.Bluetooth.Factory.BluetoothFactory.DoGetBluetoothClient()\r\n at InTheHand.Net.Sockets.BluetoothClient..ctor(BluetoothFactory factory)\r\n at InTheHand.Net.Sockets.BluetoothClient..ctor()\r\n at Tts.Evise.Windows.Entity.CommunicationManager.GetEViseList() in d:\\TFS\\E-Vise\\Windows\\Branch
es\\LMReport\\Windows\\Entity\\CommunicationManager.cs:line 457\r\n at Tts.Evise.Windows.MainForm.<>c__DisplayClass1e.<>c__DisplayClass20.<ShowPortSearchingScreen>b__1a() in d:\\TFS\\E-Vise\\Windows\\Branches\\LMReport\\Windows\\MainForm.cs:line 2923\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"
Comments: ** Comment from web user: hagelt18 **

Here is the x64 installer related to my first reply. I haven't had to use it yet though. Even on 64-bit systems I have been running the x86 installer.


New Post: Dual SPP device - out of range on one device stops data flow from second

$
0
0
This is essentially our problem - one device is blocking all communication. In our case, it blocks for ~20 seconds, which is the connection timeout and then resumes.

We are looking for some way to prevent this scenario, as our customers can handle losing one device but not both. Is this an OS issue? We normally do not see this issue when we open the connection using a virtual serial port (no 32feet), although we have seen some instances of this behavior on Windows 8.1.

Created Unassigned: Does not work on MC3200 / MC32N0 [43300]

$
0
0
I have been using this library successfully on the Motorola MC3190 for some time, but they stopped selling them and are now selling their latest MC3200 (MC32N0) which runs Windows Embedded Compact 7.

When I use the 32feet.Net samples, I can't get the MC3200 to function as a client. I can get the MC3200 to function as a server and some other device (ie. My PC) as the client. But when I try using the MC3200 as the client and my PC as the server, it does not work. This all works fine on the MC3190. The only difference between the sample code builds is the target platform and some UI sizing adjustments.

I'm using the BluetoothSdp sample and currently when I test, I get error code 10060:

_"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."_

New Post: Dual SPP device - out of range on one device stops data flow from second

$
0
0
At the moment it appears that modifying the async read method to only ever read in Available bytes prevents the data break. It might be related to having pending read operations on stalling ports triggers the issue in the Windows 7.

New Post: 32feet bluetooth application not run 64 bit

$
0
0
32feet bluetooth application not working on 64 bit OS and on 32 bit OS its working fine.please give me a solution how to resolve it.

New Post: 32feet bluetooth application not run 64 bit

$
0
0
32feet bluetooth application not working on 64 bit OS and on 32 bit OS its working fine.please give me a solution how to resolve it.

New Post: After Windows 8.1 upgrade, Msft.WindowsBluetoothListener.Start() fails at serverSocket.Bind(serverEP)

New Post: 32feet library application doesn't work on Windows XP, why?

$
0
0
I've written an application using 32feet library. It works on Windows 7,8,10. I can find my device, connect to it, send and receive data, but the application doesn't work on Windows XP. It can't find any bluetooth devices. I need to get it working on XP.

What could be the reasons for that? Does somebody knows?

New Post: Error: An address incompatible with the requested protocol was used

$
0
0
Using version 3.5 of the library on Windows 10 x64, I get a SocketException with the error "An address incompatible with the requested protocol was used" when calling the BluetoothListener (Guid) constructor. The application works fine on Windows 8.1 x32, so I am unsure if the problem relates to Windows 10 or the fact that we're now using x64 Windows.

Here's the stack trace, the final line of code is the call from our application.

System.Net.Sockets.SocketException (0x80004005): An address incompatible with the requested protocol was used
at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
at InTheHand.Net.Bluetooth.Msft.WindowsBluetoothListener.CreateSocket()
at InTheHand.Net.Bluetooth.Msft.WindowsBluetoothListener.Construct(Guid service)
at BluetoothBridge.ListenerThread.Initialise(XmlNode nodeConfig)

Has anyone else experienced this problem?

Thanks in anticipation!

Chris Wilcock

New Post: JustWorks connecting

$
0
0
I need to connect to a device that uses a PAN1026 Bluetooth module without having to deal with a pin code or link key.

I can do this on an Android device using Bluetooth SPP Pro.

I already have a C# program running 32feet.NET that pairs and connects and exchanges data just fine.

However, when I disconnect and try to reconnect I cannot. I have to remove my device first.
I think this is because my PAN1026 device does not store link keys. It also does not have a keyboard.

So could I use Just Works connecting?

Basically want to do on a PC what SPP Pro does on an Android.

New Post: Help Im Struggling

$
0
0
I have to do a barcode scanner wedge program but the scanners i need to interface to have a weird way of working.
  1. Create a bluetooth incoming comm port
  2. open new port
  3. scan a pairing barcode
  4. enter pin
  5. device creates 2 more com ports, incoming and outgoing
Now the problem is I am trying to get stage 1 working using the code
    private string GetBTMacAddress()  
    {
        return br.LocalAddress.Nap.ToString("X") +br.LocalAddress.Sap.ToString("X");
    }

    private void startCommunication()
    {
    BluetoothAddress addr = BluetoothAddress.Parse( GetBTMacAddress());
    BluetoothDeviceInfo device = new BluetoothDeviceInfo(addr);
    bool state = true;

        device.SetServiceState(BluetoothService.SerialPort, state, true);            
But i get a NULL Exception on the above line.

Any clues and any one know of a good demo which will show the funcions I need.

joolz

New Comment on "BluetoothWin32Authentication"

$
0
0
Alan, Auto pairing is not working in windows 10, it shows "Tap to set up the device" toast notification, I tried setting BluetoothWin32AuthenticationEventArgs's confirm=True, still the device is not paired properly unless the user tap on the toast notification. Is there a way to bypass the Toast notification? Thanks in adv.. Sebastian

New Post: Write and Read data in one connection

$
0
0
I'm trying to create a desktop application that can connet by bluetooth to an arduino device.
Arduino device connected by HC-06 bluetooth by serial connections TR/RX.
My desktop application can connect to it, but now, I'm trying to send command to Arduino device and then I have to wait a response.
How can I do that?
After write message, Ardunio receipt correctly and send on its TX connection its response, but desktop application side is disconnected, why? how can I do this?
Viewing all 469 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>