extract minimal gap_le.h

This commit is contained in:
matthias.ringwald@gmail.com 2014-01-05 20:13:37 +00:00
parent cb0c1216da
commit 6ae23ab165
4 changed files with 55 additions and 15 deletions

View File

@ -59,6 +59,7 @@
#include "sm.h"
#include "att.h"
#include "gap_le.h"
#include "central_device_db.h"

52
example/libusb/gap_le.h Normal file
View File

@ -0,0 +1,52 @@
/*
* Copyright (C) 2011-2012 BlueKitchen GmbH
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holders nor the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* 4. Any redistribution, use, or modification is done solely for
* personal benefit and not for any commercial purpose or for
* monetary gain.
*
* THIS SOFTWARE IS PROVIDED BY MATTHIAS RINGWALD AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS
* RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Please inquire about commercial licensing options at contact@bluekitchen-gmbh.com
*
*/
#pragma once
// address type
typedef enum {
GAP_RANDOM_ADDRESS_TYPE_OFF = 0,
GAP_RANDOM_ADDRESS_NON_RESOLVABLE,
GAP_RANDOM_ADDRESS_RESOLVABLE,
} gap_random_address_type_t;
//
// GAP LE API
//
void gap_random_address_set_mode(gap_random_address_type_t random_address_type);
void gap_random_address_set_update_period(int period_ms);

View File

@ -34,7 +34,6 @@
*
*/
#include "sm.h"
#include <stdio.h>
#include <strings.h>
@ -42,6 +41,8 @@
#include "hci.h"
#include "l2cap.h"
#include "central_device_db.h"
#include "sm.h"
#include "gap_le.h"
//
// SM internal types and globals

View File

@ -106,13 +106,6 @@ typedef enum {
// also, invalid parameters
// and reserved
// address type
typedef enum {
GAP_RANDOM_ADDRESS_TYPE_OFF = 0,
GAP_RANDOM_ADDRESS_NON_RESOLVABLE,
GAP_RANDOM_ADDRESS_RESOLVABLE,
} gap_random_address_type_t;
// Security Manager Events
typedef struct sm_event_bonding {
uint8_t type; // see <btstack/hci_cmds.h> SM_...
@ -143,13 +136,6 @@ void sm_set_request_security(int enable);
// Support for signed writes
int sm_cmac_ready();
void sm_cmac_start(sm_key_t k, uint16_t message_len, uint8_t * message, void (*done_handler)(uint8_t hash[8]));
//
// GAP LE API
//
void gap_random_address_set_mode(gap_random_address_type_t random_address_type);
void gap_random_address_set_update_period(int period_ms);
#if defined __cplusplus
}
#endif