From 8b21ee762ef9bd7ef5c03bb040881421eb6d3d88 Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Wed, 15 Feb 2017 00:17:04 +0100 Subject: [PATCH] nrf5/modules: Adding new object struct for delegate class and adding a delegate struct member to Peripheral class to bookeep callback object when event occurs. --- nrf5/modules/ubluepy/modubluepy.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nrf5/modules/ubluepy/modubluepy.h b/nrf5/modules/ubluepy/modubluepy.h index 1fae9b0a69..7754bc6918 100644 --- a/nrf5/modules/ubluepy/modubluepy.h +++ b/nrf5/modules/ubluepy/modubluepy.h @@ -86,12 +86,22 @@ typedef struct _ubluepy_characteristic_obj_t { uint16_t sccd_handle; } ubluepy_characteristic_obj_t; +typedef struct _ubluepy_delegate_obj_t { + mp_obj_base_t base; +} ubluepy_delegate_obj_t; + +typedef struct _ubluepy_peripheral_obj_t { + mp_obj_base_t base; + mp_obj_t delegate; +} ubluepy_peripheral_obj_t; + typedef struct _ubluepy_advertise_data_t { uint8_t * p_device_name; uint8_t device_name_len; mp_obj_t * p_services; uint8_t num_of_services; - } ubluepy_advertise_data_t; + + #endif // UBLUEPY_H__