add "LE Device Address" 0x1B to advertising data types

Fork of BLE_API by Bluetooth Low Energy

Committer:
rgrover1
Date:
Fri Jun 19 15:53:28 2015 +0100
Revision:
710:b2e1a2660ec2
Parent:
public/GattCallbackParamTypes.h@524:6e97ab392e2a
Synchronized with git rev 7e8977d8
Author: Rohit Grover
Release 0.3.8
=============

This is a minor set of enhancements before we yotta-ize BLE_API.

Enhancements
~~~~~~~~~~~~

* Minor rework for class UUID; added a default and copy constructor; and a != operator.

* Added copy constructor and accessors for GapAdvertisingParams.

* GapScanningParams:: remove unnecessary checks for SCAN_TIMEOUT_MAX.

* Add a comment header block to explain why BLEDevice::init() may not be safe
to call from global static context.

* Introduce GattAttribute::INVALID_HANDLE.

* Replace some deprecated uses of Gap::address_t with Gap::Address_t.

Bugfixes
~~~~~~~~

* None.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 524:6e97ab392e2a 1 /* mbed Microcontroller Library
rgrover1 524:6e97ab392e2a 2 * Copyright (c) 2006-2013 ARM Limited
rgrover1 524:6e97ab392e2a 3 *
rgrover1 524:6e97ab392e2a 4 * Licensed under the Apache License, Version 2.0 (the "License");
rgrover1 524:6e97ab392e2a 5 * you may not use this file except in compliance with the License.
rgrover1 524:6e97ab392e2a 6 * You may obtain a copy of the License at
rgrover1 524:6e97ab392e2a 7 *
rgrover1 524:6e97ab392e2a 8 * http://www.apache.org/licenses/LICENSE-2.0
rgrover1 524:6e97ab392e2a 9 *
rgrover1 524:6e97ab392e2a 10 * Unless required by applicable law or agreed to in writing, software
rgrover1 524:6e97ab392e2a 11 * distributed under the License is distributed on an "AS IS" BASIS,
rgrover1 524:6e97ab392e2a 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rgrover1 524:6e97ab392e2a 13 * See the License for the specific language governing permissions and
rgrover1 524:6e97ab392e2a 14 * limitations under the License.
rgrover1 524:6e97ab392e2a 15 */
rgrover1 524:6e97ab392e2a 16
rgrover1 524:6e97ab392e2a 17 #ifndef __GATT_CALLBACK_PARAM_TYPES_H__
rgrover1 524:6e97ab392e2a 18 #define __GATT_CALLBACK_PARAM_TYPES_H__
rgrover1 524:6e97ab392e2a 19
rgrover1 524:6e97ab392e2a 20 struct GattWriteCallbackParams {
rgrover1 524:6e97ab392e2a 21 enum WriteOp_t {
rgrover1 524:6e97ab392e2a 22 OP_INVALID = 0x00, /**< Invalid Operation. */
rgrover1 524:6e97ab392e2a 23 OP_WRITE_REQ = 0x01, /**< Write Request. */
rgrover1 524:6e97ab392e2a 24 OP_WRITE_CMD = 0x02, /**< Write Command. */
rgrover1 524:6e97ab392e2a 25 OP_SIGN_WRITE_CMD = 0x03, /**< Signed Write Command. */
rgrover1 524:6e97ab392e2a 26 OP_PREP_WRITE_REQ = 0x04, /**< Prepare Write Request. */
rgrover1 524:6e97ab392e2a 27 OP_EXEC_WRITE_REQ_CANCEL = 0x05, /**< Execute Write Request: Cancel all prepared writes. */
rgrover1 524:6e97ab392e2a 28 OP_EXEC_WRITE_REQ_NOW = 0x06, /**< Execute Write Request: Immediately execute all prepared writes. */
rgrover1 524:6e97ab392e2a 29 };
rgrover1 524:6e97ab392e2a 30
rgrover1 524:6e97ab392e2a 31 GattAttribute::Handle_t handle;
rgrover1 524:6e97ab392e2a 32 WriteOp_t writeOp; /**< Type of write operation, */
rgrover1 524:6e97ab392e2a 33 uint16_t offset; /**< Offset for the write operation. */
rgrover1 524:6e97ab392e2a 34 uint16_t len;
rgrover1 524:6e97ab392e2a 35 const uint8_t *data; /* @note: data might not persist beyond the callback; make a local copy if needed. */
rgrover1 524:6e97ab392e2a 36 };
rgrover1 524:6e97ab392e2a 37
rgrover1 524:6e97ab392e2a 38 struct GattReadCallbackParams {
rgrover1 524:6e97ab392e2a 39 GattAttribute::Handle_t handle;
rgrover1 524:6e97ab392e2a 40 uint16_t offset; /**< Offset for the read operation. */
rgrover1 524:6e97ab392e2a 41 uint16_t len;
rgrover1 524:6e97ab392e2a 42 const uint8_t *data; /* @note: data might not persist beyond the callback; make a local copy if needed. */
rgrover1 524:6e97ab392e2a 43 };
rgrover1 524:6e97ab392e2a 44
rgrover1 524:6e97ab392e2a 45 enum GattAuthCallbackReply_t {
rgrover1 524:6e97ab392e2a 46 AUTH_CALLBACK_REPLY_SUCCESS = 0x00, /**< Success. */
rgrover1 524:6e97ab392e2a 47 AUTH_CALLBACK_REPLY_ATTERR_INVALID_HANDLE = 0x0101, /**< ATT Error: Invalid Attribute Handle. */
rgrover1 524:6e97ab392e2a 48 AUTH_CALLBACK_REPLY_ATTERR_READ_NOT_PERMITTED = 0x0102, /**< ATT Error: Read not permitted. */
rgrover1 524:6e97ab392e2a 49 AUTH_CALLBACK_REPLY_ATTERR_WRITE_NOT_PERMITTED = 0x0103, /**< ATT Error: Write not permitted. */
rgrover1 524:6e97ab392e2a 50 AUTH_CALLBACK_REPLY_ATTERR_INSUF_AUTHENTICATION = 0x0105, /**< ATT Error: Authenticated link required. */
rgrover1 524:6e97ab392e2a 51 AUTH_CALLBACK_REPLY_ATTERR_INVALID_OFFSET = 0x0107, /**< ATT Error: Offset specified was past the end of the attribute. */
rgrover1 524:6e97ab392e2a 52 AUTH_CALLBACK_REPLY_ATTERR_INSUF_AUTHORIZATION = 0x0108, /**< ATT Error: Used in ATT as Insufficient Authorisation. */
rgrover1 524:6e97ab392e2a 53 AUTH_CALLBACK_REPLY_ATTERR_PREPARE_QUEUE_FULL = 0x0109, /**< ATT Error: Used in ATT as Prepare Queue Full. */
rgrover1 524:6e97ab392e2a 54 AUTH_CALLBACK_REPLY_ATTERR_ATTRIBUTE_NOT_FOUND = 0x010A, /**< ATT Error: Used in ATT as Attribute not found. */
rgrover1 524:6e97ab392e2a 55 AUTH_CALLBACK_REPLY_ATTERR_ATTRIBUTE_NOT_LONG = 0x010B, /**< ATT Error: Attribute cannot be read or written using read/write blob requests. */
rgrover1 524:6e97ab392e2a 56 AUTH_CALLBACK_REPLY_ATTERR_INVALID_ATT_VAL_LENGTH = 0x010D, /**< ATT Error: Invalid value size. */
rgrover1 524:6e97ab392e2a 57 AUTH_CALLBACK_REPLY_ATTERR_INSUF_RESOURCES = 0x0111, /**< ATT Error: Encrypted link required. */
rgrover1 524:6e97ab392e2a 58 };
rgrover1 524:6e97ab392e2a 59
rgrover1 524:6e97ab392e2a 60 struct GattWriteAuthCallbackParams {
rgrover1 524:6e97ab392e2a 61 GattAttribute::Handle_t handle;
rgrover1 524:6e97ab392e2a 62 uint16_t offset; /**< Offset for the write operation. */
rgrover1 524:6e97ab392e2a 63 uint16_t len; /**< Length of the incoming data. */
rgrover1 524:6e97ab392e2a 64 const uint8_t *data; /**< Incoming data, variable length. */
rgrover1 524:6e97ab392e2a 65 GattAuthCallbackReply_t authorizationReply; /* This is the out parameter which needs to be set to true by the callback if the
rgrover1 524:6e97ab392e2a 66 * request is to proceed; false otherwise. */
rgrover1 524:6e97ab392e2a 67 };
rgrover1 524:6e97ab392e2a 68
rgrover1 524:6e97ab392e2a 69 struct GattReadAuthCallbackParams {
rgrover1 524:6e97ab392e2a 70 GattAttribute::Handle_t handle;
rgrover1 524:6e97ab392e2a 71 uint16_t offset; /**< Offset for the read operation. */
rgrover1 524:6e97ab392e2a 72 uint16_t len; /**< Optional: new length of the outgoing data. */
rgrover1 524:6e97ab392e2a 73 uint8_t *data; /**< Optional: new outgoing data. Leave at NULL if data is unchanged. */
rgrover1 524:6e97ab392e2a 74 GattAuthCallbackReply_t authorizationReply; /* This is the out parameter which needs to be set to true by the callback if the
rgrover1 524:6e97ab392e2a 75 * request is to proceed; false otherwise. */
rgrover1 524:6e97ab392e2a 76 };
rgrover1 524:6e97ab392e2a 77
rgrover1 524:6e97ab392e2a 78 #endif /*__GATT_CALLBACK_PARAM_TYPES_H__*/