mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 04:20:20 +00:00
ANCS mostly working on Arduino
This commit is contained in:
parent
f243b7dfe2
commit
f90fa293e1
@ -8,15 +8,15 @@
|
|||||||
|
|
||||||
#define HAVE_BLE
|
#define HAVE_BLE
|
||||||
|
|
||||||
// #define HAVE_HCI_DUMP
|
#define HAVE_HCI_DUMP
|
||||||
// #define ENABLE_LOG_INFO
|
#define ENABLE_LOG_INFO
|
||||||
// #define ENABLE_LOG_ERROR
|
#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_SERVICES 0
|
||||||
#define MAX_NO_BNEP_CHANNELS 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_HCI_CONNECTIONS 1
|
||||||
#define MAX_NO_L2CAP_SERVICES 0
|
#define MAX_NO_L2CAP_SERVICES 0
|
||||||
#define MAX_NO_L2CAP_CHANNELS 0
|
#define MAX_NO_L2CAP_CHANNELS 0
|
||||||
|
@ -64,24 +64,24 @@ void ancs_callback(ancs_event_t * event){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setup(void){
|
void setup(void){
|
||||||
|
|
||||||
setup_printf();
|
setup_printf();
|
||||||
printf("Main::Setup()\n");
|
|
||||||
|
printf("BTstack ANCS Client starting up...\n");
|
||||||
|
|
||||||
|
// startup BTstack and configure log_info/log_error
|
||||||
BTstack.setup();
|
BTstack.setup();
|
||||||
BTstack.setAdvData(sizeof(adv_data), adv_data);
|
|
||||||
BTstack.startAdvertising();
|
|
||||||
|
|
||||||
sm_set_io_capabilities(IO_CAPABILITY_DISPLAY_ONLY);
|
sm_set_io_capabilities(IO_CAPABILITY_DISPLAY_ONLY);
|
||||||
sm_set_authentication_requirements( SM_AUTHREQ_BONDING );
|
sm_set_authentication_requirements( SM_AUTHREQ_BONDING );
|
||||||
|
|
||||||
// set up GATT Server
|
|
||||||
att_set_db(NULL);
|
|
||||||
|
|
||||||
// setup GATT client
|
|
||||||
gatt_client_init();
|
|
||||||
|
|
||||||
// setup ANCS Client
|
// setup ANCS Client
|
||||||
ancs_client_init();
|
ancs_client_init();
|
||||||
ancs_client_register_callback(&ancs_callback);
|
ancs_client_register_callback(&ancs_callback);
|
||||||
|
|
||||||
|
// enable advertisements
|
||||||
|
BTstack.setAdvData(sizeof(adv_data), adv_data);
|
||||||
|
BTstack.startAdvertising();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop(void){
|
void loop(void){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user