Starting Bluetooth Programming in C++

Posted on 2002-07-18
Last Modified: 2013-12-14

I have bought the ericsson bluetooth application tool kit and was going to do a simple program on data transmittion.
I have diffculties on starting the programming for the bluetooth. There seems to be many protocols and API involved and i am confused on which to start with.
I try some functions like HCI_ReqStart to start the commmunication to the HCI but when complie it gives alot of errors.

Can anyone guide me on which to start, SCM, HCI or RFCOMM to talk to the bluetooth device. How to start on it?

Question by:PsychoMantis
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2

Expert Comment

ID: 7163975

I havent worked with bluetooth application tool kit but in general you use HCI commands to talk to the BT device

you basically have to initialise the BT device, look for the correct APIs that does this then read the BD address to make sure that you have communication between BT device and your host. then you can do the rest has more information , might be a good starting point


Author Comment

ID: 7163984
Yup i have visited the website that you recommanded. You said that HCI commands are used to talk to the BT device, but i was asking one how to set them talking because the SCM, HCI and RFCOMM provides some ways to talk to the bluetooth device also.

Expert Comment

ID: 7164049
Ok , I am not sure about what is your setup there, what are you using as HOST / develeopment enviorenment.

since you are using BT kit

|RFCOMM        |

|L2CAP         |  This is on the host

| HCI          |

|Serial device |

| HCI on BT KIT|

| and rest of the|
|BT Layers       |

Here i am assuming it is serial RS232 but it can be anythink.

if you see the Bluetooth specification for HCI, you will find what are the HCI command you should give for each setup , there are HCI commands for setting up RFCOMM but you will have to follow a sequence

Since you are using APIs i assume you dont need to go this low , may be you might have an API to initialise the BT KIT that will do all the low level initialisation then you might have an other API for setting up RFCOMM that will do all the relaven think,

If you are interested in all the communication that happens for RFCOMM setup you should read the BT Core specifiaction and you can also have a look at Bluez and opensource stack BT stack for linux.

As for Erricson APIs I am not familiar with it
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.


Author Comment

ID: 7164074
My first step is to develop a program to send and receive data between the two BT devices. Yup, i am using the serial RS232.By the way i am doing for windows platform communication, the programming part should be quite the same with linux except the kernal right..?

Hmm... so if i have an API then all i need to do is to focus on either the HCI and the L2CAP layers is it?


Accepted Solution

kugan earned 50 total points
ID: 7164136
probably you will have to look for APIs like
1) Initialise the BT device
2) Put one device inquirable and pagable mode
3) Do Bt inquary from one device and find the other device
3) Service discovery Need not be done ( If you are sure about the service on the other device)
4) Setup an Rfcomm connection between

once you have an rfcomm channel it will be like having two PC connected with serial cable , you can send data

Probably when you start now dont worry about SDP , Pairing etc.

Author Comment

ID: 7164205
Hmm.. ok i think i will look into the BT API (tried hundred times, but errors keep coming...).

By the way just asking, have you done a program on BT?

Expert Comment

ID: 7164229
I did in linux with openBT and CSR BC01, but an year back

Expert Comment

ID: 7164231
I did in linux with openBT and CSR BC01, but an year back

May be you should post the error msg you are getting

Author Comment

ID: 7164270
Hmm.. found out that the error message are some variable declarations faults. I'll work it out, thanks :).
Hmmm seems late guess its time for you to turn in...

Really thanks for the help :)

Author Comment

ID: 7164284
-Testing the time-

Expert Comment

ID: 12963261

I'm so glad that I saw your post regarding this Ericsson BT kit.  I'm actually doing my final year project on this device.  Till now, I still haven't an idea how to get it to work.  I mean writing my own program in C++ to actually do a inquiry scan.  Have you manage to get the source codes?  What kind of API are you using? Ericsson API ? Is it possible to give me your email so we could keep in touch? thanx :)

Expert Comment

ID: 13038146
nobody replying ???

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Cisco Access point 6 105
Radius Debug Error 16 113
Highly placed Cisco Access Points in a warehouse - performance near walls. 3 48
Cisco WLC 5508 2 27
Coaxial cable bending There are several factors that govern the selection of coaxial cable for your Machine to Machine (M2M) application: the location of cable runs, either indoor or outdoor, inside or outside an enclosure, maximum bending and the…
Multi-source agreements are important because they set standards that all manufacturers should follow to ensure that devices are compatible with multiple vendors. The multi-source agreement (MSA) is an agreement that establishes how multiple vendors…
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question