Refer to my question in Android Bluetooth Piconet Broadcast data
I know that android question regarding to piconet is already answered. Now i've done some research regarding to bluetooth broadcasting piconet with J2ME.
I want to ask some question regarding Piconet in J2ME:
Is it possible with bluetooth J2ME API to broadcast data that was sent by one slave and the data will be received to all (master and slave) in the piconet? If it is possible, how does it works? It goes to the master first and then gives to all slave, or slave directly one by one contact another slave?
Where can i find the resource regarding to bluetooth broadcasting with J2ME? (i still have problem when i googled it)
FYI, im using both master and slave using J2ME mobile phone not computer.
Thank you :D. Really appreciate your help :D
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'm developing an IoT application. There is a microcontroller which controls the sensors. Smartphones connect them and perform some actions. I want smartphones to connect multiple devices and control them and in the meantime I dont want internet access of the smartphones to disconnect. What I want to ask is which wireless protocol would be good for this job. Should I use WiFi, Bluetooth, Wifi-Direct or anything else ?
Actually, according to my searches, "WiFi-Direct" seems good option to me, but I wanted ask to you whether it is a good options or not. In addition, please state which specific module can be used such as "HC-06" "ESP8266" and why? while stating which protocol is good for me. Thanks in advance :)
It's a hard question. Answer is depends on many aspects:
What range do you want you sensors support (how far they should stay connected)?
How many sensors do you want to support?
How your sensors are powered up (power line or battery)?
What smartphones do you want to support?
How much data and how frequently they send?
And other...
Let me cover these topics a little more:
Range
This is the easiest one. Bluetooth (depending on class, usually it's II) have a range about 10m (30ft). Wi-Fi (and Wi-Fi Direct which is almost the same) have range about 30m (100ft). So if all your sensors located on a user's body (like wearables) or at the desk (like mice, keyboard) then Bluetooth is fine. If devices are spread over larger area (like temp-sensors in each room), then Wi-Fi based protocol is better.
Number of devices
This is also quite easy. Bluetooth is capable of connecting not more than 8 devices. One of them is master and up to 7 slave devices. Wi-Fi can handle theoretically up to 255 devices, but in practice it's less (due to interference). Usually if you have more then 20-25 devices you need another access point.
Power
If your devices are connected to a power-line (like smart wall sockets or smart light bulbs) then they easily be connected using Wi-Fi. But if it's a button-cell battery then it better be Bluetooth Low Energy (BLE) (a.k.a Bluetooth Smart or Bluetooth 4.0). However there are examples where TV remote control running on 2 AAA batteries uses Wi-Fi Direct.
Smartphones support
Android can do anything, but iPhone is a headache. It does not support Wi-Fi Direct, it does support Bluetooth, but only limited number of BT profiles. If you need to support other BT profiles you need to participate in Apple MFi program and got a license and certification from Apple. Another option is to use Bluetooth Smart technology (BLE). More information about Apple restrictions are here and in the FAQ.
I won't advice about concrete chip-sets, because there are so much choices on a market, also I don't know your budget. However you can try to look at well know brands like Broadcom, Texas Instruments, Marvell and etc. - they provide a chip-sets for any choice and gust.
If you need to support iPhone and all other requirements (range, amount of sensors, etc.) are OK with Bluetooth, I would recommend to use Bluetooth Smart (BLE) as a simplest choice.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am interested in Bluetooth 4.0. Where to start adventure with it? If you have any materials, links, books I'll be very grateful. If you could share this knowledge. I would to use BT 4.0 to connect a PC (no matter what system) with a smart phone (eg. Windows Phone).
Right, I tried to quickly put together some relevant information that might help you. There is a big chance I have missed thing because this is a broad topic.
I am pretty sure you will find help here when you will have more specific questions.
Basically when it comes to Bluetooth (Smart, 4.0) devices and programming / connecting to them we can talk about two things:
Bluetooh Clients and Servers
Servers:
usually provide some data to clients. Think about a Heart rate monitor that captures someones heartrate and "stream" it so anyone who connects to the server will be able to read the data.
Clients:
On the other hand clients connect to servers (how obvious) to collect their data, or in some cases to write to them.
Bluetooth Profiles
Bluetooth devices (servers) have so called GATT (generic attribute) Profiles. These profiles describe a kind of unique set of Services. Each Service has different Characteristics. These characteristics hold the actual values.
Think about a Heart rate monitor (HRM). Thats a server. It measures heart rate so clients that connect to it can read / collect it's data. Heart rate monitors have a specific Heart rate monitor GATT profile which describes services and inside the services there are the heart rate specific characteristics like: heart rate measurement, body sensor location, etc.
When a client wants to read these values it has to connect to the HRM, discover it's services and characteristics, then read the values from the discovered characteristics.
Async
It might be obvious but Bluetooth programming (implementing server / client connection and data transfer) is async. It means the client sends something then waits till the server answers then can the it progress to the next step.
Your whole software has to be implemented keeping async programming design in mind.
Documentation
I have to say I found the iOS documentation and support very useful when I developed my first bluetooth app.Android was somewhat more difficult for me because of the lack of examples I found. Also general bluetooth 4.0 support only became available since Android 4.3. (different bluetooth chip manufacturers in different Android phones had different low level bluetooth stack so to use them one had to write native bluetooth code for each different chip with their own SDK - prior to Android 4.3)
Bluetooth.org
I would suggest to start with this:
https://developer.bluetooth.org/DevelopmentResources/Pages/Quick-Start-Kit.aspx
https://developer.bluetooth.org/TechnologyOverview/Pages/Technology-Overview.aspx
https://developer.bluetooth.org/DevelopmentResources/Pages/default.aspx
https://developer.bluetooth.org/gatt/Pages/default.aspx
iOS
It won't hurt if you read about Core-bluetooth framework, which is the iOS approach even if you don't plan to develop on iOS. Since it is well documented it might give you a better overall understanding:
https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/AboutCoreBluetooth/Introduction.html
Android
Same for android:
http://developer.android.com/guide/topics/connectivity/bluetooth-le.html
Windows 8
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207007%28v=vs.105%29.aspx
I've found "Bluetooth Low Energy: The Developer's Handbook" by Robin Heydon very useful. It deals with all the little details so you can understand how things are working on the lower level.
As a reference, I've found the Bluetooth specification PDF very useful (though it's sometimes hard to find what you need). It looks like they just released a 4.1 version here: https://www.bluetooth.org/en-us/specification/adopted-specifications
EDIT: both references aren't specific to any particular implementation, so I'm not sure how much they'd help if you wanted to learn something specific like iOS BLE or Android BLE.
In my previous question posted in how to communicate with mobile devices using bluetooth in j2me have asked question based on bluetooth. I got i some ideas for implementing client server communication. Now i am here to ask question based on communication between piconet to another piconet. Is it possible? Master device has to communicate with the slave in a piconet as well as to the master and slave to another piconet by slave of its own piconet.
Can anyone please give me some guideline and articles for my problem.
please help me..
Thankx in advance
In Bluetooth, the master initiates communications with a slave. At the baseband level the master polls the slave. However, at the application (API) level, that is abstracted away allowing both the master to send to the slave and the slave to send to the master.
The situation you describe is a scatternet. The Bluetooth specification allows for a scatternet to occur. The Bluetooth stack you are using may impose restrictions on whether a scatternet is allowed and, more generally, what master/slave configurations are allowed (e.g., the number of concurrent slaves allowed).
You'll find that, when interacting with some devices, a role switch is requested to prevent scatternets. For example, a remote device (master) may initiate a connection with a cell phone (slave); once the connection is established, the cell phone requests a role switch, becoming the master. This allows the phone to remain the master in all connections and prevents scatternets from forming. Depending on the API, this role switch may be completely transparent to your application. You won't know it happened without an air trace from a protocol analyzer. You will notice a performance hit, as the slave cannot transmit as often as the master can (since the slave does not "drive" the connection).
JSR-82 does not allow you to request a role switch, per se. If you look at ServiceRecord.getConnectionURL(int, boolean), you see that you can require that your device be the master (by passing true) or you can allow master or slave mode (by passing false).
The Bluetooth specification (available here) is a good place to start to understand how piconets and scatternets work. You should refer to the JSR-82 documentation and, if possible, your stack's documentation to get a better feel for some of the stack-specific limitations that may be present.
I am wondering if two Bluetooth masters can be connected to each other.
I think it is not possible because there should be only one master in each piconet.
Anyways, here is one scenario.
Suppose that there are two smart phones, each one is using bluetooth headset or connected to some device, thus both phones are working as masters.
Now, one smart phone wants to send files via bluetooth to the other smart phone.
In this case, is it possible that the phones are connected?
If they support role switch, one may be switched to a slave.
But in this case, I think the already established connections would be broken because they will lose the master.
If I want to send files from one master to another master, how can I do this?
Is it possible or impossible??
Bluetooth can support the capability called "Scatternet" which basically allows the devices to be part of multiple piconet (typically I have seen 2-3 piconets)
With this a device can be a master in one piconet and slave in another or slave in 2 piconets, ect.
So the scenario you mentioned is possible if one of the phone can support scatternet.
Is it possible to implement Bluetooth devices to provide conference rather than one-to-one operation.
Are there any development toolkits that will allow me to configure BT devices in this way, or modifications that can be done to the BT stack or an add-on protocol.
I need to configure several Bluetooth adaptors to simultaneously communicate with one another. I think BT allows up to 10 'pico-nets' but I need specialiced advice.
I would welcome any links to resources, or replies from Bluetooth experts.
Thanks in anticipation.
I've heard of something close to this, called a piconet. Googling "bluetooth piconet" should point you in the right direction.
A master device can be networked in this way with up to 255 slave devices, but only 7 can be active at any one time. This is more of a one-to-many communication than many-to-many, but could potentially be approximated by having the master device act like a network switch.
Update: I just read that slaves in one piconet can participate in another piconet as either a master or slave, forming a "scatternet".