Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE Central and BLE Peripheral roles at a moment on nRF52832 #4046

Closed
zephyrbot opened this issue Sep 19, 2017 · 2 comments
Closed

BLE Central and BLE Peripheral roles at a moment on nRF52832 #4046

zephyrbot opened this issue Sep 19, 2017 · 2 comments
Assignees
Labels
area: Bluetooth Enhancement Changes/Updates/Additions to existing features

Comments

@zephyrbot
Copy link
Collaborator

zephyrbot commented Sep 19, 2017

Reported by Thanh Do:

Hi,

I have an application with BLE on Nordic nRF52832 with BLE Central and Peripheral at a moment.

  • The config:
    CONFIG_BT=y
    CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_DEBUG_MONITOR=n
    CONFIG_BT_SMP=n
    CONFIG_BT_CENTRAL=y
    CONFIG_BT_GATT_CLIENT=y
    CONFIG_BT_MAX_CONN=32
    CONFIG_BT_DEVICE_NAME="perph_name"
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_CONN=y

  • The application is working fine but I have a question.
    How to determine the connection which is connected to Central or Peripheral roles?
    Because when an another device connect to my device, both Central and Peripheral Connected Callback is actived.

(Imported from Jira ZEP-2622)

@zephyrbot
Copy link
Collaborator Author

by Johan Hedberg:

I don't think Jira is the right place for questions (you should use the mailing list or IRC instead), however let me give you a quick answer anyway: you can use the bt_conn_get_info() API for this. The role member of the info struct will be BT_CONN_ROLE_MASTER when Zephyr is central and BT_CONN_ROLE_SLAVE when Zephyr is peripheral.

@zephyrbot
Copy link
Collaborator Author

by Thanh Do:

Many thanks Johan.

@zephyrbot zephyrbot added area: Bluetooth Enhancement Changes/Updates/Additions to existing features task labels Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

2 participants