Maxim Integrated Bluetooth LE Library

Dependents:   BLE_Thermometer MAXWSNENV_demo

Committer:
enginerd
Date:
Thu Mar 03 14:13:21 2016 +0000
Revision:
0:b562096246b3
Initial commit of Maxim Integrated Bluetooth LE Library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
enginerd 0:b562096246b3 1 /*************************************************************************************************/
enginerd 0:b562096246b3 2 /*!
enginerd 0:b562096246b3 3 * \file l2c_defs.h
enginerd 0:b562096246b3 4 *
enginerd 0:b562096246b3 5 * \brief L2CAP constants and definitions from the Bluetooth specification.
enginerd 0:b562096246b3 6 *
enginerd 0:b562096246b3 7 * $Date: 2011-10-14 21:35:03 -0700 (Fri, 14 Oct 2011) $
enginerd 0:b562096246b3 8 * $Revision: 191 $
enginerd 0:b562096246b3 9 *
enginerd 0:b562096246b3 10 * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
enginerd 0:b562096246b3 11 *
enginerd 0:b562096246b3 12 * SPDX-License-Identifier: LicenseRef-PBL
enginerd 0:b562096246b3 13 *
enginerd 0:b562096246b3 14 * Licensed under the Permissive Binary License, Version 1.0 (the "License"); you may not use
enginerd 0:b562096246b3 15 * this file except in compliance with the License. You may obtain a copy of the License at
enginerd 0:b562096246b3 16 *
enginerd 0:b562096246b3 17 * https://www.mbed.com/licenses/PBL-1.0
enginerd 0:b562096246b3 18 *
enginerd 0:b562096246b3 19 * See the License for the specific language governing permissions and limitations under the License.
enginerd 0:b562096246b3 20 */
enginerd 0:b562096246b3 21 /*************************************************************************************************/
enginerd 0:b562096246b3 22 #ifndef L2C_DEFS_H
enginerd 0:b562096246b3 23 #define L2C_DEFS_H
enginerd 0:b562096246b3 24
enginerd 0:b562096246b3 25 #ifdef __cplusplus
enginerd 0:b562096246b3 26 extern "C" {
enginerd 0:b562096246b3 27 #endif
enginerd 0:b562096246b3 28
enginerd 0:b562096246b3 29 /**************************************************************************************************
enginerd 0:b562096246b3 30 Macros
enginerd 0:b562096246b3 31 **************************************************************************************************/
enginerd 0:b562096246b3 32
enginerd 0:b562096246b3 33 /*! Packet definitions */
enginerd 0:b562096246b3 34 #define L2C_HDR_LEN 4 /*! L2CAP packet header length */
enginerd 0:b562096246b3 35 #define L2C_MIN_MTU 23 /*! Minimum packet payload MTU for LE */
enginerd 0:b562096246b3 36 #define L2C_SIG_HDR_LEN 4 /*! L2CAP signaling command header length */
enginerd 0:b562096246b3 37
enginerd 0:b562096246b3 38 /*! Start of L2CAP payload in an HCI ACL packet buffer */
enginerd 0:b562096246b3 39 #define L2C_PAYLOAD_START (HCI_ACL_HDR_LEN + L2C_HDR_LEN)
enginerd 0:b562096246b3 40
enginerd 0:b562096246b3 41 /*! L2CAP signaling packet base length, including HCI header */
enginerd 0:b562096246b3 42 #define L2C_SIG_PKT_BASE_LEN (HCI_ACL_HDR_LEN + L2C_HDR_LEN + L2C_SIG_HDR_LEN)
enginerd 0:b562096246b3 43
enginerd 0:b562096246b3 44 /*! Signaling packet parameter lengths */
enginerd 0:b562096246b3 45 #define L2C_SIG_CONN_UPDATE_REQ_LEN 8
enginerd 0:b562096246b3 46 #define L2C_SIG_CONN_UPDATE_RSP_LEN 2
enginerd 0:b562096246b3 47 #define L2C_SIG_CMD_REJ_LEN 2
enginerd 0:b562096246b3 48
enginerd 0:b562096246b3 49 /*! Connection identifiers */
enginerd 0:b562096246b3 50 #define L2C_CID_ATT 0x0004 /*! CID for attribute protocol */
enginerd 0:b562096246b3 51 #define L2C_CID_LE_SIGNALING 0x0005 /*! CID for LE signaling */
enginerd 0:b562096246b3 52 #define L2C_CID_SMP 0x0006 /*! CID for security manager protocol */
enginerd 0:b562096246b3 53
enginerd 0:b562096246b3 54 /*! Signaling codes */
enginerd 0:b562096246b3 55 #define L2C_SIG_CMD_REJ 0x01 /*! Comand reject */
enginerd 0:b562096246b3 56 #define L2C_SIG_CONN_UPDATE_REQ 0x12 /*! Connection parameter update request */
enginerd 0:b562096246b3 57 #define L2C_SIG_CONN_UPDATE_RSP 0x13 /*! Connection parameter update response */
enginerd 0:b562096246b3 58
enginerd 0:b562096246b3 59 /*! Signaling response code flag */
enginerd 0:b562096246b3 60 #define L2C_SIG_RSP_FLAG 0x01
enginerd 0:b562096246b3 61
enginerd 0:b562096246b3 62 /*! Command reject reason codes */
enginerd 0:b562096246b3 63 #define L2C_REJ_NOT_UNDERSTOOD 0x0000 /*! Command not understood */
enginerd 0:b562096246b3 64 #define L2C_REJ_MTU_EXCEEDED 0x0001 /*! Signaling MTU exceeded */
enginerd 0:b562096246b3 65 #define L2C_REJ_INVALID_CID 0x0002 /*! Invalid CID in request */
enginerd 0:b562096246b3 66
enginerd 0:b562096246b3 67 /*! Connection parameter update result */
enginerd 0:b562096246b3 68 #define L2C_CONN_PARAM_ACCEPTED 0x0000 /*! Connection parameters accepted */
enginerd 0:b562096246b3 69 #define L2C_CONN_PARAM_REJECTED 0x0001 /*! Connection parameters rejected */
enginerd 0:b562096246b3 70
enginerd 0:b562096246b3 71
enginerd 0:b562096246b3 72 #ifdef __cplusplus
enginerd 0:b562096246b3 73 };
enginerd 0:b562096246b3 74 #endif
enginerd 0:b562096246b3 75
enginerd 0:b562096246b3 76 #endif /* L2C_DEFS_H */