[BEETLE] Update BLE Cordio libraries

This patch updates the BLE Cordio libraries.

Signed-off-by: Marc Moreno <marc.morenoberengue@arm.com>
pull/3046/head
Marc Moreno Berengue 2016-10-17 15:03:14 +01:00
parent a3eacfd8d1
commit e7829cd617
62 changed files with 1921 additions and 1286 deletions

View File

@ -77,8 +77,13 @@ ble_error_t ArmGap::startAdvertising(const GapAdvertisingParams &params)
return BLE_ERROR_PARAM_OUT_OF_RANGE;
}
/* Peer Addr Type 0 = Public */
uint8_t peerAddrType = 0;
uint8_t peerAddr[6];
memset(peerAddr, 0, 6);
DmAdvSetInterval(params.getInterval(), params.getInterval());
DmAdvStart(params.getAdvertisingType(), params.getTimeout());
DmAdvStart(params.getAdvertisingType(), params.getTimeout(), peerAddrType, peerAddr);
state.advertising = 1;

View File

@ -4,19 +4,16 @@
*
* \brief Board-specific include file for BT4 module board.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2015-2016 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/

View File

@ -4,19 +4,16 @@
*
* \brief Board services.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2015 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/

View File

@ -4,19 +4,16 @@
*
* \brief Include file for SMD TC2.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2015-2016 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/

View File

@ -4,19 +4,16 @@
*
* \brief Low-level chip defines for SMD TC2.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2015 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/

View File

@ -4,19 +4,16 @@
*
* \brief BLE initialization.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2015 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/

View File

@ -7,19 +7,16 @@
* $Date: 2015-09-28 16:07:14 -0400 (Mon, 28 Sep 2015) $
* $Revision: 4037 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2013 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/

View File

@ -7,19 +7,16 @@
* $Date: 2015-10-22 18:45:26 -0400 (Thu, 22 Oct 2015) $
* $Revision: 4273 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2015 ARM, Ltd., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
@ -31,7 +28,7 @@ extern "C" {
#endif
/*! \brief Cordio SDK version string. */
#define CORDIO_SDK_VERSION "20151023-r4279"
#define CORDIO_SDK_VERSION "20160509-r7043"
/*! \brief Cordio SDK major version. */
#define CORDIO_SDK_VERSION_MAJOR 1

View File

@ -4,19 +4,16 @@
*
* \brief Upper-layer UART driver.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2015 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/

View File

@ -4,19 +4,16 @@
*
* \brief LLCC driver.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2015 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/

View File

@ -4,19 +4,16 @@
*
* \brief UART driver.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2015 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/

View File

@ -4,22 +4,19 @@
*
* \brief HCI core platform-specific interfaces for dual-chip.
*
* $Date: 2015-06-12 07:19:18 -0400 (Fri, 12 Jun 2015) $
* $Date: 2015-06-12 04:19:18 -0700 (Fri, 12 Jun 2015) $
* $Revision: 3061 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2013 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef HCI_CORE_PS_H

View File

@ -4,22 +4,19 @@
*
* \brief HCI core interfaces.
*
* $Date: 2015-06-12 07:19:18 -0400 (Fri, 12 Jun 2015) $
* $Revision: 3061 $
* $Date: 2016-03-29 11:20:44 -0700 (Tue, 29 Mar 2016) $
* $Revision: 6512 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef HCI_CORE_H
@ -73,6 +70,7 @@ typedef struct
uint8_t numCmdPkts; /* Controller command packed count */
uint8_t leSupFeat; /* Controller LE supported features */
int8_t advTxPwr; /* Controller advertising TX power */
uint8_t resListSize; /* Controller resolving list size */
} hciCoreCb_t;
/**************************************************************************************************
@ -85,6 +83,12 @@ extern hciCoreCb_t hciCoreCb;
/* LE event mask */
extern const uint8_t hciLeEventMask[HCI_LE_EVT_MASK_LEN];
/* Event mask page 2 */
extern const uint8_t hciEventMaskPage2[HCI_EVT_MASK_LEN];
/* LE supported features configuration mask */
extern uint8_t hciLeSupFeatCfg;
/**************************************************************************************************
Function Declarations
**************************************************************************************************/

View File

@ -4,22 +4,19 @@
*
* \brief HCI driver interface.
*
* $Date: 2013-01-03 01:19:17 -0500 (Thu, 03 Jan 2013) $
* $Date: 2013-01-02 22:19:17 -0800 (Wed, 02 Jan 2013) $
* $Revision: 405 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2012 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef HCI_DRV_H

View File

@ -4,22 +4,19 @@
*
* \brief HCI transport interface.
*
* $Date: 2015-06-12 07:19:18 -0400 (Fri, 12 Jun 2015) $
* $Date: 2015-06-12 04:19:18 -0700 (Fri, 12 Jun 2015) $
* $Revision: 3061 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef HCI_TR_H

View File

@ -5,20 +5,20 @@
* \brief HPAL BLEP initialization.
*
* \internal
* __LICENSE__
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2015 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
* \endinternal
*
* __USAGE NOTE__

View File

@ -5,20 +5,17 @@
* \brief HPAL HCI abstraction.
*
* \internal
* Copyright (c) 2015 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
*
* \endinternal
*/

View File

@ -0,0 +1,576 @@
/*************************************************************************************************/
/*!
* \file hci_defs.h
*
* \brief HCI constants and definitions from the Bluetooth specification.
*
* $Date: 2016-04-18 22:05:04 -0700 (Mon, 18 Apr 2016) $
* $Revision: 6857 $
*
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef HCI_DEFS_H
#define HCI_DEFS_H
#ifdef __cplusplus
extern "C" {
#endif
/*! Packet definitions */
#define HCI_CMD_HDR_LEN 3 /*! Command packet header length */
#define HCI_ACL_HDR_LEN 4 /*! ACL packet header length */
#define HCI_EVT_HDR_LEN 2 /*! Event packet header length */
#define HCI_EVT_PARAM_MAX_LEN 255 /*! Maximum length of event packet parameters */
#define HCI_ACL_DEFAULT_LEN 27 /*! Default maximum ACL packet length */
#define HCI_PB_FLAG_MASK 0x3000 /*! ACL packet boundary flag mask */
#define HCI_PB_START_H2C 0x0000 /*! Packet boundary flag, start, host-to-controller */
#define HCI_PB_CONTINUE 0x1000 /*! Packet boundary flag, continue */
#define HCI_PB_START_C2H 0x2000 /*! Packet boundary flag, start, controller-to-host */
#define HCI_HANDLE_MASK 0x0FFF /*! Mask for handle bits in ACL packet */
#define HCI_HANDLE_NONE 0xFFFF /*! Value for invalid handle */
/*! Packet types */
#define HCI_CMD_TYPE 1 /*! HCI command packet */
#define HCI_ACL_TYPE 2 /*! HCI ACL data packet */
#define HCI_EVT_TYPE 4 /*! HCI event packet */
/*! Error codes */
#define HCI_SUCCESS 0x00 /*! Success */
#define HCI_ERR_UNKNOWN_CMD 0x01 /*! Unknown HCI command */
#define HCI_ERR_UNKNOWN_HANDLE 0x02 /*! Unknown connection identifier */
#define HCI_ERR_HARDWARE_FAILURE 0x03 /*! Hardware failure */
#define HCI_ERR_PAGE_TIMEOUT 0x04 /*! Page timeout */
#define HCI_ERR_AUTH_FAILURE 0x05 /*! Authentication failure */
#define HCI_ERR_KEY_MISSING 0x06 /*! PIN or key missing */
#define HCI_ERR_MEMORY_EXCEEDED 0x07 /*! Memory capacity exceeded */
#define HCI_ERR_CONN_TIMEOUT 0x08 /*! Connection timeout */
#define HCI_ERR_CONN_LIMIT 0x09 /*! Connection limit exceeded */
#define HCI_ERR_SYNCH_CONN_LIMIT 0x0A /*! Synchronous connection limit exceeded */
#define HCI_ERR_ACL_CONN_EXISTS 0x0B /*! ACL connection already exists */
#define HCI_ERR_CMD_DISALLOWED 0x0C /*! Command disallowed */
#define HCI_ERR_REJ_RESOURCES 0x0D /*! Connection rejected limited resources */
#define HCI_ERR_REJ_SECURITY 0x0E /*! Connection rejected security reasons */
#define HCI_ERR_REJ_BD_ADDR 0x0F /*! Connection rejected unacceptable BD_ADDR */
#define HCI_ERR_ACCEPT_TIMEOUT 0x10 /*! Connection accept timeout exceeded */
#define HCI_ERR_UNSUP_FEAT 0x11 /*! Unsupported feature or parameter value */
#define HCI_ERR_INVALID_PARAM 0x12 /*! Invalid HCI command parameters */
#define HCI_ERR_REMOTE_TERMINATED 0x13 /*! Remote user terminated connection */
#define HCI_ERR_REMOTE_RESOURCES 0x14 /*! Remote device low resources */
#define HCI_ERR_REMOTE_POWER_OFF 0x15 /*! Remote device power off */
#define HCI_ERR_LOCAL_TERMINATED 0x16 /*! Connection terminated by local host */
#define HCI_ERR_REPEATED_ATTEMPTS 0x17 /*! Repeated attempts */
#define HCI_ERR_PAIRING_NOT_ALLOWED 0x18 /*! Pairing not allowed */
#define HCI_ERR_UNKNOWN_LMP_PDU 0x19 /*! Unknown LMP PDU */
#define HCI_ERR_UNSUP_REMOTE_FEAT 0x1A /*! Unsupported remote feature */
#define HCI_ERR_SCO_OFFSET 0x1B /*! SCO offset rejected */
#define HCI_ERR_SCO_INTERVAL 0x1C /*! SCO interval rejected */
#define HCI_ERR_SCO_MODE 0x1D /*! SCO air mode rejected */
#define HCI_ERR_LMP_PARAM 0x1E /*! Invalid LMP parameters */
#define HCI_ERR_UNSPECIFIED 0x1F /*! Unspecified error */
#define HCI_ERR_UNSUP_LMP_PARAM 0x20 /*! Unsupported LMP parameter value */
#define HCI_ERR_ROLE_CHANGE 0x21 /*! Role change not allowed */
#define HCI_ERR_LL_RESP_TIMEOUT 0x22 /*! LL response timeout */
#define HCI_ERR_LMP_COLLISION 0x23 /*! LMP error transaction collision */
#define HCI_ERR_LMP_PDU 0x24 /*! LMP pdu not allowed */
#define HCI_ERR_ENCRYPT_MODE 0x25 /*! Encryption mode not acceptable */
#define HCI_ERR_LINK_KEY 0x26 /*! Link key can not be changed */
#define HCI_ERR_UNSUP_QOS 0x27 /*! Requested qos not supported */
#define HCI_ERR_INSTANT_PASSED 0x28 /*! Instant passed */
#define HCI_ERR_UNSUP_UNIT_KEY 0x29 /*! Pairing with unit key not supported */
#define HCI_ERR_TRANSACT_COLLISION 0x2A /*! Different transaction collision */
#define HCI_ERR_CHANNEL_CLASS 0x2E /*! Channel classification not supported */
#define HCI_ERR_MEMORY 0x2F /*! Insufficient security */
#define HCI_ERR_PARAMETER_RANGE 0x30 /*! Parameter out of mandatory range */
#define HCI_ERR_ROLE_SWITCH_PEND 0x32 /*! Role switch pending */
#define HCI_ERR_RESERVED_SLOT 0x34 /*! Reserved slot violation */
#define HCI_ERR_ROLE_SWITCH 0x35 /*! Role switch failed */
#define HCI_ERR_INQ_TOO_LARGE 0x36 /*! Extended inquiry response too large */
#define HCI_ERR_UNSUP_SSP 0x37 /*! Secure simple pairing not supported by host */
#define HCI_ERR_HOST_BUSY_PAIRING 0x38 /*! Host busy - pairing */
#define HCI_ERR_NO_CHANNEL 0x39 /*! Connection rejected no suitable channel */
#define HCI_ERR_CONTROLLER_BUSY 0x3A /*! Controller busy */
#define HCI_ERR_CONN_INTERVAL 0x3B /*! Unacceptable connection interval */
#define HCI_ERR_ADV_TIMEOUT 0x3C /*! Directed advertising timeout */
#define HCI_ERR_MIC_FAILURE 0x3D /*! Connection terminated due to MIC failure */
#define HCI_ERR_CONN_FAIL 0x3E /*! Connection failed to be established */
#define HCI_ERR_MAC_CONN_FAIL 0x3F /*! MAC connection failed */
/*! Command groups */
#define HCI_OGF_NOP 0x00 /*! No operation */
#define HCI_OGF_LINK_CONTROL 0x01 /*! Link control */
#define HCI_OGF_LINK_POLICY 0x02 /*! Link policy */
#define HCI_OGF_CONTROLLER 0x03 /*! Controller and baseband */
#define HCI_OGF_INFORMATIONAL 0x04 /*! Informational parameters */
#define HCI_OGF_STATUS 0x05 /*! Status parameters */
#define HCI_OGF_TESTING 0x06 /*! Testing */
#define HCI_OGF_LE_CONTROLLER 0x08 /*! LE controller */
#define HCI_OGF_VENDOR_SPEC 0x3F /*! Vendor specific */
/*! NOP command */
#define HCI_OCF_NOP 0x00
/*! Link control commands */
#define HCI_OCF_DISCONNECT 0x06
#define HCI_OCF_READ_REMOTE_VER_INFO 0x1D
/*! Link policy commands (none used for LE) */
/*! Controller and baseband commands */
#define HCI_OCF_SET_EVENT_MASK 0x01
#define HCI_OCF_RESET 0x03
#define HCI_OCF_READ_TX_PWR_LVL 0x2D
#define HCI_OCF_SET_CONTROLLER_TO_HOST_FC 0x31
#define HCI_OCF_HOST_BUFFER_SIZE 0x33
#define HCI_OCF_HOST_NUM_CMPL_PKTS 0x35
#define HCI_OCF_SET_EVENT_MASK_PAGE2 0x63
#define HCI_OCF_READ_AUTH_PAYLOAD_TO 0x7B
#define HCI_OCF_WRITE_AUTH_PAYLOAD_TO 0x7C
/*! Informational commands */
#define HCI_OCF_READ_LOCAL_VER_INFO 0x01
#define HCI_OCF_READ_LOCAL_SUP_CMDS 0x02
#define HCI_OCF_READ_LOCAL_SUP_FEAT 0x03
#define HCI_OCF_READ_BUF_SIZE 0x05
#define HCI_OCF_READ_BD_ADDR 0x09
/*! Status commands */
#define HCI_OCF_READ_RSSI 0x05
/*! LE controller commands */
#define HCI_OCF_LE_SET_EVENT_MASK 0x01
#define HCI_OCF_LE_READ_BUF_SIZE 0x02
#define HCI_OCF_LE_READ_LOCAL_SUP_FEAT 0x03
#define HCI_OCF_LE_SET_RAND_ADDR 0x05
#define HCI_OCF_LE_SET_ADV_PARAM 0x06
#define HCI_OCF_LE_READ_ADV_TX_POWER 0x07
#define HCI_OCF_LE_SET_ADV_DATA 0x08
#define HCI_OCF_LE_SET_SCAN_RESP_DATA 0x09
#define HCI_OCF_LE_SET_ADV_ENABLE 0x0A
#define HCI_OCF_LE_SET_SCAN_PARAM 0x0B
#define HCI_OCF_LE_SET_SCAN_ENABLE 0x0C
#define HCI_OCF_LE_CREATE_CONN 0x0D
#define HCI_OCF_LE_CREATE_CONN_CANCEL 0x0E
#define HCI_OCF_LE_READ_WHITE_LIST_SIZE 0x0F
#define HCI_OCF_LE_CLEAR_WHITE_LIST 0x10
#define HCI_OCF_LE_ADD_DEV_WHITE_LIST 0x11
#define HCI_OCF_LE_REMOVE_DEV_WHITE_LIST 0x12
#define HCI_OCF_LE_CONN_UPDATE 0x13
#define HCI_OCF_LE_SET_HOST_CHAN_CLASS 0x14
#define HCI_OCF_LE_READ_CHAN_MAP 0x15
#define HCI_OCF_LE_READ_REMOTE_FEAT 0x16
#define HCI_OCF_LE_ENCRYPT 0x17
#define HCI_OCF_LE_RAND 0x18
#define HCI_OCF_LE_START_ENCRYPTION 0x19
#define HCI_OCF_LE_LTK_REQ_REPL 0x1A
#define HCI_OCF_LE_LTK_REQ_NEG_REPL 0x1B
#define HCI_OCF_LE_READ_SUP_STATES 0x1C
#define HCI_OCF_LE_RECEIVER_TEST 0x1D
#define HCI_OCF_LE_TRANSMITTER_TEST 0x1E
#define HCI_OCF_LE_TEST_END 0x1F
/* New in version 4.1 */
#define HCI_OCF_LE_REM_CONN_PARAM_REP 0x20
#define HCI_OCF_LE_REM_CONN_PARAM_NEG_REP 0x21
/* New in version 4.2 */
#define HCI_OCF_LE_SET_DATA_LEN 0x22
#define HCI_OCF_LE_READ_DEF_DATA_LEN 0x23
#define HCI_OCF_LE_WRITE_DEF_DATA_LEN 0x24
#define HCI_OCF_LE_READ_LOCAL_P256_PUB_KEY 0x25
#define HCI_OCF_LE_GENERATE_DHKEY 0x26
#define HCI_OCF_LE_ADD_DEV_RES_LIST 0x27
#define HCI_OCF_LE_REMOVE_DEV_RES_LIST 0x28
#define HCI_OCF_LE_CLEAR_RES_LIST 0x29
#define HCI_OCF_LE_READ_RES_LIST_SIZE 0x2A
#define HCI_OCF_LE_READ_PEER_RES_ADDR 0x2B
#define HCI_OCF_LE_READ_LOCAL_RES_ADDR 0x2C
#define HCI_OCF_LE_SET_ADDR_RES_ENABLE 0x2D
#define HCI_OCF_LE_SET_RES_PRIV_ADDR_TO 0x2E
#define HCI_OCF_LE_READ_MAX_DATA_LEN 0x2F
/*! Opcode manipulation macros */
#define HCI_OPCODE(ogf, ocf) (((ogf) << 10) + (ocf))
#define HCI_OGF(opcode) ((opcode) >> 10)
#define HCI_OCF(opcode) ((opcode) & 0x03FF)
/*! Command opcodes */
#define HCI_OPCODE_NOP HCI_OPCODE(HCI_OGF_NOP, HCI_OCF_NOP)
#define HCI_OPCODE_DISCONNECT HCI_OPCODE(HCI_OGF_LINK_CONTROL, HCI_OCF_DISCONNECT)
#define HCI_OPCODE_READ_REMOTE_VER_INFO HCI_OPCODE(HCI_OGF_LINK_CONTROL, HCI_OCF_READ_REMOTE_VER_INFO)
#define HCI_OPCODE_SET_EVENT_MASK HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_SET_EVENT_MASK)
#define HCI_OPCODE_RESET HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_RESET)
#define HCI_OPCODE_READ_TX_PWR_LVL HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_READ_TX_PWR_LVL)
#define HCI_OPCODE_SET_EVENT_MASK_PAGE2 HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_SET_EVENT_MASK_PAGE2)
#define HCI_OPCODE_READ_AUTH_PAYLOAD_TO HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_READ_AUTH_PAYLOAD_TO)
#define HCI_OPCODE_WRITE_AUTH_PAYLOAD_TO HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_WRITE_AUTH_PAYLOAD_TO)
#define HCI_OPCODE_READ_LOCAL_VER_INFO HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_VER_INFO)
#define HCI_OPCODE_READ_LOCAL_SUP_CMDS HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_SUP_CMDS)
#define HCI_OPCODE_READ_LOCAL_SUP_FEAT HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_SUP_FEAT)
#define HCI_OPCODE_READ_BUF_SIZE HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_BUF_SIZE)
#define HCI_OPCODE_READ_BD_ADDR HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_BD_ADDR)
#define HCI_OPCODE_READ_RSSI HCI_OPCODE(HCI_OGF_STATUS, HCI_OCF_READ_RSSI)
#define HCI_OPCODE_LE_SET_EVENT_MASK HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_EVENT_MASK)
#define HCI_OPCODE_LE_READ_BUF_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_BUF_SIZE)
#define HCI_OPCODE_LE_READ_LOCAL_SUP_FEAT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_LOCAL_SUP_FEAT)
#define HCI_OPCODE_LE_SET_RAND_ADDR HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_RAND_ADDR)
#define HCI_OPCODE_LE_SET_ADV_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_PARAM)
#define HCI_OPCODE_LE_READ_ADV_TX_POWER HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_ADV_TX_POWER)
#define HCI_OPCODE_LE_SET_ADV_DATA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_DATA)
#define HCI_OPCODE_LE_SET_SCAN_RESP_DATA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_RESP_DATA)
#define HCI_OPCODE_LE_SET_ADV_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_ENABLE)
#define HCI_OPCODE_LE_SET_SCAN_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_PARAM)
#define HCI_OPCODE_LE_SET_SCAN_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_ENABLE)
#define HCI_OPCODE_LE_CREATE_CONN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_CONN)
#define HCI_OPCODE_LE_CREATE_CONN_CANCEL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_CONN_CANCEL)
#define HCI_OPCODE_LE_READ_WHITE_LIST_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_WHITE_LIST_SIZE)
#define HCI_OPCODE_LE_CLEAR_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CLEAR_WHITE_LIST)
#define HCI_OPCODE_LE_ADD_DEV_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ADD_DEV_WHITE_LIST)
#define HCI_OPCODE_LE_REMOVE_DEV_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_DEV_WHITE_LIST)
#define HCI_OPCODE_LE_CONN_UPDATE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CONN_UPDATE)
#define HCI_OPCODE_LE_SET_HOST_CHAN_CLASS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_HOST_CHAN_CLASS)
#define HCI_OPCODE_LE_READ_CHAN_MAP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_CHAN_MAP)
#define HCI_OPCODE_LE_READ_REMOTE_FEAT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_REMOTE_FEAT)
#define HCI_OPCODE_LE_ENCRYPT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ENCRYPT)
#define HCI_OPCODE_LE_RAND HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_RAND)
#define HCI_OPCODE_LE_START_ENCRYPTION HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_START_ENCRYPTION)
#define HCI_OPCODE_LE_LTK_REQ_REPL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_LTK_REQ_REPL)
#define HCI_OPCODE_LE_LTK_REQ_NEG_REPL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_LTK_REQ_NEG_REPL)
#define HCI_OPCODE_LE_READ_SUP_STATES HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_SUP_STATES)
#define HCI_OPCODE_LE_RECEIVER_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_RECEIVER_TEST)
#define HCI_OPCODE_LE_TRANSMITTER_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TRANSMITTER_TEST)
#define HCI_OPCODE_LE_TEST_END HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TEST_END)
#define HCI_OPCODE_LE_REM_CONN_PARAM_REP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REM_CONN_PARAM_REP)
#define HCI_OPCODE_LE_REM_CONN_PARAM_NEG_REP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REM_CONN_PARAM_NEG_REP)
#define HCI_OPCODE_LE_SET_DATA_LEN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_DATA_LEN)
#define HCI_OPCODE_LE_READ_DEF_DATA_LEN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_DEF_DATA_LEN)
#define HCI_OPCODE_LE_WRITE_DEF_DATA_LEN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_WRITE_DEF_DATA_LEN)
#define HCI_OPCODE_LE_READ_LOCAL_P256_PUB_KEY HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_LOCAL_P256_PUB_KEY)
#define HCI_OPCODE_LE_GENERATE_DHKEY HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_GENERATE_DHKEY)
#define HCI_OPCODE_LE_ADD_DEV_RES_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ADD_DEV_RES_LIST)
#define HCI_OPCODE_LE_REMOVE_DEV_RES_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_DEV_RES_LIST)
#define HCI_OPCODE_LE_CLEAR_RES_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CLEAR_RES_LIST)
#define HCI_OPCODE_LE_READ_RES_LIST_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_RES_LIST_SIZE)
#define HCI_OPCODE_LE_READ_PEER_RES_ADDR HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_PEER_RES_ADDR)
#define HCI_OPCODE_LE_READ_LOCAL_RES_ADDR HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_LOCAL_RES_ADDR)
#define HCI_OPCODE_LE_SET_ADDR_RES_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADDR_RES_ENABLE)
#define HCI_OPCODE_LE_SET_RES_PRIV_ADDR_TO HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_RES_PRIV_ADDR_TO)
#define HCI_OPCODE_LE_READ_MAX_DATA_LEN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_MAX_DATA_LEN)
/*! Command parameter lengths */
#define HCI_LEN_NOP 0
#define HCI_LEN_DISCONNECT 3
#define HCI_LEN_READ_REMOTE_VER_INFO 2
#define HCI_LEN_SET_EVENT_MASK 8
#define HCI_LEN_SET_EVENT_MASK_PAGE2 8
#define HCI_LEN_RESET 0
#define HCI_LEN_READ_TX_PWR_LVL 3
#define HCI_LEN_SET_CONTROLLER_TO_HOST_FC 1
#define HCI_LEN_HOST_BUFFER_SIZE 8
#define HCI_LEN_HOST_NUM_CMPL_PKTS 1
#define HCI_LEN_READ_LOCAL_VER_INFO 0
#define HCI_LEN_READ_LOCAL_SUP_CMDS 0
#define HCI_LEN_READ_LOCAL_SUP_FEAT 0
#define HCI_LEN_READ_BUF_SIZE 0
#define HCI_LEN_READ_BD_ADDR 0
#define HCI_LEN_READ_RSSI 2
#define HCI_LEN_READ_AUTH_PAYLOAD_TO 2
#define HCI_LEN_WRITE_AUTH_PAYLOAD_TO 4
#define HCI_LEN_LE_SET_EVENT_MASK 8
#define HCI_LEN_LE_READ_BUF_SIZE 0
#define HCI_LEN_LE_READ_LOCAL_SUP_FEAT 0
#define HCI_LEN_LE_SET_RAND_ADDR 6
#define HCI_LEN_LE_SET_ADV_PARAM 15
#define HCI_LEN_LE_READ_ADV_TX_POWER 0
#define HCI_LEN_LE_SET_ADV_DATA 32
#define HCI_LEN_LE_SET_SCAN_RESP_DATA 32
#define HCI_LEN_LE_SET_ADV_ENABLE 1
#define HCI_LEN_LE_SET_SCAN_PARAM 7
#define HCI_LEN_LE_SET_SCAN_ENABLE 2
#define HCI_LEN_LE_CREATE_CONN 25
#define HCI_LEN_LE_CREATE_CONN_CANCEL 0
#define HCI_LEN_LE_READ_WHITE_LIST_SIZE 0
#define HCI_LEN_LE_CLEAR_WHITE_LIST 0
#define HCI_LEN_LE_ADD_DEV_WHITE_LIST 7
#define HCI_LEN_LE_REMOVE_DEV_WHITE_LIST 7
#define HCI_LEN_LE_CONN_UPDATE 14
#define HCI_LEN_LE_SET_HOST_CHAN_CLASS 5
#define HCI_LEN_LE_READ_CHAN_MAP 2
#define HCI_LEN_LE_READ_REMOTE_FEAT 2
#define HCI_LEN_LE_ENCRYPT 32
#define HCI_LEN_LE_RAND 0
#define HCI_LEN_LE_START_ENCRYPTION 28
#define HCI_LEN_LE_LTK_REQ_REPL 18
#define HCI_LEN_LE_LTK_REQ_NEG_REPL 2
#define HCI_LEN_LE_READ_SUP_STATES 0
#define HCI_LEN_LE_RECEIVER_TEST 1
#define HCI_LEN_LE_TRANSMITTER_TEST 3
#define HCI_LEN_LE_TEST_END 0
#define HCI_LEN_LE_READ_LOCAL_P256_PUB_KEY 0
#define HCI_LEN_LE_GENERATE_MAX_DATA 64
#define HCI_LEN_LE_ADD_DEV_RES_LIST 39
#define HCI_LEN_LE_REMOVE_DEV_RES_LIST 7
#define HCI_LEN_LE_CLEAR_RES_LIST 0
#define HCI_LEN_LE_READ_RES_LIST_SIZE 0
#define HCI_LEN_LE_READ_PEER_RES_ADDR 7
#define HCI_LEN_LE_READ_LOCAL_RES_ADDR 7
#define HCI_LEN_LE_SET_ADDR_RES_ENABLE 1
#define HCI_LEN_LE_SET_RES_PRIV_ADDR_TO 2
#define HCI_LEN_LE_REM_CONN_PARAM_REP 14
#define HCI_LEN_LE_REM_CONN_PARAM_NEG_REP 3
#define HCI_LEN_LE_SET_DATA_LEN 6
#define HCI_LEN_LE_READ_DEF_DATA_LEN 0
#define HCI_LEN_LE_WRITE_DEF_DATA_LEN 4
#define HCI_LEN_LE_READ_LOCAL_P256_PUB_KEY 0
#define HCI_LEN_LE_GENERATE_DHKEY 64
#define HCI_LEN_LE_READ_MAX_DATA_LEN 0
/*! Events */
#define HCI_DISCONNECT_CMPL_EVT 0x05
#define HCI_ENC_CHANGE_EVT 0x08
#define HCI_READ_REMOTE_VER_INFO_CMPL_EVT 0x0C
#define HCI_CMD_CMPL_EVT 0x0E
#define HCI_CMD_STATUS_EVT 0x0F
#define HCI_HW_ERROR_EVT 0x10
#define HCI_NUM_CMPL_PKTS_EVT 0x13
#define HCI_DATA_BUF_OVERFLOW_EVT 0x1A
#define HCI_ENC_KEY_REFRESH_CMPL_EVT 0x30
#define HCI_LE_META_EVT 0x3E
#define HCI_AUTH_PAYLOAD_TIMEOUT_EVT 0x57
#define HCI_VENDOR_SPEC_EVT 0xFF
/*! LE Subevents */
#define HCI_LE_CONN_CMPL_EVT 0x01
#define HCI_LE_ADV_REPORT_EVT 0x02
#define HCI_LE_CONN_UPDATE_CMPL_EVT 0x03
#define HCI_LE_READ_REMOTE_FEAT_CMPL_EVT 0x04
#define HCI_LE_LTK_REQ_EVT 0x05
/* New in version 4.1 */
#define HCI_LE_REM_CONN_PARAM_REQ_EVT 0x06
/* New in version 4.2 */
#define HCI_LE_DATA_LEN_CHANGE_EVT 0x07
#define HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_EVT 0x08
#define HCI_LE_GENERATE_DHKEY_CMPL_EVT 0x09
#define HCI_LE_ENHANCED_CONN_CMPL_EVT 0x0A
#define HCI_LE_DIRECT_ADV_REPORT_EVT 0x0B
/*! Event parameter lengths */
#define HCI_LEN_DISCONNECT_CMPL 4
#define HCI_LEN_CMD_CMPL 3
#define HCI_LEN_CMD_STATUS 4
#define HCI_LEN_HW_ERR 1
#define HCI_LEN_ENC_CHANGE 4
#define HCI_LEN_LE_CONN_CMPL 19
#define HCI_LEN_LE_CONN_UPDATE_CMPL 9
#define HCI_LEN_LE_READ_REMOTE_FEAT_CMPL 12
#define HCI_LEN_LE_LTK_REQ 13
/*! Supported commands */
#define HCI_SUP_DISCONNECT 0x20 /*! Byte 0 */
#define HCI_SUP_READ_REMOTE_VER_INFO 0x80 /*! Byte 2 */
#define HCI_SUP_SET_EVENT_MASK 0x40 /*! Byte 5 */
#define HCI_SUP_RESET 0x80 /*! Byte 5 */
#define HCI_SUP_READ_TX_PWR_LVL 0x04 /*! Byte 10 */
#define HCI_SUP_READ_LOCAL_VER_INFO 0x08 /*! Byte 14 */
#define HCI_SUP_READ_LOCAL_SUP_FEAT 0x20 /*! Byte 14 */
#define HCI_SUP_READ_BD_ADDR 0x02 /*! Byte 15 */
#define HCI_SUP_READ_RSSI 0x20 /*! Byte 15 */
#define HCI_SUP_SET_EVENT_MASK_PAGE2 0x04 /*! Byte 22 */
#define HCI_SUP_LE_SET_EVENT_MASK 0x01 /*! Byte 25 */
#define HCI_SUP_LE_READ_BUF_SIZE 0x02 /*! Byte 25 */
#define HCI_SUP_LE_READ_LOCAL_SUP_FEAT 0x04 /*! Byte 25 */
#define HCI_SUP_LE_SET_RAND_ADDR 0x10 /*! Byte 25 */
#define HCI_SUP_LE_SET_ADV_PARAM 0x20 /*! Byte 25 */
#define HCI_SUP_LE_READ_ADV_TX_POWER 0x40 /*! Byte 25 */
#define HCI_SUP_LE_SET_ADV_DATA 0x80 /*! Byte 25 */
#define HCI_SUP_LE_SET_SCAN_RESP_DATA 0x01 /*! Byte 26 */
#define HCI_SUP_LE_SET_ADV_ENABLE 0x02 /*! Byte 26 */
#define HCI_SUP_LE_SET_SCAN_PARAM 0x04 /*! Byte 26 */
#define HCI_SUP_LE_SET_SCAN_ENABLE 0x08 /*! Byte 26 */
#define HCI_SUP_LE_CREATE_CONN 0x10 /*! Byte 26 */
#define HCI_SUP_LE_CREATE_CONN_CANCEL 0x20 /*! Byte 26 */
#define HCI_SUP_LE_READ_WHITE_LIST_SIZE 0x40 /*! Byte 26 */
#define HCI_SUP_LE_CLEAR_WHITE_LIST 0x80 /*! Byte 26 */
#define HCI_SUP_LE_ADD_DEV_WHITE_LIST 0x01 /*! Byte 27 */
#define HCI_SUP_LE_REMOVE_DEV_WHITE_LIST 0x02 /*! Byte 27 */
#define HCI_SUP_LE_CONN_UPDATE 0x04 /*! Byte 27 */
#define HCI_SUP_LE_SET_HOST_CHAN_CLASS 0x08 /*! Byte 27 */
#define HCI_SUP_LE_READ_CHAN_MAP 0x10 /*! Byte 27 */
#define HCI_SUP_LE_READ_REMOTE_FEAT 0x20 /*! Byte 27 */
#define HCI_SUP_LE_ENCRYPT 0x40 /*! Byte 27 */
#define HCI_SUP_LE_RAND 0x80 /*! Byte 27 */
#define HCI_SUP_LE_START_ENCRYPTION 0x01 /*! Byte 28 */
#define HCI_SUP_LE_LTK_REQ_REPL 0x02 /*! Byte 28 */
#define HCI_SUP_LE_LTK_REQ_NEG_REPL 0x04 /*! Byte 28 */
#define HCI_SUP_LE_READ_SUP_STATES 0x08 /*! Byte 28 */
#define HCI_SUP_LE_RECEIVER_TEST 0x10 /*! Byte 28 */
#define HCI_SUP_LE_TRANSMITTER_TEST 0x20 /*! Byte 28 */
#define HCI_SUP_LE_TEST_END 0x40 /*! Byte 28 */
#define HCI_SUP_READ_AUTH_PAYLOAD_TO 0x10 /*! Byte 32 */
#define HCI_SUP_WRITE_AUTH_PAYLOAD_TO 0x20 /*! Byte 32 */
#define HCI_SUP_LE_REM_CONN_PARAM_REQ_REPL 0x10 /*! Byte 33 */
#define HCI_SUP_LE_REM_CONN_PARAM_REQ_NEG_REPL 0x20 /*! Byte 33 */
#define HCI_SUP_LE_SET_DATA_LEN 0x40 /*! Byte 33 */
#define HCI_SUP_LE_READ_DEF_DATA_LEN 0x80 /*! Byte 33 */
#define HCI_SUP_LE_WRITE_DEF_DATA_LEN 0x01 /*! Byte 34 */
#define HCI_SUP_LE_READ_LOCAL_P256_PUB_KEY 0x02 /*! Byte 34 */
#define HCI_SUP_LE_GENERATE_DHKEY 0x04 /*! Byte 34 */
#define HCI_SUP_LE_ADD_DEV_RES_LIST_EVT 0x08 /*! Byte 34 */
#define HCI_SUP_LE_REMOVE_DEV_RES_LIST 0x10 /*! Byte 34 */
#define HCI_SUP_LE_CLEAR_RES_LIST 0x20 /*! Byte 34 */
#define HCI_SUP_LE_READ_RES_LIST_SIZE 0x40 /*! Byte 34 */
#define HCI_SUP_LE_READ_PEER_RES_ADDR 0x80 /*! Byte 34 */
#define HCI_SUP_LE_READ_LOCAL_RES_ADDR 0x01 /*! Byte 35 */
#define HCI_SUP_LE_SET_ADDR_RES_ENABLE 0x02 /*! Byte 35 */
#define HCI_SUP_LE_SET_RES_PRIV_ADDR_TO 0x04 /*! Byte 35 */
#define HCI_SUP_LE_READ_MAX_DATA_LEN 0x08 /*! Byte 35 */
/*! Event mask */
#define HCI_EVT_MASK_DISCONNECT_CMPL 0x10 /*! Byte 0 */
#define HCI_EVT_MASK_ENC_CHANGE 0x80 /*! Byte 0 */
#define HCI_EVT_MASK_READ_REMOTE_VER_INFO_CMPL 0x08 /*! Byte 1 */
#define HCI_EVT_MASK_HW_ERROR 0x80 /*! Byte 1 */
#define HCI_EVT_MASK_DATA_BUF_OVERFLOW 0x02 /*! Byte 3 */
#define HCI_EVT_MASK_ENC_KEY_REFRESH_CMPL 0x80 /*! Byte 5 */
#define HCI_EVT_MASK_LE_META 0x20 /*! Byte 7 */
/*! Event mask page 2 */
#define HCI_EVT_MASK_AUTH_PAYLOAD_TIMEOUT 0x80 /*! Byte 2 */
/*! LE event mask */
#define HCI_EVT_MASK_LE_CONN_CMPL_EVT 0x01 /*! Byte 0 */
#define HCI_EVT_MASK_LE_ADV_REPORT_EVT 0x02 /*! Byte 0 */
#define HCI_EVT_MASK_LE_CONN_UPDATE_CMPL_EVT 0x04 /*! Byte 0 */
#define HCI_EVT_MASK_LE_READ_REMOTE_FEAT_CMPL_EVT 0x08 /*! Byte 0 */
#define HCI_EVT_MASK_LE_LTK_REQ_EVT 0x10 /*! Byte 0 */
#define HCI_EVT_MASK_LE_REMOTE_CONN_PARAM_REQ_EVT 0x20 /*! Byte 0 */
#define HCI_EVT_MASK_LE_DATA_LEN_CHANGE_EVT 0x40 /*! Byte 0 */
#define HCI_EVT_MASK_LE_READ_LOCAL_P256_PUB_KEY_CMPL 0x80 /*! Byte 0 */
#define HCI_EVT_MASK_LE_GENERATE_DHKEY_CMPL 0x01 /*! Byte 1 */
#define HCI_EVT_MASK_LE_ENHANCED_CONN_CMPL_EVT 0x02 /*! Byte 1 */
#define HCI_EVT_MASK_LE_DIRECT_ADV_REPORT_EVT 0x04 /*! Byte 1 */
/*! LE supported features */
#define HCI_LE_SUP_FEAT_ENCRYPTION 0x01 /*! Encryption supported */
#define HCI_LE_SUP_FEAT_CONN_PARAM_REQ_PROC 0x02 /*! Connection Parameters Request Procedure supported */
#define HCI_LE_SUP_FEAT_EXT_REJECT_IND 0x04 /*! Extended Reject Indication supported */
#define HCI_LE_SUP_FEAT_SLV_INIT_FEAT_EXCH 0x08 /*! Slave-Initiated Features Exchange supported */
#define HCI_LE_SUP_FEAT_LE_PING 0x10 /*! LE Ping supported */
#define HCI_LE_SUP_FEAT_DATA_LEN_EXT 0x20 /*! Data Length Extension supported */
#define HCI_LE_SUP_FEAT_PRIVACY 0x40 /*! LL Privacy supported */
#define HCI_LE_SUP_FEAT_EXT_SCAN_FILT_POLICY 0x80 /*! Extended Scan Filter Policy supported */
/*! Advertising command parameters */
#define HCI_ADV_MIN_INTERVAL 0x0020 /*! Minimum advertising interval */
#define HCI_ADV_NONCONN_MIN_INTERVAL 0x00A0 /*! Minimum nonconnectable adv. interval */
#define HCI_ADV_MAX_INTERVAL 0x4000 /*! Maximum advertising interval */
#define HCI_ADV_TYPE_CONN_UNDIRECT 0x00 /*! Connectable undirected advertising */
#define HCI_ADV_TYPE_CONN_DIRECT 0x01 /*! Connectable directed high duty cycle advertising */
#define HCI_ADV_TYPE_DISC_UNDIRECT 0x02 /*! Discoverable undirected advertising */
#define HCI_ADV_TYPE_NONCONN_UNDIRECT 0x03 /*! Nonconnectable undirected advertising */
#define HCI_ADV_TYPE_CONN_DIRECT_LO_DUTY 0x04 /*! Connectable directed low duty cycle advertising */
#define HCI_ADV_CHAN_37 0x01 /*! Advertising channel 37 */
#define HCI_ADV_CHAN_38 0x02 /*! Advertising channel 38 */
#define HCI_ADV_CHAN_39 0x04 /*! Advertising channel 39 */
#define HCI_ADV_FILT_NONE 0x00 /*! No scan request or connection filtering */
#define HCI_ADV_FILT_SCAN 0x01 /*! White list filters scan requests */
#define HCI_ADV_FILT_CONN 0x02 /*! White list filters connections */
#define HCI_ADV_FILT_ALL 0x03 /*! White list filters scan req. and conn. */
/*! Scan command parameters */
#define HCI_SCAN_TYPE_PASSIVE 0 /*! Passive scan */
#define HCI_SCAN_TYPE_ACTIVE 1 /*! Active scan */
#define HCI_SCAN_INTERVAL_MIN 0x0004 /*! Minimum scan interval */
#define HCI_SCAN_INTERVAL_MAX 0x4000 /*! Maximum scan interval */
#define HCI_SCAN_INTERVAL_DEFAULT 0x0010 /*! Default scan interval */
#define HCI_SCAN_WINDOW_MIN 0x0004 /*! Minimum scan window */
#define HCI_SCAN_WINDOW_MAX 0x4000 /*! Maximum scan window */
#define HCI_SCAN_WINDOW_DEFAULT 0x0010 /*! Default scan window */
/*! Connection command parameters */
#define HCI_CONN_INTERVAL_MIN 0x0006 /*! Minimum connection interval */
#define HCI_CONN_INTERVAL_MAX 0x0C80 /*! Maximum connection interval */
#define HCI_CONN_LATENCY_MAX 0x01F3 /*! Maximum connection latency */
#define HCI_SUP_TIMEOUT_MIN 0x000A /*! Minimum supervision timeout */
#define HCI_SUP_TIMEOUT_MAX 0x0C80 /*! Maximum supervision timeout */
/*! Connection event parameters */
#define HCI_ROLE_MASTER 0 /*! Role is master */
#define HCI_ROLE_SLAVE 1 /*! Role is slave */
#define HCI_CLOCK_500PPM 0x00 /*! 500 ppm clock accuracy */
#define HCI_CLOCK_250PPM 0x01 /*! 250 ppm clock accuracy */
#define HCI_CLOCK_150PPM 0x02 /*! 150 ppm clock accuracy */
#define HCI_CLOCK_100PPM 0x03 /*! 100 ppm clock accuracy */
#define HCI_CLOCK_75PPM 0x04 /*! 75 ppm clock accuracy */
#define HCI_CLOCK_50PPM 0x05 /*! 50 ppm clock accuracy */
#define HCI_CLOCK_30PPM 0x06 /*! 30 ppm clock accuracy */
#define HCI_CLOCK_20PPM 0x07 /*! 20 ppm clock accuracy */
/*! Advertising report event parameters */
#define HCI_ADV_CONN_UNDIRECT 0x00 /*! Connectable undirected advertising */
#define HCI_ADV_CONN_DIRECT 0x01 /*! Connectable directed advertising */
#define HCI_ADV_DISC_UNDIRECT 0x02 /*! Discoverable undirected advertising */
#define HCI_ADV_NONCONN_UNDIRECT 0x03 /*! Non-connectable undirected advertising */
#define HCI_ADV_SCAN_RESPONSE 0x04 /*! Scan response */
/*! Misc command parameters */
#define HCI_READ_TX_PWR_CURRENT 0 /*! Read current tx power */
#define HCI_READ_TX_PWR_MAX 1 /*! Read maximum tx power */
#define HCI_TX_PWR_MIN -30 /*! Minimum tx power dBm */
#define HCI_TX_PWR_MAX 20 /*! Maximum tx power dBm */
#define HCI_VERSION 6 /*! HCI specification version */
#define HCI_RSSI_MIN -127 /*! Minimum RSSI dBm */
#define HCI_RSSI_MAX 20 /*! Maximum RSSI dBm */
#define HCI_ADDR_TYPE_PUBLIC 0 /*! Public device address */
#define HCI_ADDR_TYPE_RANDOM 1 /*! Random device address */
#define HCI_ADDR_TYPE_PUBLIC_IDENTITY 2 /*! Public identity address. */
#define HCI_ADDR_TYPE_RANDOM_IDENTITY 3 /*! Random identity address. */
#define HCI_FILT_NONE 0 /*! Accept all advertising packets */
#define HCI_FILT_WHITE_LIST 1 /*! Accept from While List only */
#define HCI_FILT_RES_INIT 2 /*! Accept directed advertisements with RPAs */
#define HCI_FILT_WHITE_LIST_RES_INIT 3 /*! Accept from White List or directed advertisements with RPAs */
#define HCI_ROLE_MASTER 0 /*! Role is master */
#define HCI_ROLE_SLAVE 1 /*! Role is slave */
/*! Parameter lengths */
#define HCI_EVT_MASK_LEN 8 /*! Length of event mask byte array */
#define HCI_EVT_MASK_PAGE_2_LEN 8 /*! Length of event mask page 2 byte array */
#define HCI_LE_EVT_MASK_LEN 8 /*! Length of LE event mask byte array */
#define HCI_FEAT_LEN 8 /*! Length of features byte array */
#define HCI_ADV_DATA_LEN 31 /*! Length of advertising data */
#define HCI_SCAN_DATA_LEN 31 /*! Length of scan response data */
#define HCI_CHAN_MAP_LEN 5 /*! Length of channel map byte array */
#define HCI_KEY_LEN 16 /*! Length of encryption key */
#define HCI_ENCRYPT_DATA_LEN 16 /*! Length of data used in encryption */
#define HCI_RAND_LEN 8 /*! Length of random number */
#define HCI_LE_STATES_LEN 8 /*! Length of LE states byte array */
#define HCI_P256_KEY_LEN 64 /*! Length of P256 key */
#define HCI_DH_KEY_LEN 32 /*! Length of DH Key */
/*! Wicentric company ID */
#define HCI_ID_WICENTRIC 0x005F
#ifdef __cplusplus
};
#endif
#endif /* HCI_DEFS_H */

View File

@ -4,22 +4,19 @@
*
* \brief Stack configuration.
*
* $Date: 2015-06-12 07:19:18 -0400 (Fri, 12 Jun 2015) $
* $Date: 2015-06-12 04:19:18 -0700 (Fri, 12 Jun 2015) $
* $Revision: 3061 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef CFG_STACK_H

View File

@ -4,22 +4,19 @@
*
* \brief Attribute protocol client and server API.
*
* $Date: 2015-06-12 18:20:34 -0400 (Fri, 12 Jun 2015) $
* $Revision: 3075 $
* $Date: 2016-01-06 07:40:44 -0800 (Wed, 06 Jan 2016) $
* $Revision: 5284 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef ATT_API_H
@ -52,7 +49,7 @@ extern "C" {
#define ATTS_SET_ALLOW_SIGNED 0x40 /*! Set if signed writes are allowed */
#define ATTS_SET_REQ_SIGNED 0x80 /*! Set if signed writes are required if link
is not encrypted */
/*! ATT server attribute permissions */
#define ATTS_PERMIT_READ 0x01 /*! Set if attribute can be read */
#define ATTS_PERMIT_READ_AUTH 0x02 /*! Set if attribute read requires authentication */
@ -113,14 +110,14 @@ typedef struct
/*!
* Attribute server data types
*/
/*! Attribute structure */
typedef struct
{
uint8_t const *pUuid; /*! Pointer to the attributes UUID */
uint8_t *pValue; /*! Pointer to the attributes value */
uint16_t *pLen; /*! Pointer to the length of the attributes value */
uint16_t maxLen; /*! Maximum length of attributes value */
uint8_t const *pUuid; /*! Pointer to the attribute's UUID */
uint8_t *pValue; /*! Pointer to the attribute's value */
uint16_t *pLen; /*! Pointer to the length of the attribute's value */
uint16_t maxLen; /*! Maximum length of attribute's value */
uint8_t settings; /*! Attribute settings */
uint8_t permissions; /*! Attribute permissions */
} attsAttr_t;
@ -150,7 +147,7 @@ typedef struct
{
uint16_t handle; /*! Client characteristc configuration descriptor handle */
uint16_t valueRange; /*! Acceptable value range of the descriptor value */
uint8_t secLevel; /*! Security level of characteristic value */
uint8_t secLevel; /*! Security level of characteristic value */
} attsCccSet_t;
/*! ATT client structure for characteristic and descriptor discovery */
@ -176,12 +173,12 @@ typedef struct
attcDiscCfg_t *pCfgList; /*! Characterisic list for configuration */
uint8_t charListLen; /*! Characteristic and handle list length */
uint8_t cfgListLen; /*! Configuration list length */
/* the following are for internal use only */
uint16_t svcStartHdl;
uint16_t svcEndHdl;
uint16_t svcEndHdl;
uint8_t charListIdx;
uint8_t endHdlIdx;
uint8_t endHdlIdx;
} attcDiscCb_t;
/*!
@ -227,7 +224,7 @@ typedef void (*attsCccCback_t)(attsCccEvt_t *pEvt);
/*! Configuration pointer */
extern attCfg_t *pAttCfg;
/**************************************************************************************************
Function Declarations
**************************************************************************************************/
@ -235,7 +232,7 @@ extern attCfg_t *pAttCfg;
/*************************************************************************************************/
/*!
* \fn AttRegister
*
*
* \brief Register a callback with ATT.
*
* \param cback Client callback function.
@ -248,7 +245,7 @@ void AttRegister(attCback_t cback);
/*************************************************************************************************/
/*!
* \fn AttConnRegister
*
*
* \brief Register a connection callback with ATT. The callback is typically used to
* manage the attribute server database.
*
@ -263,7 +260,7 @@ void AttConnRegister(dmCback_t cback);
/*************************************************************************************************/
/*!
* \fn AttGetMtu
*
*
* \brief Get the attribute protocol MTU of a connection.
*
* \param connId DM connection ID.
@ -276,7 +273,7 @@ uint16_t AttGetMtu(dmConnId_t connId);
/*************************************************************************************************/
/*!
* \fn AttsInit
*
*
* \brief Initialize ATT server.
*
* \return None.
@ -287,7 +284,7 @@ void AttsInit(void);
/*************************************************************************************************/
/*!
* \fn AttsIndInit
*
*
* \brief Initialize ATT server for indications/notifications.
*
* \return None.
@ -298,7 +295,7 @@ void AttsIndInit(void);
/*************************************************************************************************/
/*!
* \fn AttsSignInit
*
*
* \brief Initialize ATT server for data signing.
*
* \return None.
@ -309,7 +306,7 @@ void AttsSignInit(void);
/*************************************************************************************************/
/*!
* \fn AttsAuthorRegister
*
*
* \brief Register an authorization callback with the attribute server.
*
* \param cback Client callback function.
@ -322,7 +319,7 @@ void AttsAuthorRegister(attsAuthorCback_t cback);
/*************************************************************************************************/
/*!
* \fn AttsAddGroup
*
*
* \brief Add an attribute group to the attribute server.
*
* \param pGroup Pointer to an attribute group structure.
@ -335,7 +332,7 @@ void AttsAddGroup(attsGroup_t *pGroup);
/*************************************************************************************************/
/*!
* \fn AttsRemoveGroup
*
*
* \brief Remove an attribute group from the attribute server.
*
* \param startHandle Start handle of attribute group to be removed.
@ -348,7 +345,7 @@ void AttsRemoveGroup(uint16_t startHandle);
/*************************************************************************************************/
/*!
* \fn AttsSetAttr
*
*
* \brief Set an attribute value in the attribute server.
*
* \param handle Attribute handle.
@ -363,7 +360,7 @@ uint8_t AttsSetAttr(uint16_t handle, uint16_t valueLen, uint8_t *pValue);
/*************************************************************************************************/
/*!
* \fn AttsGetAttr
*
*
* \brief Get an attribute value in the attribute server.
*
* \param handle Attribute handle.
@ -380,11 +377,11 @@ uint8_t AttsGetAttr(uint16_t handle, uint16_t *pLen, uint8_t **pValue);
/*************************************************************************************************/
/*!
* \fn AttsHandleValueInd
*
*
* \brief Send an attribute protocol Handle Value Indication.
*
* \param connId DM connection ID.
* \param handle Attribute handle.
* \param handle Attribute handle.
* \param valueLen Length of value data.
* \param pValue Pointer to value data.
*
@ -396,11 +393,11 @@ void AttsHandleValueInd(dmConnId_t connId, uint16_t handle, uint16_t valueLen, u
/*************************************************************************************************/
/*!
* \fn AttsHandleValueNtf
*
*
* \brief Send an attribute protocol Handle Value Notification.
*
* \param connId DM connection ID.
* \param handle Attribute handle.
* \param handle Attribute handle.
* \param valueLen Length of value data.
* \param pValue Pointer to value data.
*
@ -412,7 +409,7 @@ void AttsHandleValueNtf(dmConnId_t connId, uint16_t handle, uint16_t valueLen, u
/*************************************************************************************************/
/*!
* \fn AttsCccRegister
*
*
* \brief Register the utility service for managing client characteristic
* configuration descriptors. This function is typically called once on
* system initialization.
@ -429,11 +426,11 @@ void AttsCccRegister(uint8_t setLen, attsCccSet_t *pSet, attsCccCback_t cback);
/*************************************************************************************************/
/*!
* \fn AttsCccInitTable
*
*
* \brief Initialize the client characteristic configuration descriptor value table for a
* connection. The table is initialized with the values from pCccTbl. If pCccTbl
* is NULL the table will be initialized to zero.
*
*
* This function must be called when a connection is established or when a
* device is bonded.
*
@ -449,7 +446,7 @@ void AttsCccInitTable(dmConnId_t connId, uint16_t *pCccTbl);
/*************************************************************************************************/
/*!
* \fn AttsCccClearTable
*
*
* \brief Clear and deallocate the client characteristic configuration descriptor value
* table for a connection. This function must be called when a connection is closed.
*
@ -463,12 +460,12 @@ void AttsCccClearTable(dmConnId_t connId);
/*************************************************************************************************/
/*!
* \fn AttsCccGet
*
*
* \brief Get the value of a client characteristic configuration descriptor by its index.
* If not found, return zero.
*
* \param connId DM connection ID.
* \param idx Index of descriptor in CCC descriptor handle table.
* \param idx Index of descriptor in CCC descriptor handle table.
*
* \return Value of the descriptor.
*/
@ -478,12 +475,12 @@ uint16_t AttsCccGet(dmConnId_t connId, uint8_t idx);
/*************************************************************************************************/
/*!
* \fn AttsCccSet
*
*
* \brief Set the value of a client characteristic configuration descriptor by its index.
*
* \param connId DM connection ID.
* \param idx Index of descriptor in CCC descriptor handle table.
* \param value Value of the descriptor.
* \param idx Index of descriptor in CCC descriptor handle table.
* \param value Value of the descriptor.
*
* \return None.
*/
@ -493,12 +490,12 @@ void AttsCccSet(dmConnId_t connId, uint8_t idx, uint16_t value);
/*************************************************************************************************/
/*!
* \fn AttsCccEnabled
*
*
* \brief Check if a client characteristic configuration descriptor is enabled and if
* the characteristic's security level has been met.
*
* \param connId DM connection ID.
* \param idx Index of descriptor in CCC descriptor handle table.
* \param idx Index of descriptor in CCC descriptor handle table.
*
* \return Value of the descriptor if security level is met, otherwise zero.
*/
@ -508,14 +505,14 @@ uint16_t AttsCccEnabled(dmConnId_t connId, uint8_t idx);
/*************************************************************************************************/
/*!
* \fn AttsSetCsrk
*
*
* \brief Set the peer's data signing key on this connection. This function
* is typically called from the ATT connection callback when the connection is
* established. The caller is responsible for maintaining the memory that
* contains the key.
*
* \param connId DM connection ID.
* \param pCsrk Pointer to data signing key (CSRK).
* \param pCsrk Pointer to data signing key (CSRK).
*
* \return None.
*/
@ -525,14 +522,14 @@ void AttsSetCsrk(dmConnId_t connId, uint8_t *pCsrk);
/*************************************************************************************************/
/*!
* \fn AttsSetSignCounter
*
*
* \brief Set the peer's sign counter on this connection. This function
* is typically called from the ATT connection callback when the connection is
* established. ATT maintains the value of the sign counter internally and
* sets the value when a signed packet is successfully received.
*
* \param connId DM connection ID.
* \param signCounter Sign counter.
* \param signCounter Sign counter.
*
* \return None.
*/
@ -542,7 +539,7 @@ void AttsSetSignCounter(dmConnId_t connId, uint32_t signCounter);
/*************************************************************************************************/
/*!
* \fn AttsGetSignCounter
*
*
* \brief Get the current value peer's sign counter on this connection. This function
* is typically called from the ATT connection callback when the connection is
* closed so the application can store the sign counter for use on future
@ -558,7 +555,7 @@ uint32_t AttsGetSignCounter(dmConnId_t connId);
/*************************************************************************************************/
/*!
* \fn AttcInit
*
*
* \brief Initialize ATT client.
*
* \return None.
@ -569,7 +566,7 @@ void AttcInit(void);
/*************************************************************************************************/
/*!
* \fn AttcSignInit
*
*
* \brief Initialize ATT client for data signing.
*
* \return None.
@ -580,12 +577,12 @@ void AttcSignInit(void);
/*************************************************************************************************/
/*!
* \fn AttcFindInfoReq
*
*
* \brief Initiate an attribute protocol Find Information Request.
*
* \param connId DM connection ID.
* \param startHandle Attribute start handle.
* \param endHandle Attribute end handle.
* \param startHandle Attribute start handle.
* \param endHandle Attribute end handle.
* \param continuing TRUE if ATTC continues sending requests until complete.
*
* \return None.
@ -596,12 +593,12 @@ void AttcFindInfoReq(dmConnId_t connId, uint16_t startHandle, uint16_t endHandle
/*************************************************************************************************/
/*!
* \fn AttcFindByTypeValueReq
*
*
* \brief Initiate an attribute protocol Find By Type Value Request.
*
* \param connId DM connection ID.
* \param startHandle Attribute start handle.
* \param endHandle Attribute end handle.
* \param startHandle Attribute start handle.
* \param endHandle Attribute end handle.
* \param uuid16 16-bit UUID to find.
* \param valueLen Length of value data.
* \param pValue Pointer to value data.
@ -616,12 +613,12 @@ void AttcFindByTypeValueReq(dmConnId_t connId, uint16_t startHandle, uint16_t en
/*************************************************************************************************/
/*!
* \fn AttcReadByTypeReq
*
*
* \brief Initiate an attribute protocol Read By Type Request.
*
* \param connId DM connection ID.
* \param startHandle Attribute start handle.
* \param endHandle Attribute end handle.
* \param startHandle Attribute start handle.
* \param endHandle Attribute end handle.
* \param uuidLen Length of UUID (2 or 16).
* \param pUuid Pointer to UUID data.
* \param continuing TRUE if ATTC continues sending requests until complete.
@ -635,7 +632,7 @@ void AttcReadByTypeReq(dmConnId_t connId, uint16_t startHandle, uint16_t endHand
/*************************************************************************************************/
/*!
* \fn AttcReadReq
*
*
* \brief Initiate an attribute protocol Read Request.
*
* \param connId DM connection ID.
@ -649,7 +646,7 @@ void AttcReadReq(dmConnId_t connId, uint16_t handle);
/*************************************************************************************************/
/*!
* \fn AttcReadLongReq
*
*
* \brief Initiate an attribute protocol Read Long Request.
*
* \param connId DM connection ID.
@ -665,7 +662,7 @@ void AttcReadLongReq(dmConnId_t connId, uint16_t handle, uint16_t offset, bool_t
/*************************************************************************************************/
/*!
* \fn AttcReadMultipleReq
*
*
* \brief Initiate an attribute protocol Read Multiple Request.
*
* \param connId DM connection ID.
@ -680,12 +677,12 @@ void AttcReadMultipleReq(dmConnId_t connId, uint8_t numHandles, uint16_t *pHandl
/*************************************************************************************************/
/*!
* \fn AttcReadByGroupTypeReq
*
*
* \brief Initiate an attribute protocol Read By Group Type Request.
*
* \param connId DM connection ID.
* \param startHandle Attribute start handle.
* \param endHandle Attribute end handle.
* \param startHandle Attribute start handle.
* \param endHandle Attribute end handle.
* \param uuidLen Length of UUID (2 or 16).
* \param pUuid Pointer to UUID data.
* \param continuing TRUE if ATTC continues sending requests until complete.
@ -699,11 +696,11 @@ void AttcReadByGroupTypeReq(dmConnId_t connId, uint16_t startHandle, uint16_t en
/*************************************************************************************************/
/*!
* \fn AttcWriteReq
*
*
* \brief Initiate an attribute protocol Write Request.
*
* \param connId DM connection ID.
* \param handle Attribute handle.
* \param handle Attribute handle.
* \param valueLen Length of value data.
* \param pValue Pointer to value data.
*
@ -715,11 +712,11 @@ void AttcWriteReq(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t
/*************************************************************************************************/
/*!
* \fn AttcWriteCmd
*
*
* \brief Initiate an attribute protocol Write Command.
*
* \param connId DM connection ID.
* \param handle Attribute handle.
* \param handle Attribute handle.
* \param valueLen Length of value data.
* \param pValue Pointer to value data.
*
@ -731,11 +728,11 @@ void AttcWriteCmd(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t
/*************************************************************************************************/
/*!
* \fn AttcSignedWriteCmd
*
*
* \brief Initiate an attribute protocol signed Write Command.
*
* \param connId DM connection ID.
* \param handle Attribute handle.
* \param handle Attribute handle.
* \param signCounter Value of the sign counter.
* \param valueLen Length of value data.
* \param pValue Pointer to value data.
@ -749,11 +746,11 @@ void AttcSignedWriteCmd(dmConnId_t connId, uint16_t handle, uint32_t signCounter
/*************************************************************************************************/
/*!
* \fn AttcPrepareWriteReq
*
*
* \brief Initiate an attribute protocol Prepare Write Request.
*
* \param connId DM connection ID.
* \param handle Attribute handle.
* \param handle Attribute handle.
* \param offset Write attribute data starting at this offset.
* \param valueLen Length of value data.
* \param pValue Pointer to value data.
@ -769,11 +766,11 @@ void AttcPrepareWriteReq(dmConnId_t connId, uint16_t handle, uint16_t offset, ui
/*************************************************************************************************/
/*!
* \fn AttcExecuteWriteReq
*
*
* \brief Initiate an attribute protocol Execute Write Request.
*
* \param connId DM connection ID.
* \param writeAll TRUE to write all queued writes, FALSE to cancel all queued writes.
* \param writeAll TRUE to write all queued writes, FALSE to cancel all queued writes.
*
* \return None.
*/
@ -783,7 +780,7 @@ void AttcExecuteWriteReq(dmConnId_t connId, bool_t writeAll);
/*************************************************************************************************/
/*!
* \fn AttcCancelReq
*
*
* \brief Cancel an attribute protocol request in progress.
*
* \param connId DM connection ID.
@ -796,7 +793,7 @@ void AttcCancelReq(dmConnId_t connId);
/*************************************************************************************************/
/*!
* \fn AttcDiscService
*
*
* \brief This utility function discovers the given service on a peer device. Function
* AttcFindByTypeValueReq() is called to initiate the discovery procedure.
*
@ -813,7 +810,7 @@ void AttcDiscService(dmConnId_t connId, attcDiscCb_t *pCb, uint8_t uuidLen, uint
/*************************************************************************************************/
/*!
* \fn AttcDiscServiceCmpl
*
*
* \brief This utility function processes a service discovery result. It should be called
* when an ATTC_FIND_BY_TYPE_VALUE_RSP callback event is received after service
* discovery is initiated by calling AttcDiscService().
@ -829,7 +826,7 @@ uint8_t AttcDiscServiceCmpl(attcDiscCb_t *pCb, attEvt_t *pMsg);
/*************************************************************************************************/
/*!
* \fn AttcDiscCharStart
*
*
* \brief This utility function starts characteristic and characteristic descriptor
* discovery for a service on a peer device. The service must have been previously
* discovered by calling AttcDiscService() and AttcDiscServiceCmpl().
@ -845,9 +842,9 @@ void AttcDiscCharStart(dmConnId_t connId, attcDiscCb_t *pCb);
/*************************************************************************************************/
/*!
* \fn AttcDiscCharCmpl
*
*
* \brief This utility function processes a characteristic discovery result. It should be
* called when an ATTC_READ_BY_TYPE_RSP or ATTC_FIND_INFO_RSP callback event is
* called when an ATTC_READ_BY_TYPE_RSP or ATTC_FIND_INFO_RSP callback event is
* received after characteristic discovery is initiated by calling AttcDiscCharStart().
*
* \param pCb Pointer to discovery control block.
@ -863,7 +860,7 @@ uint8_t AttcDiscCharCmpl(attcDiscCb_t *pCb, attEvt_t *pMsg);
/*************************************************************************************************/
/*!
* \fn AttcDiscConfigStart
*
*
* \brief This utility function starts characteristic configuration for characteristics on a
* peer device. The characteristics must have been previously discovered by calling
* AttcDiscCharStart() and AttcDiscCharCmpl().
@ -880,7 +877,7 @@ uint8_t AttcDiscConfigStart(dmConnId_t connId, attcDiscCb_t *pCb);
/*************************************************************************************************/
/*!
* \fn AttcDiscConfigCmpl
*
*
* \brief This utility function initiates the next characteristic configuration procedure.
* It should be called when an ATTC_READ_RSP or ATTC_WRITE_RSP callback event is received
* after characteristic configuration is initiated by calling AttcDiscConfigStart().
@ -897,7 +894,7 @@ uint8_t AttcDiscConfigCmpl(dmConnId_t connId, attcDiscCb_t *pCb);
/*************************************************************************************************/
/*!
* \fn AttcDiscConfigResume
*
*
* \brief This utility function resumes the characteristic configuration procedure. It can
* be called when an ATTC_READ_RSP or ATTC_WRITE_RSP callback event is received
* with failure status to attempt the read or write procedure again.
@ -914,7 +911,7 @@ uint8_t AttcDiscConfigResume(dmConnId_t connId, attcDiscCb_t *pCb);
/*************************************************************************************************/
/*!
* \fn AttcMtuReq
*
*
* \brief For internal use only.
*
* \param connId DM connection ID.
@ -928,7 +925,7 @@ void AttcMtuReq(dmConnId_t connId, uint16_t mtu);
/*************************************************************************************************/
/*!
* \fn AttsErrorTest
*
*
* \brief For testing purposes only.
*
* \param status ATT status

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file att_defs.h
*
*
* \brief Attribute protocol constants and definitions from the Bluetooth specification.
*
* $Date: 2015-09-10 17:58:31 -0400 (Thu, 10 Sep 2015) $
* $Date: 2015-09-10 14:58:31 -0700 (Thu, 10 Sep 2015) $
* $Revision: 3838 $
*
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef ATT_DEFS_H

View File

@ -4,22 +4,19 @@
*
* \brief Interface to ATT event handler.
*
* $Date: 2012-03-29 16:24:04 -0400 (Thu, 29 Mar 2012) $
* $Date: 2012-03-29 13:24:04 -0700 (Thu, 29 Mar 2012) $
* $Revision: 287 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef ATT_HANDLER_H

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file att_uuid.h
*
*
* \brief Attribute protocol UUIDs from the Bluetooth specification.
*
* $Date: 2015-09-20 14:19:39 -0400 (Sun, 20 Sep 2015) $
* $Revision: 3979 $
* $Date: 2015-12-10 08:50:10 -0800 (Thu, 10 Dec 2015) $
* $Revision: 4738 $
*
* Copyright (c) 2011 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef ATT_UUID_H
@ -158,6 +155,7 @@ extern "C" {
#define ATT_UUID_PNP_ID 0x2A50 /*! PnP ID */
#define ATT_UUID_GLUCOSE_FEATURE 0x2A51 /*! Glucose Feature */
#define ATT_UUID_RACP 0x2A52 /*! Record Access Control Point */
#define ATT_UUID_CAR 0x2AA6 /*! Central Address Resolution */
/* remove when adopted */
#define ATT_UUID_GENERIC_CTRL_SERVICE 0xF011
@ -412,18 +410,19 @@ extern const uint8_t attNaChUuid[ATT_16_UUID_LEN]; /*! New Alert */
extern const uint8_t attSnacChUuid[ATT_16_UUID_LEN]; /*! Supported New Alert Category */
extern const uint8_t attSuacChUuid[ATT_16_UUID_LEN]; /*! Supported Unread Alert Category */
extern const uint8_t attBpfChUuid[ATT_16_UUID_LEN]; /*! Blood Pressure Feature */
extern const uint8_t attHidBmiChUuid[ATT_16_UUID_LEN]; /*! HID Information */
extern const uint8_t attHidBkiChUuid[ATT_16_UUID_LEN]; /*! HID Information */
extern const uint8_t attHidBkoChUuid[ATT_16_UUID_LEN]; /*! HID Information */
extern const uint8_t attHidBmiChUuid[ATT_16_UUID_LEN]; /*! HID Information */
extern const uint8_t attHidBkiChUuid[ATT_16_UUID_LEN]; /*! HID Information */
extern const uint8_t attHidBkoChUuid[ATT_16_UUID_LEN]; /*! HID Information */
extern const uint8_t attHidiChUuid[ATT_16_UUID_LEN]; /*! HID Information */
extern const uint8_t attHidRmChUuid[ATT_16_UUID_LEN]; /*! Report Map */
extern const uint8_t attHidRmChUuid[ATT_16_UUID_LEN]; /*! Report Map */
extern const uint8_t attHidcpChUuid[ATT_16_UUID_LEN]; /*! HID Control Point */
extern const uint8_t attHidRepChUuid[ATT_16_UUID_LEN]; /*! Report */
extern const uint8_t attHidPmChUuid[ATT_16_UUID_LEN]; /*! Protocol Mode */
extern const uint8_t attHidRepChUuid[ATT_16_UUID_LEN]; /*! Report */
extern const uint8_t attHidPmChUuid[ATT_16_UUID_LEN]; /*! Protocol Mode */
extern const uint8_t attSiwChUuid[ATT_16_UUID_LEN]; /*! Scan Interval Window */
extern const uint8_t attPnpChUuid[ATT_16_UUID_LEN]; /*! PnP ID */
extern const uint8_t attGlfChUuid[ATT_16_UUID_LEN]; /*! Glucose Feature */
extern const uint8_t attRacpChUuid[ATT_16_UUID_LEN]; /*! Record Access Control Point */
extern const uint8_t attCarChUuid[ATT_16_UUID_LEN]; /*! Central Address Resolution */
/* remove when adopted */
extern const uint8_t attWssSvcUuid[ATT_16_UUID_LEN]; /*! Weight scale service */

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file dm_api.h
*
*
* \brief Device Manager subsystem API.
*
* $Date: 2015-10-30 13:30:55 -0400 (Fri, 30 Oct 2015) $
* $Revision: 4347 $
* $Date: 2016-03-29 11:20:44 -0700 (Tue, 29 Mar 2016) $
* $Revision: 6512 $
*
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef DM_API_H
@ -52,6 +49,7 @@ extern "C" {
#define DM_ADV_CONN_DIRECT 1 /*! Connectable directed advertising */
#define DM_ADV_DISC_UNDIRECT 2 /*! Discoverable undirected advertising */
#define DM_ADV_NONCONN_UNDIRECT 3 /*! Non-connectable undirected advertising */
#define DM_ADV_CONN_DIRECT_LO_DUTY 4 /*! Connectable directed low duty cycle advertising */
#define DM_ADV_SCAN_RESPONSE 4 /*! Scan response */
#define DM_ADV_NONE 255 /*! For internal use only */
@ -83,6 +81,8 @@ extern "C" {
/*! The address type */
#define DM_ADDR_PUBLIC 0 /*! Public address */
#define DM_ADDR_RANDOM 1 /*! Random address */
#define DM_ADDR_PUBLIC_IDENTITY 2 /*! Public identity address */
#define DM_ADDR_RANDOM_IDENTITY 3 /*! Random (static) identity address */
/*! Advertising data types */
#define DM_ADV_TYPE_FLAGS 0x01 /*! Flag bits */
@ -113,6 +113,7 @@ extern "C" {
#define DM_ADV_TYPE_SVC_DATA_128 0x21 /*! Service data - 128-bit UUID */
#define DM_ADV_TYPE_LESC_CONFIRM 0x22 /*! LE Secure Connections confirm value */
#define DM_ADV_TYPE_LESC_RANDOM 0x23 /*! LE Secure Connections random value */
#define DM_ADV_TYPE_URI 0x24 /*! URI */
#define DM_ADV_TYPE_MANUFACTURER 0xFF /*! Manufacturer specific data */
/*! Bit mask for flags advertising data type */
@ -203,6 +204,10 @@ extern "C" {
/*! Set the type of random address */
#define DM_RAND_ADDR_SET(addr, type) {(addr)[5] = ((addr)[5] & 0x3F) | (type);}
/*! Check for Resolvable Random Address */
#define DM_RAND_ADDR_RPA(addr, type) (((type) == DM_ADDR_RANDOM) && \
(DM_RAND_ADDR_GET((addr)) == DM_RAND_ADDR_RESOLV))
/*! Connection busy/idle state */
#define DM_CONN_IDLE 0 /*! Connection is idle */
#define DM_CONN_BUSY 1 /*! Connection is busy */
@ -255,7 +260,17 @@ enum
DM_SEC_COMPARE_IND, /*! Result of Just Works/Numeric Comparison Compare Value Calculation */
DM_SEC_KEYPRESS_IND, /*! Keypress indication from peer in passkey security */
DM_PRIV_RESOLVED_ADDR_IND, /*! Private address resolved */
DM_CONN_READ_RSSI_IND, /*! Read connection RSSI */
DM_CONN_READ_RSSI_IND, /*! Connection RSSI read */
DM_PRIV_ADD_DEV_TO_RES_LIST_IND, /*! Device added to resolving list */
DM_PRIV_REM_DEV_FROM_RES_LIST_IND, /*! Device removed from resolving list */
DM_PRIV_CLEAR_RES_LIST_IND, /*! Resolving list cleared */
DM_PRIV_READ_PEER_RES_ADDR_IND, /*! Peer resolving address read */
DM_PRIV_READ_LOCAL_RES_ADDR_IND, /*! Local resolving address read */
DM_PRIV_SET_ADDR_RES_ENABLE_IND, /*! Address resolving enable set */
DM_REM_CONN_PARAM_REQ_IND, /*! Remote connection parameter requested */
DM_CONN_DATA_LEN_CHANGE_IND, /*! Data length changed */
DM_CONN_WRITE_AUTH_TO_IND, /*! Write authenticated payload complete */
DM_CONN_AUTH_TO_EXPIRED_IND, /*! Authenticated payload timeout expired */
DM_ERROR_IND, /*! General error */
DM_VENDOR_SPEC_IND, /*! Vendor specific event */
};
@ -386,24 +401,34 @@ typedef struct
/*! Union of DM callback event data types */
typedef union
{
wsfMsgHdr_t hdr;
hciLeAdvReportEvt_t scanReport;
hciLeConnCmplEvt_t connOpen;
hciLeConnUpdateCmplEvt_t connUpdate;
hciDisconnectCmplEvt_t connClose;
dmSecPairCmplIndEvt_t pairCmpl;
dmSecEncryptIndEvt_t encryptInd;
dmSecAuthReqIndEvt_t authReq;
dmSecPairIndEvt_t pairInd;
dmSecSlaveIndEvt_t slaveInd;
dmSecKeyIndEvt_t keyInd;
dmSecOobCalcIndEvt_t oobCalcInd;
dmSecCnfIndEvt_t cnfInd;
hciLeLtkReqEvt_t ltkReqInd;
hciVendorSpecEvt_t vendorSpec;
dmAdvNewAddrIndEvt_t advNewAddr;
wsfSecEccMsg_t eccMsg;
hciReadRssiCmdCmplEvt_t readRssi;
wsfMsgHdr_t hdr;
hciLeAdvReportEvt_t scanReport;
hciLeConnCmplEvt_t connOpen;
hciLeConnUpdateCmplEvt_t connUpdate;
hciDisconnectCmplEvt_t connClose;
dmSecPairCmplIndEvt_t pairCmpl;
dmSecEncryptIndEvt_t encryptInd;
dmSecAuthReqIndEvt_t authReq;
dmSecPairIndEvt_t pairInd;
dmSecSlaveIndEvt_t slaveInd;
dmSecKeyIndEvt_t keyInd;
dmSecOobCalcIndEvt_t oobCalcInd;
dmSecCnfIndEvt_t cnfInd;
hciLeLtkReqEvt_t ltkReqInd;
hciVendorSpecEvt_t vendorSpec;
dmAdvNewAddrIndEvt_t advNewAddr;
wsfSecEccMsg_t eccMsg;
hciReadRssiCmdCmplEvt_t readRssi;
hciLeReadPeerResAddrCmdCmplEvt_t readPeerResAddr;
hciLeReadLocalResAddrCmdCmplEvt_t readLocalResAddr;
hciLeSetAddrResEnableCmdCmplEvt_t setAddrResEnable;
hciLeAddDevToResListCmdCmplEvt_t addDevToResList;
hciLeRemDevFromResListCmdCmplEvt_t remDevFromResList;
hciLeClearResListCmdCmplEvt_t clearResList;
hciLeRemConnParamReqEvt_t remConnParamReq;
hciLeDataLenChangeEvt_t dataLenChange;
hciWriteAuthPayloadToCmdCmplEvt_t writeAuthTo;
hciAuthPayloadToExpiredEvt_t authToExpired;
} dmEvt_t;
/*! Data type for DmSecSetOob */
@ -467,13 +492,15 @@ void DmAdvInit(void);
*
* \brief Start advertising using the given advertising type and duration.
*
* \param advType Advertising type.
* \param duration The advertising duration, in milliseconds.
* \param advType Advertising type.
* \param duration The advertising duration, in milliseconds.
* \param peerAddrType Peer address type.
* \param pPeerAddr Peer address.
*
* \return None.
*/
/*************************************************************************************************/
void DmAdvStart(uint8_t advType, uint16_t duration);
void DmAdvStart(uint8_t advType, uint16_t duration, uint8_t peerAddrType, uint8_t *pPeerAddr);
/*************************************************************************************************/
/*!
@ -770,13 +797,14 @@ void DmConnClose(uint8_t clientId, dmConnId_t connId, uint8_t reason);
* \brief Accept a connection from the given peer device by initiating directed advertising.
*
* \param clientId The client identifier.
* \param advType Advertising type.
* \param addrType Address type.
* \param pAddr Peer device address.
*
* \return Connection identifier.
*/
/*************************************************************************************************/
dmConnId_t DmConnAccept(uint8_t clientId, uint8_t addrType, uint8_t *pAddr);
dmConnId_t DmConnAccept(uint8_t clientId, uint8_t advType, uint8_t addrType, uint8_t *pAddr);
/*************************************************************************************************/
/*!
@ -873,6 +901,67 @@ uint16_t DmConnCheckIdle(dmConnId_t connId);
/*************************************************************************************************/
void DmConnReadRssi(dmConnId_t connId);
/*************************************************************************************************/
/*!
* \fn DmRemoteConnParamReqReply
*
* \brief Reply to the HCI remote connection parameter request event. This command is used to
* indicate that the Host has accepted the remote devices request to change connection
* parameters.
*
* \param connId Connection identifier.
* \param pConnSpec Connection specification.
*
* \return None.
*/
/*************************************************************************************************/
void DmRemoteConnParamReqReply(dmConnId_t connId, hciConnSpec_t *pConnSpec);
/*************************************************************************************************/
/*!
* \fn DmRemoteConnParamReqNegReply
*
* \brief Negative reply to the HCI remote connection parameter request event. This command
* is used to indicate that the Host has rejected the remote devices request to change
* connection parameters.
*
* \param connId Connection identifier.
* \param reason Reason for rejection.
*
* \return None.
*/
/*************************************************************************************************/
void DmRemoteConnParamReqNegReply(dmConnId_t connId, uint8_t reason);
/*************************************************************************************************/
/*!
* \fn DmConnSetDataLen
*
* \brief Set data length for a given connection.
*
* \param connId Connection identifier.
* \param txOctets Maximum number of payload octets for a Data PDU.
* \param txTime Maximum number of microseconds for a Data PDU.
*
* \return None.
*/
/*************************************************************************************************/
void DmConnSetDataLen(dmConnId_t connId, uint16_t txOctets, uint16_t txTime);
/*************************************************************************************************/
/*!
* \fn DmWriteAuthPayloadTimeout
*
* \brief Set authenticated payload timeout for a given connection.
*
* \param connId Connection identifier.
* \param timeout Timeout period in units of 10ms
*
* \return None.
*/
/*************************************************************************************************/
void DmWriteAuthPayloadTimeout(dmConnId_t connId, uint16_t timeout);
/*************************************************************************************************/
/*!
* \fn DmDevReset
@ -1165,6 +1254,183 @@ void DmPrivInit(void);
/*************************************************************************************************/
void DmPrivResolveAddr(uint8_t *pAddr, uint8_t *pIrk, uint16_t param);
/*************************************************************************************************/
/*!
* \fn DmPrivAddDevToResList
*
* \brief Add device to resolving list. When complete the client's callback function
* is called with a DM_PRIV_ADD_DEV_TO_RES_LIST_IND event. The client must wait
* to receive this event before executing this function again.
*
* Note: This command cannot be used when address translation is enabled in the LL and:
* - Advertising is enabled
* - Scanning is enabled
* - Create connection command is outstanding
*
* Note: If the local or peer IRK associated with the peer Identity Address is all
* zeros then the LL will use or accept the local or peer Identity Address.
*
* Note: 'enableLlPriv' should be set to TRUE when the last device is being added
* to resolving list to enable address resolution in LL.
*
* \param addrType Peer identity address type.
* \param pIdentityAddr Peer identity address.
* \param pPeerIrk The peer's identity resolving key.
* \param pLocalIrk The local identity resolving key.
* \param enableLlPriv Set to TRUE to enable address resolution in LL.
* \param param client-defined parameter returned with callback event.
*
* \return None.
*/
/*************************************************************************************************/
void DmPrivAddDevToResList(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t *pPeerIrk,
uint8_t *pLocalIrk, bool_t enableLlPriv, uint16_t param);
/*************************************************************************************************/
/*!
* \fn DmPrivRemDevFromResList
*
* \brief Remove device from resolving list. When complete the client's callback function
* is called with a DM_PRIV_REM_DEV_FROM_RES_LIST_IND event. The client must wait to
* receive this event before executing this function again.
*
* Note: This command cannot be used when address translation is enabled in the LL and:
* - Advertising is enabled
* - Scanning is enabled
* - Create connection command is outstanding
*
* \param addrType Peer identity address type.
* \param pIdentityAddr Peer identity address.
* \param param client-defined parameter returned with callback event.
*
* \return None.
*/
/*************************************************************************************************/
void DmPrivRemDevFromResList(uint8_t addrType, const uint8_t *pIdentityAddr, uint16_t param);
/*************************************************************************************************/
/*!
* \fn DmPrivClearResList
*
* \brief Clear resolving list. When complete the client's callback function is called with a
* DM_PRIV_CLEAR_RES_LIST_IND event. The client must wait to receive this event before
* executing this function again.
*
* Note: This command cannot be used when address translation is enabled in the LL and:
* - Advertising is enabled
* - Scanning is enabled
* - Create connection command is outstanding
*
* Note: Address resolution in LL will be disabled when resolving list's cleared
* successfully.
*
* \return None.
*/
/*************************************************************************************************/
void DmPrivClearResList(void);
/*************************************************************************************************/
/*!
* \fn DmPrivReadPeerResolvableAddr
*
* \brief HCI read peer resolvable address command. When complete the client's callback
* function is called with a DM_PRIV_READ_PEER_RES_ADDR_IND event. The client must
* wait to receive this event before executing this function again.
*
* \param addrType Peer identity address type.
* \param pIdentityAddr Peer identity address.
*
* \return None.
*/
/*************************************************************************************************/
void DmPrivReadPeerResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr);
/*************************************************************************************************/
/*!
* \fn DmPrivReadLocalResolvableAddr
*
* \brief Read local resolvable address command. When complete the client's callback
* function is called with a DM_PRIV_READ_LOCAL_RES_ADDR_IND event. The client must
* wait to receive this event before executing this function again.
*
* \param addrType Peer identity address type.
* \param pIdentityAddr Peer identity address.
*
* \return None.
*/
/*************************************************************************************************/
void DmPrivReadLocalResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr);
/*************************************************************************************************/
/*!
* \fn DmPrivSetAddrResEnable
*
* \brief Enable or disable address resolution in LL. When complete the client's callback
* function is called with a DM_PRIV_SET_ADDR_RES_ENABLE_IND event. The client must
* wait to receive this event before executing this function again.
*
* Note: This command can be used at any time except when:
* - Advertising is enabled
* - Scanning is enabled
* - Create connection command is outstanding
*
* \param enable Set to TRUE to enable address resolution or FALSE to disable it.
*
* \return None.
*/
/*************************************************************************************************/
void DmPrivSetAddrResEnable(bool_t enable);
/*************************************************************************************************/
/*!
* \fn DmPrivSetResolvablePrivateAddrTimeout
*
* \brief Set resolvable private address timeout command.
*
* \param rpaTimeout Timeout measured in seconds.
*
* \return None.
*/
/*************************************************************************************************/
void DmPrivSetResolvablePrivateAddrTimeout(uint16_t rpaTimeout);
/*************************************************************************************************/
/*!
* \fn DmLlPrivEnabled
*
* \brief Whether LL Privacy is enabled.
*
* \return TRUE if LL Privacy is enabled. FALSE, otherwise.
*/
/*************************************************************************************************/
bool_t DmLlPrivEnabled(void);
/*************************************************************************************************/
/*!
* \fn DmLlAddrType
*
* \brief Map an address type to a type used by LL.
*
* \param addrType Address type used by Host.
*
* \return Address type used by LL.
*/
/*************************************************************************************************/
uint8_t DmLlAddrType(uint8_t addrType);
/*************************************************************************************************/
/*!
* \fn DmHostAddrType
*
* \brief Map an address type to a type used by Host.
*
* \param addrType Address type used by LL.
*
* \return Address type used by Host.
*/
/*************************************************************************************************/
uint8_t DmHostAddrType(uint8_t addrType);
/*************************************************************************************************/
/*!
* \fn DmL2cConnUpdateCnf
@ -1272,6 +1538,32 @@ uint8_t DmConnLocalAddrType(dmConnId_t connId);
/*************************************************************************************************/
uint8_t *DmConnLocalAddr(dmConnId_t connId);
/*************************************************************************************************/
/*!
* \fn DmConnPeerRpa
*
* \brief For internal use only. Return the peer resolvable private address (RPA).
*
* \param connId Connection ID.
*
* \return Pointer to peer RPA.
*/
/*************************************************************************************************/
uint8_t *DmConnPeerRpa(dmConnId_t connId);
/*************************************************************************************************/
/*!
* \fn DmConnLocalRpa
*
* \brief For internal use only. Return the local resolvable private address (RPA).
*
* \param connId Connection ID.
*
* \return Pointer to local RPA.
*/
/*************************************************************************************************/
uint8_t *DmConnLocalRpa(dmConnId_t connId);
/*************************************************************************************************/
/*!
* \fn DmConnSecLevel

View File

@ -4,22 +4,19 @@
*
* \brief Interface to DM event handler.
*
* $Date: 2012-03-29 16:24:04 -0400 (Thu, 29 Mar 2012) $
* $Date: 2012-03-29 13:24:04 -0700 (Thu, 29 Mar 2012) $
* $Revision: 287 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef DM_HANDLER_H

View File

@ -4,22 +4,19 @@
*
* \brief HCI subsystem API.
*
* $Date: 2015-10-20 16:44:24 -0400 (Tue, 20 Oct 2015) $
* $Revision: 4255 $
* $Date: 2016-04-05 14:14:53 -0700 (Tue, 05 Apr 2016) $
* $Revision: 6646 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef HCI_API_H
@ -39,28 +36,47 @@ extern "C" {
**************************************************************************************************/
/*! Internal event values for the HCI event and sec callbacks */
#define HCI_RESET_SEQ_CMPL_CBACK_EVT 0 /*! Reset sequence complete */
#define HCI_LE_CONN_CMPL_CBACK_EVT 1 /*! LE connection complete */
#define HCI_DISCONNECT_CMPL_CBACK_EVT 2 /*! LE disconnect complete */
#define HCI_LE_CONN_UPDATE_CMPL_CBACK_EVT 3 /*! LE connection update complete */
#define HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL_CBACK_EVT 4 /*! LE create connection cancel command complete */
#define HCI_LE_ADV_REPORT_CBACK_EVT 5 /*! LE advertising report */
#define HCI_READ_RSSI_CMD_CMPL_CBACK_EVT 6 /*! Read RSSI command complete */
#define HCI_LE_READ_CHAN_MAP_CMD_CMPL_CBACK_EVT 7 /*! LE Read channel map command complete */
#define HCI_READ_TX_PWR_LVL_CMD_CMPL_CBACK_EVT 8 /*! Read transmit power level command complete */
#define HCI_READ_REMOTE_VER_INFO_CMPL_CBACK_EVT 9 /*! Read remote version information complete */
#define HCI_LE_READ_REMOTE_FEAT_CMPL_CBACK_EVT 10 /*! LE read remote features complete */
#define HCI_LE_LTK_REQ_REPL_CMD_CMPL_CBACK_EVT 11 /*! LE LTK request reply command complete */
#define HCI_LE_LTK_REQ_NEG_REPL_CMD_CMPL_CBACK_EVT 12 /*! LE LTK request negative reply command complete */
#define HCI_ENC_KEY_REFRESH_CMPL_CBACK_EVT 13 /*! Encryption key refresh complete */
#define HCI_ENC_CHANGE_CBACK_EVT 14 /*! Encryption change */
#define HCI_LE_LTK_REQ_CBACK_EVT 15 /*! LE LTK request */
#define HCI_VENDOR_SPEC_CMD_STATUS_CBACK_EVT 16 /*! Vendor specific command status */
#define HCI_VENDOR_SPEC_CMD_CMPL_CBACK_EVT 17 /*! Vendor specific command complete */
#define HCI_VENDOR_SPEC_CBACK_EVT 18 /*! Vendor specific */
#define HCI_HW_ERROR_CBACK_EVT 19 /*! Hardware error */
#define HCI_LE_ENCRYPT_CMD_CMPL_CBACK_EVT 20 /*! LE encrypt command complete */
#define HCI_LE_RAND_CMD_CMPL_CBACK_EVT 21 /*! LE rand command complete */
#define HCI_RESET_SEQ_CMPL_CBACK_EVT 0 /*! Reset sequence complete */
#define HCI_LE_CONN_CMPL_CBACK_EVT 1 /*! LE connection complete */
#define HCI_LE_ENHANCED_CONN_CMPL_CBACK_EVT 2 /*! LE enhanced connection complete */
#define HCI_DISCONNECT_CMPL_CBACK_EVT 3 /*! LE disconnect complete */
#define HCI_LE_CONN_UPDATE_CMPL_CBACK_EVT 4 /*! LE connection update complete */
#define HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL_CBACK_EVT 5 /*! LE create connection cancel command complete */
#define HCI_LE_ADV_REPORT_CBACK_EVT 6 /*! LE advertising report */
#define HCI_READ_RSSI_CMD_CMPL_CBACK_EVT 7 /*! Read RSSI command complete */
#define HCI_LE_READ_CHAN_MAP_CMD_CMPL_CBACK_EVT 8 /*! LE Read channel map command complete */
#define HCI_READ_TX_PWR_LVL_CMD_CMPL_CBACK_EVT 9 /*! Read transmit power level command complete */
#define HCI_READ_REMOTE_VER_INFO_CMPL_CBACK_EVT 10 /*! Read remote version information complete */
#define HCI_LE_READ_REMOTE_FEAT_CMPL_CBACK_EVT 11 /*! LE read remote features complete */
#define HCI_LE_LTK_REQ_REPL_CMD_CMPL_CBACK_EVT 12 /*! LE LTK request reply command complete */
#define HCI_LE_LTK_REQ_NEG_REPL_CMD_CMPL_CBACK_EVT 13 /*! LE LTK request negative reply command complete */
#define HCI_ENC_KEY_REFRESH_CMPL_CBACK_EVT 14 /*! Encryption key refresh complete */
#define HCI_ENC_CHANGE_CBACK_EVT 15 /*! Encryption change */
#define HCI_LE_LTK_REQ_CBACK_EVT 16 /*! LE LTK request */
#define HCI_VENDOR_SPEC_CMD_STATUS_CBACK_EVT 17 /*! Vendor specific command status */
#define HCI_VENDOR_SPEC_CMD_CMPL_CBACK_EVT 18 /*! Vendor specific command complete */
#define HCI_VENDOR_SPEC_CBACK_EVT 19 /*! Vendor specific */
#define HCI_HW_ERROR_CBACK_EVT 20 /*! Hardware error */
#define HCI_LE_ADD_DEV_TO_RES_LIST_CMD_CMPL_CBACK_EVT 21 /*! LE add device to resolving list command complete */
#define HCI_LE_REM_DEV_FROM_RES_LIST_CMD_CMPL_CBACK_EVT 22 /*! LE remove device from resolving command complete */
#define HCI_LE_CLEAR_RES_LIST_CMD_CMPL_CBACK_EVT 23 /*! LE clear resolving list command complete */
#define HCI_LE_READ_PEER_RES_ADDR_CMD_CMPL_CBACK_EVT 24 /*! LE read peer resolving address command complete */
#define HCI_LE_READ_LOCAL_RES_ADDR_CMD_CMPL_CBACK_EVT 25 /*! LE read local resolving address command complete */
#define HCI_LE_SET_ADDR_RES_ENABLE_CMD_CMPL_CBACK_EVT 26 /*! LE set address resolving enable command complete */
#define HCI_LE_ENCRYPT_CMD_CMPL_CBACK_EVT 27 /*! LE encrypt command complete */
#define HCI_LE_RAND_CMD_CMPL_CBACK_EVT 28 /*! LE rand command complete */
#define HCI_LE_REM_CONN_PARAM_REP_CMD_CMPL_CBACK_EVT 29 /*! LE remote connection parameter request reply complete */
#define HCI_LE_REM_CONN_PARAM_NEG_REP_CMD_CMPL_CBACK_EVT 30 /*! LE remote connection parameter request negative reply complete */
#define HCI_LE_READ_DEF_DATA_LEN_CMD_CMPL_CBACK_EVT 31 /*! LE read suggested default data length command complete */
#define HCI_LE_WRITE_DEF_DATA_LEN_CMD_CMPL_CBACK_EVT 32 /*! LE write suggested default data length command complete */
#define HCI_LE_SET_DATA_LEN_CMD_CMPL_CBACK_EVT 33 /*! LE set data length command complete */
#define HCI_LE_READ_MAX_DATA_LEN_CMD_CMPL_CBACK_EVT 34 /*! LE read maximum data length command complete */
#define HCI_LE_REM_CONN_PARAM_REQ_CBACK_EVT 35 /*! LE remote connection parameter request */
#define HCI_LE_DATA_LEN_CHANGE_CBACK_EVT 36 /*! LE data length change */
#define HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_CBACK_EVT 37 /*! LE read local P-256 public key */
#define HCI_LE_GENERATE_DHKEY_CMPL_CBACK_EVT 38 /*! LE generate DHKey complete */
#define HCI_WRITE_AUTH_PAYLOAD_TO_CMD_CMPL_CBACK_EVT 39 /*! Write authenticated payload timeout command complete */
#define HCI_AUTH_PAYLOAD_TO_EXPIRED_CBACK_EVT 40 /*! Authenticated payload timeout expired event */
/**************************************************************************************************
Data Types
@ -90,6 +106,10 @@ typedef struct
uint16_t connLatency;
uint16_t supTimeout;
uint8_t clockAccuracy;
/* enhanced fields */
bdAddr_t localRpa;
bdAddr_t peerRpa;
} hciLeConnCmplEvt_t;
/*! Disconnect complete event */
@ -129,6 +149,10 @@ typedef struct
uint8_t eventType;
uint8_t addrType;
bdAddr_t addr;
/* direct fields */
uint8_t directAddrType;
bdAddr_t directAddr;
} hciLeAdvReportEvt_t;
/*! Read RSSI command complete event */
@ -265,33 +289,196 @@ typedef struct
uint8_t randNum[HCI_RAND_LEN];
} hciLeRandCmdCmplEvt_t;
/*! LE remote connection parameter request reply command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
uint16_t handle;
} hciLeRemConnParamRepEvt_t;
/*! LE remote connection parameter request negative reply command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
uint16_t handle;
} hciLeRemConnParamNegRepEvt_t;
/*! LE read suggested default data len command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
uint16_t suggestedMaxTxOctets;
uint16_t suggestedMaxTxTime;
} hciLeReadDefDataLenEvt_t;
/*! LE write suggested default data len command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
} hciLeWriteDefDataLenEvt_t;
/*! LE set data len command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
uint16_t handle;
} hciLeSetDataLenEvt_t;
/*! LE read maximum data len command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
uint16_t supportedMaxTxOctets;
uint16_t supportedMaxTxTime;
uint16_t supportedMaxRxOctets;
uint16_t supportedMaxRxTime;
} hciLeReadMaxDataLenEvt_t;
/*! LE remote connetion parameter request event */
typedef struct
{
wsfMsgHdr_t hdr;
uint16_t handle;
uint16_t intervalMin;
uint16_t intervalMax;
uint16_t latency;
uint16_t timeout;
} hciLeRemConnParamReqEvt_t;
/*! LE data length change event */
typedef struct
{
wsfMsgHdr_t hdr;
uint16_t handle;
uint16_t maxTxOctets;
uint16_t maxTxTime;
uint16_t maxRxOctets;
uint16_t maxRxTime;
} hciLeDataLenChangeEvt_t;
/*! LE local p256 ecc key command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
uint8_t key[HCI_P256_KEY_LEN];
} hciLeP256CmplEvt_t;
/*! LE generate DH key command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
uint8_t key[HCI_DH_KEY_LEN];
} hciLeGenDhKeyEvt_t;
/*! LE read peer resolving address command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
uint8_t peerRpa[BDA_ADDR_LEN];
} hciLeReadPeerResAddrCmdCmplEvt_t;
/*! LE read local resolving address command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
uint8_t localRpa[BDA_ADDR_LEN];
} hciLeReadLocalResAddrCmdCmplEvt_t;
/*! LE set address resolving enable command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
} hciLeSetAddrResEnableCmdCmplEvt_t;
/*! LE add device to resolving list command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
} hciLeAddDevToResListCmdCmplEvt_t;
/*! LE remove device from resolving list command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
} hciLeRemDevFromResListCmdCmplEvt_t;
/*! LE clear resolving list command complete event */
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
} hciLeClearResListCmdCmplEvt_t;
typedef struct
{
wsfMsgHdr_t hdr;
uint8_t status;
uint16_t handle;
} hciWriteAuthPayloadToCmdCmplEvt_t;
typedef struct
{
wsfMsgHdr_t hdr;
uint16_t handle;
} hciAuthPayloadToExpiredEvt_t;
/*! Union of all event types */
typedef union
{
wsfMsgHdr_t hdr;
wsfMsgHdr_t resetSeqCmpl;
hciLeConnCmplEvt_t leConnCmpl;
hciDisconnectCmplEvt_t disconnectCmpl;
hciLeConnUpdateCmplEvt_t leConnUpdateCmpl;
hciLeCreateConnCancelCmdCmplEvt_t leCreateConnCancelCmdCmpl;
hciLeAdvReportEvt_t leAdvReport;
hciReadRssiCmdCmplEvt_t readRssiCmdCmpl;
hciReadChanMapCmdCmplEvt_t readChanMapCmdCmpl;
hciReadTxPwrLvlCmdCmplEvt_t readTxPwrLvlCmdCmpl;
hciReadRemoteVerInfoCmplEvt_t readRemoteVerInfoCmpl;
hciLeReadRemoteFeatCmplEvt_t leReadRemoteFeatCmpl;
hciLeLtkReqReplCmdCmplEvt_t leLtkReqReplCmdCmpl;
hciLeLtkReqNegReplCmdCmplEvt_t leLtkReqNegReplCmdCmpl;
hciEncKeyRefreshCmpl_t encKeyRefreshCmpl;
hciEncChangeEvt_t encChange;
hciLeLtkReqEvt_t leLtkReq;
hciVendorSpecCmdStatusEvt_t vendorSpecCmdStatus;
hciVendorSpecCmdCmplEvt_t vendorSpecCmdCmpl;
hciVendorSpecEvt_t vendorSpec;
hciHwErrorEvt_t hwError;
hciLeEncryptCmdCmplEvt_t leEncryptCmdCmpl;
hciLeRandCmdCmplEvt_t leRandCmdCmpl;
wsfMsgHdr_t hdr;
wsfMsgHdr_t resetSeqCmpl;
hciLeConnCmplEvt_t leConnCmpl;
hciDisconnectCmplEvt_t disconnectCmpl;
hciLeConnUpdateCmplEvt_t leConnUpdateCmpl;
hciLeCreateConnCancelCmdCmplEvt_t leCreateConnCancelCmdCmpl;
hciLeAdvReportEvt_t leAdvReport;
hciReadRssiCmdCmplEvt_t readRssiCmdCmpl;
hciReadChanMapCmdCmplEvt_t readChanMapCmdCmpl;
hciReadTxPwrLvlCmdCmplEvt_t readTxPwrLvlCmdCmpl;
hciReadRemoteVerInfoCmplEvt_t readRemoteVerInfoCmpl;
hciLeReadRemoteFeatCmplEvt_t leReadRemoteFeatCmpl;
hciLeLtkReqReplCmdCmplEvt_t leLtkReqReplCmdCmpl;
hciLeLtkReqNegReplCmdCmplEvt_t leLtkReqNegReplCmdCmpl;
hciEncKeyRefreshCmpl_t encKeyRefreshCmpl;
hciEncChangeEvt_t encChange;
hciLeLtkReqEvt_t leLtkReq;
hciVendorSpecCmdStatusEvt_t vendorSpecCmdStatus;
hciVendorSpecCmdCmplEvt_t vendorSpecCmdCmpl;
hciVendorSpecEvt_t vendorSpec;
hciHwErrorEvt_t hwError;
hciLeEncryptCmdCmplEvt_t leEncryptCmdCmpl;
hciLeRandCmdCmplEvt_t leRandCmdCmpl;
hciLeReadPeerResAddrCmdCmplEvt_t leReadPeerResAddrCmdCmpl;
hciLeReadLocalResAddrCmdCmplEvt_t leReadLocalResAddrCmdCmpl;
hciLeSetAddrResEnableCmdCmplEvt_t leSetAddrResEnableCmdCmpl;
hciLeAddDevToResListCmdCmplEvt_t leAddDevToResListCmdCmpl;
hciLeRemDevFromResListCmdCmplEvt_t leRemDevFromResListCmdCmpl;
hciLeClearResListCmdCmplEvt_t leClearResListCmdCmpl;
hciLeRemConnParamRepEvt_t leRemConnParamRepCmdCmpl;
hciLeRemConnParamNegRepEvt_t leRemConnParamNegRepCmdCmpl;
hciLeReadDefDataLenEvt_t leReadDefDataLenCmdCmpl;
hciLeWriteDefDataLenEvt_t leWriteDefDataLenCmdCmpl;
hciLeSetDataLenEvt_t leSetDataLenCmdCmpl;
hciLeReadMaxDataLenEvt_t leReadMaxDataLenCmdCmpl;
hciLeRemConnParamReqEvt_t leRemConnParamReq;
hciLeDataLenChangeEvt_t leDataLenChange;
hciLeP256CmplEvt_t leP256;
hciLeGenDhKeyEvt_t leGenDHKey;
hciWriteAuthPayloadToCmdCmplEvt_t writeAuthPayloadToCmdCmpl;
hciAuthPayloadToExpiredEvt_t authPayloadToExpired;
} hciEvt_t;
/**************************************************************************************************
@ -317,6 +504,7 @@ void HciCoreInit(void);
void HciCoreHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg);
void HciSetMaxRxAclLen(uint16_t len);
void HciSetAclQueueWatermarks(uint8_t queueHi, uint8_t queueLo);
void HciSetLeSupFeat(uint8_t feat, bool_t flag);
/*! Optimization interface */
uint8_t *HciGetBdAddr(void);
@ -327,6 +515,8 @@ uint8_t HciGetNumBufs(void);
uint8_t *HciGetSupStates(void);
uint8_t HciGetLeSupFeat(void);
uint16_t HciGetMaxRxAclLen(void);
uint8_t HciGetResolvingListSize(void);
bool_t HciLlPrivacySupported(void);
/*! ACL data interface */
void HciSendAclData(uint8_t *pAclData);
@ -374,8 +564,31 @@ void HciReadRssiCmd(uint16_t handle);
void HciReadTxPwrLvlCmd(uint16_t handle, uint8_t type);
void HciResetCmd(void);
void HciSetEventMaskCmd(uint8_t *pEventMask);
void HciSetEventMaskPage2Cmd(uint8_t *pEventMask);
void HciReadAuthPayloadTimeout(uint16_t handle);
void HciWriteAuthPayloadTimeout(uint16_t handle, uint16_t timeout);
void HciLeAddDeviceToResolvingListCmd(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr,
const uint8_t *pPeerIrk, const uint8_t *pLocalIrk);
void HciLeRemoveDeviceFromResolvingList(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr);
void HciLeClearResolvingList(void);
void HciLeReadResolvingListSize(void);
void HciLeReadPeerResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr);
void HciLeReadLocalResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr);
void HciLeSetAddrResolutionEnable(uint8_t enable);
void HciLeSetResolvablePrivateAddrTimeout(uint16_t rpaTimeout);
void HciVendorSpecificCmd(uint16_t opcode, uint8_t len, uint8_t *pData);
void HciLeRemoteConnParamReqReply(uint16_t handle, uint16_t intervalMin, uint16_t intervalMax, uint16_t latency,
uint16_t timeout, uint16_t minCeLen, uint16_t maxCeLen);
void HciLeRemoteConnParamReqNegReply(uint16_t handle, uint8_t reason);
void HciLeSetDataLen(uint16_t handle, uint16_t txOctets, uint16_t txTime);
void HciLeReadDefDataLen(void);
void HciLeWriteDefDataLen(uint16_t suggestedMaxTxOctets, uint16_t suggestedMaxTxTime);
void HciLeReadLocalP256PubKey(void);
void HciLeGenerateDHKey(uint8_t *pPubKeyX, uint8_t *pPubKeyY);
void HciLeReadMaxDataLen(void);
void HciWriteAuthPayloadTimeout(uint16_t handle, uint16_t timeout);
#ifdef __cplusplus
};
#endif

View File

@ -1,467 +0,0 @@
/*************************************************************************************************/
/*!
* \file hci_defs.h
*
* \brief HCI constants and definitions from the Bluetooth specification.
*
* $Date: 2015-06-12 07:19:18 -0400 (Fri, 12 Jun 2015) $
* $Revision: 3061 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*************************************************************************************************/
#ifndef HCI_DEFS_H
#define HCI_DEFS_H
#ifdef __cplusplus
extern "C" {
#endif
/*! Packet definitions */
#define HCI_CMD_HDR_LEN 3 /*! Command packet header length */
#define HCI_ACL_HDR_LEN 4 /*! ACL packet header length */
#define HCI_EVT_HDR_LEN 2 /*! Event packet header length */
#define HCI_EVT_PARAM_MAX_LEN 255 /*! Maximum length of event packet parameters */
#define HCI_ACL_DEFAULT_LEN 27 /*! Default maximum ACL packet length */
#define HCI_PB_FLAG_MASK 0x3000 /*! ACL packet boundary flag mask */
#define HCI_PB_START_H2C 0x0000 /*! Packet boundary flag, start, host-to-controller */
#define HCI_PB_CONTINUE 0x1000 /*! Packet boundary flag, continue */
#define HCI_PB_START_C2H 0x2000 /*! Packet boundary flag, start, controller-to-host */
#define HCI_HANDLE_MASK 0x0FFF /*! Mask for handle bits in ACL packet */
#define HCI_HANDLE_NONE 0xFFFF /*! Value for invalid handle */
/*! Packet types */
#define HCI_CMD_TYPE 1 /*! HCI command packet */
#define HCI_ACL_TYPE 2 /*! HCI ACL data packet */
#define HCI_EVT_TYPE 4 /*! HCI event packet */
/*! Error codes */
#define HCI_SUCCESS 0x00 /*! Success */
#define HCI_ERR_UNKNOWN_CMD 0x01 /*! Unknown HCI command */
#define HCI_ERR_UNKNOWN_HANDLE 0x02 /*! Unknown connection identifier */
#define HCI_ERR_HARDWARE_FAILURE 0x03 /*! Hardware failure */
#define HCI_ERR_PAGE_TIMEOUT 0x04 /*! Page timeout */
#define HCI_ERR_AUTH_FAILURE 0x05 /*! Authentication failure */
#define HCI_ERR_KEY_MISSING 0x06 /*! PIN or key missing */
#define HCI_ERR_MEMORY_EXCEEDED 0x07 /*! Memory capacity exceeded */
#define HCI_ERR_CONN_TIMEOUT 0x08 /*! Connection timeout */
#define HCI_ERR_CONN_LIMIT 0x09 /*! Connection limit exceeded */
#define HCI_ERR_SYNCH_CONN_LIMIT 0x0A /*! Synchronous connection limit exceeded */
#define HCI_ERR_ACL_CONN_EXISTS 0x0B /*! ACL connection already exists */
#define HCI_ERR_CMD_DISALLOWED 0x0C /*! Command disallowed */
#define HCI_ERR_REJ_RESOURCES 0x0D /*! Connection rejected limited resources */
#define HCI_ERR_REJ_SECURITY 0x0E /*! Connection rejected security reasons */
#define HCI_ERR_REJ_BD_ADDR 0x0F /*! Connection rejected unacceptable BD_ADDR */
#define HCI_ERR_ACCEPT_TIMEOUT 0x10 /*! Connection accept timeout exceeded */
#define HCI_ERR_UNSUP_FEAT 0x11 /*! Unsupported feature or parameter value */
#define HCI_ERR_INVALID_PARAM 0x12 /*! Invalid HCI command parameters */
#define HCI_ERR_REMOTE_TERMINATED 0x13 /*! Remote user terminated connection */
#define HCI_ERR_REMOTE_RESOURCES 0x14 /*! Remote device low resources */
#define HCI_ERR_REMOTE_POWER_OFF 0x15 /*! Remote device power off */
#define HCI_ERR_LOCAL_TERMINATED 0x16 /*! Connection terminated by local host */
#define HCI_ERR_REPEATED_ATTEMPTS 0x17 /*! Repeated attempts */
#define HCI_ERR_PAIRING_NOT_ALLOWED 0x18 /*! Pairing not allowed */
#define HCI_ERR_UNKNOWN_LMP_PDU 0x19 /*! Unknown LMP PDU */
#define HCI_ERR_UNSUP_REMOTE_FEAT 0x1A /*! Unsupported remote feature */
#define HCI_ERR_SCO_OFFSET 0x1B /*! SCO offset rejected */
#define HCI_ERR_SCO_INTERVAL 0x1C /*! SCO interval rejected */
#define HCI_ERR_SCO_MODE 0x1D /*! SCO air mode rejected */
#define HCI_ERR_LMP_PARAM 0x1E /*! Invalid LMP parameters */
#define HCI_ERR_UNSPECIFIED 0x1F /*! Unspecified error */
#define HCI_ERR_UNSUP_LMP_PARAM 0x20 /*! Unsupported LMP parameter value */
#define HCI_ERR_ROLE_CHANGE 0x21 /*! Role change not allowed */
#define HCI_ERR_LL_RESP_TIMEOUT 0x22 /*! LL response timeout */
#define HCI_ERR_LMP_COLLISION 0x23 /*! LMP error transaction collision */
#define HCI_ERR_LMP_PDU 0x24 /*! LMP pdu not allowed */
#define HCI_ERR_ENCRYPT_MODE 0x25 /*! Encryption mode not acceptable */
#define HCI_ERR_LINK_KEY 0x26 /*! Link key can not be changed */
#define HCI_ERR_UNSUP_QOS 0x27 /*! Requested qos not supported */
#define HCI_ERR_INSTANT_PASSED 0x28 /*! Instant passed */
#define HCI_ERR_UNSUP_UNIT_KEY 0x29 /*! Pairing with unit key not supported */
#define HCI_ERR_TRANSACT_COLLISION 0x2A /*! Different transaction collision */
#define HCI_ERR_CHANNEL_CLASS 0x2E /*! Channel classification not supported */
#define HCI_ERR_MEMORY 0x2F /*! Insufficient security */
#define HCI_ERR_PARAMETER_RANGE 0x30 /*! Parameter out of mandatory range */
#define HCI_ERR_ROLE_SWITCH_PEND 0x32 /*! Role switch pending */
#define HCI_ERR_RESERVED_SLOT 0x34 /*! Reserved slot violation */
#define HCI_ERR_ROLE_SWITCH 0x35 /*! Role switch failed */
#define HCI_ERR_INQ_TOO_LARGE 0x36 /*! Extended inquiry response too large */
#define HCI_ERR_UNSUP_SSP 0x37 /*! Secure simple pairing not supported by host */
#define HCI_ERR_HOST_BUSY_PAIRING 0x38 /*! Host busy - pairing */
#define HCI_ERR_NO_CHANNEL 0x39 /*! Connection rejected no suitable channel */
#define HCI_ERR_CONTROLLER_BUSY 0x3A /*! Controller busy */
#define HCI_ERR_CONN_INTERVAL 0x3B /*! Unacceptable connection interval */
#define HCI_ERR_ADV_TIMEOUT 0x3C /*! Directed advertising timeout */
#define HCI_ERR_MIC_FAILURE 0x3D /*! Connection terminated due to MIC failure */
#define HCI_ERR_CONN_FAIL 0x3E /*! Connection failed to be established */
#define HCI_ERR_MAC_CONN_FAIL 0x3F /*! MAC connection failed */
/*! Command groups */
#define HCI_OGF_NOP 0x00 /*! No operation */
#define HCI_OGF_LINK_CONTROL 0x01 /*! Link control */
#define HCI_OGF_LINK_POLICY 0x02 /*! Link policy */
#define HCI_OGF_CONTROLLER 0x03 /*! Controller and baseband */
#define HCI_OGF_INFORMATIONAL 0x04 /*! Informational parameters */
#define HCI_OGF_STATUS 0x05 /*! Status parameters */
#define HCI_OGF_TESTING 0x06 /*! Testing */
#define HCI_OGF_LE_CONTROLLER 0x08 /*! LE controller */
#define HCI_OGF_VENDOR_SPEC 0x3F /*! Vendor specific */
/*! NOP command */
#define HCI_OCF_NOP 0x00
/*! Link control commands */
#define HCI_OCF_DISCONNECT 0x06
#define HCI_OCF_READ_REMOTE_VER_INFO 0x1D
/*! Link policy commands (none used for LE) */
/*! Controller and baseband commands */
#define HCI_OCF_SET_EVENT_MASK 0x01
#define HCI_OCF_RESET 0x03
#define HCI_OCF_READ_TX_PWR_LVL 0x2D
#define HCI_OCF_SET_CONTROLLER_TO_HOST_FC 0x31
#define HCI_OCF_HOST_BUFFER_SIZE 0x33
#define HCI_OCF_HOST_NUM_CMPL_PKTS 0x35
/*! Informational commands */
#define HCI_OCF_READ_LOCAL_VER_INFO 0x01
#define HCI_OCF_READ_LOCAL_SUP_CMDS 0x02
#define HCI_OCF_READ_LOCAL_SUP_FEAT 0x03
#define HCI_OCF_READ_BUF_SIZE 0x05
#define HCI_OCF_READ_BD_ADDR 0x09
/*! Status commands */
#define HCI_OCF_READ_RSSI 0x05
/*! LE controller commands */
#define HCI_OCF_LE_SET_EVENT_MASK 0x01
#define HCI_OCF_LE_READ_BUF_SIZE 0x02
#define HCI_OCF_LE_READ_LOCAL_SUP_FEAT 0x03
#define HCI_OCF_LE_SET_RAND_ADDR 0x05
#define HCI_OCF_LE_SET_ADV_PARAM 0x06
#define HCI_OCF_LE_READ_ADV_TX_POWER 0x07
#define HCI_OCF_LE_SET_ADV_DATA 0x08
#define HCI_OCF_LE_SET_SCAN_RESP_DATA 0x09
#define HCI_OCF_LE_SET_ADV_ENABLE 0x0A
#define HCI_OCF_LE_SET_SCAN_PARAM 0x0B
#define HCI_OCF_LE_SET_SCAN_ENABLE 0x0C
#define HCI_OCF_LE_CREATE_CONN 0x0D
#define HCI_OCF_LE_CREATE_CONN_CANCEL 0x0E
#define HCI_OCF_LE_READ_WHITE_LIST_SIZE 0x0F
#define HCI_OCF_LE_CLEAR_WHITE_LIST 0x10
#define HCI_OCF_LE_ADD_DEV_WHITE_LIST 0x11
#define HCI_OCF_LE_REMOVE_DEV_WHITE_LIST 0x12
#define HCI_OCF_LE_CONN_UPDATE 0x13
#define HCI_OCF_LE_SET_HOST_CHAN_CLASS 0x14
#define HCI_OCF_LE_READ_CHAN_MAP 0x15
#define HCI_OCF_LE_READ_REMOTE_FEAT 0x16
#define HCI_OCF_LE_ENCRYPT 0x17
#define HCI_OCF_LE_RAND 0x18
#define HCI_OCF_LE_START_ENCRYPTION 0x19
#define HCI_OCF_LE_LTK_REQ_REPL 0x1A
#define HCI_OCF_LE_LTK_REQ_NEG_REPL 0x1B
#define HCI_OCF_LE_READ_SUP_STATES 0x1C
#define HCI_OCF_LE_RECEIVER_TEST 0x1D
#define HCI_OCF_LE_TRANSMITTER_TEST 0x1E
#define HCI_OCF_LE_TEST_END 0x1F
/*! Opcode manipulation macros */
#define HCI_OPCODE(ogf, ocf) (((ogf) << 10) + (ocf))
#define HCI_OGF(opcode) ((opcode) >> 10)
#define HCI_OCF(opcode) ((opcode) & 0x03FF)
/*! Command opcodes */
#define HCI_OPCODE_NOP HCI_OPCODE(HCI_OGF_NOP, HCI_OCF_NOP)
#define HCI_OPCODE_DISCONNECT HCI_OPCODE(HCI_OGF_LINK_CONTROL, HCI_OCF_DISCONNECT)
#define HCI_OPCODE_READ_REMOTE_VER_INFO HCI_OPCODE(HCI_OGF_LINK_CONTROL, HCI_OCF_READ_REMOTE_VER_INFO)
#define HCI_OPCODE_SET_EVENT_MASK HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_SET_EVENT_MASK)
#define HCI_OPCODE_RESET HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_RESET)
#define HCI_OPCODE_READ_TX_PWR_LVL HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_READ_TX_PWR_LVL)
#define HCI_OPCODE_SET_CONTROLLER_TO_HOST_FC HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_SET_CONTROLLER_TO_HOST_FC)
#define HCI_OPCODE_HOST_BUFFER_SIZE HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_HOST_BUFFER_SIZE)
#define HCI_OPCODE_HOST_NUM_CMPL_PKTS HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_HOST_NUM_CMPL_PKTS)
#define HCI_OPCODE_READ_LOCAL_VER_INFO HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_VER_INFO)
#define HCI_OPCODE_READ_LOCAL_SUP_CMDS HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_SUP_CMDS)
#define HCI_OPCODE_READ_LOCAL_SUP_FEAT HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_SUP_FEAT)
#define HCI_OPCODE_READ_BUF_SIZE HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_BUF_SIZE)
#define HCI_OPCODE_READ_BD_ADDR HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_BD_ADDR)
#define HCI_OPCODE_READ_RSSI HCI_OPCODE(HCI_OGF_STATUS, HCI_OCF_READ_RSSI)
#define HCI_OPCODE_LE_SET_EVENT_MASK HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_EVENT_MASK)
#define HCI_OPCODE_LE_READ_BUF_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_BUF_SIZE)
#define HCI_OPCODE_LE_READ_LOCAL_SUP_FEAT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_LOCAL_SUP_FEAT)
#define HCI_OPCODE_LE_SET_RAND_ADDR HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_RAND_ADDR)
#define HCI_OPCODE_LE_SET_ADV_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_PARAM)
#define HCI_OPCODE_LE_READ_ADV_TX_POWER HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_ADV_TX_POWER)
#define HCI_OPCODE_LE_SET_ADV_DATA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_DATA)
#define HCI_OPCODE_LE_SET_SCAN_RESP_DATA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_RESP_DATA)
#define HCI_OPCODE_LE_SET_ADV_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_ENABLE)
#define HCI_OPCODE_LE_SET_SCAN_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_PARAM)
#define HCI_OPCODE_LE_SET_SCAN_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_ENABLE)
#define HCI_OPCODE_LE_CREATE_CONN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_CONN)
#define HCI_OPCODE_LE_CREATE_CONN_CANCEL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_CONN_CANCEL)
#define HCI_OPCODE_LE_READ_WHITE_LIST_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_WHITE_LIST_SIZE)
#define HCI_OPCODE_LE_CLEAR_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CLEAR_WHITE_LIST)
#define HCI_OPCODE_LE_ADD_DEV_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ADD_DEV_WHITE_LIST)
#define HCI_OPCODE_LE_REMOVE_DEV_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_DEV_WHITE_LIST)
#define HCI_OPCODE_LE_CONN_UPDATE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CONN_UPDATE)
#define HCI_OPCODE_LE_SET_HOST_CHAN_CLASS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_HOST_CHAN_CLASS)
#define HCI_OPCODE_LE_READ_CHAN_MAP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_CHAN_MAP)
#define HCI_OPCODE_LE_READ_REMOTE_FEAT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_REMOTE_FEAT)
#define HCI_OPCODE_LE_ENCRYPT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ENCRYPT)
#define HCI_OPCODE_LE_RAND HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_RAND)
#define HCI_OPCODE_LE_START_ENCRYPTION HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_START_ENCRYPTION)
#define HCI_OPCODE_LE_LTK_REQ_REPL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_LTK_REQ_REPL)
#define HCI_OPCODE_LE_LTK_REQ_NEG_REPL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_LTK_REQ_NEG_REPL)
#define HCI_OPCODE_LE_READ_SUP_STATES HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_SUP_STATES)
#define HCI_OPCODE_LE_RECEIVER_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_RECEIVER_TEST)
#define HCI_OPCODE_LE_TRANSMITTER_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TRANSMITTER_TEST)
#define HCI_OPCODE_LE_TEST_END HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TEST_END)
/*! Command parameter lengths */
#define HCI_LEN_NOP 0
#define HCI_LEN_DISCONNECT 3
#define HCI_LEN_READ_REMOTE_VER_INFO 2
#define HCI_LEN_SET_EVENT_MASK 8
#define HCI_LEN_RESET 0
#define HCI_LEN_READ_TX_PWR_LVL 3
#define HCI_LEN_SET_CONTROLLER_TO_HOST_FC 1
#define HCI_LEN_HOST_BUFFER_SIZE 8
#define HCI_LEN_HOST_NUM_CMPL_PKTS 1
#define HCI_LEN_READ_LOCAL_VER_INFO 0
#define HCI_LEN_READ_LOCAL_SUP_CMDS 0
#define HCI_LEN_READ_LOCAL_SUP_FEAT 0
#define HCI_LEN_READ_BUF_SIZE 0
#define HCI_LEN_READ_BD_ADDR 0
#define HCI_LEN_READ_RSSI 2
#define HCI_LEN_LE_SET_EVENT_MASK 8
#define HCI_LEN_LE_READ_BUF_SIZE 0
#define HCI_LEN_LE_READ_LOCAL_SUP_FEAT 0
#define HCI_LEN_LE_SET_RAND_ADDR 6
#define HCI_LEN_LE_SET_ADV_PARAM 15
#define HCI_LEN_LE_READ_ADV_TX_POWER 0
#define HCI_LEN_LE_SET_ADV_DATA 32
#define HCI_LEN_LE_SET_SCAN_RESP_DATA 32
#define HCI_LEN_LE_SET_ADV_ENABLE 1
#define HCI_LEN_LE_SET_SCAN_PARAM 7
#define HCI_LEN_LE_SET_SCAN_ENABLE 2
#define HCI_LEN_LE_CREATE_CONN 25
#define HCI_LEN_LE_CREATE_CONN_CANCEL 0
#define HCI_LEN_LE_READ_WHITE_LIST_SIZE 0
#define HCI_LEN_LE_CLEAR_WHITE_LIST 0
#define HCI_LEN_LE_ADD_DEV_WHITE_LIST 7
#define HCI_LEN_LE_REMOVE_DEV_WHITE_LIST 7
#define HCI_LEN_LE_CONN_UPDATE 14
#define HCI_LEN_LE_SET_HOST_CHAN_CLASS 5
#define HCI_LEN_LE_READ_CHAN_MAP 2
#define HCI_LEN_LE_READ_REMOTE_FEAT 2
#define HCI_LEN_LE_ENCRYPT 32
#define HCI_LEN_LE_RAND 0
#define HCI_LEN_LE_START_ENCRYPTION 28
#define HCI_LEN_LE_LTK_REQ_REPL 18
#define HCI_LEN_LE_LTK_REQ_NEG_REPL 2
#define HCI_LEN_LE_READ_SUP_STATES 0
#define HCI_LEN_LE_RECEIVER_TEST 1
#define HCI_LEN_LE_TRANSMITTER_TEST 3
#define HCI_LEN_LE_TEST_END 0
/*! Events */
#define HCI_DISCONNECT_CMPL_EVT 0x05
#define HCI_ENC_CHANGE_EVT 0x08
#define HCI_READ_REMOTE_VER_INFO_CMPL_EVT 0x0C
#define HCI_CMD_CMPL_EVT 0x0E
#define HCI_CMD_STATUS_EVT 0x0F
#define HCI_HW_ERROR_EVT 0x10
#define HCI_NUM_CMPL_PKTS_EVT 0x13
#define HCI_DATA_BUF_OVERFLOW_EVT 0x1A
#define HCI_ENC_KEY_REFRESH_CMPL_EVT 0x30
#define HCI_LE_META_EVT 0x3E
#define HCI_VENDOR_SPEC_EVT 0xFF
/*! LE Subevents */
#define HCI_LE_CONN_CMPL_EVT 0x01
#define HCI_LE_ADV_REPORT_EVT 0x02
#define HCI_LE_CONN_UPDATE_CMPL_EVT 0x03
#define HCI_LE_READ_REMOTE_FEAT_CMPL_EVT 0x04
#define HCI_LE_LTK_REQ_EVT 0x05
/*! Event parameter lengths */
#define HCI_LEN_DISCONNECT_CMPL 4
#define HCI_LEN_ENC_CHANGE 5
#define HCI_LEN_LE_CONN_CMPL 19
#define HCI_LEN_LE_CONN_UPDATE_CMPL 9
#define HCI_LEN_LE_READ_REMOTE_FEAT_CMPL 12
#define HCI_LEN_LE_LTK_REQ 13
/*! Supported commands */
#define HCI_SUP_DISCONNECT 0x20 /*! Byte 0 */
#define HCI_SUP_READ_REMOTE_VER_INFO 0x80 /*! Byte 2 */
#define HCI_SUP_SET_EVENT_MASK 0x40 /*! Byte 5 */
#define HCI_SUP_RESET 0x80 /*! Byte 5 */
#define HCI_SUP_READ_TX_PWR_LVL 0x04 /*! Byte 10 */
#define HCI_SUP_SET_CONTROLLER_TO_HOST_FC 0x20 /*! Byte 10 */
#define HCI_SUP_HOST_BUFFER_SIZE 0x40 /*! Byte 10 */
#define HCI_SUP_HOST_NUM_CMPL_PKTS 0x80 /*! Byte 10 */
#define HCI_SUP_READ_LOCAL_VER_INFO 0x08 /*! Byte 14 */
#define HCI_SUP_READ_LOCAL_SUP_FEAT 0x20 /*! Byte 14 */
#define HCI_SUP_READ_BD_ADDR 0x02 /*! Byte 15 */
#define HCI_SUP_READ_RSSI 0x20 /*! Byte 15 */
#define HCI_SUP_LE_SET_EVENT_MASK 0x01 /*! Byte 25 */
#define HCI_SUP_LE_READ_BUF_SIZE 0x02 /*! Byte 25 */
#define HCI_SUP_LE_READ_LOCAL_SUP_FEAT 0x04 /*! Byte 25 */
#define HCI_SUP_LE_SET_RAND_ADDR 0x10 /*! Byte 25 */
#define HCI_SUP_LE_SET_ADV_PARAM 0x20 /*! Byte 25 */
#define HCI_SUP_LE_READ_ADV_TX_POWER 0x40 /*! Byte 25 */
#define HCI_SUP_LE_SET_ADV_DATA 0x80 /*! Byte 25 */
#define HCI_SUP_LE_SET_SCAN_RESP_DATA 0x01 /*! Byte 26 */
#define HCI_SUP_LE_SET_ADV_ENABLE 0x02 /*! Byte 26 */
#define HCI_SUP_LE_SET_SCAN_PARAM 0x04 /*! Byte 26 */
#define HCI_SUP_LE_SET_SCAN_ENABLE 0x08 /*! Byte 26 */
#define HCI_SUP_LE_CREATE_CONN 0x10 /*! Byte 26 */
#define HCI_SUP_LE_CREATE_CONN_CANCEL 0x20 /*! Byte 26 */
#define HCI_SUP_LE_READ_WHITE_LIST_SIZE 0x40 /*! Byte 26 */
#define HCI_SUP_LE_CLEAR_WHITE_LIST 0x80 /*! Byte 26 */
#define HCI_SUP_LE_ADD_DEV_WHITE_LIST 0x01 /*! Byte 27 */
#define HCI_SUP_LE_REMOVE_DEV_WHITE_LIST 0x02 /*! Byte 27 */
#define HCI_SUP_LE_CONN_UPDATE 0x04 /*! Byte 27 */
#define HCI_SUP_LE_SET_HOST_CHAN_CLASS 0x08 /*! Byte 27 */
#define HCI_SUP_LE_READ_CHAN_MAP 0x10 /*! Byte 27 */
#define HCI_SUP_LE_READ_REMOTE_FEAT 0x20 /*! Byte 27 */
#define HCI_SUP_LE_ENCRYPT 0x40 /*! Byte 27 */
#define HCI_SUP_LE_RAND 0x80 /*! Byte 27 */
#define HCI_SUP_LE_START_ENCRYPTION 0x01 /*! Byte 28 */
#define HCI_SUP_LE_LTK_REQ_REPL 0x02 /*! Byte 28 */
#define HCI_SUP_LE_LTK_REQ_NEG_REPL 0x04 /*! Byte 28 */
#define HCI_SUP_LE_READ_SUP_STATES 0x08 /*! Byte 28 */
#define HCI_SUP_LE_RECEIVER_TEST 0x10 /*! Byte 28 */
#define HCI_SUP_LE_TRANSMITTER_TEST 0x20 /*! Byte 28 */
#define HCI_SUP_LE_TEST_END 0x40 /*! Byte 28 */
/*! Event mask */
#define HCI_EVT_MASK_DISCONNECT_CMPL 0x10 /*! Byte 0 */
#define HCI_EVT_MASK_ENC_CHANGE 0x80 /*! Byte 0 */
#define HCI_EVT_MASK_READ_REMOTE_VER_INFO_CMPL 0x08 /*! Byte 1 */
#define HCI_EVT_MASK_HW_ERROR 0x80 /*! Byte 1 */
#define HCI_EVT_MASK_DATA_BUF_OVERFLOW 0x02 /*! Byte 3 */
#define HCI_EVT_MASK_ENC_KEY_REFRESH_CMPL 0x80 /*! Byte 5 */
#define HCI_EVT_MASK_LE_META 0x20 /*! Byte 7 */
/*! LE event mask */
#define HCI_EVT_MASK_LE_CONN_CMPL_EVT 0x01 /*! Byte 0 */
#define HCI_EVT_MASK_LE_ADV_REPORT_EVT 0x02 /*! Byte 0 */
#define HCI_EVT_MASK_LE_CONN_UPDATE_CMPL_EVT 0x04 /*! Byte 0 */
#define HCI_EVT_MASK_LE_READ_REMOTE_FEAT_CMPL_EVT 0x08 /*! Byte 0 */
#define HCI_EVT_MASK_LE_LTK_REQ_EVT 0x10 /*! Byte 0 */
/*! LE supported features */
#define HCI_LE_SUP_FEAT_ENCRYPTION 0x01
/*! Advertising command parameters */
#define HCI_ADV_MIN_INTERVAL 0x0020 /*! Minimum advertising interval */
#define HCI_ADV_NONCONN_MIN_INTERVAL 0x00A0 /*! Minimum nonconnectable adv. interval */
#define HCI_ADV_MAX_INTERVAL 0x4000 /*! Maximum advertising interval */
#define HCI_ADV_TYPE_CONN_UNDIRECT 0x00 /*! Connectable undirected advertising */
#define HCI_ADV_TYPE_CONN_DIRECT 0x01 /*! Connectable directed advertising */
#define HCI_ADV_TYPE_DISC_UNDIRECT 0x02 /*! Discoverable undirected advertising */
#define HCI_ADV_TYPE_NONCONN_UNDIRECT 0x03 /*! Nonconnectable undirected advertising */
#define HCI_ADV_CHAN_37 0x01 /*! Advertising channel 37 */
#define HCI_ADV_CHAN_38 0x02 /*! Advertising channel 38 */
#define HCI_ADV_CHAN_39 0x04 /*! Advertising channel 39 */
#define HCI_ADV_FILT_NONE 0x00 /*! No scan request or connection filtering */
#define HCI_ADV_FILT_SCAN 0x01 /*! White list filters scan requests */
#define HCI_ADV_FILT_CONN 0x02 /*! White list filters connections */
#define HCI_ADV_FILT_ALL 0x03 /*! White list filters scan req. and conn. */
/*! Scan command parameters */
#define HCI_SCAN_TYPE_PASSIVE 0 /*! Passive scan */
#define HCI_SCAN_TYPE_ACTIVE 1 /*! Active scan */
#define HCI_SCAN_INTERVAL_MIN 0x0004 /*! Minimum scan interval */
#define HCI_SCAN_INTERVAL_MAX 0x4000 /*! Maximum scan interval */
#define HCI_SCAN_INTERVAL_DEFAULT 0x0010 /*! Default scan interval */
#define HCI_SCAN_WINDOW_MIN 0x0004 /*! Minimum scan window */
#define HCI_SCAN_WINDOW_MAX 0x4000 /*! Maximum scan window */
#define HCI_SCAN_WINDOW_DEFAULT 0x0010 /*! Default scan window */
/*! Connection command parameters */
#define HCI_CONN_INTERVAL_MIN 0x0006 /*! Minimum connection interval */
#define HCI_CONN_INTERVAL_MAX 0x0C80 /*! Maximum connection interval */
#define HCI_CONN_LATENCY_MAX 0x01F3 /*! Maximum connection latency */
#define HCI_SUP_TIMEOUT_MIN 0x000A /*! Minimum supervision timeout */
#define HCI_SUP_TIMEOUT_MAX 0x0C80 /*! Maximum supervision timeout */
/*! Connection event parameters */
#define HCI_ROLE_MASTER 0 /*! Role is master */
#define HCI_ROLE_SLAVE 1 /*! Role is slave */
#define HCI_CLOCK_500PPM 0x00 /*! 500 ppm clock accuracy */
#define HCI_CLOCK_250PPM 0x01 /*! 250 ppm clock accuracy */
#define HCI_CLOCK_150PPM 0x02 /*! 150 ppm clock accuracy */
#define HCI_CLOCK_100PPM 0x03 /*! 100 ppm clock accuracy */
#define HCI_CLOCK_75PPM 0x04 /*! 75 ppm clock accuracy */
#define HCI_CLOCK_50PPM 0x05 /*! 50 ppm clock accuracy */
#define HCI_CLOCK_30PPM 0x06 /*! 30 ppm clock accuracy */
#define HCI_CLOCK_20PPM 0x07 /*! 20 ppm clock accuracy */
/*! Advertising report event parameters */
#define HCI_ADV_CONN_UNDIRECT 0x00 /*! Connectable undirected advertising */
#define HCI_ADV_CONN_DIRECT 0x01 /*! Connectable directed advertising */
#define HCI_ADV_DISC_UNDIRECT 0x02 /*! Discoverable undirected advertising */
#define HCI_ADV_NONCONN_UNDIRECT 0x03 /*! Non-connectable undirected advertising */
#define HCI_ADV_SCAN_RESPONSE 0x04 /*! Scan response */
/*! Misc command parameters */
#define HCI_READ_TX_PWR_CURRENT 0 /*! Read current tx power */
#define HCI_READ_TX_PWR_MAX 1 /*! Read maximum tx power */
#define HCI_TX_PWR_MIN -30 /*! Minimum tx power dBm */
#define HCI_TX_PWR_MAX 20 /*! Maximum tx power dBm */
#define HCI_VERSION 6 /*! HCI specification version */
#define HCI_RSSI_MIN -127 /*! Minimum RSSI dBm */
#define HCI_RSSI_MAX 20 /*! Maximum RSSI dBm */
#define HCI_ADDR_TYPE_PUBLIC 0 /*! Public device address */
#define HCI_ADDR_TYPE_RANDOM 1 /*! Random device address */
#define HCI_FILT_NONE 0 /*! No white list filtering */
#define HCI_FILT_WHITE_LIST 1 /*! White list filtering */
#define HCI_ROLE_MASTER 0 /*! Role is master */
#define HCI_ROLE_SLAVE 1 /*! Role is slave */
/*! Parameter lengths */
#define HCI_EVT_MASK_LEN 8 /*! Length of event mask byte array */
#define HCI_LE_EVT_MASK_LEN 8 /*! Length of LE event mask byte array */
#define HCI_FEAT_LEN 8 /*! Length of features byte array */
#define HCI_ADV_DATA_LEN 31 /*! Length of advertising data */
#define HCI_SCAN_DATA_LEN 31 /*! Length of scan response data */
#define HCI_CHAN_MAP_LEN 5 /*! Length of channel map byte array */
#define HCI_KEY_LEN 16 /*! Length of encryption key */
#define HCI_ENCRYPT_DATA_LEN 16 /*! Length of data used in encryption */
#define HCI_RAND_LEN 8 /*! Length of random number */
#define HCI_LE_STATES_LEN 8 /*! Length of LE states byte array */
/*! Wicentric company ID */
#define HCI_ID_WICENTRIC 0x005F
#ifdef __cplusplus
};
#endif
#endif /* HCI_DEFS_H */

View File

@ -4,22 +4,19 @@
*
* \brief Interface to HCI event handler.
*
* $Date: 2012-03-29 16:24:04 -0400 (Thu, 29 Mar 2012) $
* $Date: 2012-03-29 13:24:04 -0700 (Thu, 29 Mar 2012) $
* $Revision: 287 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef HCI_HANDLER_H

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file l2c_api.h
*
*
* \brief L2CAP subsystem API.
*
* $Date: 2015-10-09 12:08:23 -0400 (Fri, 09 Oct 2015) $
* $Date: 2015-10-09 09:08:23 -0700 (Fri, 09 Oct 2015) $
* $Revision: 4164 $
*
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef L2C_API_H

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file l2c_defs.h
*
*
* \brief L2CAP constants and definitions from the Bluetooth specification.
*
* $Date: 2015-06-12 07:19:18 -0400 (Fri, 12 Jun 2015) $
* $Date: 2015-06-12 04:19:18 -0700 (Fri, 12 Jun 2015) $
* $Revision: 3061 $
*
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef L2C_DEFS_H

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file l2c_handler.h
*
*
* \brief L2CAP handler interface.
*
* $Date $
* $Revision $
*
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef L2C_HANDLER_H

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file smp_api.h
*
*
* \brief SMP subsystem API.
*
* $Date: 2015-06-12 07:19:18 -0400 (Fri, 12 Jun 2015) $
* $Date: 2015-06-12 04:19:18 -0700 (Fri, 12 Jun 2015) $
* $Revision: 3061 $
*
* Copyright (c) 2010 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef SMP_API_H

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file smp_defs.h
*
*
* \brief Security manager constants and definitions from the Bluetooth specification.
*
* $Date: 2015-10-15 13:06:43 -0400 (Thu, 15 Oct 2015) $
* $Date: 2015-10-15 10:06:43 -0700 (Thu, 15 Oct 2015) $
* $Revision: 4216 $
*
* Copyright (c) 2010 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef SMP_DEFS_H

View File

@ -4,22 +4,19 @@
*
* \brief Interface to SMP event handler.
*
* $Date: 2012-03-29 16:24:04 -0400 (Thu, 29 Mar 2012) $
* $Date: 2012-03-29 13:24:04 -0700 (Thu, 29 Mar 2012) $
* $Revision: 287 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2010 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef SMP_HANDLER_H

View File

@ -4,22 +4,19 @@
*
* \brief Bluetooth device address utilities.
*
* $Date: 2015-09-26 13:06:16 -0400 (Sat, 26 Sep 2015) $
* $Revision: 4027 $
* $Date: 2016-02-18 16:07:11 -0800 (Thu, 18 Feb 2016) $
* $Revision: 5910 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef BDA_H
@ -92,6 +89,19 @@ bool_t BdaCmp(const uint8_t *pAddr1, const uint8_t *pAddr2);
/*************************************************************************************************/
uint8_t *BdaClr(uint8_t *pDst);
/*************************************************************************************************/
/*!
* \fn BdaIsZeros
*
* \brief Check if a BD address is all zeros.
*
* \param pAddr Pointer to address.
*
* \return TRUE if address is all zeros, FALSE otherwise.
*/
/*************************************************************************************************/
bool_t BdaIsZeros(const uint8_t *pAddr);
/*************************************************************************************************/
/*!
* \fn Bda2Str

View File

@ -4,22 +4,19 @@
*
* \brief Byte stream to integer conversion macros.
*
* $Date: 2015-10-17 10:29:30 -0400 (Sat, 17 Oct 2015) $
* $Revision: 4235 $
* $Date: 2015-10-25 12:07:49 -0700 (Sun, 25 Oct 2015) $
* $Revision: 4298 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef BSTREAM_H

View File

@ -4,19 +4,16 @@
*
* \brief Utility functions.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2015 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact ARM, Ltd. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/

View File

@ -4,22 +4,19 @@
*
* \brief Assert macro.
*
* $Date: 2015-10-05 12:54:16 -0400 (Mon, 05 Oct 2015) $
* $Date: 2015-10-05 09:54:16 -0700 (Mon, 05 Oct 2015) $
* $Revision: 4112 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_ASSERT_H

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file wsf_os_int.h
*
*
* \brief Software foundation OS platform-specific interface file.
*
* $Date: 2012-10-01 16:53:07 -0400 (Mon, 01 Oct 2012) $
* $Date: 2012-10-01 13:53:07 -0700 (Mon, 01 Oct 2012) $
* $Revision: 357 $
*
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_OS_INT_H

View File

@ -4,22 +4,19 @@
*
* \brief Trace message interface.
*
* $Date: 2015-10-02 20:12:32 -0400 (Fri, 02 Oct 2015) $
* $Revision: 4099 $
* $Date: 2016-02-27 09:05:32 -0800 (Sat, 27 Feb 2016) $
* $Revision: 6074 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_TRACE_H
@ -38,6 +35,7 @@ typedef void (*WsfTokenHandler_t)(void);
void WsfTrace(const char *pStr, ...);
void WsfToken(uint32_t tok, uint32_t var);
void WsfTraceEnable(bool_t enable);
/* Token management. */
bool_t WsfTokenService(void);
@ -216,4 +214,10 @@ uint8_t WsfTokenIOWrite(uint8_t *pBuf, uint8_t len);
#define LL_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("LL", "ERR", msg, var1, var2)
#define LL_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("LL", "ERR", msg, var1, var2, var3)
#if (WSF_TRACE_ENABLED == TRUE) || (WSF_TOKEN_ENABLED == TRUE)
#define LL_TRACE_ENABLE(ena) WsfTraceEnable(ena)
#else
#define LL_TRACE_ENABLE(ena)
#endif
#endif /* WSF_TRACE_H */

View File

@ -4,22 +4,19 @@
*
* \brief Platform-independent data types.
*
* $Date: 2015-05-14 17:58:23 -0400 (Thu, 14 May 2015) $
* $Date: 2015-05-14 14:58:23 -0700 (Thu, 14 May 2015) $
* $Revision: 2837 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_TYPES_H
@ -46,21 +43,7 @@
**************************************************************************************************/
/* Integer data types */
#if ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) && \
(!defined(__ICC8051__) || (__ICC8051__ == 0)))
#include <stdint.h>
#else
#if 0
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed long int32_t;
typedef unsigned long uint32_t;
typedef unsigned long long uint64_t;
#endif
#include <stdint.h>
#endif
/* Boolean data type */
typedef uint8_t bool_t;

View File

@ -4,22 +4,19 @@
*
* \brief Buffer pool service.
*
* $Date: 2015-09-05 12:01:07 -0400 (Sat, 05 Sep 2015) $
* $Revision: 3793 $
* $Date: 2015-12-20 15:10:41 -0800 (Sun, 20 Dec 2015) $
* $Revision: 4927 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_BUF_H
@ -50,10 +47,10 @@ typedef struct
/*! Pool statistics */
typedef struct
{
uint8_t bufSize; /*!< Pool buffer size. */
uint8_t numBuf; /*!< Total number of buffers. */
uint8_t numAlloc; /*!< Number of outstanding allocations. */
uint8_t maxAlloc; /*!< High allocation watermark. */
uint16_t bufSize; /*!< Pool buffer size. */
uint8_t numBuf; /*!< Total number of buffers. */
uint8_t numAlloc; /*!< Number of outstanding allocations. */
uint8_t maxAlloc; /*!< High allocation watermark. */
} WsfBufPoolStat_t;
@ -141,6 +138,17 @@ uint8_t WsfBufGetNumAlloc(uint8_t pool);
/*************************************************************************************************/
uint8_t *WsfBufGetAllocStats(void);
/*************************************************************************************************/
/*!
* \fn WsfBufGetNumPool
*
* \brief Get number of pools.
*
* \return Number of pools.
*/
/*************************************************************************************************/
uint8_t WsfBufGetNumPool(void);
/*************************************************************************************************/
/*!
* \fn WsfBufGetPoolStats

View File

@ -4,22 +4,19 @@
*
* \brief Common math utilities.
*
* $Date: 2015-08-27 08:31:35 -0400 (Thu, 27 Aug 2015) $
* $Revision: 3731 $
* $Date: 2016-04-05 14:14:53 -0700 (Tue, 05 Apr 2016) $
* $Revision: 6646 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2013 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_MATH_H
@ -41,29 +38,149 @@ extern "C" {
/*! \brief Returns the maximum of two values. */
#define WSF_MAX(a,b) ((a) > (b) ? (a) : (b))
/*! \brief Binary divide with 1,000 divisor. */
#define WSF_MATH_DIV_10E3(n) (((n) * UINT32_C(1048)) >> 20)
/*! \brief ECC key length. */
#define WSF_MATH_ECC_KEY_LEN 32
/*! \brief Binary divide with 1,000,000 divisor. */
#define WSF_MATH_DIV_10E6(n) ((uint32_t)(((uint64_t)(n) * UINT64_C(4295)) >> 32))
/**************************************************************************************************
Data Types
**************************************************************************************************/
/*! \brief Binary divide with 10 divisor. */
#define WSF_MATH_DIV_10(n) ((uint32_t)(((uint64_t)(n) * UINT64_C(419431)) >> 22))
/*! \brief ECC service callback. */
typedef void (*WsfMathEccServiceCback_t)(uint8_t op);
/*! \brief Binary divide with 37 divisor. */
#define WSF_MATH_DIV_37(n) (((n) * UINT32_C(56680)) >> 21)
/*! \brief ECC operations. */
enum
{
WSF_MATH_ECC_OP_GENERATE_P256_KEY_PAIR, /*!< Generate P-256 key pair. */
WSF_MATH_ECC_OP_GENERATE_DH_KEY /*!< Generate Diffie-Hellman key. */
};
/*! \brief Binary modulo 37. */
#define WSF_MATH_MOD_37(n) ((n) - (WSF_MATH_DIV_37(n) * 37))
/**************************************************************************************************
Function Declarations
**************************************************************************************************/
/*************************************************************************************************/
/*!
* \fn WsfMathInit
*
* \brief Initialize math routines.
*
* \return None.
*/
/*************************************************************************************************/
void WsfMathInit(void);
/*************************************************************************************************/
/*!
* \fn WsfRandNum
*
* \brief Generate random number.
*
* \return 32-bit random number.
*/
/*************************************************************************************************/
uint32_t WsfRandNum(void);
/*************************************************************************************************/
/*!
* \fn WsfAesEcb
*
* \brief Calculate AES ECB.
*
* \param pKey Encryption key.
* \param pOut Output data.
* \param pIn Input data.
*
* \return None.
*/
/*************************************************************************************************/
void WsfAesEcb(const uint8_t *pKey, uint8_t *pOut, const uint8_t *pIn);
/*************************************************************************************************/
/*!
* \brief Set service callback for ECC generation.
*
* \param cback Callback to invoke when driver needs servicing.
*
* \return None.
*/
/*************************************************************************************************/
void WsfMathEccSetServiceCback(WsfMathEccServiceCback_t cback);
/*************************************************************************************************/
/*!
* \brief Start generating P-256 key pair.
*
* \return None.
*/
/*************************************************************************************************/
void WsfMathEccGenerateP256KeyPairStart(void);
/*************************************************************************************************/
/*!
* \brief Start generating P-256 public key with a specified private key.
*
* \param pPrivKey Private key.
*
* \return None.
*/
/*************************************************************************************************/
void WsfMathEccGenerateP256PublicKeyStart(const uint8_t *pPrivKey);
/*************************************************************************************************/
/*!
* \brief Continue generating P-256 key pair.
*
* \return TRUE if key generation complete.
*/
/*************************************************************************************************/
bool_t WsfMathEccGenerateP256KeyPairContinue(void);
/*************************************************************************************************/
/*!
* \brief Get results from generating P-256 key pair.
*
* \param pPubKey Storage for public key.
* \param pPrivKey Storage for private key.
*
* \return None.
*/
/*************************************************************************************************/
void WsfMathEccGenerateP256KeyPairComplete(uint8_t *pPubKey, uint8_t *pPrivKey);
/*************************************************************************************************/
/*!
* \brief Start generating Diffie-Hellman key.
*
* \param pPublicKey Public key.
* \param pPrivateKey Private key.
*
* \return None.
*/
/*************************************************************************************************/
void WsfMathEccGenerateDhKeyStart(const uint8_t *pPubKey, const uint8_t *pPrivKey);
/*************************************************************************************************/
/*!
* \brief Continue generating Diffie-Hellman key.
*
* \return TRUE if Diffie-Hellman key generation complete.
*/
/*************************************************************************************************/
bool_t WsfMathEccGenerateDhKeyContinue(void);
/*************************************************************************************************/
/*!
* \brief Get results from generating Diffie-Hellman key.
*
* \param pDhKey Storage for Diffie-Hellman key.
*
* \return None.
*/
/*************************************************************************************************/
void WsfMathEccGenerateDhKeyComplete(uint8_t *pDhKey);
#ifdef __cplusplus
};
#endif

View File

@ -4,22 +4,19 @@
*
* \brief Message passing service.
*
* $Date: 2013-07-02 18:08:09 -0400 (Tue, 02 Jul 2013) $
* $Date: 2013-07-02 15:08:09 -0700 (Tue, 02 Jul 2013) $
* $Revision: 779 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_MSG_H

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file wsf_os.h
*
*
* \brief Software foundation OS API.
*
* $Date: 2014-08-08 09:30:50 -0400 (Fri, 08 Aug 2014) $
* $Date: 2014-08-08 06:30:50 -0700 (Fri, 08 Aug 2014) $
* $Revision: 1725 $
*
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_OS_H

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file wsf_queue.h
*
*
* \brief General purpose queue service.
*
* $Date: 2011-10-15 00:35:03 -0400 (Sat, 15 Oct 2011) $
* $Date: 2011-10-14 21:35:03 -0700 (Fri, 14 Oct 2011) $
* $Revision: 191 $
*
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_QUEUE_H

View File

@ -1,25 +1,22 @@
/*************************************************************************************************/
/*!
* \file wsf_sec.h
*
*
* \brief AES and random number security service API.
*
* $Date: 2015-10-15 14:57:57 -0400 (Thu, 15 Oct 2015) $
* $Date: 2015-10-15 11:57:57 -0700 (Thu, 15 Oct 2015) $
* $Revision: 4218 $
*
* Copyright (c) 2010 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_SEC_H

View File

@ -4,22 +4,19 @@
*
* \brief Internal security service structures.
*
* $Date: 2015-09-05 12:01:07 -0400 (Sat, 05 Sep 2015) $
* $Revision: 3793 $
* $Date: 2015-12-10 09:40:54 -0800 (Thu, 10 Dec 2015) $
* $Revision: 4754 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2010 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_SEC_INT_H
@ -45,6 +42,11 @@ extern "C" {
/*! Multiple of HCI_RAND_LEN to keep in the wsfSecCb_t rand data buffer */
#define WSF_HCI_RAND_MULT (32 / HCI_RAND_LEN)
/*! Compile time ECC configuration */
#define WSF_SEC_ECC_CFG_DEBUG 0
#define WSF_SEC_ECC_CFG_UECC 1
#define WSF_SEC_ECC_CFG_HCI 2
/**************************************************************************************************
Data Types
**************************************************************************************************/

View File

@ -4,22 +4,19 @@
*
* \brief Timer service.
*
* $Date: 2015-09-11 17:14:44 -0400 (Fri, 11 Sep 2015) $
* $Date: 2015-09-11 14:14:44 -0700 (Fri, 11 Sep 2015) $
* $Revision: 3856 $
*
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
* Copyright (c) 2009 Wicentric, Inc., all rights reserved.
* Wicentric confidential and proprietary.
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_TIMER_H

View File

@ -4,22 +4,16 @@
*
* \brief Mbed OS specific callback.
*
* $Date: 2016-06-24 12:54:16 -0400 (Mon, 05 Oct 2015) $
* $Revision: 1 $
* Copyright (c) 2016 ARM, Ltd., all rights reserved.
* ARM confidential and proprietary.
*
* Copyright (c) 2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
* IMPORTANT. Your use of this file is governed by a Software License Agreement
* ("Agreement") that must be accepted in order to download or otherwise receive a
* copy of this file. You may not use or copy this file for any purpose other than
* as described in the Agreement. If you do not agree to all of the terms of the
* Agreement do not use this file and delete all copies in your possession or control;
* if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
* to any use, copying or further distribution of this software.
*/
/*************************************************************************************************/
#ifndef WSF_MBED_OS_H