From 797dcf6d10c317f482b0600947c5df5f7d0d5732 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 1 Apr 2016 16:51:17 +0200 Subject: [PATCH] docu: get rid of remote_device_db --- doc/manual/btstack_gettingstarted.tex | 2 +- doc/manual/docs/examples/intro.md | 5 ++--- doc/manual/docs/porting.md | 19 +++++++++---------- .../example/hid_demo.c | 7 ++++--- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/doc/manual/btstack_gettingstarted.tex b/doc/manual/btstack_gettingstarted.tex index ab2c2511b..d994d7b44 100644 --- a/doc/manual/btstack_gettingstarted.tex +++ b/doc/manual/btstack_gettingstarted.tex @@ -61,7 +61,7 @@ identifierstyle=\color{black}, stringstyle=\color{blue}, morekeywords={*, btstack_timer_source_t, btstack_data_source_t, uint32_t, uint16_t, uint8_t, btstack_run_loop_TYPE, le_command_status_t, gatt_client_t, gatt_client_characteristic_t, gatt_client_service_t, gatt_client_characteristic_descriptor_t, service_record_item_t, bd_addr_t, btstack_packet_handler_t, - hci_cmd_t, btstack_control_t, remote_device_db_t, link_key_t, device_name_t, hci_transport_t, hci_uart_config_t, sdp_query_event_t, + hci_cmd_t, btstack_control_t, btstack_link_key_db_t, link_key_t, device_name_t, hci_transport_t, hci_uart_config_t, sdp_query_event_t, sdp_query_complete_event_t, sdp_client_query_rfcomm_service_event_t, sdp_parser_event_t, sdp_parser_event_type_t, sdp_parser_attribute_value_event_t, sdp_parser_complete_event_t, advertising_report_t, gc_state_t, le_service_event_t, le_characteristic_event_t} diff --git a/doc/manual/docs/examples/intro.md b/doc/manual/docs/examples/intro.md index d246e471f..250c67d96 100644 --- a/doc/manual/docs/examples/intro.md +++ b/doc/manual/docs/examples/intro.md @@ -25,9 +25,8 @@ embedded system with a Bluetooth chipset connected via UART. hci_dump_open(NULL, HCI_DUMP_STDOUT); // init HCI - hci_transport_t * transport = hci_transport_h4_instance(); - remote_device_db_t * remote_db = (remote_device_db_t *) &remote_device_db_memory; - hci_init(transport, NULL, NULL, remote_db); + hci_transport_t * transport = hci_transport_h4_instance(); + hci_init(transport, NULL); // setup example btstack_main(argc, argv); diff --git a/doc/manual/docs/porting.md b/doc/manual/docs/porting.md index d616c6c0d..859d6aa93 100644 --- a/doc/manual/docs/porting.md +++ b/doc/manual/docs/porting.md @@ -137,14 +137,18 @@ callback for CTS interrupts. void hal_uart_dma_set_sleep(uint8_t sleep); -## Persistent Storage API {#sec:persistentStoragePorting} +## Persistent Storage APIs {#sec:persistentStoragePorting} On embedded systems there is no generic way to persist data like link keys or remote device names, as every type of a device has its own capabilities, particularities and limitations. The persistent storage -API provides an interface to implement concrete drivers for a particular -system. As an example and for testing purposes, BTstack provides the -memory-only implementation *remote_device_db_memory*. An +APIs provides an interface to implement concrete drivers for a particular +system. + +### Link Key DB + +As an example and for testing purposes, BTstack provides the +memory-only implementation *btstack_link_key_db_memory*. An implementation has to conform to the interface in Listing [below](#lst:persistentDB). ~~~~ {#lst:persistentDB .c caption="{Persistent storage interface.}"} @@ -158,10 +162,5 @@ implementation has to conform to the interface in Listing [below](#lst:persisten int (*get_link_key)(bd_addr_t bd_addr, link_key_t link_key); void (*put_link_key)(bd_addr_t bd_addr, link_key_t key); void (*delete_link_key)(bd_addr_t bd_addr); - - // remote name - int (*get_name)(bd_addr_t bd_addr, device_name_t *device_name); - void(*put_name)(bd_addr_t bd_addr, device_name_t *device_name); - void(*delete_name)(bd_addr_t bd_addr); - } remote_device_db_t; + } btstack_link_key_db_t; ~~~~ diff --git a/port/msp-exp430f5438-cc2564b/example/hid_demo.c b/port/msp-exp430f5438-cc2564b/example/hid_demo.c index 824d6b428..1a3019ee5 100644 --- a/port/msp-exp430f5438-cc2564b/example/hid_demo.c +++ b/port/msp-exp430f5438-cc2564b/example/hid_demo.c @@ -59,7 +59,8 @@ #include "btstack_memory.h" #include "hci.h" #include "l2cap.h" - +#include "btstack_link_key_db_memory,h" + #define INQUIRY_INTERVAL 15 #define FONT_HEIGHT 12 // Each character has 13 lines @@ -378,8 +379,8 @@ int main(void){ // init HCI const hci_transport_t * transport = hci_transport_h4_instance(); - remote_device_db_t * link_key_db = (remote_device_db_t *) &remote_device_db_memory; - hci_init(transport, &config, link_key_db); + btstack_link_key_db_t * link_key_db = btstack_link_key_db_memory_instance(); + hci_init(transport, &config); hci_set_link_key_db(link_key_db); hci_set_chipset(btstack_chipset_cc256x_instance());