From f90fa293e137796d3b80c4a1d7b24b7f4f160981 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 21 May 2015 15:54:06 +0200 Subject: [PATCH] ANCS mostly working on Arduino --- platforms/arduino/btstack-config.h | 10 +++++----- platforms/arduino/examples/ANCS/ANCS.ino | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/platforms/arduino/btstack-config.h b/platforms/arduino/btstack-config.h index 3b18e060a..e1aaa9000 100644 --- a/platforms/arduino/btstack-config.h +++ b/platforms/arduino/btstack-config.h @@ -8,15 +8,15 @@ #define HAVE_BLE -// #define HAVE_HCI_DUMP -// #define ENABLE_LOG_INFO -// #define ENABLE_LOG_ERROR +#define HAVE_HCI_DUMP +#define ENABLE_LOG_INFO +#define ENABLE_LOG_ERROR -#define HCI_ACL_PAYLOAD_SIZE 52 +#define HCI_ACL_PAYLOAD_SIZE 200 #define MAX_NO_BNEP_SERVICES 0 #define MAX_NO_BNEP_CHANNELS 0 -#define MAX_NO_GATT_SUBCLIENTS 1 +#define MAX_NO_GATT_SUBCLIENTS 2 #define MAX_NO_HCI_CONNECTIONS 1 #define MAX_NO_L2CAP_SERVICES 0 #define MAX_NO_L2CAP_CHANNELS 0 diff --git a/platforms/arduino/examples/ANCS/ANCS.ino b/platforms/arduino/examples/ANCS/ANCS.ino index 0953cfd32..8e054e33d 100644 --- a/platforms/arduino/examples/ANCS/ANCS.ino +++ b/platforms/arduino/examples/ANCS/ANCS.ino @@ -64,24 +64,24 @@ void ancs_callback(ancs_event_t * event){ } void setup(void){ + setup_printf(); - printf("Main::Setup()\n"); + + printf("BTstack ANCS Client starting up...\n"); + + // startup BTstack and configure log_info/log_error BTstack.setup(); - BTstack.setAdvData(sizeof(adv_data), adv_data); - BTstack.startAdvertising(); sm_set_io_capabilities(IO_CAPABILITY_DISPLAY_ONLY); sm_set_authentication_requirements( SM_AUTHREQ_BONDING ); - // set up GATT Server - att_set_db(NULL); - - // setup GATT client - gatt_client_init(); - // setup ANCS Client ancs_client_init(); ancs_client_register_callback(&ancs_callback); + + // enable advertisements + BTstack.setAdvData(sizeof(adv_data), adv_data); + BTstack.startAdvertising(); } void loop(void){