From the 32feet.NET documentation:
Quote:
Bluetooth applications/services are identified and registered by UUID (Universally Unique Id), a 128-bit value that is represented by the System.Guid class in .NET. If one is creating a new service then a new UUID should be created at design time and entered into the two applications’ source code, a new value can be created either by calling Guid.NewValue or using the guidgen.exe Windows SDK program — in Visual Studio access it with menu item Tools, “Create GUID”.
Finally a maybe stupid question:
Have you also started a client instance on another device using the same UUID?
If not, the server will of course wait indefinitly for a connection.
[EDIT Answering a question posted as solution]
Quote:
this is all of my code. how do i get the uuid? and how do i start the client instance when the server isn´t ready?
To generate an UUID follow the advices from the quote (execute the
guidgen.exe tool and copy and paste the UUID or use
Guid.NewGuid Method (System)[
^])
The server is ready when starting the application as server. It just waits for a connection.
AcceptBluetoothClient
is a blocking call. That means the call will not return until a connection has been established or an error occured. Therefore, it is called from within it's own thread.
Then start the software as client on another system (
rbClient.Checked
must be
true
). It should then connect (or at least try) to connect to the server. I have not tried to understand what all the code is doing. And it seems you have neither.
Bluetooth is a serial radio protocol. As far as I know it does not support being client and server on a single system (as most serial protocols / interfaces like IrDA, USB, RS-232 without using some kind of loopback hardware). So you have to start two (or more) instances of your application on two different systems (or using two Bluetooth devices connected to one system): One server and one or more clients.
[/EDIT]