2009-10-29 20:25:42 +00:00
|
|
|
/*
|
2015-02-06 16:19:27 +00:00
|
|
|
* Copyright (C) 2014 BlueKitchen GmbH
|
2009-10-29 20:25:42 +00:00
|
|
|
*
|
|
|
|
* 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.
|
2012-05-07 21:54:09 +00:00
|
|
|
* 4. Any redistribution, use, or modification is done solely for
|
|
|
|
* personal benefit and not for any commercial purpose or for
|
|
|
|
* monetary gain.
|
2009-10-29 20:25:42 +00:00
|
|
|
*
|
2015-02-06 16:19:27 +00:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
|
2009-10-29 20:25:42 +00:00
|
|
|
* ``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.
|
|
|
|
*
|
2015-02-06 16:19:27 +00:00
|
|
|
* Please inquire about commercial licensing options at
|
|
|
|
* contact@bluekitchen-gmbh.com
|
2012-05-07 21:54:09 +00:00
|
|
|
*
|
2009-10-29 20:25:42 +00:00
|
|
|
*/
|
|
|
|
|
2009-05-19 21:49:12 +00:00
|
|
|
/*
|
2016-01-22 17:16:06 +01:00
|
|
|
* btstack_control.h
|
2009-05-19 21:49:12 +00:00
|
|
|
*
|
2016-01-22 17:16:06 +01:00
|
|
|
* BTstack Bluetooth Hardware Control API -- allows HCI to manage Bluetooth chipsets via direct hardware controls
|
2009-05-19 21:49:12 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-05-11 19:08:52 +02:00
|
|
|
#ifndef BTSTACK_CONTROL_H
|
|
|
|
#define BTSTACK_CONTROL_H
|
2009-05-20 20:46:35 +00:00
|
|
|
|
2010-08-05 20:04:03 +00:00
|
|
|
#include <stdint.h>
|
2016-01-20 16:10:07 +01:00
|
|
|
#include "btstack_util.h"
|
2010-08-05 20:04:03 +00:00
|
|
|
|
2013-05-23 14:57:16 +00:00
|
|
|
#if defined __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-01-08 22:12:03 +00:00
|
|
|
typedef enum {
|
|
|
|
POWER_WILL_SLEEP = 1,
|
|
|
|
POWER_WILL_WAKE_UP
|
|
|
|
} POWER_NOTIFICATION_t;
|
|
|
|
|
2009-05-19 21:49:12 +00:00
|
|
|
typedef struct {
|
2016-01-22 17:44:04 +01:00
|
|
|
void (*init) (const void *config);
|
|
|
|
int (*on) (void); // <-- turn BT module on and configure
|
|
|
|
int (*off) (void); // <-- turn BT module off
|
|
|
|
int (*sleep)(void); // <-- put BT module to sleep - only to be called after ON
|
|
|
|
int (*wake) (void); // <-- wake BT module from sleep - only to be called after SLEEP
|
|
|
|
void (*register_for_power_notifications)(void (*cb)(POWER_NOTIFICATION_t event));
|
2016-01-22 17:16:06 +01:00
|
|
|
} btstack_control_t;
|
2013-05-23 14:57:16 +00:00
|
|
|
|
|
|
|
#if defined __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2014-01-19 16:30:17 +00:00
|
|
|
|
2019-05-11 19:08:52 +02:00
|
|
|
#endif // BTSTACK_CONTROL_H
|