BLE reason codes


Johannes Hutter
 

Hello Zephyr community,


if the connection between a BLE peripheral running Zephyr and a central device is lost, the "disconnected" callback is fired that passes the "reason code". I can't find any definitions of those disconnect reasons in the included bluetooth headers, but as I understand it they are part of the HCI error codes. Is there a reason not all of the possible error codes are defined in hci.h?


Thanks and best regards,

Johannes

--

Johannes Hutter | Embedded Software Engineer
Mail: johannes@...


Workaround GmbH (ProGlove)
Friedenstr. 4 | 81671 München

Managing Director: Thomas Kirchner
HRB: 216605 | AG München
USt.-IdNr.: DE298859320


Carles Cufi
 

Hi Johannes,

 

Here they are:

 

https://github.com/zephyrproject-rtos/zephyr/blob/master/include/bluetooth/hci.h#L93

 

You can find the rest in the Bluetooth Specification, Vol 2. Part D.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of Johannes Hutter
Sent: 22 February 2018 10:32
To: zephyr-users@...
Subject: [Zephyr-users] BLE reason codes

 

Hello Zephyr community,

 

if the connection between a BLE peripheral running Zephyr and a central device is lost, the "disconnected" callback is fired that passes the "reason code". I can't find any definitions of those disconnect reasons in the included bluetooth headers, but as I understand it they are part of the HCI error codes. Is there a reason not all of the possible error codes are defined in hci.h?

 

Thanks and best regards,

Johannes

--

Johannes Hutter | Embedded Software Engineer
Mail: johannes@...

Workaround GmbH (ProGlove)
Friedenstr. 4 | 81671 München

Managing Director: Thomas Kirchner
HRB: 216605 | AG München
USt.-IdNr.: DE298859320

 


Johannes Hutter
 

Hey Carles,

my question is whether there is a reason why not all of them are defined. Especially all the connection related errors (0x08: Connection Timeout, 0x0B Connection Already Exists etc.) are not defined but they are helpful if I want to change the application behavior based on the disconnection raeson.

Best regards,
Johannes


On 22.02.2018 10:35, Cufi, Carles wrote:

Hi Johannes,

 

Here they are:

 

https://github.com/zephyrproject-rtos/zephyr/blob/master/include/bluetooth/hci.h#L93

 

You can find the rest in the Bluetooth Specification, Vol 2. Part D.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of Johannes Hutter
Sent: 22 February 2018 10:32
To: zephyr-users@...
Subject: [Zephyr-users] BLE reason codes

 

Hello Zephyr community,

 

if the connection between a BLE peripheral running Zephyr and a central device is lost, the "disconnected" callback is fired that passes the "reason code". I can't find any definitions of those disconnect reasons in the included bluetooth headers, but as I understand it they are part of the HCI error codes. Is there a reason not all of the possible error codes are defined in hci.h?

 

Thanks and best regards,

Johannes

--

Johannes Hutter | Embedded Software Engineer
Mail: johannes@...

Workaround GmbH (ProGlove)
Friedenstr. 4 | 81671 München

Managing Director: Thomas Kirchner
HRB: 216605 | AG München
USt.-IdNr.: DE298859320


 


Carles Cufi
 

Hi Johannes,

 

Right, I see. No particular reason, feel free to send a pull request with the missing ones (at least the ones relevant to BLE).

 

Regards,

 

Carles

 

From: Johannes Hutter [mailto:johannes@...]
Sent: 22 February 2018 11:05
To: Cufi, Carles <Carles.Cufi@...>; zephyr-users@...
Subject: Re: [Zephyr-users] BLE reason codes

 

Hey Carles,

my question is whether there is a reason why not all of them are defined. Especially all the connection related errors (0x08: Connection Timeout, 0x0B Connection Already Exists etc.) are not defined but they are helpful if I want to change the application behavior based on the disconnection raeson.

Best regards,
Johannes

On 22.02.2018 10:35, Cufi, Carles wrote:

Hi Johannes,

 

Here they are:

 

https://github.com/zephyrproject-rtos/zephyr/blob/master/include/bluetooth/hci.h#L93

 

You can find the rest in the Bluetooth Specification, Vol 2. Part D.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of Johannes Hutter
Sent: 22 February 2018 10:32
To: zephyr-users@...
Subject: [Zephyr-users] BLE reason codes

 

Hello Zephyr community,

 

if the connection between a BLE peripheral running Zephyr and a central device is lost, the "disconnected" callback is fired that passes the "reason code". I can't find any definitions of those disconnect reasons in the included bluetooth headers, but as I understand it they are part of the HCI error codes. Is there a reason not all of the possible error codes are defined in hci.h?

 

Thanks and best regards,

Johannes

--

Johannes Hutter | Embedded Software Engineer
Mail: johannes@...

Workaround GmbH (ProGlove)
Friedenstr. 4 | 81671 München

Managing Director: Thomas Kirchner
HRB: 216605 | AG München
USt.-IdNr.: DE298859320