main.c (2fca4dad957cd7b88f4657ed51e89c12615dda72) main.c (15d217585718297f89c661a103c7d1222a0ab1b0)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 74 unchanged lines hidden (view full) ---

83static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
84 if (packet_type != HCI_EVENT_PACKET) return;
85 if (hci_event_packet_get_type(packet) != BTSTACK_EVENT_STATE) return;
86 switch (btstack_event_state_get_state(packet)){
87 case HCI_STATE_WORKING:
88 gap_local_bd_addr(local_addr);
89 printf("BTstack up and running on %s.\n", bd_addr_to_str(local_addr));
90 strcpy(tlv_db_path, TLV_DB_PATH_PREFIX);
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 74 unchanged lines hidden (view full) ---

83static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
84 if (packet_type != HCI_EVENT_PACKET) return;
85 if (hci_event_packet_get_type(packet) != BTSTACK_EVENT_STATE) return;
86 switch (btstack_event_state_get_state(packet)){
87 case HCI_STATE_WORKING:
88 gap_local_bd_addr(local_addr);
89 printf("BTstack up and running on %s.\n", bd_addr_to_str(local_addr));
90 strcpy(tlv_db_path, TLV_DB_PATH_PREFIX);
91 strcat(tlv_db_path, bd_addr_to_str(local_addr));
91 strcat(tlv_db_path, bd_addr_to_str_with_delimiter(static_address, '-'));
92 strcat(tlv_db_path, TLV_DB_PATH_POSTFIX);
93 tlv_impl = btstack_tlv_posix_init_instance(&tlv_context, tlv_db_path);
94 btstack_tlv_set_instance(tlv_impl, &tlv_context);
95#ifdef ENABLE_CLASSIC
96 hci_set_link_key_db(btstack_link_key_db_tlv_get_instance(tlv_impl, &tlv_context));
97#endif
98#ifdef ENABLE_BLE
99 le_device_db_tlv_configure(tlv_impl, &tlv_context);

--- 66 unchanged lines hidden ---
92 strcat(tlv_db_path, TLV_DB_PATH_POSTFIX);
93 tlv_impl = btstack_tlv_posix_init_instance(&tlv_context, tlv_db_path);
94 btstack_tlv_set_instance(tlv_impl, &tlv_context);
95#ifdef ENABLE_CLASSIC
96 hci_set_link_key_db(btstack_link_key_db_tlv_get_instance(tlv_impl, &tlv_context));
97#endif
98#ifdef ENABLE_BLE
99 le_device_db_tlv_configure(tlv_impl, &tlv_context);

--- 66 unchanged lines hidden ---