BlueZ which layer get reason of Bluetooth disconnection - bluetooth

I am using BlueZ stack for Bluetooth connection between Smart-phone(AG-Audio Gateway) and Embedded board(HF-Handsfree).
On which layer of Bluez ( HCI, L2CAP, RFCOMM) we will get reason of Bluetooth disconnection. So we can differentiate following type of disconnection:
Smart-Phone SIMPLE DISCONNECT, but phone is still have HF Embedded device in its paired list.
Smart-Phone FORGET HF device during bluetooth connection.
Disconnection because HF device went out of Smart-Phone bluetooth Range

HCI: Disconnection Complete Event, check the Reason byte.

Related

What is bluez "bluetoothctl scan on" (StartDiscovery) doing that "hcitool lescan" is not

I see its adding a file to /var/lib/bluetooth/hci MAC/cache/ for each discovered device with its name as the address. Documentation says its creating device objects. Where and what are they, virtual dbus objects? ( ex: /dev_F8:41:1B:6B:95:2A). I know the device is removed after 3 minutes if not connected. And what else is it doing to make a device available for connecting with the bluez dbus interface. Thanks.
Bluetoothctl uses the Bluez DBus apis to do everything it does. When you do 'scan on' in bluetoothctl, it will call the StartDiscovery method of the Adapter object. Internally the Dbus will use the HCI interface to start a lescan. Once advertisement come in, Bluez will create objects for them on the Dbus and will send an InterfaceAdded or PropertiesChanged signals on the Dbus. Your application can listen to those signals which contain the address of the objects they are about.

What's the difference between Jackdaw and KillerBee on RZ Raven USB Stick

What is the difference between Jackdaw and KillerBee on ZigBee USB Stick, both seem to be sniffing packet, but Jackdaw can act as a network interface, and KillerBee is only used for pentest? As far as I understand it, you can't use either to connect to like a hub or Wireless router, but only to ZigBee based devices, which would be the IoT devices such as sensors or smart socket etc.
Thank you

To communicate between two bluetooth devices is pairing between them is necessary?

In general, two communicate between bluetooth devices, first we perform a bluetooth pairing between two devices and then starts further communication between them.
My problem scenario is simply to transfer a hello packet from one bluetooth device to another bluetooth device.
For this i am planning to use sockets programming technique i.e. RFCOMM sockets.
I got some help about this from http://people.csail.mit.edu/albert/bluez-intro/x502.html
So, my query is do we require bluetooth pairing between two devices before initiating communication with RFCOMM socket connection.
Or does 48 bits device address is only necessary to transfer some data packet from one bluetooth device to other and bluetooth pairing could be avoided.
No, it is not.
Bluetooth device can be in one of the four modes:
Broadcaster
Observer
Peripheral
Central
In broadcaster mode device can only send advertisement messages. This includes name and HwID.
In Observer mode device can only receive advertisement messages.
Peripheral = Broadcaster + can take in connect requests
Central = Observer + can send out connect requests.
If you have an application which does not want to connect use first two modes above.
Please let me know if this addresses your question.

HID Connection to a remote device without SDP record

To connect a HID profile to a mouse/keyboard, HID_CONTROL and HID_INTERUPT channel with psm 17 and 19 needs to be connected. We find information using SDP record for the HID and then we establish a L2CAP connection to connect on the channels.
Is there any utility in bluez which can help me in connecting a input device. My keybaord/mouse does not support SDP record so when i use dbus signals(connect to a input device), it fails.
Are there any libraries provided within bluez with which i can connect to a device using BD_ADDR and PSM numbers without quering for device via SDP
Its possible using HIDD utility available, though hidd utility also does SDP and then connects, i tweeked the code with removing of code for SDP search, after that it did connect on control and interrupt channels. As my peer device was capable of PSM 17 and 19, it did accepted HID connection

No audio through the bluetooth headset

When i am connecting my phone to any handsfree device , the Voice is
not coming to the hands free device, when call is accepted using
handset/hands free.
The headset was paired and connected to the handset. Then accepted a
call. The voise was not coming in headset.
When i extracted the airlog i could find that the downlink( headset to
handset) is working fine.
But the uplink (phone to headset) is not sending the data over the sco
link.
Please anyone tell me the reason of this. When i checked the logs i
could see that the sco connection establishment was all proper.

Resources