From f8c0ff6413e9a096a9b64f8ac9dcf6776a44fc4d Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Sun, 14 May 2017 18:28:49 +0200 Subject: [PATCH] nrf5/drivers/bluetooth: Adding role member to peripheral object to indicate whether Peripheral object is Peripheral or Central role. --- nrf5/modules/ubluepy/modubluepy.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/nrf5/modules/ubluepy/modubluepy.h b/nrf5/modules/ubluepy/modubluepy.h index aa5e6a7ffa..c7778d3c3d 100644 --- a/nrf5/modules/ubluepy/modubluepy.h +++ b/nrf5/modules/ubluepy/modubluepy.h @@ -101,6 +101,11 @@ typedef enum { #endif } ubluepy_addr_type_t; +typedef enum { + UBLUEPY_ROLE_PERIPHERAL, + UBLUEPY_ROLE_CENTRAL +} ubluepy_role_type_t; + typedef struct _ubluepy_uuid_obj_t { mp_obj_base_t base; ubluepy_uuid_type_t type; @@ -109,12 +114,13 @@ typedef struct _ubluepy_uuid_obj_t { } ubluepy_uuid_obj_t; typedef struct _ubluepy_peripheral_obj_t { - mp_obj_base_t base; - uint16_t conn_handle; - mp_obj_t delegate; - mp_obj_t notif_handler; - mp_obj_t conn_handler; - mp_obj_t service_list; + mp_obj_base_t base; + ubluepy_role_type_t role; + uint16_t conn_handle; + mp_obj_t delegate; + mp_obj_t notif_handler; + mp_obj_t conn_handler; + mp_obj_t service_list; } ubluepy_peripheral_obj_t; typedef struct _ubluepy_service_obj_t {