Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3982372
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:31:13+00:00 2026-05-20T05:31:13+00:00

I am working on establishing a Bluetooth Piconet among multiple devices in a testbed.

  • 0

I am working on establishing a Bluetooth Piconet among multiple devices in a testbed. The topology of this network is known to all devices.

The devices in the testbed are Ubuntu Desktop PCs and Android (Eclair) devices. Now, I’m looking at a way of establishing a master slave relationship among these devices in a deterministic way. Specifically, I’m looking for a way to establish an android device as master and open multiple connections with 7 other devices.

I have looked at native implementations using the bluez stack and the NDK, but the bluez stack implementation on my device (Samsung GT 15503) does not conform to the standards I guess and even normal apps like hcitool, hciconfig don’t work.

Therefore, I tried using the official SDK and even succeeded in establishing an RFCOMM socket with my laptop (Using the bluetooth chat sample app as a reference). But I’m stuck at the point where I try connecting two or more devices using the same BluetoothServerSocket. Unless I close the original socket, I can’t seem to open new connections.

Any suggestions in this regard are greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:31:13+00:00Added an answer on May 20, 2026 at 5:31 am

    I finally figured out what I was doing wrong. Apparently, whenever you call the accept method from a BluetoothServerSocket and get back a socket, you have to close this socket before calling accept again.

    I worked around this problem to establish the piconet I wanted by creating 7 different UUIDs and using a BluetoothServerSocket to listen and accept a connection for each of these UUIDs. Once I get a connection for a particular UUID, I close the corresponding server socket and reopen another one for the next UUID.

    The following snippet illustrates the idea, which I got from BTClickLinkCompete.

    for (int i = 0; i < 7; i++) {
                    BluetoothServerSocket myServerSocket = mBtAdapter
                            .listenUsingRfcommWithServiceRecord(srcApp, mUuid.get(i));
                    BluetoothSocket myBSock = myServerSocket.accept();
                    myServerSocket.close(); // Close the socket now that the connection
                    //has been made
                    //Do stuff with the socket here, like callback to main thread
    }
    

    Here, mUuid is an array that stores 7 different uuids. The clients trying to connect to the server will also possess these uuids and will try them out one by one in order because they do not know the number of clients already connected to the server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a mobile communicator and after establishing connection to the server
Working with MySQL lately, from PHP, I am wondering about this: What is the
Working on Ubuntu 10.04 Lucid webserver (linode). Followed these instructions to install wkhtmltopdf link
Working with MVC 2 ad with the help of some friends I thought all
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
Working with a SqlCommand in C# I've created a query that contains a IN
Working on a project at the moment and we have to implement soft deletion
Working on a somewhat complex page for configuring customers at work. The setup is
Working on a project that parses a log of events, and then updates a
Working with python interactively, it's sometimes necessary to display a result which is some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.