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
  • 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.


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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cableWifi customer support or tech support 8 63
WAP requirements 5 57
Cisco 1830 AP behaving wierdly 7 72
vibration sensors: piezoelectric to wireless 9 44
This article is a step by step guide on how to create a basic PTP link using Ubiquiti airOS devices. This guide can be used on the following Ubiquiti AirMAX devices. Nanostation, Bullets, AirBridge, Nanobeam, NanoBridge to name a few. Please review …
This subject  of securing wireless devices conjures up visions of your PC or mobile phone connecting to the Internet through some hotspot at Starbucks. But it is so much more than that. Let’s look at the facts: devices#sthash.eoFY7dic.
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now